Bladeren bron

更新 NavBar, 只显示 video 和 account 相关的路由

reghao 1 jaar geleden
bovenliggende
commit
73f6182769
2 gewijzigde bestanden met toevoegingen van 33 en 33 verwijderingen
  1. 30 30
      src/components/layout/NavBar.vue
  2. 3 3
      src/views/my/MyVip.vue

+ 30 - 30
src/components/layout/NavBar.vue

@@ -16,7 +16,7 @@
       >
         <el-menu-item index="1">
           <a href="/video" style="text-decoration-line: none">
-            <span style="color: #007bff">视频</span>
+            <span style="color: #007bff">分区</span>
           </a>
         </el-menu-item>
         <el-menu-item index="2">
@@ -64,27 +64,15 @@
                 @click.native="goToProfile"
               >我的帐号</el-dropdown-item>
               <el-dropdown-item
-                icon="el-icon-files"
+                icon="el-icon-collection"
                 class="size"
-                @click.native="goToDisk"
-              >我的网盘</el-dropdown-item>
+                @click.native="goToFavlist"
+              >收藏夹</el-dropdown-item>
               <el-dropdown-item
                 icon="el-icon-s-data"
                 class="size"
                 @click.native="goToPost"
-              >我的稿件
-              </el-dropdown-item>
-              <el-dropdown-item
-                icon="el-icon-video-camera"
-                class="size"
-                @click.native="goToCam"
-              >我的监控
-              </el-dropdown-item>
-              <el-dropdown-item
-                icon="el-icon-s-shop"
-                class="size"
-                @click.native="goToMall"
-              >我的商城
+              >历史记录
               </el-dropdown-item>
               <el-dropdown-item
                 icon="el-icon-s-home"
@@ -170,7 +158,7 @@
 import { userMixin } from 'assets/js/mixin'
 import { keywordSuggest } from '@/api/search'
 import { getAuthedUser } from '@/utils/auth'
-import {getUnreadCount} from "@/api/user";
+import { getUnreadCount } from '@/api/user'
 
 export default {
   name: 'NavBar',
@@ -280,6 +268,14 @@ export default {
       console.log('帐号注册')
     },
     // ****************************************************************************************************************
+    goToFavlist() {
+      const path = '/post/fav/video'
+      if (this.$route.path === path) {
+        this.$router.go(0)
+        return
+      }
+      this.$router.push(path)
+    },
     goToDisk() {
       const path = '/disk'
       if (this.$route.path === path) {
@@ -319,34 +315,38 @@ export default {
       }
       this.$router.push('/post')
     },
-    goToCam() {
-      if (this.$route.path === '/cam') {
+    goToMessage() {
+      if (this.$route.path === '/my/message') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/cam')
+      this.$router.push('/my/message')
     },
-    goToMall() {
-      if (this.$route.path === '/mall') {
+    goToPublish() {
+      if (this.$route.path === '/post/publish/video') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/mall')
+      this.$router.push('/post/publish/video')
     },
-    goToMessage() {
-      if (this.$route.path === '/my/message') {
+    // ************************************************************************
+    // 我的监控
+    goToCam() {
+      if (this.$route.path === '/cam') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/my/message')
+      this.$router.push('/cam')
     },
-    goToPublish() {
-      if (this.$route.path === '/post/publish/video') {
+    // 我的商城
+    goToMall() {
+      if (this.$route.path === '/mall') {
         this.$router.go(0)
         return
       }
-      this.$router.push('/post/publish/video')
+      this.$router.push('/mall')
     }
+    // ************************************************************************
   }
 }
 </script>

+ 3 - 3
src/views/my/MyVip.vue

@@ -5,7 +5,7 @@
         <div slot="header" class="clearfix">
           <span>我的小会员</span>
         </div>
-        <div class="text item" v-if="myVip !== null">
+        <div v-if="myVip !== null" class="text item">
           <el-row v-if="!myVip.isVip">
             您当前还不是小会员, <el-button type="text" @click="showPlanDialog">成为小会员</el-button>
           </el-row>
@@ -14,7 +14,7 @@
               您的小会员已过期, <el-button type="text" @click="showPlanDialog">续费小会员</el-button>
             </el-row>
             <el-row v-else>
-              您的小会员还有 <span style="color: red">{{myVip.expireIn}}</span> 天到期, <el-button type="text" @click="showPlanDialog">续费小会员</el-button>
+              您的小会员还有 <span style="color: red">{{ myVip.expireIn }}</span> 天到期, <el-button type="text" @click="showPlanDialog">续费小会员</el-button>
             </el-row>
           </el-row>
         </div>
@@ -68,7 +68,7 @@
 
 <script>
 import StampBadge from '@/components/StampBadge'
-import {getMyVip, getVipPlans, vip} from '@/api/account'
+import { getMyVip, getVipPlans, vip } from '@/api/account'
 
 export default {
   name: 'MyVip',