litian
8 天以前 aff8d054df4a638f399dc8f15d98c19b9c9aa785
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -436,22 +436,18 @@
              }
              this.setData({
                showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
                titleName: items.name
                titleName: items.name,
                selectedId: index
              })
              debugger
              this.aliVod(file, this.data.showData)
            } else {
              this.setData({
                showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
                titleName: items.name
                titleName: items.name,
                selectedId: index
              })
              this.aliVod(items.file, this.data.showData)
            }
            let selectedIndex = index; // 存储选中项的索引
            console.log(selectedIndex, "selectedIndex")
            this.setData({
              selectedId: selectedIndex // 设置选中项的索引
            });
          }
        });
      } else {
@@ -865,17 +861,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
  }
})