From 068dbdbbdeb514557856cf3c8ea9dfe99c711a86 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Mon, 19 Aug 2019 10:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demonstration/detail/index.vue | 23 +++++++++++++++-------- src/views/exam/detail/courseDetail.vue | 11 ++++++++--- src/views/exam/detail/examDetail.vue | 18 ++++++++++-------- src/views/exam/detail/questionDetail.vue | 14 ++++++++------ src/views/teach/detail/index.vue | 8 ++++++-- src/views/teach/practical/index.vue | 12 ++++-------- 6 files changed, 51 insertions(+), 35 deletions(-) diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 4e2916510..12b2f8f4e 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -30,12 +30,12 @@
- 购买 - 权限分发 - 权限转赠 - 开始仿真 - 创建房间 - 进入房间 + 购买 + 权限分发 + 权限转赠 + 开始仿真 + 创建房间 + 进入房间
@@ -81,6 +81,7 @@ export default { goodsId: '', tryUser: 0, loading: true, + buttonLoading: false, currentLessonId: '', currentPrdCode: '', productList: [], @@ -240,6 +241,7 @@ export default { async start() { if (this.courseModel.prdType == '03') { try { + this.buttonLoading = true; const param = { mapId: Number(this.mapId), prdCode: this.courseModel.prdCode @@ -250,12 +252,13 @@ export default { this.$router.push({ path: `/trainroom`, query: query }); } } catch (error) { + this.buttonLoading = false; if (error.code == 20001) { this.$confirm(`每个用户只能创建一个综合演练房间, 是否进入房间`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(() => { }).catch(() => { }); + }).then(() => {}).catch(() => {}); } if (error.code == 500009) { this.$messageBox(error.message); @@ -272,7 +275,7 @@ export default { type: 'warning' }).then(() => { this.buy(); - }).catch(() => { }); + }).catch(() => {}); } else { this.jump(); } @@ -281,6 +284,7 @@ export default { }, jump() { const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode }; + this.buttonLoading = true; simulationNotify(data).then(resp => { // try 0 有权限不走试用 const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser }; @@ -292,17 +296,20 @@ export default { }); }, buy() { + this.buttonLoading = true; this.$router.push({ path: `${UrlConfig.demonstration.pay}/${this.courseModel.id}`, query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } }); }, transfer() { + this.buttonLoading = false; if (this.$refs) { this.$refs[`limit_${this.currentPrdCode}`][0].transfer(this.courseModel); } }, distribute() { + this.buttonLoading = false; if (this.$refs) { this.$refs[`limit_${this.currentPrdCode}`][0].distribute(this.courseModel); } diff --git a/src/views/exam/detail/courseDetail.vue b/src/views/exam/detail/courseDetail.vue index fcdfd5068..d500cc471 100644 --- a/src/views/exam/detail/courseDetail.vue +++ b/src/views/exam/detail/courseDetail.vue @@ -35,9 +35,9 @@
购买 - 权限分发(考试) - 权限转赠 - 查看课程试卷 + 权限分发(考试) + 权限转赠 + 查看课程试卷
@@ -57,6 +57,7 @@ export default { data() { return { height: '', + loading: false, courseModel: { id: '', name: '请选择课程', @@ -117,24 +118,28 @@ export default { } }, buy() { + this.loading = true; this.$router.push({ path: `${UrlConfig.exam.pay}/${this.$route.params.lessonId}`, query: { permissionType: PermissionType.EXAM, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } }); }, checkCourse() { + this.loading = true; this.$router.push({ path: `${UrlConfig.exam.examRuleManage}`, query: { lessonId: this.courseModel.id } }); }, transfer() { + this.loading = false; if (this.$refs) { this.activeName = 'second'; this.$refs.limitList.transfer(this.courseModel); } }, distribute() { + this.loading = false; if (this.$refs) { this.activeName = 'second'; this.$refs.limitList.distribute(this.courseModel); diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue index 5962d4cc9..4e786ed21 100644 --- a/src/views/exam/detail/examDetail.vue +++ b/src/views/exam/detail/examDetail.vue @@ -43,7 +43,7 @@
- 开始考试 + 开始考试
@@ -67,6 +67,7 @@ export default { data() { return { height: '', + loading: false, examDetails: { lessonId: '', name: '', @@ -156,11 +157,15 @@ export default { } }, buy() { + this.loading = true; getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => { this.$router.push({ path: `${UrlConfig.exam.pay}/${this.examDetails.lessonId}`, query: { permissionType: PermissionType.EXAM, prdCode: res.data.prdCode, mapId: res.data.mapId } }); + }).catch(() => { + this.$messageBox('获取课程详情失败'); + this.loading = false; }); }, @@ -194,12 +199,7 @@ export default { } }, exmaStart() { - this.loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + this.loading = true; this.examDetail(); if (this.examList.length) { examNotify({ examId: this.$route.params.examId }).then(resp => { @@ -212,9 +212,11 @@ export default { this.$router.push({ path: `${UrlConfig.display}/exam`, query: query }); launchFullscreen(); }).catch(error => { + this.loading = false; this.$messageBox(`创建仿真失败: ${error.message}`); - this.loading.close(); }); + } else { + this.loading = false; } } } diff --git a/src/views/exam/detail/questionDetail.vue b/src/views/exam/detail/questionDetail.vue index d50a27914..95ee1b73d 100644 --- a/src/views/exam/detail/questionDetail.vue +++ b/src/views/exam/detail/questionDetail.vue @@ -22,8 +22,8 @@

- 开始考试 - 放弃考试 + 开始考试 + 放弃考试

@@ -45,12 +45,10 @@ export default { mixins: [ WindowResizeHandler ], - mixins: [ - WindowResizeHandler - ], data() { return { height: '', + loading: false, courseModel: { id: '', name: '', @@ -98,11 +96,13 @@ export default { } }, start() { + this.loading = true; const query = { skinCode: this.$route.query.skinCode, trainingId: this.$route.query.trainingId, userExamId: this.$route.query.userExamId, examQuestionId: this.$route.params.examQuestionId }; this.$router.push({ path: '/display/exam', query: query }); launchFullscreen(); }, back() { + this.loading = true; this.$confirm('此操作将放弃本次考试, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -112,7 +112,9 @@ export default { setExamGive(this.$route.query.userExamId).then(() => { this.$router.push({ path: '/exam/home' }); }); - }).catch(() => { }); + }).catch(() => { + this.loading = false; + }); } } }; diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index c40944194..6524b65bc 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -42,8 +42,8 @@
购买 - 权限分发(上课) - 权限转赠 + 权限分发(上课) + 权限转赠
@@ -65,6 +65,7 @@ export default { return { num: 5, height: '', + loading: false, WhetherTypeList: [], EffectiveTypeList: [], courseModel: { @@ -121,18 +122,21 @@ export default { } }, buy() { + this.loading = true; this.$router.push({ path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`, query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } }); }, transfer() { + this.loading = false; if (this.$refs) { this.activeName = 'second'; this.$refs.limitList.transfer(this.courseModel); } }, distribute() { + this.loading = false; if (this.$refs) { this.activeName = 'second'; this.$refs.limitList.distribute(this.courseModel); diff --git a/src/views/teach/practical/index.vue b/src/views/teach/practical/index.vue index 14e44bca4..9419628a0 100644 --- a/src/views/teach/practical/index.vue +++ b/src/views/teach/practical/index.vue @@ -20,7 +20,7 @@
- 开始实训 + 开始实训
@@ -43,6 +43,7 @@ export default { data() { return { height: '', + loading: false, courseModel: { id: '', name: '', @@ -85,12 +86,7 @@ export default { } }, start() { - const loading = this.$loading({ - lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); + this.loading = true; trainingNotify({ trainingId: this.$route.params.trainingId }).then(resp => { const query = { group: resp.data, trainingId: this.$route.params.trainingId, lessonId: this.$route.params.lessonId @@ -98,8 +94,8 @@ export default { this.$router.push({ path: `${UrlConfig.display}/teach`, query: query }); launchFullscreen(); }).catch(error => { + this.loading = false; this.$messageBox(`创建仿真失败: ${error.message}`); - loading.close(); }); } }