Browse Source

Merge branch 'iteration-20241205'

lex-xin 2 months ago
parent
commit
7b1ab4cda9

+ 1 - 1
src/student/discount-card/index.tsx

@@ -53,10 +53,10 @@ export default defineComponent({
         await request.post(`${baseState.platformApi}/userOrder/orderCancel`, {
           data: { orderNo: state.orderDetail.orderNo }
         })
-        state.orderVisible = false
       } catch {
         //
       }
+      state.orderVisible = false
     }
 
     // 继续支付

+ 12 - 70
src/tenant/music/music-detail/new-index.tsx

@@ -110,19 +110,18 @@ export default defineComponent({
     const onChangeStaff = (type: string) => {
       staff.radio = type
       staff.status = false
-
-      if (type == 'first') {
+      if (type == 'FIRST') {
         loading.value = false
         const tempPdf = staffData.details?.firstPdfUrl
-        initIframe(tempPdf, 'first', staffData.musicXml)
-      } else if (type == 'fixed') {
+        initIframe(tempPdf, 'FIRST')
+      } else if (type == 'JIAN') {
         loading.value = false
         const tempPdf = staffData.details?.jianPdfUrl
-        initIframe(tempPdf, 'fixed', staffData.musicXml)
+        initIframe(tempPdf, 'JIAN')
       } else {
         loading.value = false
         const tempPdf = staffData.details?.musicPdfUrl
-        initIframe(tempPdf, 'staff', staffData.musicXml)
+        initIframe(tempPdf, 'STAVE')
       }
     }
 
@@ -200,64 +199,6 @@ export default defineComponent({
     const showLoading = async (e: any) => {
       // console.log(e, 'showLoading')
       if (e.data?.api === 'musicStaffRender') {
-        // const osmdImg = e.data.osmdImg
-        // // staffData.imgs = []
-        // const imgs: any = []
-
-        // 独奏并且的图片则不用生成
-        // if (
-        //   staffData.details?.musicSheetType === 'SINGLE' &&
-        //   staffData.details?.notation
-        // ) {
-        //   if (
-        //     (staff.radio === 'first' && firstList.value.length > 0) ||
-        //     (staff.radio === 'fixed' && fixedList.value.length > 0) ||
-        //     (staff.radio === 'staff' && staffList.value.length > 0)
-        //   ) {
-        //     if (staff.radio === 'first') {
-        //       staffData.imgs = firstList.value
-        //     } else if (staff.radio === 'fixed') {
-        //       staffData.imgs = fixedList.value
-        //     }
-        //     if (staff.radio === 'staff') {
-        //       staffData.imgs = staffList.value
-        //     }
-
-        //     loading.value = e.data.loading
-        //     return
-        //   }
-        // }
-
-        // uploadImgs.value = true
-
-        // if (osmdImg) {
-        //   for (let i = 0; i < osmdImg.length; i++) {
-        //     const img = await svgtopng(
-        //       osmdImg[i].img,
-        //       osmdImg[i].width,
-        //       osmdImg[i].height
-        //     )
-        //     imgs.push(img)
-        //   }
-        // }
-
-        // uploadImgs.value = false
-        // // 判断是否为独奏
-        // if (
-        //   staffData.details?.musicSheetType === 'SINGLE' &&
-        //   staffData.details?.notation
-        // ) {
-        //   if (staff.radio === 'first') {
-        //     firstList.value = imgs
-        //   } else if (staff.radio === 'fixed') {
-        //     fixedList.value = imgs
-        //   } else if (staff.radio === 'staff') {
-        //     staffList.value = imgs
-        //   }
-        //   staffData.imgs = imgs
-        // } else {
-        //   staffData.imgs = imgs
-        // }
         const osmdImg = e.data.osmdImg
         const imgs: any = []
         for (let i = 0; i < osmdImg.length; i++) {
@@ -429,7 +370,7 @@ export default defineComponent({
       closed: true,
       audioReady: false,
       iframeSrc: '',
-      musicXml: '',
+      // musicXml: '',
       instrumentName: '',
       iframeRef: null as any,
       imgs: [] as any,
@@ -569,7 +510,7 @@ export default defineComponent({
       })
 
       staffData.details = row || {}
-      staffData.musicXml = staffData.details?.xmlFileUrl
+      // staffData.musicXml = staffData.details?.xmlFileUrl
       staffData.isComberRender = staffData.details?.isScoreRender
 
       let defaultShowStaff
@@ -666,7 +607,7 @@ export default defineComponent({
       const musicScoreUrl = getHttpOrigin() + musicScorePath
       // const musicScoreUrl = "https://dev.colexiu.com" + musicScorePath;
       // const musicScoreUrl = 'http://192.168.3.68:3000/instrument.html';
-      let href = `${musicScoreUrl}?t=${Date.now()}#/?id=${musicId}&Authorization=${Authorization}&part-index=${partIndex}&isPreView=true&zoom=0.5&downPng=A4`
+      let href = `${musicScoreUrl}?t=${Date.now()}#/?id=${musicId}&Authorization=${Authorization}&isPreView=true&zoom=0.5&downPng=A4`
       // // 老师端加上systemType=teacher
       href +=
         '&systemType=' +
@@ -702,9 +643,10 @@ export default defineComponent({
       try {
         nextTick(() => {
           if (staffData.musicPdfUrl) {
-            const url = `${location.origin}${
-              location.pathname
-            }pdf/web/viewer-pdf.html?file=${encodeURIComponent(
+            // ${
+            //   location.pathname
+            // }
+            const url = `${location.origin}/pdf/web/viewer-pdf.html?file=${encodeURIComponent(
               staffData.musicPdfUrl
             )}&t=${Date.now()}`
 

+ 1 - 1
src/views/member-center/index.tsx

@@ -349,10 +349,10 @@ export default defineComponent({
         await request.post(`${state.apiSuffix}/userOrder/orderCancel`, {
           data: { orderNo: state.orderDetail.orderNo }
         })
-        state.orderVisiable = false
       } catch {
         //
       }
+      state.orderVisiable = false
     }
     // 继续支付
     const onContinueOrder = async () => {

+ 11 - 4
src/views/music/music-detail/index.tsx

@@ -150,6 +150,7 @@ export default defineComponent({
     const onChangeStaff = (type: string) => {
       staff.radio = type
       staff.status = false
+      staffData.imgs = []
       if (type == 'FIRST') {
         loading.value = false
         const tempPdf = staffData.details?.firstPdfUrl
@@ -657,8 +658,8 @@ export default defineComponent({
           name: "总谱",
         });
         // 如果是总谱则默认选中,否则选择
-        // staffData.selectedPartIndex = row.defaultScoreRender ? 0 : defaultShowStaff  ? defaultShowStaff.value : 1
-        staffData.selectedPartIndex = defaultShowStaff  ? defaultShowStaff.value : 1
+        staffData.selectedPartIndex = row.defaultScoreRender ? 0 : defaultShowStaff  ? defaultShowStaff.value : 1
+        // staffData.selectedPartIndex = defaultShowStaff  ? defaultShowStaff.value : 1
         let pdfUrl = ''
         if(row.defaultScoreRender) {
           pdfUrl = getCurrentPdf(row, row.scoreType)
@@ -886,7 +887,7 @@ export default defineComponent({
                       <span
                         style={{
                           visibility:
-                            state.platformType === 'TEACHER'
+                            state.platformType === 'TEACHER' && !route.query.tenantAlbumId
                               ? 'visible'
                               : 'hidden'
                         }}
@@ -956,6 +957,7 @@ export default defineComponent({
                   onClick={() => {
                     if ( staffData.details?.musicSheetType === 'CONCERT') {
                       staffData.open = true
+                      staffData.closed = false;
                     }
                   }}
                 >
@@ -1369,8 +1371,12 @@ export default defineComponent({
             position="bottom"
             round
             v-model:show={staffData.open}
+            onClosed={() => {
+              staffData.closed = true;
+            }}
           >
-            <Picker
+            {!staffData.closed && (
+              <Picker
               columns={partColumns.value}
               defaultIndex={staffData.selectedPartIndex}
               onConfirm={value => {
@@ -1405,6 +1411,7 @@ export default defineComponent({
               }}
               onCancel={() => (staffData.open = false)}
             />
+            )}
           </Popup>
         </div>
       )