闫增涛
2024-04-03 34dd2d10cf26c86ed170a59aa36718f7c27f24d0
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -42,6 +42,9 @@
          }
        })
      }
      wx.showLoading({
        title: '加载中',
      })
      // 获取章节下是否有题目
      let idPathList = []
      let query = {
@@ -55,6 +58,7 @@
        }
      }
      if (value.childrenFolderCount == 0) {
        wx.hideLoading()
        return wx.showToast({
          icon: "error",
          title: '暂无数据',
@@ -70,16 +74,7 @@
          })
        })
      }
      // query: {
      //   title: bookData.value.test,
      //   bookId: route.query.bookId,
      //   productLinkPath: data.productLinkPath,
      //   answerTitle: data.name,
      //   answerType: 'option',
      //   rootCmsItemId: bookData.value.rootCmsItemId,
      //   idPathList: JSON.stringify(idPathList)
      // }
      wx.hideLoading()
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&productLinkPath=${value.productLinkPath}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&idPathList=${JSON.stringify(idPathList)}&answerTitle=${value.name}&answerType=${'option'}`,
      })
@@ -106,6 +101,9 @@
      })
    },
    async getMockId() {
      wx.showLoading({
        title: '加载中'
      })
      let id
      let query = {
        start: 0,
@@ -124,10 +122,20 @@
      //   return logIn()
      // }
      const mockid = await this.getMockId()
      wx.hideLoading()
      const item = e.currentTarget.dataset.item
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${item.name}&answerType=${'mock'}&uuid=${item.id}&mockid=${mockid}`,
      })
    },
    // 购买组卷
    buyMock() {
      var myEventDetail = {}
      var myEventOption = {
        bubbles: true,
        composed: true
      }
      this.triggerEvent('buyMock', myEventDetail, myEventOption)
    }
  }
})