mo vor 2 Jahren
Ursprung
Commit
d6f909580a

+ 6 - 1
src/components/col-header/index.css

@@ -4,7 +4,9 @@
   /* @apply bg-black/[.2] */
   /* @apply bg-black/[.2] */
   background: rgba(0, 0, 0, 0.2);
   background: rgba(0, 0, 0, 0.2);
 }
 }
-
+.wall {
+  height: 70px;
+}
 .logoWrap {
 .logoWrap {
   margin-left: 80px;
   margin-left: 80px;
   margin-right:55px;
   margin-right:55px;
@@ -65,6 +67,9 @@
   height: 70px;
   height: 70px;
   line-height: 70px;
   line-height: 70px;
 }
 }
+.isdark.headerSection {
+  background-color: #383838!important;
+}
 .rightWrap {
 .rightWrap {
   margin-right: 130px;
   margin-right: 130px;
 }
 }

+ 19 - 10
src/components/col-header/index.tsx

@@ -18,7 +18,8 @@ export default defineComponent({
         { name: '下载', href: '/downLoad', current: false }
         { name: '下载', href: '/downLoad', current: false }
       ],
       ],
       navPath: ['', '/musicLibrary', '', '', '/downLoad'],
       navPath: ['', '/musicLibrary', '', '', '/downLoad'],
