|
...
|
...
|
@@ -1011,15 +1011,22 @@ Page({ |
|
|
|
couponArr.push(item)
|
|
|
|
}
|
|
|
|
if (item.id == id && couponArr.length > 0) {
|
|
|
|
couponArr.forEach(item => {
|
|
|
|
couponArr.forEach((item,index) => {
|
|
|
|
let match = obj.find(b => b.id === item.id);
|
|
|
|
if (match) {
|
|
|
|
item.number = match.number;
|
|
|
|
}
|
|
|
|
item.grant_num = item.grant_num*1
|
|
|
|
if(item.grant_num < 0 || item.grant_num == 0) couponArr.splice(index,1)
|
|
|
|
if(item.number>item.grant_num){
|
|
|
|
item.number = item.grant_num
|
|
|
|
}
|
|
|
|
});
|
|
|
|
totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
|
|
|
|
this.setcouponFun(couponArr)
|
|
|
|
this.couponModal.showModal()
|
|
|
|
if(couponArr.length>0){
|
|
|
|
totalPrice = couponArr.reduce((sum, item) => sum + item.price * item.number, 0);
|
|
|
|
this.setcouponFun(couponArr)
|
|
|
|
this.couponModal.showModal()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log('未领取的券列表-----------', couponArr);
|
|
|
|
this.setData({
|
...
|
...
|
|