hookehuyr

✨ feat: 优化已结束活动详情显示

<!--
* @Date: 2022-09-26 16:10:35
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-21 13:37:32
* @LastEditTime: 2022-10-25 16:25:19
* @FilePath: /swx/src/components/activity-bar.vue
* @Description: 活动详情页底部导航栏
-->
......@@ -17,6 +17,7 @@
</view>
</van-col>
<van-col span="19">
<view v-if="!isEnd">
<view v-if="userType === 'volunteer'" class="user-not-reg">
<view class="button" @tap="goTo('volunteer')">义工报名</view>
<view class="button" @tap="goTo('join')">活动报名</view>
......@@ -34,6 +35,12 @@
<view v-if="userType === 'volunteer_only'" class="staff-not-join">
<view class="button" @tap="goTo('volunteer')">义工报名</view>
</view>
</view>
<view v-else>
<view class="activity-close">
<view class="button" @tap="goTo('info')">活动结束</view>
</view>
</view>
</van-col>
</van-row>
</view>
......@@ -54,6 +61,7 @@ const props = defineProps({
userType: String,
regId: String,
memberRole : String,
isEnd : String,
})
const goTo = (type) => {
......@@ -197,5 +205,19 @@ const goTo = (type) => {
width: 100%;
}
}
.activity-close {
display: flex;
text-align: center;
.button {
padding: 0.8rem;
border-radius: 2rem;
background-color: #EDEDED;
color: #909090;
margin: 0.5rem 0.8rem;
width: 100%;
}
}
}
</style>
......
<!--
* @Date: 2022-09-20 15:39:37
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-25 16:11:42
* @LastEditTime: 2022-10-25 16:37:35
* @FilePath: /swx/src/components/activity-card.vue
* @Description: 活动卡片组件
-->
<template>
<view @tap="goTo(data.id)" class="activity-card-page">
<view @tap="goTo(data.id, formatStatus(data))" class="activity-card-page">
<view class="card-main">
<van-row>
<van-col :span="10">
......@@ -86,16 +86,16 @@ const formatStatus = (item) => {
} else if (dayjs(item.reg_begin_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.reg_end_time))) {
return '报名中';
} else if (dayjs(item.reg_end_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.activity_time))) {
return '报名截止';
return '报名结束';
} else if (dayjs(item.activity_time).isBefore(dayjs(item.server_time))) {
return '活动进行中';
}
return 'mo'
}
const goTo = (id) => {
const goTo = (id, status) => {
Taro.navigateTo({
url: '../activityDetail/index?id=' + id
url: '../activityDetail/index?id=' + id + '&status=' + decodeURIComponent(status)
})
}
</script>
......
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-21 10:27:19
* @LastEditTime: 2022-10-25 16:26:07
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 活动详情页
-->
......@@ -106,7 +106,7 @@
</view>
</view>
<view style="height: 6rem;"></view>
<activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" />
<activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end" />
<!-- <van-action-sheet
:z-index="10"
......@@ -473,6 +473,7 @@ export default {
const { code, data } = await activityInfoAPI({ i: id });
if (code) {
this.activity = data.activity;
this.is_end = data.activity.is_end;
this.host = data.host;
this.member_role = data.member_role;
this.reg_id = data.reg_id;
......@@ -486,6 +487,7 @@ export default {
host: {},
member_role: '',
reg_id: '',
is_end: '',
}
},
computed: {
......