调整优惠券部分
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
})
|
@@ -32,6 +32,7 @@
|
||||
<view class="right">
|
||||
<van-button wx:if="{{type === 1}}" type="info" size="small" bind:tap="handleUse">去领取</van-button>
|
||||
<van-button wx:if="{{type === 2}}" type="info" size="small" bind:tap="handleChange">去兑换</van-button>
|
||||
<van-button wx:if="{{type === 3}}" type="info" size="small" bind:tap="handleUseIt">去使用</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
Reference in New Issue
Block a user