Commit f2660cf9eaf0ccc09fedb78a253ae38b3eeb6d13
1 parent
db875754
搭配商品在添加的时候,需要深拷贝
Showing
1 changed file
with
3 additions
and
1 deletions
packageE/pages/cart/cart2/cart2.js
@@ -7823,7 +7823,9 @@ Page({ | @@ -7823,7 +7823,9 @@ Page({ | ||
7823 | var index = e.index; | 7823 | var index = e.index; |
7824 | 7824 | ||
7825 | var collocationList = this.data.cartlist[cart_index].collocationList; | 7825 | var collocationList = this.data.cartlist[cart_index].collocationList; |
7826 | - var item = collocationList[index]; | 7826 | + var item =JSON.parse(JSON.stringify(collocationList[index])); |
7827 | + | ||
7828 | + | ||
7827 | var goods = this.data.cartlist[cart_index].goods; | 7829 | var goods = this.data.cartlist[cart_index].goods; |
7828 | var txt = 'cartlist[' + cart_index + '].goods'; | 7830 | var txt = 'cartlist[' + cart_index + '].goods'; |
7829 | var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected'; | 7831 | var txt2 = 'cartlist[' + cart_index + '].collocationList[' + index + '].selected'; |