Showing
3 changed files
with
126 additions
and
16 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2022-10-20 13:15:00 | 2 | * @Date: 2022-10-20 13:15:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-21 16:54:03 | 4 | + * @LastEditTime: 2022-11-11 16:31:20 |
| 5 | * @FilePath: /swx/src/api/Reg/index.js | 5 | * @FilePath: /swx/src/api/Reg/index.js |
| 6 | * @Description: 报名信息 | 6 | * @Description: 报名信息 |
| 7 | */ | 7 | */ |
| ... | @@ -14,6 +14,7 @@ const Api = { | ... | @@ -14,6 +14,7 @@ const Api = { |
| 14 | REG_CANCEL: '/srv/?a=reg_cancel', | 14 | REG_CANCEL: '/srv/?a=reg_cancel', |
| 15 | REG_LIST: '/srv/?a=reg_list', | 15 | REG_LIST: '/srv/?a=reg_list', |
| 16 | REG_STATUS: '/srv/?a=reg_set_status', | 16 | REG_STATUS: '/srv/?a=reg_set_status', |
| 17 | + REG_CONFIRM_NOTICE: '/srv/?a=reg_confirm_notice', | ||
| 17 | } | 18 | } |
| 18 | 19 | ||
| 19 | /** | 20 | /** |
| ... | @@ -51,3 +52,9 @@ export const listRegAPI = (params) => fn(fetch.post(Api.REG_LIST, params)); | ... | @@ -51,3 +52,9 @@ export const listRegAPI = (params) => fn(fetch.post(Api.REG_LIST, params)); |
| 51 | * @returns | 52 | * @returns |
| 52 | */ | 53 | */ |
| 53 | export const statusRegAPI = (params) => fn(fetch.post(Api.REG_STATUS, params)); | 54 | export const statusRegAPI = (params) => fn(fetch.post(Api.REG_STATUS, params)); |
| 55 | + | ||
| 56 | +/** | ||
| 57 | + * @description: 确认已收到审核失败提醒 | ||
| 58 | + * @returns | ||
| 59 | + */ | ||
| 60 | +export const noticeRegAPI = (params) => fn(fetch.post(Api.REG_CONFIRM_NOTICE, params)); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-26 16:10:35 | 2 | * @Date: 2022-09-26 16:10:35 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-11-03 16:43:56 | 4 | + * @LastEditTime: 2022-11-11 18:28:21 |
| 5 | * @FilePath: /swx/src/components/activity-bar.vue | 5 | * @FilePath: /swx/src/components/activity-bar.vue |
| 6 | * @Description: 活动详情页底部导航栏 | 6 | * @Description: 活动详情页底部导航栏 |
| 7 | --> | 7 | --> |
| ... | @@ -33,7 +33,8 @@ | ... | @@ -33,7 +33,8 @@ |
| 33 | <view class="button" @tap="goTo('join')">活动报名</view> | 33 | <view class="button" @tap="goTo('join')">活动报名</view> |
| 34 | </view> | 34 | </view> |
| 35 | <view v-if="userType === 'player_join'" class="user-reg"> | 35 | <view v-if="userType === 'player_join'" class="user-reg"> |
| 36 | - <view class="button" @tap="goTo('info')">报名信息</view> | 36 | + <view class="reg" @tap="goTo('volunteer')">义工报名</view> |
| 37 | + <view class="info" @tap="goTo('info', 'player')">活动报名信息</view> | ||
| 37 | </view> | 38 | </view> |
| 38 | <view v-if="userType === 'creator'" class="admin-control"> | 39 | <view v-if="userType === 'creator'" class="admin-control"> |
| 39 | <view class="edit" @tap="goTo('edit')">修改活动</view> | 40 | <view class="edit" @tap="goTo('edit')">修改活动</view> |
| ... | @@ -46,12 +47,19 @@ | ... | @@ -46,12 +47,19 @@ |
| 46 | <view v-if="userType === 'volunteer_only'" class="staff-not-join"> | 47 | <view v-if="userType === 'volunteer_only'" class="staff-not-join"> |
| 47 | <view class="button" @tap="goTo('volunteer')">义工报名</view> | 48 | <view class="button" @tap="goTo('volunteer')">义工报名</view> |
| 48 | </view> | 49 | </view> |
| 50 | + <view v-if="userType === 'player_join_volunteer_reject'" class="volunteer-reject"> | ||
| 51 | + <view class="info" @tap="goTo('info', 'volunteer')">义工报名信息</view> | ||
| 52 | + <view class="join" @tap="goTo('join')">活动报名</view> | ||
| 53 | + </view> | ||
| 54 | + <view v-if="userType === 'player_join_volunteer'" class="volunteer-success"> | ||
| 55 | + <view class="info" @tap="goTo('info', 'volunteer')">报名信息</view> | ||
| 56 | + </view> | ||
| 49 | </view> | 57 | </view> |
| 50 | </van-col> | 58 | </van-col> |
| 51 | </van-row> | 59 | </van-row> |
| 52 | </view> | 60 | </view> |
| 53 | <van-toast id="van-toast" /> | 61 | <van-toast id="van-toast" /> |
| 54 | - | 62 | + <van-dialog id="van-dialog" /> |
| 55 | </template> | 63 | </template> |
| 56 | 64 | ||
| 57 | <script setup> | 65 | <script setup> |
| ... | @@ -60,6 +68,7 @@ import { ref, defineProps } from 'vue' | ... | @@ -60,6 +68,7 @@ import { ref, defineProps } from 'vue' |
| 60 | import icon_home1 from '@/images/icon/home01@2x.png' | 68 | import icon_home1 from '@/images/icon/home01@2x.png' |
| 61 | import { getCurrentPageParam } from "@/utils/weapp"; | 69 | import { getCurrentPageParam } from "@/utils/weapp"; |
| 62 | import Toast from '@/components/vant-weapp/toast/toast'; | 70 | import Toast from '@/components/vant-weapp/toast/toast'; |
| 71 | +import Dialog from '@/components/vant-weapp/dialog/dialog'; | ||
| 63 | 72 | ||
| 64 | const props = defineProps({ | 73 | const props = defineProps({ |
| 65 | // player=参与者,可报名活动。 | 74 | // player=参与者,可报名活动。 |
| ... | @@ -78,7 +87,7 @@ const props = defineProps({ | ... | @@ -78,7 +87,7 @@ const props = defineProps({ |
| 78 | 87 | ||
| 79 | const emit = defineEmits(['on-handle']); | 88 | const emit = defineEmits(['on-handle']); |
| 80 | 89 | ||
| 81 | -const goTo = (type) => { | 90 | +const goTo = (type, status) => { |
| 82 | if (type === 'home') { // 返回首页 | 91 | if (type === 'home') { // 返回首页 |
| 83 | Taro.redirectTo({ | 92 | Taro.redirectTo({ |
| 84 | url: '../index/index' | 93 | url: '../index/index' |
| ... | @@ -86,15 +95,30 @@ const goTo = (type) => { | ... | @@ -86,15 +95,30 @@ const goTo = (type) => { |
| 86 | } else if (type === 'join') { // 活动报名 | 95 | } else if (type === 'join') { // 活动报名 |
| 87 | emit('on-handle', { type: 'join' }); | 96 | emit('on-handle', { type: 'join' }); |
| 88 | } else if (type === 'volunteer') { // 义工报名 | 97 | } else if (type === 'volunteer') { // 义工报名 |
| 89 | - if (props.volunteerStatus) { | 98 | + if (props.volunteerStatus) { // 有岗位可以报名 |
| 99 | + if (props.memberRole === 'player') { | ||
| 100 | + // player报名义工之前需要弹出提示框,告诉用户注意事项。 | ||
| 101 | + Dialog.alert({ | ||
| 102 | + title: '温馨提示', | ||
| 103 | + message: '报名义工的注意事项', | ||
| 104 | + confirmButtonColor: "#199A74", | ||
| 105 | + confirmButtonText: '知道了' | ||
| 106 | + }).then(() => { | ||
| 107 | + // on close | ||
| 108 | + Taro.navigateTo({ | ||
| 109 | + url: '../joinVolunteer/index?id=' + getCurrentPageParam().id | ||
| 110 | + }) | ||
| 111 | + }); | ||
| 112 | + } else { | ||
| 90 | Taro.navigateTo({ | 113 | Taro.navigateTo({ |
| 91 | url: '../joinVolunteer/index?id=' + getCurrentPageParam().id | 114 | url: '../joinVolunteer/index?id=' + getCurrentPageParam().id |
| 92 | }) | 115 | }) |
| 116 | + } | ||
| 93 | } else { | 117 | } else { |
| 94 | Toast('未设置义工岗位,不能报名!') | 118 | Toast('未设置义工岗位,不能报名!') |
| 95 | } | 119 | } |
| 96 | } else if (type === 'info') { // 报名信息 | 120 | } else if (type === 'info') { // 报名信息 |
| 97 | - if (props.regRole === 'player') { // 普通用户报名详情页 | 121 | + if (status === 'player') { // 普通用户报名详情页 |
| 98 | Taro.navigateTo({ | 122 | Taro.navigateTo({ |
| 99 | url: '../joinInfo/index?reg_id=' + props.regId + '&id=' + getCurrentPageParam().id | 123 | url: '../joinInfo/index?reg_id=' + props.regId + '&id=' + getCurrentPageParam().id |
| 100 | }) | 124 | }) |
| ... | @@ -159,14 +183,23 @@ const goTo = (type) => { | ... | @@ -159,14 +183,23 @@ const goTo = (type) => { |
| 159 | display: flex; | 183 | display: flex; |
| 160 | text-align: center; | 184 | text-align: center; |
| 161 | 185 | ||
| 162 | - .button { | 186 | + .reg { |
| 187 | + padding: 0.8rem; | ||
| 188 | + border-radius: 2rem; | ||
| 189 | + background-color: #199A74; | ||
| 190 | + color: #FFFFFF; | ||
| 191 | + margin: 0.5rem 0.8rem; | ||
| 192 | + width: 50%; | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + .info { | ||
| 163 | padding: 0.8rem; | 196 | padding: 0.8rem; |
| 164 | border-radius: 2rem; | 197 | border-radius: 2rem; |
| 165 | border: 1px solid #199A74; | 198 | border: 1px solid #199A74; |
| 166 | background-color: #FFFFFF; | 199 | background-color: #FFFFFF; |
| 167 | color: #199A74; | 200 | color: #199A74; |
| 168 | margin: 0.5rem 0.8rem; | 201 | margin: 0.5rem 0.8rem; |
| 169 | - width: 100%; | 202 | + width: 50%; |
| 170 | } | 203 | } |
| 171 | } | 204 | } |
| 172 | 205 | ||
| ... | @@ -222,6 +255,45 @@ const goTo = (type) => { | ... | @@ -222,6 +255,45 @@ const goTo = (type) => { |
| 222 | } | 255 | } |
| 223 | } | 256 | } |
| 224 | 257 | ||
| 258 | + .volunteer-reject { | ||
| 259 | + display: flex; | ||
| 260 | + text-align: center; | ||
| 261 | + | ||
| 262 | + .info { | ||
| 263 | + padding: 0.8rem; | ||
| 264 | + border-radius: 2rem; | ||
| 265 | + border: 1px solid #199A74; | ||
| 266 | + background-color: #FFFFFF; | ||
| 267 | + color: #199A74; | ||
| 268 | + margin: 0.5rem 0.8rem; | ||
| 269 | + width: 50%; | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + .join { | ||
| 273 | + padding: 0.8rem; | ||
| 274 | + border-radius: 2rem; | ||
| 275 | + background-color: #199A74; | ||
| 276 | + color: #FFFFFF; | ||
| 277 | + margin: 0.5rem 0.8rem; | ||
| 278 | + width: 50%; | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + .volunteer-success { | ||
| 283 | + display: flex; | ||
| 284 | + text-align: center; | ||
| 285 | + | ||
| 286 | + .info { | ||
| 287 | + padding: 0.8rem; | ||
| 288 | + border-radius: 2rem; | ||
| 289 | + border: 1px solid #199A74; | ||
| 290 | + background-color: #FFFFFF; | ||
| 291 | + color: #199A74; | ||
| 292 | + margin: 0.5rem 0.8rem; | ||
| 293 | + width: 100%; | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + | ||
| 225 | .activity-close { | 297 | .activity-close { |
| 226 | display: flex; | 298 | display: flex; |
| 227 | text-align: center; | 299 | text-align: center; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-26 14:36:57 | 2 | * @Date: 2022-09-26 14:36:57 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-11-03 18:06:24 | 4 | + * @LastEditTime: 2022-11-12 00:07:37 |
| 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue | 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue |
| 6 | * @Description: 活动详情页 | 6 | * @Description: 活动详情页 |
| 7 | --> | 7 | --> |
| ... | @@ -143,6 +143,7 @@ | ... | @@ -143,6 +143,7 @@ |
| 143 | @cancel="onCancelSave" | 143 | @cancel="onCancelSave" |
| 144 | @select="onSelectSave" | 144 | @select="onSelectSave" |
| 145 | /> | 145 | /> |
| 146 | + <van-dialog id="van-dialog" /> | ||
| 146 | </template> | 147 | </template> |
| 147 | 148 | ||
| 148 | <script setup> | 149 | <script setup> |
| ... | @@ -506,10 +507,12 @@ const onSelectSave = ({ detail }) => { | ... | @@ -506,10 +507,12 @@ const onSelectSave = ({ detail }) => { |
| 506 | <script> | 507 | <script> |
| 507 | import "./index.less"; | 508 | import "./index.less"; |
| 508 | import { activityInfoAPI } from '@/api/Host/index'; | 509 | import { activityInfoAPI } from '@/api/Host/index'; |
| 510 | +import { noticeRegAPI } from '@/api/Reg/index'; | ||
| 509 | import { pageQuery } from '@/utils/tools.js' | 511 | import { pageQuery } from '@/utils/tools.js' |
| 510 | import mixin from '@/utils/mixin'; | 512 | import mixin from '@/utils/mixin'; |
| 511 | import { getCurrentPageParam } from "@/utils/weapp"; | 513 | import { getCurrentPageParam } from "@/utils/weapp"; |
| 512 | require('@tarojs/taro/html.css') | 514 | require('@tarojs/taro/html.css') |
| 515 | +import Dialog from '@/components/vant-weapp/dialog/dialog'; | ||
| 513 | 516 | ||
| 514 | export default { | 517 | export default { |
| 515 | name: "activityInfoPage", | 518 | name: "activityInfoPage", |
| ... | @@ -524,12 +527,30 @@ export default { | ... | @@ -524,12 +527,30 @@ export default { |
| 524 | this.host = data.host; | 527 | this.host = data.host; |
| 525 | this.member_role = data.member_role; | 528 | this.member_role = data.member_role; |
| 526 | this.reg_role = data.reg_role; | 529 | this.reg_role = data.reg_role; |
| 527 | - this.reg_id = data.reg_id; | 530 | + // this.reg_id = data.reg_id; |
| 531 | + this.reg_id = data.player_reg?.id ? data.player_reg?.id : ''; | ||
| 528 | // 如果有岗位说明可以报名义工 | 532 | // 如果有岗位说明可以报名义工 |
| 529 | this.volunteer_status = this.activity?.extend.length ? true : false; | 533 | this.volunteer_status = this.activity?.extend.length ? true : false; |
| 534 | + // 提示标识 | ||
| 535 | + this.is_read_notice = data.volunteer_reg?.is_read_notice ? true : false; | ||
| 536 | + // 义工状态 | ||
| 537 | + this.volunteer_reg_id = data.volunteer_reg?.id ? data.volunteer_reg?.id : ''; | ||
| 538 | + this.volunteer_reg_status = data.volunteer_reg?.status | ||
| 530 | } | 539 | } |
| 531 | // 活动状态判断显示 | 540 | // 活动状态判断显示 |
| 532 | this.activity_status = getCurrentPageParam().status ? getCurrentPageParam().status : ''; | 541 | this.activity_status = getCurrentPageParam().status ? getCurrentPageParam().status : ''; |
| 542 | + // 用户是否需要弹窗 | ||
| 543 | + if (!this.is_read_notice && data.volunteer_reg?.status === 'reject') { | ||
| 544 | + Dialog.confirm({ | ||
| 545 | + title: '温馨提示', | ||
| 546 | + message: '您报名义工申请已被拒绝,确认后下次将不会再次弹出提示窗口。', | ||
| 547 | + confirmButtonColor: "#199A74", | ||
| 548 | + }).then(async() => { | ||
| 549 | + // on close | ||
| 550 | + const { code, data } = await noticeRegAPI({ i: id }); | ||
| 551 | + }).catch(() => { | ||
| 552 | + }); | ||
| 553 | + } | ||
| 533 | }, | 554 | }, |
| 534 | onLoad(options) { | 555 | onLoad(options) { |
| 535 | // 小程序码进入 | 556 | // 小程序码进入 |
| ... | @@ -552,6 +573,9 @@ export default { | ... | @@ -552,6 +573,9 @@ export default { |
| 552 | is_end: '', | 573 | is_end: '', |
| 553 | activity_status: '', | 574 | activity_status: '', |
| 554 | volunteer_status: false, | 575 | volunteer_status: false, |
| 576 | + is_read_notice: false, | ||
| 577 | + volunteer_reg_id: '', | ||
| 578 | + volunteer_reg_status: '', | ||
| 555 | } | 579 | } |
| 556 | }, | 580 | }, |
| 557 | computed: { | 581 | computed: { |
| ... | @@ -562,17 +586,24 @@ export default { | ... | @@ -562,17 +586,24 @@ export default { |
| 562 | // creator=创建人,可管理活动 | 586 | // creator=创建人,可管理活动 |
| 563 | userType () { | 587 | userType () { |
| 564 | let status = '' | 588 | let status = '' |
| 565 | - if (this.member_role === 'creator') { | 589 | + if (this.member_role === 'creator') { // 创建人 |
| 566 | status = 'creator' | 590 | status = 'creator' |
| 567 | } | 591 | } |
| 568 | - if (this.member_role === 'player') { | 592 | + if (this.member_role === 'player') { // 参与者 |
| 569 | - if (this.reg_id) { | 593 | + // 判断申请义工或活动的情况 |
| 594 | + if (this.reg_id) { // 申请过活动 | ||
| 570 | status = 'player_join' | 595 | status = 'player_join' |
| 571 | - } else { | 596 | + } else if (this.volunteer_reg_id) { // 申请过义工 |
| 597 | + if (this.volunteer_reg_status === 'reject') { // 申请拒绝, 按钮显示 义工报名信息/活动报名 | ||
| 598 | + status = 'player_join_volunteer_reject' | ||
| 599 | + } else { // 申请通过, 按钮显示 义工报名信息 | ||
| 600 | + status = 'player_join_volunteer' | ||
| 601 | + } | ||
| 602 | + } else { // 没有申请过任何活动 | ||
| 572 | status = 'player' | 603 | status = 'player' |
| 573 | } | 604 | } |
| 574 | } | 605 | } |
| 575 | - if (this.member_role === 'volunteer') { | 606 | + if (this.member_role === 'volunteer') { // 义工 |
| 576 | if (this.reg_id) { | 607 | if (this.reg_id) { |
| 577 | status = 'player_join' | 608 | status = 'player_join' |
| 578 | } else { | 609 | } else { | ... | ... |
-
Please register or login to post a comment