Просмотр исходного кода

老师增加收藏曲谱和收藏专辑

skyblued 2 лет назад
Родитель
Сommit
3e853f3839

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

@@ -174,14 +174,14 @@ export default [
         path: '/userInfo/musicClass',
         name: 'userInfoMusicClass',
         component: () => import('@/views/user-info/music-class'),
-        meta: { title: '我的曲谱', index: 5, isdark: true }
+        meta: { title: '上传曲谱', index: 5, isdark: true }
       },
       {
         path: '/userInfo/musicOperation',
         name: 'userInfoMusicOperation',
         component: () => import('@/views/user-info/music-operation'),
         meta: {
-          title: '我的曲谱',
+          title: '上传曲谱',
           index: 4,
           hidden: true,
           activeMenu: 'userInfoMusicClass',
@@ -189,6 +189,18 @@ export default [
         }
       },
       {
+        path: '/userInfo/myCollect',
+        name: 'userInfoMyCollect',
+        component: () => import('@/views/student-info/my-score'),
+        meta: {
+          title: '我的曲谱',
+          index: 5,
+          hidden: false,
+          activeMenu: 'userInfoMyCollect',
+          isdark: true
+        }
+      },
+      {
         path: '/userInfo/myFans',
         name: 'userInfoMyFans',
         component: () => import('@/views/user-info/my-fans'),

+ 6 - 1
src/views/student-info/my-score/album-list.tsx

@@ -5,11 +5,13 @@ import styles from './index.module.less'
 import { ElSkeleton, ElSkeletonItem } from 'element-plus'
 import { defineComponent } from 'vue'
 import Item from '../components/item'
+import { getUserType } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'list',
   data() {
     return {
+      clientType: '',
       pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -23,6 +25,8 @@ export default defineComponent({
     }
   },
   mounted() {
+    const clientType = getUserType()
+    if (clientType === 'TEACHER') this.clientType = clientType
     this.getList()
   },
   methods: {
@@ -34,7 +38,8 @@ export default defineComponent({
           {
             params: {
               page: this.pageInfo.page,
-              rows: this.pageInfo.limit
+              rows: this.pageInfo.limit,
+              clientType: this.clientType
             }
           }
         )

+ 7 - 2
src/views/student-info/my-score/list.tsx

@@ -5,6 +5,7 @@ import styles from './index.module.less'
 import { ElSkeleton, ElSkeletonItem } from 'element-plus'
 import { defineComponent } from 'vue'
 import MusicItem from '../../user-info/music-class/item'
+import { getUserType } from '@/helpers/utils'
 
 export default defineComponent({
   name: 'list',
@@ -20,6 +21,7 @@ export default defineComponent({
   },
   data() {
     return {
+      clientType: '',
       pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -33,6 +35,8 @@ export default defineComponent({
     }
   },
   mounted() {
+    const clientType = getUserType()
+    if (clientType === 'TEACHER') this.clientType = clientType
     this.getList()
   },
   methods: {
@@ -46,7 +50,8 @@ export default defineComponent({
         const { data } = await request.get(url, {
           params: {
             page: this.pageInfo.page,
-            rows: this.pageInfo.limit
+            rows: this.pageInfo.limit,
+            clientType: this.clientType
           }
         })
         this.list = data.rows || []
@@ -101,8 +106,8 @@ export default defineComponent({
             {this.list.map((item: any) => (
               <MusicItem
                 onClick={(item: any) => {
+                  console.log(item)
                   if (this.auditStatus === 'UNPASS') {
-                    console.log(item)
                     this.$router.push({
                       path: '/userInfo/musicOperation',
                       query: {

+ 3 - 1
src/views/user-info/music-operation/index.tsx

@@ -62,6 +62,7 @@ export default defineComponent({
         canEvaluate: 1,
         showFingering: 1,
         chargeType: 0,
+        paymentType: '',
         musicPrice: '',
         backgroundMp3s: [
           {
@@ -104,7 +105,7 @@ export default defineComponent({
         const res = await request.get(
           '/api-website/open/music/sheet/detail/' + id
         )
-        this.form.chargeType = res.data.chargeType === 'FREE' ? 0 : 2
+        this.form.chargeType = res.data.paymentType === 'FREE' ? 0 : 2
         this.form.showFingering = res.data.showFingering
         this.form.notation = res.data.notation
         this.form.canEvaluate = res.data.canEvaluate
@@ -183,6 +184,7 @@ export default defineComponent({
         xmlFileUrl: form.xmlFileUrl,
         canEvaluate: Number(form.canEvaluate),
         chargeType: form.chargeType === 0 ? 'FREE' : 'CHARGE',
+        paymentType: form.paymentType ? form.paymentType : form.chargeType === 0 ? 'FREE' : 'CHARGE',
         composer: form.composer,
         musicPrice: form.chargeType === 0 ? 0 : form.musicPrice,
         background: form.backgroundMp3s.map(item => ({