瀏覽代碼

样式更新

lex 2 年之前
父節點
當前提交
eed427070b

+ 1 - 0
src/student/teacher-dependent/components/music.tsx

@@ -40,6 +40,7 @@ export default defineComponent({
       <>
         <MusicList
           hideSearch
+          myself
           onItemClick={this.onItemClick}
           teacherId={this.teacherId}
         />

+ 12 - 2
src/views/music/list/index.tsx

@@ -33,9 +33,16 @@ export default defineComponent({
     teacherId: {
       type: String || Number,
       default: ''
+    },
+    myself: {
+      type: Boolean,
+      default: false
     }
   },
-  setup({ hideSearch, defauleParams, onItemClick, teacherId }, { expose }) {
+  setup(
+    { hideSearch, defauleParams, onItemClick, teacherId, myself },
+    { expose }
+  ) {
     const subjects: any = useSubjectId(SubjectEnum.SEARCH)
     // 判断是否已有数据
     if (!subjects.id) {
@@ -108,8 +115,11 @@ export default defineComponent({
         createBy: teacherId
       }
       // if (state.platformType === 'TEACHER') {
-      tempParams.myself = false
+
       // }
+      if (!myself) {
+        tempParams.myself = false
+      }
 
       try {
         const res = await request.post(`${apiSuffix.value}/music/sheet/list`, {

+ 20 - 18
src/views/music/personal/collection.tsx

@@ -6,6 +6,8 @@ import { useRoute } from 'vue-router'
 import ColResult from '@/components/col-result'
 import { musicBuy } from '../music'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 export default defineComponent({
   name: 'MusicList',
@@ -66,24 +68,24 @@ export default defineComponent({
         onLoad={FetchList}
         error={isError.value}
       >
-        {rows.value.length
-          ? rows.value.map(item => (
-              <Item
-                data={item}
-                onClick={() => musicBuy(item)}
-                onFavorite={() => {
-                  reset()
-                  emit('favorite')
-                }}
-              />
-            ))
-          : !loading.value && (
-              <ColResult
-                tips="暂无收藏单曲"
-                classImgSize="SMALL"
-                btnStatus={false}
-              />
-            )}
+        {rows.value.length ? (
+          <div class={styles.personalSong}>
+            <Song
+              list={rows.value}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+        ) : (
+          !loading.value && (
+            <ColResult
+              tips="暂无收藏单曲"
+              classImgSize="SMALL"
+              btnStatus={false}
+            />
+          )
+        )}
       </List>
     )
   }

+ 11 - 0
src/views/music/personal/index.module.less

@@ -20,3 +20,14 @@
     }
   }
 }
+
+.practice,
+.personalSong {
+  padding: 0 12px;
+  border-radius: 18px;
+  background-color: #fff;
+  margin: 0 14px 14px;
+}
+.personalSong {
+  margin: 14px;
+}

+ 16 - 15
src/views/music/personal/personal.tsx

@@ -6,6 +6,8 @@ import { musicBuy } from '../music'
 import { useRoute } from 'vue-router'
 import ColResult from '@/components/col-result'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 export default defineComponent({
   name: 'MusicList',
@@ -64,21 +66,20 @@ export default defineComponent({
         onLoad={FetchList}
         error={isError.value}
       >
-        {rows.value.length
-          ? rows.value.map(item => (
-              <Item
-                data={item}
-                onClick={() => musicBuy(item)}
-                onFavorite={() => emit('favorite')}
-              />
-            ))
-          : !loading.value && (
-              <ColResult
-                tips="暂无单曲"
-                classImgSize="SMALL"
-                btnStatus={false}
-              />
-            )}
+        {rows.value.length ? (
+          <div class={styles.personalSong}>
+            <Song
+              list={rows.value}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+        ) : (
+          !loading.value && (
+            <ColResult tips="暂无单曲" classImgSize="SMALL" btnStatus={false} />
+          )
+        )}
       </List>
     )
   }

+ 13 - 3
src/views/music/personal/practice.tsx

@@ -5,6 +5,8 @@ import { Cell, Skeleton } from 'vant'
 import Item from '../list/item'
 import { musicBuy } from '../music'
 import { state } from '@/state'
+import styles from './index.module.less'
+import Song from '../component/song'
 
 export default defineComponent({
   name: 'Practice',
@@ -39,8 +41,16 @@ export default defineComponent({
       }
       return (
         <>
-          {prevNum.value > 0 && <Cell title="最近练习" />}
-          {Array.from(Array(prevNum.value)).map((_, index) => {
+          {prevNum.value > 0 && <Cell title="最近练习" border={false} />}
+          <div class={styles.practice}>
+            <Song
+              list={list}
+              onDetail={(item: any) => {
+                musicBuy(item)
+              }}
+            />
+          </div>
+          {/* {Array.from(Array(prevNum.value)).map((_, index) => {
             const item = list[index]
             console.log(list, item)
             if (!item) {
@@ -56,7 +66,7 @@ export default defineComponent({
                 }}
               />
             )
-          })}
+          })} */}
         </>
       )
     }