图书详情页bug修改,我的错题、收藏模式下答题卡添加题目类型,非单选题添加查看解析按钮
24个文件已修改
358 ■■■■ 已修改文件
app.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/suggest/suggest.wxml 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/suggest/suggest.wxss 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/examination.js 199 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/examination.wxml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.js 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.wxml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.wxss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionOptions/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/list/index.js 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/list/index.wxml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/biji-click-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/biji-icon-g.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/ebook-click.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/ebook-g.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/jiaoxueziyuan-click.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/jiaoxueziyuan.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/test-click-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/test-icon-g.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/tushujianjie-click.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/tushujianjie-g.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/yunxuexi-click.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/yunxuexi.png 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -12,8 +12,8 @@
    "pages/personalCenter/index",
    "pages/personalCenter/feedBackSubmit/index",
    "pages/personalCenter/certificate/index",
    "pages/testLogin/index",
    "pages/bookServices/assort/index",
    "pages/testLogin/index",
    "pages/bindInfo/index"
  ],
  "subPackages": [
packageBookService/pages/bookServices/detail/components/suggest/suggest.wxml
@@ -9,23 +9,65 @@
  </view>
</t-dialog> -->
<!-- <view class="suggest"> -->
<t-popup visible="{{showWithInput}}" bind:visible-change="onVisibleChange" placement="center">
<t-popup
  visible="{{showWithInput}}"
  bind:visible-change="onVisibleChange"
  placement="center"
>
  <view class="top-icon">
    <t-image src="/static/images/bookService/detail/feedback.png"></t-image>
  </view>
  <view slot="content" class="content">
    <view class="top-title">我要建议</view>
    <view class="demo-rate">
      <t-rate value="{{ratevalue}}" catch:change="onChangeRate" size="{{30}}" color="#FFB400" />
      <t-rate
        value="{{ratevalue}}"
        catch:change="onChangeRate"
        size="{{30}}"
        color="#FFB400"
      />
    </view>
    <view class="phone-input">
      <t-input clearable value="{{inputvalue}}" slot="content" label="" placeholder="请输入联系方式" placeholder-class="placeholder" bind:change="inputChange" type="number" maxlength="{{11}}" class="phone" style="{{inputStyle}}" />
      <t-input
        clearable
        value="{{inputvalue}}"
        slot="content"
        label=""
        placeholder="请输入联系方式"
        bind:change="inputChange"
        type="number"
        maxlength="{{11}}"
        class="phone"
        style="{{inputStyle}}"
        placeholder-style="{{placeholderstyle}}"
      />
    </view>
    <t-textarea value="{{textvalue}}" t-class="external-class" label="" placeholder="请输入反馈内容" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" />
    <view style="width: 100%">
      <t-textarea
        value="{{textvalue}}"
        t-class="external-class"
        label=""
        placeholder="请输入反馈内容"
        maxcharacter="200"
        disableDefaultPadding="{{true}}"
        indicator
        bind:change="textareaChange"
        style="{{inputStyle}}"
        placeholder-style="{{placeholderstyle}}"
      />
    </view>
  </view>
  <view class="submit-btn">
    <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button>
    <t-button theme="primary" size="large" block bind:tap="confirmSuggest"
      >提交</t-button
    >
  </view>
  <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" />
  <t-icon
    t-class="close-btn"
    name="close-circle"
    size="32"
    color="#fff"
    bind:tap="closeDialog"
  />
</t-popup>
<!-- </view> -->
packageBookService/pages/bookServices/detail/components/suggest/suggest.wxss
@@ -60,6 +60,9 @@
.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 40rpx;
  padding: 100rpx 40rpx 0rpx 40rpx;
  width: 600rpx;
@@ -68,7 +71,7 @@
.demo-rate {
  width: 350rpx;
  margin: 20rpx auto 20rpx auto;
  margin: 20rpx 0;
}
.phone {
@@ -77,6 +80,9 @@
  border-radius: 20rpx;
}
.phone-input {
  width: 100%;
}
.submit-btn {
  padding: 40rpx;
@@ -100,8 +106,15 @@
.top-title {
  width: 160rpx;
  margin: 0 auto;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
}
.t-input__placeholder {
  font-size: 28rpx;
}
.phone-input .t-input__placeholder {
  font-size: 28rpx !important
}
packageBookService/pages/bookServices/examination/examination.js
@@ -253,6 +253,13 @@
      if (flag) this.handleQuestion(index)
    }
  },
  // 我的错题,收藏查看解析按钮
  viewParsing() {
    if (this.data.answerType == 'collectQuestion' || this.data.answerType == 'errorQuestion') {
      const item = this.data.questionDataList[this.data.currentIndex]
      if (!item.isComplete) this.handleQuestion(this.data.currentIndex)
    }
  },
  // 点击答题卡跳转题目
  goQuestion(e) {
    const id = e.detail.id
@@ -387,7 +394,6 @@
  },
  // 提交逻辑
  submitPaper() {
    // 关闭退出页面监听
    wx.disableAlertBeforeUnload()
    this.setData({
@@ -852,7 +858,17 @@
      // 简答 翻译
      questionList[index].isRight = null
    } else if (item.questionType == 'completion') {
      // 填空
      if (item.answer == 'string') {
        item.isRight = item.answer == item.userAnswer[0]
      } else {
        if (item.answer.length != item.userAnswer.length) {
          item.isRight = false
        } else {
          item.isRight = item.answer.every(
            (value, index) => value === item.userAnswer[index]
          )
        }
      }
      // subjectiveGrade.value += item.score
      if (typeof item.answer == 'string') {
        questionList[index].isRight = item.answer == item.userAnswer[0]
@@ -1071,12 +1087,35 @@
  // 获取收藏夹
  async getCollectDataList() {
    let questionArr = []
    // this.setData({
    //   cardList: [{
    //     catalogName: '收藏夹',
    //     infoList: []
    //   }]
    // })
    this.setData({
      cardList: [{
        catalogName: '收藏夹',
        catalogName: '单选题',
        infoList: []
      }, {
        catalogName: '判断题',
        infoList: []
      }, {
        catalogName: '多选题',
        infoList: []
      }, {
        catalogName: '填空题',
        infoList: []
      }, {
        catalogName: '简答题',
        infoList: []
      }]
    })
    let singleChoiceArr = [] // 单选
    let judgeArr = [] // 判断
    let shortArr = [] // 简答
    let multipleChoiceArr = [] // 多选
    let completionArr = [] // 填空
    let query = {
      path: '*',
      cmsPath: this.data.rootCmsItemId,
@@ -1157,25 +1196,61 @@
            if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150)
          })
        }
        // if (item.Embedded_QuestionBank_QuestionType == 'judge') {
        //   topicList.value.judge.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
        //   topicList.value.radio.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'multipleChoice') {
        //   topicList.value.check.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'completion') {
        //   topicList.value.gap.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {
        //   topicList.value.short.data.push(questionObj)
        // }
        questionArr.push(questionObj)
        // cardList.value[0].infoList.push(questionObj)
        // 题干富文本处理
        if (questionObj.stemStyle == 'RichText') {
          // questionObj.option.txt = ''
          questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ').replace(/\<p/gi, '<p class="stem-rich-p"')
        }
        // 选项富文本处理
        if (questionObj.optionStyle == 'RichText' && (questionObj.questionType == 'singleChoice' || questionObj.questionType == 'judge' || questionObj.questionType == 'multipleChoice')) {
          questionObj.option.forEach(item => {
            if (item.txt) item.txt = item.txt.replace(/\<img/gi, '<img class="option-rich-img"').replace(/\<p/gi, '<p class="stem-rich-p"')
      })
      // loadings.value = false
        }
        if (item.Embedded_QuestionBank_QuestionType == 'judge') {
          questionObj.type = '判断题'
          judgeArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
          questionObj.type = '单选题'
          singleChoiceArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'multipleChoice') {
          questionObj.type = '多选题'
          multipleChoiceArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'completion') {
          questionObj.type = '填空题'
          completionArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {
          questionObj.type = '简答题'
          shortArr.push(questionObj)
        }
        // questionArr.push(questionObj)
      })
      // this.setData({
      //   questionDataList: questionArr,
      //   ['cardList[0].infoList']: questionArr,
      //   loading: false,
      // })
      this.setData({
        ['cardList[0].infoList']: singleChoiceArr,
        ['cardList[1].infoList']: judgeArr,
        ['cardList[2].infoList']: multipleChoiceArr,
        ['cardList[3].infoList']: completionArr,
        ['cardList[3].infoList']: shortArr,
      })
      const cardList = this.data.cardList
      for (let index = 0; index < cardList.length; index++) {
        const item = cardList[index];
        for (let cindex = 0; cindex < item.infoList.length; cindex++) {
          const citem = item.infoList[cindex]
          citem.number = cindex + 1
          questionArr.push(citem)
        }
      }
      this.setData({
        questionDataList: questionArr,
        ['cardList[0].infoList']: questionArr,
        loading: false,
        cardList: cardList,
        loading: false
      })
    })
  },
