From bc12ee4b12b621aeb7d4d584bb7ac4b6d493a8e9 Mon Sep 17 00:00:00 2001
From: ZhaoTongYao <531131322@qq.com>
Date: Mon, 27 Sep 2021 17:14:50 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC1.7.21=20=E5=BF=97=E6=84=BF?=
=?UTF-8?q?=E8=80=85=E6=B4=BB=E5=8A=A8=E5=8F=96=E6=B6=88=E6=8A=A5=E5=90=8D?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=AE=B5=E9=80=89=E6=8B=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/toRegister/toRegister.js | 2 +-
.../heart/pages/heartDetail/heartDetail.js | 54 +++++++++++++++++--
.../heart/pages/heartDetail/heartDetail.wxml | 43 +++++++++++++--
.../heart/pages/heartDetail/heartDetail.wxss | 30 ++++++++++-
utils/api.js | 12 +++--
5 files changed, 128 insertions(+), 13 deletions(-)
diff --git a/pages/toRegister/toRegister.js b/pages/toRegister/toRegister.js
index f1efd37..caf39aa 100644
--- a/pages/toRegister/toRegister.js
+++ b/pages/toRegister/toRegister.js
@@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
- const versionNum = "1.7.20"
+ const versionNum = "1.7.21"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data ? res.data.scanFlag : '1'
diff --git a/subpages/heart/pages/heartDetail/heartDetail.js b/subpages/heart/pages/heartDetail/heartDetail.js
index c911c9f..d435c62 100644
--- a/subpages/heart/pages/heartDetail/heartDetail.js
+++ b/subpages/heart/pages/heartDetail/heartDetail.js
@@ -35,6 +35,9 @@ Page({
dialogTips: '',
sponsor: '', // 主办方
periodList: [], // 时间段
+ actPeriodId: [], //
+ cancelPeriodList: [], // 取消报名的时间段
+ textareaValue: '', // 取消原因
},
onLoad: function (options) {
console.log("当前时间" + getTimestamp())
@@ -52,8 +55,6 @@ Page({
// }
// 获取默认网格
this.getDefaultGridInfo()
- // 获取活动时间段
- this.getActPeriods()
},
onReachBottom () {
if (this.data.curSize == this.data.pageSize) {
@@ -131,6 +132,8 @@ Page({
// dialogConfirmText: '确定',
// dialogCancelText: ''
// })
+ // 获取活动时间段
+ this.getActPeriods()
this.setData({
// dialogVisible: this.data.periodList.length == 0 ? true : false,
showPeriodDialog: !this.data.showPeriodDialog,
@@ -141,6 +144,8 @@ Page({
dialogCancelText: "否"
})
} else if (uservolunteerflag == 1) {
+ // 获取活动时间段
+ this.getActPeriods()
this.setData({
// dialogVisible: this.data.periodList.length == 0 ? true : false,
showPeriodDialog: !this.data.showPeriodDialog,
@@ -181,6 +186,7 @@ Page({
},
// 取消报名
prompt () {
+ this.getSignInActPeriods()
const now = getTimestamp()
if (now > this.data.detail.signupEndTime) {
this.setData({
@@ -246,8 +252,18 @@ Page({
},
cancelSignupCallback (e) {
let id = this.data.id
- let reason = e.detail.data
- api.cancelsignup(id, reason).then(() => {
+ let actPeriodId = this.data.actPeriodId
+ 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({
title: "取消报名成功",
icon: "none",
@@ -349,11 +365,41 @@ Page({
}
},
getActPeriods () {
+ this.setData({
+ periodList: [],
+ actPeriodId: [],
+ })
api.getActPeriods(this.data.id).then(res => {
console.log(res.data)
this.setData({
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 => {})
}
})
\ No newline at end of file
diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxml b/subpages/heart/pages/heartDetail/heartDetail.wxml
index 5bebd74..6c49592 100644
--- a/subpages/heart/pages/heartDetail/heartDetail.wxml
+++ b/subpages/heart/pages/heartDetail/heartDetail.wxml
@@ -368,22 +368,28 @@
content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
-
-
+ -->
请选择时间段
+
-
@@ -396,4 +402,33 @@
+
+
+
+
+ 请选择时间段
+
+
+
+
+ {{item.actPeriodStartTime}} 至
+ {{item.actPeriodEndTime}}
+
+
+
+
+
+
+
+
+ {{cancelSignupTipValue}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subpages/heart/pages/heartDetail/heartDetail.wxss b/subpages/heart/pages/heartDetail/heartDetail.wxss
index 5936bc7..715c7af 100644
--- a/subpages/heart/pages/heartDetail/heartDetail.wxss
+++ b/subpages/heart/pages/heartDetail/heartDetail.wxss
@@ -390,14 +390,24 @@ line-height: 75rpx;
font-size: 36rpx;
}
.period-dialog .period-content {
- height: 400rpx;
+ max-height: 400rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
+ overflow: auto;
+}
+.period-dialog .period-content .item-header {
+ display: flex;
+}
+.item-header .item-header-1 {
+ width: 380rpx;
}
.period-dialog .period-content .checkbox-group {
height: 100%;
/* overflow: auto; */
}
+.disabled {
+ opacity: 0.5;
+}
.checkbox-group .checkbox-item {
display: flex;
width: 100%;
@@ -435,4 +445,22 @@ line-height: 75rpx;
line-height: 80rpx;
text-align: center;
color: #04BCA0;
+}
+.period-dialog .textarea {
+ width: 100%;
+ height: 345rpx;
+ border-radius: 16rpx;
+ box-sizing: border-box;
+ padding: 27rpx 17rpx 0;
+ margin-bottom: 20rpx;
+}
+.period-dialog .textarea textarea {
+ width: 100%;
+ height: 100%;
+ font-size: 32rpx;
+ line-height: 44rpx;
+ color: #666;
+ background-color: #f7f7f7;
+ padding: 10rpx;
+ box-sizing: border-box;
}
\ No newline at end of file
diff --git a/utils/api.js b/utils/api.js
index a7ef28b..c177f1d 100755
--- a/utils/api.js
+++ b/utils/api.js
@@ -81,7 +81,8 @@ module.exports = {
getEnterpriseReportList,
getEnterpriseReportDetail,
//
- getActPeriods
+ getActPeriods,
+ getSignInActPeriods
}
function getToken (wxCode) {
@@ -450,10 +451,11 @@ function signup (param) {
/**
* 取消报名
*/
-function cancelsignup (id, response) {
+function cancelsignup (id, response, actPeriodId) {
return fly.post("heart/act/cancelsignup", {
actId: id,
- failureReason: response
+ failureReason: response,
+ actPeriodId: actPeriodId
})
}
@@ -670,4 +672,8 @@ function getEnterpriseReportDetail (id) {
// 活动参与时间段列表接口
function getActPeriods (actId) {
return fly.get(`heart/act/getActPeriods`, {actId: actId})
+}
+// 取消报名时间段列表接口
+function getSignInActPeriods (actId) {
+ return fly.get(`heart/act/getSignInActPeriods`, {actId: actId})
}
\ No newline at end of file