hookehuyr

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

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-10-21 13:37:32 4 + * @LastEditTime: 2022-10-25 16:25:19
5 * @FilePath: /swx/src/components/activity-bar.vue 5 * @FilePath: /swx/src/components/activity-bar.vue
6 * @Description: 活动详情页底部导航栏 6 * @Description: 活动详情页底部导航栏
7 --> 7 -->
...@@ -17,22 +17,29 @@ ...@@ -17,22 +17,29 @@
17 </view> 17 </view>
18 </van-col> 18 </van-col>
19 <van-col span="19"> 19 <van-col span="19">
20 - <view v-if="userType === 'volunteer'" class="user-not-reg"> 20 + <view v-if="!isEnd">
21 - <view class="button" @tap="goTo('volunteer')">义工报名</view> 21 + <view v-if="userType === 'volunteer'" class="user-not-reg">
22 - <view class="button" @tap="goTo('join')">活动报名</view> 22 + <view class="button" @tap="goTo('volunteer')">义工报名</view>
23 - </view> 23 + <view class="button" @tap="goTo('join')">活动报名</view>
24 - <view v-if="userType === 'player_join'" class="user-reg"> 24 + </view>
25 - <view class="button" @tap="goTo('info')">报名信息</view> 25 + <view v-if="userType === 'player_join'" class="user-reg">
26 - </view> 26 + <view class="button" @tap="goTo('info')">报名信息</view>
27 - <view v-if="userType === 'creator'" class="admin-control"> 27 + </view>
28 - <view class="edit" @tap="goTo('edit')">修改活动</view> 28 + <view v-if="userType === 'creator'" class="admin-control">
29 - <view class="list" @tap="goTo('list')">报名列表</view> 29 + <view class="edit" @tap="goTo('edit')">修改活动</view>
30 - </view> 30 + <view class="list" @tap="goTo('list')">报名列表</view>
31 - <view v-if="userType === 'player'" class="staff-join"> 31 + </view>
32 - <view class="button" @tap="goTo('join')">报名活动</view> 32 + <view v-if="userType === 'player'" class="staff-join">
33 + <view class="button" @tap="goTo('join')">报名活动</view>
34 + </view>
35 + <view v-if="userType === 'volunteer_only'" class="staff-not-join">
36 + <view class="button" @tap="goTo('volunteer')">义工报名</view>
37 + </view>
33 </view> 38 </view>
34 - <view v-if="userType === 'volunteer_only'" class="staff-not-join"> 39 + <view v-else>
35 - <view class="button" @tap="goTo('volunteer')">义工报名</view> 40 + <view class="activity-close">
41 + <view class="button" @tap="goTo('info')">活动结束</view>
42 + </view>
36 </view> 43 </view>
37 </van-col> 44 </van-col>
38 </van-row> 45 </van-row>
...@@ -54,6 +61,7 @@ const props = defineProps({ ...@@ -54,6 +61,7 @@ const props = defineProps({
54 userType: String, 61 userType: String,
55 regId: String, 62 regId: String,
56 memberRole : String, 63 memberRole : String,
64 + isEnd : String,
57 }) 65 })
58 66
59 const goTo = (type) => { 67 const goTo = (type) => {
...@@ -197,5 +205,19 @@ const goTo = (type) => { ...@@ -197,5 +205,19 @@ const goTo = (type) => {
197 width: 100%; 205 width: 100%;
198 } 206 }
199 } 207 }
208 +
209 + .activity-close {
210 + display: flex;
211 + text-align: center;
212 +
213 + .button {
214 + padding: 0.8rem;
215 + border-radius: 2rem;
216 + background-color: #EDEDED;
217 + color: #909090;
218 + margin: 0.5rem 0.8rem;
219 + width: 100%;
220 + }
221 + }
200 } 222 }
201 </style> 223 </style>
......
1 <!-- 1 <!--
2 * @Date: 2022-09-20 15:39:37 2 * @Date: 2022-09-20 15:39:37
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-25 16:11:42 4 + * @LastEditTime: 2022-10-25 16:37:35
5 * @FilePath: /swx/src/components/activity-card.vue 5 * @FilePath: /swx/src/components/activity-card.vue
6 * @Description: 活动卡片组件 6 * @Description: 活动卡片组件
7 --> 7 -->
8 <template> 8 <template>
9 - <view @tap="goTo(data.id)" class="activity-card-page"> 9 + <view @tap="goTo(data.id, formatStatus(data))" class="activity-card-page">
10 <view class="card-main"> 10 <view class="card-main">
11 <van-row> 11 <van-row>
12 <van-col :span="10"> 12 <van-col :span="10">
...@@ -86,16 +86,16 @@ const formatStatus = (item) => { ...@@ -86,16 +86,16 @@ const formatStatus = (item) => {
86 } else if (dayjs(item.reg_begin_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.reg_end_time))) { 86 } else if (dayjs(item.reg_begin_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.reg_end_time))) {
87 return '报名中'; 87 return '报名中';
88 } else if (dayjs(item.reg_end_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.activity_time))) { 88 } else if (dayjs(item.reg_end_time).isBefore(dayjs(item.server_time)) && dayjs(item.server_time).isBefore(dayjs(item.activity_time))) {
89 - return '报名截止'; 89 + return '报名结束';
90 } else if (dayjs(item.activity_time).isBefore(dayjs(item.server_time))) { 90 } else if (dayjs(item.activity_time).isBefore(dayjs(item.server_time))) {
91 return '活动进行中'; 91 return '活动进行中';
92 } 92 }
93 return 'mo' 93 return 'mo'
94 } 94 }
95 95
96 -const goTo = (id) => { 96 +const goTo = (id, status) => {
97 Taro.navigateTo({ 97 Taro.navigateTo({
98 - url: '../activityDetail/index?id=' + id 98 + url: '../activityDetail/index?id=' + id + '&status=' + decodeURIComponent(status)
99 }) 99 })
100 } 100 }
101 </script> 101 </script>
......
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-10-21 10:27:19 4 + * @LastEditTime: 2022-10-25 16:26:07
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 活动详情页 6 * @Description: 活动详情页
7 --> 7 -->
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
106 </view> 106 </view>
107 </view> 107 </view>
108 <view style="height: 6rem;"></view> 108 <view style="height: 6rem;"></view>
109 - <activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" /> 109 + <activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end" />
110 110
111 <!-- <van-action-sheet 111 <!-- <van-action-sheet
112 :z-index="10" 112 :z-index="10"
...@@ -473,6 +473,7 @@ export default { ...@@ -473,6 +473,7 @@ export default {
473 const { code, data } = await activityInfoAPI({ i: id }); 473 const { code, data } = await activityInfoAPI({ i: id });
474 if (code) { 474 if (code) {
475 this.activity = data.activity; 475 this.activity = data.activity;
476 + this.is_end = data.activity.is_end;
476 this.host = data.host; 477 this.host = data.host;
477 this.member_role = data.member_role; 478 this.member_role = data.member_role;
478 this.reg_id = data.reg_id; 479 this.reg_id = data.reg_id;
...@@ -486,6 +487,7 @@ export default { ...@@ -486,6 +487,7 @@ export default {
486 host: {}, 487 host: {},
487 member_role: '', 488 member_role: '',
488 reg_id: '', 489 reg_id: '',
490 + is_end: '',
489 } 491 }
490 }, 492 },
491 computed: { 493 computed: {
......