From 55c9a186998fba7073910b7724b58ba3f2b12c3d Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Fri, 1 Nov 2024 14:36:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=BE=E9=97=AE=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=20mat=5Fsn=EF=BC=9B=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E9=9B=86=E4=BD=BF=E7=94=A8=20Drawer=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/stores/AuthStore.js | 1 + src/views/DesktopApp.jsx | 63 ++++++++++++++++++------------ src/views/accounts/Profile.jsx | 26 ++++++------ src/views/accounts/SnippetList.jsx | 8 ++-- 5 files changed, 60 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index a5635bb..b09aa7f 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,4 @@ npm version patch --no-git-tag-version ## 本机测试账号 GLOBAL_SALES_LOGIN_USER -{"userId":"383","userIdStr":"383,609","emailList":[{"opi_sn":383,"email":"lyj@asiahighlights.com","default":false,"backup":false},{"opi_sn":383,"email":"lyj@chinahighlights.com","default":false,"backup":true},{"opi_sn":383,"email":"lyj@hainatravel.com","default":true,"backup":false}],"username":"廖一军","avatarUrl":"https://static-legacy.dingtalk.com/media/lALPBDDrhXr716HNAoDNAoA_640_640.png","mobile":"+86-18777396951","email":"lyj@hainatravel.com","whatsAppBusiness":"8617458471254","openId":"iioljiPmZ4RPoOYpkFiSn7IKAiEiE","accountList":[{"OPI_SN":383,"OPI_Code":"LYJ","OPI_NameCN":"廖一军","OPI_DEI_SN":7,"OPI_NameEN":"Jimmy Liow"},{"OPI_SN":609,"OPI_Code":"LYJAH","OPI_NameCN":"廖一军(ah)","OPI_DEI_SN":28,"OPI_NameEN":"Jimmy Liow"}]} \ No newline at end of file +{"userId":"383","userIdStr":"383,609","emailList":[{"opi_sn":383,"mat_sn":760,"email":"lyj@asiahighlights.com","default":false,"backup":false},{"opi_sn":383,"mat_sn":759,"email":"lyj@chinahighlights.com","default":false,"backup":true},{"opi_sn":383,"mat_sn":758,"email":"lyj@hainatravel.com","default":true,"backup":false}],"username":"廖一军","avatarUrl":"https://static-legacy.dingtalk.com/media/lALPBDDrhXr716HNAoDNAoA_640_640.png","mobile":"+86-18777396951","email":"lyj@hainatravel.com","whatsAppBusiness":"8617458471254","openId":"iioljiPmZ4RPoOYpkFiSn7IKAiEiE","accountList":[{"OPI_SN":383,"OPI_Code":"LYJ","OPI_NameCN":"廖一军","OPI_DEI_SN":7,"OPI_NameEN":"Jimmy Liow"},{"OPI_SN":609,"OPI_Code":"LYJAH","OPI_NameCN":"廖一军(ah)","OPI_DEI_SN":28,"OPI_NameEN":"Jimmy Liow"}]} diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index cde12ab..c93f20a 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -66,6 +66,7 @@ const useAuthStore = create((set, get) => ({ emailList: json.result?.emaillist.map(item => { return { opi_sn: item.opi_sn, + mat_sn: item.mat_sn, email: item.email, default: item.Isdefaultemail == 1, backup: item.Isbakemail == 1, diff --git a/src/views/DesktopApp.jsx b/src/views/DesktopApp.jsx index dfb8203..9bb5774 100644 --- a/src/views/DesktopApp.jsx +++ b/src/views/DesktopApp.jsx @@ -13,6 +13,7 @@ import { Typography, theme, Badge, + Drawer, } from 'antd' import 'dayjs/locale/zh-cn' import { useEffect, useState } from 'react' @@ -24,6 +25,8 @@ import 'react-chat-elements/dist/main.css' import ReloadPrompt from './ReloadPrompt' import ClearCache from './ClearCache' +import SnippetList from './accounts/SnippetList' + import { BUILD_VERSION, BUILD_DATE } from '@/config' const { Header, Footer, Content } = Layout @@ -37,6 +40,14 @@ function DesktopApp() { const totalNotify = useConversationStore((state) => state.totalNotify) + const [drawerOpen, setDrawerOpen] = useState(false) + + const onClick = ({ key }) => { + if (key === 'snippet-list') { + setDrawerOpen(true) + } + } + let defaultPath = '/order/follow' if (href !== '/') { @@ -78,35 +89,42 @@ function DesktopApp() { return (
- - - - App logo + }}> + setDrawerOpen(false)} + open={drawerOpen}> + + + + + + App logo 销售平台 订单跟踪, + label: 订单跟踪, }, { key: '/order/chat', label: ( - + 在线聊天 0 ? totalNotify : undefined} @@ -119,34 +137,33 @@ function DesktopApp() { }, { key: '/callcenter/call', - label: 语音通话, + label: 语音通话, }, { key: '/chat/history', - label: 聊天记录, + label: 聊天记录, }, ]} /> + }}> 个人资料, + label: 个人资料, key: 'profile', }, { - label: 图文集管理, + label: '图文集管理', key: 'snippet-list', }, { type: 'divider' }, @@ -155,17 +172,16 @@ function DesktopApp() { { label: , key: 'clearcache' }, { type: 'divider' }, { - label: 退出, + label: 退出, key: 'logout', }, ], + onClick, }} - trigger={['click']} - > + trigger={['click']}> e.preventDefault()} - style={{ color: colorPrimary }} - > + style={{ color: colorPrimary }}> {loginUser?.username?.substring(1)} @@ -185,8 +201,7 @@ function DesktopApp() { margin: 0, minHeight: 280, background: colorBgContainer, - }} - > + }}> diff --git a/src/views/accounts/Profile.jsx b/src/views/accounts/Profile.jsx index 5244f98..7c2a116 100644 --- a/src/views/accounts/Profile.jsx +++ b/src/views/accounts/Profile.jsx @@ -8,7 +8,7 @@ import { Tag, Divider, List, - Result, + Alert, Button, Flex, Select, @@ -158,13 +158,17 @@ function Profile() { header={
邮箱
} dataSource={loginUser.emailList} renderItem={(item) => { - const isDefault = item.default ? 默认 : null - const isBackup = item.backup ? 备用 : null + const isDefault = item.default ? ( + 默认 + ) : null + const isBackup = item.backup ? 备用 : null return ( - {item.email} {isDefault}{isBackup} + + {item.email} {isDefault} + {isBackup} + ) - } - } + }} /> @@ -183,16 +187,16 @@ function Profile() { - + - WhatsApp:8618754124786 - - + + + diff --git a/src/views/accounts/SnippetList.jsx b/src/views/accounts/SnippetList.jsx index 31bb53b..aac0eef 100644 --- a/src/views/accounts/SnippetList.jsx +++ b/src/views/accounts/SnippetList.jsx @@ -142,10 +142,10 @@ function SnippetList() {