diff --git a/src/config.js b/src/config.js index 4acd750..d3794a8 100644 --- a/src/config.js +++ b/src/config.js @@ -26,6 +26,7 @@ export const HT3 = process.env.NODE_ENV === 'production' ? 'https://p9axztuwd7x export const DATE_FORMAT = 'YYYY-MM-DD'; export const DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; +export const ERROR_IMG = 'https://hiana-crm.oss-accelerate.aliyuncs.com/WAMedia/afe412d4-3acf-4e79-a623-048aeb4d696a.png'; export const OSS_URL_CN = 'https://haina-sale-system.oss-cn-shenzhen.aliyuncs.com/WAMedia/'; export const OSS_URL_AP = 'https://hiana-crm.oss-ap-southeast-1.aliyuncs.com/WAMedia/'; export const OSS_URL = OSS_URL_AP; diff --git a/src/views/Conversations/History/MessagesList.jsx b/src/views/Conversations/History/MessagesList.jsx index f00d8f1..ae74858 100644 --- a/src/views/Conversations/History/MessagesList.jsx +++ b/src/views/Conversations/History/MessagesList.jsx @@ -1,5 +1,5 @@ import { useRef, useEffect, useState, forwardRef, memo } from 'react'; -import { App, Flex, List, Button, } from 'antd'; +import { App, Flex, List, Button, Image } from 'antd'; import { LoadingOutlined } from '@ant-design/icons'; import { MessageBox } from 'react-chat-elements'; import { MESSAGE_PAGE_SIZE, fetchMessagesHistory } from '@/actions/ConversationActions'; @@ -9,6 +9,7 @@ import { useShallow } from 'zustand/react/shallow'; import MergeConversationTo from './MergeConversationTo'; import BubbleIM from '../Online/Components/BubbleIM'; import BubbleEmail from '../Online/Components/BubbleEmail'; +import { ERROR_IMG } from '@/config'; const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 20; const MessagesList = ({ ...listProps }) => { @@ -173,7 +174,7 @@ const MessagesList = ({ ...listProps }) => { {headerObj ? (
{'text' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() &&
{headerObj.text}
} - {'image' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() && } + {'image' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() && } {['document', 'video'].includes((headerObj?.parameters?.[0]?.type || '').toLowerCase()) && ( [ {headerObj.parameters[0].type} ] diff --git a/src/views/Conversations/Online/Components/BubbleIM.jsx b/src/views/Conversations/Online/Components/BubbleIM.jsx index ffa9605..18c04fc 100644 --- a/src/views/Conversations/Online/Components/BubbleIM.jsx +++ b/src/views/Conversations/Online/Components/BubbleIM.jsx @@ -1,5 +1,5 @@ import { memo } from 'react'; -import { App, Button } from 'antd'; +import { App, Button, Image } from 'antd'; import { ExportOutlined, CopyOutlined, PhoneOutlined } from '@ant-design/icons'; import { MessageBox } from 'react-chat-elements'; import { groupBy, isEmpty, TagColorStyle } from '@/utils/commons'; @@ -7,6 +7,7 @@ import useConversationStore from '@/stores/ConversationStore'; import { useShallow } from 'zustand/react/shallow'; import { ReplyIcon } from '@/components/Icons'; import ChannelLogo from './ChannelLogo'; +import { ERROR_IMG } from '@/config'; const outboundStyle = { 'waba': { color: '#ccd4ae' }, @@ -54,7 +55,7 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s {headerObj ? (
{'text' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() &&
{headerObj.text}
} - {'image' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() && } + {'image' === (headerObj?.parameters?.[0]?.type || '').toLowerCase() && } {['document', 'video'].includes((headerObj?.parameters?.[0]?.type || '').toLowerCase()) && (
[ {headerObj.parameters[0].type} ]