今天看啥  ›  专栏  ›  追逐繁星D孩子

小程序无法绑定后端返回的参数问题?

追逐繁星D孩子  · 简书  ·  · 2019-04-09 16:39

小程序无法绑定后端返回的参数问题?###传递参数不对应会导致问题,需要注意null
appJs.apiConfig.getData(appJs.apiConfig.staffsInfoNew, 'get',null, res => {
if (res.error == 0) {
let list = [];
for (let v of res.data) {
if (v.able_order == 1) {
if (v.type == 1) {
v.truename = "店长"
}
v.truename = v.user.truename;
list.push(v);
}
}
this.setData({
clerkList: list
});
// this.nowClerk = that.data.clerkArr[that.data.clerkIndex];/设置当前选择的店员/
this.getClerkHours();
/获取当前店员可预约的时间段/
}
});

222

let apiData = {
type: 'get',
sendData: {},
apiUrl: appJs.apiConfig.staffsInfoNew
};
apiData.success = res => {
if (res.data) {
let list = [];
for (let v of res.data) {
if (v.able_order == 1) {
/if (v.type == 1) {
v.truename = "店长"
}
/
v.truename =v.title + v.user.truename;
list.push(v);
}
}
this.setData({
clerkList: list
});
// this.nowClerk = that.data.clerkArr[that.data.clerkIndex];/设置当前选择的店员/
this.getClerkHours();
/获取当前店员可预约的时间段/
}
};
appJs.apiConfig.getApi(apiData);




原文地址:访问原文地址
快照地址: 访问文章快照