const query = wx.createSelectorQuery();
let tops = [];
let topViewH, navViewH, scrollHeight, fixedCateH;
query.selectAll('.top,.nav,.mid').boundingClientRect(function(heights) {
topViewH = heights[0].height //顶部描述的高度
navViewH = heights[1].height //三个小导航的高度
scrollHeight = heights[2].height
}).exec()
query.selectAll('.good-title').boundingClientRect(function(rects) {
rects.forEach(function(rect, index) {
//减去顶部固定占位置view的高度
tops[index] = Math.round(rect.top) - topViewH - navViewH
})
that.setData({
tops: tops //把每个分类距离scroll-view顶部的距离数组记录下来
})
}).exec()
-
Notifications
You must be signed in to change notification settings - Fork 0
kzkzzzz/wx_miniapp
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
微信小程序商城和基本视频功能
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published