...
|
...
|
@@ -5,12 +5,13 @@ Page({ |
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
input_bottom: 0,
|
|
|
enroll_arr: ['线上', '线下', '线上及线下'],
|
|
|
check_arr: [
|
|
|
"摄影(设备自带",
|
|
|
"摄像(设备自带",
|
|
|
"摄影(设备自带)",
|
|
|
"摄像(设备自带)",
|
|
|
"爱心车队",
|
|
|
"现场服务(签到、指引、礼仪等",
|
|
|
"现场服务(签到、指引、礼仪等)",
|
|
|
"线上答疑",
|
|
|
"门诊服务"
|
|
|
],
|
...
|
...
|
@@ -20,12 +21,6 @@ Page({ |
|
|
eat_arr: [
|
|
|
'午餐', '晚餐'
|
|
|
],
|
|
|
date_arr: [
|
|
|
"2019-07-21",
|
|
|
"2019-07-22",
|
|
|
"2019-07-23",
|
|
|
"2019-07-24"
|
|
|
],
|
|
|
t_arr: [{ //选择日期数组
|
|
|
date: '',
|
|
|
time: ''
|
...
|
...
|
@@ -44,10 +39,23 @@ Page({ |
|
|
],
|
|
|
|
|
|
t_type: false,
|
|
|
z_type: false,
|
|
|
e_type: false,
|
|
|
z_type: true,
|
|
|
e_type: true,
|
|
|
cover_type: false
|
|
|
},
|
|
|
// 获取到焦点
|
|
|
focus: function (e) {
|
|
|
this.setData({
|
|
|
input_bottom: 100
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 失去焦点
|
|
|
no_focus: function (e) {
|
|
|
this.setData({
|
|
|
input_bottom: 0
|
|
|
})
|
|
|
},
|
|
|
// 审核用户信息是否通过
|
|
|
examine(e){
|
|
|
let that = this
|
...
|
...
|
@@ -57,7 +65,7 @@ Page({ |
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
let params = {
|
|
|
id: that.data.user_id,
|
|
|
id: that.data.info.id,
|
|
|
status: id
|
|
|
}
|
|
|
app.post(url, params, head).then((res) => {
|
...
|
...
|
@@ -173,12 +181,20 @@ Page({ |
|
|
that.setData({
|
|
|
z_type: true
|
|
|
})
|
|
|
} else {
|
|
|
that.setData({
|
|
|
z_type: false
|
|
|
})
|
|
|
}
|
|
|
} else if (type == 3) {
|
|
|
if (that.data.e_arr[index].date != "" && that.data.e_arr[index].time != "") {
|
|
|
that.setData({
|
|
|
e_type: true
|
|
|
})
|
|
|
} else {
|
|
|
that.setData({
|
|
|
e_type: false
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -208,7 +224,29 @@ Page({ |
|
|
})
|
|
|
this.judge_status(2, index)
|
|
|
},
|
|
|
|
|
|
//删除日期,入住,用餐
|
|
|
del(e){
|
|
|
let status = Number(e.currentTarget.dataset.status)
|
|
|
let index = e.currentTarget.dataset.index
|
|
|
let arr = status > 1 ? (status > 2 ? this.data.e_arr : this.data.z_arr) : this.data.t_arr
|
|
|
arr.splice(index, 1)
|
|
|
if (status == 1){
|
|
|
this.setData({
|
|
|
t_arr: arr,
|
|
|
t_type: true
|
|
|
})
|
|
|
} else if(status == 2){
|
|
|
this.setData({
|
|
|
z_arr: arr,
|
|
|
z_type: true
|
|
|
})
|
|
|
} else if (status == 3) {
|
|
|
this.setData({
|
|
|
e_arr: arr,
|
|
|
e_type: true
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// 添加日期,入住,用餐
|
|
|
add_item(e) {
|
|
|
let id = e.currentTarget.dataset.id
|
...
|
...
|
@@ -231,7 +269,7 @@ Page({ |
|
|
t_type: false
|
|
|
})
|
|
|
} else if (id == 2) {
|
|
|
if (this.data.z_type == false) {
|
|
|
if (this.data.z_arr[this.data.z_arr.length - 1].date == "" && this.data.z_arr[this.data.z_arr.length - 1].idcard == "") {
|
|
|
wx.showToast({
|
|
|
title: '请先完善申请入住信息',
|
|
|
icon: 'none'
|
...
|
...
|
@@ -248,7 +286,7 @@ Page({ |
|
|
z_type: false
|
|
|
})
|
|
|
} else if (id == 3) {
|
|
|
if (this.data.e_type == false) {
|
|
|
if (this.data.e_arr[this.data.e_arr.length - 1].date == "" && this.data.e_arr[this.data.e_arr.length - 1].time == "") {
|
|
|
wx.showToast({
|
|
|
title: '请先完善申请用餐信息',
|
|
|
icon: 'none'
|
...
|
...
|
@@ -288,12 +326,16 @@ Page({ |
|
|
let params = {
|
|
|
id: id
|
|
|
}
|
|
|
if (this.data.status){
|
|
|
params.user_id = this.data.user_id
|
|
|
}
|
|
|
let header = {
|
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
this.setData({
|
|
|
info: res,
|
|
|
date_arr: res.time, //活动日期
|
|
|
type_id: res.work_type ? res.work_type: null,
|
|
|
type: res.work_type ? this.data.enroll_arr[Number(res.work_type) - 1]:null,
|
|
|
check_id: res.work_content ? res.work_content : null,
|
...
|
...
|
@@ -301,9 +343,7 @@ Page({ |
|
|
t_arr: res.select_time ? res.select_time : this.data.t_arr,
|
|
|
z_arr: res.apply_stay ? res.apply_stay : this.data.z_arr,
|
|
|
e_arr: res.apply_food ? res.apply_food : this.data.e_arr,
|
|
|
t_type: res.select_time?true:false,
|
|
|
z_type: res.apply_stay ? true : false,
|
|
|
e_type: res.apply_food ? true : false
|
|
|
t_type: res.select_time?true:false
|
|
|
})
|
|
|
|
|
|
})
|
...
|
...
|
@@ -368,7 +408,7 @@ Page({ |
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
wx.showToast({
|
|
|
title: '报名成功,请等待审核',
|
|
|
title: '报名成功',
|
|
|
duration: 1000,
|
|
|
success: ()=>{
|
|
|
setTimeout(()=>{
|
...
|
...
|
@@ -388,8 +428,6 @@ Page({ |
|
|
if (options.type){
|
|
|
this.setData({
|
|
|
t_type: true,
|
|
|
z_type: true,
|
|
|
e_type: true,
|
|
|
page_type: options.type
|
|
|
})
|
|
|
}
|
...
|
...
|
|