|
@ -30,7 +30,11 @@ Page({ |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
curSize: 0, // 当前页码获取的活动条数
|
|
|
curSize: 0, // 当前页码获取的活动条数
|
|
|
isPreviewImage: false //是否从图片预览返回
|
|
|
isPreviewImage: false, //是否从图片预览返回
|
|
|
|
|
|
showPeriodDialog: false, // 是否显示选择时间段对话框
|
|
|
|
|
|
dialogTips: '', |
|
|
|
|
|
sponsor: '', // 主办方
|
|
|
|
|
|
periodList: [], // 时间段
|
|
|
}, |
|
|
}, |
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
console.log("当前时间" + getTimestamp()) |
|
|
console.log("当前时间" + getTimestamp()) |
|
@ -48,6 +52,8 @@ Page({ |
|
|
// }
|
|
|
// }
|
|
|
// 获取默认网格
|
|
|
// 获取默认网格
|
|
|
this.getDefaultGridInfo() |
|
|
this.getDefaultGridInfo() |
|
|
|
|
|
// 获取活动时间段
|
|
|
|
|
|
this.getActPeriods() |
|
|
}, |
|
|
}, |
|
|
onReachBottom () { |
|
|
onReachBottom () { |
|
|
if (this.data.curSize == this.data.pageSize) { |
|
|
if (this.data.curSize == this.data.pageSize) { |
|
@ -72,7 +78,8 @@ Page({ |
|
|
actEndTime: res.data.actEndTime.substring(0, 16), |
|
|
actEndTime: res.data.actEndTime.substring(0, 16), |
|
|
signupEndTime: res.data.signupEndTime.substring(0, 16), |
|
|
signupEndTime: res.data.signupEndTime.substring(0, 16), |
|
|
timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false, |
|
|
timeJudge: getTimestamp() > res.data.actEndTime.substring(0, 16) ? true : false, |
|
|
preloadVisible: false |
|
|
preloadVisible: false, |
|
|
|
|
|
sponsor: res.data.sponsor |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
@ -106,7 +113,8 @@ Page({ |
|
|
url: `../clockIn/clockIn?id=${id}¤tUserStatus=${currentUserStatus}` |
|
|
url: `../clockIn/clockIn?id=${id}¤tUserStatus=${currentUserStatus}` |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
goVolunteer (e) { //我要报名 用户认证志愿者标识(0-未认证,1-已认证)
|
|
|
goVolunteer (e) { |
|
|
|
|
|
// 我要报名 用户认证志愿者标识(0-未认证,1-已认证)
|
|
|
// 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证
|
|
|
// 0-待审核 提醒用户志愿者身份认证审核中,不能报名也不用去认证
|
|
|
// 1 - 认证通过 直接报名
|
|
|
// 1 - 认证通过 直接报名
|
|
|
// 2 - 待认证 提示用户去认证
|
|
|
// 2 - 待认证 提示用户去认证
|
|
@ -124,7 +132,9 @@ Page({ |
|
|
// dialogCancelText: ''
|
|
|
// dialogCancelText: ''
|
|
|
// })
|
|
|
// })
|
|
|
this.setData({ |
|
|
this.setData({ |
|
|
dialogVisible: !this.data.dialogVisible, |
|
|
// dialogVisible: !this.data.dialogVisible,
|
|
|
|
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
|
|
|
|
dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`, |
|
|
dialogTitle: "报名提醒", |
|
|
dialogTitle: "报名提醒", |
|
|
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], |
|
|
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], |
|
|
dialogConfirmText: "是", |
|
|
dialogConfirmText: "是", |
|
@ -132,7 +142,9 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
} else if (uservolunteerflag == 1) { |
|
|
} else if (uservolunteerflag == 1) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
dialogVisible: !this.data.dialogVisible, |
|
|
// dialogVisible: !this.data.dialogVisible,
|
|
|
|
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
|
|
|
|
dialogTips: `报名时间截止之前可取消,缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`, |
|
|
dialogTitle: "报名提醒", |
|
|
dialogTitle: "报名提醒", |
|
|
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], |
|
|
dialogContent: ["报名时间截止之前可取消", `缺席活动扣除${this.data.detail.punishmentPoints}积分,是否确定报名`], |
|
|
dialogConfirmText: "是", |
|
|
dialogConfirmText: "是", |
|
@ -204,8 +216,11 @@ Page({ |
|
|
console.log("::::::" + this.data.uservolunteerflag.length) |
|
|
console.log("::::::" + this.data.uservolunteerflag.length) |
|
|
if (this.data.uservolunteerflag.length > 0) { |
|
|
if (this.data.uservolunteerflag.length > 0) { |
|
|
if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { |
|
|
if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { |
|
|
let id = this.data.id |
|
|
let param = { |
|
|
api.signup(id).then(res => { |
|
|
actId: this.data.id, |
|
|
|
|
|
actPeriodId: this.data.actPeriodId |
|
|
|
|
|
} |
|
|
|
|
|
api.signup(param).then(res => { |
|
|
if (res.code == 0) { |
|
|
if (res.code == 0) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
dialogVisible: !this.data.dialogVisible, |
|
|
dialogVisible: !this.data.dialogVisible, |
|
@ -277,5 +292,68 @@ Page({ |
|
|
title: "活动详情", |
|
|
title: "活动详情", |
|
|
path: `/pages/heartNew/heartNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}` |
|
|
path: `/pages/heartNew/heartNew?shareType=heartDetail&id=${this.data.id}&defaultGridId=${this.data.defaultGridId}` |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
checkboxChange (e) { |
|
|
|
|
|
console.log(e.detail.value) |
|
|
|
|
|
// let actPeriodId = []
|
|
|
|
|
|
// if (e.detail.value.length > 0) {
|
|
|
|
|
|
// e.detail.value.forEach(item => {
|
|
|
|
|
|
// let ob = {
|
|
|
|
|
|
// id: item
|
|
|
|
|
|
// }
|
|
|
|
|
|
// actPeriodId.push(ob)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// }
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
actPeriodId: e.detail.value |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
onCancelPeriod () { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showPeriodDialog: false, |
|
|
|
|
|
actPeriodId: [] |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
onConfirmPeriod () { |
|
|
|
|
|
console.log("::::::" + this.data.uservolunteerflag.length) |
|
|
|
|
|
if (this.data.uservolunteerflag.length > 0) { |
|
|
|
|
|
if (this.data.uservolunteerflag == 0 || this.data.uservolunteerflag == 1) { |
|
|
|
|
|
let param = { |
|
|
|
|
|
actId: this.data.id, |
|
|
|
|
|
actPeriodId: this.data.actPeriodId |
|
|
|
|
|
} |
|
|
|
|
|
api.signup(param).then(res => { |
|
|
|
|
|
if (res.code == 0) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
showPeriodDialog: !this.data.showPeriodDialog, |
|
|
|
|
|
dialogVisible: !this.data.dialogVisible, |
|
|
|
|
|
dialogTitle: "报名成功", |
|
|
|
|
|
dialogContent: ["正在审核中", "请耐心等待消息通知!"], |
|
|
|
|
|
dialogConfirmText: "确定", |
|
|
|
|
|
dialogCancelText: "", |
|
|
|
|
|
uservolunteerflag: "" |
|
|
|
|
|
}) |
|
|
|
|
|
this.getDetail() |
|
|
|
|
|
} else { //点击我要报名,刚好已经报满,此时弹出已报满的提示框,点击确定后,我要报名按钮变成已报满按钮(置灰)
|
|
|
|
|
|
this.getDetail() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (this.data.uservolunteerflag == 2) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: "/subpages/heart/pages/volunteer/volunteer" |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log("报名成功以后不进行操作") |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getActPeriods () { |
|
|
|
|
|
api.getActPeriods(this.data.id).then(res => { |
|
|
|
|
|
console.log(res.data) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
periodList: res.data |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |