Commit a649dfbf7ecd20520a053369ff0dda7447f56c69

Authored by yvan.ni
1 parent d4c16dee

标签的报错

packageA/pages/profile/profile.js
@@ -94,15 +94,19 @@ Page({ @@ -94,15 +94,19 @@ Page({
94 if (res.data.code == 0) { 94 if (res.data.code == 0) {
95 var data = res.data.data; 95 var data = res.data.data;
96 var VipLabel = th.data.check_label; //通过id标签找到已选择的标签 96 var VipLabel = th.data.check_label; //通过id标签找到已选择的标签
97 - var dateList = data.VipLabel.split(",");  
98 - for (var i in dateList) {  
99 - if (dateList[i] != "") {  
100 - VipLabel.push(dateList[i]);  
101 - } 97 + if(VipLabel){
  98 + var dateList = data.VipLabel.split(",");
  99 + for (var i in dateList) {
  100 + if (dateList[i] != "") {
  101 + VipLabel.push(dateList[i]);
  102 + }
  103 + }
  104 + th.setData({
  105 + check_label: VipLabel
  106 + })
102 } 107 }
103 - th.setData({  
104 - check_label: VipLabel  
105 - }) 108 +
  109 +
106 } else { 110 } else {
107 getApp().my_warnning("系统繁忙,请稍后再试", 0, th); 111 getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
108 } 112 }
pages/user/labels/labels.js
@@ -136,7 +136,7 @@ Page({ @@ -136,7 +136,7 @@ Page({
136 storeId: a.stoid 136 storeId: a.stoid
137 } 137 }
138 }).then(res => { 138 }).then(res => {
139 - if (res.data.code == 0) { 139 + if (res.data.code == 0 && res.data.data && res.data.data.VipLabelId) {
140 var data = res.data.data; 140 var data = res.data.data;
141 var arr = []; 141 var arr = [];
142 var VipLabelId = []; //通过id标签找到已选择的标签 142 var VipLabelId = []; //通过id标签找到已选择的标签
pages/user/userinfo/userinfo.js
@@ -115,7 +115,7 @@ Page({ @@ -115,7 +115,7 @@ Page({
115 storeId: r.stoid 115 storeId: r.stoid
116 } 116 }
117 }).then(res => { 117 }).then(res => {
118 - if (res.data.code == 0) { 118 + if (res.data.code == 0 && res.data.data && res.data.data.check_label) {
119 var data = res.data.data; 119 var data = res.data.data;
120 var VipLabel = th.data.check_label; //通过id标签找到已选择的标签 120 var VipLabel = th.data.check_label; //通过id标签找到已选择的标签
121 var dateList = data.VipLabel.split(","); 121 var dateList = data.VipLabel.split(",");