From 5e4bed2d67b26eeb7eab4d176bfabe3f527836e4 Mon Sep 17 00:00:00 2001 From: yj <2077506045@qq.com> Date: 星期五, 19 七月 2024 13:48:29 +0800 Subject: [PATCH] 修复答题刷新与CAQ分片2从第2题开始bug --- src/views/demography/index.vue | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/views/demography/index.vue b/src/views/demography/index.vue index 997ece0..812865f 100644 --- a/src/views/demography/index.vue +++ b/src/views/demography/index.vue @@ -107,18 +107,27 @@ paramsInfo: {}, parasInfos: [], parasInfoIds: {}, - formDo: {}, + // formDo: {}, submitDisable: false, isStart: this.$route.query.isStart === 'true' } }, created () { + const langType = this.$route.query.langType + if (langType && (langType === 'Chinese' || langType === 'English' || langType === 'Thai')) { + this.setLangType(langType) + } + }, + beforeDestroy () { + }, + beforeUpdate () { + }, + updated () { }, methods: { submitDemography: function () { let _this = this _this.submitDisable = true - console.log( this.$refs.demographyMenber) this.$refs.demographyMenber.validate(vaild => { if (vaild) { _this.parasInfos = [] @@ -132,7 +141,7 @@ _paramsInfo.paramId = _this.demographyMenber.data[i].paramId _paramsInfo.paramName = _this.demographyMenber.data[i].paramName _paramsInfo.paramValue = _this.demographyMenber.data[i].paramValue - if (_paramsInfo.paramValue.trim() === '') { + if (!_paramsInfo.paramValue) { continue } _this.parasInfos.push(_paramsInfo) @@ -140,13 +149,14 @@ demographyApi.submitDemography(_this.memberToken, _this.langType, _this.parasInfos).then(function (result) { if (result && result.code === 1) { examPaperApi.select(_this.memberToken, _this.langType).then(re => { - _this.formDo = re.response + _this.setFormDo(re.response) _this.setDoUrl(re.response.questionTemplateId) if (_this.isStart) { _this.$router.push({ path: '/exam/' + _this.doUrl }) return } - _this.$router.push({ path: '/guide/index', query: { formDo: _this.formDo } }); + // _this.$router.push({ path: '/guide/index', query: { formDo: _this.formDo } }) + _this.$router.push({ path: '/guide/index' }) }).catch(e => { _this.$message.error(_this.$t('noquestionMsg')) }) @@ -192,7 +202,9 @@ }) }, ...mapMutations('user', ['setMemberTocken']), - ...mapMutations('exam', ['setDoUrl']) + ...mapMutations('exam', ['setDoUrl']), + ...mapMutations('user', ['setLangType']), + ...mapMutations('user', ['setFormDo']) }, computed: { ...mapState('user', { memberToken: state => state.memberToken }), -- Gitblit v1.9.1