闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
packageDomain/pages/resourceDetails/document/index.js
@@ -82,32 +82,13 @@
      deadline: options.deadline,
      formPath: options.formPath,
    })
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (options.formPath == 'jsek_cloudLearning') {
          this.setData({
            learnStartTime: Date.now(),
          })
          this.getLearnTime()
        }
        this.getBookInfo(this.data.bookId)
        // if (data) {
        //   this.resourceDetailsData()
        // } else {
        //   this.resourceDetailsData()
        // }
    if (options.formPath == 'jsek_cloudLearning') {
      this.setData({
        learnStartTime: Date.now(),
      })
    } else {
      if (options.formPath == 'jsek_cloudLearning') {
        this.setData({
          learnStartTime: Date.now(),
        })
        this.getLearnTime()
      }
      this.getBookInfo(this.data.bookId)
      // this.resourceDetailsData()
      this.getLearnTime()
    }
    this.getBookInfo(this.data.bookId)
  },
  /**
@@ -352,19 +333,14 @@
        isBuy: res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)
      })
      res.datas.cmsDatas[0].datas.forEach((item) => {
        // if (this.data.productLinkPath == item.productLinkPath) {
        //   this.handleTeachData(item)
        //   this.setData({
        //     titleName: item.name,
        //     selectType: item.selectType,
        //     learnSelectType: item.learnSelectType
        //   })
        // } else {
        //   return wx.showToast({
        //     icon: 'none',
        //     title: '暂无资源',
        //   })
        // }
        if (this.data.productLinkPath == item.productLinkPath) {
          this.handleTeachData(item)
          this.setData({
            titleName: item.name,
            selectType: item.selectType,
            learnSelectType: item.learnSelectType
          })
        }
        if (this.data.storeInfo == 'jsek_digitalCourses') {
          if (this.data.isBuy) {
            if (this.data.productLinkPath == item.productLinkPath) {
@@ -434,13 +410,13 @@
          learnSelectType: item.learnSelectType,
        })
      } else {
        wx.showToast({
          icon: 'none',
          title: '请先返回资源所在图书详情购买视频资源',
        })
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
        });
        // wx.showToast({
        //   icon: 'none',
        //   title: '请先返回资源所在图书详情购买视频资源',
        // })
        // wx.navigateTo({
        //   url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=jsek_cloudLearning`,
        // });
      }
    })
  },