Jelajahi Sumber

更新修改

lex 2 tahun lalu
induk
melakukan
a030fc9829

TEMPAT SAMPAH
src/common/images/icon_fine.png


+ 38 - 8
src/components/hotSearch/index.tsx

@@ -48,9 +48,9 @@ export default defineComponent({
       hotList: [],
       type: props.type,
       showDetail: true,
-      tagTree: [],
-      chioseTagList: [],
-      chioseParentList: [],
+      tagTree: [] as any,
+      chioseTagList: [] as any,
+      chioseParentList: [] as any,
       searchTagList: [],
       searchType: props.searchType,
       searchHover: false
@@ -73,13 +73,43 @@ export default defineComponent({
       try {
         const res = await request.get('/api-website/open/MusicTag/tree', {})
         state.tagTree = res.data
+
+        state.tagTree.push({
+          id: -1,
+          name: '乐谱类型',
+          children: [
+            {
+              id: -1,
+              name: '全部',
+              parentTagId: -1,
+              isCheck: true
+            },
+            {
+              id: -2,
+              name: '精品',
+              parentTagId: -1
+            }
+          ]
+        })
+        // 初始化选中
+        state.chioseParentList.push(-1)
+        state.chioseTagList.push(-1)
+        state.searchTagList = []
+        state.tagTree.forEach((tree: any) => {
+          tree.children.forEach((item: any) => {
+            if (state.chioseTagList.indexOf(item.id as never) != -1) {
+              state.searchTagList.push(item as never)
+            }
+          })
+        })
         if (route.params.tag && route.params.parentTagId) {
-          let tag = findTag(route.params.tag)
+          const tag = findTag(route.params.tag)
           if (tag) {
-            state.showDetail= false;
+            state.showDetail = false
             chioseTag(tag)
           }
         }
+
         // state.hotList = res.data
       } catch (e) {
         console.log(e)
@@ -89,10 +119,11 @@ export default defineComponent({
     const chioseTag = (tag: any) => {
       // 选择判断
 
-      let chioseParentIndex = state.chioseParentList.indexOf(
+      const chioseParentIndex = state.chioseParentList.indexOf(
         tag.parentTagId as never
       )
-      let chioseIndex = state.chioseTagList.indexOf(tag.id as never)
+      const chioseIndex = state.chioseTagList.indexOf(tag.id as never)
+
       if (chioseParentIndex !== -1 && chioseIndex !== -1) {
         // 这里就是反复点击这一个
         tag.isCheck = false
@@ -309,7 +340,6 @@ export default defineComponent({
                                 chioseTag(tag)
                               }}
                             >
-                              {' '}
                               {tag.name}
                             </div>
                           )

+ 9 - 0
src/components/musicLIstItem/index.module.less

@@ -91,6 +91,8 @@
         color: #000000;
         line-height: 28px;
         margin-bottom: 6px;
+        display: flex;
+        align-items: center;
       }
       .authorName {
         font-weight: 400;
@@ -224,3 +226,10 @@
     }
   }
 }
+
+.iconFine {
+  display: inline-block;
+  width: 18px;
+  height: 22px;
+  margin-right: 8px;
+}

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

@@ -10,6 +10,7 @@ import { goodsType } from '@/constant'
 import { useRouter } from 'vue-router'
 import start from '@/common/images/start.png'
 import lineStart from '@/common/images/lineStart.png'
+import iconFine from '@/common/images/icon_fine.png'
 
 type Props = {
   id?: Number
@@ -77,7 +78,13 @@ export default defineComponent({
                 <img src={state.item.titleImg || music} alt="" />
               </div>
               <div class={classes.textWrap}>
-                <p class={classes.musicName}>{state.item.musicSheetName}</p>
+                <p class={classes.musicName}>
+                  {state.item.exquisiteFlag === 1 && (
+                    <img src={iconFine} class={classes.iconFine} />
+                  )}
+
+                  {state.item.musicSheetName}
+                </p>
                 <p class={classes.authorName}>作曲:{state.item.composer}</p>
                 <div class={classes.favoriteWrap}>
                   <img src={state.item.favorite ? lineStart : start} alt="" />

+ 8 - 0
src/views/muiscDetial/modals/musicItem.module.less

@@ -24,6 +24,8 @@
     }
     .textWrap {
       p {
+        display: flex;
+        align-items: center;
         width: 226px;
         font-weight: 600;
         color: #333333;
@@ -38,6 +40,12 @@
           color: #6a6a6a;
         }
       }
+      .iconFine {
+        display: inline-block;
+        width: 18px;
+        height: 22px;
+        margin-right: 8px;
+      }
       .authorInfo {
         display: flex;
         flex-direction: row;

+ 4 - 0
src/views/muiscDetial/modals/musicItem.tsx

@@ -5,6 +5,7 @@ import music from '@/components/musicLIstItem/images/music.png'
 import arrow from '@/components/musicLIstItem/images/arrow.png'
 import { useRouter } from 'vue-router'
 import { ElTooltip } from 'element-plus'
+import iconFine from '@/common/images/icon_fine.png'
 type Props = {
   id?: Number
   addName: String
@@ -64,6 +65,9 @@ export default defineComponent({
             </div>
             <div class={classes.textWrap}>
               <p>
+                {state.item.exquisiteFlag === 1 && (
+                  <img src={iconFine} class={classes.iconFine} />
+                )}
                 <ElTooltip placement="top" content={state.item.musicSheetName}>
                   {state.item.musicSheetName}
                 </ElTooltip>

+ 8 - 4
src/views/musicLibrary/modals/searchAlbum.tsx

@@ -37,7 +37,7 @@ export default defineComponent({
         limit: 40, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [5,10, 20, 40, 50] // 选择限制显示条数
+        page_size: [5, 10, 20, 40, 50] // 选择限制显示条数
       }
     })
 
@@ -64,7 +64,12 @@ export default defineComponent({
       }
     }
     const getList = (val: any) => {
-      state.search = { ...val,idAndName:val.search,subjectIds:val.subject }
+      state.search = {
+        ...val,
+        idAndName: val.search,
+        subjectIds: val.subject,
+        exquisiteFlag: val.exquisiteFlag
+      }
       state.pageInfo.page = 1
       getAlbumList()
     }
@@ -89,7 +94,7 @@ export default defineComponent({
                   return <albumItem detail={item}></albumItem>
                 })}
               </div>
-              {this.isshowData&&<ColEmpty></ColEmpty>}
+              {this.isshowData && <ColEmpty></ColEmpty>}
             </div>
           </div>
         </div>
@@ -100,7 +105,6 @@ export default defineComponent({
           pageSizes={this.pageInfo.page_size}
           pagination={this.getAlbumList}
         />
-
       </div>
     )
   }

+ 5 - 5
src/views/musicLibrary/modals/searchMusic.tsx

@@ -31,7 +31,7 @@ export default defineComponent({
     const state = reactive({
       musicList: [],
       search: {},
-      isshowData:false,
+      isshowData: false,
       pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -70,9 +70,9 @@ export default defineComponent({
 
         state.musicList = res.data.rows
         state.pageInfo.total = res.data.total
-        if( state.pageInfo.total == 0){
+        if (state.pageInfo.total == 0) {
           state.isshowData = true
-        }else{
+        } else {
           state.isshowData = false
         }
       } catch (e) {
@@ -83,6 +83,7 @@ export default defineComponent({
       state.search = {
         subjectIds: val.subject,
         musicTagIds: val.albumTagIds,
+        exquisiteFlag: val.exquisiteFlag,
         idAndName: val.search
       }
       state.pageInfo.page = 1
@@ -111,8 +112,7 @@ export default defineComponent({
               </div>
             </div>
           </div>
-          {this.isshowData&&<ColEmpty></ColEmpty> }
-
+          {this.isshowData && <ColEmpty></ColEmpty>}
         </div>
         <pagination
           total={this.pageInfo.total}

+ 10 - 1
src/views/musicLibrary/searchdetail.tsx

@@ -42,6 +42,7 @@ export default defineComponent({
       searchs: {
         albumTagIds: '',
         search: '',
+        exquisiteFlag: null as any,
         subject: subjects.id || ''
       }
     })
@@ -80,7 +81,14 @@ export default defineComponent({
     //   }
     // }
     const searchRust = (val: any) => {
-      state.searchs.albumTagIds = val.join(',') as string
+      console.log(val, 'search')
+      const smallTag = (val || ([] as any)).filter(tag => tag < 0)
+      const maxTag = (val || ([] as any)).filter(tag => tag > 0)
+      state.searchs.albumTagIds = maxTag.join(',') as string
+      state.searchs.exquisiteFlag = null
+      if (smallTag[0] == -2) {
+        state.searchs.exquisiteFlag = 1
+      }
       startSearch(state.searchs)
     }
     const startSearch = (val: any) => {
@@ -89,6 +97,7 @@ export default defineComponent({
     }
 
     const search = () => {
+      console.log(state.searchs, '1212')
       if (state.chiose == 'album') {
         searchAlbumRef.value.getList(state.searchs)
       }

+ 8 - 0
src/views/user-info/music-class/index.module.less

@@ -76,6 +76,7 @@
         font-size: 18px;
         margin-bottom: 7px;
         display: flex;
+        align-items: center;
       }
       .authorInfo {
         display: flex;
@@ -153,3 +154,10 @@
     }
   }
 }
+
+.iconFine {
+  display: inline-block;
+  width: 18px;
+  height: 22px;
+  margin-right: 8px;
+}

+ 4 - 0
src/views/user-info/music-class/item.tsx

@@ -7,6 +7,7 @@ import arrow from './images/arrow.png'
 import { goodsType } from '@/constant'
 import { useRouter } from 'vue-router'
 import { ElButton } from 'element-plus'
+import iconFine from '@/common/images/icon_fine.png'
 
 type Props = {
   id?: number
@@ -70,6 +71,9 @@ export default defineComponent({
             </div>
             <div class={classes.textWrap}>
               <p>
+                {state.item.exquisiteFlag === 1 && (
+                  <img src={iconFine} class={classes.iconFine} />
+                )}
                 {state.item.musicSheetName}
                 <div
                   class={[