pages/personalCenter/index.js
@@ -102,6 +102,7 @@ data: { barHeight: '', navBarHeight: '', scoll: false, isWhite: false, userInfo: {}, currAuthStep: 1, @@ -346,15 +347,23 @@ }, onScroll(e) { 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); } } }, isChange(data) { this.setData({ isWhite: e.detail.scrollTop > 10 ? true : false isWhite: data }) const { scrollTop } = e.detail; this.setData({ scrollTop }); },