litian
2024-09-07 ce3a08b28c16f5cce2185167f8a9030ee16898ed
pages/bookExhibitionDetails/index.js
@@ -1,5 +1,8 @@
// pages/bookExhibitionDetails/index.js
const app = getApp()
import {
  loginInfo
} from '../../assets/js/login';
Page({
  /**
@@ -27,8 +30,6 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
@@ -36,20 +37,26 @@
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
    })
    console.log();
    this.setData({
      bookName: options.bookName,
      subtitleName: options.subtitleName,
      passId: options.id
    })
    const passId = options.id
    this.bookExhibitionGet(passId)
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      loginInfo(app, (data) => {
        if (data) {
          this.bookExhibitionGet(this.data.passId)
    this.getBookExhibitionDetails()
        } else {
          this.bookExhibitionGet(this.data.passId)
          this.getBookExhibitionDetails()
        }
      })
    }
    this.bookExhibitionGet(this.data.passId)
    this.getBookExhibitionDetails()
    wx.setNavigationBarTitle({
      title: this.data.subtitleName
    });
@@ -109,10 +116,6 @@
      loading: true,
      hidden: true,
    })
    wx.showLoading({
      title: '加载中...',
    })
    console.log(passId, 8988989);
    app.MG.store.getProductDetail({
      storeInfo: 'jsek_bookFair', //商品库
      path: '*', //路径
@@ -132,18 +135,15 @@
        bookBeginDate: res.datas.beginDate,
        bookCreator: res.datas.datas.Creator.Name,
        bookContent: res.datas.content,
        bookImage: res.datas.icon
      });
      wx.hideLoading()
      this.setData({
        bookImage: res.datas.icon,
        loading: false,
        hidden: false,
      })
      });
      console.log(this.data.loading, 123)
    })
  },
  //书展详情接口
  getBookExhibitionDetails() {
    app.MG.store.getProductList({
      path: '*',
      storeInfo: 'jsek_bookFair',
@@ -161,15 +161,9 @@
        Creator: []
      }
    }).then(res => {
      this.setData({
        bookExhibitionList: res.datas,
        totalSize: res.total
      })
      this.setData({
        loading: false,
        hidden: false,
        totalSize: res.total,
      })
    })
  },
@@ -185,10 +179,7 @@
  },
  // 触底函数
  onReachBottom() {
    console.log(this.data.bookExhibitionList.length);
    console.log(this.data.totalSize);
    if (this.data.bookExhibitionList.length < this.data.totalSize) {
      console.log(11111);
      this.setData({
        isMore: true,
        start: this.data.start + 1
@@ -202,7 +193,6 @@
        this.setData({
          isMore: false
        })
        console.log('300');
      }, 300)
    }
  },