|
|
|
@ -1,33 +1,10 @@
|
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
|
import {
|
|
|
|
|
Row,
|
|
|
|
|
Col,
|
|
|
|
|
Space,
|
|
|
|
|
Descriptions,
|
|
|
|
|
Avatar,
|
|
|
|
|
Tag,
|
|
|
|
|
Divider,
|
|
|
|
|
List,
|
|
|
|
|
Alert,
|
|
|
|
|
Button,
|
|
|
|
|
Flex,
|
|
|
|
|
Select,
|
|
|
|
|
Spin,
|
|
|
|
|
Form,
|
|
|
|
|
Typography,
|
|
|
|
|
QRCode,
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import {
|
|
|
|
|
UserOutlined,
|
|
|
|
|
InfoCircleOutlined,
|
|
|
|
|
CloseCircleFilled,
|
|
|
|
|
ReloadOutlined,
|
|
|
|
|
CheckCircleFilled,
|
|
|
|
|
} from '@ant-design/icons'
|
|
|
|
|
import { Row, Col, Space, Descriptions, Avatar, Tag, Divider, List, Alert, Button, Flex, Select, Spin, Form, Typography, QRCode, Tooltip } from 'antd'
|
|
|
|
|
import { UserOutlined, InfoCircleOutlined, CloseCircleFilled, ReloadOutlined, CheckCircleFilled } from '@ant-design/icons'
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
|
|
|
|
|
function Profile() {
|
|
|
|
|
const loginUser = useAuthStore((state) => state.loginUser)
|
|
|
|
|
const [loginUser, setWhatsAppBusiness] = useAuthStore((state) => [state.loginUser, state.setWhatsAppBusiness])
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
console.info(loginUser)
|
|
|
|
@ -41,12 +18,12 @@ function Profile() {
|
|
|
|
|
case 'expired':
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<CloseCircleFilled
|
|
|
|
|
<CheckCircleFilled
|
|
|
|
|
style={{
|
|
|
|
|
color: 'red',
|
|
|
|
|
color: '#52c41a',
|
|
|
|
|
}}
|
|
|
|
|
/>{' '}
|
|
|
|
|
{info.locale?.expired}
|
|
|
|
|
8618754124786 已登录
|
|
|
|
|
<p>
|
|
|
|
|
<Button type='link' onClick={info.onRefresh}>
|
|
|
|
|
<ReloadOutlined /> {info.locale?.refresh}
|
|
|
|
@ -84,35 +61,34 @@ function Profile() {
|
|
|
|
|
<Descriptions title='个人资料' layout='vertical' column={1}>
|
|
|
|
|
<Descriptions.Item label='名字'>
|
|
|
|
|
<Space size='middle'>
|
|
|
|
|
<Avatar src={loginUser.avatarUrl}>
|
|
|
|
|
{loginUser.username.substring(1)}
|
|
|
|
|
</Avatar>
|
|
|
|
|
<Avatar src={loginUser.avatarUrl}>{loginUser.username.substring(1)}</Avatar>
|
|
|
|
|
{loginUser.username}
|
|
|
|
|
</Space>
|
|
|
|
|
</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label='HT 账号'>
|
|
|
|
|
{loginUser.accountList?.map((a) => {
|
|
|
|
|
return (
|
|
|
|
|
<Tag
|
|
|
|
|
key={a.OPI_Code}
|
|
|
|
|
icon={<UserOutlined />}
|
|
|
|
|
bordered={false}>
|
|
|
|
|
<Tag key={a.OPI_Code} icon={<UserOutlined />} bordered={false}>
|
|
|
|
|
{a.OPI_Code}
|
|
|
|
|
</Tag>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</Descriptions.Item>
|
|
|
|
|
|
|
|
|
|
<Descriptions.Item label='商业号身份'>
|
|
|
|
|
<Descriptions.Item
|
|
|
|
|
label={
|
|
|
|
|
<Space>
|
|
|
|
|
<Tooltip title='你所属的业务部门'>
|
|
|
|
|
<InfoCircleOutlined />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
<span>商业号身份</span>
|
|
|
|
|
</Space>
|
|
|
|
|
}>
|
|
|
|
|
<Form
|
|
|
|
|
layout='vertical'
|
|
|
|
|
// form={form}
|
|
|
|
|
>
|
|
|
|
|
<Form.Item
|
|
|
|
|
tooltip={{
|
|
|
|
|
title: '你所属的业务部门',
|
|
|
|
|
icon: <InfoCircleOutlined />,
|
|
|
|
|
}}>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Select
|
|
|
|
|
defaultValue='8617607730395'
|
|
|
|
|
options={[
|
|
|
|
@ -147,7 +123,13 @@ function Profile() {
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item>
|
|
|
|
|
<Button type='primary'>保存</Button>
|
|
|
|
|
<Button
|
|
|
|
|
type='primary'
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setWhatsAppBusiness(383, 8617607730395)
|
|
|
|
|
}}>
|
|
|
|
|
保存
|
|
|
|
|
</Button>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form>
|
|
|
|
|
</Descriptions.Item>
|
|
|
|
@ -158,9 +140,7 @@ function Profile() {
|
|
|
|
|
header={<div>邮箱</div>}
|
|
|
|
|
dataSource={loginUser.emailList}
|
|
|
|
|
renderItem={(item) => {
|
|
|
|
|
const isDefault = item.default ? (
|
|
|
|
|
<Tag color='green'>默认</Tag>
|
|
|
|
|
) : null
|
|
|
|
|
const isDefault = item.default ? <Tag color='green'>默认</Tag> : null
|
|
|
|
|
const isBackup = item.backup ? <Tag color='cyan'>备用</Tag> : null
|
|
|
|
|
return (
|
|
|
|
|
<List.Item>
|
|
|
|
@ -180,22 +160,15 @@ function Profile() {
|
|
|
|
|
<Typography.Paragraph>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>在手机上打开 WhatsApp</li>
|
|
|
|
|
<li>点击“已关联的设备”,然后点击“关联新设备”</li>
|
|
|
|
|
<li>将手机对准屏幕扫描二维码</li>
|
|
|
|
|
<li>点击“已关联的设备”,再点击“关联新设备”</li>
|
|
|
|
|
<li>将手机对准屏幕扫描二维码➡️</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</Typography.Paragraph>
|
|
|
|
|
</Typography>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={6}>
|
|
|
|
|
<Flex gap='middle' vertical justify={'center'} align={'center'}>
|
|
|
|
|
<QRCode
|
|
|
|
|
size={264}
|
|
|
|
|
value={'https://web.whatsapp.com/'}
|
|
|
|
|
status='scanned'
|
|
|
|
|
statusRender={customStatusRender}
|
|
|
|
|
/>
|
|
|
|
|
<Alert message='WhatsApp:8618754124786' type='success' showIcon />
|
|
|
|
|
<Button type='primary'>退出</Button>
|
|
|
|
|
<QRCode size={264} value={'https://web.whatsapp.com/'} status='expired' statusRender={customStatusRender} />
|
|
|
|
|
</Flex>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|