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-10-26 15:54:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dadaaecee7305f0de136683c0eedd711a1c7cc09
dadaaece
1 parent
51a24a73
✨ feat: 陪伴用户页面API联调
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
src/pages/my/index.vue
src/pages/myFollowUser/index.vue
src/pages/my/index.vue
View file @
dadaaec
<!--
* @Date: 2022-09-21 14:51:44
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-2
5 18:29:15
* @LastEditTime: 2022-10-2
6 15:52:42
* @FilePath: /swx/src/pages/my/index.vue
* @Description: 我的页面
-->
...
...
@@ -84,13 +84,17 @@ import { hostListAPI } from '@/api/Host/index'
import Toast from '@/components/vant-weapp/toast/toast';
const host_id = ref('');
const join_hosts = ref([])
onMounted(async () => {
// 获取主办方列表信息
const { code, data } = await hostListAPI();
const { code, data } = await hostListAPI(
{ is_join: 1 }
);
if (code) {
if (data.my_hosts.length) {
host_id.value = data.my_hosts[0]?.id
}
if (data.join_hosts.length) {
join_hosts.value = data.join_hosts
}
}
})
...
...
@@ -111,11 +115,16 @@ const createActivity = () => {
})
}
// 陪伴的用户
const followUser = () => {
const followUser = async () => {
if (join_hosts.value.length) {
Taro.navigateTo({
url: '../myFollowUser/index'
url: '../myFollowUser/index?host_id=' + join_hosts.value[0]['id']
})
} else {
Toast('您还加入过义工')
}
}
// 我的主办方
const myProject = () => {
Taro.navigateTo({
...
...
@@ -154,13 +163,13 @@ export default {
})
this.activity_list = data.activity_list;
this.nickname = data.user.nickname;
this.avatar = data.user.avatar ? data.user.avatar : 'http
s://jdc.jd.com/img/200
';
this.avatar = data.user.avatar ? data.user.avatar : 'http
://gyzs.onwall.cn/tou%402x.png
';
}
},
methods: {
formatDate (date) {
return dayjs(date).format('YYYY-MM-DD HH:mm')
}
}
,
}
};
</script>
...
...
src/pages/myFollowUser/index.vue
View file @
dadaaec
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment