【代码评审】Mall:客服的会话列表

This commit is contained in:
YunaiV
2024-07-10 09:30:03 +08:00
parent 6550983413
commit ec61670b75
9 changed files with 72 additions and 26 deletions

View File

@ -10,6 +10,7 @@
: ''
]"
>
<!-- TODO @puhui999unocss -->
<el-image
:src="message.content"
fit="contain"
@ -30,6 +31,7 @@ defineOptions({ name: 'ImageMessageItem' })
defineProps<{
message: KeFuMessageRespVO
}>()
/** 图预览 */
const imagePreview = (imgUrl: string) => {
createImageViewer({

View File

@ -18,6 +18,7 @@
</div>
</div>
<div v-for="item in getMessageContent.items" :key="item.id" class="border-bottom">
<!-- TODO @puhui999要不把 img => picUrl 类似这种搞的更匹配一点 -->
<ProductItem
:img="item.picUrl"
:num="item.count"
@ -29,10 +30,10 @@
<div class="pay-box mt-30px flex justify-end pr-20px">
<div class="flex items-center">
<div class="discounts-title pay-color"
> {{ getMessageContent.productCount }} 件商品,总金额:
> {{ getMessageContent?.productCount }} 件商品,总金额:
</div>
<div class="discounts-money pay-color">
{{ fenToYuan(getMessageContent.payPrice) }}
{{ fenToYuan(getMessageContent?.payPrice) }}
</div>
</div>
</div>

View File

@ -90,6 +90,8 @@ const props = defineProps({
default: ''
}
})
/** SKU 展示字符串 */
const skuString = computed(() => {
if (!props.skuText) {
return ''
@ -99,6 +101,8 @@ const skuString = computed(() => {
}
return props.skuText
})
// TODO @puhui999可以使用 preview-teleported
/** 图预览 */
const imagePrediv = (imgUrl: string) => {
createImageViewer({

View File

@ -32,5 +32,7 @@ defineOptions({ name: 'ProductMessageItem' })
const props = defineProps<{
message: KeFuMessageRespVO
}>()
/** 获悉消息内容 */
const getMessageContent = computed(() => JSON.parse(props.message.content))
</script>