feat: 增加获取顾问主要邮箱;增加立即收件按钮;修改商业号、邮件输入框;生成支付页面使用主要邮箱;

2.0/email-builder
Jimmy Liow 11 months ago
parent 15bbe0024f
commit 59d73f69b8

@ -63,7 +63,7 @@ export const getEmailFetchAction = async (param) => {
const { opi_sn, mat_sn } = param
const { result } = await fetchJSON(`${EMAIL_HOST}/email_fetch`, {
opi_sn,
mat_sn,
mat_sn, // TODO 废弃,后端自己查询
// 以下是废弃的参数
externalid: 0,
actionid: 0,

@ -91,6 +91,28 @@ const useAuthStore = create(devtools((set, get) => ({
}
},
getPrimaryEmail: () => {
const { loginUser } = get()
const defaultList = loginUser.emailList.filter(email => {
return email.default
})
if (defaultList.length > 0) {
return defaultList[0].email
} else {
const backupList = loginUser.emailList.filter(email => {
return email.backup
})
if (backupList.length > 0) {
return backupList[0].email
} else if (loginUser.emailList.length > 0) {
return loginUser.emailList[0].email
}
}
},
setLoginStatus: (code) => {
set(() => ({
loginStatus: code,

@ -11,7 +11,7 @@ import {
FloatButton,
theme,
} from 'antd'
import { BugOutlined } from '@ant-design/icons'
import { BugOutlined, MailOutlined } from '@ant-design/icons'
import zhLocale from 'antd/locale/zh_CN'
import 'dayjs/locale/zh-cn'
import { useEffect } from 'react'
@ -99,7 +99,8 @@ function AuthApp() {
insetInlineEnd: 94,
}}
>
<FloatButton icon={<BugOutlined />} onClick={() => uploadLog()} />
<FloatButton icon={<MailOutlined />} tooltip={<div>立即收件</div>} onClick={() => console.info('立即收件')} />
<FloatButton icon={<BugOutlined />} tooltip={<div>上传日志给研发部</div>} onClick={() => uploadLog()} />
<FloatButton.BackTop />
</FloatButton.Group>
{contextHolder}

@ -40,6 +40,7 @@ const EmailFetch = ({ ...props }) => {
const [fetchingText, setFetchingText] = useState('收邮件')
const handleGetEmail = async () => {
setEmailLoading(true)
// TODO SN
const ret = await getAllEmailFetchAction(emailList)
// setFetchingText('...');
setEmailLoading(false)

@ -260,7 +260,9 @@ const Conversations = () => {
// addonBefore={<FilterOutlined />}
// enterButton={'Filter'}
/>
{/* TODO 邮件接收放到右下角,和小虫子一起 */}
<EmailFetch />
{/* TODO 这个在完成搜索历史会话后去掉 */}
<Tooltip key={'conversation-list'} title={activeList ? '隐藏会话' : '活跃会话'}>
<Button onClick={toggleClosedConversationsList} icon={activeList ? <HistoryOutlined className='text-neutral-500' /> : <FireOutlined className=' text-orange-500' />} type='text' />
</Tooltip>

@ -97,7 +97,7 @@ export const ConversationItemFormModal = ({ open, onCreate, onCancel, initialVal
wa_id: _initialValues?.whatsapp_phone_number || _initialValues?.wa_id || '',
name: _initialValues?.whatsapp_name || _initialValues?.name || '',
remark: _initialValues?.conversation_memo || '',
// TODO:
// TODO
email: _initialValues?.channels?.email || '',
is_new: _initialValues?.is_new ?? true,
});

@ -72,10 +72,11 @@ const ReplyWrapper = () => {
const replyTypes = [
// { key: 'waba', label: mobile ? '' : (<WABASwitcher />), icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
{ key: 'waba', label: mobile ? '' : 'WA商业号', icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
{ key: 'email', label: mobile ? '' : 'Email', icon: <MailOutlined className='text-indigo-500' />, children: <EmailSwitcher /> },
{ key: 'waba', label: mobile ? '' : '商业号', icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
{ key: 'email', label: mobile ? '' : '邮件', 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> },
{ 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> },
// TODO WA
];
return (

@ -15,12 +15,17 @@ function GeneratePayment() {
const [searchform] = Form.useForm()
const [getPrimaryEmail] = useAuthStore(s => [s.getPrimaryEmail])
const [isHtmlLoading, setHtmlLoading] = useState(false)
const handleSearchFinish = (values) => {
}
useEffect(() => {}, [])
useEffect(() => {
const primaryEmail = getPrimaryEmail()
console.info('primaryEmail: %o', primaryEmail)
}, [])
return (
<>
@ -34,7 +39,7 @@ function GeneratePayment() {
form={searchform}
onFinish={handleSearchFinish}
initialValues={{
notifyEmail: 'lyj@chinahighlights.com',
notifyEmail: getPrimaryEmail(),
description: 'Tracking Code: Travel Advisor: Content:',
orderNumber: 'lyj202411141004001',
langauge: '英语',

Loading…
Cancel
Save