ts
litian
2024-09-27 d780880b7a73360c8fc9fead1b429dd8ba3758e3
packageBookService/pages/bookServices/detail/index.js
@@ -55,6 +55,7 @@
    isShowBuyCloundMenu: false, //   云学习全部购买按钮是否显示
    isCloundHaveSaleMethod: false, // 云学习是否有销售方式 
    cloundMenuIsBuy: false,
    learnTaskData: {},
    rejectCause: "", // 下载拒绝原因
    buyIdList: [],
    shoppingCartGetId: [], // 已购买id列表
@@ -207,7 +208,8 @@
    fileList: [],
    isShowUp: true,
    protocolShow: false,
    protocolTxt: ''
    protocolTxt: '',
    learnMenu: null
  },
  resetTree: function (e) {
@@ -525,8 +527,11 @@
    app.MG.store.getProductDetail(query).then((res) => {
      this.setData({
        resourceCodeList: res.datas.cmsDatas[0].datas,
        learnTaskData: res.datas.cmsDatas[0].datas.filter((item) => item.refCode == 'jsek_learningTasks')[0]
      })
      console.log('refcode', this.data.resourceCodeList);
      if (res.datas.cmsDatas[0].datas.length) this.setData({
        learnMenu: res.datas.cmsDatas[0].datas.find(item => item.refCode == 'jsek_cloudLearning')
      })
    })
  },
  //请求子商品的文件
@@ -1039,9 +1044,9 @@
          new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime()
        ) || (flags && cloundSaleMethod.Price == 0)
        // 判断云学习全部购买按钮是否显示
        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0
        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id)
        // 判断资源购买按钮是否显示
        let isShowBuyCloundBtn = res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0) || type.saleMethod.length
        let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0)
        // 判断购物车按钮和锁按钮是否显示
        this.handleTreeData(list).forEach(item => {
          item.isbuy = this.resourceIsBuy(item);
@@ -2805,7 +2810,7 @@
    app.MG.ugc.newTopicMessage(query).then((res) => {
      wx.showToast({
        icon: "success",
        title: "请上传资源文件",
        title: "上传成功",
      });
      this.closeDialog()
    })
@@ -2820,5 +2825,10 @@
    this.setData({
      cloundMenuIsBuy: flag
    })
  }
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {},
  onShareTimeline() {}
})