litian
2024-07-10 629658fdf9dbced931cf9e0b5ea273840a5e919d
pages/home/home.js
@@ -46,11 +46,10 @@
    });
    console.log(this.data.searchVal)
    this.loadHomePage();
    this.getBannerList()
  },
  onLoad() {
    this.getBannerList()
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
@@ -151,6 +150,7 @@
  //点击目录
  toPages(item) {
    let info = item.target.dataset.info
    console.log(info);
    if (info.url) {
      if (info.text == "图书服务") {
        wx.switchTab({
@@ -591,6 +591,22 @@
  },
  // 扫一扫
  onIconScanTap() {
    wx.scanCode({
      success(res) {
        console.log(res);
        if (res.errMsg == "scanCode:ok" && res.path || res.result) {
          let path = res.path || res.result
          wx.redirectTo({
            url: '/' + path,
          })
        }
      }
    })
  },
  // 监听滚动条
  onScroll(e) {
@@ -606,7 +622,6 @@
      }
    }
  },
  isChange(data) {
    this.setData({
      isWhite: data