Commit e9abcab2b7887c959038db6320b345519ff16b9c
1 parent
48281b94
清理一下赠品的优化
Showing
1 changed file
with
9 additions
and
1 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -8770,8 +8770,16 @@ Page({ |
8770 | 8770 | } |
8771 | 8771 | } |
8772 | 8772 | |
8773 | + //清理下赠品 | |
8774 | + let n_goods=[]; | |
8775 | + for (let ig = 0; ig <goods.length; ig++) { | |
8776 | + if(!goods[ig].is_gift){ | |
8777 | + n_goods.push(goods[ig]); | |
8778 | + } | |
8779 | + } | |
8780 | + | |
8773 | 8781 | //原始数据要有深拷贝不能有地址的牵连 |
8774 | - th.data.cartlist_y = JSON.parse(JSON.stringify(goods)) | |
8782 | + th.data.cartlist_y = JSON.parse(JSON.stringify(n_goods)) | |
8775 | 8783 | //重新调用cart_next,进行下一步计算 |
8776 | 8784 | wx.showLoading({ |
8777 | 8785 | title: "处理中.", | ... | ... |