闫增涛
2025-02-14 093bb57203ae158aa371125d584e2bff372a344e
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -224,14 +224,19 @@
      },
      fields: {},
    };
    if (this.data.storeInfo) query['storeInfo'] = this.data.storeInfo
    app.MG.store.getProductDetail(query).then(async (res) => {
      this.setData({
        bookDetail: res.datas,
        buyIdList: res.datas.purchasedSaleMethodIdList,
        learnClassData: res.datas.cmsDatas[0].datas.length > 0 ? res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") : null
      })
      try {
        this.setData({
          bookDetail: res.datas,
          buyIdList: res.datas.purchasedSaleMethodIdList,
          learnClassData: res.datas.cmsDatas[0].datas.length > 0 ? res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") : null
        })
      } catch (error) {}
      if (this.data.learnClassData) {
        this.getResourceDataList(this.data.learnClassData)
      } else {
        this.resourceDetailsData()
      }
    });
  },
@@ -255,7 +260,7 @@
      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)
      }
      this.setData({
        buyList: buyList
@@ -347,7 +352,6 @@
      this.setData({
        isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)
      })
      console.log(0, res.datas.cmsDatas[0].datas);
      res.datas.cmsDatas[0].datas.forEach((item) => {
        if (this.data.source == 'qrcode') {
          if (item.id == this.data.activeId) {
@@ -382,6 +386,8 @@
                  if (new Date().getTime() > new Date(itemSaleMethod.EndDate).getTime()) {
                    this.data.threeLeveData.push(item)
                  }
                  //  没买且只有试读资源
                  if (!item.file && item.freeFile) this.data.threeLeveData.push(item)
                }
              }
            }
@@ -475,7 +481,10 @@
          videoLoading: false,
        })
      } else {
        return ElMessage.error('无法获取视频资源')
        return wx.showToast({
          icon: 'error',
          title: '无法获取视频资源',
        })
      }
    })
  },
@@ -485,9 +494,11 @@
      currentTime,
      duration
    } = e.detail
    this.setData({
      progress: ((currentTime / duration) * 100).toFixed(2)
    })
    console.log('进度', e);
  },
  //获取视频学习
  getPlayerList() {