-      isTop: false
+      isTop: false,
+      isdark:false
     }
     }
   },
   },
   mounted() {
   mounted() {
@@ -26,14 +27,19 @@ export default defineComponent({
       //函数体
       //函数体
       let scrollTop =
       let scrollTop =
         document.documentElement.scrollTop | document.body.scrollTop
         document.documentElement.scrollTop | document.body.scrollTop
-      scrollTop > 0 ? (this.isTop = true) : (this.isTop = false)
+      scrollTop > 70 ? (this.isTop = true) : (this.isTop = false)
     })
     })
   },
   },
   watch: {
   watch: {
     $route(res: any) {
     $route(res: any) {
       this.navigator.forEach((item: any) => {
       this.navigator.forEach((item: any) => {
-        if (item.href === res.path) {
+        item.current = false
+      })
+      this.navigator.forEach((item: any) => {
+        if (item.href === res.meta.highlightPath) {
           item.current = true
           item.current = true
+          this.isdark = !!res.meta.isdark
+           console.log(this.isdark)
         }
         }
       })
       })
     }
     }
@@ -43,8 +49,9 @@ export default defineComponent({
       <>
       <>
         {/* <div class="wall h-[70px]"></div> */}
         {/* <div class="wall h-[70px]"></div> */}
         <div
         <div
-          class={['headerSection backdrop-blur-sm', this.isTop ? '' : 'top']}
+          class={['headerSection backdrop-blur-sm', this.isTop ? '' : 'top',this.isdark?'isdark':'']}
         >
         >
+
           <div class="flex items-center h-full">
           <div class="flex items-center h-full">
             <div class="logoWrap">
             <div class="logoWrap">
               <img class="w-full" src={logo} alt="" />
               <img class="w-full" src={logo} alt="" />
@@ -52,12 +59,12 @@ export default defineComponent({
             <div class="flex">
             <div class="flex">
               {this.navigator.map((item: any) => (
               {this.navigator.map((item: any) => (
                 <div
                 <div
-                  onClick={() => {
-                    this.navigator.forEach((item: any) => {
-                      item.current = false
-                    })
-                    item.current = true
-                  }}
+                  // onClick={() => {
+                  //   this.navigator.forEach((item: any) => {
+                  //     item.current = false
+                  //   })
+                  //   item.current = true
+                  // }}
                 >
                 >
                   <RouterLink
                   <RouterLink
                     to={item.href}
                     to={item.href}
@@ -84,6 +91,8 @@ export default defineComponent({
             </ElButton>
             </ElButton>
           </div>
           </div>
         </div>
         </div>
+        {this.isTop?<div class="wall"></div>:''}
+
       </>
       </>
     )
     )
   }
   }

+ 0 - 1
src/components/musicLIstItem/index.tsx

@@ -34,7 +34,6 @@ export default defineComponent({
   },
   },
   setup(props: any) {
   setup(props: any) {
     const item = props.item
     const item = props.item
-    console.log(item)
     return () => (
     return () => (
       <div
       <div
         onClick={() => {
         onClick={() => {

+ 57 - 20
src/router/routes-admin.ts

@@ -7,19 +7,31 @@
 export default [
 export default [
   {
   {
     path: '/',
     path: '/',
-    component: () => import('@/views/home/index')
+    component: () => import('@/views/home/index'),
+    meta: {
+      title: '首页',
+      highlightPath: '/home',
+      isdark:false
+    }
   },
   },
   {
   {
     path: '/home',
     path: '/home',
     name: 'home',
     name: 'home',
-    component: () => import('@/views/home/index')
+    component: () => import('@/views/home/index'),
+    meta: {
+      title: '首页',
+      highlightPath: '/home',
+      isdark:false
+    }
   },
   },
   {
   {
     path: '/downLoad',
     path: '/downLoad',
     name: 'downLoad',
     name: 'downLoad',
     component: () => import('@/views/downLoad/index'),
     component: () => import('@/views/downLoad/index'),
     meta: {
     meta: {
-      title: '下载'
+      title: '下载',
+      highlightPath: '/downLoad',
+      isdark:true
     }
     }
   },
   },
   {
   {
@@ -28,7 +40,9 @@ export default [
     component: () => import('@/views/musicLibrary/index'),
     component: () => import('@/views/musicLibrary/index'),
     meta: {
     meta: {
       title: '谱库',
       title: '谱库',
-      index: 2
+      highlightPath: '/musicLibrary',
+      index: 2,
+      isdark:false
     }
     }
   },
   },
   {
   {
@@ -37,7 +51,9 @@ export default [
     component: () => import('@/views/musicLibrary/searchdetail'),
     component: () => import('@/views/musicLibrary/searchdetail'),
     meta: {
     meta: {
       title: '搜索',
       title: '搜索',
-      index: 3
+      index: 3,
+      highlightPath: '/musicLibrary',
+      isdark:true
     }
     }
   },
   },
   {
   {
@@ -46,7 +62,9 @@ export default [
     component: () => import('@/views/albumDetail'),
     component: () => import('@/views/albumDetail'),
     meta: {
     meta: {
       title: '专辑详情',
       title: '专辑详情',
-      index: 3
+      index: 3,
+      highlightPath: '/musicLibrary',
+      isdark:true
     }
     }
   },
   },
   {
   {
@@ -55,7 +73,9 @@ export default [
     component: () => import('@/views/videoDetailList'),
     component: () => import('@/views/videoDetailList'),
     meta: {
     meta: {
       title: '视频课',
       title: '视频课',
-      index: 3
+      index: 3,
+      highlightPath: '/videoDetailList',
+      isdark:true
     }
     }
   },
   },
   {
   {
@@ -64,18 +84,21 @@ export default [
     component: () => import('@/views/videoDetailList/videoDetail'),
     component: () => import('@/views/videoDetailList/videoDetail'),
     meta: {
     meta: {
       title: '视频课详情',
       title: '视频课详情',
-      index: 3
+      index: 3,
+      highlightPath: '/videoDetailList',
+      isdark:true
     }
     }
   },
   },
   //
   //
 
 
-
   {
   {
     path: '/teacherAuth',
     path: '/teacherAuth',
     name: 'teacherAuth',
     name: 'teacherAuth',
     component: () => import('@/views/role-auth/teacherAuth'),
     component: () => import('@/views/role-auth/teacherAuth'),
     meta: {
     meta: {
-      title: '老师认证'
+      title: '老师认证',
+      isdark:true
+
     }
     }
   },
   },
   {
   {
@@ -83,7 +106,9 @@ export default [
     name: 'musicAuth',
     name: 'musicAuth',
     component: () => import('@/views/role-auth/musicAuth'),
     component: () => import('@/views/role-auth/musicAuth'),
     meta: {
     meta: {
-      title: '音乐人认证'
+      title: '音乐人认证',
+      isdark:true
+
     }
     }
   },
   },
   {
   {
@@ -96,13 +121,15 @@ export default [
         path: '/userInfo/practiceSetting',
         path: '/userInfo/practiceSetting',
         name: 'userInfoPracticeSetting',
         name: 'userInfoPracticeSetting',
         component: () => import('@/views/user-info/practice-setting'),
         component: () => import('@/views/user-info/practice-setting'),
-        meta: { title: '陪练课', index: 2 }
+        meta: { title: '陪练课', index: 2,       isdark:true
+      }
       },
       },
       {
       {
         path: '/userInfo/liveClass',
         path: '/userInfo/liveClass',
         name: 'userInfoLiveClass',
         name: 'userInfoLiveClass',
         component: () => import('@/views/user-info/live-class'),
         component: () => import('@/views/user-info/live-class'),
-        meta: { title: '直播课', index: 3 }
+        meta: { title: '直播课', index: 3 ,       isdark:true
+      }
       },
       },
       {
       {
         path: '/userInfo/liveOperation',
         path: '/userInfo/liveOperation',
@@ -112,14 +139,17 @@ export default [
           title: '直播课',
           title: '直播课',
           index: 4,
           index: 4,
           hidden: true,
           hidden: true,
-          activeMenu: 'userInfoLiveClass'
+          activeMenu: 'userInfoLiveClass',
+          isdark:true
+
         }
         }
       },
       },
       {
       {
         path: '/userInfo/videoClass',
         path: '/userInfo/videoClass',
         name: 'userInfoVideoClass',
         name: 'userInfoVideoClass',
         component: () => import('@/views/user-info/video-class'),
         component: () => import('@/views/user-info/video-class'),
-        meta: { title: '视频课', index: 4 }
+        meta: { title: '视频课', index: 4,       isdark:true
+      }
       },
       },
       {
       {
         path: '/userInfo/videoOperation',
         path: '/userInfo/videoOperation',
@@ -129,14 +159,17 @@ export default [
           title: '视频课',
           title: '视频课',
           index: 4,
           index: 4,
           hidden: true,
           hidden: true,
-          activeMenu: 'userInfoVideoClass'
+          activeMenu: 'userInfoVideoClass',
+          isdark:true
+
         }
         }
       },
       },
       {
       {
         path: '/userInfo/musicClass',
         path: '/userInfo/musicClass',
         name: 'userInfoMusicClass',
         name: 'userInfoMusicClass',
         component: () => import('@/views/user-info/music-class'),
         component: () => import('@/views/user-info/music-class'),
-        meta: { title: '我的曲谱', index: 5 }
+        meta: { title: '我的曲谱', index: 5,      isdark:true
+      }
       },
       },
       {
       {
         path: '/userInfo/musicOperation',
         path: '/userInfo/musicOperation',
@@ -146,7 +179,9 @@ export default [
           title: '视频课',
           title: '视频课',
           index: 4,
           index: 4,
           hidden: true,
           hidden: true,
-          activeMenu: 'userInfoMusicClass'
+          activeMenu: 'userInfoMusicClass',
+          isdark:true
+
         }
         }
       }
       }
     ]
     ]
@@ -161,13 +196,15 @@ export default [
         path: '/studentInfo/myScore',
         path: '/studentInfo/myScore',
         name: 'studentInfoMyScore',
         name: 'studentInfoMyScore',
         component: () => import('@/views/student-info/my-score'),
         component: () => import('@/views/student-info/my-score'),
-        meta: { title: '我的曲谱', index: 5 }
+        meta: { title: '我的曲谱', index: 5,       isdark:true
+      }
       },
       },
       {
       {
         path: '/studentInfo/myFollow',
         path: '/studentInfo/myFollow',
         name: 'studentInfoMyFollow',
         name: 'studentInfoMyFollow',
         component: () => import('@/views/student-info/my-follow'),
         component: () => import('@/views/student-info/my-follow'),
-        meta: { title: '我关注的老师', index: 5, hidden: true }
+        meta: { title: '我关注的老师', index: 5, hidden: true,       isdark:true
+      }
       }
       }
     ]
     ]
   }
   }