hookehuyr

审核状态相关操作调整

/*
* @Date: 2022-10-20 13:15:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-21 16:54:03
* @LastEditTime: 2022-11-11 16:31:20
* @FilePath: /swx/src/api/Reg/index.js
* @Description: 报名信息
*/
......@@ -14,6 +14,7 @@ const Api = {
REG_CANCEL: '/srv/?a=reg_cancel',
REG_LIST: '/srv/?a=reg_list',
REG_STATUS: '/srv/?a=reg_set_status',
REG_CONFIRM_NOTICE: '/srv/?a=reg_confirm_notice',
}
/**
......@@ -51,3 +52,9 @@ export const listRegAPI = (params) => fn(fetch.post(Api.REG_LIST, params));
* @returns
*/
export const statusRegAPI = (params) => fn(fetch.post(Api.REG_STATUS, params));
/**
* @description: 确认已收到审核失败提醒
* @returns
*/
export const noticeRegAPI = (params) => fn(fetch.post(Api.REG_CONFIRM_NOTICE, params));
......
<!--
* @Date: 2022-09-26 16:10:35
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 16:43:56
* @LastEditTime: 2022-11-11 18:28:21
* @FilePath: /swx/src/components/activity-bar.vue
* @Description: 活动详情页底部导航栏
-->
......@@ -33,7 +33,8 @@
<view class="button" @tap="goTo('join')">活动报名</view>
</view>
<view v-if="userType === 'player_join'" class="user-reg">
<view class="button" @tap="goTo('info')">报名信息</view>
<view class="reg" @tap="goTo('volunteer')">义工报名</view>
<view class="info" @tap="goTo('info', 'player')">活动报名信息</view>
</view>
<view v-if="userType === 'creator'" class="admin-control">
<view class="edit" @tap="goTo('edit')">修改活动</view>
......@@ -46,12 +47,19 @@
<view v-if="userType === 'volunteer_only'" class="staff-not-join">
<view class="button" @tap="goTo('volunteer')">义工报名</view>
</view>
<view v-if="userType === 'player_join_volunteer_reject'" class="volunteer-reject">
<view class="info" @tap="goTo('info', 'volunteer')">义工报名信息</view>
<view class="join" @tap="goTo('join')">活动报名</view>
</view>
<view v-if="userType === 'player_join_volunteer'" class="volunteer-success">
<view class="info" @tap="goTo('info', 'volunteer')">报名信息</view>
</view>
</view>
</van-col>
</van-row>
</view>
<van-toast id="van-toast" />
<van-dialog id="van-dialog" />
</template>
<script setup>
......@@ -60,6 +68,7 @@ import { ref, defineProps } from 'vue'
import icon_home1 from '@/images/icon/home01@2x.png'
import { getCurrentPageParam } from "@/utils/weapp";
import Toast from '@/components/vant-weapp/toast/toast';
import Dialog from '@/components/vant-weapp/dialog/dialog';
const props = defineProps({
// player=参与者,可报名活动。
......@@ -78,7 +87,7 @@ const props = defineProps({
const emit = defineEmits(['on-handle']);
const goTo = (type) => {
const goTo = (type, status) => {
if (type === 'home') { // 返回首页
Taro.redirectTo({
url: '../index/index'
......@@ -86,15 +95,30 @@ const goTo = (type) => {
} else if (type === 'join') { // 活动报名
emit('on-handle', { type: 'join' });
} else if (type === 'volunteer') { // 义工报名
if (props.volunteerStatus) {
if (props.volunteerStatus) { // 有岗位可以报名
if (props.memberRole === 'player') {
// player报名义工之前需要弹出提示框,告诉用户注意事项。
Dialog.alert({
title: '温馨提示',
message: '报名义工的注意事项',
confirmButtonColor: "#199A74",
confirmButtonText: '知道了'
}).then(() => {
// on close
Taro.navigateTo({
url: '../joinVolunteer/index?id=' + getCurrentPageParam().id
})
});
} else {
Taro.navigateTo({
url: '../joinVolunteer/index?id=' + getCurrentPageParam().id
})
}
} else {
Toast('未设置义工岗位,不能报名!')
}
} else if (type === 'info') { // 报名信息
if (props.regRole === 'player') { // 普通用户报名详情页
if (status === 'player') { // 普通用户报名详情页
Taro.navigateTo({
url: '../joinInfo/index?reg_id=' + props.regId + '&id=' + getCurrentPageParam().id
})
......@@ -159,14 +183,23 @@ const goTo = (type) => {
display: flex;
text-align: center;
.button {
.reg {
padding: 0.8rem;
border-radius: 2rem;
background-color: #199A74;
color: #FFFFFF;
margin: 0.5rem 0.8rem;
width: 50%;
}
.info {
padding: 0.8rem;
border-radius: 2rem;
border: 1px solid #199A74;
background-color: #FFFFFF;
color: #199A74;
margin: 0.5rem 0.8rem;
width: 100%;
width: 50%;
}
}
......@@ -222,6 +255,45 @@ const goTo = (type) => {
}
}
.volunteer-reject {
display: flex;
text-align: center;
.info {
padding: 0.8rem;
border-radius: 2rem;
border: 1px solid #199A74;
background-color: #FFFFFF;
color: #199A74;
margin: 0.5rem 0.8rem;
width: 50%;
}
.join {
padding: 0.8rem;
border-radius: 2rem;
background-color: #199A74;
color: #FFFFFF;
margin: 0.5rem 0.8rem;
width: 50%;
}
}
.volunteer-success {
display: flex;
text-align: center;
.info {
padding: 0.8rem;
border-radius: 2rem;
border: 1px solid #199A74;
background-color: #FFFFFF;
color: #199A74;
margin: 0.5rem 0.8rem;
width: 100%;
}
}
.activity-close {
display: flex;
text-align: center;
......
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-03 18:06:24
* @LastEditTime: 2022-11-12 00:07:37
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
......@@ -143,6 +143,7 @@
@cancel="onCancelSave"
@select="onSelectSave"
/>
<van-dialog id="van-dialog" />
</template>
<script setup>
......@@ -506,10 +507,12 @@ const onSelectSave = ({ detail }) => {
<script>
import "./index.less";
import { activityInfoAPI } from '@/api/Host/index';
import { noticeRegAPI } from '@/api/Reg/index';
import { pageQuery } from '@/utils/tools.js'
import mixin from '@/utils/mixin';
import { getCurrentPageParam } from "@/utils/weapp";
require('@tarojs/taro/html.css')
import Dialog from '@/components/vant-weapp/dialog/dialog';
export default {
name: "activityInfoPage",
......@@ -524,12 +527,30 @@ export default {
this.host = data.host;
this.member_role = data.member_role;
this.reg_role = data.reg_role;
this.reg_id = data.reg_id;
// this.reg_id = data.reg_id;
this.reg_id = data.player_reg?.id ? data.player_reg?.id : '';
// 如果有岗位说明可以报名义工
this.volunteer_status = this.activity?.extend.length ? true : false;
// 提示标识
this.is_read_notice = data.volunteer_reg?.is_read_notice ? true : false;
// 义工状态
this.volunteer_reg_id = data.volunteer_reg?.id ? data.volunteer_reg?.id : '';
this.volunteer_reg_status = data.volunteer_reg?.status
}
// 活动状态判断显示
this.activity_status = getCurrentPageParam().status ? getCurrentPageParam().status : '';
// 用户是否需要弹窗
if (!this.is_read_notice && data.volunteer_reg?.status === 'reject') {
Dialog.confirm({
title: '温馨提示',
message: '您报名义工申请已被拒绝,确认后下次将不会再次弹出提示窗口。',
confirmButtonColor: "#199A74",
}).then(async() => {
// on close
const { code, data } = await noticeRegAPI({ i: id });
}).catch(() => {
});
}
},
onLoad(options) {
// 小程序码进入
......@@ -552,6 +573,9 @@ export default {
is_end: '',
activity_status: '',
volunteer_status: false,
is_read_notice: false,
volunteer_reg_id: '',
volunteer_reg_status: '',
}
},
computed: {
......@@ -562,17 +586,24 @@ export default {
// creator=创建人,可管理活动
userType () {
let status = ''
if (this.member_role === 'creator') {
if (this.member_role === 'creator') { // 创建人
status = 'creator'
}
if (this.member_role === 'player') {
if (this.reg_id) {
if (this.member_role === 'player') { // 参与者
// 判断申请义工或活动的情况
if (this.reg_id) { // 申请过活动
status = 'player_join'
} else {
} else if (this.volunteer_reg_id) { // 申请过义工
if (this.volunteer_reg_status === 'reject') { // 申请拒绝, 按钮显示 义工报名信息/活动报名
status = 'player_join_volunteer_reject'
} else { // 申请通过, 按钮显示 义工报名信息
status = 'player_join_volunteer'
}
} else { // 没有申请过任何活动
status = 'player'
}
}
if (this.member_role === 'volunteer') {
if (this.member_role === 'volunteer') { // 义工
if (this.reg_id) {
status = 'player_join'
} else {
......