Showing
4 changed files
with
51 additions
and
9 deletions
| 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-28 16:58:56 | 4 | + * @LastEditTime: 2022-09-29 09:52:40 |
| 5 | * @FilePath: /swx/src/components/activity-bar.vue | 5 | * @FilePath: /swx/src/components/activity-bar.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -25,14 +25,14 @@ | ... | @@ -25,14 +25,14 @@ |
| 25 | <view class="button" @tap="goTo('info')">报名信息</view> | 25 | <view class="button" @tap="goTo('info')">报名信息</view> |
| 26 | </view> | 26 | </view> |
| 27 | <view v-if="userType === '3'" class="admin-control"> | 27 | <view v-if="userType === '3'" class="admin-control"> |
| 28 | - <view class="edit">修改活动</view> | 28 | + <view class="edit" @tap="goTo('edit')">修改活动</view> |
| 29 | - <view class="list">报名列表</view> | 29 | + <view class="list" @tap="goTo('list')">报名列表</view> |
| 30 | </view> | 30 | </view> |
| 31 | <view v-if="userType === '4'" class="staff-join"> | 31 | <view v-if="userType === '4'" class="staff-join"> |
| 32 | - <view class="button">报名活动</view> | 32 | + <view class="button" @tap="goTo('join')">报名活动</view> |
| 33 | </view> | 33 | </view> |
| 34 | <view v-if="userType === '5'" class="staff-not-join"> | 34 | <view v-if="userType === '5'" class="staff-not-join"> |
| 35 | - <view class="button">义工报名</view> | 35 | + <view class="button" @tap="goTo('volunteer')">义工报名</view> |
| 36 | </view> | 36 | </view> |
| 37 | </van-col> | 37 | </van-col> |
| 38 | </van-row> | 38 | </van-row> |
| ... | @@ -66,6 +66,14 @@ const goTo = (type) => { | ... | @@ -66,6 +66,14 @@ const goTo = (type) => { |
| 66 | Taro.navigateTo({ | 66 | Taro.navigateTo({ |
| 67 | url: '../joinInfo/index' | 67 | url: '../joinInfo/index' |
| 68 | }) | 68 | }) |
| 69 | + } else if (type === 'list') { // 报名列表 | ||
| 70 | + Taro.navigateTo({ | ||
| 71 | + url: '../joinList/index' | ||
| 72 | + }) | ||
| 73 | + } else if (type === 'edit') { // 修改活动 | ||
| 74 | + Taro.navigateTo({ | ||
| 75 | + url: '../createActivity/index?type=edit' | ||
| 76 | + }) | ||
| 69 | } | 77 | } |
| 70 | } | 78 | } |
| 71 | 79 | ... | ... |
| 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-28 17:33:23 | 4 | + * @LastEditTime: 2022-09-29 09:46:53 |
| 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue | 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -162,7 +162,7 @@ import { ref } from "vue"; | ... | @@ -162,7 +162,7 @@ import { ref } from "vue"; |
| 162 | 162 | ||
| 163 | // TEMP: 等待真实数据类型 | 163 | // TEMP: 等待真实数据类型 |
| 164 | // 根据用户类型显示对应操作栏 | 164 | // 根据用户类型显示对应操作栏 |
| 165 | -const userType = ref('2') | 165 | +const userType = ref('3') |
| 166 | 166 | ||
| 167 | const show_share = ref(false); | 167 | const show_share = ref(false); |
| 168 | const actions_share = ref([{ | 168 | const actions_share = ref([{ | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-21 16:04:10 | 2 | * @Date: 2022-09-21 16:04:10 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-09-26 23:02:43 | 4 | + * @LastEditTime: 2022-09-29 10:16:05 |
| 5 | * @FilePath: /swx/src/pages/createActivity/index.vue | 5 | * @FilePath: /swx/src/pages/createActivity/index.vue |
| 6 | * @Description: 创建活动页面 | 6 | * @Description: 创建活动页面 |
| 7 | --> | 7 | --> |
| ... | @@ -278,8 +278,8 @@ import icon_vip from '@/images/icon/vip@2x.png' | ... | @@ -278,8 +278,8 @@ import icon_vip from '@/images/icon/vip@2x.png' |
| 278 | import icon_sel from '@/images/icon/sel@2x.png' | 278 | import icon_sel from '@/images/icon/sel@2x.png' |
| 279 | import timePickerData from "@/components/time-picker-data/picker"; | 279 | import timePickerData from "@/components/time-picker-data/picker"; |
| 280 | import activityEditor from "@/components/activity-editor"; | 280 | import activityEditor from "@/components/activity-editor"; |
| 281 | +import { getCurrentPageUrl, getCurrentPageParam } from "@/utils/weapp"; | ||
| 281 | 282 | ||
| 282 | -const value1 = ref(''); | ||
| 283 | const message = ref(''); | 283 | const message = ref(''); |
| 284 | const message1 = ref(''); | 284 | const message1 = ref(''); |
| 285 | const checked = ref(false); | 285 | const checked = ref(false); |
| ... | @@ -315,6 +315,12 @@ const removeUploadImage = () => { | ... | @@ -315,6 +315,12 @@ const removeUploadImage = () => { |
| 315 | /**********************************/ | 315 | /**********************************/ |
| 316 | 316 | ||
| 317 | onMounted(() => { | 317 | onMounted(() => { |
| 318 | + if (getCurrentPageParam().type === 'edit') { | ||
| 319 | + // 动态修改标题 | ||
| 320 | + wx.setNavigationBarTitle({ | ||
| 321 | + title: '修改活动', | ||
| 322 | + }) | ||
| 323 | + } | ||
| 318 | nextTick(() => { | 324 | nextTick(() => { |
| 319 | setTimeout(() => { | 325 | setTimeout(() => { |
| 320 | // 获取元素宽度 | 326 | // 获取元素宽度 |
| ... | @@ -497,5 +503,14 @@ import "./index.less"; | ... | @@ -497,5 +503,14 @@ import "./index.less"; |
| 497 | 503 | ||
| 498 | export default { | 504 | export default { |
| 499 | name: "createActivityPage", | 505 | name: "createActivityPage", |
| 506 | + // onLoad (options) { | ||
| 507 | + // //options.参数名就可以取到 | ||
| 508 | + // if (options.type === 'edit') { | ||
| 509 | + // // 动态修改标题 | ||
| 510 | + // wx.setNavigationBarTitle({ | ||
| 511 | + // title: '修改活动', | ||
| 512 | + // }) | ||
| 513 | + // } | ||
| 514 | + // }, | ||
| 500 | }; | 515 | }; |
| 501 | </script> | 516 | </script> | ... | ... |
src/utils/weapp.js
0 → 100644
| 1 | +/*获取当前页url*/ | ||
| 2 | +const getCurrentPageUrl = () => { | ||
| 3 | + let pages = getCurrentPages() //获取加载的页面 | ||
| 4 | + let currentPage = pages[pages.length - 1] //获取当前页面的对象 | ||
| 5 | + let url = currentPage.route //当前页面url | ||
| 6 | + return url | ||
| 7 | +} | ||
| 8 | +/*获取当前页参数*/ | ||
| 9 | +const getCurrentPageParam = () => { | ||
| 10 | + let pages = getCurrentPages() //获取加载的页面 | ||
| 11 | + let currentPage = pages[pages.length - 1] //获取当前页面的对象 | ||
| 12 | + let options = currentPage.options //如果要获取url中所带的参数可以查看options | ||
| 13 | + return options | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +export { | ||
| 17 | + getCurrentPageUrl, | ||
| 18 | + getCurrentPageParam | ||
| 19 | +} |
-
Please register or login to post a comment