MCPcopy Create free account
hub / github.com/coderwhy/HYMiniMall / scrollPosition

Function scrollPosition

pages/home/home.js:40–55  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

38 this._getProductData(this.data.currentType);
39 },
40 scrollPosition(e) {
41 // 1.获取滚动的顶部
42 const position = e.detail.scrollTop;
43
44 // 2.设置是否显示
45 this.setData({
46 showBackTop: position > BACK_TOP_POSITION,
47 })
48
49 wx.createSelectorQuery().select('.tab-control').boundingClientRect((rect) => {
50 const show = rect.top > 0
51 this.setData({
52 showTabControl: !show
53 })
54 }).exec()
55 },
56 onImageLoad() {
57 wx.createSelectorQuery().select('.tab-control').boundingClientRect((rect) => {
58 this.setData({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected