Commit 6cc0e0f796899acc55cce48e99f69e1474b62382

Authored by yvan.ni
1 parent 155f82fe

报警的优化

components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -148,8 +148,10 @@ Component({
148 148 this.data.g_id = nav_item.data;
149 149 var arr = [];
150 150  
151   - for (var i = 0; i < this.data.g_id.length; i += parseInt(this.data.goodscount)) {
152   - arr.push(this.data.g_id.slice(i, i + parseInt(this.data.goodscount)));
  151 + if(this.data.g_id) {
  152 + for (var i = 0; i < this.data.g_id.length; i += parseInt(this.data.goodscount)) {
  153 + arr.push(this.data.g_id.slice(i, i + parseInt(this.data.goodscount)));
  154 + }
153 155 }
154 156 this.data.firist_type_data = arr;
155 157 this.init(this.data.classstyle_id, this.data.wgroup);
... ...