Przeglądaj źródła

Merge branch 'liu-EventTracking' into dev

skyblued 2 lat temu
rodzic
commit
576dee96a2

+ 8 - 0
src/router/routes-common.ts

@@ -204,6 +204,14 @@ export const router = [
     meta: {
       title: '优惠券'
     }
+  },
+  {
+    path: '/contactus',
+    name: 'contactus',
+    component: () => import('@/views/contactus/index'),
+    meta: {
+      title: '联系我们'
+    }
   }
 ]
 

+ 8 - 0
src/router/routes-teacher.ts

@@ -289,6 +289,14 @@ export default [
           title: '曲目挑战排行榜',
           // isExternal: true // 是否外部浏览器可以打开
         }
+      },
+      {
+        path: '/mySheetMusic',
+        component: () =>
+          import('@/teacher/my-sheetMusic/index'),
+        meta: {
+          title: '我的乐谱',
+        }
       }
     ]
   },

+ 8 - 0
src/teacher/my-sheetMusic/index.tsx

@@ -0,0 +1,8 @@
+import { defineComponent } from "vue";
+
+export default defineComponent({
+    name: 'mySheetMusic',
+    setup(){
+        return () => <div>我的曲谱</div>
+    }
+})

+ 0 - 0
src/views/contactus/index.module.less


+ 8 - 0
src/views/contactus/index.tsx

@@ -0,0 +1,8 @@
+import { defineComponent } from 'vue'
+
+export default defineComponent({
+  name: 'contactus',
+  setup(props, ctx) {
+    return () => <div>联系我们</div>
+  }
+})

+ 5 - 11
src/views/music/album-detail/index.tsx

@@ -110,15 +110,11 @@ export default defineComponent({
     })
 
     const toggleFavorite = async (id: number) => {
-      // 如果是老师则不能收藏
-      if (state.platformType === 'TEACHER') {
-        return
-      }
       favoriteLoading.value = true
       try {
-        await request.post('/api-student/music/album/favorite/' + id, {
-          // prefix:
-          //   state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
+        await request.post('/music/album/favorite/' + id, {
+          prefix:
+            state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
         })
         favorited.value = favorited.value === 1 ? 0 : 1
         albumFavoriteCount.value += favorited.value ? 1 : -1
@@ -178,16 +174,14 @@ export default defineComponent({
             </div>
             <div class={styles.alumCollect}>
               <img src={IconPan} />
-              <span>共{albumDetail.value?.musicSheetCount}首曲目</span>
-              {state.platformType === 'STUDENT' && (
-                <div
+              <span>共{albumDetail.value?.musicSheetCount}首曲目{state.platformType}</span>
+              <div
                   class={styles.right}
                   onClick={() => toggleFavorite(albumDetail.value?.id)}
                 >
                   <img src={favorited.value ? iStart : oStart} />
                   <span>{albumFavoriteCount.value}人收藏</span>
                 </div>
-              )}
             </div>
           </div>
           <div class={styles.alumnContainer}>

+ 1 - 3
src/views/music/component/song/index.tsx

@@ -210,8 +210,7 @@ export default defineComponent({
                 }}
               />
             )}
-            {state.platformType === 'TEACHER' && (
-              <Cell
+            <Cell
                 border={false}
                 size="large"
                 title={'分享曲目'}
@@ -228,7 +227,6 @@ export default defineComponent({
                   )
                 }}
               />
-            )}
 
             <Cell
               border={false}