diff --git a/src/components/OrderProfile.jsx b/src/components/OrderProfile.jsx index 06ac025..64478de 100644 --- a/src/components/OrderProfile.jsx +++ b/src/components/OrderProfile.jsx @@ -23,10 +23,11 @@ import useAuthStore from '@/stores/AuthStore' const OrderProfile = ({ coliSN, ...props }) => { const navigate = useNavigate() const { notification, message } = App.useApp() - const [formComment] = Form.useForm() + const [formComment, formWhatsApp] = Form.useForm() const [loading, setLoading] = useState(false) const [openOrderCommnet, setOpenOrderCommnet] = useState(false) + const [openWhatsApp, setOpenWhatsApp] = useState(false) const orderLabelOptions = copy(OrderLabelDefaultOptions) orderLabelOptions.unshift({ value: 0, label: '未设置', disabled: true }) @@ -117,10 +118,13 @@ const OrderProfile = ({ coliSN, ...props }) => { {customerDetail.email} - + + {isEmpty(customerDetail.whatsapp_phone_number) ? + : {customerDetail.whatsapp_phone_number} + } @@ -265,6 +269,42 @@ const OrderProfile = ({ coliSN, ...props }) => { + setOpenWhatsApp(false)} open={openWhatsApp}> +
{ + console.log('Received values of form: ', values) + // appendOrderComment(loginUser.userId, orderId, values.number) + .then(() => { + notification.success({ + message: '温性提示', + description: '设置 WhatsApp 成功', + }) + setOpenWhatsApp(false) + formComment.setFieldsValue({ number: '' }) + }) + .catch((reason) => { + notification.error({ + message: '设置出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + }}> + + + + + + +
+
) }