| | |
| | | submitStatus: { |
| | | type: Boolean, |
| | | value: false |
| | | }, |
| | | mockSumTime: { |
| | | type: Number, |
| | | value: 0, |
| | | }, |
| | | isNight: { |
| | | type: Boolean, |
| | | value: false |
| | | } |
| | | }, |
| | | |
| | |
| | | questionCardState: false, |
| | | setUpPopup: false, |
| | | testReportState: false, |
| | | sliderValue: 0, |
| | | useTime: '' |
| | | sliderValue: 10, |
| | | 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')) { |
| | |
| | | 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({ |
| | |
| | | // 底部提交按钮 |
| | | 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() { |