Explorar o código

Merge branch 'master' of http://git.dayaedu.com/lex/colexiu-project

lex %!s(int64=3) %!d(string=hai) anos
pai
achega
75ce175d43

+ 1 - 1
src/components/col-header/index.tsx

@@ -16,7 +16,7 @@ export default defineComponent({
         { name: '社区', href: '#', current: false },
         { name: '下载', href: '/downLoad', current: false }
       ],
-      navPath:   ['','','','','/downLoad']
+      navPath:   ['','/musicLibrary','','','/downLoad']
     }
   },
   mounted() {},

+ 2 - 2
src/components/musicLIstItem/index.tsx

@@ -30,7 +30,7 @@ export default defineComponent({
   setup(props: any) {
     const item = props.item
     return () => (
-      <>
+      <div>
         <div class={classes.itemWrap}>
           <div class={classes.left}>
             <div class={classes.imgWrap}>
@@ -67,7 +67,7 @@ export default defineComponent({
             <img class={classes.arrow} src={arrow} alt="" />
           </div>
         </div>
-      </>
+      </div>
     )
   }
 })

+ 1 - 7
src/components/searchInput/index.tsx

@@ -28,13 +28,7 @@ export default defineComponent({
     })
     const getSubjectList = async ()=>{
       try {
-        const res = await request.post('/api-website/subject/subjectSelect', {
-          data: {
-            albumStatus: 'PASS',
-            page: 1,
-            rows: 5,
-            state: 1
-          }
+        const res = await request.get('/api-website/open/subject/subjectSelect', {
         })
 
         state.subjectList = res.data

+ 1 - 1
src/helpers/request.ts

@@ -80,7 +80,7 @@ request.interceptors.response.use(
       }
 
       if (data.code === 403) {
-        window.location.href = location.origin
+        // window.location.href = location.origin
         ElMessage.error('登录已过期,请重新登录')
       }
       throw new Error(msg)

+ 4 - 2
src/router/routes-admin.ts

@@ -27,7 +27,8 @@ export default [
     name: 'musicLibrary',
     component: () => import('@/views/musicLibrary/index'),
     meta: {
-      title: '谱库'
+      title: '谱库',
+      index: 2
     }
   },
   {
@@ -35,7 +36,8 @@ export default [
     name: 'searchdetail',
     component: () => import('@/views/musicLibrary/searchdetail'),
     meta: {
-      title: '谱库'
+      title: '谱库',
+      index: 2
     }
   },
 

+ 85 - 0
src/views/musicLibrary/modals/searchAlbum.tsx

@@ -0,0 +1,85 @@
+// import { PaperClipIcon } from '@heroicons/vue/solid'
+import { defineComponent, toRefs, reactive, onMounted, ref } from 'vue'
+import arrow from '@/components/musicLIstItem/images/arrow.png'
+import styles from '../index.module.less'
+import albumItem from '@/components/albumItem'
+import videoDetailItem from '@/components/videoDetailItem'
+import musicLIstItem from '@/components/musicLIstItem'
+import hotSearch from '@/components/hotSearch'
+import request from '@/helpers/request'
+import silder from '@/components/silder'
+import searchInput from '@/components/searchInput'
+import 'swiper/css'
+import 'swiper/css/navigation'
+import 'swiper/css/pagination'
+import 'swiper/css/scrollbar'
+import { ElTabPane, ElTabs } from 'element-plus'
+export default defineComponent({
+  name: 'searchdetail',
+  components: {
+    hotSearch,
+    silder,
+    searchInput,
+    albumItem
+  },
+  setup() {
+    const state = reactive({
+      albumList: [],
+      musicList: []
+    })
+
+    const getAlbumList = async () => {
+      try {
+        const res = await request.post('/api-website/open/music/album/list', {
+          data: {
+            albumStatus: 1,
+            page: 1,
+            rows: 10
+          }
+        })
+
+        state.albumList = res.data.rows
+      } catch (e) {
+        console.log(e)
+      }
+    }
+    // const getMusicList = async () => {
+    //   try {
+    //     const res = await request.post('/api-website/open/music/sheet/list', {
+    //       data: {
+    //         albumStatus: 'PASS',
+    //         page: 1,
+    //         rows: 5,
+    //         state: 1
+    //       }
+    //     })
+
+    //     state.musicList = res.data.rows
+    //   } catch (e) {
+    //     console.log(e)
+    //   }
+    // }
+
+    onMounted(() => {
+      getAlbumList()
+      // getMusicList()
+    })
+    return () => (
+      <div>
+        <div class="bg-white">
+          <div class={styles.w1200}>
+            <div class={styles.section}>
+            <div class={styles.albumList}>
+                {state.albumList.map(item=>{
+                  return  <albumItem detail={item}></albumItem>
+                })}
+
+
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    )
+  }
+})

+ 9 - 3
src/views/musicLibrary/searchdetail.tsx

@@ -9,6 +9,7 @@ import hotSearch from '@/components/hotSearch'
 import request from '@/helpers/request'
 import silder from '@/components/silder'
 import searchInput from '@/components/searchInput'
+import searchAlbum from './modals/searchAlbum'
 import 'swiper/css'
 import 'swiper/css/navigation'
 import 'swiper/css/pagination'
@@ -19,7 +20,8 @@ export default defineComponent({
   components: {
     hotSearch,
     silder,
-    searchInput
+    searchInput,
+    searchAlbum
   },
   setup() {
     const state = reactive({
@@ -71,8 +73,12 @@ export default defineComponent({
               <searchInput></searchInput>
               <hotSearch type={'search'}></hotSearch>
               <ElTabs>
-                <ElTabPane label="专辑" name="album"></ElTabPane>
-                <ElTabPane label="乐谱" name="music"></ElTabPane>
+                <ElTabPane label="专辑" name="album">
+                  <searchAlbum/>
+                </ElTabPane>
+                <ElTabPane label="乐谱" name="music">
+
+                </ElTabPane>
               </ElTabs>
             </div>
           </div>