闫增涛
2024-03-19 fa662bf36ed8db479b42f912d4705c11511db558
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() {