Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-05-25 19:52:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0036628ac8531452fb93e0fbb5ed6a3a2f6bd4b2
0036628a
1 parent
b297e891
✨ feat(我的): 固定列表数据生成方式调整
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
53 deletions
src/router/routes/modules/me/index.js
src/views/me/index.vue
src/router/routes/modules/me/index.js
View file @
0036628
...
...
@@ -3,7 +3,8 @@ const index = [{
name
:
'我的捐赠'
,
component
:
()
=>
import
(
'@/views/me/donateList.vue'
),
meta
:
{
title
:
'我的捐赠'
title
:
'我的捐赠'
,
key
:
'donate'
},
children
:
[]
},
{
...
...
@@ -11,7 +12,8 @@ const index = [{
name
:
'我的作品'
,
component
:
()
=>
import
(
'@/views/me/videoList.vue'
),
meta
:
{
title
:
'我的作品'
title
:
'我的作品'
,
key
:
'prod'
},
children
:
[]
},
{
...
...
@@ -19,7 +21,8 @@ const index = [{
name
:
'我的订阅'
,
component
:
()
=>
import
(
'@/views/me/subscribe.vue'
),
meta
:
{
title
:
'我的订阅'
title
:
'我的订阅'
,
key
:
'subs'
},
children
:
[]
},
{
...
...
@@ -27,7 +30,8 @@ const index = [{
name
:
'我的收藏'
,
component
:
()
=>
import
(
'@/views/me/collection.vue'
),
meta
:
{
title
:
'我的收藏'
title
:
'我的收藏'
,
key
:
'favor'
},
children
:
[]
},
{
...
...
@@ -35,7 +39,8 @@ const index = [{
name
:
'我的点赞'
,
component
:
()
=>
import
(
'@/views/me/like.vue'
),
meta
:
{
title
:
'我的点赞'
title
:
'我的点赞'
,
key
:
'like'
},
children
:
[]
},
{
...
...
@@ -45,7 +50,8 @@ const index = [{
meta
:
{
title
:
'我的留言'
,
keepAlive
:
true
,
name
:
'message'
name
:
'message'
,
key
:
'comment'
},
children
:
[]
},
{
...
...
@@ -55,7 +61,8 @@ const index = [{
meta
:
{
title
:
'@我的'
,
keepAlive
:
true
,
name
:
'callMe'
name
:
'callMe'
,
key
:
'reply'
},
children
:
[]
},
{
...
...
src/views/me/index.vue
View file @
0036628
...
...
@@ -93,6 +93,7 @@ import { _, mainStore } from '@/utils/generatePackage.js'
import { MyButton, NoticeOverlay } from '@/utils/generateModules.js'
import { icon_avatar } from '@/utils/generateIcons.js'
import { changePerformerAPI, myInfoAPI, myPerformerAPI } from '@/api/C/me.js'
import meRoute from '@/router/routes/modules/me'
const $router = useRouter();
...
...
@@ -107,53 +108,17 @@ store.changeKeepPages('clear');
// })
const userInfo = ref({});
// 查询用户信息
const itemList = [
{
name: '我的捐赠',
key: 'donate_num',
// 构建我的列表数据结构
const itemList = [];
meRoute.forEach(item => {
item.meta.key && itemList.push({
name: item.name,
key: `${item.meta.key}_num`,
sum: 0,
to: '/me/donateList'
},
{
name: '我的作品',
key: 'prod_num',
sum: 0,
to: '/me/videoList'
},
{
name: '我的订阅',
key: 'subs_num',
sum: 0,
to: '/me/subscribe'
},
{
name: '我的收藏',
key: 'favor_num',
sum: 0,
to: '/me/collection'
},
{
name: '我的点赞',
key: 'like_num',
sum: 0,
to: '/me/like'
},
{
name: '我的留言',
key: 'comment_num',
sum: 0,
tag: true,
to: '/me/message'
},
{
name: '@我的',
key: 'reply_num',
sum: 0,
tag: true,
to: '/me/callMe'
},
]
tag: ['comment', 'reply'].includes(item.meta.key),
to: item.path
})
});
// 异步获取我的列表数量信息
async function getMySum() {
...
...
Please
register
or
login
to post a comment