闫增涛
2025-05-06 d7b7435558c15789e9a2c650389cd28ce88d443b
资源查看判断是否购买
18个文件已修改
737 ■■■■ 已修改文件
packageBookService/pages/bookServices/detail/components/note/note.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/suggestDialog/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/suggestDialog/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/suggestDialog/index.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/document/index.js 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/document/index.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/document/index.wxml 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/document/index.wxss 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myAudio/index.js 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myAudio/index.wxml 213 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myAudio/index.wxss 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myVideo/index.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myVideo/index.wxml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myVideo/index.wxss 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/note/note.js
@@ -66,12 +66,21 @@
      });
    },
    openDialog() {
      loginInfo(app, (data) => {})
      if (data)
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        this.setData({
          submitTitle: this.properties.bookInfo.name,
          showNoteDialog: true,
        });
      } else {
        loginInfo(app, (data) => {
          if (data)
            this.setData({
              submitTitle: this.properties.bookInfo.name,
              showNoteDialog: true,
            });
        })
      }
    },
    closeDialog() {
      this.setData({
packageBookService/pages/bookServices/detail/components/suggestDialog/index.js
@@ -36,6 +36,7 @@
   */
  data: {
    inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;',
    textareaStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;height:240rpx',
    showIndex: null, //打开弹窗的对应下标
    height: '', //屏幕高度
    inputvalue: '',
packageBookService/pages/bookServices/detail/components/suggestDialog/index.wxml
@@ -2,7 +2,7 @@
<view class="popup-box" wx:if="{{showIndex=='1'}}" bindtap="closePopup"></view>
<view
  class="info-center"
  style="top:{{height*0.3}}px"
  style="top:{{height*0.1}}px"
  wx:if="{{showIndex=='1'}}"
>
  <view class="top-icon">
@@ -52,7 +52,7 @@
          disableDefaultPadding="{{true}}"
          indicator
          bind:change="textareaChange"
          style="{{inputStyle}}"
          style="{{textareaStyle}}"
          placeholder-style="{{placeholderstyle}}"
        />
      </view>
packageBookService/pages/bookServices/detail/components/suggestDialog/index.wxss
@@ -142,7 +142,7 @@
.popup-content {
  width: 100%;
  height: 680rpx;
  height: 550rpx;
  display: flex;
  flex-direction: column;
}
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -59,6 +59,12 @@
    },
    isCloundHaveSaleMethod: {
      type: Boolean
    },
    activeId: {
      type: String
    },
    source: {
      type: String
    }
  },
  data: {
@@ -71,7 +77,27 @@
    canExecute: true,
    purchaseList: []
  },
  ready() {},
  ready() {
    var query = this.createSelectorQuery()
    const that = this
    try {
      if (this.data.activeId)
        setTimeout(() => {
          query.select('.cms-' + this.data.activeId).boundingClientRect(function (res) {
            if (res && res.top > 0) {
              var myEventDetail = {
                top: res.top
              };
              var myEventOption = {
                bubbles: true,
                composed: true,
              };
              that.triggerEvent("handleScrollTop", myEventDetail, myEventOption);
            }
          }).exec()
        }, 500)
    } catch (err) {}
  },
  onLoad() {},
  observers: {
    treeList: function (newValue) {
packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -8,7 +8,7 @@
      wx:if="{{item.sysType== 'CmsItem' }}"
    >
      <view
        class="listItems"
        class="listItems {{'cms-' + item.id}}"
        wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}"
      >
        <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}">
@@ -136,7 +136,7 @@
      value="{{item.id}}"
      wx:if="{{item.sysType == 'CmsFolder' }}"
    >
      <view slot="header" class="header-title">
      <view slot="header" class=" {{'cms-' + item.id}}  header-title">
        <view class="title-checkBox" catchtap="catchTap">
          <t-checkbox
            style="align-items: center"
@@ -183,7 +183,7 @@
      >
        <!-- // 判断 无子项 且为商品item 直接显示 -->
        <view
          class="listItems"
          class="listItems {{'cms-' + citem.id}}"
          wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"
        >
          <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}">
@@ -314,6 +314,7 @@
          buyIds="{{buyIds}}"
          openIds="{{openIds}}"
          learnMenu="{{learnMenu}}"
          activeId="{{activeId}}"
          isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}"
        ></tree>
      </view>
packageBookService/pages/bookServices/detail/index.js
@@ -212,9 +212,19 @@
    protocolTxt: '',
    learnMenu: null,
    md5List: [],
    editDialog: false
    editDialog: false,
    scrollTop: 0, // 扫码进资源滚动
    source: '',
    activeId: '',
    qrTabValue: ''
  },
  // 扫码到资源列表,滚动到该资源位置
  handleScrollTop(e) {
    if (this.data.tabValue == this.data.qrTabValue)
      this.setData({
        scrollTop: e.detail.top
      })
  },
  resetTree: function (e) {
    this.setData({
      currentCheck: e.detail.checkedItem,
@@ -258,7 +268,11 @@
        name: decodeURI(options.name),
        storeInfo: options.storeInfo,
      },
      source: options.source,
      activeId: options.resourceId,
      qrTabValue: options.tabValue
    });
    console.log('传参', this.data);
    wx.setNavigationBarTitle({
      title: decodeURI(options.name),
    })
