|
|
@@ -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);
|