hookehuyr

✨ feat: 活动详情新增修改活动,报名列表跳转功能

<!--
* @Date: 2022-09-26 16:10:35
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-28 16:58:56
* @LastEditTime: 2022-09-29 09:52:40
* @FilePath: /swx/src/components/activity-bar.vue
* @Description: 文件描述
-->
......@@ -25,14 +25,14 @@
<view class="button" @tap="goTo('info')">报名信息</view>
</view>
<view v-if="userType === '3'" class="admin-control">
<view class="edit">修改活动</view>
<view class="list">报名列表</view>
<view class="edit" @tap="goTo('edit')">修改活动</view>
<view class="list" @tap="goTo('list')">报名列表</view>
</view>
<view v-if="userType === '4'" class="staff-join">
<view class="button">报名活动</view>
<view class="button" @tap="goTo('join')">报名活动</view>
</view>
<view v-if="userType === '5'" class="staff-not-join">
<view class="button">义工报名</view>
<view class="button" @tap="goTo('volunteer')">义工报名</view>
</view>
</van-col>
</van-row>
......@@ -66,6 +66,14 @@ const goTo = (type) => {
Taro.navigateTo({
url: '../joinInfo/index'
})
} else if (type === 'list') { // 报名列表
Taro.navigateTo({
url: '../joinList/index'
})
} else if (type === 'edit') { // 修改活动
Taro.navigateTo({
url: '../createActivity/index?type=edit'
})
}
}
......
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-28 17:33:23
* @LastEditTime: 2022-09-29 09:46:53
* @FilePath: /swx/src/pages/activityDetail/index.vue
* @Description: 文件描述
-->
......@@ -162,7 +162,7 @@ import { ref } from "vue";
// TEMP: 等待真实数据类型
// 根据用户类型显示对应操作栏
const userType = ref('2')
const userType = ref('3')
const show_share = ref(false);
const actions_share = ref([{
......
<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-26 23:02:43
* @LastEditTime: 2022-09-29 10:16:05
* @FilePath: /swx/src/pages/createActivity/index.vue
* @Description: 创建活动页面
-->
......@@ -278,8 +278,8 @@ import icon_vip from '@/images/icon/vip@2x.png'
import icon_sel from '@/images/icon/sel@2x.png'
import timePickerData from "@/components/time-picker-data/picker";
import activityEditor from "@/components/activity-editor";
import { getCurrentPageUrl, getCurrentPageParam } from "@/utils/weapp";
const value1 = ref('');
const message = ref('');
const message1 = ref('');
const checked = ref(false);
......@@ -315,6 +315,12 @@ const removeUploadImage = () => {
/**********************************/
onMounted(() => {
if (getCurrentPageParam().type === 'edit') {
// 动态修改标题
wx.setNavigationBarTitle({
title: '修改活动',
})
}
nextTick(() => {
setTimeout(() => {
// 获取元素宽度
......@@ -497,5 +503,14 @@ import "./index.less";
export default {
name: "createActivityPage",
// onLoad (options) {
// //options.参数名就可以取到
// if (options.type === 'edit') {
// // 动态修改标题
// wx.setNavigationBarTitle({
// title: '修改活动',
// })
// }
// },
};
</script>
......
/*获取当前页url*/
const getCurrentPageUrl = () => {
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length - 1] //获取当前页面的对象
let url = currentPage.route //当前页面url
return url
}
/*获取当前页参数*/
const getCurrentPageParam = () => {
let pages = getCurrentPages() //获取加载的页面
let currentPage = pages[pages.length - 1] //获取当前页面的对象
let options = currentPage.options //如果要获取url中所带的参数可以查看options
return options
}
export {
getCurrentPageUrl,
getCurrentPageParam
}