Showing
2 changed files
with
15 additions
and
6 deletions
| 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 18:29:15 | 4 | + * @LastEditTime: 2022-10-26 15:52:42 |
| 5 | * @FilePath: /swx/src/pages/my/index.vue | 5 | * @FilePath: /swx/src/pages/my/index.vue |
| 6 | * @Description: 我的页面 | 6 | * @Description: 我的页面 |
| 7 | --> | 7 | --> |
| ... | @@ -84,13 +84,17 @@ import { hostListAPI } from '@/api/Host/index' | ... | @@ -84,13 +84,17 @@ import { hostListAPI } from '@/api/Host/index' |
| 84 | import Toast from '@/components/vant-weapp/toast/toast'; | 84 | import Toast from '@/components/vant-weapp/toast/toast'; |
| 85 | 85 | ||
| 86 | const host_id = ref(''); | 86 | const host_id = ref(''); |
| 87 | +const join_hosts = ref([]) | ||
| 87 | onMounted(async () => { | 88 | onMounted(async () => { |
| 88 | // 获取主办方列表信息 | 89 | // 获取主办方列表信息 |
| 89 | - const { code, data } = await hostListAPI(); | 90 | + const { code, data } = await hostListAPI({ is_join: 1 }); |
| 90 | if (code) { | 91 | if (code) { |
| 91 | if (data.my_hosts.length) { | 92 | if (data.my_hosts.length) { |
| 92 | host_id.value = data.my_hosts[0]?.id | 93 | host_id.value = data.my_hosts[0]?.id |
| 93 | } | 94 | } |
| 95 | + if (data.join_hosts.length) { | ||
| 96 | + join_hosts.value = data.join_hosts | ||
| 97 | + } | ||
| 94 | } | 98 | } |
| 95 | }) | 99 | }) |
| 96 | 100 | ||
| ... | @@ -111,11 +115,16 @@ const createActivity = () => { | ... | @@ -111,11 +115,16 @@ const createActivity = () => { |
| 111 | }) | 115 | }) |
| 112 | } | 116 | } |
| 113 | // 陪伴的用户 | 117 | // 陪伴的用户 |
| 114 | -const followUser = () => { | 118 | +const followUser = async () => { |
| 119 | + if (join_hosts.value.length) { | ||
| 115 | Taro.navigateTo({ | 120 | Taro.navigateTo({ |
| 116 | - url: '../myFollowUser/index' | 121 | + url: '../myFollowUser/index?host_id=' + join_hosts.value[0]['id'] |
| 117 | }) | 122 | }) |
| 123 | + } else { | ||
| 124 | + Toast('您还加入过义工') | ||
| 125 | + } | ||
| 118 | } | 126 | } |
| 127 | + | ||
| 119 | // 我的主办方 | 128 | // 我的主办方 |
| 120 | const myProject = () => { | 129 | const myProject = () => { |
| 121 | Taro.navigateTo({ | 130 | Taro.navigateTo({ |
| ... | @@ -154,13 +163,13 @@ export default { | ... | @@ -154,13 +163,13 @@ export default { |
| 154 | }) | 163 | }) |
| 155 | this.activity_list = data.activity_list; | 164 | this.activity_list = data.activity_list; |
| 156 | this.nickname = data.user.nickname; | 165 | this.nickname = data.user.nickname; |
| 157 | - this.avatar = data.user.avatar ? data.user.avatar : 'https://jdc.jd.com/img/200'; | 166 | + this.avatar = data.user.avatar ? data.user.avatar : 'http://gyzs.onwall.cn/tou%402x.png'; |
| 158 | } | 167 | } |
| 159 | }, | 168 | }, |
| 160 | methods: { | 169 | methods: { |
| 161 | formatDate (date) { | 170 | formatDate (date) { |
| 162 | return dayjs(date).format('YYYY-MM-DD HH:mm') | 171 | return dayjs(date).format('YYYY-MM-DD HH:mm') |
| 163 | - } | 172 | + }, |
| 164 | } | 173 | } |
| 165 | }; | 174 | }; |
| 166 | </script> | 175 | </script> | ... | ... |
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment