闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -438,7 +438,6 @@
                showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
                titleName: items.name
              })
              debugger
              this.aliVod(file, this.data.showData)
            } else {
              this.setData({
@@ -865,17 +864,21 @@
  },
  // 判断当前点击的数据是否购买
  cmsItemIsBuy(item) {
    // 1.this.data.buyIdList 上是否有 cmsItem的linkpath里的id
    const linkData = item.productLinkInfo.find(citem => citem.LinkType == 'Link' && citem.CmsItemId == item.id)
    let linkids = []
    try {
      linkids = linkData.LinkPath.split('\\')
    } catch (error) {}
    if (!this.data.buyIdList.length) return false
    const flag = linkids.some(citem => {
      return this.data.buyIdList.includes(Number(citem))
    })
    console.log(linkids, flag);
    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
  }
})