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-09-26 17:14:29 4 + * @LastEditTime: 2022-09-27 17:22:03
5 * @FilePath: /swx/src/components/activity-bar.vue 5 * @FilePath: /swx/src/components/activity-bar.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <view class="activity-bar-page"> 9 <view class="activity-bar-page">
10 <van-row> 10 <van-row>
11 <van-col span="5"> 11 <van-col span="5">
12 - <view @tap="goTo()" class="home"> 12 + <view @tap="goTo('home')" class="home">
13 <view style="height: 1.75rem;"> 13 <view style="height: 1.75rem;">
14 <van-icon :name="icon_home1" size="1.75rem" color="" /> 14 <van-icon :name="icon_home1" size="1.75rem" color="" />
15 </view> 15 </view>
...@@ -17,21 +17,21 @@ ...@@ -17,21 +17,21 @@
17 </view> 17 </view>
18 </van-col> 18 </van-col>
19 <van-col span="19"> 19 <van-col span="19">
20 - <view v-if="status === '1'" class="user-not-reg"> 20 + <view v-if="userType === '1'" class="user-not-reg">
21 <view class="button">义工报名</view> 21 <view class="button">义工报名</view>
22 - <view class="button">活动报名</view> 22 + <view class="button" @tap="goTo('join')">活动报名</view>
23 </view> 23 </view>
24 - <view v-if="status === '2'" class="user-reg"> 24 + <view v-if="userType === '2'" class="user-reg">
25 <view class="button">报名信息</view> 25 <view class="button">报名信息</view>
26 </view> 26 </view>
27 - <view v-if="status === '3'" class="admin-control"> 27 + <view v-if="userType === '3'" class="admin-control">
28 <view class="edit">修改活动</view> 28 <view class="edit">修改活动</view>
29 <view class="list">报名列表</view> 29 <view class="list">报名列表</view>
30 </view> 30 </view>
31 - <view v-if="status === '4'" class="staff-join"> 31 + <view v-if="userType === '4'" class="staff-join">
32 <view class="button">报名活动</view> 32 <view class="button">报名活动</view>
33 </view> 33 </view>
34 - <view v-if="status === '5'" class="staff-not-join"> 34 + <view v-if="userType === '5'" class="staff-not-join">
35 <view class="button">义工报名</view> 35 <view class="button">义工报名</view>
36 </view> 36 </view>
37 </van-col> 37 </van-col>
...@@ -40,20 +40,27 @@ ...@@ -40,20 +40,27 @@
40 </template> 40 </template>
41 41
42 <script setup> 42 <script setup>
43 -import { ref } from 'vue' 43 +import { ref, defineProps } from 'vue'
44 import icon_home1 from '@/images/icon/home01@2x.png' 44 import icon_home1 from '@/images/icon/home01@2x.png'
45 45
46 import Taro from '@tarojs/taro' 46 import Taro from '@tarojs/taro'
47 47
48 -const goTo = () => { 48 +const props = defineProps({
49 + userType: String
50 +})
51 +
52 +const goTo = (type) => {
53 + if (type === 'home') { // 返回首页
49 Taro.redirectTo({ 54 Taro.redirectTo({
50 url: '../index/index' 55 url: '../index/index'
51 }) 56 })
57 + } else if (type === 'join') { // 活动报名
58 + Taro.navigateTo({
59 + url: '../joinActivity/index'
60 + })
61 + }
52 } 62 }
53 63
54 -// TODO: 状态待定-后期根据实际状态判断
55 -const status = '5';
56 -
57 </script> 64 </script>
58 65
59 <style lang="less"> 66 <style lang="less">
......
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-09-27 16:38:57 4 + * @LastEditTime: 2022-09-27 17:55:02
5 * @FilePath: /swx/src/pages/activityDetail/index.vue 5 * @FilePath: /swx/src/pages/activityDetail/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
119 </view> 119 </view>
120 </view> 120 </view>
121 <view style="height: 6rem;"></view> 121 <view style="height: 6rem;"></view>
122 - <activity-bar /> 122 + <activity-bar :user-type="userType" />
123 123
124 <van-action-sheet 124 <van-action-sheet
125 :z-index="10" 125 :z-index="10"
...@@ -160,6 +160,10 @@ import PosterBuilder from '@/components/PosterBuilder/index.vue'; ...@@ -160,6 +160,10 @@ import PosterBuilder from '@/components/PosterBuilder/index.vue';
160 160
161 import { ref } from "vue"; 161 import { ref } from "vue";
162 162
163 +// TEMP: 等待真实数据类型
164 +// 根据用户类型显示对应操作栏
165 +const userType = ref('1')
166 +
163 const show_share = ref(false); 167 const show_share = ref(false);
164 const actions_share = ref([{ 168 const actions_share = ref([{
165 name: '分享朋友' 169 name: '分享朋友'
......