|
@ -35,6 +35,9 @@ Page({ |
|
|
dialogTips: '', |
|
|
dialogTips: '', |
|
|
sponsor: '', // 主办方
|
|
|
sponsor: '', // 主办方
|
|
|
periodList: [], // 时间段
|
|
|
periodList: [], // 时间段
|
|
|
|
|
|
actPeriodId: [], //
|
|
|
|
|
|
cancelPeriodList: [], // 取消报名的时间段
|
|
|
|
|
|
textareaValue: '', // 取消原因
|
|
|
}, |
|
|
}, |
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
console.log("当前时间" + getTimestamp()) |
|
|
console.log("当前时间" + getTimestamp()) |
|
@ -52,8 +55,6 @@ Page({ |
|
|
// }
|
|
|
// }
|
|
|
// 获取默认网格
|
|
|
// 获取默认网格
|
|
|
this.getDefaultGridInfo() |
|
|
this.getDefaultGridInfo() |
|
|
// 获取活动时间段
|
|
|
|
|
|
this.getActPeriods() |
|
|
|
|
|
}, |
|
|
}, |
|
|
onReachBottom () { |
|
|
onReachBottom () { |
|
|
if (this.data.curSize == this.data.pageSize) { |
|
|
if (this.data.curSize == this.data.pageSize) { |
|
@ -131,6 +132,8 @@ Page({ |
|
|
// dialogConfirmText: '确定',
|
|
|
// dialogConfirmText: '确定',
|
|
|
// dialogCancelText: ''
|
|
|
// dialogCancelText: ''
|
|
|
// })
|
|
|
// })
|
|
|
|
|
|
// 获取活动时间段
|
|
|
|
|
|
this.getActPeriods() |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
// dialogVisible: this.data.periodList.length == 0 ? true : false,
|
|
|
// dialogVisible: this.data.periodList.length == 0 ? true : false,
|
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
@ -141,6 +144,8 @@ Page({ |
|
|
dialogCancelText: "否" |
|
|
dialogCancelText: "否" |
|
|
}) |
|
|
}) |
|
|
} else if (uservolunteerflag == 1) { |
|
|
} else if (uservolunteerflag == 1) { |
|
|
|
|
|
// 获取活动时间段
|
|
|
|
|
|
this.getActPeriods() |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
// dialogVisible: this.data.periodList.length == 0 ? true : false,
|
|
|
// dialogVisible: this.data.periodList.length == 0 ? true : false,
|
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
@ -181,6 +186,7 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
// 取消报名
|
|
|
// 取消报名
|
|
|
prompt () { |
|
|
prompt () { |
|
|
|
|
|
this.getSignInActPeriods() |
|
|
const now = getTimestamp() |
|
|
const now = getTimestamp() |
|
|
if (now > this.data.detail.signupEndTime) { |
|
|
if (now > this.data.detail.signupEndTime) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
@ -246,8 +252,18 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
cancelSignupCallback (e) { |
|
|
cancelSignupCallback (e) { |
|
|
let id = this.data.id |
|
|
let id = this.data.id |
|
|
let reason = e.detail.data |
|
|
let actPeriodId = this.data.actPeriodId |
|
|
api.cancelsignup(id, reason).then(() => { |
|
|
let reason = this.data.textareaValue |
|
|
|
|
|
console.log(this.data.actPeriodId) |
|
|
|
|
|
if (actPeriodId.length == 0) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: "请选择取消的时间段", |
|
|
|
|
|
icon: "none", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
api.cancelsignup(id, reason, actPeriodId).then(() => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: "取消报名成功", |
|
|
title: "取消报名成功", |
|
|
icon: "none", |
|
|
icon: "none", |
|
@ -349,11 +365,41 @@ Page({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getActPeriods () { |
|
|
getActPeriods () { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
periodList: [], |
|
|
|
|
|
actPeriodId: [], |
|
|
|
|
|
}) |
|
|
api.getActPeriods(this.data.id).then(res => { |
|
|
api.getActPeriods(this.data.id).then(res => { |
|
|
console.log(res.data) |
|
|
console.log(res.data) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
periodList: res.data |
|
|
periodList: res.data |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
textareaInput (e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
textareaValue: e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
closeCancelDialog () { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
cancelPeriodList: [], |
|
|
|
|
|
actPeriodId: [], |
|
|
|
|
|
textareaValue: '', |
|
|
|
|
|
cancelSignupVisible: !this.data.cancelSignupVisible, |
|
|
|
|
|
cancelSignupTipValue: "" |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
getSignInActPeriods () { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
cancelPeriodList: [], |
|
|
|
|
|
actPeriodId: [], |
|
|
|
|
|
}) |
|
|
|
|
|
api.getSignInActPeriods(this.data.id).then(res => { |
|
|
|
|
|
console.log(res.data) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
cancelPeriodList: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(err => {}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |