| | |
| | | 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) |
| | | } else { |
| | | this.setLangType('English') |
| | | } |
| | | }, |
| | | 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 = [] |
| | |
| | | _paramsInfo.paramId = _this.demographyMenber.data[i].paramId |
| | | _paramsInfo.paramName = _this.demographyMenber.data[i].paramName |
| | | _paramsInfo.paramValue = _this.demographyMenber.data[i].paramValue |
| | | console.log('_paramsInfo.paramValue' + _paramsInfo.paramValue) |
| | | console.log('_paramsInfo.paramValue' + typeof _paramsInfo.paramValue) |
| | | if (!_paramsInfo.paramValue) { |
| | | continue |
| | | } |
| | |
| | | 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 } }) |
| | | }).catch(e => { |
| | | _this.$message.error(_this.$t('noquestionMsg')) |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | ...mapMutations('user', ['setMemberTocken']), |
| | | ...mapMutations('exam', ['setDoUrl']) |
| | | ...mapMutations('exam', ['setDoUrl']), |
| | | ...mapMutations('user', ['setLangType']), |
| | | ...mapMutations('user', ['setFormDo']) |
| | | }, |
| | | computed: { |
| | | ...mapState('user', { memberToken: state => state.memberToken }), |