Commit 853a6f785abb7af4aee7d2e694c1736566d5ce70
1 parent
e4fe4114
搭配优化
Showing
1 changed file
with
3 additions
and
3 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1435,8 +1435,8 @@ Page({ |
1435 | 1435 | // }else{ |
1436 | 1436 | // th.setData({ collocation_goods: gg.collocation_goods }); |
1437 | 1437 | // } |
1438 | - | |
1439 | - if (th.data.all_collocation_list && gg.collocation_goods && gg.collocation_goods.leng>0) { | |
1438 | + | |
1439 | + if (th.data.all_collocation_list && gg.collocation_goods && gg.collocation_goods.length>0) { | |
1440 | 1440 | for (var i = 0; i < th.data.all_collocation_list.length; i++) { |
1441 | 1441 | var item0 = th.data.all_collocation_list[i]; |
1442 | 1442 | var idx = gg.collocation_goods.findIndex(function (e) { |
... | ... | @@ -1454,7 +1454,7 @@ Page({ |
1454 | 1454 | |
1455 | 1455 | } |
1456 | 1456 | |
1457 | - if( gg.collocation_goods && gg.collocation_goods.leng>0){ | |
1457 | + if( gg.collocation_goods && gg.collocation_goods.length>0){ | |
1458 | 1458 | //var narr=gg.collocation_goods; |
1459 | 1459 | //修改成深拷贝,确保返回是数据正确 |
1460 | 1460 | var narr = JSON.parse(JSON.stringify(gg.collocation_goods)); | ... | ... |