hookehuyr

fix

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-24 18:07:28 4 + * @LastEditTime: 2022-10-25 15:12:40
5 * @FilePath: /swx/src/pages/my/index.vue 5 * @FilePath: /swx/src/pages/my/index.vue
6 * @Description: 我的页面 6 * @Description: 我的页面
7 --> 7 -->
...@@ -78,6 +78,7 @@ import icon_user from '@/images/icon/peiban@2x.png' ...@@ -78,6 +78,7 @@ import icon_user from '@/images/icon/peiban@2x.png'
78 import icon_company from '@/images/icon/zhubanfang@2x.png' 78 import icon_company from '@/images/icon/zhubanfang@2x.png'
79 import navbar from '@/components/navbar.vue' 79 import navbar from '@/components/navbar.vue'
80 import activityCard from '@/components/activity-card.vue' 80 import activityCard from '@/components/activity-card.vue'
81 +import { text } from "stream/consumers";
81 82
82 // 参加的活动 83 // 参加的活动
83 const joinActivity = () => { 84 const joinActivity = () => {
...@@ -110,6 +111,7 @@ import "./index.less"; ...@@ -110,6 +111,7 @@ import "./index.less";
110 import { $ } from '@tarojs/extend' 111 import { $ } from '@tarojs/extend'
111 import mixin from '@/utils/mixin'; 112 import mixin from '@/utils/mixin';
112 import { infoUserAPI } from '@/api/User/index'; 113 import { infoUserAPI } from '@/api/User/index';
114 +import * as dayjs from 'dayjs'
113 115
114 export default { 116 export default {
115 name: "myPage", 117 name: "myPage",
...@@ -123,12 +125,24 @@ export default { ...@@ -123,12 +125,24 @@ export default {
123 }, 125 },
124 async onShow () { 126 async onShow () {
125 // 获取用户信息和列表 127 // 获取用户信息和列表
128 + // 只看已报名,未结束的活动
126 const { code, data } = await infoUserAPI({ is_activity: 1 }); 129 const { code, data } = await infoUserAPI({ is_activity: 1 });
127 if (code) { 130 if (code) {
131 + data.activity_list.forEach(item => {
132 + item.server_time = data.server_time;
133 + item.reg_begin_time = this.formatDate(data.reg_begin_time);
134 + item.reg_end_time = this.formatDate(data.reg_end_time);
135 + item.activity_time = this.formatDate(data.activity_time);
136 + })
128 this.activity_list = data.activity_list; 137 this.activity_list = data.activity_list;
129 this.nickname = data.user.nickname; 138 this.nickname = data.user.nickname;
130 this.avatar = data.user.avatar ? data.user.avatar : 'https://jdc.jd.com/img/200'; 139 this.avatar = data.user.avatar ? data.user.avatar : 'https://jdc.jd.com/img/200';
131 } 140 }
132 }, 141 },
142 + methods: {
143 + formatDate (date) {
144 + return dayjs(date).format('YYYY-MM-DD HH:mm')
145 + }
146 + }
133 }; 147 };
134 </script> 148 </script>
......