skyblued hace 2 años
padre
commit
6f879f85f2

+ 1 - 1
src/music-sheet/index.tsx

@@ -163,7 +163,7 @@ export default defineComponent({
         renderData.value = musicInfo.musicSvg?.staff
       } else {
         //是否固定调
-        renderData.value = SettingState.sett.keySignature ? musicInfo.musicSvg?.fixed : musicInfo.musicSvg?.first
+        renderData.value = SettingState.sett.keySignature ? musicInfo.musicSvg?.fixedTone : musicInfo.musicSvg?.firstTone
       }
       // console.log("🚀 ~ renderData:", renderData)
       if (renderData.value && renderData.value.json) {

+ 9 - 11
src/subpages/colexiu/popups/productJson/index.tsx

@@ -17,7 +17,7 @@ export const getHasCache = () => {
     isProduction = !musicInfo.musicSvg?.staff
   } else {
     //是否有固定调和首调的缓存
-    isProduction = SettingState.sett.keySignature ? !musicInfo.musicSvg?.fixed : !musicInfo.musicSvg?.first
+    isProduction = SettingState.sett.keySignature ? !musicInfo.musicSvg?.fixedTone : !musicInfo.musicSvg?.firstTone
   }
   return isProduction
 }
@@ -92,10 +92,10 @@ export default defineComponent({
       } else {
         if (SettingState.sett.keySignature) {
           // 固定调
-          musicSvg.fixed = renderData
+          musicSvg.fixedTone = renderData
         } else {
           //首调
-          musicSvg.first = renderData
+          musicSvg.firstTone = renderData
         }
       }
       body.musicSvg = JSON.stringify(musicSvg)
@@ -118,11 +118,8 @@ export default defineComponent({
         requestType: 'json',
         data: body,
       })
-      if (res.code === 200) {
-        detailState.activeDetail.musicJSON = body.musicJSON
-        detailState.activeDetail.musicSvg = body.musicSvg
-        detailState.activeDetail.musicJianSvg = body.musicJianSvg
-        detailState.activeDetail.musicFirstSvg = body.musicFirstSvg
+      if (res.code === 200 && body.musicSvg) {
+        musicInfo.musicSvg = JSON.parse(body.musicSvg)
       }
       return res
     }
@@ -163,6 +160,7 @@ export default defineComponent({
       return ossUrl + key
     }
     return () => (
+      
       <>
         {search.modeType === 'json' && (
           <div class={styles.wrap}>
@@ -174,7 +172,7 @@ export default defineComponent({
                       <span>缓存状态: </span>
                       <span>
                         五线谱&nbsp;
-                        {detailState.activeDetail?.musicSvg ? (
+                        {musicInfo.musicSvg?.staff ? (
                           <Icon name="success" color="rgba(103,201,176,1)" />
                         ) : (
                           <Icon name="cross" color="#ff6868" />
@@ -182,7 +180,7 @@ export default defineComponent({
                       </span>
                       <span>
                         首调&nbsp;
-                        {detailState.activeDetail?.musicJianSvg ? (
+                        {musicInfo.musicSvg?.firstTone ? (
                           <Icon name="success" color="rgba(103,201,176,1)" />
                         ) : (
                           <Icon name="cross" color="#ff6868" />
@@ -190,7 +188,7 @@ export default defineComponent({
                       </span>
                       <span>
                         固定调&nbsp;
-                        {detailState.activeDetail?.musicFirstSvg ? (
+                        {musicInfo.musicSvg?.fixedTone ? (
                           <Icon name="checked" color="rgba(103,201,176,1)" />
                         ) : (
                           <Icon name="cross" color="#ff6868" />

+ 2 - 2
src/subpages/colexiu/state.ts

@@ -1,6 +1,6 @@
 import { reactive } from 'vue'
 
-export const musicInfo = {
+export const musicInfo = reactive({
   id: '',
   /** 原音 */
   audioFileUrl: '',
@@ -14,7 +14,7 @@ export const musicInfo = {
   speed: null,
   /**曲谱code */
   track: ''
-}
+})
 
 export type DetailState = {
   // 当前页面加载状态