@@ -1217,12 +1292,35 @@
  },
  // 获取错题集
  async getErrorDataList() {
    // this.setData({
    //   cardList: [{
    //     catalogName: '错题集',
    //     infoList: []
    //   }]
    // })
    this.setData({
      cardList: [{
        catalogName: '错题集',
        catalogName: '单选题',
        infoList: []
      }, {
        catalogName: '判断题',
        infoList: []
      }, {
        catalogName: '多选题',
        infoList: []
      }, {
        catalogName: '填空题',
        infoList: []
      }, {
        catalogName: '简答题',
        infoList: []
      }]
    })
    let singleChoiceArr = [] // 单选
    let judgeArr = [] // 判断
    let shortArr = [] // 简答
    let multipleChoiceArr = [] // 多选
    let completionArr = [] // 填空
    let query = {
      path: '*',
      cmsPath: this.data.rootCmsItemId,
@@ -1303,22 +1401,57 @@
            if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150)
          })
        }
        // if (item.Embedded_QuestionBank_QuestionType == 'judge') {
        //   topicList.value.judge.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
        //   topicList.value.radio.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'multipleChoice') {
        //   topicList.value.check.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'completion') {
        //   topicList.value.gap.data.push(questionObj)
        // } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {
        //   topicList.value.short.data.push(questionObj)
        // }
        questionArr.push(questionObj)
        // 题干富文本处理
        if (questionObj.stemStyle == 'RichText') {
          // questionObj.option.txt = ''
          questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ').replace(/\<p/gi, '<p class="stem-rich-p"')
        }
        // 选项富文本处理
        if (questionObj.optionStyle == 'RichText' && (questionObj.questionType == 'singleChoice' || questionObj.questionType == 'judge' || questionObj.questionType == 'multipleChoice')) {
          questionObj.option.forEach(item => {
            if (item.txt) item.txt = item.txt.replace(/\<img/gi, '<img class="option-rich-img"').replace(/\<p/gi, '<p class="stem-rich-p"')
          })
        }
        if (item.Embedded_QuestionBank_QuestionType == 'judge') {
          questionObj.type = '判断题'
          judgeArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
          questionObj.type = '单选题'
          singleChoiceArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'multipleChoice') {
          questionObj.type = '多选题'
          multipleChoiceArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'completion') {
          questionObj.type = '填空题'
          completionArr.push(questionObj)
        } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {
          questionObj.type = '简答题'
          shortArr.push(questionObj)
        }
        // questionArr.push(questionObj)
      })
      this.setData({
        // questionDataList: questionArr,
        ['cardList[0].infoList']: singleChoiceArr,
        ['cardList[1].infoList']: judgeArr,
        ['cardList[2].infoList']: multipleChoiceArr,
        ['cardList[3].infoList']: completionArr,
        ['cardList[3].infoList']: shortArr,
        // loading: false
      })
      const cardList = this.data.cardList
      for (let index = 0; index < cardList.length; index++) {
        const item = cardList[index];
        for (let cindex = 0; cindex < item.infoList.length; cindex++) {
          const citem = item.infoList[cindex]
          citem.number = cindex + 1
          questionArr.push(citem)
        }
      }
      this.setData({
        questionDataList: questionArr,
        ['cardList[0].infoList']: questionArr,
        cardList: cardList,
        loading: false
      })
    })
