Showing
2 changed files
with
90 additions
and
30 deletions
| ... | @@ -63,6 +63,8 @@ | ... | @@ -63,6 +63,8 @@ |
| 63 | <van-tag @tap="changeStatus('apply', item.id)" v-if="item.status === 'apply'" :round="true" color="#D7F3FF" text-color="#0091FD" size="large">已报名</van-tag> | 63 | <van-tag @tap="changeStatus('apply', item.id)" v-if="item.status === 'apply'" :round="true" color="#D7F3FF" text-color="#0091FD" size="large">已报名</van-tag> |
| 64 | <van-tag @tap="changeStatus('enable', item.id)" v-if="item.status === 'enable'" :round="true" color="#D7FFD7" text-color="#019200" size="large">已签到</van-tag> | 64 | <van-tag @tap="changeStatus('enable', item.id)" v-if="item.status === 'enable'" :round="true" color="#D7FFD7" text-color="#019200" size="large">已签到</van-tag> |
| 65 | <van-tag @tap="changeStatus('absent', item.id)" v-if="item.status === 'absent'" :round="true" color="#FFF5E4" text-color="#FF7300" size="large">未出席</van-tag> | 65 | <van-tag @tap="changeStatus('absent', item.id)" v-if="item.status === 'absent'" :round="true" color="#FFF5E4" text-color="#FF7300" size="large">未出席</van-tag> |
| 66 | + <van-tag @tap="changeStatus('request', item.id)" v-if="item.status === 'request'" :round="true" color="#FFF5E4" text-color="#FF7300" size="large">待审核</van-tag> | ||
| 67 | + <van-tag @tap="changeStatus('reject', item.id)" v-if="item.status === 'reject'" :round="true" color="#FFF5E4" text-color="#FF7300" size="large">已拒绝</van-tag> | ||
| 66 | </van-col> | 68 | </van-col> |
| 67 | </van-row> | 69 | </van-row> |
| 68 | </view> | 70 | </view> |
| ... | @@ -72,7 +74,7 @@ | ... | @@ -72,7 +74,7 @@ |
| 72 | </view> | 74 | </view> |
| 73 | 75 | ||
| 74 | <!-- 切换状态弹出框 --> | 76 | <!-- 切换状态弹出框 --> |
| 75 | - <van-popup :show="show_status_popup" position="bottom" custom-style="height: 45%;" :lock-scroll="true"> | 77 | + <van-popup :show="show_status_popup" position="bottom" custom-style="height: 50%;" :lock-scroll="true"> |
| 76 | <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="status_type_columns" | 78 | <van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="status_type_columns" |
| 77 | toolbar-class="picker-toolbar" @confirm="onStatusTypeConfirm" @cancel="onStatusTypeCancel" /> | 79 | toolbar-class="picker-toolbar" @confirm="onStatusTypeConfirm" @cancel="onStatusTypeCancel" /> |
| 78 | </van-popup> | 80 | </van-popup> |
| ... | @@ -104,16 +106,6 @@ const goToUserInfo = (member_id) => { | ... | @@ -104,16 +106,6 @@ const goToUserInfo = (member_id) => { |
| 104 | }) | 106 | }) |
| 105 | } | 107 | } |
| 106 | 108 | ||
| 107 | -// 处理过滤条件 | ||
| 108 | -const status_type_columns = ref([]) | ||
| 109 | -const internalInstance = getCurrentInstance(); | ||
| 110 | -setTimeout(() => { | ||
| 111 | - if (internalInstance.data.absent) { | ||
| 112 | - status_type_columns.value = ['全部', '已签到', '未出席'] | ||
| 113 | - } else { | ||
| 114 | - status_type_columns.value = ['全部', '已签到', '已报名'] | ||
| 115 | - } | ||
| 116 | -}, 500); | ||
| 117 | </script> | 109 | </script> |
| 118 | 110 | ||
| 119 | <script> | 111 | <script> |
| ... | @@ -153,13 +145,14 @@ export default { | ... | @@ -153,13 +145,14 @@ export default { |
| 153 | activated: 1, | 145 | activated: 1, |
| 154 | show_status_popup: false, | 146 | show_status_popup: false, |
| 155 | status_type: '', | 147 | status_type: '', |
| 148 | + status_type_columns: [], | ||
| 156 | } | 149 | } |
| 157 | }, | 150 | }, |
| 158 | async onShow () { | 151 | async onShow () { |
| 159 | const info = await activityInfoAPI({ i: getCurrentPageParam().id }); | 152 | const info = await activityInfoAPI({ i: getCurrentPageParam().id }); |
| 160 | if (info.code) { | 153 | if (info.code) { |
| 161 | // 判断是否超过活动时间 | 154 | // 判断是否超过活动时间 |
| 162 | - if (+new Date(info.data.activity.activity_time) > +new Date(info.data.server_time)) { | 155 | + if (info.data.activity.activity_time > info.data.server_time) { |
| 163 | this.absent = true; | 156 | this.absent = true; |
| 164 | } | 157 | } |
| 165 | } | 158 | } |
| ... | @@ -173,7 +166,10 @@ export default { | ... | @@ -173,7 +166,10 @@ export default { |
| 173 | // 活动超时翻状态 | 166 | // 活动超时翻状态 |
| 174 | this.reg_list.forEach(item => { | 167 | this.reg_list.forEach(item => { |
| 175 | item.status = item.status === 'apply' ? 'absent' : item.status; | 168 | item.status = item.status === 'apply' ? 'absent' : item.status; |
| 176 | - }) | 169 | + }); |
| 170 | + this.status_type_columns = ['全部', '已签到', '未出席'] | ||
| 171 | + } else { | ||
| 172 | + this.status_type_columns = ['全部', '已签到', '已报名'] | ||
| 177 | } | 173 | } |
| 178 | } | 174 | } |
| 179 | }, | 175 | }, |
| ... | @@ -206,11 +202,23 @@ export default { | ... | @@ -206,11 +202,23 @@ export default { |
| 206 | if (type === 'activity') { // 活动报名 | 202 | if (type === 'activity') { // 活动报名 |
| 207 | this.member_type = 'player'; | 203 | this.member_type = 'player'; |
| 208 | this.activated = 1; | 204 | this.activated = 1; |
| 205 | + if (this.absent) { | ||
| 206 | + this.status_type_columns = ['全部', '已签到', '未出席'] | ||
| 207 | + } else { | ||
| 208 | + this.status_type_columns = ['全部', '已签到', '已报名'] | ||
| 209 | + } | ||
| 209 | } else { // 岗位报名 | 210 | } else { // 岗位报名 |
| 210 | this.member_type = 'volunteer'; | 211 | this.member_type = 'volunteer'; |
| 211 | this.activated = 2; | 212 | this.activated = 2; |
| 213 | + if (this.absent) { | ||
| 214 | + this.status_type_columns = ['全部', '已签到', '未出席', '待审核', '已拒绝'] | ||
| 215 | + } else { | ||
| 216 | + this.status_type_columns = ['全部', '已签到', '已报名', '待审核', '已拒绝'] | ||
| 217 | + } | ||
| 212 | } | 218 | } |
| 213 | // 重置条件 | 219 | // 重置条件 |
| 220 | + this.status_type = ''; | ||
| 221 | + this.status = ''; | ||
| 214 | this.page = 0; | 222 | this.page = 0; |
| 215 | this.reg_list = []; | 223 | this.reg_list = []; |
| 216 | this.flag = false; | 224 | this.flag = false; |
| ... | @@ -229,6 +237,12 @@ export default { | ... | @@ -229,6 +237,12 @@ export default { |
| 229 | if (this.status_type === '未出席' || this.status_type === '已报名') { | 237 | if (this.status_type === '未出席' || this.status_type === '已报名') { |
| 230 | this.status = 'apply'; | 238 | this.status = 'apply'; |
| 231 | } | 239 | } |
| 240 | + if (this.status_type === '待审核') { | ||
| 241 | + this.status = 'request'; | ||
| 242 | + } | ||
| 243 | + if (this.status_type === '已拒绝') { | ||
| 244 | + this.status = 'reject'; | ||
| 245 | + } | ||
| 232 | // 重置条件 | 246 | // 重置条件 |
| 233 | this.page = 0; | 247 | this.page = 0; |
| 234 | this.reg_list = []; | 248 | this.reg_list = []; |
| ... | @@ -238,21 +252,9 @@ export default { | ... | @@ -238,21 +252,9 @@ export default { |
| 238 | onStatusTypeCancel (event) { | 252 | onStatusTypeCancel (event) { |
| 239 | this.show_status_popup = false; | 253 | this.show_status_popup = false; |
| 240 | }, | 254 | }, |
| 241 | - changeStatus (status, id) { | 255 | + async handleStatusReg (id, status) { |
| 242 | - // 已签到不能修改状态 | 256 | + // 改变状态操作接口请求及后续更新 |
| 243 | - if (status === 'enable') { | 257 | + const { code, data } = await statusRegAPI({ i: id, status }); |
| 244 | - Toast('无需修改状态') | ||
| 245 | - } | ||
| 246 | - // 未签到, 已报名 修改状态已签到 | ||
| 247 | - if (status === 'absent' || status === 'apply') { | ||
| 248 | - Dialog.confirm({ | ||
| 249 | - title: '温馨提示', | ||
| 250 | - message: '是否确认修改状态为已签到?', | ||
| 251 | - confirmButtonColor: '#199a74' | ||
| 252 | - }) | ||
| 253 | - .then(async () => { | ||
| 254 | - // on confirm | ||
| 255 | - const { code, data } = await statusRegAPI({ i: id, status: 'enable' }); | ||
| 256 | if (code) { | 258 | if (code) { |
| 257 | Taro.showToast({ | 259 | Taro.showToast({ |
| 258 | title: '修改成功', | 260 | title: '修改成功', |
| ... | @@ -262,7 +264,7 @@ export default { | ... | @@ -262,7 +264,7 @@ export default { |
| 262 | // 手动翻状态-显示 | 264 | // 手动翻状态-显示 |
| 263 | this.reg_list.forEach(item => { | 265 | this.reg_list.forEach(item => { |
| 264 | if (item.id === id) { | 266 | if (item.id === id) { |
| 265 | - item.status = 'enable'; | 267 | + item.status = status; |
| 266 | } | 268 | } |
| 267 | }); | 269 | }); |
| 268 | // 更新用户统计 | 270 | // 更新用户统计 |
| ... | @@ -273,11 +275,44 @@ export default { | ... | @@ -273,11 +275,44 @@ export default { |
| 273 | this.sign_count = data.sign_count; | 275 | this.sign_count = data.sign_count; |
| 274 | } | 276 | } |
| 275 | } | 277 | } |
| 278 | + }, | ||
| 279 | + changeStatus (status, id) { | ||
| 280 | + // 已签到不能修改状态 | ||
| 281 | + if (status === 'enable') { | ||
| 282 | + Toast('无需修改状态') | ||
| 283 | + } | ||
| 284 | + // 未签到, 已报名 修改状态已签到 | ||
| 285 | + if (status === 'absent' || status === 'apply') { | ||
| 286 | + Dialog.confirm({ | ||
| 287 | + title: '温馨提示', | ||
| 288 | + message: '是否确认修改状态为已签到?', | ||
| 289 | + confirmButtonColor: '#199a74' | ||
| 290 | + }) | ||
| 291 | + .then(async () => { | ||
| 292 | + // on confirm | ||
| 293 | + this.handleStatusReg(id, 'enable'); | ||
| 276 | }) | 294 | }) |
| 277 | .catch(() => { | 295 | .catch(() => { |
| 278 | // on cancel | 296 | // on cancel |
| 279 | }); | 297 | }); |
| 280 | } | 298 | } |
| 299 | + if (status === 'request') { | ||
| 300 | + Dialog.confirm({ | ||
| 301 | + title: '温馨提示', | ||
| 302 | + message: '是否审核通过,报名者成为义工?', | ||
| 303 | + confirmButtonColor: '#199a74', | ||
| 304 | + confirmButtonText: '同意', | ||
| 305 | + cancelButtonText: '不同意', | ||
| 306 | + }) | ||
| 307 | + .then(async () => { | ||
| 308 | + // on confirm | ||
| 309 | + this.handleStatusReg(id, 'apply'); | ||
| 310 | + }) | ||
| 311 | + .catch(async () => { | ||
| 312 | + // on cancel | ||
| 313 | + this.handleStatusReg(id, 'reject'); | ||
| 314 | + }); | ||
| 315 | + } | ||
| 281 | } | 316 | } |
| 282 | } | 317 | } |
| 283 | }; | 318 | }; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-27 17:13:05 | 2 | * @Date: 2022-09-27 17:13:05 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-27 18:37:45 | 4 | + * @LastEditTime: 2022-11-11 15:25:20 |
| 5 | * @FilePath: /swx/src/pages/joinVolunteerInfo/index.vue | 5 | * @FilePath: /swx/src/pages/joinVolunteerInfo/index.vue |
| 6 | * @Description: 义工报名 | 6 | * @Description: 义工报名 |
| 7 | --> | 7 | --> |
| ... | @@ -36,6 +36,12 @@ | ... | @@ -36,6 +36,12 @@ |
| 36 | <input class="h5-input at-input__input" placeholder-class="placeholder" :value="user_sex" placeholder="" :disabled="true"/> | 36 | <input class="h5-input at-input__input" placeholder-class="placeholder" :value="user_sex" placeholder="" :disabled="true"/> |
| 37 | </view> | 37 | </view> |
| 38 | </view> | 38 | </view> |
| 39 | + <view class="at-input"> | ||
| 40 | + <view class="at-input__container"> | ||
| 41 | + <label class="h5-label at-input__title at-input__title">状态</label> | ||
| 42 | + <input class="h5-input at-input__input" placeholder-class="placeholder" :value="status" placeholder="" :disabled="true"/> | ||
| 43 | + </view> | ||
| 44 | + </view> | ||
| 39 | </view> | 45 | </view> |
| 40 | 46 | ||
| 41 | <view class="confirm-wrapper-page"> | 47 | <view class="confirm-wrapper-page"> |
| ... | @@ -98,6 +104,8 @@ export default { | ... | @@ -98,6 +104,8 @@ export default { |
| 98 | phone: '', | 104 | phone: '', |
| 99 | user_sex: '', | 105 | user_sex: '', |
| 100 | post: '', | 106 | post: '', |
| 107 | + status: '', | ||
| 108 | + absent: false, | ||
| 101 | } | 109 | } |
| 102 | }, | 110 | }, |
| 103 | async onShow () { | 111 | async onShow () { |
| ... | @@ -107,6 +115,23 @@ export default { | ... | @@ -107,6 +115,23 @@ export default { |
| 107 | this.phone = data.phone; | 115 | this.phone = data.phone; |
| 108 | this.post = data.post; | 116 | this.post = data.post; |
| 109 | this.user_sex = data.gender === 'man' ? '男士' : '女士'; | 117 | this.user_sex = data.gender === 'man' ? '男士' : '女士'; |
| 118 | + this.absent = data.activity_time > data.server_time ? true : false; | ||
| 119 | + if (data.status === 'apply') { | ||
| 120 | + if (this.absent) { // 活动开始前显示为已报名,开始后显示为未出席 | ||
| 121 | + this.status = '未出席' | ||
| 122 | + } else { | ||
| 123 | + this.status = '已报名' | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + if (data.status === 'enable') { | ||
| 127 | + this.status = '已签到' | ||
| 128 | + } | ||
| 129 | + if (data.status === 'request') { | ||
| 130 | + this.status = '已申请报名义工' | ||
| 131 | + } | ||
| 132 | + if (data.status === 'reject') { | ||
| 133 | + this.status = '管理员拒绝义工申请' | ||
| 134 | + } | ||
| 110 | } | 135 | } |
| 111 | } | 136 | } |
| 112 | }; | 137 | }; | ... | ... |
-
Please register or login to post a comment