|
|
|
@ -150,23 +150,30 @@
|
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let list = that.couponsList |
|
|
|
|
getCouponReceive(id) |
|
|
|
|
.then(function(res) { |
|
|
|
|
list[index].isUse = true |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '领取成功', |
|
|
|
|
icon: 'success', |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch(function(err) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
let list = that.couponsList, |
|
|
|
|
tmplIds = ['lOOnpYASRMKy81gh5tNMR7OXSHMKw05x-aosYjvhK-E', 'lejbsmRtheMLXEGNx_UhVHuq5P6Yjwfokc183n9oMek']; |
|
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
|
tmplIds, |
|
|
|
|
fail(err) { |
|
|
|
|
console.log("requestSubscribeMessage err", err) |
|
|
|
|
}, |
|
|
|
|
complete() { |
|
|
|
|
getCouponReceive(id).then(function(res) { |
|
|
|
|
list[index].isUse = true |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '领取成功', |
|
|
|
|
icon: 'success', |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}).catch(function(err) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
|
icon: 'none', |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getUseCoupons: function(i) { |
|
|
|
@ -191,14 +198,14 @@
|
|
|
|
|
}) |
|
|
|
|
}else if(i===0){ |
|
|
|
|
getCanReceive(q).then(res => { |
|
|
|
|
res.data.forEach(item=>{ |
|
|
|
|
if(!item.isUse){ |
|
|
|
|
this.couponsList.push(item) |
|
|
|
|
} |
|
|
|
|
res.data.forEach(item=>{ |
|
|
|
|
if(!item.isUse){ |
|
|
|
|
this.couponsList.push(item) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.loading = false |
|
|
|
|
this.page = this.page + 1 |
|
|
|
|
}) |
|
|
|
|
this.loading = false |
|
|
|
|
this.page = this.page + 1 |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
getUserFailure(type).then(res=>{ |
|
|
|
|
res.data.forEach(item=>{ |
|
|
|
|