packageBookService/pages/bookServices/examination/examination.wxml
@@ -54,6 +54,7 @@
    bind:onChangeRadio="onChangeRadio"
    bind:onChangeInput="onChangeInput"
    bind:changeSwiper="changeSwiper"
    bind:viewParsing="viewParsing"
  ></question-list>
  <view class="lodaing-box" wx:if="{{loading}}">
    <t-loading
packageBookService/pages/bookServices/examination/questionList/index.js
@@ -48,7 +48,9 @@
    duration: 500,
    interval: 5000,
    paginationPosition: 'bottom-right',
    navigation: { type: 'fraction' },
    navigation: {
      type: 'fraction'
    },
    showIndex: 0,
  },
@@ -63,11 +65,11 @@
      })
      var myEventDetail = {
        index: e.detail.current
      } // detail对象,提供给事件监听函数
      }
      var myEventOption = {
        bubbles: true,
        composed: true,
      } // 触发事件的选项
      }
      this.triggerEvent('changeSwiper', myEventDetail, myEventOption)
    },
    // 单选  富文本框输入  触发
@@ -103,5 +105,14 @@
      } // 触发事件的选项
      this.triggerEvent('onChangeInput', myEventDetail, myEventOption)
    },
    // 我的错题,收藏查看解析按钮
    viewParsing() {
      var myEventDetail = {}
      var myEventOption = {
        bubbles: true,
        composed: true,
      }
      this.triggerEvent('viewParsing', myEventDetail, myEventOption)
    }
  }
})
packageBookService/pages/bookServices/examination/questionList/index.json
@@ -11,6 +11,7 @@
    "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
    "t-textarea": "tdesign-miniprogram/textarea/textarea",
    "t-empty": "tdesign-miniprogram/empty/empty",
    "t-button": "tdesign-miniprogram/button/button",
    "mp-html": "mp-html"
  }
}
packageBookService/pages/bookServices/examination/questionList/index.wxml
@@ -10,7 +10,10 @@
    style="background-color:{{isNight ? '#222' : '#fff'}}"
  >
    <text class="title-name">{{questionList[showIndex].type}}</text
    ><text class="title-score" style="color: {{isNight ? '#fff' : '#000'}};"
    ><text
      wx:if="{{questionList[showIndex].score}}"
      class="title-score"
      style="color: {{isNight ? '#fff' : '#000'}};"
      >(每题{{questionList[showIndex].score}}分)</text
    >
  </view>
