//修改数据表状态值
updateSelected: function (id, selected){
var openid = app.globalData.openid;
var token = app.globalData.userInfo.token;
var url = app.globalData.domain + “Cart/updateSelected”;
var params = { id: id, selected:selected, openid: openid, token: token };
util.wxRequest(url, params, data => {
}, params, data => {
console.log(data);
console.log(data.selectAll);//显示undefine 但打印data有数据
console.log(data.msg);
//这里判断就无法操作
if (data.selectAll == 1){
this.setData({
checkAll: true
})
}else{
this.setData({
checkAll: false
})
}
}, params, data => { });
}
打印出data.selectAll 显示undefine, 但是打印出整体data却是有数据
{data: {…}, header: {…}, statusCode: 200, errMsg: “request:ok”}
data: {code: 200, msg: “修改成功”, selectAll: 1}
errMsg: “request:ok”
header: {Date: “Wed, 04 Jul 2018 16:21:57 GMT”, Server: “Apache”, X-Powered-By: “PHP/5.6.30”, Content-Length: “47”, Keep-Alive: “timeout=5, max=99”, …}
statusCode: 200__proto__: Object