闫增涛
2024-09-19 d7e794685c439cb820259813b5e826a0ea218914
packageBookService/pages/bookServices/detail/index.js
@@ -949,7 +949,6 @@
    let query = {
      path: '*',
      queryType: '*',
      // storeInfo: this.data.options.storeInfo,
      productId: this.data.bookDetail.id,
      cmsPath: type.productLinkPath,
      cmsType: '*',
@@ -962,10 +961,9 @@
        file: [],
        protectedFile: [],
        resourcesClassification: [],
        isDownload: [],
        // isDownload: [],
        jsek_resourceBrief: [],
        jsek_link: [],
        jsek_questionBank: []
      },
      pading: {
        start: 0,
@@ -973,7 +971,6 @@
      },
    }
    app.MG.store.getProductDetailNoChildren(query).then((res) => {
      console.log('未处理资源', res.datas.cmsDatas[0].datas);
      if (!res.datas.cmsDatas[0].datas.length) {
        return this.setData({
          noResources: true,
@@ -1836,6 +1833,32 @@
      });
    }
  },
  // 云学习全部购买
  async buyCloudLearnClass() {
    const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning')
    debugger
    let query = {
      remarks: '云学习',
      requests: [{
        saleMethodId: cloundMenu.saleMethod.find((eitem) => eitem.SaleType == 'Normal').Id,
        count: 1
      }]
    }
    const initOrderRes = await app.MG.store.initOrder(query)
    // 检查订单号是否存在
    if (initOrderRes.orderNumber) {
      // bookService: orderNumber.value,  少传这个 ,暂时不知道有什么用
      wx.navigateTo({
        url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNumber=${initOrderRes.orderNumber}`,
      });
    } else {
      // 订单号不存在,显示警告消息
      wx.showToast({
        icon: "error",
        title: "请重试",
      });
    }
  },
  // 云学习字段购买
  async buyCloundMenu() {
    const cloundData = this.data.resourceCodeList.find(item => item.refCode == 'jsek_cloudLearning')
@@ -2544,6 +2567,11 @@
    return childrenList
  },
  uploadFile(e) {
    const userInfo = JSON.parse(wx.getStorageSync(app.config.userInfoKey))
    if (userInfo.role != 'Teacher') return wx.showToast({
      icon: 'error',
      title: '请先进行教师认证',
    })
    this.setData({
      dialogBox: true,
      isShowUp: true