@@ -246,7 +249,9 @@
      <view
        wx:if="{{(answerType == 'collectQuestion' || answerType ==  'errorQuestion') && (item.questionType == 'multipleChoice' || item.questionType ==  'completion' || item.questionType == 'shortAnswer')}}"
      >
        查看解析
        <t-button theme="primary" class="view-parsing" bind:tap="viewParsing"
          >查看解析</t-button
        >
      </view>
      <!-- 单选、多选解析 -->
      <view
packageBookService/pages/bookServices/examination/questionList/index.wxss
@@ -255,3 +255,12 @@
  display: inline-block;
  width: calc(100% - 25px);
}
.view-parsing {
  margin-top: 40rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-color: #ff6c00;
  --td-button-primary-active-bg-color: #fff0e6;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-border-color: #ff6c00;
}
packageBookService/pages/bookServices/examination/questionOptions/index.wxml
@@ -79,7 +79,7 @@
    <view class="question-card-list">
      <view wx:for="{{cardList}}" wx:key="index" class="card-box">
        <!-- 题型 -->
        <view class="question-title">
        <view class="question-title" wx:if="{{item.infoList.length}}">
          <text class="color-box"></text>
          <text class="title-text">{{item.catalogName}}</text>
        </view>
packageBookService/pages/bookServices/list/index.js
@@ -38,6 +38,29 @@
      value: [],
      options: [],
    },
    sortList: {
      value: '',
      options: [{
          value: '',
          label: '综合排序',
        }, {
          value: '1',
          label: '名称正序'
        },
        {
          value: '2',
          label: '名称倒叙'
        },
        {
          value: '3',
          label: '出版时间正序'
        },
        {
          value: '3',
          label: '出版时间倒叙'
        }
      ],
    },
    newTextBook: {
      value: [],
      options: [],
@@ -469,6 +492,12 @@
    });
    this.getBookList(this.data.path);
  },
  // 排序切换
  onSortChange(e) {
    this.setData({
      'sortList.value': e.detail.value
    })
  },
  changeNewText(e) {
    this.setData({
      'newTextBook.value': e.detail.value,
packageBookService/pages/bookServices/list/index.wxml
@@ -67,7 +67,6 @@
      </view>
      <view class="header-sort" bind:tap="sortClick">
        <text class="sort-name">排序</text>
        <!-- <view class="sort-icon"> -->
        <t-icon
          name="swap-left"
          size="28rpx"
@@ -80,17 +79,16 @@
          class="icon-left"
          color="{{sort == 'Desc' ? '#ff6c00' : ''}}"
        />
        <!-- </view> -->
        <!-- <t-dropdown-menu>
          <t-dropdown-item
            label="排序"
            options="{{sortList.options}}"
            value="{{sortList.value}}"
            bindchange="onSortChange"
          />
        </t-dropdown-menu> -->
      </view>
    </view>
    <!-- <t-pull-down-refresh
      value="{{enable}}"
      loadingProps="{{loadingProps}}"
      loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}"
      bind:refresh="onRefresh"
      class="down-refresh"
    >
    </t-pull-down-refresh> -->
    <scroll-view
      scroll-y="{{true}}"
      refresher-enabled="{{true}}"
static/images/bookService/detail/biji-click-icon.png

static/images/bookService/detail/biji-icon-g.png

static/images/bookService/detail/ebook-click.png

static/images/bookService/detail/ebook-g.png

static/images/bookService/detail/jiaoxueziyuan-click.png

static/images/bookService/detail/jiaoxueziyuan.png

static/images/bookService/detail/test-click-icon.png

static/images/bookService/detail/test-icon-g.png

static/images/bookService/detail/tushujianjie-click.png

static/images/bookService/detail/tushujianjie-g.png

static/images/bookService/detail/yunxuexi-click.png

static/images/bookService/detail/yunxuexi.png