feat: 邮箱地址切换; 默认值

2.0/email-builder
Lei OT 11 months ago
parent 8eab29e879
commit d5e4c7ff99

@ -8,7 +8,7 @@ import useAuthStore from '@/stores/AuthStore';
import useConversationStore from '@/stores/ConversationStore';
import { useOrderStore, } from "@/stores/OrderStore";
const EmailComposer = ({ ...props }) => {
const EmailSwitcher = ({ ...props }) => {
const [mobile] = useStyleStore((state) => [state.mobile]);
const {userId, username, emailList} = useAuthStore((state) => state.loginUser);
@ -29,7 +29,9 @@ const EmailComposer = ({ ...props }) => {
const find =
emailListOption?.find((ele) => ele.opi_sn === order_opi && ele.default === true) ||
emailListOption?.find((ele) => ele.opi_sn === order_opi && ele.backup === true) ||
emailListOption?.find((ele) => ele.opi_sn === order_opi)
emailListOption?.find((ele) => ele.opi_sn === order_opi) ||
emailListOption?.find((ele) => ele.default === true) ||
emailListOption?.find((ele) => ele.backup === true)
setPickEmail(find)
return () => {}
}, [orderDetail])
@ -81,4 +83,4 @@ const EmailComposer = ({ ...props }) => {
</Flex>
);
};
export default EmailComposer;
export default EmailSwitcher;

@ -2,7 +2,7 @@ import { Children, createContext, useEffect, useState } from 'react';
import { Dropdown, Space, Tabs } from 'antd';
import { MailFilled, MailOutlined, WhatsAppOutlined, DownOutlined } from '@ant-design/icons';
import InputComposer from './Input/InputComposer';
import EmailComposer from './Input/EmailChannelTab';
import EmailSwitcher from './Input/EmailSwitcher';
import { WABIcon } from '@/components/Icons';
import useConversationStore from '@/stores/ConversationStore';
import { useShallow } from 'zustand/react/shallow';
@ -69,7 +69,7 @@ const ReplyWrapper = () => {
const replyTypes = [
// { key: 'waba', label: mobile ? '' : (<WABASwitcher />), icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
{ key: 'waba', label: mobile ? '' : 'WA商业号-Global Highlights', icon: <WABIcon />, children: <InputComposer channel={'waba'} /> }, // todo:
{ key: 'email', label: mobile ? '' : 'Email', icon: <MailOutlined className='text-indigo-500' />, children: <EmailComposer /> },
{ key: 'email', label: mobile ? '' : 'Email', icon: <MailOutlined className='text-indigo-500' />, children: <EmailSwitcher /> },
// { key: 'whatsapp', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <InputComposer channel={'whatsapp'} /> },
{ key: 'wa', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <div className='p-2 py-4 text-center text-whatsapp bg-gray-200 rounded rounded-b-none border-gray-300 border-solid border border-b-0 border-x-0'>敬请期待</div> },
];

Loading…
Cancel
Save