刚刚更新了版本,完了以后报了这个错,我把onShow()注释了还是报错,想请教一下这是什么问题?
不是自己定义的方法呢
Page({
data:{
userMsg:{},
userPoster:’’,
userInfo:{},
userData:{}
},
onLoad: function(){
},
__ onShow__: function() {
var that = this;
wx.getStorage({
key: ‘userBase’,
success: function(res) {
that.setData({
userMsg:res.data
});
userId = res.data.user_id;
token = res.data.token;
console.log(userId,token);
//1、请求用户空间壁纸接口
wx.request({
url: theme_url + ‘&user_id=’ + userId + ‘&token=’ + token ,
data: {},
header: {
‘Content-Type’ : ‘application/json’
},
success: function(resp){
var data = resp.data;
console.log(data.content);
that.setData({
userPoster:data.content.theme_url
});
}
})
//2、请求用户信息接口
wx.request({
url: user_info_url + ‘&user_id=’ + userId + ‘&token=’ + token ,
data: {},
header: {
‘Content-Type’ : ‘application/json’
},
success: function(resp){
var data = resp.data;
that.setData({
userInfo:data.content
});
console.log(data);
}
})
//3、请求用户数据报告接口
wx.request({
url: user_count_url + ‘&user_id=’ + userId + ‘&token=’ + token ,
data: {},
header: {
‘Content-Type’ : ‘application/json’
},
success: function(resp){
var data = resp.data;
that.setData({
userData:data.content
});
console.log(data);
}
})
}
})
}
})