Browse Source

Merge branch 'feature-tianyong' into ponline

TIANYONG 4 months ago
parent
commit
8bb69ce4eb
3 changed files with 10 additions and 6 deletions
  1. 2 2
      src/views/creation/api.ts
  2. 4 2
      src/views/creation/index-share.tsx
  3. 4 2
      src/views/creation/index.tsx

+ 2 - 2
src/views/creation/api.ts

@@ -11,7 +11,7 @@ export const api_userMusicDetail = (params: any): Promise<any> => {
 
 /** 开放详情 */
 export const api_openUserMusicDetail = (params: any): Promise<any> => {
-  return request.get(`/api-student/open/userMusic/detail/${params}`)
+  return request.get(apiFix + `/open/userMusic/detail/${params}`)
 }
 
 /**  点赞分页 */
@@ -23,7 +23,7 @@ export const api_userMusicStarPage = (params: any): Promise<any> => {
 
 /**  分享推荐作品 */
 export const api_openUserMusicPage = (params: any): Promise<any> => {
-  return request.post(`/api-student/open/userMusic/page`, {
+  return request.post(apiFix + `/open/userMusic/page`, {
     data: params
   })
 }

+ 4 - 2
src/views/creation/index-share.tsx

@@ -59,11 +59,12 @@ import "plyr/dist/plyr.css";
 import Plyr from "plyr";
 import audioVisualDraw from "./audioVisualDraw"
 import Loading from './loading';
+import { state as originState } from '@/state'
 
 export default defineComponent({
   name: 'creation-detail',
   setup() {
-    const {isApp, isTablet, weixin} = browser()
+    const {isApp, isTablet, weixin, isTeacher} = browser()
     const route = useRoute()
     const router = useRouter()
     const isScreenScroll = ref(false)
@@ -447,7 +448,8 @@ export default defineComponent({
     });
     // 初始化五线谱
     function initStaff(){
-      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
+      const systemType = originState.platformType === 'TEACHER' || isTeacher ? 'teacher' : 'student'
+      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}&systemType=${systemType}`;
       // const src = `http://192.168.3.68:3000/instrument.html#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
       staffState.staffSrc = src
       window.addEventListener('message', (event) => {

+ 4 - 2
src/views/creation/index.tsx

@@ -38,11 +38,12 @@ import svipIcon from './images/svip_icon.png';
 import tyBg from './images/ty.png';
 import TextEllipsis from './text-ellipsis/index';
 import Loading from './loading';
+import { state as originState } from '@/state'
 
 export default defineComponent({
   name: 'creation-detail',
   setup() {
-    const {isApp, isTablet} = browser()
+    const {isApp, isTablet, isTeacher} = browser()
     const route = useRoute()
     const router = useRouter()
     const isScreenScroll = ref(false)
@@ -424,7 +425,8 @@ export default defineComponent({
     }
     // 初始化五线谱
     function initStaff(){
-      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
+      const systemType = originState.platformType === 'TEACHER' || isTeacher ? 'teacher' : 'student'
+      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}&systemType=${systemType}`;
       // const src = `http://192.168.3.68:3000/instrument.html#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
       staffState.staffSrc = src
       window.addEventListener('message', (event) => {