Merge remote-tracking branch 'origin/main' into dev/chat

dev/chat
Lei OT 2 years ago
commit ce77626f1d

@ -3,7 +3,7 @@ import { groupBy } from '@/utils/utils';
import { fetchJSON, postJSON } from '@/utils/request' import { fetchJSON, postJSON } from '@/utils/request'
import { parseRenderMessageList } from '@/lib/msgUtils'; import { parseRenderMessageList } from '@/lib/msgUtils';
const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback'; const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback_cn';
export const fetchTemplates = async () => { export const fetchTemplates = async () => {
const data = await fetchJSON(`${API_HOST}/listtemplates`); const data = await fetchJSON(`${API_HOST}/listtemplates`);

@ -7,7 +7,7 @@ import { devtools } from 'zustand/middleware';
// const WS_URL = 'ws://202.103.68.144:8888/whatever/'; // const WS_URL = 'ws://202.103.68.144:8888/whatever/';
// const WS_URL = 'ws://120.79.9.217:10022/whatever/'; // const WS_URL = 'ws://120.79.9.217:10022/whatever/';
const WS_URL = 'wss://p9axztuwd7x8a7.mycht.cn/whatsapp_callback'; // prod: const WS_URL = 'wss://p9axztuwd7x8a7.mycht.cn/whatsapp_callback_cn'; // prod:
const initialConversationState = { const initialConversationState = {
// websocket: null, // websocket: null,

@ -2,7 +2,7 @@ import { create } from 'zustand'
import { devtools } from 'zustand/middleware' import { devtools } from 'zustand/middleware'
import { fetchJSON, postJSON } from '@/utils/request' import { fetchJSON, postJSON } from '@/utils/request'
const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback'; const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback_cn';
const useOrderStore = create((set, get) => ({ const useOrderStore = create((set, get) => ({

@ -53,16 +53,28 @@ const SearchForm = memo(function ({ onSubmit }) {
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())} (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
options={[ options={[
{ {
value: 'Coco', value: '杨新玲',
label: 'Coco', label: '杨新玲',
}, },
{ {
value: 'Ann', value: '骆梅玉',
label: 'Ann', label: '骆梅玉',
}, },
{ {
value: 'Lora', value: '秦宇尘',
label: 'Lora', label: '秦宇尘',
},
{
value: '莫梦瑶',
label: '莫梦瑶',
},
{
value: '秦雯萱',
label: '秦雯萱',
},
{
value: '王露加',
label: '王露加',
}, },
]} ]}
/> />
@ -76,16 +88,24 @@ const SearchForm = memo(function ({ onSubmit }) {
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())} (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
options={[ options={[
{ {
value: 'jack', value: 'Denise',
label: 'Jack', label: 'Denise',
},
{
value: 'Kennedy',
label: 'Kennedy',
},
{
value: 'Harsh',
label: 'Harsh',
}, },
{ {
value: 'lucy', value: 'SMLiew',
label: 'Lucy', label: 'SMLiew',
}, },
{ {
value: 'tom', value: 'See Kok Ching',
label: 'Tom', label: 'See Kok Ching',
}, },
]} ]}
/> />

@ -77,12 +77,12 @@ const CustomerProfile = (() => {
</Card> </Card>
<Flex vertical={true} className='p-2 '> <Flex vertical={true} className='p-2 '>
<Typography.Text strong>最新报价</Typography.Text> <Typography.Text strong>最新报价</Typography.Text>
<p className='m-0 py-2 line-clamp-2 '><a target='_blank' href={lastQuotation.letterurl}>{lastQuotation.lettertitle}<LinkOutlined /></a></p> <p className='m-0 py-2 line-clamp-2 '><a target='_blank' href={lastQuotation.letterurl}><LinkOutlined />&nbsp;{lastQuotation.lettertitle}</a></p>
<Flex justify={'space-between'} > <Flex justify={'space-between'} >
<QuotesHistory dataSource={quotationList} /> <QuotesHistory dataSource={quotationList} />
</Flex> </Flex>
</Flex> </Flex>
<p className='p-2 shadow-inner overflow-auto max-h-72 m-0 break-words whitespace-pre-wrap ' dangerouslySetInnerHTML={{__html: orderDetail.order_detail}}></p> <p className='p-2 shadow-inner overflow-auto m-0 break-words whitespace-pre-wrap ' dangerouslySetInnerHTML={{__html: orderDetail.order_detail}}></p>
</div> </div>
) )
}) })

@ -1,5 +1,6 @@
import { LinkOutlined } from '@ant-design/icons'
import { Button, Flex, List, Popover } from 'antd'
import { useState } from 'react' import { useState } from 'react'
import { Popover, Flex, Button, List, Popconfirm } from 'antd'
const QuotesHistory = ((props) => { const QuotesHistory = ((props) => {
@ -9,9 +10,9 @@ const QuotesHistory = ((props) => {
setOpen(newOpen) setOpen(newOpen)
} }
const onSend = () => { const handleCopyClick = (url) => {
navigator.clipboard.writeText(url)
setOpen(false) setOpen(false)
// todo: send
} }
return ( return (
@ -31,13 +32,12 @@ const QuotesHistory = ((props) => {
<List.Item className='' key={item.letterid} > <List.Item className='' key={item.letterid} >
<List.Item.Meta <List.Item.Meta
className='text-neutral-800' className='text-neutral-800'
title={<a target='_blank' href={item.letterurl}>{item.lettertitle}</a>} title={<a target='_blank' href={item.letterurl}><LinkOutlined />&nbsp;{item.lettertitle}</a>}
description={ description={
<Flex justify='space-between'> <Flex justify='space-between'>
<span>{item.letterdate}</span> <span>{item.letterdate}</span>
<Button onClick={() => { <Button onClick={() => {
navigator.clipboard.writeText(item.letterurl) handleCopyClick(item.letterurl)
setOpen(false)
}} size={'small'} type='link' key={'send'}> }} size={'small'} type='link' key={'send'}>
复制 复制
</Button> </Button>

@ -205,7 +205,7 @@ function OrderList({ formValues }) {
const [orderData, setOrderData] = useState([]) const [orderData, setOrderData] = useState([])
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const { loginUser } = useAuthContext() const { loginUser } = useAuthContext()
let fetchOrderUrl = `https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback/getwlorder?opisn=${loginUser.userId}&otype=${formValues.type}` let fetchOrderUrl = `https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback_cn/getwlorder?opisn=${loginUser.userId}&otype=${formValues.type}`
if (formValues.type === 'advance') { if (formValues.type === 'advance') {
const fromDate = formValues.startDateRange[0].format('YYYY-MM-DD') const fromDate = formValues.startDateRange[0].format('YYYY-MM-DD')

Loading…
Cancel
Save