@@ -1086,7 +1100,11 @@
      }
      let result = [];
      if (type.refCode == "jsek_teachingResources") {
        this.findChildIds(list, result);
        if (this.data.activeId) {
          result = this.findChildIdsByCode(res.datas.cmsDatas[0].datas)
        } else {
          this.findChildIds(list, result);
        }
        this.setData({
          openTeachids: result,
          loading: false,
@@ -1105,14 +1123,21 @@
        ) || (flags && cloundSaleMethod.Price == 0)
        // 判断云学习全部购买按钮是否显示
        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)
        // 判断资源购买按钮是否显示 (云学习无销售方式,资源和目录中有销售方式,且售价大于0)
        let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(item => item.saleMethod.length &&
          item.saleMethod.find((citem) => citem.SaleType == 'Normal').Price > 0 &&
          new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() &&
          new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime())
        // 判断购物车按钮和锁按钮是否显示
        this.handleTreeData(list).forEach(item => {
          item.isbuy = this.resourceIsBuy(item);
          item.isShopCar = this.isShoppingCart(item);
        })
        this.findChildIds(list, result);
        if (this.data.activeId) {
          result = this.findChildIdsByCode(res.datas.cmsDatas[0].datas)
        } else {
          this.findChildIds(list, result);
        }
        this.setData({
          isshowDrawBtn,
          isShowBuyCloundMenu,
@@ -1124,7 +1149,7 @@
          learnPath: type.productLinkPath
        });
      }
      console.log('1', this.data.teach);
      console.log('1', result);
    })
  },
  //  获取 云测试
@@ -1275,6 +1300,17 @@
      }
  },
  // 获取目录扫码展开项
  findChildIdsByCode(list) {
    let arr = []
    const data = list.find(item => item.id == this.data.activeId)
    if (data) {
      const ids = data.productLinkInfo.find(item => item.CmsItemId == data.id).LinkPath.split('\\')
      arr = [data.id, ...ids].map(item => Number(item))
    }
    return arr
  },
  // 图书添加购物车
  addBookShopcCar() {
    const addFun = async () => {
packageBookService/pages/bookServices/detail/index.wxml
@@ -16,6 +16,8 @@
      scroll-y="{{true}}"
      class="book"
      bindscrolltolower="onReachBottom"
      scroll-with-animation="{{true}}"
      scroll-top="{{scrollTop}}"
    >
      <!-- 图书详情 -->
      <view class="book-box">
@@ -195,13 +197,7 @@
              <empty />
            </view>
          </t-tab-panel>
          <!-- <t-tab-panel
          label="电子书"
          icon="{{tabValue == 'jsek_eBook' ? eBookClickIcon : eBookIcon}}"
          value="jsek_eBook"
          style="{{tabPanelstyle}}"
        >
        </t-tab-panel> -->
          <t-tab-panel
            label="教学资源"
            icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}"
@@ -229,9 +225,12 @@
                bind:downloadTeach="downloadTeach"
                bind:handleTree="handleTree"
                openTeachids="{{openTeachids}}"
                source="{{source}}"
                activeId="{{activeId}}"
                wx:if="{{teach.length}}"
                isShoppingCart="isShoppingCart"
                bind:updateCloudLearning="updateCloudLearning"
                bind:handleScrollTop="handleScrollTop"
              ></tree>
            </view>
            <view wx:if="{{loading}}" style="width: 100%; height: min-content">
@@ -280,9 +279,12 @@
                cloundMenuIsBuy="{{cloundMenuIsBuy}}"
                learnMenu="{{learnMenu}}"
                isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}"
                source="{{source}}"
                activeId="{{activeId}}"
                bind:updateShoppingCartHidden="updateShoppingCartHidden"
                bind:updateCloudLearning="updateCloudLearning"
                bind:getCloundIsBuy="getCloundIsBuy"
                bind:handleScrollTop="handleScrollTop"
              ></tree>
            </view>
            <view wx:if="{{noResources && !loading}}" class="noData">
