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]"
|
Object.prototype.toString.call(response.data) === "[object Object]"
|
||||||
) {
|
) {
|
||||||
// Message.closeAll();
|
// Message.closeAll();
|
||||||
if (!response.config.hidemsg) {
|
// if (!response.config.hidemsg) {
|
||||||
Message({
|
// Message({
|
||||||
message: response.data.msg || response.data.message,
|
// message: response.data.msg || response.data.message,
|
||||||
type: "success"
|
// type: "success"
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.resolve(response);
|
return Promise.resolve(response);
|
||||||
|
|
|
@ -98,8 +98,18 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
// 默认选择所有摊铺
|
// 如果storeList有数据,默认选择所有摊铺
|
||||||
|
if (this.storeList && this.storeList.length > 0) {
|
||||||
this.formInline.shopIds = this.storeList.map(store => store.shopId);
|
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();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -228,13 +228,21 @@
|
||||||
width="100"
|
width="100"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ getCouponTypeText(scope.row.couponType) }}
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="面额" width="100" align="center">
|
<el-table-column label="面额" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.couponType === 'DISCOUNT'">
|
<span v-if="scope.row.couponType === 'DISCOUNT'">
|
||||||
{{ scope.row.discount }}折
|
{{ scope.row.discount }}折
|
||||||
</span>
|
</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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -257,7 +265,7 @@
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="有效期" width="180" align="center">
|
<el-table-column label="有效期" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.useStartTime }} 至 {{ scope.row.useEndTime }}
|
{{ scope.row.useStartTime }} 至 {{ scope.row.useEndTime }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -580,6 +588,17 @@ export default {
|
||||||
default:
|
default:
|
||||||
return "未知";
|
return "未知";
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 获取优惠券类型中文文本
|
||||||
|
getCouponTypeText(couponType) {
|
||||||
|
switch (couponType) {
|
||||||
|
case "MONEY":
|
||||||
|
return "满减券";
|
||||||
|
case "DISCOUNT":
|
||||||
|
return "折扣券";
|
||||||
|
default:
|
||||||
|
return couponType || "未知";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue