Bladeren bron

离线包过期提示

dsy 9 maanden geleden
bovenliggende
commit
0772d7a51c
4 gewijzigde bestanden met toevoegingen van 48 en 3 verwijderingen
  1. 5 0
      src/api/article.js
  2. 11 3
      src/components/CommonPreview.vue
  3. 31 0
      src/components/QuitTips.vue
  4. 1 0
      src/icons/svg/borderDotted.svg

+ 5 - 0
src/api/article.js

@@ -42,3 +42,8 @@ export function getCoursewareWordExampleSentenceList(data) {
 export function getSysConfig() {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=sys_config_manager-GetSysConfig`);
 }
+
+// 音频字幕打点-火山
+export function getWordTimes(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-AudioTextDot_OldFormat`, data);
+}

+ 11 - 3
src/components/CommonPreview.vue

@@ -211,6 +211,8 @@
         @child-click="handleNodeClick"
       />
     </el-dialog>
+
+    <QuitTips :visible.sync="visibleQuitTips" :error-msg="errorMsg" />
   </div>
 </template>
 
@@ -222,6 +224,7 @@ import MindMap from '@/components/MindMap.vue';
 // import VideoPlay from '@/views/book/courseware/preview/components/common/VideoPlay.vue';
 // import AudioPlay from '@/views/book/courseware/preview/components/common/AudioPlay.vue';
 // import AuditRemark from '@/components/AuditRemark.vue';
+import QuitTips from '@/components/QuitTips.vue';
 import * as OpenCC from 'opencc-js';
 
 import { GetProjectBaseInfo } from '@/api/project';
@@ -235,6 +238,7 @@ export default {
     CoursewarePreview,
     RichText,
     MindMap,
+    QuitTips,
     // AudioPlay,
     // VideoPlay,
     // AuditRemark,
@@ -361,6 +365,8 @@ export default {
         cover_image_file_url: '', // 封面图片URL
       },
       coursewareFileList: [], // 课件文件列表
+      visibleQuitTips: false,
+      errorMsg: '',
     };
   },
   computed: {
@@ -477,11 +483,13 @@ export default {
           const now = Date.now();
           const endDate = new Date(info.effective_end_date).getTime();
           if (now > endDate) {
-            this.$message.warning('当前离线包激活已过期');
+            this.visibleQuitTips = true;
+            this.errorMsg = '离线包教材已过期。';
             return false;
           }
           if (info.effective_count <= 0) {
-            this.$message.warning('当前离线包激活次数已用完');
+            this.visibleQuitTips = true;
+            this.errorMsg = '离线包教材使用次数已满。';
             return false;
           }
           info.effective_count -= 1;
@@ -501,7 +509,6 @@ export default {
       setBlockAllRequests(false);
       try {
         const { effective_count, effective_end_date } = await BookOfflinePackActivate({ auth_code, host_address });
-        this.$message.success('离线包激活成功');
         setBlockAllRequests(true);
         await this.modifyEepFileData(
           'authorization.json',
@@ -520,6 +527,7 @@ export default {
           effective_end_date,
         };
         await window.electronStore.set(this.storeName, storeData);
+        this.$message.success('离线包激活成功');
         return true;
       } catch (e) {
         console.error(e);

+ 31 - 0
src/components/QuitTips.vue

@@ -0,0 +1,31 @@
+<template>
+  <el-dialog title="离线包提示" :visible="visible" width="200px" :close-on-click-modal="false" :show-close="false">
+    <h3>{{ errorMsg }}</h3>
+
+    <span slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="quit">退 出</el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: 'QuitTipsPage',
+  props: {
+    visible: {
+      type: Boolean,
+      required: true,
+    },
+    errorMsg: {
+      type: String,
+      default: '',
+    },
+  },
+  methods: {
+    quit() {
+      this.$emit('update:visible', false);
+      this.$router.push({ name: 'SelectEEP' });
+    },
+  },
+};
+</script>

+ 1 - 0
src/icons/svg/borderDotted.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766029286060" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6052" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M578.4576 865.5872V115.6096H921.6V1.024H102.4v114.688h343.1424v749.9776z" fill="#000000" p-id="6053"></path><path d="M51.2 972.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" fill="#000000" p-id="6054"></path><path d="M358.4 972.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" fill="#000000" p-id="6055"></path><path d="M665.6 972.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" fill="#000000" p-id="6056"></path><path d="M972.8 972.8m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" fill="currentColor" p-id="6057"></path></svg>