packageDomain/pages/resourceDetails/document/index.js
@@ -55,7 +55,13 @@
    learnTimeList: [],
    learnTimeData: 0,
    threeLeveData: [],
    selectTypeData: ''
    selectTypeData: '',
    promptVisable: false,
    showMd5: '',
    confirmBtn: {
      content: '确定',
      variant: 'base',
    },
  },
  /**
   * 生命周期函数--监听页面加载
@@ -385,12 +391,10 @@
      })
      if (this.data.source == 'qrcode') {
        let qrData = this.data.threeLeveData.find(ditem => ditem.id == this.data.activeId)
        if (qrData && this.data.isLearnDataBuy) {
          if (qrData) {
            this.setData({
              threeLeveData: [qrData]
            })
          }
        if (qrData && this.cmsItemIsBuy(qrData)) {
          this.setData({
            threeLeveData: [qrData]
          })
        } else {
          this.setData({
            threeLeveData: []
@@ -500,7 +504,8 @@
    let that = this
    //图片
    if (item.selectType == 'picture' || item.learnSelectType == 'picture') {
      let file = item.file ? item.file : item.protectedFile ? item.protectedFile : item.freeFile
      const isBuy = this.cmsItemIsBuy(item)
      let file = isBuy ? item.protectedFile || item.file : item.freeFile
      this.setData({
        showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + file,
      })
@@ -520,21 +525,14 @@
      })
      wx.hideLoading();
    }
    // if (item.selectType == 'pdf') {
    //   console.log('pdf', item);
    //   wx.hideLoading()
    //   let md5 = item.file ? item.file : item.freeFile
    //   let pdfSrc = app.config.pdfUrl + "?MD5=" + md5 + "&url=" + app.config.requestCtx + '&currentPage=' + "1" + "&isPreview=" + false + "&warterMark=" + "北京师范大学出版社" + "&previewPages=" + 30 + "&token=" + wx.getStorageSync(app.config.tokenKey)
    //   this.setData({
    //     pdfSrc: pdfSrc
    //   })
    // }
    //文档等
    if (item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') {
      let md5 = item.file ? item.file : item.protectedFile ? item.protectedFile : item.freeFile
      const isBuy = this.cmsItemIsBuy(item)
      let md5 = isBuy ? item.protectedFile || item.file || item.freeFile : item.freeFile
      if (item.fileMap[md5]?.extension == 'xlsx' || item.fileMap[md5]?.extension == 'xls') {
        this.setData({
          selectTypeData: 'excel'
          selectTypeData: 'excel',
          showMd5: md5,
        })
        wx.request({
          url: app.config.requestCtx + '/file/api/ApiDownload?md5=' + md5,
@@ -625,56 +623,45 @@
      urls: urls // 需要预览的图片http链接列表
    })
  },
  // myTouchStart(e) {
  //   //---------------------记录缩放事件信息---------------------
  //   // 当两根手指放上去的时候,将距离(distance)初始化。
  //   let xMove = e.touches[1].clientX - e.touches[0].clientX;
  //   let yMove = e.touches[1].clientY - e.touches[0].clientY;
  //   //计算开始触发两个手指坐标的距离
  //   const distance = Math.sqrt(xMove * xMove + yMove * yMove);
  //   this.setData({
  //     distance: distance
  //   })
  //   //---------------------记录缩放事件信息end---------------------
  // },
  // myTouchMove(e) {
  //   // ----------------监听手势缩小放大事件----------------
  //   // 单手指缩放不做任何操作
  //   if (e.touches.length != 1) {
  //     //双手指运动 x移动后的坐标和y移动后的坐标
  //     let xMove = e.touches[1].clientX - e.touches[0].clientX;
  //     let yMove = e.touches[1].clientY - e.touches[0].clientY;
  //     //双手指运动新的 ditance
  //     let newDistance = Math.sqrt(xMove * xMove + yMove * yMove);
  //     //计算移动的过程中实际移动了多少的距离
  //     let distanceDiff = newDistance - this.data.distance;
  //     // newScale = scale + 0.005 * distanceDiff
  //     console.log('移动距离', distanceDiff);
  //     this.setData({
  //       newScale: this.data.newScale + 0.005 * distanceDiff
  //     })
  //     // 打开缩放监听
  //     // zoomFlag = true
  //     this.setData({
  //       lzoomFlag: true
  //     })
  //     return
  //   }
  //   // ----------------监听手势缩小放大事件end----------------
  // },
  // myTouchEnd() {
  //   if (this.data.lzoomFlag) {
  //     if (this.data.newScale > 1.3) {
  //       console.log("放大了", this.data.newScale);
  //     } else if (this.data.newScale < 0.7, this.data.newScale) {
  //       console.log("缩小了");
  //     }
  //     // 关闭缩放监听
  //     // zoomFlag = false
  //     this.setData({
  //       lzoomFlag: false
  //     })
  //   }
  // },
  // 判断当前点击的数据是否购买
  cmsItemIsBuy(item) {
    let flag = false
    // 买了
    if (this.data.buyList.length) {
      if (this.data.buyList.some(citem => item.productLinkPath.includes(citem.productLinkPath)))
        flag = true
    } else {
      // 没买且无销售方式
      if (!item.saleMethod.length) {
        flag = true
      } else {
        // 没买且销售方式过期//没买,销售方式价格为0
        const itemSaleMethod = item.saleMethod.find(citem => citem.SaleType == 'Normal')
        if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime() || itemSaleMethod.Price == 0) flag = true
      }
    }
    return flag
  },
  //
  scrolltolower(e) {
    const activeData = this.data.threeLeveData.find(item => item.id == this.data.activeId)
    const flag = this.data.naturalResources.some(item => item.includes(activeData.freeFile))
    if ((this.data.showMd5 == activeData.freeFile || flag) && activeData.protectedFile)
      this.setData({
        promptVisable: true
      })
  },
  // 提示弹窗关闭
  closePromapDialog() {
    this.setData({
      promptVisable: false
    })
    if (this.data.source == 'qrcode') {
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
      });
    } else {
      wx.navigateBack()
    }
  }
})
packageDomain/pages/resourceDetails/document/index.json
@@ -5,6 +5,7 @@
    "t-button": "tdesign-miniprogram/button/button",
    "t-image": "tdesign-miniprogram/image/image",
    "t-toast": "tdesign-miniprogram/toast/toast",
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-image-viewer": "tdesign-miniprogram/image-viewer/image-viewer"
  }
}
packageDomain/pages/resourceDetails/document/index.wxml
@@ -1,19 +1,13 @@
<!-- <view style="width: 100%; height: {{barHeight}}px; "></view>
<view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;">
  <view>
    <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
  </view>
  <view class="navbar-title">资源详情</view>
</view>
-->
<view class="titleNameBox" wx:if="{{selectType != 'webpage' && learnSelectType != 'webpage'}}">
<view
  class="titleNameBox"
  wx:if="{{selectType != 'webpage' && learnSelectType != 'webpage'}}"
>
  {{titleName}}
</view>
<!-- bind:tap="onClick" -->
<view class="pictureBox" wx:if="{{selectType == 'picture' || learnSelectType == 'picture'}}">
  <!-- style="width: {{(newScale <= 5 ? newScale: 5) * 100}}%;" -->
<view
  class="pictureBox"
  wx:if="{{selectType == 'picture' || learnSelectType == 'picture'}}"
>
  <image
    src="{{showData}}"
    mode="widthFix"
@@ -34,20 +28,34 @@
  </view>
</view>
<view wx:if="{{(selectType == 'document' || learnSelectType == 'document') && selectTypeData == 'excel'}}" class="excelBox">
  <!-- <rich-text nodes="{{webpageSrc}}" ></rich-text> -->
  <view wx:for="{{naturalResources}}"
<view
  wx:if="{{(selectType == 'document' || learnSelectType == 'document') && selectTypeData == 'excel'}}"
  class="excelBox"
>
  <view
    wx:for="{{naturalResources}}"
    wx:key="key"
    wx:for-item="item"
    wx:for-index="index"
    class="textBox"
  >
    <view
      class="textWidth"
      wx:for="{{item}}"
      wx:key="key1"
      wx:for-index="index1"
      wx:for-item="item1"
      >{{item1}}</view
    >
    <view class="textWidth" wx:for="{{item}}" wx:key="key1" wx:for-index="index1" wx:for-item="item1" >{{item1}}</view>
  </view>
</view>
<view wx:if="{{(selectType == 'pdf' ||  selectType == 'document' || learnSelectType == 'pdf' ||  learnSelectType == 'document') && selectTypeData != 'excel'}}">
<scroll-view
  wx:if="{{(selectType == 'pdf' ||  selectType == 'document' || learnSelectType == 'pdf' ||  learnSelectType == 'document') && selectTypeData != 'excel'}}"
  scroll-y="{{true}}"
  bindscrolltolower="scrolltolower"
  class="scrollBox"
>
  <view
    wx:for="{{naturalResources}}"
    wx:key="index"
@@ -66,11 +74,12 @@
    <view class="divider">第 {{index + 1}} 页</view>
  </view>
  <!-- <web-view src="{{pdfSrc}}" id="web-view-pdf" /> -->
</view>
</scroll-view>
<web-view wx:if="{{selectType == 'webpage' || learnSelectType == 'webpage'}}" src="{{webpageSrc}}"></web-view>
<web-view
  wx:if="{{selectType == 'webpage' || learnSelectType == 'webpage'}}"
  src="{{webpageSrc}}"
></web-view>
<!-- <button bind:tap="handleTap">点位</button> -->
<!-- <t-button theme="primary" size="large" variant="outline" block>基础图片预览</t-button> -->
@@ -86,3 +95,12 @@
  bind:delete="onDelete"
  bind:close="onClose"
></t-image-viewer>
<t-dialog
  class="prompDialog"
  visible="{{promptVisable}}"
  title="提示"
  content="试看结束,请购买正式资源"
  confirm-btn="{{ confirmBtn }}"
  bind:confirm="closePromapDialog"
/>
packageDomain/pages/resourceDetails/document/index.wxss
@@ -63,10 +63,7 @@
  height: 100%;
}
.pictureBox image {
  /* width: 100%;
  height: auto; */
}
.download-btn {
  width: 100%;
@@ -125,4 +122,19 @@
.textWidth {
  text-align: center;
  flex: 1;
}
.scrollBox {
  height: calc(100vh - env(safe-area-inset-bottom) - 60px);
}
.prompDialog {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.prompDialog .t-dialog__header {
  margin-top: 30rpx;
}
packageDomain/pages/resourceDetails/myAudio/index.js
@@ -63,6 +63,11 @@
    learnTimeList: [],
    learnTimeData: 0,
    toView: 'activeName',
    promptVisable: false,
    confirmBtn: {
      content: '确定',
      variant: 'base',
    },
  },
  format(time) {
@@ -139,6 +144,13 @@
  onShow() {
    this.setData({
      startTime: Date.now()
    })
    myAudio.onEnded((e) => {
      const data = this.data.threeLeveData.find(item => item.id == this.data.activeId)
      if (data.freeFile && this.data.showData.includes(data.freeFile) && data.protectedFile)
        this.setData({
          promptVisable: true
        })
    })
  },
@@ -296,7 +308,6 @@
      const buyList = res.datas.cmsDatas[0].datas.filter(item => item.saleMethod.length && this.data.buyIdList.includes(item.saleMethod.find(citem => citem.SaleType == 'Normal').Id))
      if (this.data.learnClassData && this.data.learnClassData.saleMethod.length) {
        const learnSaleMethod = this.data.learnClassData.saleMethod.find(citem => citem.SaleType == 'Normal')
        // if (this.data.buyIdList.includes(learnSaleMethod.Id)) buyList.push(learnClassData)
        if (this.data.buyIdList.includes(learnSaleMethod.Id)) {
          buyList.push(this.data.learnClassData)
        } else {
@@ -380,11 +391,6 @@
      let showDataUrl = '';
      let titleName = '';
      res.datas.cmsDatas[0].datas.forEach((item, index) => {
        // if (this.data.source == 'qrcode') {
        //   if (item.id == this.data.activeId) {
        //     this.data.threeLeveData.push(item);
        //   }
        // } else {
        if (item.selectType === "audio" || item.learnSelectType === "audio") {
          if (this.data.storeInfo == 'jsek_digitalCourses') {
            if (item.sysType == 'CmsItem') {
@@ -399,7 +405,7 @@
                this.data.threeLeveData.push(item)
              }
            } else {
              // if (!item.saleMethod.length) this.data.threeLeveData.push(item)
              if (!item.saleMethod.length) {
                // 没买且无销售方式
                this.data.threeLeveData.push(item)
@@ -410,21 +416,22 @@
                  this.data.threeLeveData.push(item)
                }
                //  没买且只有试读资源
                if (!item.file && item.freeFile) this.data.threeLeveData.push(item)
                if ((!item.file && !item.protectedFile) && item.freeFile) {
                  const state = this.data.threeLeveData.find(citem => citem.id == item.id)
                  if (!state)
                    this.data.threeLeveData.push(item)
                }
              }
            }
          }
        }
        // }
      });
      if (this.data.source == 'qrcode') {
        let qrData = this.data.threeLeveData.find(ditem => ditem.id == this.data.activeId)
        if (qrData && this.data.isLearnDataBuy) {
          if (qrData) {
            this.setData({
              threeLeveData: [qrData]
            })
          }
        if (qrData && this.cmsItemIsBuy(qrData)) {
          this.setData({
            threeLeveData: [qrData]
          })
        } else {
          this.setData({
            threeLeveData: []
@@ -440,7 +447,7 @@
        if (selectedId !== -1) {
          let datas = this.data.threeLeveData[selectedId];
          if (this.data.formPath == 'jsek_cloudLearning') {
            let file = datas.protectedFile ? datas.protectedFile : datas.freeFile
            let file = this.cmsItemIsBuy(datas) ? datas.protectedFile || datas.freeFile : datas.freeFile
            showDataUrl = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey);
          } else {
            showDataUrl = datas.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.freeFile
@@ -824,7 +831,6 @@
    }
    setTimeout(() => {
      myAudio.startTime = this.data.myAudioDuration //开始时间  
      myAudio.playbackRate = this.data.speed; //  播放速率
    }, 200);
@@ -925,4 +931,36 @@
        .then((res) => {})
    }
  },
  // 判断当前点击的数据是否购买
  cmsItemIsBuy(item) {
    let flag = false
    // 买了
    if (this.data.buyList.length) {
      if (this.data.buyList.some(citem => item.productLinkPath.includes(citem.productLinkPath)))
        flag = true
    } else {
      // 没买且无销售方式
      if (!item.saleMethod.length) {
        flag = true
      } else {
        // 没买且销售方式过期//没买,销售方式价格为0
        const itemSaleMethod = item.saleMethod.find(citem => citem.SaleType == 'Normal')
        if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime() || itemSaleMethod.Price == 0) flag = true
      }
    }
    return flag
  },
  // 提示弹窗关闭
  closePromapDialog() {
    this.setData({
      promptVisable: false
    })
    if (this.data.source == 'qrcode') {
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
      });
    } else {
      wx.navigateBack()
    }
  }
})
packageDomain/pages/resourceDetails/myAudio/index.wxml
@@ -16,27 +16,43 @@
  </view> -->
  <view class="audioPlayerBox">
    <view class="audioBackground" style="background-image: url('https://jsek.bnuic.com/home/image/video-bg.png');">
    <view
      class="audioBackground"
      style="background-image: url('https://jsek.bnuic.com/home/image/video-bg.png')"
    >
      <image src="/static/images/resourceDetailsMyAudio/cd.png" alt="" />
    </view>
    <!-- 视频播放的按钮 -->
    <view class="bigFunctionBox">
      <view class="functionBox">
        <!-- 暂停播放 -->
        <view class="audioIconBox color" style="margin-left: 30rpx; margin-right: 10rpx">
        <view
          class="audioIconBox color"
          style="margin-left: 30rpx; margin-right: 10rpx"
        >
          <view wx:if="{{isplay}}" bind:tap="play" class="pauseCircleBox">
            <!-- <t-icon name="play-circle-stroke" size="24" /> -->
            <image src="/static/images/resourceDetailsMyAudio/play@2x.png" mode="" />
            <image
              src="/static/images/resourceDetailsMyAudio/play@2x.png"
              mode=""
            />
          </view>
          <view wx:if="{{!isplay}}" bind:tap="stop" class="pauseCircleBox">
            <!-- <t-icon name="pause-circle-stroke" size="24" /> -->
            <image src="/static/images/resourceDetailsMyAudio/zanting@2x.png" mode="" />
            <image
              src="/static/images/resourceDetailsMyAudio/zanting@2x.png"
              mode=""
            />
          </view>
        </view>
        <slider style="width: 300rpx" activeColor="#FF6C00" class="mp-slider-bar" block-size="16" value="{{myAudioPos}}" bindchange="hanle_slider_change"></slider>
        <slider
          style="width: 300rpx"
          activeColor="#FF6C00"
          class="mp-slider-bar"
          block-size="16"
          value="{{myAudioPos}}"
          bindchange="hanle_slider_change"
        ></slider>
        <!-- 时间 -->
        <view class="timeBox">
