Commit 853a6f785abb7af4aee7d2e694c1736566d5ce70

Authored by 前端开发-罗建龙
1 parent e4fe4114

搭配优化

packageE/pages/cart/cart2/cart2.js
@@ -1435,8 +1435,8 @@ Page({ @@ -1435,8 +1435,8 @@ Page({
1435 // }else{ 1435 // }else{
1436 // th.setData({ collocation_goods: gg.collocation_goods }); 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 for (var i = 0; i < th.data.all_collocation_list.length; i++) { 1440 for (var i = 0; i < th.data.all_collocation_list.length; i++) {
1441 var item0 = th.data.all_collocation_list[i]; 1441 var item0 = th.data.all_collocation_list[i];
1442 var idx = gg.collocation_goods.findIndex(function (e) { 1442 var idx = gg.collocation_goods.findIndex(function (e) {
@@ -1454,7 +1454,7 @@ Page({ @@ -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 //var narr=gg.collocation_goods; 1458 //var narr=gg.collocation_goods;
1459 //修改成深拷贝,确保返回是数据正确 1459 //修改成深拷贝,确保返回是数据正确
1460 var narr = JSON.parse(JSON.stringify(gg.collocation_goods)); 1460 var narr = JSON.parse(JSON.stringify(gg.collocation_goods));