|
|
@ -158,23 +158,30 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCoupon: function(id, index) { |
|
|
|
getCoupon: function(id, index) { |
|
|
|
let that = this |
|
|
|
let that = this |
|
|
|
let list = that.couponsList |
|
|
|
let list = that.couponsList, |
|
|
|
getCouponReceive(id) |
|
|
|
tmplIds = ['lOOnpYASRMKy81gh5tNMR7OXSHMKw05x-aosYjvhK-E', 'lejbsmRtheMLXEGNx_UhVHuq5P6Yjwfokc183n9oMek']; |
|
|
|
.then(function(res) { |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
|
|
|
|
tmplIds, |
|
|
|
|
|
|
|
fail(err) { |
|
|
|
|
|
|
|
console.log("requestSubscribeMessage err", err) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
complete() { |
|
|
|
|
|
|
|
getCouponReceive(id).then(function(res) { |
|
|
|
list[index].isUse = true |
|
|
|
list[index].isUse = true |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '领取成功', |
|
|
|
title: '领取成功', |
|
|
|
icon: 'success', |
|
|
|
icon: 'success', |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(function(err) { |
|
|
|
.catch(function(err) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getUseCoupons() { |
|
|
|
getUseCoupons() { |
|
|
|
if (this.loading) return //阻止下次请求(false可以进行请求); |
|
|
|
if (this.loading) return //阻止下次请求(false可以进行请求); |
|
|
|