Ver Fonte

bug更新

lex há 2 anos atrás
pai
commit
45241c4556

+ 2 - 2
src/components/musicLIstItem/index.module.less

@@ -95,7 +95,7 @@
         align-items: center;
       }
       .musicSheetName {
-        max-width: 250px;
+        max-width: 200px;
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
@@ -106,7 +106,7 @@
         line-height: 22px;
         font-size: 16px;
         margin-left: 12px;
-        max-width: 150px;
+        max-width: 130px;
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;

+ 4 - 2
src/views/albumDetail/index.tsx

@@ -87,7 +87,9 @@ export default defineComponent({
             })) ||
           []
         state.hotList = res.data.hotMusicAlbum
-        state.hotTagList = res.data.musicTagNames.split(',') || []
+        state.hotTagList = res.data.musicTagNames
+          ? res.data.musicTagNames.split(',')
+          : []
         state.relatedMusicAlbum = res.data.relatedMusicAlbum
       } catch (e) {
         console.log(e)
@@ -127,7 +129,7 @@ export default defineComponent({
     }
 
     const gotoMore = () => {
-      router.push({ path: '/searchdetail' })
+      router.push({ path: '/albumibrary' })
     }
     return () => (
       <>

+ 3 - 3
src/views/albumLibrary/index.tsx

@@ -57,7 +57,7 @@ export default defineComponent({
       searchs: {
         albumStatus: 1,
         albumTagIds: route.query.albumTagIds || '',
-        search: '',
+        search: route.query.search || '',
         subject: subjectId || '',
         page: 1,
         rows: 10
@@ -190,7 +190,7 @@ export default defineComponent({
                 }}
               ></searchInput>
               <div class={styles.hotSearch}>
-                <hotSearch
+                {/* <hotSearch
                   onSearchRust={(val: any) => searchRust(val)}
                   onHotTag={(val: string) => {
                     state.searchs.search = val
@@ -198,7 +198,7 @@ export default defineComponent({
                   }}
                   type={''}
                   isChiose={true}
-                ></hotSearch>
+                ></hotSearch> */}
               </div>
 
               {state.albumList && state.albumList.length > 0 && (

+ 3 - 4
src/views/home/index.module.less

@@ -73,7 +73,7 @@
       .line {
         opacity: 0.2;
         // border: 1px solid #979797;
-        background-color:  #979797;
+        background-color: #979797;
         width: 1px;
         height: calc(100% - 30px);
         position: absolute;
@@ -121,7 +121,6 @@
 
           .el-input {
             .el-input__wrapper {
-
               box-shadow: none;
               padding: 0;
               .el-input__inner {
@@ -132,7 +131,7 @@
                 border-radius: 25px;
                 border: 1px solid #2dc7aa;
                 &:hover {
-                  box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.1000);
+                  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.1);
                 }
               }
             }
@@ -142,7 +141,7 @@
       .chioseRow {
         margin-top: 38px;
         .chioseTagWrap {
-          max-height: 168px;
+          // max-height: 168px;
           overflow: hidden;
         }
         p {

+ 21 - 8
src/views/home/index.tsx

@@ -99,7 +99,10 @@ export default defineComponent({
       }
     }
     const gotoSearch = (val: string, type = 'music') => {
-      router.push({ name: 'musicLibrary', query: { search: val } })
+      router.push({
+        name: type === 'music' ? 'musicLibrary' : 'albumibrary',
+        query: { search: val }
+      })
     }
     const getTagTree = async (type = 'MUSIC') => {
       try {
@@ -113,26 +116,36 @@ export default defineComponent({
           const resHot = await request.get(
             `/api-website/open/music/sheet/hotTag/${type}`
           )
-          state.hotList = resHot.data || []
-          state.tagTree = res.data || []
+          state.hotList = getArrayLength(resHot.data || [])
+          state.tagTree = getArrayLength(res.data || [])
         } else {
-          state.tagTreeAlbum = res.data || []
+          state.tagTreeAlbum = getArrayLength(res.data || [])
         }
       } catch (e) {
         console.log(e)
       }
     }
 
+    const getArrayLength = (arr: any, num = 6) => {
+      return arr.splice(0, num)
+    }
+
     const gotoVideoList = () => {
       router.push({ path: '/videoDetailList' })
     }
 
     const gotoSearchTag = (tag: any, type: string) => {
-      if (type === 'album') {
+      if (type === 'album' || type === 'albumTag') {
+        const params = {} as any
+        if (type === 'album') {
+          params.albumTagIds = tag.id
+        } else {
+          params.search = tag
+        }
         router.push({
           name: 'albumibrary',
           query: {
-            albumTagIds: tag.id
+            ...params
           }
         })
       } else if (type === 'music' || type === 'musicHot') {
@@ -196,11 +209,11 @@ export default defineComponent({
                     <img
                       src={searchIcon}
                       class={styles.searchIcon}
-                      onClick={() => gotoSearch(state.search)}
+                      onClick={() => gotoSearchTag(state.search, 'albumTag')}
                       alt=""
                     />
                     <ElInput
-                      placeholder="搜索你想要的曲目"
+                      placeholder="搜索你想要的专辑"
                       v-model={state.search}
                     ></ElInput>
                   </div>