Showing
2 changed files
with
25 additions
and
53 deletions
| ... | @@ -3,7 +3,8 @@ const index = [{ | ... | @@ -3,7 +3,8 @@ const index = [{ |
| 3 | name: '我的捐赠', | 3 | name: '我的捐赠', |
| 4 | component: () => import('@/views/me/donateList.vue'), | 4 | component: () => import('@/views/me/donateList.vue'), |
| 5 | meta: { | 5 | meta: { |
| 6 | - title: '我的捐赠' | 6 | + title: '我的捐赠', |
| 7 | + key: 'donate' | ||
| 7 | }, | 8 | }, |
| 8 | children: [] | 9 | children: [] |
| 9 | }, { | 10 | }, { |
| ... | @@ -11,7 +12,8 @@ const index = [{ | ... | @@ -11,7 +12,8 @@ const index = [{ |
| 11 | name: '我的作品', | 12 | name: '我的作品', |
| 12 | component: () => import('@/views/me/videoList.vue'), | 13 | component: () => import('@/views/me/videoList.vue'), |
| 13 | meta: { | 14 | meta: { |
| 14 | - title: '我的作品' | 15 | + title: '我的作品', |
| 16 | + key: 'prod' | ||
| 15 | }, | 17 | }, |
| 16 | children: [] | 18 | children: [] |
| 17 | }, { | 19 | }, { |
| ... | @@ -19,7 +21,8 @@ const index = [{ | ... | @@ -19,7 +21,8 @@ const index = [{ |
| 19 | name: '我的订阅', | 21 | name: '我的订阅', |
| 20 | component: () => import('@/views/me/subscribe.vue'), | 22 | component: () => import('@/views/me/subscribe.vue'), |
| 21 | meta: { | 23 | meta: { |
| 22 | - title: '我的订阅' | 24 | + title: '我的订阅', |
| 25 | + key: 'subs' | ||
| 23 | }, | 26 | }, |
| 24 | children: [] | 27 | children: [] |
| 25 | }, { | 28 | }, { |
| ... | @@ -27,7 +30,8 @@ const index = [{ | ... | @@ -27,7 +30,8 @@ const index = [{ |
| 27 | name: '我的收藏', | 30 | name: '我的收藏', |
| 28 | component: () => import('@/views/me/collection.vue'), | 31 | component: () => import('@/views/me/collection.vue'), |
| 29 | meta: { | 32 | meta: { |
| 30 | - title: '我的收藏' | 33 | + title: '我的收藏', |
| 34 | + key: 'favor' | ||
| 31 | }, | 35 | }, |
| 32 | children: [] | 36 | children: [] |
| 33 | }, { | 37 | }, { |
| ... | @@ -35,7 +39,8 @@ const index = [{ | ... | @@ -35,7 +39,8 @@ const index = [{ |
| 35 | name: '我的点赞', | 39 | name: '我的点赞', |
| 36 | component: () => import('@/views/me/like.vue'), | 40 | component: () => import('@/views/me/like.vue'), |
| 37 | meta: { | 41 | meta: { |
| 38 | - title: '我的点赞' | 42 | + title: '我的点赞', |
| 43 | + key: 'like' | ||
| 39 | }, | 44 | }, |
| 40 | children: [] | 45 | children: [] |
| 41 | }, { | 46 | }, { |
| ... | @@ -45,7 +50,8 @@ const index = [{ | ... | @@ -45,7 +50,8 @@ const index = [{ |
| 45 | meta: { | 50 | meta: { |
| 46 | title: '我的留言', | 51 | title: '我的留言', |
| 47 | keepAlive: true, | 52 | keepAlive: true, |
| 48 | - name: 'message' | 53 | + name: 'message', |
| 54 | + key: 'comment' | ||
| 49 | }, | 55 | }, |
| 50 | children: [] | 56 | children: [] |
| 51 | }, { | 57 | }, { |
| ... | @@ -55,7 +61,8 @@ const index = [{ | ... | @@ -55,7 +61,8 @@ const index = [{ |
| 55 | meta: { | 61 | meta: { |
| 56 | title: '@我的', | 62 | title: '@我的', |
| 57 | keepAlive: true, | 63 | keepAlive: true, |
| 58 | - name: 'callMe' | 64 | + name: 'callMe', |
| 65 | + key: 'reply' | ||
| 59 | }, | 66 | }, |
| 60 | children: [] | 67 | children: [] |
| 61 | }, { | 68 | }, { | ... | ... |
| ... | @@ -93,6 +93,7 @@ import { _, mainStore } from '@/utils/generatePackage.js' | ... | @@ -93,6 +93,7 @@ import { _, mainStore } from '@/utils/generatePackage.js' |
| 93 | import { MyButton, NoticeOverlay } from '@/utils/generateModules.js' | 93 | import { MyButton, NoticeOverlay } from '@/utils/generateModules.js' |
| 94 | import { icon_avatar } from '@/utils/generateIcons.js' | 94 | import { icon_avatar } from '@/utils/generateIcons.js' |
| 95 | import { changePerformerAPI, myInfoAPI, myPerformerAPI } from '@/api/C/me.js' | 95 | import { changePerformerAPI, myInfoAPI, myPerformerAPI } from '@/api/C/me.js' |
| 96 | +import meRoute from '@/router/routes/modules/me' | ||
| 96 | 97 | ||
| 97 | const $router = useRouter(); | 98 | const $router = useRouter(); |
| 98 | 99 | ||
| ... | @@ -107,53 +108,17 @@ store.changeKeepPages('clear'); | ... | @@ -107,53 +108,17 @@ store.changeKeepPages('clear'); |
| 107 | // }) | 108 | // }) |
| 108 | 109 | ||
| 109 | const userInfo = ref({}); | 110 | const userInfo = ref({}); |
| 110 | -// 查询用户信息 | 111 | +// 构建我的列表数据结构 |
| 111 | -const itemList = [ | 112 | +const itemList = []; |
| 112 | - { | 113 | +meRoute.forEach(item => { |
| 113 | - name: '我的捐赠', | 114 | + item.meta.key && itemList.push({ |
| 114 | - key: 'donate_num', | 115 | + name: item.name, |
| 116 | + key: `${item.meta.key}_num`, | ||
| 115 | sum: 0, | 117 | sum: 0, |
| 116 | - to: '/me/donateList' | 118 | + tag: ['comment', 'reply'].includes(item.meta.key), |
| 117 | - }, | 119 | + to: item.path |
| 118 | - { | 120 | + }) |
| 119 | - name: '我的作品', | 121 | +}); |
| 120 | - key: 'prod_num', | ||
| 121 | - sum: 0, | ||
| 122 | - to: '/me/videoList' | ||
| 123 | - }, | ||
| 124 | - { | ||
| 125 | - name: '我的订阅', | ||
| 126 | - key: 'subs_num', | ||
| 127 | - sum: 0, | ||
| 128 | - to: '/me/subscribe' | ||
| 129 | - }, | ||
| 130 | - { | ||
| 131 | - name: '我的收藏', | ||
| 132 | - key: 'favor_num', | ||
| 133 | - sum: 0, | ||
| 134 | - to: '/me/collection' | ||
| 135 | - }, | ||
| 136 | - { | ||
| 137 | - name: '我的点赞', | ||
| 138 | - key: 'like_num', | ||
| 139 | - sum: 0, | ||
| 140 | - to: '/me/like' | ||
| 141 | - }, | ||
| 142 | - { | ||
| 143 | - name: '我的留言', | ||
| 144 | - key: 'comment_num', | ||
| 145 | - sum: 0, | ||
| 146 | - tag: true, | ||
| 147 | - to: '/me/message' | ||
| 148 | - }, | ||
| 149 | - { | ||
| 150 | - name: '@我的', | ||
| 151 | - key: 'reply_num', | ||
| 152 | - sum: 0, | ||
| 153 | - tag: true, | ||
| 154 | - to: '/me/callMe' | ||
| 155 | - }, | ||
| 156 | -] | ||
| 157 | 122 | ||
| 158 | // 异步获取我的列表数量信息 | 123 | // 异步获取我的列表数量信息 |
| 159 | async function getMySum() { | 124 | async function getMySum() { | ... | ... |
-
Please register or login to post a comment