浏览代码

更新判断

lex 2 年之前
父节点
当前提交
72ad552044

+ 1 - 0
src/views/music/album/index.tsx

@@ -225,6 +225,7 @@ export default defineComponent({
           >
             <SelectSubject
               isReset
+              type="ALBUM"
               searchParams={subject}
               onComfirm={onComfirmSubject}
             />

+ 5 - 2
src/views/music/component/song/index.tsx

@@ -8,6 +8,8 @@ import { state } from '@/state'
 import request from '@/helpers/request'
 import ColShare from '@/components/col-share'
 import MusicIcon from '../../list/icons/music-icon.png'
+import collection_active from '../images/collection_active.png'
+import collection from '../images/collection.png'
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `../images/${fileName}`
   const modules = import.meta.globEager('../images/*')
@@ -178,6 +180,7 @@ export default defineComponent({
                 )
               }}
             />
+
             {state.platformType === 'STUDENT' && (
               <Cell
                 border={false}
@@ -191,8 +194,8 @@ export default defineComponent({
                       <Image
                         src={
                           moreData.value.favorite
-                            ? getAssetsHomeFile('collection_active.png')
-                            : getAssetsHomeFile('collection.png')
+                            ? collection_active
+                            : collection
                         }
                       />
                     </div>

+ 1 - 0
src/views/music/list/index.tsx

@@ -276,6 +276,7 @@ export default defineComponent({
         >
           <SelectSubject
             isReset
+            type="MUSIC"
             searchParams={subject}
             onComfirm={onComfirmSubject}
           />

+ 5 - 1
src/views/music/search/select-subject.tsx

@@ -20,6 +20,10 @@ export default defineComponent({
         id: ''
       }
     },
+    type: {
+      type: String,
+      default: ''
+    },
     onComfirm: {
       type: Function,
       default: (item: any) => {}
@@ -46,7 +50,7 @@ export default defineComponent({
   methods: {
     async getList() {
       const { data } = await request.get(
-        `${this.apiSuffix}/subject/subjectSelect?type=MUSIC`
+        `${this.apiSuffix}/subject/subjectSelect?type=${this.type}`
       )
       if (Array.isArray(data)) {
         this.subjectList = data