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-25 16:18:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
03dff360cafef79c0829dd294e6383539e61ee27
03dff360
1 parent
1627237e
fix
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
src/pages/my/index.vue
src/pages/my/index.vue
View file @
03dff36
<!--
* @Date: 2022-09-21 14:51:44
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-2
4 18:07:28
* @LastEditTime: 2022-10-2
5 15:12:40
* @FilePath: /swx/src/pages/my/index.vue
* @Description: 我的页面
-->
...
...
@@ -78,6 +78,7 @@ import icon_user from '@/images/icon/peiban@2x.png'
import icon_company from '@/images/icon/zhubanfang@2x.png'
import navbar from '@/components/navbar.vue'
import activityCard from '@/components/activity-card.vue'
import { text } from "stream/consumers";
// 参加的活动
const joinActivity = () => {
...
...
@@ -110,6 +111,7 @@ import "./index.less";
import { $ } from '@tarojs/extend'
import mixin from '@/utils/mixin';
import { infoUserAPI } from '@/api/User/index';
import * as dayjs from 'dayjs'
export default {
name: "myPage",
...
...
@@ -123,12 +125,24 @@ export default {
},
async onShow () {
// 获取用户信息和列表
// 只看已报名,未结束的活动
const { code, data } = await infoUserAPI({ is_activity: 1 });
if (code) {
data.activity_list.forEach(item => {
item.server_time = data.server_time;
item.reg_begin_time = this.formatDate(data.reg_begin_time);
item.reg_end_time = this.formatDate(data.reg_end_time);
item.activity_time = this.formatDate(data.activity_time);
})
this.activity_list = data.activity_list;
this.nickname = data.user.nickname;
this.avatar = data.user.avatar ? data.user.avatar : 'https://jdc.jd.com/img/200';
}
},
methods: {
formatDate (date) {
return dayjs(date).format('YYYY-MM-DD HH:mm')
}
}
};
</script>
...
...
Please
register
or
login
to post a comment