feat: 测试会员优惠券列表展示
This commit is contained in:
parent
84424caa39
commit
2c1933b7be
|
@ -182,12 +182,12 @@ http.interceptors.response.use(
|
|||
Object.prototype.toString.call(response.data) === "[object Object]"
|
||||
) {
|
||||
// Message.closeAll();
|
||||
if (!response.config.hidemsg) {
|
||||
Message({
|
||||
message: response.data.msg || response.data.message,
|
||||
type: "success"
|
||||
});
|
||||
}
|
||||
// if (!response.config.hidemsg) {
|
||||
// Message({
|
||||
// message: response.data.msg || response.data.message,
|
||||
// type: "success"
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
return Promise.resolve(response);
|
||||
|
|
|
@ -98,8 +98,18 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
initData() {
|
||||
// 默认选择所有摊铺
|
||||
this.formInline.shopIds = this.storeList.map(store => store.shopId);
|
||||
// 如果storeList有数据,默认选择所有摊铺
|
||||
if (this.storeList && this.storeList.length > 0) {
|
||||
this.formInline.shopIds = this.storeList.map(store => store.shopId);
|
||||
}
|
||||
// 如果storeList没有数据但shopId有数据,则设置为shopId(支持只有一家店铺的情况)
|
||||
else if (this.shopId) {
|
||||
this.formInline.shopIds = [this.shopId];
|
||||
}
|
||||
// 否则设置为空数组
|
||||
else {
|
||||
this.formInline.shopIds = [];
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
|
||||
|
|
|
@ -228,13 +228,21 @@
|
|||
width="100"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ getCouponTypeText(scope.row.couponType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="面额" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.couponType === 'DISCOUNT'">
|
||||
{{ scope.row.discount }}折
|
||||
</span>
|
||||
<span v-else>¥{{ scope.row.money }}</span>
|
||||
<span v-else-if="scope.row.couponType === 'MONEY'">
|
||||
¥{{ scope.row.money }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ scope.row.money || scope.row.discount || "-" }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -257,7 +265,7 @@
|
|||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期" width="180" align="center">
|
||||
<el-table-column label="有效期" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.useStartTime }} 至 {{ scope.row.useEndTime }}
|
||||
</template>
|
||||
|
@ -580,6 +588,17 @@ export default {
|
|||
default:
|
||||
return "未知";
|
||||
}
|
||||
},
|
||||
// 获取优惠券类型中文文本
|
||||
getCouponTypeText(couponType) {
|
||||
switch (couponType) {
|
||||
case "MONEY":
|
||||
return "满减券";
|
||||
case "DISCOUNT":
|
||||
return "折扣券";
|
||||
default:
|
||||
return couponType || "未知";
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Reference in New Issue