@@ -49,14 +65,46 @@
        <view class="publicBtn color">
          <view class="publicText" bind:tap="toggleDropdown">
            <view> {{"x "+speed}} </view>
            <t-icon style="margin-top: 10rpx" wx:if="{{showDropdown}}" name="caret-up-small" size="14" bind:click="onIconTap" />
            <t-icon style="margin-top: 10rpx" wx:else name="caret-down-small" size="14" bind:click="onIconTap" />
            <t-icon
              style="margin-top: 10rpx"
              wx:if="{{showDropdown}}"
              name="caret-up-small"
              size="14"
              bind:click="onIconTap"
            />
            <t-icon
              style="margin-top: 10rpx"
              wx:else
              name="caret-down-small"
              size="14"
              bind:click="onIconTap"
            />
          </view>
          <view class="multipleBox" wx:if="{{showDropdown}}">
            <view style="margin: 10rpx 0" wx:if="{{speed != 0.5}}" bind:tap="smallSpeed">x0.5</view>
            <view style="margin: 10rpx 0" wx:if="{{speed != 1}}" bind:tap="smallSpeeDmultiple">x1</view>
            <view style="margin: 10rpx 0" wx:if="{{speed != 1.5}}" bind:tap="centreSpeed">x1.5</view>
            <view style="margin: 10rpx 0" wx:if="{{speed != 2}}" bind:tap="bigSpeed">x2</view>
            <view
              style="margin: 10rpx 0"
              wx:if="{{speed != 0.5}}"
              bind:tap="smallSpeed"
              >x0.5</view
            >
            <view
              style="margin: 10rpx 0"
              wx:if="{{speed != 1}}"
              bind:tap="smallSpeeDmultiple"
              >x1</view
            >
            <view
              style="margin: 10rpx 0"
              wx:if="{{speed != 1.5}}"
              bind:tap="centreSpeed"
              >x1.5</view
            >
            <view
              style="margin: 10rpx 0"
              wx:if="{{speed != 2}}"
              bind:tap="bigSpeed"
              >x2</view
            >
          </view>
        </view>
      </view>
