litian
2024-07-10 81c23f9c2f5bdfbe962d0b19a5a80ea7c12f043d
pages/index/resourceCover.js
@@ -1,5 +1,8 @@
// pages/index/resourceCover.js
const app = getApp()
import {
  loginInfo
} from '../../assets/js/login';
Page({
  /**
@@ -20,9 +23,22 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if (options.scene) {
      this.getBookInfo(options.scene)
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        // 如果不是第一次登录,会执行回调
        if (data) {
          if (options.scene) {
            this.getBookInfo(options.scene)
          }
        }
      })
    } else {
      if (options.scene) {
        this.getBookInfo(options.scene)
      }
    }
  },
  /**
@@ -41,8 +57,8 @@
  getBookInfo(refcode) {
    const obj = {
      storeInfo: app.config.jslx,
      path: app.config.jslx,
      storeInfo: app.config.goodsStore,
      path: app.config.goodsStore,
      queryType: 'ProductCmsItem',
      SysType: "CmsItem",
      RefCode: refcode,
@@ -92,7 +108,7 @@
        formPath: book.learnSelectType ? 'jsek_cloudLearning' : ''
      })
      wx.redirectTo({
        url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`,
        url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&formPath=${this.data.formPath}`,
      });
      if (book.selectType == "pdf" || book.selectType == 'document') {