Commit 7654764d62920515cffd5a40f4475fb4037f6d3b

Authored by 后端研发-苏明海
2 parents f945ce75 a69e6055

Merge branch 'dev' into 'test'

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

2.  报警错误的修复

See merge request !645
components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -101,13 +101,16 @@ Component({
101 101 }
102 102  
103 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 114 this.init(this.data.classstyle_id, this.data.wgroup);
112 115 },
113 116 detached: function() {
... ... @@ -127,12 +130,11 @@ Component({
127 130 // 这里是一个自定义方法
128 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 134 var th = this;
133 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 139 g_id = this.data.firist_type_data[th.data.firist_type_curr];
138 140 th.data.firist_type_curr++;
... ...
packageA/pages/quan_list/quan_list.js
... ... @@ -25,9 +25,16 @@ Page({
25 25 onLoad: function(t) {
26 26 var th=this;
27 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 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 40 onShow: function() {
... ...