闫增涛
2024-03-21 3baf9a943cdf11d4cdfb52b3756458529d0dcf2a
pages/bookExhibitionList/index.js
@@ -58,8 +58,8 @@
      options: [],
    },
    navBarHeight: '',
    barHeight: ''
    barHeight: '',
    windowHeight: '',
  },
@@ -68,6 +68,34 @@
    * 生命周期函数--监听页面加载
    */
  onLoad(options) {
    // 获取屏幕高度
    wx.getSystemInfo({
      success: function (res) {
        // this.setData({
        //   windowHeight: res.windowHeight
        // })
        // 获取节点的类名
        var query = wx.createSelectorQuery();
        query.select('.assembleContent').boundingClientRect();
        query.exec(function (res) {
          console.log(res, 'res');
          let node = res[0];
          node.setStyle({
            backgroundColor: '#0256b9',
          })
          // // 修改节点样式
          // if (node) {
          //   node.setStyle({
          //     backgroundColor: 'red',
          //     color: 'white'
          //   });
          // }
        });
      }
    });
    // console.log(this.data.filteredItems, 88888);
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
@@ -348,7 +376,7 @@
    const item = event.currentTarget.dataset.item;
    console.log(item);
    wx.navigateTo({
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name + '&subtitleName=' + item.subtitleName // 假设跳转到详情页面,并传递了id参数
    });
  },
  // 搜索框