diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js index 0cbb3d3..3d669c0 100644 --- a/packageA/pages/profile/profile.js +++ b/packageA/pages/profile/profile.js @@ -94,15 +94,19 @@ Page({ if (res.data.code == 0) { var data = res.data.data; var VipLabel = th.data.check_label; //通过id标签找到已选择的标签 - var dateList = data.VipLabel.split(","); - for (var i in dateList) { - if (dateList[i] != "") { - VipLabel.push(dateList[i]); - } + if(VipLabel){ + var dateList = data.VipLabel.split(","); + for (var i in dateList) { + if (dateList[i] != "") { + VipLabel.push(dateList[i]); + } + } + th.setData({ + check_label: VipLabel + }) } - th.setData({ - check_label: VipLabel - }) + + } else { getApp().my_warnning("系统繁忙,请稍后再试", 0, th); } diff --git a/pages/user/labels/labels.js b/pages/user/labels/labels.js index 5666231..cd1134d 100644 --- a/pages/user/labels/labels.js +++ b/pages/user/labels/labels.js @@ -136,7 +136,7 @@ Page({ storeId: a.stoid } }).then(res => { - if (res.data.code == 0) { + if (res.data.code == 0 && res.data.data && res.data.data.VipLabelId) { var data = res.data.data; var arr = []; var VipLabelId = []; //通过id标签找到已选择的标签 diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index b0661fa..d091b36 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -115,7 +115,7 @@ Page({ storeId: r.stoid } }).then(res => { - if (res.data.code == 0) { + if (res.data.code == 0 && res.data.data && res.data.data.check_label) { var data = res.data.data; var VipLabel = th.data.check_label; //通过id标签找到已选择的标签 var dateList = data.VipLabel.split(",");