优化我的优惠券

This commit is contained in:
gyq
2025-09-29 16:54:17 +08:00
parent 719a513371
commit aecfdf9c2a

View File

@@ -143,13 +143,32 @@ const selectListItem = ref('');
const selectListItemDetails = ref([]);
function showDetailHandle(item) {
showDetail.value = true;
// 1. 定义每个规则的独立描述仅“其他优惠券”需判断item.type
const ruleList = [];
// 规则1限时折扣同享始终显示
const discountRule = item.discountShare ? '与限时折扣同享' : '不与限时折扣同享';
ruleList.push(discountRule);
// 规则2会员价/会员折扣同享(始终显示)
const vipRule = item.vipPriceShare ? '与会员价/会员折扣同享' : '不与会员价/会员折扣同享';
ruleList.push(vipRule);
// 规则3其他优惠券同享仅item.type=2时显示
if (item.type === 2) {
const otherCouponRule = item.otherCouponShare ? '与其他优惠券同享' : '不与其他优惠券同享';
ruleList.push(otherCouponRule);
}
const shareRuleText = `${ruleList.join('、')}`;
selectListItemDetails.value = [
`可适用门店:${item.useShops}`,
`可适用商品:${item.foods}`,
`可使用类型:${convertValuesToLabels(item.useType)}`,
`可用时间段:${item.useTimeType == 'all' ? '全段时间可用' : `${item.useStartTime} - ${item.useEndTime}`}`,
`限量规则:每人限领${item.getLimit == -10086 ? `无限张` : `${item.getLimit}`},每日最多可使用${item.useLimit == -10086 ? `无限张` : `${item.useLimit}`}`,
`同享规则:${item.vipPriceShare ? '与限时折扣同享、与会员价同享' : '不与限时折扣同享、与会员价同享'}`,
`同享规则:${shareRuleText}`,
`其它说明:${item.ruleDetails || '无'}`
];