From e9d90e9ea68a2ee82869124ff092dc21f329f2b0 Mon Sep 17 00:00:00 2001
From: yj <2077506045@qq.com>
Date: 星期四, 27 十一月 2025 11:00:22 +0800
Subject: [PATCH] 移动端不显示关闭按钮与相应文字
---
src/views/exam/paper/personality.vue | 110 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 97 insertions(+), 13 deletions(-)
diff --git a/src/views/exam/paper/personality.vue b/src/views/exam/paper/personality.vue
index d07b95d..7563f2a 100644
--- a/src/views/exam/paper/personality.vue
+++ b/src/views/exam/paper/personality.vue
@@ -16,14 +16,14 @@
<div class="align-center"><span style="font-size: small; float: left">{{$t('examinee')}}{{memberName}}</span><span style="margin-top: 0px;padding-right: 11%">鈼弡{form.name}}鈼�</span></div>
<hr style="border : 1px dashed #b3d8ff;" />
<el-form-item :key="itemOrder" label-width="1px">
- <QuestionEdit @callNextSubject="nextSubject" :qType="questionItem.questionType" :question="questionItem"
+ <QuestionEdit @callSelected="callSelected" @callNextSubject="nextSubject" :qType="questionItem.questionType" :question="questionItem"
:answer="answer.answerItems[questionItem.itemOrder-1]" :qLabel="itemOrder+'/'+itemSize"/>
</el-form-item>
<hr style="border : 0.5px dashed #b3d8ff;" />
<div style="color: red;font-size: smaller">{{$t('pleaseAnswerCarefully')}}</div>
<el-row class="do-align-center" v-if="order < problemLength">
- <el-button @click="preSubject" type="warning" v-if ="preDisable" round>{{$t('lastQuestion')}}</el-button>
- <el-button @click="nextSubject" type="primary" v-if ="nextDisable" round>{{$t('nextQuestion')}}</el-button>
+ <el-button @click="preSubject" type="warning" v-if ="preDisable" :disabled="preDisable2" round>{{$t('lastQuestion')}}</el-button>
+ <el-button @click="nextSubject" type="primary" v-if ="nextDisable" :disabled="nextDisable2" round>{{$t('nextQuestion')}}</el-button>
</el-row>
<el-row class="do-align-center" v-else>
<el-button @click="preSubject" type="warning" v-if ="preDisable" round>{{$t('lastQuestion')}}</el-button>
@@ -88,7 +88,9 @@
submitDisable: true,
doTime: 0,
preDisable: false,
+ preDisable2: false,
nextDisable: false,
+ nextDisable2: false,
partOrder: 0,
parts: [],
guideTitle: '',
@@ -97,16 +99,18 @@
memberName: '',
itemSize: '', // 棰樼洰闀垮害
startDoDisable: true,
- ismobile: false
+ ismobile: false,
+ hasShownSubmitTip: false // 鏍囧織鏄惁宸茬粡鏄剧ず杩囨彁浜ゆ彁绀�
}
},
created: function () {
+ // this.getFormDo()
let _this = this
_this.ismobile = /ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(navigator.userAgent.toLowerCase())
// 澶氳瑷�
_this.setLangFlag(false)
- _this.form = this.$route.query.formDo
- if (_this.form !== {} && _this.form !== undefined) {
+ _this.form = undefined
+ if (_this.form && _this.form !== {} && _this.form !== undefined) {
_this.formLoading = true
_this.remainTime = _this.form.suggestTime * 60
_this.problemLength = _this.form.titleItems[0].questionItems.length - 1
@@ -131,6 +135,10 @@
// 鍔犺浇棰樼洰
examPaperApi.select(_this.memberToken, _this.langType).then(re => {
_this.form = re.response
+ // // 娴嬭瘯妯″紡锛氬彧淇濈暀鍓�3閬撻
+ // if (_this.form.titleItems[0].questionItems.length > 3) {
+ // _this.form.titleItems[0].questionItems = _this.form.titleItems[0].questionItems.slice(0, 3)
+ // }
_this.remainTime = re.response.suggestTime * 60
_this.problemLength = _this.form.titleItems[0].questionItems.length - 1
_this.titleItemsLength = _this.form.titleItems.length
@@ -142,12 +150,10 @@
_this.initAnswer()
_this.formLoading = false
_this.memberName = _this.form.memberName
-
examPaperApi.selectTokenId(_this.memberToken).then(re => {
_this.answered = re.response.examItemOrderAndContentList
_this.doTime = re.response.doTime
_this.timeReduce()
-
if (_this.answered !== null) {
_this.answered.forEach(it => {
_this.answer.answerItems[parseInt(it.itemOrder) - 1].content = it.content
@@ -166,7 +172,7 @@
}
if (_this.isForFinish(i)) {
- _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.memberToken } })
}
}
// 濡傛灉涓婁竴棰樹笉鏄湰娈碉紝鍒欎笉鑳借繑鍥炰笂涓�娈�
@@ -192,6 +198,20 @@
},
beforeDestroy () {
window.clearInterval(this.timer)
+ },
+ watch: {
+ guideDescirption: function (newVal, oldVal) {
+ // 澶勭悊鎸囧璇紝鏇存崲鍙橀噺
+ if (newVal) {
+ if (this.form) {
+ let productType = this.form.productType
+ if (productType === 'API_Fan') {
+ newVal = newVal.replace('%%company%%', this.form.reportCompany)
+ this.guideDescirption = newVal
+ }
+ }
+ }
+ }
},
methods: {
formatSeconds (theTime) {
@@ -314,6 +334,8 @@
},
nextSubject: function () {
let _this = this
+ _this.preDisable2 = true
+ _this.nextDisable2 = true
_this.isShowGuide(false)
let nowPartOrder = _this.partOrder
// 璁剧疆涓婁竴棰樼殑缁撴潫鏃堕棿
@@ -342,8 +364,20 @@
return
}
}
+
+ // 妫�鏌ユ槸鍚︽槸鏈�鍚庝竴棰樹笖宸茬瓟瀹岋紝寮瑰嚭鎻愮ず妗�
+ if (_this.order === _this.answer.answerItems.length - 1 && _this.isContentNotEmpty(_this.order)) {
+ if (!_this.hasShownSubmitTip) {
+ _this.hasShownSubmitTip = true
+ _this.$alert(_this.$t('submit_tip'), _this.$t('prompt'), {
+ confirmButtonText: _this.$t('determine'),
+ customClass: 'submit-tip-dialog'
+ })
+ }
+ }
this.answer.answerItems[_this.order].readOnly = true
let answerSubmit = _this.getSubmitAnswerValue(nowPartOrder)
+
// 宸茬粡绛斿埌浜嗘渶鍚庝竴棰樹簡,涓嶇敤鑷姩璺冲埌涓嬩竴棰�
if (this.order + 1 > this.problemLength) {
this.submitDisable = false
@@ -375,12 +409,21 @@
} else {
this.nextQuestionOrder(nowPartOrder)
}
+ _this.preDisable2 = false
+ _this.nextDisable2 = false
}).catch(e => {
if (_this.isNotEmpty(loading)) {
loading.close()
}
_this.reloadPage(e)
+ _this.preDisable2 = false
+ _this.nextDisable2 = false
})
+ },
+ callSelected: function () {
+ let _this = this
+ _this.preDisable2 = true
+ _this.nextDisable2 = true
},
getSubmitAnswerValue (nowPartOrder) {
let _this = this
@@ -400,8 +443,16 @@
},
preSubject () {
let _this = this
+ _this.nextDisable2 = false
_this.isShowGuide(false)
if (_this.order > 0) {
+ // 娓呯┖鏈鐨勯�夋嫨
+ _this.answer.answerItems[_this.order].content = null
+ _this.answer.answerItems[_this.order].completed = false
+ _this.answer.answerItems[_this.order].questionReport = null
+ _this.answer.answerItems[_this.order].readOnly = false
+
+ // 璁剧疆鍥炲埌涓婁竴棰�
let num = --_this.order
_this.itemOrder = _this.form.titleItems[0].questionItems[num].itemOrder
_this.questionItem = _this.form.titleItems[0].questionItems[num]
@@ -420,7 +471,9 @@
for (let i = 0; i < _this.answer.answerItems.length; i++) {
if (_this.answer.answerItems[i].content === null) {
unFinish = true
- _this.answer.finish = 0
+ // 鏈夋湭瀹屾垚鐨勭瓟棰樺簲璇ユ槸 2绛旈涓�
+ // 涔嬪墠鏄�0鏈鐞�
+ _this.answer.finish = 2
}
}
if (unFinish) {
@@ -440,7 +493,20 @@
} else {
_this.answer.verifyStatus = 1
_this.answer.finish = 1
- _this.submitAnswer(_this.$t('finishSubmit'))
+ let text = _this.$t('finishPersonalityInfo')
+ if (_this.isMobile()) {
+ text = _this.$t('finishPersonalityInfo_mobile')
+ }
+ if (this.form) {
+ let productType = this.form.productType
+ if (productType === 'API_Fan') {
+ text = _this.$t('finishPersonalityInfo_apifan')
+ if (_this.isMobile()) {
+ text = _this.$t('finishPersonalityInfo_apifan_mobile')
+ }
+ }
+ }
+ _this.submitAnswer(text)
}
},
startDo: function () {
@@ -462,7 +528,18 @@
examPaperAnswerApi.answerSubmit(answerSubmit, _this.memberToken).then(re => {
loading.close()
if (re.code === 1) {
- _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } })
+ // 鐗规畩澶勭悊 LAQ娴嬭瘯鍖� MAQ+CAQ
+ if (_this.form.name.indexOf('LAQ') !== -1) {
+ examPaperApi.select(_this.memberToken, _this.langType).then(re => {
+ _this.form = re.response
+ this.setFormDo(_this.form)
+ _this.$router.push({ path: '/guide/index', query: { formDo: _this.form } })
+ }).catch(e => {
+ _this.$message.error(_this.$t('noquestionMsg'))
+ })
+ } else {
+ _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } })
+ }
} else {
_this.$message.error(re.message + '/exam/finish')
}
@@ -520,8 +597,13 @@
let _this = this
return _this.form.titleItems[0].questionItems[_this.order].partOrder !== _this.form.titleItems[0].questionItems[_this.order - 1].partOrder
},
+ isMobile: function () {
+ return window.innerWidth < 1025
+ },
...mapMutations('user', ['setLangType']),
- ...mapMutations('user', ['setLangFlag'])
+ ...mapMutations('user', ['setLangFlag']),
+ ...mapMutations('user', ['getFormDo']),
+ ...mapMutations('user', ['setFormDo'])
},
computed: {
...mapGetters('enumItem', ['enumFormat']),
@@ -529,6 +611,7 @@
...mapState('user', { memberToken: state => state.memberToken }),
...mapState('user', { langType: state => state.langType }),
...mapState('user', { langFlag: state => state.langFlag }),
+ ...mapState('user', { formDo: state => state.formDo }),
...mapState('exam', { doUrl: state => state.doUrl })
}
}
@@ -558,4 +641,5 @@
z-index: 1000;
bottom: 0px;
}
+
</style>
--
Gitblit v1.9.1