Local
res: {data: "{"errno":0,"message":"","data":[{"id":"1","uniaci…n_qr":null,"uid":"1","createtime":"1587566664"}]}", profile: {…}, header: {…}, statusCode: 200, cookies: Array(2), …}
this: Object
Closure (RefreshCompany)
Closure
Window
Global
res.data
res.data
"{"errno":0,"message":"","data":[{"id":"1","uniacid":"2","title":"\u4fe1\u5b9c\u5e02\u4eba\u6c11\u533b\u9662","linkmen":"\u603b\u673a","linkway":"88888888","lng":"0","lat":"0","address":"\u5e7f\u4e1c\u7701\u4fe1\u5b9c\u5e02\u94f6\u6e56\u897f\u8def","pid":"0","url":"www.xysrmyy.cn","thumb":" ","pic":" ","province":"\u5e7f\u4e1c\u7701","city":"\u8302\u540d\u5e02","dist":"\u4fe1\u5b9c\u5e02","qq":" …"
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
let that = this;
app.util.request({
url: 'entry/wxapp/listCompanies',
data: {
m: app.siteInfo.m,
uniacid: app.siteInfo.uniacid,
region_type:wx.getStorageSync('region_type'),
},
method : 'post',
success: function(res) {
if(res.data.data){
that.setData({
listCompanies: res.data.data,
//loading: false // 关闭等待框
})
if(that.data.listCompanies){
if(that.data.listCompanies.length == 1){
that.bindCompany(that.data.listCompanies[0].id,that.data.listCompanies[0].title);
}
}
}else{
wx.showModal({
title: '缺少服务单位',
content: '请先设置服务的单位后再继续',
showCancel:false,
success: function (res) {
wx.reLaunch({
url: '../index/index',
})
}
})
}
},
complete:function(){
//loading: false // 关闭等待框
}
});
},
正式认证小程序
RefreshCompany: function () {
let that = this;
app.util.request({
url: 'entry/wxapp/listCompanies',
data: {
m: app.siteInfo.m,
uniacid: app.siteInfo.uniacid,
region_type:wx.getStorageSync('region_type'),
},
method : 'post',
success: function(res) {
if(res.data.data){
that.setData({
listCompanies: res.data.data,
//loading: false // 关闭等待框
})
if(that.data.listCompanies){
if(that.data.listCompanies.length == 1){
that.bindCompany(that.data.listCompanies[0].id,that.data.listCompanies[0].title);
}
}
}else{
wx.showModal({
title: '缺少服务单位',
content: '请先设置服务的单位后再继续',
showCancel:false,
success: function (res) {
wx.reLaunch({
url: '../index/index',
})
}
})
}
},
complete:function(){
//loading: false // 关闭等待框
}
});
},