@@ -66,23 +114,52 @@
  <!-- 标题 -->
  <view class="titleBox">{{titleName}}</view>
  <view class="contentBox">
    <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel" split="{{false}}">
    <t-tabs
      defaultValue="{{0}}"
      bind:change="onTabsChange"
      bind:click="onTabsClick"
      t-class="custom-tabs"
      t-class-content="custom-panel"
      split="{{false}}"
    >
      <!-- 资源列表 -->
      <t-tab-panel label="资源列表" value="0" style="{{tabPanelstyle}}" style="width: 750rpx">
        <scroll-view style="height:700rpx" scroll-y scroll-into-view="{{toView}}">
        <view class="wrapper">
          <!-- <t-collapse value="{{activeValues}}" bind:change="handleChange">
      <t-tab-panel
        label="资源列表"
        value="0"
        style="{{tabPanelstyle}}"
        style="width: 750rpx"
      >
        <scroll-view
          style="height: 700rpx"
          scroll-y
          scroll-into-view="{{toView}}"
        >
          <view class="wrapper">
            <!-- <t-collapse value="{{activeValues}}" bind:change="handleChange">
            <t-collapse-panel header="{{parentName}}" value="{{0}}" expandIcon>
        
            </t-collapse-panel>
          </t-collapse> -->
          <view class="outsideDetailsName">
            <view class="titleBox"> {{parentName}}</view>
            <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}" id="{{selectedId == index ? 'activeName'+index : ''}}">
              <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}} ">{{item.name}}</view>
            <view class="outsideDetailsName">
              <view class="titleBox"> {{parentName}}</view>
              <view
                class="detailsName"
                wx:for="{{threeLeveData}}"
                wx:key="index"
                wx:for-item="item"
                wx:for-index="index"
                bind:tap="onVideo"
                data-item="{{item}}"
                data-index="{{index}}"
                id="{{selectedId == index ? 'activeName'+index : ''}}"
              >
                <view
                  style="color: {{selectedId == index ? '#ff6c00' : '#000'}} "
                  >{{item.name}}</view
                >
              </view>
            </view>
          </view>
        </view>
        </scroll-view>
      </t-tab-panel>
      <!-- 笔记展示 -->
