Showing
4 changed files
with
36 additions
and
7 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2022-10-20 13:15:00 | 2 | * @Date: 2022-10-20 13:15:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-25 15:37:28 | 4 | + * @LastEditTime: 2022-10-25 17:27:05 |
| 5 | * @FilePath: /swx/src/api/Activity/index.js | 5 | * @FilePath: /swx/src/api/Activity/index.js |
| 6 | * @Description: 活动信息 | 6 | * @Description: 活动信息 |
| 7 | */ | 7 | */ |
| ... | @@ -9,6 +9,7 @@ import { fn, fetch } from '../fn'; | ... | @@ -9,6 +9,7 @@ import { fn, fetch } from '../fn'; |
| 9 | 9 | ||
| 10 | const Api = { | 10 | const Api = { |
| 11 | ACTIVITY_JOIN_LIST: '/srv/?a=activity_join_list', | 11 | ACTIVITY_JOIN_LIST: '/srv/?a=activity_join_list', |
| 12 | + ACTIVITY_ADD_LIST: '/srv/?a=activity_add_list', | ||
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| ... | @@ -16,3 +17,9 @@ const Api = { | ... | @@ -16,3 +17,9 @@ const Api = { |
| 16 | * @returns | 17 | * @returns |
| 17 | */ | 18 | */ |
| 18 | export const joinListAPI = (params) => fn(fetch.get(Api.ACTIVITY_JOIN_LIST, params)); | 19 | export const joinListAPI = (params) => fn(fetch.get(Api.ACTIVITY_JOIN_LIST, params)); |
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * @description: 我创建的活动列表 | ||
| 23 | + * @returns | ||
| 24 | + */ | ||
| 25 | +export const addListAPI = (params) => fn(fetch.get(Api.ACTIVITY_ADD_LIST, params)); | ... | ... |
| 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-10-25 16:26:07 | 4 | + * @LastEditTime: 2022-10-26 09:14:00 |
| 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue | 5 | * @FilePath: /swx/src/pages/activityDetail/index.vue |
| 6 | * @Description: 活动详情页 | 6 | * @Description: 活动详情页 |
| 7 | --> | 7 | --> |
| ... | @@ -106,7 +106,7 @@ | ... | @@ -106,7 +106,7 @@ |
| 106 | </view> | 106 | </view> |
| 107 | </view> | 107 | </view> |
| 108 | <view style="height: 6rem;"></view> | 108 | <view style="height: 6rem;"></view> |
| 109 | - <activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end" /> | 109 | + <activity-bar :user-type="userType" :reg-id="reg_id" :member-role="member_role" :is-end="is_end" :activity-status="activity_status" /> |
| 110 | 110 | ||
| 111 | <!-- <van-action-sheet | 111 | <!-- <van-action-sheet |
| 112 | :z-index="10" | 112 | :z-index="10" |
| ... | @@ -462,6 +462,7 @@ import "./index.less"; | ... | @@ -462,6 +462,7 @@ import "./index.less"; |
| 462 | import { activityInfoAPI } from '@/api/Host/index'; | 462 | import { activityInfoAPI } from '@/api/Host/index'; |
| 463 | import { pageQuery } from '@/utils/tools.js' | 463 | import { pageQuery } from '@/utils/tools.js' |
| 464 | import mixin from '@/utils/mixin'; | 464 | import mixin from '@/utils/mixin'; |
| 465 | +import { getCurrentPageParam } from "@/utils/weapp"; | ||
| 465 | require('@tarojs/taro/html.css') | 466 | require('@tarojs/taro/html.css') |
| 466 | 467 | ||
| 467 | export default { | 468 | export default { |
| ... | @@ -478,6 +479,8 @@ export default { | ... | @@ -478,6 +479,8 @@ export default { |
| 478 | this.member_role = data.member_role; | 479 | this.member_role = data.member_role; |
| 479 | this.reg_id = data.reg_id; | 480 | this.reg_id = data.reg_id; |
| 480 | } | 481 | } |
| 482 | + // 活动状态判断显示 | ||
| 483 | + this.activity_status = getCurrentPageParam().status; | ||
| 481 | }, | 484 | }, |
| 482 | mounted() { | 485 | mounted() { |
| 483 | }, | 486 | }, |
| ... | @@ -488,6 +491,7 @@ export default { | ... | @@ -488,6 +491,7 @@ export default { |
| 488 | member_role: '', | 491 | member_role: '', |
| 489 | reg_id: '', | 492 | reg_id: '', |
| 490 | is_end: '', | 493 | is_end: '', |
| 494 | + activity_status: '', | ||
| 491 | } | 495 | } |
| 492 | }, | 496 | }, |
| 493 | computed: { | 497 | computed: { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-21 14:51:44 | 2 | * @Date: 2022-09-21 14:51:44 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-10-25 15:12:40 | 4 | + * @LastEditTime: 2022-10-25 18:29:15 |
| 5 | * @FilePath: /swx/src/pages/my/index.vue | 5 | * @FilePath: /swx/src/pages/my/index.vue |
| 6 | * @Description: 我的页面 | 6 | * @Description: 我的页面 |
| 7 | --> | 7 | --> |
| ... | @@ -64,10 +64,12 @@ | ... | @@ -64,10 +64,12 @@ |
| 64 | </view> | 64 | </view> |
| 65 | <view style="height: 6rem;"></view> | 65 | <view style="height: 6rem;"></view> |
| 66 | <navbar activated="my" /> | 66 | <navbar activated="my" /> |
| 67 | + <van-toast id="van-toast" /> | ||
| 68 | + | ||
| 67 | </template> | 69 | </template> |
| 68 | 70 | ||
| 69 | <script setup> | 71 | <script setup> |
| 70 | -import { ref } from "vue"; | 72 | +import { ref, onMounted } from "vue"; |
| 71 | // import icon_vip from '@/images/icon/vip@2x.png' | 73 | // import icon_vip from '@/images/icon/vip@2x.png' |
| 72 | import Taro from '@tarojs/taro' | 74 | import Taro from '@tarojs/taro' |
| 73 | // import { AtAvatar } from 'taro-ui-vue3' | 75 | // import { AtAvatar } from 'taro-ui-vue3' |
| ... | @@ -78,7 +80,19 @@ import icon_user from '@/images/icon/peiban@2x.png' | ... | @@ -78,7 +80,19 @@ import icon_user from '@/images/icon/peiban@2x.png' |
| 78 | import icon_company from '@/images/icon/zhubanfang@2x.png' | 80 | import icon_company from '@/images/icon/zhubanfang@2x.png' |
| 79 | import navbar from '@/components/navbar.vue' | 81 | import navbar from '@/components/navbar.vue' |
| 80 | import activityCard from '@/components/activity-card.vue' | 82 | import activityCard from '@/components/activity-card.vue' |
| 81 | -import { text } from "stream/consumers"; | 83 | +import { hostListAPI } from '@/api/Host/index' |
| 84 | +import Toast from '@/components/vant-weapp/toast/toast'; | ||
| 85 | + | ||
| 86 | +const host_id = ref(''); | ||
| 87 | +onMounted(async () => { | ||
| 88 | + // 获取主办方列表信息 | ||
| 89 | + const { code, data } = await hostListAPI(); | ||
| 90 | + if (code) { | ||
| 91 | + if (data.my_hosts.length) { | ||
| 92 | + host_id.value = data.my_hosts[0]?.id | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | +}) | ||
| 82 | 96 | ||
| 83 | // 参加的活动 | 97 | // 参加的活动 |
| 84 | const joinActivity = () => { | 98 | const joinActivity = () => { |
| ... | @@ -88,8 +102,12 @@ const joinActivity = () => { | ... | @@ -88,8 +102,12 @@ const joinActivity = () => { |
| 88 | } | 102 | } |
| 89 | // 创建的活动 | 103 | // 创建的活动 |
| 90 | const createActivity = () => { | 104 | const createActivity = () => { |
| 105 | + if (!host_id.value) { | ||
| 106 | + Toast('您还未创建过主办方'); | ||
| 107 | + return false; | ||
| 108 | + } | ||
| 91 | Taro.navigateTo({ | 109 | Taro.navigateTo({ |
| 92 | - url: '../myCreateActivity/index' | 110 | + url: '../myCreateActivity/index?host_id=' + host_id.value |
| 93 | }) | 111 | }) |
| 94 | } | 112 | } |
| 95 | // 陪伴的用户 | 113 | // 陪伴的用户 | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment