闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
@@ -2,6 +2,7 @@
import {
  loginInfo
} from "../../../../../../assets/js/login";
const app = getApp()
Component({
  /**
   * 组件的属性列表
@@ -57,13 +58,6 @@
    },
    // 跳转资源购买页
    goBuyResource() {
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        gotoPageFun()
      } else {
        loginInfo(app, (data) => {
        })
      }
      const gotoPageFun = () => {
        if (!this.properties.isGoBuyResource) {
          return wx.showToast({
@@ -74,6 +68,12 @@
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`,
        })
      }
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        gotoPageFun()
      } else {
        loginInfo(app, (data) => {})
      }
    },
@@ -88,6 +88,11 @@
      })
    },
    goLearnTask() {
      const gotoPageFun = () => {
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`,
        })
      }
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        gotoPageFun()
@@ -96,11 +101,7 @@
          if (data) gotoPageFun()
        })
      }
      const gotoPageFun = () => {
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`,
        })
      }
    },
    buyCloudLearnClass() {
      var myEventDetail = {} // detail对象,提供给事件监听函数