From ecabd20b3dfbd956dad14ffb6ba3dc2efcfdd7c1 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期一, 25 三月 2024 16:23:32 +0800 Subject: [PATCH] 微信支付 --- packageBookService/pages/bookServices/examination/questionOptions/index.js | 65 +++++++++++++++++++++++--------- 1 files changed, 47 insertions(+), 18 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.js b/packageBookService/pages/bookServices/examination/questionOptions/index.js index 54aed63..1aeb95a 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.js +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.js @@ -44,6 +44,14 @@ submitStatus: { type: Boolean, value: false + }, + mockSumTime: { + type: Number, + value: 0, + }, + isNight: { + type: Boolean, + value: false } }, @@ -56,14 +64,20 @@ questionCardState: false, setUpPopup: false, testReportState: false, - sliderValue: 0, - useTime: '' + sliderValue: 28, + 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')) { @@ -152,16 +166,24 @@ }, // 婊戝潡鍙樺寲 onChangeSlider(e) { - console.log(e); this.setData({ sliderValue: e.detail.value }) + console.log(e.detail.value); }, // 璁剧疆閬僵灞傜偣鍑� onSetUpChange(e) { this.setData({ 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() { @@ -202,24 +224,31 @@ }, // 搴曢儴鎻愪氦鎸夐挳 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 - }) - } + this.setData({ + noReady: 0 }) - // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 - 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