litian
2025-01-10 61052ffdfbbb93dae84803c5bd966899c2afb684
云学习购买
3个文件已修改
48 ■■■■ 已修改文件
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml
@@ -1,10 +1,6 @@
<!--pages/bookServices/detail/components/learnResource/learnResource.wxml-->
<view
  class="learnResource"
  theme="primary"
  style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};"
>
  <t-button
<view class="learnResource" theme="primary" style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};">
  <!-- <t-button
    wx:if="{{isshowDrawBtn}}"
    loading="{{receive}}"
    class="btn"
@@ -17,42 +13,23 @@
      <image src=" /static/images/bookService/detail/yijianlingqu.png" />
      <text>领取查看</text>
    </view>
  </t-button>
  <t-button
    wx:if="{{isShowBuyCloundBtn}}"
    loading="{{buy}}"
    class="btn"
    theme="primary"
    bind:tap="goBuyResource"
    style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}"
  >
  </t-button> -->
  <t-button wx:if="{{isShowBuyCloundBtn}}" loading="{{buy}}" class="btn" theme="primary" bind:tap="goBuyResource" style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}">
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/yijiangoumai.png" />
      <text>资源购买</text>
    </view>
  </t-button>
  <t-button
    theme="primary"
    class="btn"
    style="height: 72rpx; font-size: 28rpx"
    bind:tap="buyCloudLearnClass"
    wx:if="{{isShowBuyCloundMenu}}"
  >
  <t-button theme="primary" class="btn" style="height: 72rpx; font-size: 28rpx" bind:tap="buyCloudLearnClass" wx:if="{{isShowBuyCloundMenu}}">
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/yijiangoumai.png" />
      <text>全部购买</text>
    </view>
  </t-button>
  <t-button
    class="btn"
    theme="primary"
    style="height: 72rpx; font-size: 28rpx; margin: 0 20rpx"
    bind:tap="goLearnTask"
    wx:if="{{learnTaskData.name}}"
  >
  <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; margin: 0 20rpx" bind:tap="goLearnTask" wx:if="{{learnTaskData.name}}">
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/renwudan/icon.png" />
      <text>学习任务单</text>
    </view>
  </t-button>
</view>
</view>
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -227,7 +227,7 @@
          // 1.2 云学习无销售方式,将父级目录和本身加入数组
          learn = this.handleTreeData(this.properties.learnList).filter(
            (citem) => citem.saleMethod &&
            citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal') &&
            citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal' && ditem.Price > 0) &&
            new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() &&
            new Date(citem.saleMethod.find((ditem) => ditem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() &&
            item.productLinkPath.includes(citem.productLinkPath)
packageBookService/pages/bookServices/detail/index.js
@@ -1044,7 +1044,6 @@
      res.datas.cmsDatas[0].datas.forEach((item) => {
        // 云学习上有销售方式,去掉云学习下所有销售方式
        if (this.data.tabValue == "jsek_teachingResources") {
          if (item.file || item.freeFile) {
            let md5 = item.file ? item.file : item.freeFile
            md5s.push(md5)
@@ -1053,7 +1052,7 @@
            md5List: md5s,
          });
        }
        if (flags) item.saleMethod = []
        if (flags && cloundSaleMethod.Price > 0) item.saleMethod = []
        item.checked = false;
        if (item.sysType == 'CmsItem') {
          // 教学资源 类型名称赋值
@@ -1101,7 +1100,7 @@
          new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime()
        ) || (flags && cloundSaleMethod.Price == 0)
        // 判断云学习全部购买按钮是否显示
        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id)
        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price > 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id)
        // 判断资源购买按钮是否显示
        let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0)
        // 判断购物车按钮和锁按钮是否显示
@@ -1114,7 +1113,7 @@
          isshowDrawBtn,
          isShowBuyCloundMenu,
          isShowBuyCloundBtn,
          isCloundHaveSaleMethod: flags,
          isCloundHaveSaleMethod: flags && cloundSaleMethod.Price > 0,
          learn: list,
          loading: false,
          openLearnids: result,
@@ -1673,7 +1672,7 @@
        (item) => item == saleData.Id
      );
      // 已经购买
      if (isShow) return false
      if (isShow || saleData.Price == 0) return false
      // 未购买,查看销售方式是否过期
      if (!isShow) {
        const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() &&