diff --git a/src/actions/ConversationActions.js b/src/actions/ConversationActions.js
index 5f6c809..620cf1e 100644
--- a/src/actions/ConversationActions.js
+++ b/src/actions/ConversationActions.js
@@ -37,7 +37,11 @@ export const fetchOrderConversationsList = async (params) => {
};
export const fetchConversationItemClose = async (body) => {
- const getParams = body ? new URLSearchParams(body).toString() : '';
- const { result } = await fetchJSON(`${API_HOST}/closeconversation?${getParams}`);
+ const { result } = await fetchJSON(`${API_HOST}/closeconversation`, body);
return result;
};
+
+export const fetchCleanUnreadMsgCount = async (params) => {
+ const { errcode, result } = await fetchJSON(`${API_HOST}/clean_unread_msg_count`, params);
+ return errcode !== 0 ? {} : result;
+};
diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js
index 6212dd1..0899bc3 100644
--- a/src/lib/msgUtils.js
+++ b/src/lib/msgUtils.js
@@ -266,9 +266,6 @@ export const whatsappMsgTypeMapped = {
},
},
originText: msg.image?.caption || '',
- onOpen: () => {
- console.log('Open image', msg.image.link);
- },
}),
renderForReply: (msg) => ({
id: msg.wamid,
@@ -377,7 +374,7 @@ export const whatsappMsgTypeMapped = {
id: msg.wamid,
title: `位置信息 ${msg.location.name || ''} ↓打开高德地图`,
text: msg.location.address, // 地址
- src: `https://uri.amap.com/marker?position=${msg.location.longitude},${msg.location.latitude}`,
+ src: `https://uri.amap.com/marker?position=${msg.location.longitude},${msg.location.latitude}&callnative=1`,
data: {
longitude: msg.location?.longitude,
latitude: msg.location?.latitude,
diff --git a/src/views/AuthApp.jsx b/src/views/AuthApp.jsx
index b21a390..9c85960 100644
--- a/src/views/AuthApp.jsx
+++ b/src/views/AuthApp.jsx
@@ -70,7 +70,7 @@ function AuthApp() {
let interval;
if (totalNotify > 0) {
interval = setInterval(() => {
- document.title = isTitleVisible ? `🔔🔥💬【${totalNotify}条新消息】` : '聊天式销售平台';
+ document.title = isTitleVisible ? `🔔🔥💬【${totalNotify}条新消息】` : '______________';
setIsTitleVisible(!isTitleVisible);
}, 500);
} else {
diff --git a/src/views/ChatHistory.jsx b/src/views/ChatHistory.jsx
index 5d38fbf..9a819b4 100644
--- a/src/views/ChatHistory.jsx
+++ b/src/views/ChatHistory.jsx
@@ -1,170 +1,167 @@
-import { useNavigate } from 'react-router-dom'
+import { useNavigate } from 'react-router-dom';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
-import { Row, Col, Divider, Table , Card, Button, Input,
- Space, Empty, Radio, Select, DatePicker, Form, List, Avatar
-} from 'antd'
-import {
- StarFilled, ZoomInOutlined, StarOutlined, SearchOutlined
-} from '@ant-design/icons'
+import { Row, Col, Divider, Table, Card, Button, Input, Flex, Layout, Space, Empty, Radio, Select, DatePicker, Form, List, Avatar } from 'antd';
+import { StarFilled, ZoomInOutlined, StarOutlined, SearchOutlined } from '@ant-design/icons';
+import { ChatList, ChatItem, MessageBox } from 'react-chat-elements';
-const { Search } = Input
-const { RangePicker } = DatePicker
+const { Sider, Content, Header, Footer } = Layout;
+const { Search } = Input;
+const { RangePicker } = DatePicker;
const data = [
{
title: 'Ann',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=0',
msgTime: '03-04 13:45:29',
- content: 'Hi, this is Ann from China Highlights travel and it is my pleasure to help your Beijing trip. I have sent you an email with the general idea about you trip. Please check it and if any question or new idea just let me know. We are specailized in customizing tour and I would like to work with you to create a tour itinerary that you like. Look forward to your reply.'
+ content:
+ 'Hi, this is Ann from China Highlights travel and it is my pleasure to help your Beijing trip. I have sent you an email with the general idea about you trip. Please check it and if any question or new idea just let me know. We are specailized in customizing tour and I would like to work with you to create a tour itinerary that you like. Look forward to your reply.',
},
{
title: 'David Azhari',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=2',
msgTime: '03-04 16:33:08',
- content: 'Hi! I just replied to your email saying that I have a few questions and notes'
+ content: 'Hi! I just replied to your email saying that I have a few questions and notes',
},
{
title: 'David Azhari',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=2',
msgTime: '03-04 16:33:34',
- content: 'So first, is it possible for you guys to write a PU Invitation letter for visas or no?'
+ content: 'So first, is it possible for you guys to write a PU Invitation letter for visas or no?',
},
{
title: 'Ann',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=0',
msgTime: '03-04 16:33:41',
- content: 'you prefer we discuss here or go on by mail ?'
+ content: 'you prefer we discuss here or go on by mail ?',
},
{
title: 'David Azhari',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=2',
msgTime: '03-04 16:34:03',
- content: 'I prefer by mail if it’s ok with you'
+ content: 'I prefer by mail if it’s ok with you',
},
{
title: 'Ann',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=0',
msgTime: '03-04 16:34:28',
- content: 'both is okay ,I am typing mail to you now lol and receive your message here.'
+ content: 'both is okay ,I am typing mail to you now lol and receive your message here.',
},
{
title: 'David Azhari',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=2',
msgTime: '03-05 02:56:37',
- content: 'Ok thank you so much'
+ content: 'Ok thank you so much',
},
{
title: 'Ann',
avatarUrl: 'https://api.dicebear.com/7.x/miniavs/svg?seed=0',
msgTime: '03-04 16:44:03',
- content: 'you are welcome I have sent the mail to you ,please check.it is my pleasure to assist you with your tour.'
+ content: 'you are welcome I have sent the mail to you ,please check.it is my pleasure to assist you with your tour.',
},
-]
+];
+// eslint-disable-next-line react/display-name
const SearchForm = memo(function ({ onSubmit }) {
- const [form] = Form.useForm()
+ const [form] = Form.useForm();
function handleSubmit(values) {
- onSubmit?.(values)
+ onSubmit?.(values);
}
return (