Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-10-26 20:16:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
649b6291068b7bd6d6a3f065be83d1439ccc1fa4
649b6291
1 parent
157f84a7
refactor(Dashboard): 使用更简洁的Taro.getWindowInfo替换getSystemInfo
简化滚动触发逻辑,直接获取窗口高度信息,移除不必要的回调嵌套
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
src/pages/Dashboard/index.vue
src/pages/Dashboard/index.vue
View file @
649b629
<!--
* @Date: 2025-08-27 17:43:45
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-10-2
5 20:05:09
* @LastEditTime: 2025-10-2
6 20:16:05
* @FilePath: /lls_program/src/pages/Dashboard/index.vue
* @Description: 首页
-->
...
...
@@ -657,21 +657,14 @@ const handlePageScroll = (scrollTop) => {
if (rect) {
// console.log('RankingCard 位置信息:', rect)
// 获取系统信息
Taro.getSystemInfo({
success: (res) => {
const windowHeight = res.windowHeight
const { windowHeight } = Taro.getWindowInfo();
// 当组件顶部进入视窗下方80%位置时触发
const triggerPoint = windowHeight * 0.8
// console.log('窗口高度:', windowHeight, '触发点:', triggerPoint, 'rect.top:', rect.top)
const triggerPoint = windowHeight * 0.8;
if (rect.top <= triggerPoint && rect.bottom >= 0) {
// console.log('触发数字滚动动画!')
// 触发数字滚动动画
triggerNumberRoll()
}
}
})
} else {
console.log('未找到 RankingCard 容器元素')
}
...
...
Please
register
or
login
to post a comment