小程序无法绑定后端返回的参数问题?###传递参数不对应会导致问题,需要注意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);