litian
2024-09-12 bbba5d26e9e26c910ed337dcb65f462752ee6dce
packageDomain/pages/resourceDetails/document/index.js
@@ -1,6 +1,9 @@
// pages/resourceDetails/document/index.js
import Toast from 'tdesign-miniprogram/toast/index';
const app = getApp()
import {
  loginInfo
} from '../../../../assets/js/login';
Page({
  /**
@@ -16,6 +19,7 @@
    navBarHeight: '',
    barHeight: '',
    activeId: '',
    storeInfo: '',
    bookId: '',
    bookName: '',
    cmsId: '',
@@ -55,6 +59,7 @@
      activeId: options.activeId,
      bookId: options.bookId,
      bookName: options.bookName,
      storeInfo: options.storeInfo,
      cmsId: options.cmsId,
      parentName: options.parentName,
      parentProductLinkPath: options.parentProductLinkPath,
@@ -62,7 +67,19 @@
      applyState: options.applyState,
      deadline: options.deadline
    })
    this.resourceDetailsData()
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          this.resourceDetailsData()
        } else {
          this.resourceDetailsData()
        }
      })
    } else {
      this.resourceDetailsData()
    }
  },
  /**
@@ -142,9 +159,8 @@
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  onShareAppMessage() {},
  onShareTimeline() {},
  goBack() {
    wx.navigateBack()
  },
@@ -174,6 +190,9 @@
        size: 999
      }
    }
    if (this.data.storeInfo) {
      query.storeInfo = this.data.storeInfo
    }
    app.MG.store.getProductDetail(query).then((res) => {
      console.log(res);
      res.datas.cmsDatas[0].datas.forEach((item) => {