From 93006504ce322fcc7b26f6658a5d994cb019942f Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 9 Jul 2024 17:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91mall=20?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E8=AE=A2=E5=8D=95=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/kefu/components/KeFuChatBox.vue | 3 + .../components/message/OrderMessageItem.vue | 166 ++++++++++++++++-- .../kefu/components/message/ProductItem.vue | 1 + .../components/message/ProductMessageItem.vue | 2 +- 4 files changed, 161 insertions(+), 11 deletions(-) diff --git a/src/views/mall/promotion/kefu/components/KeFuChatBox.vue b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue index d7b9aeff..245791d0 100644 --- a/src/views/mall/promotion/kefu/components/KeFuChatBox.vue +++ b/src/views/mall/promotion/kefu/components/KeFuChatBox.vue @@ -57,6 +57,8 @@ + + - @@ -27,10 +46,137 @@ import { KeFuMessageContentTypeEnum } from '../tools/constants' import ProductItem from './ProductItem.vue' import { UserTypeEnum } from '@/utils/constants' import { KeFuMessageRespVO } from '@/api/mall/promotion/kefu/message' +import { fenToYuan } from '@/utils' -defineOptions({ name: 'ImageMessageItem' }) +defineOptions({ name: 'OrderMessageItem' }) const props = defineProps<{ message: KeFuMessageRespVO }>() const getMessageContent = computed(() => JSON.parse(props.message.content)) + +/** + * 格式化订单状态的颜色 + * + * @param order 订单 + * @return {string} 颜色的 class 名称 + */ +function formatOrderColor(order) { + if (order.status === 0) { + return 'info-color' + } + if (order.status === 10 || order.status === 20 || (order.status === 30 && !order.commentStatus)) { + return 'warning-color' + } + if (order.status === 30 && order.commentStatus) { + return 'success-color' + } + return 'danger-color' +} + +/** + * 格式化订单状态 + * + * @param order 订单 + */ +function formatOrderStatus(order) { + if (order.status === 0) { + return '待付款' + } + if (order.status === 10 && order.deliveryType === 1) { + return '待发货' + } + if (order.status === 10 && order.deliveryType === 2) { + return '待核销' + } + if (order.status === 20) { + return '待收货' + } + if (order.status === 30 && !order.commentStatus) { + return '待评价' + } + if (order.status === 30 && order.commentStatus) { + return '已完成' + } + return '已关闭' +} + + diff --git a/src/views/mall/promotion/kefu/components/message/ProductItem.vue b/src/views/mall/promotion/kefu/components/message/ProductItem.vue index 6805f24f..482ba6f8 100644 --- a/src/views/mall/promotion/kefu/components/message/ProductItem.vue +++ b/src/views/mall/promotion/kefu/components/message/ProductItem.vue @@ -116,6 +116,7 @@ const imagePrediv = (imgUrl: string) => { .ss-order-card-warp { padding: 20px; + border-radius: 10px; background-color: #e2e2e2; .img-box { diff --git a/src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue b/src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue index 923d366b..daf1b0bc 100644 --- a/src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue +++ b/src/views/mall/promotion/kefu/components/message/ProductMessageItem.vue @@ -28,7 +28,7 @@ import ProductItem from './ProductItem.vue' import { UserTypeEnum } from '@/utils/constants' import { KeFuMessageRespVO } from '@/api/mall/promotion/kefu/message' -defineOptions({ name: 'ImageMessageItem' }) +defineOptions({ name: 'ProductMessageItem' }) const props = defineProps<{ message: KeFuMessageRespVO }>()