Showing
1 changed file
with
6 additions
and
26 deletions
| @@ -115,15 +115,6 @@ export struct BottomNavigationComponent { | @@ -115,15 +115,6 @@ export struct BottomNavigationComponent { | ||
| 115 | .height(CommonConstants.FULL_PARENT) | 115 | .height(CommonConstants.FULL_PARENT) |
| 116 | .padding({ bottom: 15, left: 10, right: 10, top: 2 }) | 116 | .padding({ bottom: 15, left: 10, right: 10, top: 2 }) |
| 117 | .aspectRatio(this.ASPECT_RATIO_1_1) | 117 | .aspectRatio(this.ASPECT_RATIO_1_1) |
| 118 | - .gesture( | ||
| 119 | - TapGesture({ count: 2 }) | ||
| 120 | - .onAction((event: GestureEvent) => { | ||
| 121 | - if (this.currentNavIndex === index) { | ||
| 122 | - // 当前tab,双击事件 | ||
| 123 | - this.autoRefresh++ | ||
| 124 | - } | ||
| 125 | - }) | ||
| 126 | - ) | ||
| 127 | 118 | ||
| 128 | Text(navItem.name) | 119 | Text(navItem.name) |
| 129 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 120 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) |
| @@ -140,8 +131,14 @@ export struct BottomNavigationComponent { | @@ -140,8 +131,14 @@ export struct BottomNavigationComponent { | ||
| 140 | this.barBackgroundColor = Color.White | 131 | this.barBackgroundColor = Color.White |
| 141 | this.currentBottomNavInfo = {} as BottomNavDTO | 132 | this.currentBottomNavInfo = {} as BottomNavDTO |
| 142 | } else { | 133 | } else { |
| 134 | + if (this.currentNavIndex === index) { | ||
| 135 | + // 当前tab,单击事件 | ||
| 136 | + this.autoRefresh++ | ||
| 137 | + } else { | ||
| 138 | + // 切换tab | ||
| 143 | this.currentBottomNavInfo = navItem | 139 | this.currentBottomNavInfo = navItem |
| 144 | } | 140 | } |
| 141 | + } | ||
| 145 | 142 | ||
| 146 | this.currentNavIndex = index; | 143 | this.currentNavIndex = index; |
| 147 | Logger.info(TAG, `onChange, index: ${index}`); | 144 | Logger.info(TAG, `onChange, index: ${index}`); |
| @@ -186,21 +183,4 @@ export struct BottomNavigationComponent { | @@ -186,21 +183,4 @@ export struct BottomNavigationComponent { | ||
| 186 | this.assignChannel.bottomNavId = assignChannel.bottomNavId | 183 | this.assignChannel.bottomNavId = assignChannel.bottomNavId |
| 187 | }, 20) | 184 | }, 20) |
| 188 | } | 185 | } |
| 189 | - | ||
| 190 | - /** | ||
| 191 | - * 双击实现 | ||
| 192 | - */ | ||
| 193 | - // doubleClickTime: number = 0 | ||
| 194 | - | ||
| 195 | - /** | ||
| 196 | - * 双击实现 | ||
| 197 | - */ | ||
| 198 | - // private doubleClick(fun: () => void) { | ||
| 199 | - // let now = DateTimeUtils.getTimeStamp() | ||
| 200 | - // if (now - this.doubleClickTime < 200) { | ||
| 201 | - // fun() | ||
| 202 | - // } else { | ||
| 203 | - // this.doubleClickTime = now | ||
| 204 | - // } | ||
| 205 | - // } | ||
| 206 | } | 186 | } |
-
Please register or login to post a comment