diff --git a/features/home/src/main/ets/view/BannerView.ets b/features/home/src/main/ets/view/BannerView.ets index 9a27b6344e65679516652c581987fd4161a02e1b..6c61d3641d8a4e288e1d28f6aa0ad332d4c0c34e 100644 --- a/features/home/src/main/ets/view/BannerView.ets +++ b/features/home/src/main/ets/view/BannerView.ets @@ -57,7 +57,9 @@ export struct BannerView { Column() { // Banner layout. Row() { + // [Start 2] Swiper() { + // [StartExclude 2] LazyForEach(this.bannerDataSource, (item: Banner, index: number) => { Stack() { Image(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? item.getBannerImg().getImgSrcSm() : @@ -129,12 +131,18 @@ export struct BannerView { right: this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? $r('app.float.banner_padding_sm') : 0 }) }, (item: Banner, index: number) => index + JSON.stringify(item)) + // [EndExclude 2] } - .index(2) - .tabIndex(getTabIndex(HomeConstants.DIRECTION_LIST[2])) .displayCount(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? 1 : HomeConstants.TWO) // Interval between banner images .itemSpace(HomeConstants.SWIPER_ITEM_SPACE) + .prevMargin(new BreakpointType($r('app.float.swiper_prev_next_margin_sm'), + $r('app.float.swiper_prev_next_margin_md'), $r('app.float.swiper_prev_next_margin_lg')) + .getValue(this.currentWidthBreakpoint)) + .nextMargin(new BreakpointType($r('app.float.swiper_prev_next_margin_sm'), + $r('app.float.swiper_prev_next_margin_md'), $r('app.float.swiper_prev_next_margin_lg')) + .getValue(this.currentWidthBreakpoint)) + // [End 2] // Setting the navigation point Style of the swiper. .indicator(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_SM ? Indicator.dot() .itemWidth($r('app.float.swiper_item_size')) @@ -151,12 +159,8 @@ export struct BannerView { (this.currentTopIndex === 1) ? Visibility.None : Visibility.Visible) .effectMode(EdgeEffect.None) // The sizes of the front and rear banners on the MD and LG devices are different. - .prevMargin(new BreakpointType($r('app.float.swiper_prev_next_margin_sm'), - $r('app.float.swiper_prev_next_margin_md'), $r('app.float.swiper_prev_next_margin_lg')) - .getValue(this.currentWidthBreakpoint)) - .nextMargin(new BreakpointType($r('app.float.swiper_prev_next_margin_sm'), - $r('app.float.swiper_prev_next_margin_md'), $r('app.float.swiper_prev_next_margin_lg')) - .getValue(this.currentWidthBreakpoint)) + .index(2) + .tabIndex(getTabIndex(HomeConstants.DIRECTION_LIST[2])) // Switch the tab to switch the banner display effect. Row({ space: HomeConstants.BANNER_ROW_SPACE }) { diff --git a/features/search/src/main/ets/view/SearchForHua.ets b/features/search/src/main/ets/view/SearchForHua.ets index a48db0e5fa39a84d92ec9b59f4e150d70ccd4110..d2a1f51d30f44449d91a696c990fb3fb67c1c8c7 100644 --- a/features/search/src/main/ets/view/SearchForHua.ets +++ b/features/search/src/main/ets/view/SearchForHua.ets @@ -24,7 +24,9 @@ export struct SearchForHua { build() { Column() { + // [Start 1] List() { + // [StartExclude 1] ForEach(SearchConstants.HUA_LIST, (item: string, index: number) => { ListItem() { Column() { @@ -52,9 +54,11 @@ export struct SearchForHua { }) } }) + // [EndExclude 1] } .lanes(this.currentWidthBreakpoint === BreakpointConstants.BREAKPOINT_LG ? SearchConstants.SEARCH_LIST_LANES[1] : SearchConstants.SEARCH_LIST_LANES[2]) + // [End 1] } .layoutWeight(1) .padding({ top: $r('app.float.search_hua_list_padding') })