feat(shop): 支持货到付款支付类型及状态展示

- 在订单状态中新增货到付款标签区分
- 已付款状态中增加针对货到付款的待收货付款标签
- 订单支付类型展示中添加货到付款蓝色标签
- 更新支付类型列表,新增货到付款及调整相关标签名称
- 修复支付类型获取函数安全性,防止索引异常失败
This commit is contained in:
2026-07-14 19:26:24 +08:00
parent db0d2d3773
commit 3989c755e8
2 changed files with 43 additions and 69 deletions

View File

@@ -11,15 +11,15 @@ export function getPayType(index?: number): any {
}, },
{ {
value: 2, value: 2,
label: '积分'
},
{
value: 3,
label: '支付宝' label: '支付宝'
}, },
{
value: 3,
label: '银联支付'
},
{ {
value: 4, value: 4,
label: '现金' label: '现金支付'
}, },
{ {
value: 5, value: 5,
@@ -27,64 +27,19 @@ export function getPayType(index?: number): any {
}, },
{ {
value: 6, value: 6,
label: '会员卡' label: '免费'
},
{
value: 7,
label: '积分支付'
},
{
value: 8,
label: '货到付款'
} }
// {
// value: 7,
// label: 'VIP年卡',
// },
// {
// value: 8,
// label: 'VIP次卡',
// },
// {
// value: 9,
// icon: 'IdcardOutlined',
// label: 'IC月卡',
// },
// {
// value: 10,
// icon: 'IdcardOutlined',
// label: 'IC年卡',
// },
// {
// value: 11,
// icon: 'IdcardOutlined',
// label: 'IC次卡',
// },
// {
// value: 12,
// icon: '',
// label: '免费',
// },
// {
// value: 13,
// icon: 'IdcardOutlined',
// label: 'VIP充值卡',
// },
// {
// value: 14,
// icon: 'IdcardOutlined',
// label: 'IC充值卡',
// },
// {
// value: 15,
// icon: '',
// label: '积分支付',
// },
// {
// value: 16,
// icon: 'IdcardOutlined',
// label: 'VIP季卡',
// },
// {
// value: 17,
// icon: 'IdcardOutlined',
// label: 'IC季卡',
// },
]; ];
if (index) { if (index) {
return payType[index].label || ''; return payType[index]?.label || '';
} }
return payType; return payType;
} }

View File

@@ -88,14 +88,27 @@
<template v-if="column.key === 'statusInfo'"> <template v-if="column.key === 'statusInfo'">
<div class="py-1"> <div class="py-1">
<a-space :size="6" wrap> <a-space :size="6" wrap>
<!-- 货到付款标识 -->
<a-tag
v-if="record.payType === 8"
color="blue"
>货到付款</a-tag>
<!-- 支付状态 --> <!-- 支付状态 -->
<a-tag <a-tag
v-if="record.payStatus == 1" v-if="record.payStatus == 1 && record.payType !== 8"
color="green" color="green"
@click.stop="updatePayStatus(record)" @click.stop="updatePayStatus(record)"
class="cursor-pointer" class="cursor-pointer"
>已付款</a-tag >已付款</a-tag
> >
<a-tag
v-else-if="record.payStatus == 1 && record.payType === 8"
color="green"
@click.stop="updatePayStatus(record)"
class="cursor-pointer"
>待收货付款</a-tag
>
<a-tag <a-tag
v-else-if="record.payStatus == 0 || record.payStatus == null" v-else-if="record.payStatus == 0 || record.payStatus == null"
@click.stop="updatePayStatus(record)" @click.stop="updatePayStatus(record)"
@@ -169,6 +182,11 @@
</template> </template>
</template> </template>
<template v-if="column.key === 'payType'"> <template v-if="column.key === 'payType'">
<!-- 货到付款特殊标识 -->
<template v-if="record.payType === 8">
<a-tag color="blue">货到付款</a-tag>
</template>
<template v-else>
<template v-for="item in getPayType()"> <template v-for="item in getPayType()">
<template v-if="record.payStatus == 1"> <template v-if="record.payStatus == 1">
<span v-if="item.value == record.payType">{{ <span v-if="item.value == record.payType">{{
@@ -180,6 +198,7 @@
</template> </template>
</template> </template>
</template> </template>
</template>
<template v-if="column.key === 'image'"> <template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" /> <a-image :src="record.image" :width="50" />
</template> </template>