调整优惠券部分

This commit is contained in:
2024-12-09 10:36:16 +08:00
parent 9bc3cb5584
commit fd7777e4f4
6 changed files with 48 additions and 10 deletions

View File

@@ -25,9 +25,6 @@ Component({
* 组件的方法列表
*/
methods: {
handleUse() {
alertInfo("敬请期待")
},
handleChange() {
const { data } = this.data;
const that = this;
@@ -42,6 +39,18 @@ Component({
alertSuccess("兑换成功")
this.triggerEvent("change", { id, type: 2 })
})
},
handleUseIt() {
alertInfo("敬请期待")
},
async handleUse(e) {
const { data } = this.data;
const { code, message } = await redeemCoupons({ id: data.id, type: 2 })
if (code !== OK) {
alertInfo(message)
return;
}
this.triggerEvent("get", { id, type: 1 })
}
}
})