소스 검색

Merge branch 'feature-tianyong'

TIANYONG 4 달 전
부모
커밋
514af62342

+ 3 - 3
src/components/col-search/index.module.less

@@ -40,7 +40,7 @@
     }
 
     .van-field__control {
-      font-size: 14px;
+      font-size: 15px;
     }
   }
 
@@ -111,11 +111,11 @@
     width: 56px;
     height: 28px;
     padding: 0;
-    font-size: 14px;
+    font-size: 15px;
     font-weight: 500;
     --van-button-mini-height: 28px;
     --van-font-size-xs: 14px;
-    line-height: 1;
+    line-height: 28px;
 
     &.searchTenantBtn {
       background: linear-gradient( 270deg, #FF436A 0%, #FF6D8B 100%);

+ 12 - 5
src/components/col-upload/index.tsx

@@ -54,6 +54,10 @@ export default defineComponent({
     disabled: {
       type: Boolean,
       default: false
+    },
+    hasDeviceAuth: {
+      type: Boolean,
+      default: true
     }
   },
   methods: {
@@ -192,11 +196,14 @@ export default defineComponent({
                 {this.tips && <p class={styles.uploaderText}>{this.tips}</p>}
               </div>
             )}
-            <ColCropper
-              disabled={this.disabled}
-              option={this.options}
-              getFile={this.getFile}
-            />
+            {
+              this.hasDeviceAuth && 
+              <ColCropper
+                disabled={this.disabled }
+                option={this.options}
+                getFile={this.getFile}
+              />              
+            }
           </div>
         ) : this.native ? (
           <div

+ 54 - 15
src/views/creation/edit/index.tsx

@@ -22,7 +22,9 @@ export default defineComponent({
       playType: '',
       desc: '',
       videoImg: '', // 视频封面
-      img: ''
+      img: '',
+      needCheckDevice: true,
+      hasDeviceAuth: false, // 有设备相机权限
     })
 
     const onSubmit = async () => {
@@ -49,7 +51,39 @@ export default defineComponent({
         //
       }
     }
-
+    // 初始化获取是否已经授权
+    const initDeviceAuth = () => {
+      postMessage(
+        {
+          api: 'checkDeviceCamera',
+          content: {
+            hideAlert: true
+          }
+        },
+        res => {
+          if (res?.content.status) {
+            state.hasDeviceAuth = true
+          }
+        }
+      )
+    }
+    // 校验是否已经授权
+    const checkDeviceAuth = () => {
+      console.log('校验app',state.needCheckDevice)
+      if (state.needCheckDevice) {
+        postMessage({ api: 'checkDeviceCamera' }, res => {
+          const { content } = res as any
+          if (content?.status) {
+            state.hasDeviceAuth = true
+          } else {
+            // 没有权限不能获取图片
+            state.hasDeviceAuth = false
+          }
+        })
+      } else {
+        state.hasDeviceAuth = true
+      }
+    }
     // 截图
     const onCropper = () => {
       postMessage(
@@ -74,6 +108,7 @@ export default defineComponent({
       });
     }
     onMounted(async () => {
+      initDeviceAuth();
       setStatusBarTextColor(false);
       try {
         const { data } = await api_userMusicDetail(state.id)
@@ -107,6 +142,7 @@ export default defineComponent({
               cropper
               tips={''}
               deletable={false}
+              needCheckDevice={true}
               v-model:modelValue={state.img}
             />
             {/* <div class={styles.tip}>选封面</div> */}
@@ -120,19 +156,22 @@ export default defineComponent({
           <div class={[styles.section, styles.sectionVideo]}>
             <img src={state.videoImg || videoBg} class={styles.videoBg} />
             <div class={styles.btnGroup}>
-              <MUploader
-                class={styles.btnImg}
-                cropper
-                tips=""
-                deletable={false}
-                onUploadChange={img => {
-                  console.log(img, 'img')
-                  state.videoImg = img
-                }}
-                options={{
-                  fixedNumber: [16, 9]
-                }}
-              />
+              <div onClick={checkDeviceAuth}>
+                <MUploader
+                  class={styles.btnImg}
+                  cropper
+                  tips=""
+                  deletable={false}
+                  hasDeviceAuth={state.hasDeviceAuth}
+                  onUploadChange={img => {
+                    console.log(img, 'img')
+                    state.videoImg = img
+                  }}
+                  options={{
+                    fixedNumber: [16, 9]
+                  }}
+                />
+              </div>
               <div class={styles.btnCropper} onClick={onCropper}>
                 视频截取封面
               </div>

+ 1 - 1
src/views/creation/index-share.tsx

@@ -447,7 +447,7 @@ export default defineComponent({
     });
     // 初始化五线谱
     function initStaff(){
-      const src = `https://test.colexiu.com/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
+      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
       // 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) => {

+ 48 - 6
src/views/creation/index.module.less

@@ -45,7 +45,6 @@
     height: 40px;
     bottom: -40px;
     left: 0;
-    background: linear-gradient( 180deg, #444B68 0%, rgba(57,77,95,0) 100%);
     pointer-events: none;
   }
   :global {
@@ -61,7 +60,7 @@
               pointer-events: initial !important;
               .plyr__controls__item.plyr__progress__container{
                   input[type=range]{
-                      color: #01c1b5;
+                      color: #ffffff;
                       height: 10px;
                   }
                   input[type="range"]::-webkit-slider-runnable-track {
@@ -75,8 +74,8 @@
                   }
                   .plyr__progress__buffer{
                       height: 2px;
-                      color: rgba(1, 193, 181, 0.8);
-                      background-color: #fff;
+                      color: rgba(255, 255, 255, 0.7);
+                      background-color: rgba(0, 0, 0, 0.1);
                       margin-top: -1px;
                   }
               }
@@ -315,6 +314,23 @@
       }
     }
   }
+  &.isLandscapeScreen2 {
+    :global {
+      .plyr {
+        .plyr__controls{
+          .plyr__controls__item.plyr__progress__container {
+            input[type="range"] {
+               color: #01c1b5 !important;
+            }
+            .plyr__progress__buffer {
+               color: rgba(1, 193, 181, 0.8);
+               background-color: #fff;
+            }
+         }
+        }
+      }
+    }
+  }
 }
 
 .musicSection {
@@ -882,6 +898,7 @@
 // 横屏样式
 .creation.creationTablet{
   .playSection.isLandscapeScreen{
+    position: relative;
     .audioBox {
       .audioBga{
         width: 72%;
@@ -901,6 +918,16 @@
   height: 100%;
   min-height: 100vh;
   z-index: 1000;
+  &::before {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 115px;
+    content: "";
+    background: linear-gradient(0, rgba(255, 255, 255, 0) 0%, rgba(3, 3, 3, 0.2) 45%, rgba(0, 0, 0, 0.7) 100%);
+    z-index: 2;
+  }
   .landscapeScreen{
     display: none;
   }
@@ -946,7 +973,7 @@
         .plyr__controls__item.plyr__progress__container{
           margin-left: 9px;
           input[type=range]{
-              color: #01c1b5;
+              color: #ffffff;
               height: 20px;
           }
           input[type="range"]::-webkit-slider-runnable-track {
@@ -957,10 +984,11 @@
               height: 12px;
               margin-top: -4px;
               box-shadow: initial;
+              background: #ffffff;
           }
           .plyr__progress__buffer{
               height: 4px;
-              color: rgba(1, 193, 181, 0.8);
+              color: rgba(255, 255, 255, 0.7);
               background-color: #fff;
               margin-top: -2px;
           }
@@ -1052,6 +1080,20 @@
               background-size: 100% 100%;
             }
           }
+          .plyr__controls__item.plyr__progress__container{
+            input[type="range"]::-webkit-slider-thumb {
+               background-color: #2DC7AA;
+            }
+          }
+         .plyr__controls__item.plyr__time {
+            font-weight: 500;
+            font-size: 14px;
+            color: #131415;
+            display: initial;
+            &.plyr__time--current {
+              margin-left: 9px;
+            }
+          }
         }
       }
     }  

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

@@ -424,7 +424,7 @@ export default defineComponent({
     }
     // 初始化五线谱
     function initStaff(){
-      const src = `https://test.colexiu.com/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
+      const src = `/klx-music-score/#/simple-detail?id=${state.musicDetail.musicSheetId}&musicRenderType=${staffState.musicRenderType}&part-index=${staffState.partIndex}&userMusicId=${state.id}`;
       // 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) => {
@@ -737,7 +737,7 @@ export default defineComponent({
               ))}
             </List>
           ) : (
-            <MEmpty class={styles.mEmpty} tips="暂无内容~" btnStatus={false} />
+            <MEmpty class={styles.mEmpty} tips="暂无内容" btnStatus={false} />
           )}
         </div>
         {

+ 2 - 2
src/views/creation/share-model/index.module.less

@@ -51,7 +51,7 @@
     width: 56px;
     height: 56px;
     object-fit: cover;
-    border-radius: 6px;
+    border-radius: 10px;
   }
 
   .uploadImg {
@@ -70,7 +70,7 @@
     }
     .imgLabel{
       position: absolute;
-      right: -1px;
+      right: 0;
       top: 0;
       width: 28px;
       height: 14px;

+ 1 - 1
src/views/creation/share-model/index.tsx

@@ -231,7 +231,7 @@ export default defineComponent({
             <div class={styles.qrtips}>
               <div>温馨提示:</div>
               <p class={styles.tip}>
-                保存图片到相册或长按识别二维码进入查看喔
+                保存图片到相册后,请在微信里扫码查看
               </p>
               <img src={iconLogo} class={styles.iconLogo} />
               {/* <p class={styles.downTip}>扫码下载音乐数字课堂App</p> */}

+ 2 - 1
src/views/music/music-detail/index.tsx

@@ -188,7 +188,8 @@ export default defineComponent({
       loading.value = true
       isError.value = false
       try {
-        const res = await request.get(`/music/sheet/detail/${route.query.id}`, {
+        const apiUrl = route.query.tenantAlbumId ? `/music/sheet/detail/${route.query.id}?tenantAlbumId=${route.query.tenantAlbumId}` : `/music/sheet/detail/${route.query.id}`
+        const res = await request.get(apiUrl, {
           prefix:
             state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
         })

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://online.colexiu.com/'
-const proxyUrl = 'https://dev.colexiu.com/'
+const proxyUrl = 'https://test.colexiu.com/'
 // const proxyUrl = 'http://192.168.3.14:8000/'
 export default defineConfig({
   base: './',