Explorar o código

添加分谱下载

lex %!s(int64=2) %!d(string=hai) anos
pai
achega
0e9924446e
Modificáronse 3 ficheiros con 69 adicións e 29 borrados
  1. 16 1
      src/views/muiscDetial/index.module.less
  2. 52 27
      src/views/muiscDetial/index.tsx
  3. 1 1
      vite.config.ts

+ 16 - 1
src/views/muiscDetial/index.module.less

@@ -3,6 +3,20 @@
 }
 }
 .wallWrap {
 .wallWrap {
   background-color: #f8f8f8;
   background-color: #f8f8f8;
+  :global {
+    .el-carousel__container {
+      height: 100%;
+    }
+    .el-carousel__button {
+      // background-color: #2dc7aa;
+      background-color: #c2c2c2;
+      height: 4px;
+      border-radius: 4px;
+    }
+    .is-active .el-carousel__button {
+      background-color: #2dc7aa;
+    }
+  }
 }
 }
 .musicWraps {
 .musicWraps {
   // min-height: 100vh;
   // min-height: 100vh;
@@ -83,7 +97,7 @@
       align-items: center;
       align-items: center;
       // justify-content: center;
       // justify-content: center;
       overflow-y: auto;
       overflow-y: auto;
-      padding: 34px 10px 0;
+      padding: 34px 0 0;
       .musicTitle {
       .musicTitle {
         font-size: 20px;
         font-size: 20px;
         font-weight: bold;
         font-weight: bold;
@@ -94,6 +108,7 @@
         position: absolute;
         position: absolute;
         right: 0;
         right: 0;
         top: 0;
         top: 0;
+        z-index: 99;
       }
       }
       img {
       img {
         width: 100%;
         width: 100%;

+ 52 - 27
src/views/muiscDetial/index.tsx

@@ -14,7 +14,9 @@ import {
   ElOption,
   ElOption,
   ElSelect,
   ElSelect,
   ElScrollbar,
   ElScrollbar,
-  ElMessageBox
+  ElMessageBox,
+  ElCarousel,
+  ElCarouselItem
 } from 'element-plus'
 } from 'element-plus'
 import printIcon from './images/printIcon.png'
 import printIcon from './images/printIcon.png'
 import noMore from './images/noMore.png'
 import noMore from './images/noMore.png'
@@ -117,7 +119,8 @@ export default defineComponent({
       accompanyUrl: '',
       accompanyUrl: '',
       imgData: '',
       imgData: '',
       imgUrl: '',
       imgUrl: '',
-      showImg: '',
+      activeIndex: 0,
+      showImg: [] as any,
       iconList: [] as any,
       iconList: [] as any,
       // ossUploadUrl: 'https://ks3-cn-beijing.ksyuncs.com/cloud-coach',
       // ossUploadUrl: 'https://ks3-cn-beijing.ksyuncs.com/cloud-coach',
       ossUploadUrl: `https://cloud-coach.ks3-cn-beijing.ksyuncs.com/`,
       ossUploadUrl: `https://cloud-coach.ks3-cn-beijing.ksyuncs.com/`,
@@ -178,25 +181,23 @@ export default defineComponent({
         state.teacherDetail = res.data.teacher
         state.teacherDetail = res.data.teacher
         if (res.data.musicImg) {
         if (res.data.musicImg) {
           // 有图片
           // 有图片
-          state.showImg = res.data.musicImg
+          state.showImg = res.data.musicImg ? res.data.musicImg.split(',') : []
         } else {
         } else {
-          window.addEventListener(
-            'message',
-            async e => {
-              console.log(e)
-              state.imgData = e.data
-
-              // alert(e.data);
-              const tempCanvas = await imgToCanvas(state.imgData)
-              const showImg = convasToImg(tempCanvas)
-
-              //  开始上传图片
-              uploadFunction(showImg)
-            },
-            false
-          )
+          // window.addEventListener(
+          //   'message',
+          //   async e => {
+          //     console.log(e)
+          //     state.imgData = e.data
+          //     // alert(e.data);
+          //     const tempCanvas = await imgToCanvas(state.imgData)
+          //     const showImg = convasToImg(tempCanvas)
+          //     //  开始上传图片
+          //     uploadFunction(showImg)
+          //   },
+          //   false
+          // )
         }
         }
-        setAccompanyUrl()
+        // setAccompanyUrl()
         setUser()
         setUser()
       } catch (e) {
       } catch (e) {
         console.log(e)
         console.log(e)
@@ -221,7 +222,7 @@ export default defineComponent({
       router.push({
       router.push({
         query: { ...route.query, id: state.id }
         query: { ...route.query, id: state.id }
       })
       })
-      state.showImg = ''
+      state.showImg = []
       getMusicList()
       getMusicList()
     }
     }
     watch(
     watch(
@@ -326,7 +327,7 @@ export default defineComponent({
           data: { musicSheetId: state.musicDetail.id, musicImg: imgurl }
           data: { musicSheetId: state.musicDetail.id, musicImg: imgurl }
         })
         })
         console.log('赋值')
         console.log('赋值')
-        state.showImg = imgurl
+        state.showImg = [imgurl]
       } catch (e) {
       } catch (e) {
         console.log(e)
         console.log(e)
       }
       }
@@ -357,9 +358,11 @@ export default defineComponent({
     }
     }
     const printHander = async () => {
     const printHander = async () => {
       //  img 转 canvas
       //  img 转 canvas
-      const tempCanvas = await imgToCanvas(state.showImg)
+      const tempCanvas = await imgToCanvas(
+        state.showImg[state.activeIndex] as any
+      )
       const showImg = convasToImg(tempCanvas)
       const showImg = convasToImg(tempCanvas)
-      state.showImg = showImg
+      // state.showImg = showImg
       const titleCanvas = addMusicTitle(tempCanvas, {
       const titleCanvas = addMusicTitle(tempCanvas, {
         title: state.musicDetail.musicSheetName,
         title: state.musicDetail.musicSheetName,
         size: 18
         size: 18
@@ -459,19 +462,41 @@ export default defineComponent({
                       src={chargeImg[state.musicDetail.chargeType]}
                       src={chargeImg[state.musicDetail.chargeType]}
                       alt=""
                       alt=""
                     />
                     />
-                    <iframe
+                    {/* <iframe
                       id="containerPrint"
                       id="containerPrint"
                       ref="print"
                       ref="print"
                       style="width: 538px;page-break-after:always; "
                       style="width: 538px;page-break-after:always; "
                       src={state.accompanyUrl}
                       src={state.accompanyUrl}
                       class={classes.iframe}
                       class={classes.iframe}
-                    />
+                    /> */}
                     <p class={classes.musicTitle}>
                     <p class={classes.musicTitle}>
                       {state.musicDetail.musicSheetName}
                       {state.musicDetail.musicSheetName}
                     </p>
                     </p>
-                    {state.showImg ? (
-                      <img src={state.showImg} alt="" />
+                    {state.showImg.length > 0 ? (
+                      <ElCarousel
+                        arrow="always"
+                        style="width: 100%; height: 541px"
+                        autoplay={false}
+                        loop={false}
+                        onChange={(index: number) => {
+                          state.activeIndex = index
+                        }}
+                      >
+                        {state.showImg &&
+                          state.showImg.map((img: any) => (
+                            <ElCarouselItem>
+                              <div style="height: 541px; overflow: hidden auto ;">
+                                <img src={img} alt="" />
+                              </div>
+                            </ElCarouselItem>
+                          ))}
+                      </ElCarousel>
                     ) : (
                     ) : (
+                      //                     <el-carousel :interval="5000" arrow="always">
+                      //   <el-carousel-item v-for="item in 4" :key="item">
+                      //     <h3>{{ item }}</h3>
+                      //   </el-carousel-item>
+                      // </el-carousel>
                       <div>
                       <div>
                         <Vue3Lottie
                         <Vue3Lottie
                           animationData={AstronautJSON}
                           animationData={AstronautJSON}

+ 1 - 1
vite.config.ts

@@ -66,7 +66,7 @@ export default defineConfig({
   },
   },
   server: {
   server: {
     host: '0.0.0.0',
     host: '0.0.0.0',
-    port: 5500,
+    port: 5100,
     strictPort: true,
     strictPort: true,
     proxy: {
     proxy: {
       '/api-auth': {
       '/api-auth': {