Commit 22c9b72b4e6fec174dcc273ab3efcd81fbfc0f50

Authored by yvan.ni
1 parent d4cb05ee

报错的修复

components/diy_goodsGroup/diy_goodsGroup.js
@@ -75,10 +75,13 @@ Component({ @@ -75,10 +75,13 @@ Component({
75 } 75 }
76 76
77 // 在组件实例进入页面节点树时执行 77 // 在组件实例进入页面节点树时执行
78 - if(nav_item)  
79 - this.data.classstyle_id = nav_item.classstyle; 78 + if(nav_item) {
  79 + this.data.classstyle_id = nav_item.classstyle;
  80 + this.data.wgroup =nav_item.wgroup;
  81 + }
  82 +
80 this.data.goodscount = this.data.object.goodscount; 83 this.data.goodscount = this.data.object.goodscount;
81 - this.data.wgroup =nav_item.wgroup; 84 +
82 85
83 var hei=280; 86 var hei=280;
84 if(this.data.object.goodstit) hei+=80; 87 if(this.data.object.goodstit) hei+=80;
@@ -87,13 +90,13 @@ Component({ @@ -87,13 +90,13 @@ Component({
87 90
88 this.setData({swiper_hei:hei}); 91 this.setData({swiper_hei:hei});
89 92
90 - if (nav_item.goodsclass == 1) { 93 + if (nav_item && nav_item.goodsclass == 1) {
91 this.data.is_recommend = 1 94 this.data.is_recommend = 1
92 } 95 }
93 - if (nav_item.goodsclass == 2) { 96 + if (nav_item && nav_item.goodsclass == 2) {
94 this.data.is_hot = 1 97 this.data.is_hot = 1
95 } 98 }
96 - if (nav_item.goodsclass == 3) { 99 + if (nav_item && nav_item.goodsclass == 3) {
97 this.data.is_new = 1 100 this.data.is_new = 1
98 } 101 }
99 102