Showing
2 changed files
with
9 additions
and
2 deletions
| @@ -347,14 +347,18 @@ export struct TopNavigationComponentNew { | @@ -347,14 +347,18 @@ export struct TopNavigationComponentNew { | ||
| 347 | } else if (this.isLayoutByIndex(index)) { | 347 | } else if (this.isLayoutByIndex(index)) { |
| 348 | ProcessUtils.gotoENewsPaper() | 348 | ProcessUtils.gotoENewsPaper() |
| 349 | } else { | 349 | } else { |
| 350 | - this.currentTopNavSelectedIndex = index | ||
| 351 | this.changePage(index) | 350 | this.changePage(index) |
| 352 | } | 351 | } |
| 353 | } | 352 | } |
| 354 | }) | 353 | }) |
| 355 | } | 354 | } |
| 356 | 355 | ||
| 356 | + /** | ||
| 357 | + * 改变频道页 | ||
| 358 | + * @param index 频道所在的序列号 | ||
| 359 | + */ | ||
| 357 | private changePage(index: number) { | 360 | private changePage(index: number) { |
| 361 | + this.currentTopNavSelectedIndex = index | ||
| 358 | this.swiperController.changeIndex(index) | 362 | this.swiperController.changeIndex(index) |
| 359 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) | 363 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) |
| 360 | } | 364 | } |
| @@ -26,7 +26,9 @@ import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentio | @@ -26,7 +26,9 @@ import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentio | ||
| 26 | import { CardParser } from '../CardParser' | 26 | import { CardParser } from '../CardParser' |
| 27 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; | 27 | import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 28 | const TAG = 'PeopleShipMainComponent'; | 28 | const TAG = 'PeopleShipMainComponent'; |
| 29 | -@Preview | 29 | +/** |
| 30 | + * 人民号 --- 关注 | ||
| 31 | + */ | ||
| 30 | @Component | 32 | @Component |
| 31 | export struct PeopleShipMainComponent { | 33 | export struct PeopleShipMainComponent { |
| 32 | @State private pageModel: PageModel = new PageModel(); | 34 | @State private pageModel: PageModel = new PageModel(); |
| @@ -422,6 +424,7 @@ export struct PeopleShipMainComponent { | @@ -422,6 +424,7 @@ export struct PeopleShipMainComponent { | ||
| 422 | } | 424 | } |
| 423 | // 当前页面,自动刷新数据 | 425 | // 当前页面,自动刷新数据 |
| 424 | Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) | 426 | Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) |
| 427 | + this.listScroller.scrollToIndex(0) | ||
| 425 | this.currentPage = 1 | 428 | this.currentPage = 1 |
| 426 | this.getData() | 429 | this.getData() |
| 427 | } | 430 | } |
-
Please register or login to post a comment