litian
2024-06-26 ccda9ec2fe70d8f51ef184eafc04b78d22dfbabd
pages/home/home.js
@@ -41,6 +41,10 @@
    loading: true
  },
  onShow() {
    this.setData({
      searchVal: "",
    });
    console.log(this.data.searchVal)
    this.loadHomePage();
    this.getBannerList()
@@ -147,6 +151,7 @@
  //点击目录
  toPages(item) {
    let info = item.target.dataset.info
    console.log(info);
    if (info.url) {
      if (info.text == "图书服务") {
        wx.switchTab({
@@ -587,6 +592,22 @@
  },
  // 扫一扫
  onIconScanTap() {
    wx.scanCode({
      success(res) {
        console.log(res);
        if (res.errMsg == "scanCode:ok" && res.path) {
          console.log(res.path, 2)
          wx.redirectTo({
            url: '/' + res.path,
          })
        }
      }
    })
  },
  // 监听滚动条
  onScroll(e) {
@@ -602,7 +623,6 @@
      }
    }
  },
  isChange(data) {
    this.setData({
      isWhite: data