闫增涛
2024-04-30 dc934dfd63fecff84d0bf996418e041b9bd4ea59
packageBookService/pages/bookServices/detail/index.js
@@ -37,6 +37,8 @@
    openTeachids: [],
    openLearnids: [],
    openTestids: [],
    isGoBuyResource: true,
    learnPath: '',
    applyResourceState: false, // 申请教学资源按钮防抖
    resourceClassList: [], // 资源所属分类
    applyState: "", // 教学资源申请状态
@@ -746,7 +748,7 @@
    return num
  },
  // 给·目录添加子项数量
  // 给目录添加子项数量
  changeResourceChildren(list) {
    const changeList = (list) => {
      for (let index = 0; index < list.length; index++) {
@@ -900,6 +902,22 @@
            }
          }
        });
        if (type.refCode == "jsek_cloudLearning") {
          this.setData({
            learnPath: type.productLinkPath
          })
          const dataList = res.datas.cmsDatas[0].datas
          if (dataList.length) {
            const tag = dataList.findIndex(item => this.isShowNeedBuy(item))
            this.setData({
              isGoBuyResource: tag > -1 ? true : false
            })
          } else {
            this.setData({
              isGoBuyResource: false
            })
          }
        }
        const num = query.cmsPath.length + 6
        this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\')
        list = this.ensureTreeConsistency(list)
@@ -1686,19 +1704,19 @@
        };
        // 确认订单
        const confirmOrderRes = await app.MG.store.confirmOrder(parameter);
        console.log(confirmOrderRes.orderNumber, 'confirmOrderRes.orderNumber');
        if (confirmOrderRes.orderNumber) {
          child.changeReceive(false);
          wx.showToast({
            title: "领取成功",
          });
          this.getBookInfo(this.data.bookId);
          this.getResourceDataList({
            refCode: 'jsek_cloudLearning',
            productLinkPath: this.data.learnPath
          })
          this.setData({
            successOrderNumber: confirmOrderRes.orderNumber
          })
        }
      } catch (error) {
        console.log(error);
@@ -2026,7 +2044,6 @@
        this.data.bookDetail.id,
    });
    debugger
  },
  //样书申请
@@ -2093,7 +2110,7 @@
        const smBook = list.find(item => item.content[0].id == this.data.bookDetail.id)
        console.log('已申请', smBook);
        if (smBook && smBook.state == 'Normal') {
          const flag = new Date(JSON.parse(smBook.feedBack).endDate + '23:59:59').getTime() > new Date().getTime()
          const flag = new Date(smBook.feedBack.endDate + '23:59:59').getTime() > new Date().getTime()
          if (flag) {
            this.setData({
              applicationState: 'Normal'
@@ -2203,7 +2220,7 @@
            });
            return false;
          } else if (isApply.state == 'Normal') {
            const flag = new Date(JSON.parse(isApply.feedBack).endDate + '23:59:59').getTime() > new Date().getTime()
            const flag = new Date(isApply.feedBack.endDate + '23:59:59').getTime() > new Date().getTime()
            if (flag) {
              wx.showToast({
                title: "该书已申请!",