作者 刘晓艳

合并分支 'wumengyu' 到 'master'

添加逆解析域名,优化申诉上传图片,去掉console



查看合并请求 !16
... ... @@ -25,7 +25,7 @@ var getLocation = function (self) {//当第一次未授æƒæ—¶éœ€è¦é‡æ–°è°ƒç”¨æ
longitude: res.longitude//经度
},
success: function (res) {
console.log('城市', res);
// console.log('城市', res);
wx.setStorageSync('city', res.result.address_component.city);
let params = {
city: res.result.address_component.city,
... ... @@ -86,7 +86,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, header).then((res) => {
console.log(res);
// console.log(res);
if (res.is_binding) {
this.setData({is_bingding: true})
} else {
... ... @@ -102,7 +102,7 @@ Page({
},
//打卡
punch() {
console.log('city', wx.getStorageSync('city'));
// console.log('city', wx.getStorageSync('city'));
if(wx.getStorageSync('city') !== '') {
if (this.data.test.name !== '') {
let url = '/portal/Experiment/user_sign';
... ... @@ -115,7 +115,7 @@ Page({
lng: this.data.longitude,
};
app.post(url, params, header).then((res) => {
console.log('打卡结果', res);
// console.log('打卡结果', res);
if (res.is_success) {
this.setData({
punchState: false,
... ... @@ -153,7 +153,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params, header).then((res) => {
console.log('获取用户所在实验室', res);
// console.log('获取用户所在实验室', res);
if(res === undefined) {
this.setData({
['test.name']: ''
... ... @@ -168,10 +168,9 @@ Page({
},
//打卡页面获取位置授权
getExperiment() {
console.log('实验室');
const self = this;
if (wx.getStorageSync('city') !== '') {//如果第一次授权过
console.log(111);
if (wx.getStorageSync('city') !== '') { //如果第一次授权过
console.log('如果第一次授权过');
wx.getLocation({
type: 'wgs84',
success(res) {
... ... @@ -185,10 +184,10 @@ Page({
}
});
} else {//重新调起授权
console.log('获取当前城市');
console.log('重新调起授权,获取当前城市');
wx.getSetting({
success: (res) => {
console.log('成功');
// console.log('成功');
if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {//非初始化进入该页面,且未授权
console.log('非初始化进入该页面,且未授权');
wx.showModal({
... ...
... ... @@ -22,7 +22,7 @@ Page({
tabCharge(e) {
var index = +e.currentTarget.dataset.current
var current = this.data.current
console.log('index', index);
// console.log('index', index);
if (index == current) {
return false
} else {
... ... @@ -33,7 +33,7 @@ Page({
examining:[]
});
if(index !== 0) {
console.log('aa');
// console.log('aa');
this.getMyComplain(index)
}
}
... ... @@ -71,7 +71,7 @@ Page({
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res);
// console.log(res);
const tempFilePaths = res.tempFilePaths;
let token = wx.getStorageSync('token');
let uploadImgCount = 0;
... ... @@ -91,7 +91,7 @@ Page({
success: function(res) {
uploadImgCount++;
let data = JSON.parse(res.data);
console.log('data',data);
// console.log('data',data);
if (data.code == 20000) {
//服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
if (current === 0) {
... ... @@ -104,14 +104,14 @@ Page({
const images = [];
const new_images = [];
images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
console.log('images push后',images);
// console.log('images push后',images);
images.map((item)=> {
if(item !== undefined) {
new_images.push(item)
}
});
self.setData({new_images: new_images.join(',')});
console.log('images',new_images.join(','));
// console.log('images',new_images.join(','));
} else {
wx.showModal({
... ... @@ -154,7 +154,7 @@ Page({
formId: e.detail.formId,
};
app.post(url, params, header).then((res) => {
console.log('提交结果',res);
// console.log('提交结果',res);
if(res.is_success) {
wx.showToast({
title:'申诉成功',
... ... @@ -175,7 +175,7 @@ Page({
},
//我的申诉
getMyComplain(current) {
console.log(this.data.has_more);
// console.log(this.data.has_more);
if(!this.data.has_more) return;
this.setData({has_more: false});
let url = '/portal/Experiment/user_complain_list';
... ... @@ -187,12 +187,12 @@ Page({
page: this.data.page_number,
};
app.post(url, params, header).then((res) => {
console.log('我的申诉',res);
// console.log('我的申诉',res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
this.setData({examining: this.data.examining.concat(res.list)});
console.log(this.data.examining);
// console.log(this.data.examining);
})
},
//取消申诉
... ... @@ -206,7 +206,7 @@ Page({
complain_id: id,//申诉id
};
app.post(url, params, header).then((res) => {
console.log('取消申诉',res);
// console.log('取消申诉',res);
if(res.is_success == 1) {
wx.showToast({title:'取消成功',icon:'none'});
const current = 1;
... ... @@ -223,7 +223,7 @@ Page({
listDetail(e) {
const current = +e.currentTarget.dataset.index;
const id = +e.currentTarget.dataset.id;
console.log('current',current);
// console.log('current',current);
wx.navigateTo({
url: '../punchAppealDetail/punchAppealDetail?status=' + current
+ '&test_name=' + this.data.test_name +
... ... @@ -234,7 +234,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', options);
// console.log('options', options);
this.setData({test_name: options.test_name?options.test_name:'',});
},
... ...
... ... @@ -158,6 +158,7 @@ page {
position: fixed;
bottom: 0;
left: 0;
border-radius: 0;
}
.submit_btn::after {
border: 0;
... ...
... ... @@ -12,11 +12,12 @@ Page({
image: [],
image_params:[],
disabled:true,
new_images:[],
},
//补充提交申诉
againSubmit(e) {
const self = this;
console.log(self.data.image.join(','),self.data.new_images);
// console.log(self.data.new_images);
if (self.data.image.length === 0) {
wx.showToast({title: '请上传申诉照片!', icon: 'none'})
} else {
... ... @@ -31,7 +32,7 @@ Page({
formId: e.detail.formId,
};
app.post(url, params, header).then((res) => {
console.log('补充提交结果', res);
// console.log('补充提交结果', res);
if (res.data.is_success) {
wx.showToast({
title: '二次申诉成功',
... ... @@ -53,9 +54,9 @@ Page({
//上传图片
uploadImg(e) {
const current = +e.currentTarget.dataset.current;
console.log(current);
// console.log(current);
const self = this;
console.log('status=3才可上传',self.data.detail.status);
// console.log('status=3才可上传',self.data.detail.status);
// self.setData({current:current})
if (self.data.detail.status === 3) {
wx.chooseImage({
... ... @@ -63,7 +64,7 @@ Page({
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res.tempFilePaths[0]);
// console.log(res.tempFilePaths[0]);
// const tempFilePaths = res.tempFilePaths[0];
// self.setData({[`image[${current}]`]: tempFilePaths});
... ... @@ -87,26 +88,38 @@ Page({
success: function(res) {
uploadImgCount++;
let data = JSON.parse(res.data);
console.log('data',data);
// console.log('data',data);
if (data.code == 20000) {
//服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
if (current === 0) {
self.setData({[`image[${current}]`]: data.data.url,image_params:data.data.local_url});
} else if (current === 1) {
self.setData({[`image[${current}]`]: data.data.url,image_params1:data.data.local_url});
} else {
self.setData({[`image[${current}]`]: data.data.url,image_params2:data.data.local_url});
// let image_params = self.data.image;
if (current === 0) { //点击第一个照片
// image_params[0].local_url = data.data.local_url;
// console.log('进入0',image_params[0].local_url);
self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url});
} else if (current === 1) { //点击第二个照片
// console.log('进入1');
self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url});
} else { //点击第三个照片
// console.log('进入2');
self.setData({[`image[${current}].url`]: data.data.url,[`image_params[${current}].local_url`]:data.data.local_url});
}
const images = [];
// console.log('image_params', self.data.image_params);
// console.log('image', self.data.image);
// const images = [];
const new_images = [];
images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
images.map((item)=> {
if(item !== undefined) {
new_images.push(item)
// images.push(self.data.image_params,self.data.image_params1,self.data.image_params2);
self.data.image_params.map((item)=> {
if(item.local_url !== "") {
// console.log('item', item);
new_images.push(item.local_url)
}
});
self.setData({new_images: new_images.join(',')});
console.log('new_images',new_images.join(','));
// console.log('new_images',new_images,new_images.join(','),'image',self.data.image);
}else {
wx.showModal({
... ... @@ -145,14 +158,15 @@ Page({
id: this.data.id,//申诉id
};
app.post(url, params, header).then((res) => {
console.log('申诉详情', res);
// console.log('申诉详情', res);
// (1,审核中、2,已通过、3,未通过、4,二次审核中;5,二次审核已通过;6,二次审核未通过)
if (res.info.status === 4 || res.info.status === 5 || res.info.status === 6) {
this.setData({detail: res.info, image: res.info.re_images})
} else {
if(res.info.status === 3) {
if(res.info.status === 3) { //二次申诉时开启textarea
this.setData({disabled:false})
}
this.setData({detail: res.info, image: res.info.images})
this.setData({detail: res.info, image: res.info.images,image_params:res.info.images})
}
})
},
... ... @@ -161,7 +175,7 @@ Page({
*/
onLoad: function (options) {
const self = this;
console.log('options', options);
// console.log('options', options);
self.setData({
// status: options.status,
test_name: options.test_name ? options.test_name : '',
... ...
... ... @@ -5,15 +5,15 @@
<view class='uoload_box' wx:if="{{image.length > 0}}">
<view class='upload_item' bindtap='uploadImg' data-current="0">
<text class='iconfont icon-jia' wx:if="{{image[0] === undefined}}"></text>
<image src="{{image[0]}}" mode="aspectFill" wx:else></image>
<image src="{{image[0].url}}" mode="aspectFill" wx:else></image>
</view>
<view class='upload_item' bindtap='uploadImg' data-current="1">
<text class='iconfont icon-jia' wx:if="{{image[1] === undefined}}"></text>
<image src="{{image[1]}}" mode="aspectFill" wx:else></image>
<image src="{{image[1].url}}" mode="aspectFill" wx:else></image>
</view>
<view class='upload_item' bindtap='uploadImg' data-current="2">
<text class='iconfont icon-jia' wx:if="{{image[2] === undefined}}"></text>
<image src="{{image[2]}}" mode="aspectFill" wx:else></image>
<image src="{{image[2].url}}" mode="aspectFill" wx:else></image>
</view>
</view>
</view>
... ...
... ... @@ -12,7 +12,7 @@ Page({
},
clickAgreeBtn() {
this.setData({is_agree: !this.data.is_agree});
console.log(this.data.is_agree);
// console.log(this.data.is_agree);
},
getDetail() {
let url = '/portal/Experiment/detail';
... ... @@ -23,7 +23,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log(res);
// console.log(res);
if(res.code === 0) {
wx.navigateTo({url: '/pages/index/phone-code/phone-code'})
}else {
... ... @@ -47,7 +47,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
// console.log(options);
this.setData({
test_id: +options.id,
is_the_week: options.is_the_week
... ...
... ... @@ -31,56 +31,56 @@ Page({
// checked_student: [],
},
chooseChildren(e) {
console.log(e,e.detail);
// console.log(e,e.detail);
// const current = e.currentTarget.dataset.index;
const that = this;
var index_arr = e.detail.value;
console.log(index_arr)
// console.log(index_arr)
//新建数组全部设置为没被选中
var new_arr = [];
console.log('选择时学员', that.data.student_list);
// console.log('选择时学员', that.data.student_list);
that.data.student_list.forEach((item) => {
new_arr.push({ ...item, checked: false })
});//给每一项添加checked属性
console.log('new_arr',new_arr);
// console.log('new_arr',new_arr);
var new_itmes = new_arr;
console.log('new_itmes', new_itmes);
// console.log('new_itmes', new_itmes);
if(that.data.student_num >=2) { //两个学员预约时
console.log('两个学员');
// console.log('两个学员');
if (index_arr.length > 2) {
//取出倒数两个值
var key1 = index_arr[index_arr.length - 1];
var key2 = index_arr[index_arr.length - 2];
// var key3 = skin[skin.length - 3];
// console.log(key1, key2, key3);
console.log(key1, key2);
console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id);
// console.log(key1, key2);
// console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id);
//设置最后两个值为选中状态
new_itmes[key1]['checked'] = true
new_itmes[key2]['checked'] = true
// new_itmes[key3 - 1]['checked'] = 'true'
//删除被选中的第一个值
index_arr.splice(0, 1);
console.log('skin',index_arr);
// console.log('skin',index_arr);
const id_arr = [];
id_arr.push(new_itmes[key1].id,new_itmes[key2].id);
that.setData({student_id: id_arr.join(','),is_choose_student:true});
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
} else {
//被选中少于两个,直接设置被选中
const checked_student = [];
for (var i = 0; i < index_arr.length; i++) {
var key = index_arr[i]
console.log('key', key);
// console.log('key', key);
new_itmes[key]['checked'] = true;
}
console.log('选一个时候new_itmes', new_itmes);
// console.log('选一个时候new_itmes', new_itmes);
new_itmes.forEach((item) => {
if(item.checked) {
checked_student.push(item)
}
});
console.log('选择学员length', checked_student,checked_student.length);
// console.log('选择学员length', checked_student,checked_student.length);
if(checked_student.length>=2) {
const arr = [];
new_itmes.forEach((item) => {
... ... @@ -93,7 +93,7 @@ Page({
wx.showToast({title:'请选择两个学员!',icon:'none'});
that.setData({student_id: new_itmes[key].id,is_choose_student:true});
}
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
}
//存入
that.setData({
... ... @@ -102,26 +102,26 @@ Page({
student_list: new_itmes,
})
}else if(that.data.student_num <2){ //一个学员预约时
console.log('一个学员');
// console.log('一个学员');
if (index_arr.length > 1) {
//取出倒数一个值
var key1 = index_arr[index_arr.length - 1];
// var key2 = skin[skin.length - 2];
// var key3 = skin[skin.length - 3];
// console.log(key1, key2, key3);
console.log(key1);
console.log(new_itmes[key1]['checked'],new_itmes[key1].id);
// console.log(key1);
// console.log(new_itmes[key1]['checked'],new_itmes[key1].id);
//设置最后一个值为选中状态
new_itmes[key1]['checked'] = true
// new_itmes[key2]['checked'] = true
// new_itmes[key3 - 1]['checked'] = 'true'
//删除被选中的第一个值
index_arr.splice(0, 1);
console.log('skin',index_arr);
// console.log('skin',index_arr);
that.setData({student_id: new_itmes[key1].id,is_choose_student:true});
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
} else {
console.log('111');
// console.log('111');
//被选中少于1个,直接设置被选中
// new_itmes.forEach((item,index) => {
// if(item.id === that.data.student_id) {
... ... @@ -129,15 +129,15 @@ Page({
// }
// });
for (var i = 0; i < index_arr.length; i++) {
console.log('222',index_arr,i);
// console.log('222',index_arr,i);
var key = index_arr[i]
console.log('key', key);
// console.log('key', key);
new_itmes[key]['checked'] = true
that.setData({student_id: new_itmes[key].id,is_choose_student:true});
}
index_arr = []
console.log('333');
console.log('student_id', that.data.student_id);
// console.log('333');
// console.log('student_id', that.data.student_id);
}
//存入
that.setData({
... ... @@ -150,13 +150,13 @@ Page({
},
//提交预约
formSubmit(e) {
console.log('预约学生人数',this.data.student_num,e.detail);
// console.log('预约学生人数',this.data.student_num,e.detail);
if(this.data.student_list.length === 0) {
wx.showToast({title: '请添加学员!',icon:'none'})
}else if(!this.data.is_choose_student) {
wx.showToast({title: '请选择学员!',icon:'none'})
}else if(this.data.student_num>=2 && ('' + this.data.student_id).indexOf(',') === -1) {
console.log('检验student_id',('' + this.data.student_id).indexOf(','));
// console.log('检验student_id',('' + this.data.student_id).indexOf(','));
wx.showToast({title:'请选择两个学员!',icon:'none'})
} else {
// this.setData({'modal_data.is_showModal': true})
... ... @@ -173,7 +173,7 @@ Page({
students: this.data.student_id,
};
app.post(url,params,header).then((res) => {
console.log('提交预约信息',res);
// console.log('提交预约信息',res);
if(res.data.card_modal === 1) {
this.setData({'modal_data.is_showModal': true});
}else if(res.data.reservation_modal === 1) {
... ... @@ -217,115 +217,70 @@ Page({
reservation_id: this.data.reservation_id,
};
app.post(url,params,header).then((res) => {
console.log('预约信息',res);
// console.log('预约信息',res);
var arr = [];
for (let i in res.list) {
arr.push(res.list[i]); //属性
//arr.push(obj[i]); //值
}//对象转数组
console.log('arr',arr);
// console.log('arr',arr);
var new_arr = [];
arr.forEach((item) => {
new_arr.push({ ...item, checked: false })
});//给每一项添加checked属性
console.log(new_arr);
// console.log(new_arr);
this.setData({
student_list: new_arr,
new_arr:new_arr,
session_info: res.session_info,
})
console.log('student_list', this.data.student_list);
// console.log('student_list', this.data.student_list);
})
},
//获取学员列表
getStudentList() {
const self = this;
console.log('预约学生人数',this.data.student_num);
// console.log('预约学生人数',this.data.student_num);
self.setData({is_choose_student: true});
console.log('返回时的学生列表预约信息自带的学员', self.data.student_list);
// console.log('返回时的学生列表预约信息自带的学员', self.data.student_list);
const buy_arr = [];
self.data.student_list.forEach((item) => {
buy_arr.push({ ...item, checked: false })
});//给每一项添加checked属性
console.log('buy_arr', buy_arr);
// console.log('buy_arr', buy_arr);
this.setData({
student_list: buy_arr,
// new_arr:buy_arr,
// session_info: res.session_info,
})
this.refreshBuyState();
// console.log('预约学生人数',this.data.student_num);
// self.setData({is_choose_student: true})
// console.log('返回时的学生列表预约信息自带的学员', self.data.student_list);
// let url = '/user/Student/student_list';
// let header = {
// "XX-token": wx.getStorageSync('token')
// };
// let params = {
// page: 2,
// };
// app.post(url,params,header).then((res) => {
// console.log('学员列表',res);
//
// var arr = [];
// for (let i in res.list) {
// arr.push(res.list[i]); //属性
// //arr.push(obj[i]); //值
// }//对象转数组
// console.log('arr',arr);
// var new_arr = [];
// arr.forEach((item) => {
// new_arr.push({ ...item, checked: false })
// });//给每一项添加checked属性
// console.log('new_arr',new_arr);
// this.setData({
// student_list: new_arr,
// new_arr:new_arr,
// // session_info: res.session_info,
// })
// console.log('student_list', this.data.student_list);
// this.refreshBuyState();
// res.list.forEach((item) => {
// if(item.time !== '') {
// self.data.student_list.forEach((item) => {
// new_arr.push({ ...item, checked: false })
// });//给每一项添加checked属性
// }
// })
// this.setData({student_list: res.list})
// })
},
//更新购买状态
refreshBuyState() {
console.log('更新购买状态---学生id--人数',this.data.student_num,this.data.is_buy,this.data.choose_student_id);
// console.log('更新购买状态---学生id--人数',this.data.student_num,this.data.is_buy,this.data.choose_student_id);
if(this.data.is_buy) {
if(this.data.student_num<2) {
this.data.student_list.forEach((item) => {
item.checked = false;
if (item.id === this.data.choose_student_id) {
console.log('item.id', item.id);
// console.log('item.id', item.id);
item.checked = true;
}
});
this.setData({student_list:this.data.student_list,is_choose_student:true})
console.log('student_list',this.data.student_list);
// console.log('student_list',this.data.student_list);
}else if(this.data.student_num>=2) {
console.log('购买完进入两个学员student_list',this.data.student_list);
// console.log('购买完进入两个学员student_list',this.data.student_list);
this.data.student_list.forEach((item) => {
item.checked = false;
if (item.id === this.data.choose_student_id) {
console.log('item.id', item.id);
// console.log('item.id', item.id);
item.checked = true;
// total_student_num.push(item)
}
});
this.setData({student_list:this.data.student_list,is_choose_student:true,});
console.log('student_list',this.data.student_list);
// console.log('student_list',this.data.student_list);
}
}
},
... ... @@ -334,8 +289,8 @@ Page({
*/
onLoad: function (options) {
const self =this;
console.log('load');
console.log(options);
// console.log('load');
// console.log(options);
self.setData({
experiment_id: +options.experiment_id?+options.experiment_id:'',
session_id: +options.session_id?+options.session_id:'',
... ... @@ -356,7 +311,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
console.log('show');
// console.log('show');
const self = this;
self.setData({is_choose_student: false});
self.getStudentList();
... ...
... ... @@ -44,16 +44,10 @@ Page({
this.setData({
currentTest: current,
current_test_id: current_id,
// is_choose_test: true,
// current_session_id: this.data.areaTest[current].lab_list ? this.data.areaTest[current].lab_list[0].session_list[0].id : '',
// description: this.data.areaTest[current].lab_list[current].description
});
// console.log(util.formatTimeTwo(1543375800,'h:m'),'1543375800');
// console.log('areaTest',this.data.areaTest);
return this.data.areaTest.forEach((item, index) => {
// console.log(item.lab_list[current].id, current_id);
if (item.lab_list && (item.lab_list[current].id === current_id)) {
// console.log(current_id, item.lab_list[current].id,item.lab_list[current].description);
this.setData({
description: item.lab_list && item.lab_list[current].description ? item.lab_list[current].description : '',
session_list: item.lab_list && item.lab_list[current].session_list ? item.lab_list[current].session_list : '',
... ... @@ -61,8 +55,6 @@ Page({
// return
}
});
// console.log(a);
// console.log(this.data.areaTest[current].lab_list[current].description);
},
//选择场次
... ... @@ -92,9 +84,6 @@ Page({
student_num: 1,
})
}
// wx.navigateTo({
// url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 1
// })
},
//点击双人预约
... ... @@ -107,9 +96,6 @@ Page({
student_num: 2,
})
}
// wx.navigateTo({
// url: '/pages/index/confirm-appointment-info/confirm-appointment-info?num=' + 2
// })
},
//提交
submit() {
... ... @@ -123,12 +109,8 @@ Page({
session_id: this.data.current_session_id,
student_num: this.data.student_num,
};
// wx.navigateTo({
// url: '/pages/index/confirm-appointment-info/confirm-appointment-info?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
... ... @@ -151,7 +133,7 @@ Page({
var city_list = [];
res.forEach((item, index) => {
if(item.city == wx.getStorageSync('city')){
console.log('item.city', item.city, wx.getStorageSync('city'));
// console.log('item.city', item.city, wx.getStorageSync('city'));
this.setData({city_index:index})
}
city_list.push(item.city)
... ... @@ -159,11 +141,8 @@ Page({
// console.log(city_list,res);
this.setData({
cityList: city_list,
// description: res.list[0].lab_list[0].description,//默认显示第一个实验室的描述
// session_list: res.list[0].lab_list[0].session_list//默认显示第一个实验室的实验时间
})
// console.log(this.data.this_week_test_info);
})
},
//获取预约城市、区、实验室、场次
... ... @@ -177,27 +156,10 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params, header).then((res) => {
console.log(res, res.list);
// res.list.forEach((item,index) => {
// if(item.lab_list) {
// item.lab_list.forEach((i,k) => {
// if(i.session_list) {
// i.session_list.forEach((j,b) => {
// j.start_time = util.formatTimeTwo(j.start_time, 'h:m');
// j.end_time = util.formatTimeTwo(j.end_time, 'h:m');
// })
// }
// })
// }
// });
// console.log(res,res.list);
// console.log(res.list[0].lab_list[0].id);
this.setData({
areaTest: res.list,
student_num: res.student_num,
current_test_id: res.list[0].lab_list[0].id,
// current_test_id: res.list[0].lab_list ? res.list[0].lab_list[0].id : '',//默认实验室id
// current_session_id: res.list[0].lab_list ? res.list[0].lab_list[0].session_list[0].id : '',//默认场次id
description: res.list[0].lab_list ? res.list[0].lab_list[0].description : '',//默认显示第一个实验室的描述
session_list: res.list[0].lab_list ? res.list[0].lab_list[0].session_list : ''//默认显示第一个实验室的实验时间
... ... @@ -210,16 +172,8 @@ Page({
*/
onLoad: function (options) {
const self = this;
console.log('load-experiment_id',options);
// console.log('load-experiment_id',options);
self.setData({experiment_id: +options.experiment_id});
// this.data.areaTest.forEach((v, i) => {
// Object.keys(v).forEach(v => {
// console.log(v) //取到了key
// console.log(this.data.areaTest[i][v]) //取到了值
// })
// })
// console.log(this.data.areaTest);
},
/**
... ... @@ -230,9 +184,8 @@ Page({
},
getData() {
const self = this;
console.log(wx.getStorageSync('city') == wx.getStorageSync('choose-city'),wx.getStorageSync('city') === wx.getStorageSync('choose-city'),wx.getStorageSync('choose-city') !=='');
if ((wx.getStorageSync('city') === wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
console.log('相同');
// console.log('相同');
const city = wx.getStorageSync('city');
// console.log('city',city);
self.getChooseSession(city);
... ... @@ -241,12 +194,11 @@ Page({
// console.log(self.data.currentCity);
}else if((wx.getStorageSync('city') !== wx.getStorageSync('choose-city')) && wx.getStorageSync('choose-city') !=='') {
console.log('不同');
// console.log('不同');
const city = wx.getStorageSync('choose-city');
self.getChooseSession(city);
self.setData({currentCity: city})
} else if(wx.getStorageSync('city') === ''){
console.log('aaa');
const city = '北京市';
self.getChooseSession(city);
self.setData({currentCity: city})
... ...
... ... @@ -27,13 +27,8 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, {}).then((res) => {
console.log('获取购买背景图',res);
// console.log('获取购买背景图',res);
this.setData({buy_card: res.info})
// if (res.is_binding) {
// this.setData({is_bingding: true})
// } else {
// this.setData({is_bingding: false})
// }
})
},
//判断手机号是否绑定
... ... @@ -43,7 +38,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {},header).then((res) => {
console.log(res);
// console.log(res);
if(res.is_binding) {
this.setData({is_bingding: true})
}else {
... ... @@ -78,7 +73,7 @@ Page({
//前往预约
goAppointment(e) {
const id = e.currentTarget.dataset.id;
console.log('实验室id', id);
// console.log('实验室id', id);
wx.navigateTo({url: './go-appointment/go-appointment?experiment_id=' + id})
},
//获取轮播图
... ... @@ -96,7 +91,7 @@ Page({
let url = '/portal/Index/index';
app.post(url, params).then((res) => {
console.log('轮播图',res);
// console.log('轮播图',res);
this.setData({imgUrls: res.list})
})
},
... ... @@ -122,7 +117,7 @@ Page({
page: this.data.page_number,
}
app.post(url, params,{}).then((res) => {
console.log('获取往期实验',res);
// console.log('获取往期实验',res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
... ... @@ -138,10 +133,8 @@ Page({
},
//打卡页面获取位置授权
getExperiment() {
console.log('实验室');
const self = this;
if (wx.getStorageSync('city')) {//如果第一次授权过
console.log(111);
wx.getLocation({
type: 'wgs84',
success(res) {
... ... @@ -208,8 +201,8 @@ Page({
const self = this;
// self.setData({is_bingding: +options.is_bingding?+options.is_bingding:''});
self.setData({is_bingding: app.globalData.is_bingding});
console.log('is_bingding', self.data.is_bingding);
console.log('options',options);
// console.log('is_bingding', self.data.is_bingding);
// console.log('options',options);
// self.checkMobile();
self.getTheWeekTest();
self.getPastWeekTest();
... ... @@ -218,7 +211,7 @@ Page({
wx.getLocation({
type: 'wgs84',
success: function(res) {
console.log(res);
// console.log(res);
// 实例化API核心类
var demo = new QQMapWX({
key: 'CLVBZ-KHZKP-KWLDW-VDJTA-QVUST-XOBVO' // 必填
... ... @@ -231,7 +224,7 @@ Page({
longitude: res.longitude//经度
},
success: function (res) {
console.log('获取城市',res.result.address_component.city);
// console.log('获取城市',res.result.address_component.city);
self.setData({city: res.result.address_component.city});
wx.setStorageSync('city', res.result.address_component.city);
self.getSlideImage();
... ... @@ -247,7 +240,7 @@ Page({
});
},
onShow() {
console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding));
// console.log('show-globalData',app.globalData.is_bingding,typeof(app.globalData.is_bingding));
},
onReachBottom: function () {
const self = this;
... ... @@ -260,6 +253,6 @@ Page({
icon: 'none'
});
}
console.log('上拉加载');
// console.log('上拉加载');
},
});
... ...
... ... @@ -44,7 +44,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log(res);
// console.log(res);
that.setData({verification_code: res.code})
// console.log(this.data.this_week_test_info);
})
... ... @@ -65,7 +65,7 @@ Page({
},
//确认绑定
formSubmit(e) {
console.log(e.detail);
// console.log(e.detail);
const self = this;
if(self.data.phone_number === '') {
wx.showToast({title: '请输入手机号!',icon: 'none'})
... ... @@ -83,7 +83,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log('绑定结果',res);
// console.log('绑定结果',res);
app.globalData.is_bingding = 1;
if(self.data.from_index) {
wx.switchTab({
... ...
... ... @@ -34,13 +34,13 @@ Page({
page: self.data.page_number,
};
app.post(url, params,header).then((res) => {
console.log('获取预约列表',res);
// console.log('获取预约列表',res);
if(res.this_page < res.total_page) {
self.setData({has_more: true});
}
self.setData({orderList: self.data.orderList.concat(res.list)})
// self.setData({orderList: res.list})
console.log(self.data.orderList);
// console.log(self.data.orderList);
})
},
//查看预约详情
... ... @@ -52,29 +52,17 @@ Page({
},
//取消
clickCancel(e) {
console.log('取消',e);
// console.log('取消',e);
const current = e.currentTarget.dataset.index;
wx.navigateTo({url: '../order-detail/order-detail?currentTab=' + this.data.currentTab
+ '&reservation_id=' + this.data.orderList[current].id
})
// let url = '/user/Reservation/reservation_cancel';
// let header = {
// "XX-token": wx.getStorageSync('token')
// };
// let params = {
// reservation_id: this.data.orderList[e.detail.target.dataset.index].id,
// formId: e.detail.formId,
// };
// app.post(url, params,header).then((res) => {
// console.log('取消',res);
// // this.setData({orderList: res.list})
// })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', options);
// console.log('options', options);
const self = this;
self.setData({currentTab: +options.currentTab});
self.getAppointmentList();
... ...
... ... @@ -24,7 +24,7 @@ Page({
"XX-Token": wx.getStorageSync('token')
};
app.post(url, params, header).then((res) => {
console.log(res);
// console.log(res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
... ... @@ -36,7 +36,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', options);
// console.log('options', options);
this.setData({student_id: +options.student_id ? +options.student_id : ''});
this.recordList()
},
... ...
... ... @@ -52,7 +52,7 @@ Page({
id: this.data.student_list[this.data.index].id
};
app.post(url, params,header).then((res) => {
console.log('支付换参',res);
// console.log('支付换参',res);
this.wxPay(res.pay)
})
}else {
... ... @@ -73,7 +73,7 @@ Page({
'signType': data.signType,
'paySign': data.paySign,
'success': function(res) {
console.log('支付成功',res);
// console.log('支付成功',res);
wx.showToast({
title: '支付成功',
icon: 'success',
... ... @@ -107,12 +107,12 @@ Page({
changeState() {
var pages = getCurrentPages();
if (pages.length > 1) {
console.log('pay_success',this.data.pay_success);
// console.log('pay_success',this.data.pay_success);
var beforePage = pages[pages.length - 2]//获取上一页面实例
if (this.data.pay_success) {
// beforePage.refreshStudent()
beforePage.data.is_buy = true;
console.log('学生id',this.data.student_list[this.data.index].id);
// console.log('学生id',this.data.student_list[this.data.index].id);
beforePage.data.choose_student_id = this.data.student_list[this.data.index].id;
beforePage.refreshBuyState()
}
... ... @@ -125,14 +125,14 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {},header).then((res) => {
console.log(res);
// console.log(res);
this.setData({
card_info: res
})
})
},
getMoreStudent() {
console.log('has_more',this.data.has_more);
// console.log('has_more',this.data.has_more);
if (this.data.has_more) {
this.data.page_number++;
this.getStudentList();
... ... @@ -178,7 +178,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options',options);
// console.log('options',options);
const self =this;
self.getArcCard();
self.setData({
... ...
... ... @@ -36,7 +36,6 @@ Page({
// 'modal_data.is_showModal': true,
// 'modal_data.title': '绑定后无法更改,确认绑定' + this.data.picker_list[this.data.index] + '吗?',
// });
console.log('34',e.detail);
const self = this;
if(self.data.code === '') {
wx.showToast({title: '请输入兑换码!',icon: 'none'})
... ... @@ -54,7 +53,7 @@ Page({
formId: self.data.detail.formId,
};
app.post(url,params,header).then((res) => {
console.log('兑换并绑定',res);
// console.log('兑换并绑定',res);
this.setData({is_confirm: false});
if(res === '参数错误') {
}
... ... @@ -111,11 +110,11 @@ Page({
};
var list = [];
app.post(url,params,header).then((res) => {
console.log('学员列表',res);
// console.log('学员列表',res);
res.list.forEach((item) => {
list.push(item.name)
});
console.log('list', list);
// console.log('list', list);
this.setData({picker_list: list,student_list: res.list})
})
},
... ...
... ... @@ -47,7 +47,7 @@ Page({
})
}
}, 1000);
console.log(that.data.disabled);
// console.log(that.data.disabled);
}else if(that.data.time_flag){
var currentTime1 = that.data.currentTime1;
interval1 = setInterval(function () {
... ... @@ -64,7 +64,7 @@ Page({
})
}
}, 1000);
console.log(that.data.disabled1);
// console.log(that.data.disabled1);
}
if(this.data.time_flag === '') {
let url = '/user/Profile/getOldCode';
... ... @@ -75,7 +75,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log('旧验证码',res);
// console.log('旧验证码',res);
that.setData({old_verification_code: res.code,old_time: res.time})
// console.log(this.data.this_week_test_info);
})
... ... @@ -89,10 +89,10 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log('新验证码',res);
// console.log('新验证码',res);
if(res == '手机号已经存在!') {
clearInterval(interval1);
console.log('...',that.data.disabled1);
// console.log('...',that.data.disabled1);
that.setData({
time1: '获取验证码',
disabled1:false,
... ... @@ -126,16 +126,16 @@ Page({
//下一步
next() {
const self = this;
console.log(0);
// console.log(0);
clearInterval(interval);
if(self.data.old_phone === '') {
console.log(1);
// console.log(1);
wx.showToast({title: '请输入手机号!',icon: 'none'})
}else if(self.data.old_verification_code === '') {
console.log(2);
// console.log(2);
wx.showToast({title: '请输入验证码!',icon: 'none'})
}else {
console.log(3);
// console.log(3);
if(self.data.old_phone && self.data.old_verification_code) {
let url = '/user/Profile/checkOldMobile';
let params = {
... ... @@ -147,7 +147,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params,header).then((res) => {
console.log('原手机号验证结果',res);
// console.log('原手机号验证结果',res);
self.setData({time_flag: res.time});
});
}
... ... @@ -156,16 +156,16 @@ Page({
//保存
formSubmit(e) {
const self = this;
console.log(e,e.detail);
// console.log(e,e.detail);
clearInterval(interval1);
if(self.data.new_phone === '') {
console.log(1);
// console.log(1);
wx.showToast({title: '请输入手机号!',icon: 'none'})
}else if(self.data.new_verification_code === '') {
console.log(2);
// console.log(2);
wx.showToast({title: '请输入验证码!',icon: 'none'})
}else {
console.log(3);
// console.log(3);
if(self.data.new_phone && self.data.new_verification_code) {
let url = '/user/Profile/bindingNewMobile';
let params = {
... ... @@ -179,7 +179,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, params, header).then((res) => {
console.log('新手机号绑定结果', res);
// console.log('新手机号绑定结果', res);
if(res.is_bingding) {
wx.showToast({
title: '更换手机号成功!',
... ... @@ -200,7 +200,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
// console.log(options);
this.setData({
old_phone: options.old_phone?options.old_phone:'',
old_phone_hidden: options.old_phone_hidden?options.old_phone_hidden:'',
... ...
... ... @@ -44,7 +44,7 @@ Page({
},
//选择性别
sexPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
sex_index: e.detail.value,
is_sex_change: true,
... ... @@ -52,7 +52,7 @@ Page({
},
//选择生日
birthPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
birth_date: e.detail.value,
is_birth_change: true,
... ... @@ -66,7 +66,7 @@ Page({
},
//选择城市
cityPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
city_index: e.detail.value,
is_city_change: true,
... ... @@ -87,7 +87,7 @@ Page({
city: self.data.city[self.data.city_index] || self.data.current_student.city,
};
app.post(url, params, header).then((res) => {
console.log('保存', res);
// console.log('保存', res);
if (res.is_success) {
wx.showToast({
title: '编辑成功',
... ...
... ... @@ -29,7 +29,7 @@
getBanner() {
let url = '/portal/Group/banner'
app.post(url, {}, {}).then((res) => {
console.log('获取banner',res)
// console.log('获取banner',res)
this.setData({banner: res.info});
})
},
... ...
... ... @@ -84,7 +84,7 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, header).then((res) => {
console.log('个人信息结果',res);
// console.log('个人信息结果',res);
this.setData({personal_info: res.user})
});
},
... ...
... ... @@ -15,7 +15,7 @@ Page({
//获取轮播当前页
swiperCharge(e) {
console.log(e.detail.current)
// console.log(e.detail.current)
this.setData({
swipercurrent: e.detail.current,
current_student: e.detail.current,
... ... @@ -29,7 +29,7 @@ Page({
"XX-Token": wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
console.log(res);
// console.log(res);
this.setData({imgsUrl: res.list, service: res.service})
})
},
... ... @@ -42,7 +42,7 @@ Page({
"XX-Token": wx.getStorageSync('token')
}
app.post(url, {}, {}).then((res) => {
console.log('畅玩卡说明',res);
// console.log('畅玩卡说明',res);
this.setData({service: res})
})
},
... ...
... ... @@ -25,7 +25,6 @@ Page({
student_list: [],
},
handleBackground() {
console.log('111')
this.setData({ 'modal_data.is_showModal': false})
},
//更换手机号
... ... @@ -47,7 +46,7 @@ Page({
//编辑学员信息
editInfo(e) {
const current = e.currentTarget.dataset.index;
console.log(current,JSON.stringify(this.data.student_list[current]));
// console.log(current,JSON.stringify(this.data.student_list[current]));
wx.navigateTo({
url: '../edit-student/edit-student?current_student=' +
JSON.stringify(this.data.student_list[current]) +
... ... @@ -83,7 +82,6 @@ Page({
is_delete: true,
});
if(this.data.is_delete) {
console.log('diaoyong');
this.delStudent(this.data.current_student);
}
},
... ... @@ -93,14 +91,12 @@ Page({
},
//删除学员
delStudent(e) {
console.log(e);
// var current = e.currentTarget.dataset.index;
if(typeof(e) === "number") {
this.setData({current_student: e});
}else {
this.setData({current_student: e.currentTarget.dataset.index});
}
console.log('current_student',this.data.current_student);
if(this.data.is_delete) {
if(this.data.student_list[this.data.current_student].is_end === 1) {//该学员已绑卡,不能删除
this.setData({'state_data.is_showSuccessModal': true,is_delete: false})
... ... @@ -113,7 +109,7 @@ Page({
id: this.data.student_list[this.data.current_student].id,
};
app.post(url, params, header).then((res) => {
console.log('删除学员结果', res);
// console.log('删除学员结果', res);
});
const arr = []
this.data.student_list.map((item) => {
... ... @@ -121,7 +117,7 @@ Page({
arr.push(item)
}
});
console.log('arr', arr);
// console.log('arr', arr);
this.setData({student_list: arr,is_delete: false});
}
}else {
... ... @@ -138,13 +134,12 @@ Page({
"XX-token": wx.getStorageSync('token')
};
app.post(url, {}, header).then((res) => {
console.log('个人信息结果', res);
// console.log('个人信息结果', res);
this.setData({personal_info: res.user})
});
},
//获取学员列表
getStudentList() {
console.log(this.data.page_number);
if(!this.data.has_more) return;
this.setData({has_more: false});
let url = '/user/Student/student_list';
... ... @@ -155,7 +150,7 @@ Page({
page: this.data.page_number,
};
app.post(url,params,header).then((res) => {
console.log('学员列表',res);
// console.log('学员列表',res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
... ... @@ -222,7 +217,7 @@ Page({
icon: 'none'
});
}
console.log('上拉加载');
// console.log('上拉加载');
},
/**
... ...
... ... @@ -44,7 +44,7 @@ Page({
page: this.data.page_number,
};
app.post(url,params,header).then((res) => {
console.log('学员列表',res);
// console.log('学员列表',res);
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
... ... @@ -53,63 +53,62 @@ Page({
res.list.forEach((item) => {
new_arr.push({ ...item, checked: false })
});//给每一项添加checked属性
console.log(new_arr);
// console.log(new_arr);
this.setData({student_list:this.data.student_list.concat(new_arr)})
})
},
//选择学员(待确认可选)
chooseChildren(e) {
console.log('29------e', e);
// const current = e.currentTarget.dataset.index;
const that = this;
if(that.data.detail.status === 1) {//待确认可选择学员
console.log(e.detail);
// console.log(e.detail);
var index_arr = e.detail.value;
console.log(index_arr);
// console.log(index_arr);
//新建数组全部设置为没被选中
var new_arr = [];
that.data.student_list.forEach((item) => {
new_arr.push({ ...item, checked: false })
});//给每一项添加checked属性
console.log('new_arr',new_arr);
// console.log('new_arr',new_arr);
var new_itmes = new_arr;
console.log('new_itmes', new_itmes);
// console.log('new_itmes', new_itmes);
if(that.data.detail.num >=2) { //两个学员预约时
console.log('两个学员');
// console.log('两个学员');
if (index_arr.length > 2) {
//取出倒数两个值
var key1 = index_arr[index_arr.length - 1];
var key2 = index_arr[index_arr.length - 2];
// var key3 = skin[skin.length - 3];
// console.log(key1, key2, key3);
console.log(key1, key2);
console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id);
// console.log(key1, key2);
// console.log(new_itmes[key1]['checked'],new_itmes[key1].id,new_itmes[key2].id);
//设置最后两个值为选中状态
new_itmes[key1]['checked'] = true
new_itmes[key2]['checked'] = true
// new_itmes[key3 - 1]['checked'] = 'true'
//删除被选中的第一个值
index_arr.splice(0, 1);
console.log('skin',index_arr);
// console.log('skin',index_arr);
const id_arr = [];
id_arr.push(new_itmes[key1].id,new_itmes[key2].id);
that.setData({student_id: id_arr.join(','),is_choose_student:true});
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
} else {
const checked_student = [];
//被选中少于两个,直接设置被选中
for (var i = 0; i < index_arr.length; i++) {
var key = index_arr[i]
console.log('key', key);
// console.log('key', key);
new_itmes[key]['checked'] = true
}
console.log('选一个时候new_itmes', new_itmes);
// console.log('选一个时候new_itmes', new_itmes);
new_itmes.forEach((item) => {
if(item.checked) {
checked_student.push(item)
}
});
console.log('选择学员length', checked_student,checked_student.length);
// console.log('选择学员length', checked_student,checked_student.length);
if(checked_student.length>=2) {
const arr = [];
new_itmes.forEach((item) => {
... ... @@ -122,36 +121,36 @@ Page({
wx.showToast({title:'请选择两个学员!',icon:'none'});
that.setData({student_id: new_itmes[key].id,is_choose_student:true});
}
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
}
}else if(that.data.detail.num <2){//一个学员预约时
console.log('一个学员');
// console.log('一个学员');
if (index_arr.length > 1) {
//取出倒数一个值
var key1 = index_arr[index_arr.length - 1];
// var key2 = skin[skin.length - 2];
// var key3 = skin[skin.length - 3];
// console.log(key1, key2, key3);
console.log(key1);
console.log(new_itmes[key1]['checked'],new_itmes[key1].id);
// console.log(key1);
// console.log(new_itmes[key1]['checked'],new_itmes[key1].id);
//设置最后一个值为选中状态
new_itmes[key1]['checked'] = true
// new_itmes[key2]['checked'] = true
// new_itmes[key3 - 1]['checked'] = 'true'
//删除被选中的第一个值
index_arr.splice(0, 1);
console.log('skin',index_arr);
// console.log('skin',index_arr);
that.setData({student_id: new_itmes[key1].id,is_choose_student:true});
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
} else {
//被选中少于1个,直接设置被选中
for (var i = 0; i < index_arr.length; i++) {
var key = index_arr[i]
console.log('key', key);
// console.log('key', key);
new_itmes[key]['checked'] = true
}
that.setData({student_id: new_itmes[key].id,is_choose_student:true});
console.log('student_id', that.data.student_id);
// console.log('student_id', that.data.student_id);
}
}
... ... @@ -189,7 +188,7 @@ Page({
},
//获取预约详情
getAppointmentInfo() {
console.log('this.data.student_list', this.data.student_list);
// console.log('this.data.student_list', this.data.student_list);
let url = '/user/Reservation/reservation_detail';
let header = {
"XX-token": wx.getStorageSync('token')
... ... @@ -198,48 +197,46 @@ Page({
reservation_id: this.data.reservation_id,
};
app.post(url,params,header).then((res) => {
console.log('预约详情',res.info.status === 1);
// console.log('预约详情',res.info.status === 1);
this.setData({
detail: res.info,
});
if(this.data.detail.status === 1 && !this.data.is_buy) {
console.log('111111111111111');
this.getStudentList();
}
});
},
//更新购买状态
refreshBuyState() {
console.log('更新购买状态---学生id--人数',this.data.detail.num,this.data.is_buy,this.data.choose_student_id);
// console.log('更新购买状态---学生id--人数',this.data.detail.num,this.data.is_buy,this.data.choose_student_id);
if(this.data.is_buy) {
if(this.data.detail.num<2) {
this.data.student_list.forEach((item) => {
item.checked = false;
if (item.id === this.data.choose_student_id) {
console.log('item.id', item.id);
// console.log('item.id', item.id);
item.checked = true;
}
});
this.setData({student_list:this.data.student_list,is_choose_student:true})
console.log('student_list',this.data.student_list);
// console.log('student_list',this.data.student_list);
}else if(this.data.detail.num>=2) {
console.log('购买完进入两个学员student_list',this.data.student_list);
// console.log('购买完进入两个学员student_list',this.data.student_list);
this.data.student_list.forEach((item) => {
item.checked = false;
if (item.id === this.data.choose_student_id) {
console.log('item.id', item.id);
// console.log('item.id', item.id);
item.checked = true;
// total_student_num.push(item)
}
});
this.setData({student_list:this.data.student_list,is_choose_student:true,});
console.log('student_list',this.data.student_list);
// console.log('student_list',this.data.student_list);
}
}
},
//取消
clickCancel(e) {
console.log('取消',e);
let url = '/user/Reservation/reservation_cancel';
let header = {
"XX-token": wx.getStorageSync('token')
... ... @@ -249,19 +246,19 @@ Page({
formId: e.detail.formId,
};
app.post(url, params,header).then((res) => {
console.log('取消',res);
// console.log('取消',res);
// this.setData({orderList: res.list})
})
},
//确认
clickConfirm(e) {
console.log(e.detail);
// console.log(e.detail);
if(this.data.student_list.length === 0) {
wx.showToast({title: '请添加学员!',icon:'none'})
}else if(!this.data.is_choose_student) {
wx.showToast({title: '请选择学员!',icon:'none'})
}else if(this.data.detail.num>=2 && ('' + this.data.student_id).indexOf(',') === -1) {
console.log('检验student_id',('' + this.data.student_id).indexOf(','));
// console.log('检验student_id',('' + this.data.student_id).indexOf(','));
wx.showToast({title:'请选择两个学员!',icon:'none'})
}else {
// this.setData({'modal_data.is_showModal': true})
... ... @@ -278,7 +275,7 @@ Page({
students: this.data.student_id,
};
app.post(url,params,header).then((res) => {
console.log('提交预约信息',res);
// console.log('提交预约信息',res);
if(res.data.card_modal === 1) {
this.setData({'modal_data.is_showModal': true});
}else if(res.data.reservation_modal === 1) {
... ... @@ -292,8 +289,8 @@ Page({
*/
onLoad: function (options) {
const self =this;
console.log('load');
console.log(options);
// console.log('load');
// console.log(options);
self.setData({
currentTab: +options.currentTab?+options.currentTab:'',
reservation_id: +options.reservation_id?options.reservation_id:'',
... ...
... ... @@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
... ...