@@ -94,9 +171,16 @@
              <empty />
            </view>
            <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}">
            <t-collapse-panel
              value="{{item.id}}"
              expandIcon
              wx:for="{{noteList}}"
            >
              <view slot="header" class="collapse-header">
                <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image>
                <t-image
                  class="note-icon"
                  src="/static/images/bookService/detail/note-icon.png"
                ></t-image>
                <view class="header-name">{{item.name}}</view>
              </view>
              <view>
@@ -104,9 +188,19 @@
                <view class="note-bottom">
                  <view class="note-time">{{item.createDate}}</view>
                  <view class="bottom-btn">
                    <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image>
                    <t-image
                      src="/static/images/bookService/detail/compliceHover.png"
                      class="complice"
                      bind:tap="editNote"
                      data-note="{{item}}"
                    ></t-image>
                    <view></view>
                    <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image>
                    <t-image
                      src="/static/images/bookService/detail/deleteHover.png"
                      class="delete"
                      bind:tap="deleteNote"
                      data-id="{{item.id}}"
                    ></t-image>
                  </view>
                </view>
              </view>
@@ -119,7 +213,10 @@
    <!-- 记笔记 -->
    <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog">
      <view class="takeNotesLining">
        <image src="/static/images/resourceDetails/jibiji/icon@2x.png" mode="" />
        <image
          src="/static/images/resourceDetails/jibiji/icon@2x.png"
          mode=""
        />
        记笔记
      </view>
    </view>
