[测评系统]--前端(用户答题页面)
阳洁
2024-03-05 abff99332f01964f43859b6cc88d22dcac12c343
src/views/demography/login.vue
@@ -18,6 +18,7 @@
      parasInfos: [],
      parasInfoIds: {},
      formDo: {},
      reportTemplateType: null,
      statusInfo: { '2': this.$t('statusInfo2'), '3': this.$t('statusInfo3'), '4': this.$t('statusInfo4') }
    }
  },
@@ -31,10 +32,13 @@
    // 已经答完了不能答题
    examPaperApi.selectTokenId(_this.paraMemberToken).then(re => {
      if (re.response.finish === 1) {
        _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg') } })
        _this.$router.push({ path: '/exam/finish', query: { name: '', content: _this.$t('finishMsg'), tokenId: _this.paraMemberToken } })
      } else if (re.response.status !== '1') {
        _this.$router.push({ path: '/exam/exception', query: { name: '', content: _this.statusInfo[re.response.status] } })
      } else {
        // _this.doUrl = re.response.doUrl
        _this.reportTemplateType = re.response.productType
        _this.setProductType(re.response.productType)
        _this.setMemberTocken(_this.paraMemberToken)
        _this.setDoUrl(re.response.doUrl)
        _this.setReportTemplateId(re.response.reportTemplateId)
@@ -50,6 +54,22 @@
      demographyApi.queryDemographyParamInfo(_this.paraMemberToken).then(
        reParam => {
          if (reParam.code !== 1) {
            // 职业兴趣报告特殊化处理 只有中文
            if (_this.doUrl === 'career_interests') {
              _this.$i18n.locale = 'zh'
              _this.setLangType('Chinese')
              _this.$router.push({ path: '/demography/fill/index', query: { demographyMenber: _this.memberToken, isStart: false } })
              return
            }
            // APIFan做特殊处理 只有中文
            if (_this.reportTemplateType === 'API_Fan') {
              _this.$i18n.locale = 'zh'
              _this.setLangType('Chinese')
              _this.$router.push({ path: '/demography/fill/logo', query: { demographyMenber: _this.memberToken, isStart: false } })
              return
            }
            // 先选择密码
            _this.$router.push({ path: '/demography/fill/langOption', query: { langSelectValue: _this.langType } })
            _this.setMemberTocken(_this.paraMemberToken)
@@ -88,14 +108,17 @@
    ...mapMutations('exam', ['setDoUrl']),
    ...mapMutations('exam', ['setReportTemplateId']),
    ...mapMutations('user', ['setLangType']),
    ...mapMutations('user', ['getLangType'])
    ...mapMutations('user', ['getLangType']),
    ...mapMutations('exam', ['setProductType'])
  },
  computed: {
    ...mapState('user', { memberToken: state => state.memberToken }),
    ...mapState('user', { memberId: state => state.memberId }),
    ...mapState('exam', { doUrl: state => state.doUrl }),
    ...mapState('exam', { reportTemplateId: state => state.reportTemplateId }),
    ...mapState('user', { langType: state => state.langType })
    ...mapState('user', { langType: state => state.langType }),
    ...mapState('exam', { productType: state => state.productType })
  }
}
</script>