Commit a69e6055d95fecb16acd81d3bd3981abcc4ba2b9

Authored by yvan.ni
1 parent 55b51e2a

1. 领券未登录要登录一下

2.  报警错误的修复
components/diy_goodsGroup/diy_goodsGroup.js
@@ -101,13 +101,16 @@ Component({ @@ -101,13 +101,16 @@ Component({
101 } 101 }
102 102
103 this.data.requestData = new Array(); 103 this.data.requestData = new Array();
104 - this.data.g_id = nav_item.data;  
105 - var arr = []; 104 + if(nav_item && nav_item.data)
  105 + {
  106 + this.data.g_id = nav_item.data;
  107 + var arr = [];
  108 + for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {
  109 + arr.push(this.data.g_id.slice(i, i + this.data.goodscount));
  110 + }
  111 + this.data.firist_type_data = arr;
  112 + }
106 113
107 - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) {  
108 - arr.push(this.data.g_id.slice(i, i + this.data.goodscount));  
109 - }  
110 - this.data.firist_type_data = arr;  
111 this.init(this.data.classstyle_id, this.data.wgroup); 114 this.init(this.data.classstyle_id, this.data.wgroup);
112 }, 115 },
113 detached: function() { 116 detached: function() {
@@ -127,12 +130,11 @@ Component({ @@ -127,12 +130,11 @@ Component({
127 // 这里是一个自定义方法 130 // 这里是一个自定义方法
128 init:async function (classstyle_id, wgroup) { 131 init:async function (classstyle_id, wgroup) {
129 132
130 - this.setData({classstyle_id:classstyle_id})  
131 - 133 + this.setData({classstyle_id:classstyle_id})
132 var th = this; 134 var th = this;
133 var g_id = this.data.g_id; 135 var g_id = this.data.g_id;
134 - var len=this.data.firist_type_data.length;  
135 - if (classstyle_id == 1) { 136 + var len=this.data.firist_type_data?this.data.firist_type_data.length:0;
  137 + if (classstyle_id == 1 && this.data.firist_type_data) {
136 //---手动选择的时候--- 138 //---手动选择的时候---
137 g_id = this.data.firist_type_data[th.data.firist_type_curr]; 139 g_id = this.data.firist_type_data[th.data.firist_type_curr];
138 th.data.firist_type_curr++; 140 th.data.firist_type_curr++;
packageA/pages/quan_list/quan_list.js
@@ -25,9 +25,16 @@ Page({ @@ -25,9 +25,16 @@ Page({
25 onLoad: function(t) { 25 onLoad: function(t) {
26 var th=this; 26 var th=this;
27 getApp().getConfig2(function (conf) { 27 getApp().getConfig2(function (conf) {
28 - conf.couponset=conf.couponset.replace(/\<img/g,'<img style="width:100%;height:auto;display:block"'); 28 + if(conf.couponset)
  29 + conf.couponset=conf.couponset.replace(/\<img/g,'<img style="width:100%;height:auto;display:block"');
29 th.setData({config2:conf}); 30 th.setData({config2:conf});
30 }) 31 })
  32 +
  33 + var usr=getApp().globalData.userInfo;
  34 + if(!usr){
  35 + getApp().goto("/pages/togoin/togoin");
  36 + return false;
  37 + }
31 }, 38 },
32 //---展示--- 39 //---展示---
33 onShow: function() { 40 onShow: function() {