zhangbo1_wd

底导双击刷新改完单击刷新

... ... @@ -115,15 +115,6 @@ export struct BottomNavigationComponent {
.height(CommonConstants.FULL_PARENT)
.padding({ bottom: 15, left: 10, right: 10, top: 2 })
.aspectRatio(this.ASPECT_RATIO_1_1)
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.autoRefresh++
}
})
)
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
... ... @@ -140,7 +131,13 @@ export struct BottomNavigationComponent {
this.barBackgroundColor = Color.White
this.currentBottomNavInfo = {} as BottomNavDTO
} else {
this.currentBottomNavInfo = navItem
if (this.currentNavIndex === index) {
// 当前tab,单击事件
this.autoRefresh++
} else {
// 切换tab
this.currentBottomNavInfo = navItem
}
}
this.currentNavIndex = index;
... ... @@ -186,21 +183,4 @@ export struct BottomNavigationComponent {
this.assignChannel.bottomNavId = assignChannel.bottomNavId
}, 20)
}
/**
* 双击实现
*/
// doubleClickTime: number = 0
/**
* 双击实现
*/
// private doubleClick(fun: () => void) {
// let now = DateTimeUtils.getTimeStamp()
// if (now - this.doubleClickTime < 200) {
// fun()
// } else {
// this.doubleClickTime = now
// }
// }
}
\ No newline at end of file
... ...