mo 1 year ago
parent
commit
264ae49d40

+ 36 - 64
dev-dist/sw.js

@@ -13,29 +13,31 @@
 
 // If the loader is already loaded, just stop.
 if (!self.define) {
-  const registry = {};
+  let registry = {};
 
   // Used for `eval` and `importScripts` where we can't get script URL by other means.
   // In both cases, it's safe to use a global var because those functions are synchronous.
   let nextDefineUri;
 
   const singleRequire = (uri, parentUri) => {
-    uri = new URL(uri + '.js', parentUri).href;
-    return (
-      registry[uri] ||
-      new Promise(resolve => {
-        if ('document' in self) {
-          const script = document.createElement('script');
-          script.src = uri;
-          script.onload = resolve;
-          document.head.appendChild(script);
-        } else {
-          nextDefineUri = uri;
-          importScripts(uri);
-          resolve();
-        }
-      }).then(() => {
-        const promise = registry[uri];
+    uri = new URL(uri + ".js", parentUri).href;
+    return registry[uri] || (
+      
+        new Promise(resolve => {
+          if ("document" in self) {
+            const script = document.createElement("script");
+            script.src = uri;
+            script.onload = resolve;
+            document.head.appendChild(script);
+          } else {
+            nextDefineUri = uri;
+            importScripts(uri);
+            resolve();
+          }
+        })
+      
+      .then(() => {
+        let promise = registry[uri];
         if (!promise) {
           throw new Error(`Module ${uri} didn’t register its module`);
         }
@@ -45,31 +47,27 @@ if (!self.define) {
   };
 
   self.define = (depsNames, factory) => {
-    const uri =
-      nextDefineUri ||
-      ('document' in self ? document.currentScript.src : '') ||
-      location.href;
+    const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
     if (registry[uri]) {
       // Module is already loading or loaded.
       return;
     }
-    const exports = {};
+    let exports = {};
     const require = depUri => singleRequire(depUri, uri);
     const specialDeps = {
       module: { uri },
       exports,
       require
     };
-    registry[uri] = Promise.all(
-      depsNames.map(depName => specialDeps[depName] || require(depName))
-    ).then(deps => {
+    registry[uri] = Promise.all(depsNames.map(
+      depName => specialDeps[depName] || require(depName)
+    )).then(deps => {
       factory(...deps);
       return exports;
     });
   };
 }
-define(['./workbox-5357ef54'], function (workbox) {
-  'use strict';
+define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -79,42 +77,16 @@ define(['./workbox-5357ef54'], function (workbox) {
    * requests for URLs in the manifest.
    * See https://goo.gl/S9QRab
    */
-  workbox.precacheAndRoute(
-    [
-      {
-        url: 'registerSW.js',
-        revision: '3ca0b8505b4bec776b69afdba2768812'
-      },
-      {
-        url: 'index.html',
-        revision: '0.1b6d4v58fbg'
-      }
-    ],
-    {}
-  );
+  workbox.precacheAndRoute([{
+    "url": "registerSW.js",
+    "revision": "b17c881594570d5574b0e0d280c3df6d"
+  }, {
+    "url": "index.html",
+    "revision": "0.ab482jjgat8"
+  }], {});
   workbox.cleanupOutdatedCaches();
-  workbox.registerRoute(
-    new workbox.NavigationRoute(workbox.createHandlerBoundToURL('index.html'), {
-      allowlist: [/^\/$/]
-    })
-  );
-});
-
-// 监听install事件
-self.addEventListener('install', function (e) {
-  // console.log('Service Worker 状态: install');
-  console.log('install,更新');
-  self.skipWaiting();
-});
-
-// 监听activate事件
-self.addEventListener('activate', function (e) {
-  // console.log('Service Worker 状态: activate');
-  console.log('activate,更新');
-  e.waitUntil(clients.claim());
-});
+  workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
+    allowlist: [/^\/$/]
+  }));
 
-self.addEventListener('fetch', function (e) {
-  // 需要缓存的xhr请求
-  // console.log("fetch 事件")
-});
+}));

+ 8 - 0
src/views/attend-class/index.tsx

@@ -1190,6 +1190,14 @@ export default defineComponent({
                 onClick={() => {
                   //
                   if (state.application) {
+
+                    document.exitFullscreen
+                    ? document.exitFullscreen()
+                    : document.mozCancelFullScreen
+                    ? document.mozCancelFullScreen()
+                    : document.webkitExitFullscreen
+                    ? document.webkitExitFullscreen()
+                    : ''
                     emit('close');
                   } else {
                     window.close();

+ 3 - 3
src/views/prepare-lessons/components/lesson-main/index.tsx

@@ -17,7 +17,7 @@ export default defineComponent({
           paneClass={styles.paneTitle}
           justifyContent="center"
           paneWrapperClass={styles.paneWrapperContainer}
-          onUpdate:value={(val: string) => {
+          onUpdate: value={(val: string) => {
             prepareStore.setTabType(val);
           }}>
           <NTabPane name="courseware" tab="课件">
@@ -25,8 +25,8 @@ export default defineComponent({
           </NTabPane>
           <NTabPane
             name="train"
-            tab="学练"
-            v-slots={{ tab: () => <span id="lessons-4">学练</span> }}
+            tab="作业"
+            v-slots={{ tab: () => <span id="lessons-4">作业</span> }}
             {...{ id: 'lessons-4' }}>
             <Train />
           </NTabPane>

+ 32 - 3
src/views/prepare-lessons/model/attend-class/index.tsx

@@ -7,7 +7,8 @@ import { classGroupPage, courseScheduleStart } from '../../api';
 import { useThrottleFn } from '@vueuse/core';
 import TheEmpty from '/src/components/TheEmpty';
 import { usePrepareStore } from '/src/store/modules/prepareLessons';
-
+import { state } from '/src/state';
+import { nextTick } from 'process';
 const classList: any = [];
 for (let i = 1; i <= 40; i++) {
   classList.push({ label: i + '班', value: i });
@@ -24,6 +25,7 @@ export default defineComponent({
       currentGradeNum: null,
       currentClass: null
     });
+
     const list = ref([] as any);
     const loading = ref(false);
     // 开始上课
@@ -33,19 +35,46 @@ export default defineComponent({
           lessonCoursewareKnowledgeDetailId: prepareStore.selectKey,
           classGroupId: item.id
         });
+
         emit('close');
 
+
         emit('preview', {
           type: 'class',
           classGroupId: item.id,
           subjectId: prepareStore.getSubjectId,
           detailId: prepareStore.getSelectKey
         });
+        if(state.application){
+          setTimeout(()=>{
+            fscreen()
+          },200)
+
+      }
+
       } catch {
         //
       }
     };
-
+   const fscreen=()=> {
+      var el = document.documentElement
+      var isFullscreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen
+      if (!isFullscreen) {
+        //进入全屏
+        (el.requestFullscreen && el.requestFullscreen()) ||
+        (el.mozRequestFullScreen && el.mozRequestFullScreen()) ||
+        (el.webkitRequestFullscreen && el.webkitRequestFullscreen()) ||
+        (el.msRequestFullscreen && el.msRequestFullscreen())
+      } else {
+        //退出全屏
+        document.exitFullscreen
+          ? document.exitFullscreen()
+          : document.mozCancelFullScreen
+          ? document.mozCancelFullScreen()
+          : document.webkitExitFullscreen
+          ? document.webkitExitFullscreen()
+          : ''
+      }}
     const getList = async () => {
       loading.value = true;
       try {
@@ -122,7 +151,7 @@ export default defineComponent({
               ]}>
               {list.value.map((item: any) => (
                 <div onClick={() => onAttendClass(item)}>
-                  <NThing class={styles.thingItem}>
+                  <NThing class={[styles.thingItem,'isFull']}>
                     {{
                       header: () => (
                         <div class={styles.title}>

+ 2 - 1
vite.config.ts

@@ -62,11 +62,12 @@ export default defineConfig({
     VitePWA({
       registerType: 'autoUpdate',
       includeAssets: ['./logo.png'],
+
       manifest: {
         name: '酷乐秀-音乐数字课堂',
         short_name: '音乐数字课堂',
         theme_color: '#E8EAED',
-        display: 'fullscreen',
+        display: 'standalone',
         icons: [
           {
             src: './logo.png',