作者 wumengyu

优化预约code为40000问题

... ... @@ -70,6 +70,7 @@ App({
}else if(res.data.code == '30000') {
resolve(res.data);
} else if (res.data.code == '40001') {//返回错误提示信息
console.log('code == 40001');
wx.showModal({
title: '提示',
content: res.data.msg,
... ... @@ -85,14 +86,17 @@ App({
});
resolve(res.data.msg);
} else if (res.data.code == '40000') {
wx.showModal({
title: '提示',
content: res.data.msg,
showCancel: false,
success: function (res) { }
})
console.log('code == 40000');
resolve(res.data);
// wx.showModal({
// title: '提示',
// content: res.data.msg,
// showCancel: false,
// success: function (res) { }
// })
} else {
console.log(res.data);
console.log('app其他code');
wx.showModal({
title: '提示',
content: res.data.msg,
... ...
... ... @@ -126,17 +126,18 @@ Page({
//提交
submit() {
if (this.data.is_choose_session) {
console.log(this.data.experiment_id, this.data.current_session_id, this.data.student_num);
let url = '/portal/Experiment/submit_session';
let header = {
"XX-token": wx.getStorageSync('token')
};
let params = {
experiment_id: this.data.experiment_id,
session_id: this.data.current_session_id,
student_num: this.data.student_num,
experiment_id: +this.data.experiment_id,
session_id: +this.data.current_session_id,
student_num: +this.data.student_num,
};
app.post(url, params, header).then((res) => {
// console.log(res);
console.log(res);
wx.navigateTo({
url: '/pages/index/confirm-appointment-info/confirm-appointment-info?experiment_id=' + this.data.experiment_id
+ '&session_id=' + this.data.current_session_id
... ... @@ -182,11 +183,11 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params, header).then((res) => {
// console.log('实验',res.list);
// console.log('实验',res);
// console.log(res.list,res.list[0],res.list[0].lab_list,res.list[0].lab_list[0],);
this.setData({
areaTest: res.list,
student_num: res.student_num,
student_num: res.student_num == 0?1:res.student_num,
current_test_id: res.list.length>0 && res.list[0].lab_list && res.list[0].lab_list.length>0 ? res.list[0].lab_list[0].id:'',
description: res.list.length>0 && res.list[0].lab_list && res.list[0].lab_list.length>0 ? res.list[0].lab_list[0].description : '',//默认显示第一个实验室的描述
session_list: res.list.length>0 && res.list[0].lab_list.length>0 ? res.list[0].lab_list[0].session_list : ''//默认显示第一个实验室的实验时间
... ...
... ... @@ -55,8 +55,8 @@ Page({
app.post(url,params,header).then((res) => {
// console.log('兑换并绑定',res);
this.setData({is_confirm: false});
if(res === '参数错误') {
}
// if(res === '参数错误') {
// }
// console.log('list', list);
// this.setData({picker_list: list})
})
... ...