@@ -127,28 +224,72 @@
  </view>
  <!-- 记笔记弹窗 -->
  <t-popup visible="{{dialogKey}}" bind:visible-change="onVisibleChange" placement="center">
  <t-popup
    visible="{{dialogKey}}"
    bind:visible-change="onVisibleChange"
    placement="center"
  >
    <view class="popup">
      <view slot="title">
        <view class="title-text" wx:if="{{!flag}}">
          <text class="note-title">{{submitTitle}}</text>
          <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image>
          <t-image
            src="/static/images/bookService/detail/edit.png"
            class="edit-icon"
            bind:tap="changeTitle"
            data-value="{{true}}"
          ></t-image>
        </view>
        <view wx:else>
          <t-input value="{{submitTitle}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange"></t-input>
          <t-input
            value="{{submitTitle}}"
            style="{{inputStyle}}"
            data-value="{{false}}"
            bind:enter="changeTitle"
            bind:blur="changeTitle"
            maxlength="{{50}}"
            bind:change="inputChange"
          ></t-input>
        </view>
      </view>
      <view slot="content">
        <view class="textarea-example">
          <text class="textarea-example__label">内容:</text>
          <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="请输入文字" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" />
          <t-textarea
            value="{{textvalue}}"
            t-class="external-class"
            placeholder="请输入文字"
            bordered
            maxlength="500"
            disableDefaultPadding="{{true}}"
            indicator
            style="{{inputStyle}}"
            bind:change="textareaChange"
          />
        </view>
        <view class="submit-btn">
          <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button>
          <t-button theme="primary" size="large" block bind:tap="confirmSuggest"
            >提交</t-button
          >
        </view>
      </view>
    </view>
    <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" />
    <t-icon
      t-class="close-btn"
      name="close-circle"
      size="32"
      color="#fff"
      bind:tap="closeDialog"
    />
  </t-popup>
