From 81b30e7fb0763bce403431f0c1f64d5a9e36dfb2 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期三, 20 三月 2024 15:42:13 +0800 Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master --- packageBookService/pages/bookServices/examination/questionOptions/index.js | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 38 insertions(+), 16 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.js b/packageBookService/pages/bookServices/examination/questionOptions/index.js index 54aed63..49b4ac6 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.js +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.js @@ -44,6 +44,10 @@ submitStatus: { type: Boolean, value: false + }, + mockSumTime: { + type: Number, + value: 0, } }, @@ -57,13 +61,19 @@ setUpPopup: false, testReportState: false, sliderValue: 0, - useTime: '' + useTime: '', + radioItem: 'daytime' }, observers: { "countdownTime": function (newValue, oldValue) { if (this.properties.answerType == 'option') { this.setData({ useTime: this.formatTime(2 * 60 * 60 * 1000 - this.properties.countdownTime) + }) + } + else if (this.properties.answerType == 'option') { + this.setData({ + useTime: this.formatTime(this.properties.mockSumTime - this.properties.countdownTime) }) } if (newValue == 0 && (this.properties.answerType == 'option' || this.properties.answerType == 'mock')) { @@ -163,6 +173,14 @@ setUpPopup: e.detail.visible }) }, + // 璁剧疆妯″紡鍒囨崲 + onRadioChange(e) { + this.setData({ + radioItem: e.detail.value + }) + const value = e.detail.value == 'night' ? true : false + this.triggerEvent('changeBGColor', { value }) + }, // 閲嶅仛鎸夐挳 resterBtn() { wx.showModal({ @@ -203,23 +221,27 @@ // 搴曢儴鎻愪氦鎸夐挳 submitBtn() { // 鎴戠殑閿欓鍜屾敹钘� 鐩存帴璧版彁浜ら�昏緫 - if (this.properties.answerType !== 'option' || this.properties.answerType !== 'option') { - return this.submitPaper() - } - this.properties.questionDataList.forEach(item => { - if (!this.isHaveAnswer(item.userAnswer)) { - this.setData({ - noReady: this.data.noReady + 1 - }) - } - }) - // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 - if (this.data.noReady > 0) { - this.confrimPromptDialog() - } else { - // 鍋氬畬浜嗙洿鎺ユ墽琛屾彁浜や簨浠� + if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') { this.submitPaper() + return wx.navigateBack() + } else if (this.properties.answerType == 'option' || this.properties.answerType == 'mock') { + if (this.properties.submitStatus) return wx.navigateBack() + this.properties.questionDataList.forEach(item => { + if (!this.isHaveAnswer(item.userAnswer)) { + this.setData({ + noReady: this.data.noReady + 1 + }) + } + }) + // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 + if (this.data.noReady > 0) { + this.confrimPromptDialog() + } else { + // 鍋氬畬浜嗙洿鎺ユ墽琛屾彁浜や簨浠� + this.submitPaper() + } } + }, // 鎻愪氦浜嬩欢 submitPaper() { -- Gitblit v1.9.1