From aaa4299c57cf41a706f56300d216f007dce70f7c Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 27 Nov 2024 08:54:30 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BE=9B=E5=BA=94=E5=95=86=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E5=8F=96=E6=B6=88=E8=AE=A2=E5=8D=95=E5=8F=B7=EF=BC=9B?= =?UTF-8?q?=20=E6=94=AF=E4=BB=98=E9=93=BE=E6=8E=A5=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=BD=A2=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Online/order/CustomerProfile.jsx | 1 - src/views/accounts/GeneratePayment.jsx | 28 +++++++++++-------- src/views/accounts/Profile.jsx | 18 ++++-------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/views/Conversations/Online/order/CustomerProfile.jsx b/src/views/Conversations/Online/order/CustomerProfile.jsx index 2534c52..a8ad89c 100644 --- a/src/views/Conversations/Online/order/CustomerProfile.jsx +++ b/src/views/Conversations/Online/order/CustomerProfile.jsx @@ -229,7 +229,6 @@ const CustomerProfile = () => { >
From: {email.SenderReceiver}
Subject: {email.MAI_Subject}
- {email.MAI_COLI_ID} )} diff --git a/src/views/accounts/GeneratePayment.jsx b/src/views/accounts/GeneratePayment.jsx index cf2187e..1de641b 100644 --- a/src/views/accounts/GeneratePayment.jsx +++ b/src/views/accounts/GeneratePayment.jsx @@ -1,5 +1,5 @@ -import { Radio, Row, Col, Tooltip, Flex, Form, Input, Button, InputNumber, Select, message } from 'antd' -import { useState, useEffect } from 'react' +import { Radio, Row, Col, Tooltip, Flex, App, Typography, Form, Input, Button, InputNumber, Select, message } from 'antd' +import { useState, useEffect, useCallback } from 'react' import HtmlPreview from './HtmlPreview' import useAuthStore from '@/stores/AuthStore' import useConversationStore from '@/stores/ConversationStore' @@ -7,6 +7,8 @@ import { useOrderStore } from '@/stores/OrderStore' import { InfoCircleOutlined } from '@ant-design/icons' function GeneratePayment() { + + const { notification } = App.useApp() const [messageApi, contextHolder] = message.useMessage() const [generateForm] = Form.useForm() @@ -18,15 +20,21 @@ function GeneratePayment() { const [isHtmlLoading, setHtmlLoading] = useState(false) const [generatedObject, setGeneratedObject] = useState('') - const handleGenerate = () => { + const handleGenerate = useCallback(() => { setHtmlLoading(true) generatePayment(generateForm.getFieldsValue()) .then((result) => { setGeneratedObject(result) }) - .catch((ex) => console.info(ex)) + .catch((ex) => + notification.error({ + message: 'Notification', + description: ex.message, + placement: 'top', + duration: 4, + })) .finally(() => setHtmlLoading(false)) - } + }, []) useEffect(() => { if (currentOrder) { @@ -162,9 +170,7 @@ function GeneratePayment() { @@ -173,19 +179,19 @@ function GeneratePayment() { - 支付按钮 + 支付按钮 messageApi.success('已复制')} /> - 支付链接 + 支付链接 - + {generatedObject.paylink} {contextHolder} diff --git a/src/views/accounts/Profile.jsx b/src/views/accounts/Profile.jsx index bdc0875..a31c7fd 100644 --- a/src/views/accounts/Profile.jsx +++ b/src/views/accounts/Profile.jsx @@ -1,10 +1,9 @@ import { useEffect, useCallback } from 'react' import { Row, Col, Space, Descriptions, Avatar, Tag, Divider, List, App, Button, Flex, Select, Spin, Form, Typography, QRCode, Tooltip } from 'antd' -import { UserOutlined, InfoCircleOutlined, CloseCircleFilled, ReloadOutlined, CheckCircleFilled } from '@ant-design/icons' +import { UserOutlined, InfoCircleOutlined, ReloadOutlined, CheckCircleFilled } from '@ant-design/icons' import useAuthStore from '@/stores/AuthStore' function Profile() { - const { notification } = App.useApp() const [wabaForm] = Form.useForm() @@ -17,7 +16,6 @@ function Profile() { }, []) const handelUpdateWABA = useCallback(() => { - console.info('handelUpdateWABA: %o', wabaForm.getFieldsValue()) setWhatsAppBusiness(loginUser.userId, wabaForm.getFieldsValue().whatsAppBusiness) .then(() => { notification.info({ @@ -26,7 +24,7 @@ function Profile() { placement: 'top', }) }) - .catch(ex => { + .catch((ex) => { notification.error({ message: 'Notification', description: ex.message, @@ -107,11 +105,7 @@ function Profile() { 商业号身份 }> -
+