From 92bdab1577ce5080a43327d34eb0be4593055201 Mon Sep 17 00:00:00 2001 From: song Date: Fri, 31 Dec 2021 15:48:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bug):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 ++- src/components/Info/Info.vue | 1 - src/mixins/tool.js | 4 +++- .../components/ConfigInfo/ConfigInfo.vue | 7 ++++++ .../ConfigInfo/components/CaregiverDetail.vue | 21 ++++++++++++++--- .../components/NotEvaluated/NotEvaluated.vue | 12 +++++++++- .../project/components/Roles/Roles.vue | 4 +++- src/pagesProject/project/project.vue | 2 ++ src/pagesYanyuan/assess/assess.vue | 23 ++++++++++--------- .../transfer-page/transfer-page.vue | 7 +++--- 10 files changed, 61 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c651b8..a30a6e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -# 0.1.0 (2021-12-30) +# 0.1.0 (2021-12-31) ### 🌟 新功能 范围|描述|commitId --|--|-- + - | 1.添加时间轴工具箱折叠功能 2.添加联网超时时间 | [327b72e](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/327b72e) - | api封装 | [7d4edfc](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/7d4edfc) bind phone | 图形验证码;短信验证码;绑定手机号 | [93ffea2](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/93ffea2) - | cache indexedDB处理 | [3388967](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/3388967) diff --git a/src/components/Info/Info.vue b/src/components/Info/Info.vue index f12f58b..fbc7140 100644 --- a/src/components/Info/Info.vue +++ b/src/components/Info/Info.vue @@ -393,7 +393,6 @@ export default { this.$emit('setEmptyInfo'); setTimeout(() => { const info = this.$t.storage.getStorageSync('infoList'); - console.log('info: ', info); if (info !== 'null') { this.infoList = JSON.parse(info); } diff --git a/src/mixins/tool.js b/src/mixins/tool.js index 1e8780f..87945af 100644 --- a/src/mixins/tool.js +++ b/src/mixins/tool.js @@ -141,7 +141,7 @@ export default { return; } // 申请成为家属 - this.$t.page.openPage('/pagesYanyuan/transfer-page/transfer-page?type=jiashu'); + await this.applyFamily(); } catch (error) { this.$refs.uModal.clearLoading(); console.error('error: ', error); @@ -162,10 +162,12 @@ export default { } await this.$u.api.applyFamily(params); this.transferContent = '申请已提交,请等待审核'; + this.$t.page.openPage(`/pagesYanyuan/transfer-page/transfer-page?type=jiashu&msg=${this.transferContent}`); } catch (error) { console.error('error: ', error); const msg = error.msg || '申请失败,稍后请重新申请'; this.transferContent = msg; + this.$t.page.openPage(`/pagesYanyuan/transfer-page/transfer-page?type=jiashu&msg=${this.transferContent}`); } }, diff --git a/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue b/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue index ba4a4e9..ed4b9c2 100644 --- a/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue +++ b/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue @@ -96,6 +96,10 @@ export default { } }, + destroyed() { + this.$t.ui.hideLoading(); + }, + methods: { ...mapActions('yanyuan', ['getPersonalInfo']), @@ -141,10 +145,13 @@ export default { */ async handlePersonalInfo() { try { + this.$t.ui.showLoading(); const params = { projectId: this.projectId }; const data = await this.$u.api.queryTrainee(params); this.personalInfo = data; + this.$t.ui.hideLoading(); } catch (error) { + this.$t.ui.hideLoading(); console.error('error: ', error); } }, diff --git a/src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue b/src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue index 5457c47..f10e1c2 100644 --- a/src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue +++ b/src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue @@ -86,8 +86,13 @@ - 保存并开始填表 - + 保存并开始填表 + 继续填表 @@ -114,6 +119,7 @@ export default { careInfo, show: true, params: {}, + loading: false, }; }, @@ -218,14 +224,17 @@ export default { */ async submit() { try { + this.loading = true; if (!this.validationRequired(this.params)) return; const params = this.params; params.projectId = this.projectId; const data = await this.$u.api.addZarit(params); + this.loading = false; if (data) { await this.handleFinishNum(data); } } catch (error) { + this.loading = false; console.error('error: ', error); } }, @@ -277,6 +286,7 @@ export default { */ async handleFinishNum(id) { try { + this.loading = true; this.setReportId(id); this.setCode('ZARIT'); const params = { @@ -284,8 +294,10 @@ export default { reportId: id, }; const data = await this.getFinishNum(params); - this.startAssess(id, data); + this.loading = false; + await this.startAssess(id, data); } catch (error) { + this.loading = false; console.error('error: ', error); } }, @@ -298,6 +310,7 @@ export default { */ async startAssess(id, data) { try { + this.loading = true; let num = 0; if (data.finishNum - 0 < data.totalNum - 0) { num = data.finishNum - 0 + 1; @@ -312,8 +325,10 @@ export default { num, }; await this.handleQuestion(params); + this.loading = false; uni.navigateTo({ url: '/pagesYanyuan/assess/assess' }); } catch (error) { + this.loading = false; console.error('error: ', error); } }, diff --git a/src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue b/src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue index b595054..3d96e08 100644 --- a/src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue +++ b/src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue @@ -6,7 +6,7 @@ - 开始测评 + 开始测评 注:每两个周可进行一次测评 @@ -20,6 +20,10 @@ import { mapActions, mapMutations, mapGetters } from 'vuex'; export default { props: { task: { type: Object, default: () => {} } }, + data() { + return { loading: false }; + }, + computed: mapGetters('project', ['projectId']), methods: { @@ -34,6 +38,7 @@ export default { */ async handleFinishNum() { try { + this.loading = true; const { task } = this; this.setTask(task); this.setCode('NLCP'); @@ -41,9 +46,11 @@ export default { code: 'NLCP', reportId: task.id, }; + this.loading = false; const data = await this.getFinishNum(params); this.startAssess(data); } catch (error) { + this.loading = false; console.error('error: ', error); } }, @@ -56,6 +63,7 @@ export default { */ async startAssess(data) { try { + this.loading = true; let num = 0; if (data.finishNum - 0 < data.totalNum - 0) { num = data.finishNum - 0 + 1; @@ -71,8 +79,10 @@ export default { num, }; await this.handleQuestion(params); + this.loading = false; uni.navigateTo({ url: '/pagesYanyuan/assess/assess' }); } catch (error) { + this.loading = false; this.$t.ui.showToast(error.msg || '查询失败'); console.error('error: ', error); } diff --git a/src/pagesProject/project/components/Roles/Roles.vue b/src/pagesProject/project/components/Roles/Roles.vue index 1d385f3..580614c 100644 --- a/src/pagesProject/project/components/Roles/Roles.vue +++ b/src/pagesProject/project/components/Roles/Roles.vue @@ -168,8 +168,8 @@ export default { // 查任务这里不用管 project监听了roleId的变化 // 时间基准点不用管 project监听了roleId 里处理了 changeRole(id, index, type) { + this.$t.ui.showLoading(); try { - this.$t.ui.showLoading(); if (type === 'Setting') { // 切换设置 this.$emit('changeIsSetting', true); @@ -188,7 +188,9 @@ export default { // 清除时间轴滚动位置id this.setScrollToTaskId(''); this.setShowScrollTo(false); + this.$t.ui.hideLoading(); } catch (error) { + this.$t.ui.hideLoading(); console.error('role.vue changeRole error: ', error); } }, diff --git a/src/pagesProject/project/project.vue b/src/pagesProject/project/project.vue index 2853d5b..b875e1e 100644 --- a/src/pagesProject/project/project.vue +++ b/src/pagesProject/project/project.vue @@ -231,9 +231,11 @@ export default { * @param {number} query.queryType 0向上查找 1向下查找(默认) 下查包含自己,上查不包含 */ getTasks(query) { + this.$t.ui.showLoading(); // this.setShowSkeleton(true); const params = this.generateGetTaskParam(query); this.$t.$q.getRegularTask(params, (err, data) => { + this.$t.ui.hideLoading(); this.setShowSkeleton(false); if (err) { // TODO: 提示错误 diff --git a/src/pagesYanyuan/assess/assess.vue b/src/pagesYanyuan/assess/assess.vue index 2b8917f..5b55482 100644 --- a/src/pagesYanyuan/assess/assess.vue +++ b/src/pagesYanyuan/assess/assess.vue @@ -105,14 +105,12 @@ export default { await this.calculateScore(); } } else { - this.$refs.child.openLoading(); const params = { code, reportId: code === 'NLCP' ? task.id : reportId, num: questionInfo.num + 1, }; await this.handleQuestion(params); - this.$refs.child.closeLoading(); } }, @@ -128,13 +126,19 @@ export default { type: 'success', duration: '3000', }); - setTimeout(() => { - this.backProject(); - this.setTimeNode(Date.now()); - }, 1000); + this.backProject(); + this.setTimeNode(Date.now()); + this.$t.ui.hideLoading(); } catch (error) { console.error('error: ', error); this.$t.ui.showToast(error.msg || '提交失败'); + if (error.msg === '脑力测评分数计算中,请勿重复提交。') { + setTimeout(() => { + this.backProject(); + this.setTimeNode(Date.now()); + }, 1500); + } + this.$t.ui.hideLoading(); } }, @@ -149,10 +153,8 @@ export default { type: 'success', duration: '3000', }); - setTimeout(() => { - this.setIsTest(true); - this.$t.page.back(); - }, 1000); + this.setIsTest(true); + this.$t.page.back(); } catch (error) { console.error('error: ', error); this.$t.ui.showToast(error.msg || '提交失败'); @@ -162,7 +164,6 @@ export default { // 返回时间轴 backProject() { this.setIsEvaluated(true); - const { name, id, url, templateCode } = this.project; url && (uni.$t.domain = url); this.$u.route('/pagesProject/project/project', { diff --git a/src/pagesYanyuan/transfer-page/transfer-page.vue b/src/pagesYanyuan/transfer-page/transfer-page.vue index af79e5a..b4371d1 100644 --- a/src/pagesYanyuan/transfer-page/transfer-page.vue +++ b/src/pagesYanyuan/transfer-page/transfer-page.vue @@ -21,7 +21,7 @@ export default { this.content = '工具箱已绑定'; } if (options.type === 'jiashu') { - this.openApplyModal(1); + this.openApplyModal(1, options.msg); } if (options.type === 'isjiashu') { this.openApplyModal(0); @@ -38,10 +38,9 @@ export default { methods: { // 申请成为家属弹框 - async openApplyModal(type) { + async openApplyModal(type, msg) { if (type === 1) { - await this.applyFamily(); - this.content = this.transferContent; + this.content = msg; } else { this.content = '家属申请已提交,请等待审核'; }