</view>
</view>
<t-dialog
class="prompDialog"
  visible="{{promptVisable}}"
  title="提示"
  content="试听结束,请购买正式资源"
  confirm-btn="{{ confirmBtn }}"
  bind:confirm="closePromapDialog"
/>
packageDomain/pages/resourceDetails/myAudio/index.wxss
@@ -407,8 +407,16 @@
  flex-direction: row;
}
.wrapper {
  /* overflow-y: scroll;
  overflow-x: hidden;
  height: 50vh; */
.t-dialog__header {
  margin-top: 30rpx;
}
.prompDialog {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.prompDialog .t-dialog__header {
  margin-top: 30rpx;
}
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -61,6 +61,12 @@
    learnTimeList: [],
    learnTimeData: 0,
    toView: 'activeName',
    promptVisable: false,
    confirmBtn: {
      content: '确定',
      variant: 'base',
    },
    showMd5: ''
  },
  // 格式化笔记时间
  convertTimestamp(timestamp) {
@@ -458,7 +464,6 @@
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
        });
      }
      this.setData({
        loading: false,
@@ -520,6 +525,9 @@
        appRefCode: app.config.appRefCode
      }
      app.MG.file.getAliVod(query).then((res) => {
        this.setData({
          showMd5: md5
        })
        if (res) {
          if (res && res.data == '') {
            this.setData({
@@ -877,5 +885,25 @@
      }
    }
    return flag
  },
  videoEnd() {
    const data = this.data.threeLeveData.find(item => item.id == this.data.activeId)
    if (data.freeFile && (this.data.showDataVod.includes(data.freeFile) || this.data.showMd5 == data.freeFile) && data.protectedFile)
      this.setData({
        promptVisable: true
      })
  },
  // 提示弹窗关闭
  closePromapDialog() {
    this.setData({
      promptVisable: false
    })
    if (this.data.source == 'qrcode') {
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
      });
    } else {
      wx.navigateBack()
    }
  }
})
packageDomain/pages/resourceDetails/myVideo/index.wxml
@@ -16,6 +16,7 @@
      src="{{showDataVod}}"
      style="width: 100%"
      bindvideoloaded="loadedmetadata"
      bindEnded="videoEnd"
      bindTimeupdate="timeUpdate"
      wx:if="{{!videoLoading}}"
    >
@@ -50,28 +51,33 @@
            loading="true"
          ></t-skeleton>
        </view>
        <scroll-view style="height:700rpx" scroll-y scroll-into-view="{{toView}}">
        <view class="wrapper" wx:if="{{!loading}}">
          <view class="outsideDetailsName">
            <view class="titleBox">{{parentName}}</view>
            <view
              wx:for="{{threeLeveData}}"
              wx:key="index"
              wx:for-item="item"
              wx:for-index="index"
              bind:tap="onVideo"
              data-item="{{item}}"
              data-index="{{index}}"
              class="detailsName"
              id="{{selectedId == index ? 'activeName'+index : ''}}"
            >
              <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}"
                >{{item.name}}</view
        <scroll-view
          style="height: 700rpx"
          scroll-y
          scroll-into-view="{{toView}}"
        >
          <view class="wrapper" wx:if="{{!loading}}">
            <view class="outsideDetailsName">
              <view class="titleBox">{{parentName}}</view>
              <view
                wx:for="{{threeLeveData}}"
                wx:key="index"
                wx:for-item="item"
                wx:for-index="index"
                bind:tap="onVideo"
                data-item="{{item}}"
                data-index="{{index}}"
                class="detailsName"
                id="{{selectedId == index ? 'activeName'+index : ''}}"
              >
                <view
                  style="color: {{selectedId == index ? '#ff6c00' : '#000'}}"
                  >{{item.name}}</view
                >
              </view>
            </view>
          </view>
        </view>
      </scroll-view>
        </scroll-view>
      </t-tab-panel>
      <!-- 笔记展示 -->
      <t-tab-panel label="笔记" value="1" style="{{tabPanelstyle}}">
@@ -194,3 +200,12 @@
    />
  </t-popup>
</view>
<t-dialog
  class="prompDialog"
  visible="{{promptVisable}}"
  title="提示"
  content="试看结束,请购买正式资源"
  confirm-btn="{{ confirmBtn }}"
  bind:confirm="closePromapDialog"
/>
packageDomain/pages/resourceDetails/myVideo/index.wxss
@@ -356,12 +356,18 @@
}
.wrapper {
  /* overflow-y: scroll;
  overflow-x: hidden; */
  /* height: 50vh; */
}
.demo-section__content {
  margin: 40rpx;
}
.prompDialog {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.prompDialog .t-dialog__header {
  margin-top: 30rpx;
}