Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-09-29 10:21:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b009ded5890819426d6fc77511950e10c92ba67d
b009ded5
1 parent
6d8629b5
✨ feat: 活动详情新增修改活动,报名列表跳转功能
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
src/components/activity-bar.vue
src/pages/activityDetail/index.vue
src/pages/createActivity/index.vue
src/utils/weapp.js
src/components/activity-bar.vue
View file @
b009ded
<!--
* @Date: 2022-09-26 16:10:35
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-2
8 16:58:56
* @LastEditTime: 2022-09-2
9 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'
})
}
}
...
...
src/pages/activityDetail/index.vue
View file @
b009ded
<!--
* @Date: 2022-09-26 14:36:57
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-2
8 17:33:2
3
* @LastEditTime: 2022-09-2
9 09:46:5
3
* @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([{
...
...
src/pages/createActivity/index.vue
View file @
b009ded
<!--
* @Date: 2022-09-21 16:04:10
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-09-2
6 23:02:43
* @LastEditTime: 2022-09-2
9 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>
...
...
src/utils/weapp.js
0 → 100644
View file @
b009ded
/*获取当前页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
}
Please
register
or
login
to post a comment