litian
2024-04-11 f00c1cca98455a036548672d28e7e8ad13729a21
pages/home/home.js
@@ -11,6 +11,7 @@
    barHeight: '',
    navBarHeight: '',
    searchVal: '',
    scoll: false,
    isWhite: false,
    userInfo: {},
    tabList: [], //目录
@@ -589,17 +590,22 @@
  // 监听滚动条
  onScroll(e) {
    this.setData({
      isWhite: true
    })
    this.setData({
      isWhite: e.detail.scrollTop > 20 ? true : false
    })
    if (this.data.scoll) {
      if (e.detail.scrollTop < 20) {
        this.data.scoll = false
        this.isChange(false);
      }
    } else {
      if (e.detail.scrollTop > 20) {
        this.data.scoll = true
        this.isChange(true);
      }
    }
  },
  onScrollToTop(e) {
  isChange(data) {
    this.setData({
      isWhite: e.detail.scrollTop > 50 ? true : false
      isWhite: data
    })
  },