hookehuyr

✨ feat: 活动详情页控制按钮逻辑修改

<!--
* @Date: 2022-09-26 16:10:35
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-26 17:14:29
* @LastEditTime: 2022-09-27 17:22:03
* @FilePath: /swx/src/components/activity-bar.vue
* @Description: 文件描述
-->
......@@ -9,7 +9,7 @@
<view class="activity-bar-page">
<van-row>
<van-col span="5">
<view @tap="goTo()" class="home">
<view @tap="goTo('home')" class="home">
<view style="height: 1.75rem;">
<van-icon :name="icon_home1" size="1.75rem" color="" />
</view>
......@@ -17,21 +17,21 @@
</view>
</van-col>
<van-col span="19">
<view v-if="status === '1'" class="user-not-reg">
<view v-if="userType === '1'" class="user-not-reg">
<view class="button">义工报名</view>
<view class="button">活动报名</view>
<view class="button" @tap="goTo('join')">活动报名</view>
</view>
<view v-if="status === '2'" class="user-reg">
<view v-if="userType === '2'" class="user-reg">
<view class="button">报名信息</view>
</view>
<view v-if="status === '3'" class="admin-control">
<view v-if="userType === '3'" class="admin-control">
<view class="edit">修改活动</view>
<view class="list">报名列表</view>
</view>
<view v-if="status === '4'" class="staff-join">
<view v-if="userType === '4'" class="staff-join">
<view class="button">报名活动</view>
</view>
<view v-if="status === '5'" class="staff-not-join">
<view v-if="userType === '5'" class="staff-not-join">
<view class="button">义工报名</view>
</view>
</van-col>
......@@ -40,20 +40,27 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref, defineProps } from 'vue'
import icon_home1 from '@/images/icon/home01@2x.png'
import Taro from '@tarojs/taro'
const goTo = () => {
Taro.redirectTo({
url: '../index/index'
})
const props = defineProps({
userType: String
})
const goTo = (type) => {
if (type === 'home') { // 返回首页
Taro.redirectTo({
url: '../index/index'
})
} else if (type === 'join') { // 活动报名
Taro.navigateTo({
url: '../joinActivity/index'
})
}
}
// TODO: 状态待定-后期根据实际状态判断
const status = '5';
</script>
<style lang="less">
......
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-27 16:38:57
* @LastEditTime: 2022-09-27 17:55:02
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 文件描述
-->
......@@ -119,7 +119,7 @@
</view>
</view>
<view style="height: 6rem;"></view>
<activity-bar />
<activity-bar :user-type="userType" />
<van-action-sheet
:z-index="10"
......@@ -160,6 +160,10 @@ import PosterBuilder from '@/components/PosterBuilder/index.vue';
import { ref } from "vue";
// TEMP: 等待真实数据类型
// 根据用户类型显示对应操作栏
const userType = ref('1')
const show_share = ref(false);
const actions_share = ref([{
name: '分享朋友'
......