Преглед изворни кода

feat: 作品页面增加systemType参数

TIANYONG пре 7 месеци
родитељ
комит
fbb5a44671
2 измењених фајлова са 6 додато и 4 уклоњено
  1. 3 2
      src/views/creation/index-share.tsx
  2. 3 2
      src/views/creation/index.tsx

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

@@ -63,7 +63,7 @@ import Loading from './loading';
 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 +447,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 = 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) => {

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

@@ -42,7 +42,7 @@ import Loading from './loading';
 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 +424,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 = 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) => {