优化头像显示、删除测试订单数据

dev/mobile
Jimmy Liow 2 years ago
parent c7b341b125
commit 0cf3c5d541

@ -53,7 +53,7 @@ const router = createBrowserRouter([
ReactDOM.createRoot(document.getElementById('root')).render(
// <React.StrictMode>
<ThemeContext.Provider value={{ colorPrimary: '#1ba784', borderRadius: 4 }}>
<AuthContext.Provider value={{ loginUser: { userId: 354 } }}>
<AuthContext.Provider value={{ loginUser: { userId: 354, username: '廖一军', accountList: ['LYJ', 'LYJAH', 'LYJGH'] } }}>
<ConversationProvider>
<RouterProvider router={router} fallbackElement={() => <div>Loading...</div>} />
</ConversationProvider>

@ -1,8 +1,10 @@
import { useEffect } from 'react'
import {
Row, Col, Space, Descriptions, Avatar, Radio
Row, Col, Space, Descriptions, Avatar, Radio, Tag
} from 'antd'
import {
UserOutlined
} from '@ant-design/icons'
import { useAuthContext } from '@/stores/AuthContext'
function AccountProfile() {
@ -17,19 +19,11 @@ function AccountProfile() {
<Row>
<Col span={12} offset={6}>
<Descriptions title='个人资料' layout='vertical' column={2}>
<Descriptions.Item label='名字'><Space size='middle'><Avatar src={loginUser.avatarUrl} />{loginUser.username}</Space></Descriptions.Item>
<Descriptions.Item label='名字'><Space size='middle'><Avatar src={loginUser.avatarUrl}>{loginUser.username.substring(1)}</Avatar>{loginUser.username}</Space></Descriptions.Item>
<Descriptions.Item label='HT 账号'>
{loginUser.accountName}
<Radio.Group
options={[
{ label: 'LMY', value: '1' },
{ label: 'christy', value: '2' },
{ label: 'LMYGH', value: '3' }
]}
value='2'
optionType='button'
buttonStyle='solid'
/>
{loginUser.accountList?.map(a => { return (
<Tag icon={<UserOutlined />} bordered={false}>{a}</Tag>
)})}
</Descriptions.Item>
<Descriptions.Item label='手机'>{loginUser.mobile}</Descriptions.Item>
<Descriptions.Item label='邮件'>{loginUser.email}</Descriptions.Item>

@ -90,7 +90,7 @@ function AuthApp() {
trigger={['click']}
>
<a onClick={(e) => e.preventDefault()} style={{ color: colorPrimary }}>
<Space><Avatar src={loginUser.avatarUrl} />廖一军<DownOutlined /></Space>
<Space><Avatar src={loginUser.avatarUrl}>{loginUser.username.substring(1)}</Avatar>{loginUser.username}<DownOutlined /></Space>
</a>
</Dropdown>

@ -1,16 +1,6 @@
import {
App,
Badge,
Button,
DatePicker,
Divider,
Flex, Form,
Input,
Radio, Row, Col, Select,
Space,
Switch,
Table,
Tag
App, Badge, Button, DatePicker, Divider, Flex, Form, Input,
Radio, Row, Col, Select, Space, Switch, Table, Tag
} from 'antd'
import { memo, useCallback, useEffect, useState } from 'react'
import { NavLink } from 'react-router-dom'
@ -56,17 +46,14 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
return (
<Form
layout={'vertical'}
// layout={'inline'}
form={form}
initialValues={{ orderLabel: '', orderStatus: '', remindState: '',
initialValues={{
orderLabel: '', orderStatus: '', remindState: '',
startDateRange: [dayjs().startOf('M'), dayjs().endOf('M')]
}}
onFinish={handleSubmit}
// style={{
// maxWidth: '200',
// }}
>
<Row justify='start' align='middle' gutter={16}>
<Row justify='start' gutter={16}>
<Col span={4}>
<Form.Item label='订单号' name='orderNumber'>
<Input placeholder='订单号' allowClear />
@ -89,7 +76,7 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
</Col>
</Row>
<Row justify='start' align='middle' gutter={16}>
<Row justify='start' gutter={16}>
<Col span={2}>
<Form.Item label='标签' name='orderLabel'>
<Select
@ -148,10 +135,8 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
/>
</Form.Item>
</Col>
<Col flex="auto">
{/* <Form.Item > */}
<Col span={2}>
<Button type='primary' htmlType='submit'>搜索</Button>
{/* </Form.Item> */}
</Col>
</Row>
</Form>
@ -243,51 +228,7 @@ function OrderList({ formValues }) {
.then(response => response.json())
.then(json => {
if (json.errcode === 0) {
const testOrder = [{
"key": 240129001,
"COLI_SN": 240129001,
"COLI_ID": "LYJ240129001",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240001,
"coli_guest": "LiaoYijun",
"buytime": 1,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "1st Trip Plan: 8-Day Essential Japan Family Trip with Disneyland",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
},{
"key": 240129002,
"COLI_SN": 240129002,
"COLI_ID": "QQS240129002",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240002,
"coli_guest": "QinQianSheng",
"buytime": 2,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "2nd Trip Plan: 2-Week Japan Private Family Vacation",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
},{
"key": 240129003,
"COLI_SN": 240129003,
"COLI_ID": "LYT240129003",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240003,
"coli_guest": "LeiYuanTing",
"buytime": 3,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "3rd Trip Plan: 12-Day Best of Thailand and Cambodia Tour",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
}]
const fetchData = json.result.map((order) => { return {...order, key: order.COLI_ID}})
setOrderData([...testOrder, ...fetchData])
setOrderData(json.result.map((order) => { return { ...order, key: order.COLI_ID } }))
} else {
notification.error({
message: '查询出错',

Loading…
Cancel
Save