Bladeren bron

添加其它模式

lex 1 jaar geleden
bovenliggende
commit
60145a4776

+ 1 - 29
dev-dist/sw.js

@@ -67,13 +67,7 @@ if (!self.define) {
     });
   };
 }
-<<<<<<< HEAD
-
-define(['./workbox-5357ef54'], function (workbox) {
-  'use strict';
-=======
 define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
->>>>>>> startLogin
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -83,35 +77,13 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
    * requests for URLs in the manifest.
    * See https://goo.gl/S9QRab
    */
-<<<<<<< HEAD
-<<<<<<< HEAD
-  workbox.precacheAndRoute(
-    [
-      {
-        url: 'registerSW.js',
-        revision: '3ca0b8505b4bec776b69afdba2768812'
-      },
-      {
-        url: 'index.html',
-        revision: '0.88abiq01ca8'
-      }
-    ],
-    {}
-  );
-=======
-=======
->>>>>>> startLogin
   workbox.precacheAndRoute([{
     "url": "registerSW.js",
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.menbt6dkbn8"
+    "revision": "0.qevlpmb742"
   }], {});
-<<<<<<< HEAD
->>>>>>> startLogin
-=======
->>>>>>> startLogin
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
     allowlist: [/^\/$/]

BIN
src/views/attend-class/image/icon-close.png


+ 19 - 0
src/views/attend-class/index.module.less

@@ -8,6 +8,21 @@
   --plyr-range-track-height: 3px;
 }
 
+.assignHomeworkClose {
+  position: absolute;
+  top: 40px;
+  left: 40px;
+  width: 60px;
+  height: 65px;
+  cursor: pointer;
+  transition: all 0.5s;
+
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+
 .assignHomework {
   position: absolute;
   top: 40px;
@@ -17,6 +32,10 @@
   cursor: pointer;
   transition: all 0.5s;
 
+  &.isClose {
+    left: 124px;
+  }
+
   img {
     width: 100%;
     height: 100%;

+ 48 - 20
src/views/attend-class/index.tsx

@@ -16,6 +16,7 @@ import iconDown from './image/icon-down.png';
 import iconNote from './image/icon-note.png';
 import iconWhiteboard from './image/icon-whiteboard.png';
 import iconAssignHomework from './image/icon-assignHomework.png';
+import iconClose from './image/icon-close.png';
 import iconOverPreivew from './image/icon-over-preview.png';
 import { Vue3Lottie } from 'vue3-lottie';
 import playLoadData from './datas/data.json';
@@ -105,7 +106,7 @@ export default defineComponent({
     });
 
     const data = reactive({
-      type: '' as '' | 'preview' | 'class', // 预览类型
+      type: 'class' as '' | 'preview' | 'class', // 预览类型
       subjectId: '' as any, // 声部编号
       detailId: '' as any, // 编号 - 章节编号
       classGroupId: '' as any, // 上课时需要 班级编号
@@ -120,7 +121,10 @@ export default defineComponent({
       modelAttendStatus: false, // 布置作业提示弹窗
       modalAttendMessage: '本节课未设置课后训练,是否继续?',
       modelTrainStatus: false, // 训练设置
-      homeworkStatus: true // 布置作业完成时
+      homeworkStatus: true, // 布置作业完成时
+      removeVisiable: false,
+      removeTitle: '',
+      removeContent: ''
     });
     const activeData = reactive({
       // isAutoPlay: false, // 是否自动播放
@@ -858,20 +862,37 @@ export default defineComponent({
           <div class={styles.menu}>{activeName.value}</div>
         </div>
         {/* 布置作业按钮 */}
+
+        {data.type !== 'preview' ? (
+          <div
+            class={[
+              styles.assignHomeworkClose,
+              activeData.model ? '' : styles.sectionAnimateUp
+            ]}
+            onClick={async () => {
+              data.removeVisiable = true;
+              data.removeTitle = '结束课程';
+              data.removeContent = '请确认是否结束课程?';
+            }}>
+            <img src={iconClose} />
+          </div>
+        ) : (
+          ''
+        )}
         <div
           id="attent-3"
           class={[
             styles.assignHomework,
+            data.type !== 'preview' ? styles.isClose : '',
             activeData.model ? '' : styles.sectionAnimateUp
           ]}
           onClick={async () => {
             if (data.type === 'preview') {
               handleStop();
-              if (state.application) {
-                emit('close');
-              } else {
-                window.close();
-              }
+
+              data.removeVisiable = true;
+              data.removeTitle = '结束预览';
+              data.removeContent = '请确认是否结束预览?';
 
               // onFullScreen();
             } else {
@@ -992,11 +1013,12 @@ export default defineComponent({
               onClick={() => {
                 data.modelAttendStatus = false;
                 handleStop();
-                if (state.application) {
-                  emit('close');
-                } else {
-                  window.close();
-                }
+                // if (state.application) {
+                //   emit('close');
+                // } else {
+                //   window.close();
+                // }
+                data.modelAttendStatus = false;
               }}>
               暂不布置
             </NButton>
@@ -1025,14 +1047,15 @@ export default defineComponent({
             onClose={() => (data.modelTrainStatus = false)}
             onConfirm={() => {
               // 布置完作业之后直接关闭
-              setTimeout(() => {
-                handleStop();
-                if (state.application) {
-                  emit('close');
-                } else {
-                  window.close();
-                }
-              }, 1000);
+              // setTimeout(() => {
+              //   handleStop();
+              //   if (state.application) {
+              //     emit('close');
+              //   } else {
+              //     window.close();
+              //   }
+              // }, 1000);
+              data.modelTrainStatus = false;
             }}
           />
         </NModal>
@@ -1148,6 +1171,11 @@ export default defineComponent({
                 type="primary"
                 onClick={() => {
                   //
+                  if (state.application) {
+                    emit('close');
+                  } else {
+                    window.close();
+                  }
                 }}>
                 确定
               </NButton>

+ 31 - 1
src/views/notation/index.module.less

@@ -20,4 +20,34 @@
     height: 100vh;
     background-color: #fff;
   }
-}
+}
+
+.removeVisiable {
+  width: 500px;
+
+  .studentRemove {
+    padding: 20px 40px 0;
+
+    p {
+      font-size: max(18px, 16px);
+      color: #777777;
+      line-height: 30px;
+      text-align: center;
+
+      span {
+        color: #EA4132;
+      }
+    }
+  }
+
+  .btnGroupModal {
+    padding: 32px 0;
+
+    :global {
+      .n-button {
+        height: 47px;
+        min-width: 156px;
+      }
+    }
+  }
+}

+ 32 - 6
src/views/notation/index.tsx

@@ -2,7 +2,7 @@ import { defineComponent, onMounted, reactive, ref } from 'vue';
 import { useUserStore } from '/src/store/modules/users';
 import styles from './index.module.less';
 import { state } from '/src/state';
-import { NModal, NSpin } from 'naive-ui';
+import { NButton, NModal, NSpace, NSpin } from 'naive-ui';
 
 export default defineComponent({
   name: 'notation-a',
@@ -10,15 +10,16 @@ export default defineComponent({
     const show = ref(false);
     const previewModal = ref(false);
     const previewParams = ref({} as any);
+    const removeVisiable = ref(false);
     const userStore = useUserStore();
     const Authorization = userStore.getToken || '';
     console.log(Authorization);
     const data = reactive({
       src: `${
         /(192|localhost)/.test(location.origin)
-          ? 'https://test.lexiaoya.cn'
-          : // 'http://localhost:3050'
-            location.origin
+          ? // ? 'https://test.lexiaoya.cn'
+            'http://localhost:3050'
+          : location.origin
       }/notation/#/create?Authorization=${Authorization}`
       //   src: `http://localhost:3050/#/create?Authorization=${Authorization}`
     });
@@ -35,8 +36,7 @@ export default defineComponent({
           window.open(e.data.url);
         }
       } else if (e.data.api === 'notation_exit') {
-        previewModal.value = false;
-        previewParams.value.url = '';
+        removeVisiable.value = true;
       }
     };
     onMounted(() => {
@@ -61,6 +61,32 @@ export default defineComponent({
               src={previewParams.value.url}></iframe>
           </NSpin>
         </NModal>
+
+        <NModal
+          v-model:show={removeVisiable.value}
+          preset="card"
+          class={['modalTitle', styles.removeVisiable]}
+          title={'退出制谱'}>
+          <div class={styles.studentRemove}>
+            <p>是否退出制谱功能?</p>
+
+            <NSpace class={styles.btnGroupModal} justify="center">
+              <NButton
+                round
+                type="primary"
+                onClick={() => {
+                  previewModal.value = false;
+                  previewParams.value.url = '';
+                  removeVisiable.value = false;
+                }}>
+                确定
+              </NButton>
+              <NButton round onClick={() => (removeVisiable.value = false)}>
+                取消
+              </NButton>
+            </NSpace>
+          </div>
+        </NModal>
       </div>
     );
   }

+ 15 - 2
src/views/xiaoku-music/index.module.less

@@ -82,7 +82,8 @@
       margin-left: auto;
       width: 361px;
     }
-    .n-input__input-el{
+
+    .n-input__input-el {
       height: 100%;
       line-height: 100%;
     }
@@ -356,4 +357,16 @@
   .van-fade-leave-to {
     opacity: 0;
   }
-}
+}
+
+.previewWindow {
+  width: 85%;
+  height: 85vh;
+
+  .previewIframe {
+    width: 100%;
+    height: 85vh;
+    background-color: #fff;
+    border-radius: 16px;
+  }
+}

+ 34 - 2
src/views/xiaoku-music/index.tsx

@@ -17,6 +17,7 @@ import {
   NButton,
   NEmpty,
   NImage,
+  NModal,
   NSpace,
   NSpin
 } from 'naive-ui';
@@ -42,6 +43,7 @@ import {
 import { useUserStore } from '/src/store/modules/users';
 import Musicguide from '@/custom-plugins/guide-page/music-guide';
 import TheEmpty from '/src/components/TheEmpty';
+import { state } from '/src/state';
 export default defineComponent({
   name: 'XiaokuMusic',
   setup() {
@@ -64,7 +66,10 @@ export default defineComponent({
       list: [] as unknown as IMusicItem[],
       listActive: 0,
       playState: 'pause' as 'play' | 'pause',
-      showPlayer: false
+      showPlayer: false,
+      previewModal: false,
+      showPreivew: false,
+      previewUrl: ''
     });
     const showGuide = ref(false);
     const userStore = useUserStore();
@@ -396,7 +401,13 @@ export default defineComponent({
                       ? 'https://test.lexiaoya.cn'
                       : location.origin;
                     const src = `${origin}/instrument?platform=pc&showGuide=true&id=${activeItem.value.id}&Authorization=${user.getToken}`;
-                    window.open(src);
+                    if (state.application) {
+                      data.previewModal = true;
+                      data.previewUrl = src;
+                      data.showPreivew = false;
+                    } else {
+                      window.open(src);
+                    }
                   }}
                 />
                 <div
@@ -438,6 +449,27 @@ export default defineComponent({
           />
         )}
         {showGuide.value ? <Musicguide></Musicguide> : null}
+
+        <NModal
+          v-model:show={data.previewModal}
+          onUpdate:show={(val: any) => {
+            if (!val) {
+              data.previewUrl = '';
+            }
+          }}
+          class={styles.previewWindow}
+          showIcon={false}
+          displayDirective="show">
+          <NSpin show={data.showPreivew} style="--n-opacity-spinning: 1;">
+            <iframe
+              class={styles.previewIframe}
+              onLoad={() => {
+                data.showPreivew = false;
+              }}
+              frameborder="0"
+              src={data.previewUrl}></iframe>
+          </NSpin>
+        </NModal>
       </div>
     );
   }