QYF-GitLab1
2 天以前 4df5e250646fa201c08f38dfb77cfb49e53706fc
packageDomain/pages/resourceDetails/document/index.js
@@ -336,7 +336,7 @@
    if (this.data.storeInfo) {
      query.storeInfo = this.data.storeInfo
    }
    app.MG.store.getProductDetail(query).then((res) => {
    app.MG.store.getProductDetail(query).then(async (res) => {
      wx.hideLoading();
      const list = res.datas.cmsDatas[0]?.datas
      if (this.data.source == 'qrcode') {
@@ -354,7 +354,7 @@
      this.setData({
        isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)
      })
      list?.forEach(async (item) => {
      for (const item of list) {
        if (this.data.storeInfo == 'jsek_digitalCourses') {
          if (this.data.isBuy) {
            if (this.data.productLinkPath == item.productLinkPath) {
@@ -369,16 +369,17 @@
          const isBuyCms = await app.MG.file.checkCmsItem({
            cmsItemId: Number(item.id)
          })
          if (isBuyCms && this.data.productLinkPath == item.productLinkPath) {
            this.data.threeLeveData(item)
          item.isBuyCms = isBuyCms
          if (isBuyCms) {
            this.data.threeLeveData.push(item)
          } else {
            if (item.freeFile && this.data.productLinkPath == item.productLinkPath) {
              this.data.threeLeveData(item)
            if (item.freeFile) {
              this.data.threeLeveData.push(item)
            } else {
              wx.showModal({
                icon: 'error',
                title: '温馨提示',
                content: '请购买题库,即将返回购买页',
                content: '请购买资源,即将返回购买页',
                confirmText: '确定',
                showCancel: false, // 关闭取消按钮
                success: (cres) => {
@@ -393,7 +394,7 @@
            }
          }
        }
      })
      }
      if (this.data.threeLeveData.length > 0) {
        let item = this.data.threeLeveData[0]
        this.handleTeachData(item)
@@ -485,7 +486,7 @@
    let that = this
    //图片
    if (item.selectType == 'picture' || item.learnSelectType == 'picture') {
      const isBuy = this.cmsItemIsBuy(item)
      const isBuy = item.isBuyCms
      let file = isBuy ? item.protectedFile || item.file : item.freeFile
      this.setData({
        showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + file,
@@ -508,7 +509,7 @@
    }
    //文档等
    if (item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') {
      const isBuy = this.cmsItemIsBuy(item)
      const isBuy = item.isBuyCms
      let md5 = isBuy ? item.protectedFile || item.file || item.freeFile : item.freeFile
      if (item.fileMap[md5]?.extension == 'xlsx' || item.fileMap[md5]?.extension == 'xls') {
        this.setData({