111
QYF-GitLab1
2025-01-03 2ee8ddb1ecac7df4198e54e08ec7f22daf4b07c0
packageBookService/pages/bookServices/examination/examination.js
@@ -628,8 +628,42 @@
      showDialog: false,
    });
  },
  // 初始化函数
  async init() {
    // 获取图书详情,判断题库是否购买
    const query = {
      path: "*",
      queryType: "*",
      productId: this.data.bookId,
      favoriteTypes: "FavoriteBookCity",
      itemFields: {
        "SysType=": "CmsFolder",
      },
      coverSize: {
        height: 300,
      },
      fields: {},
    };
    const res = await app.MG.store.getProductDetail(query)
    const saleData = res.datas.saleMethod.find(item => item.Name.includes('题库'))
    if (saleData && !res.datas.purchasedSaleMethodIdList.includes(saleData.Id)) return wx.showModal({
      title: '提示',
      content: '请先购买题库再答题',
      confirmColor: "#ff6c00",
      cancelColor: "#949494",
      editable: false, //是否显示输入框
      showCancel: false,
      complete: () => {
        this.setData({
          submitStatus: true
        })
        wx.setStorageSync('tabValue', 'questionBank')
        wx.redirectTo({
          url: `/packageBookService/pages/bookServices/detail/index?id=${res.datas.id}&name=${res.datas.name}`,
        })
      }
    })
    this.setData({
      loading: true,
      subjectiveTotal: 0,
@@ -2460,7 +2494,7 @@
      // 做完了且加入了班级,提交到message
      if (this.data.classList.length && this.data.joinGroup) {
        this.data.classList.forEach(item => {
          if (item.linkProductDto.product.id == this.data.bookId)
          if (item.linkProductDto.product.id == this.data.bookId && item.topicId)
            this.newTopicMessage(item.topicId)
        })
        this.setinteractionInfo()
@@ -2501,7 +2535,7 @@
          path: this.data.productLinkPath,
          content
        }),
        type: 'Normal',
        type: 'Public',
        cmsTypeRefCode: '',
        newDataListRequest: []
      }