From effed5014c00dda347b69177ddc1da301f2deddb Mon Sep 17 00:00:00 2001 From: yulei <1002365491@qq.com> Date: Mon, 16 Jun 2025 15:05:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=84=E8=8C=83=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/constants/CommonConstants.ets | 35 ++----------------- .../hot/src/main/ets/view/CardItemView.ets | 2 +- features/hot/src/main/ets/view/FoundView.ets | 6 ++-- .../hot/src/main/ets/view/HotColumnView.ets | 2 +- .../hot/src/main/ets/view/HotTitleView.ets | 12 +++---- features/rank/Index.ets | 1 + .../main/ets/constants/CommonConstants.ets | 9 ----- .../rank/src/main/ets/view/HotRankPage.ets | 4 +-- .../main/ets/entryability/EntryAbility.ets | 3 +- .../phone/src/main/ets/pages/MainPage.ets | 2 +- .../src/main/ets/view/TabContentView.ets | 8 +++-- 11 files changed, 24 insertions(+), 60 deletions(-) diff --git a/features/hot/src/main/ets/constants/CommonConstants.ets b/features/hot/src/main/ets/constants/CommonConstants.ets index 71819aa..c40c8ef 100644 --- a/features/hot/src/main/ets/constants/CommonConstants.ets +++ b/features/hot/src/main/ets/constants/CommonConstants.ets @@ -18,147 +18,118 @@ export class CommonConstants { * Rank item margin left sm. */ static readonly RANK_ITEM_ML_SM: string = '2.2%'; - /** * Rank item margin left md. */ static readonly RANK_ITEM_ML_MD: string = '1.2%'; - /** * Rank item margin left lg. */ static readonly RANK_ITEM_ML_LG: string = '1.2%'; - /** * Rank title margin left. */ static readonly RANK_TITLE_MARGIN_LEFT: string = '2.2%'; - /** * Search bar width md. */ static readonly SEARCH_BAR_WIDTH_MD: string = '27.2%'; - /** *Search bar width lg. */ static readonly SEARCH_BAR_WIDTH_LG: string = '18.1%'; - /** * Animation duration. */ static readonly TAB_ANIMATION_DURATION: number = 300; - /** * Water flow columns template normal. */ static readonly WATER_FLOW_COLUMNS_TEMPLATE_NORMAL: string = '1fr'; - /** * Water flow columns template lg. */ static readonly WATER_FLOW_COLUMNS_TEMPLATE_LG: string = '1fr 1fr'; - /** * Hot column item space sm. */ - static readonly HOT_COLUMN_IS_SM:string = '0vp'; - + static readonly HOT_COLUMN_IS_SM: string = '0vp'; /** * Hot column item space md. */ - static readonly HOT_COLUMN_IS_MD:string = '49vp'; - + static readonly HOT_COLUMN_IS_MD: string = '49vp'; /** * Hot column item space lg. */ - static readonly HOT_COLUMN_IS_LG:string = '81vp'; - + static readonly HOT_COLUMN_IS_LG: string = '81vp'; /** * Swiper display count one. */ static readonly SWIPER_DISPLAY_COUNT_ONE: number = 1; - /** * Swiper display count two. */ static readonly SWIPER_DISPLAY_COUNT_TWO: number = 2; - /** * Swiper display count three. */ static readonly SWIPER_DISPLAY_COUNT_THREE: number = 3; - /** * Hot column max count. */ static readonly HOT_COLUMN_MAX_COUNT: number = 5; - /** * Hot item column space. */ static readonly HOT_ITEM_COLUMN_SPACE: string = '4vp'; - /** * Top count. */ static readonly TOP_COUNT: number = 3; - /** * Search bar opacity. */ static readonly SEARCH_BAR_OPACITY: number = 0.9; - /** * Card item shadow radius. */ static readonly CARD_ITEM_SHADOW_RADIUS: number = 10; - /** * Icon more opacity. */ static readonly ICON_MORE_OPACITY: number = 0.4; - /** * Window padding sm. */ static readonly WINDOW_PADDING_SM: string = '16vp'; - /** * Window padding md. */ static readonly WINDOW_PADDING_MD: string = '23vp'; - /** * Window padding lg. */ static readonly WINDOW_PADDING_LG: string = '32vp'; - /** * Linear gradient angel. */ static readonly LINEAR_GRADIENT_ANGEL: number = 180; - /** * Linear gradient from color. */ static readonly LINEAR_GRADIENT_FROM_COLOR: string = '#FFFFFF'; - /** * Linear gradient to color. */ static readonly LINEAR_GRADIENT_TO_COLOR: string = '#F1F3F5'; - /** * Linear gradient to area. */ static readonly LINEAR_GRADIENT_TO_AREA: number = 0.02; - /** * Follow item picture max height. */ static readonly FOLLOW_ITEM_PICTURE_MAX_HEIGHT: string = '60%'; - /** * Follow title space. */ diff --git a/features/hot/src/main/ets/view/CardItemView.ets b/features/hot/src/main/ets/view/CardItemView.ets index 4e057d7..23adb1f 100644 --- a/features/hot/src/main/ets/view/CardItemView.ets +++ b/features/hot/src/main/ets/view/CardItemView.ets @@ -27,7 +27,7 @@ export struct CardItemView { name: string = ''; aboutToAppear(): void { - app.setImageRawDataCacheSize(1024*1024*100); + app.setImageRawDataCacheSize(1024 * 1024 * 100); app.setImageCacheCount(100); } diff --git a/features/hot/src/main/ets/view/FoundView.ets b/features/hot/src/main/ets/view/FoundView.ets index b69991c..2319b70 100644 --- a/features/hot/src/main/ets/view/FoundView.ets +++ b/features/hot/src/main/ets/view/FoundView.ets @@ -28,7 +28,7 @@ export struct FoundView { @State tabIndexSelected: number = 0; jumpDetail() { - this.pageInfos.pushPath({name : 'detailPage'}); + this.pageInfos.pushPath({ name: 'detailPage' }); } @Builder @@ -133,10 +133,10 @@ export struct FoundView { }) } .borderRadius(this.currentBreakpoint === Breakpoint.BREAKPOINT_LG ? - $r('app.float.water_flow_br') : $r('app.float.zero')) + $r('app.float.water_flow_br') : $r('app.float.zero')) .backgroundColor($r('app.color.white')) .margin(this.currentBreakpoint === Breakpoint.BREAKPOINT_LG ? - $r('app.float.water_flow_margin') : $r('app.float.zero')) + $r('app.float.water_flow_margin') : $r('app.float.zero')) } }, (item: CardItem, index: number) => index + JSON.stringify(item)) // [EndExclude foundView] diff --git a/features/hot/src/main/ets/view/HotColumnView.ets b/features/hot/src/main/ets/view/HotColumnView.ets index 082a319..89ce581 100644 --- a/features/hot/src/main/ets/view/HotColumnView.ets +++ b/features/hot/src/main/ets/view/HotColumnView.ets @@ -37,7 +37,7 @@ export struct HotColumnView { item: item, showDetail: true, indexWidth: item.index <= Common.HOT_COLUMN_MAX_COUNT ? $r('app.float.index_width_normal') : - $r('app.float.index_width_more'), + $r('app.float.index_width_more'), indexIconGap: $r('app.float.index_icon_gap') }) } diff --git a/features/hot/src/main/ets/view/HotTitleView.ets b/features/hot/src/main/ets/view/HotTitleView.ets index 54dce74..6b1a6a3 100644 --- a/features/hot/src/main/ets/view/HotTitleView.ets +++ b/features/hot/src/main/ets/view/HotTitleView.ets @@ -27,18 +27,18 @@ export struct HotTitleView { Row() { Text($r('app.string.found')) .fontSize(this.isFoundSelected ? $r('app.float.title_font_size_selected') : - $r('app.float.title_font_size_normal')) + $r('app.float.title_font_size_normal')) .fontWeight(BaseCommon.FONT_WEIGHT_500) .fontColor(Color.Black) .opacity(this.isFoundSelected ? $r('app.float.title_opacity_selected') : - $r('app.float.title_opacity_normal')) - .onClick(()=>{ + $r('app.float.title_opacity_normal')) + .onClick(() => { this.isFoundSelected = true; }) Text($r('app.string.follow')) .fontSize(this.isFoundSelected ? $r('app.float.title_font_size_normal') : - $r('app.float.title_font_size_selected')) + $r('app.float.title_font_size_selected')) .fontWeight(BaseCommon.FONT_WEIGHT_500) .fontColor(Color.Black) .margin({ @@ -46,8 +46,8 @@ export struct HotTitleView { $r('app.float.title_margin_left_lg')).getValue(this.currentBreakpoint) }) .opacity(this.isFoundSelected ? $r('app.float.title_opacity_normal') : - $r('app.float.title_opacity_selected')) - .onClick(()=>{ + $r('app.float.title_opacity_selected')) + .onClick(() => { this.isFoundSelected = false; }) } diff --git a/features/rank/Index.ets b/features/rank/Index.ets index 2ed5065..e11164d 100644 --- a/features/rank/Index.ets +++ b/features/rank/Index.ets @@ -14,4 +14,5 @@ */ export { HotListItemView } from './src/main/ets/view/HotListItemView'; + export { HotRankPage } from './src/main/ets/view/HotRankPage'; \ No newline at end of file diff --git a/features/rank/src/main/ets/constants/CommonConstants.ets b/features/rank/src/main/ets/constants/CommonConstants.ets index 4304fcd..f10f1bb 100644 --- a/features/rank/src/main/ets/constants/CommonConstants.ets +++ b/features/rank/src/main/ets/constants/CommonConstants.ets @@ -18,47 +18,38 @@ export class CommonConstants { * Linear gradient angle. */ static readonly LINEAR_GRADIENT_ANGLE: number = 180; - /** * Linear gradient from. */ static readonly LINEAR_GRADIENT_FROM: number = 0.01; - /** * Linear gradient to. */ static readonly LINEAR_GRADIENT_TO: number = 0.92; - /** * Linear gradient from color. */ static readonly LINEAR_GRADIENT_FROM_COLOR: string = '#80307AF8'; - /** * Linear gradient to color. */ static readonly LINEAR_GRADIENT_TO_COLOR: string = '#000A59F7'; - /** * Subtitle opacity. */ static readonly SUBTITLE_OPACITY: number = 0.6; - /** * Swiper item space. */ static readonly SWIPER_ITEM_SPACE: string = '20vp'; - /** * Title content space. */ static readonly TITLE_CONTENT_SPACE: string = '4vp'; - /** * Top count. */ static readonly TOP_COUNT: number = 3; - /** * Window padding half sm. */ diff --git a/features/rank/src/main/ets/view/HotRankPage.ets b/features/rank/src/main/ets/view/HotRankPage.ets index ae8f4f6..cb4d5bc 100644 --- a/features/rank/src/main/ets/view/HotRankPage.ets +++ b/features/rank/src/main/ets/view/HotRankPage.ets @@ -69,10 +69,10 @@ export struct HotRankPage { }) .margin({ top: this.titleMarginTop === MIN_MARGIN_TOP ? - $r('app.float.hot_list_view_min_mt') : $r('app.float.hot_list_view_max_mt') + $r('app.float.hot_list_view_min_mt') : $r('app.float.hot_list_view_max_mt') }) .width(this.currentBreakpoint === Breakpoint.BREAKPOINT_SM ? - BaseCommon.FULL_PERCENT : $r('app.float.zero')) + BaseCommon.FULL_PERCENT : $r('app.float.zero')) .padding({ left: new BreakpointType($r('app.float.window_padding_left_sm'), $r('app.float.window_padding_left_md'), $r('app.float.window_padding_left_lg') diff --git a/products/phone/src/main/ets/entryability/EntryAbility.ets b/products/phone/src/main/ets/entryability/EntryAbility.ets index d7ad56a..9d527a0 100644 --- a/products/phone/src/main/ets/entryability/EntryAbility.ets +++ b/products/phone/src/main/ets/entryability/EntryAbility.ets @@ -20,7 +20,6 @@ import { window, display } from '@kit.ArkUI'; import { CommonConstants as BaseCommon, BreakpointConstants } from 'base' export default class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } @@ -71,7 +70,7 @@ export default class EntryAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } - private updateBreakpoint(windowWidth: number) :void{ + private updateBreakpoint(windowWidth: number): void { let windowWidthVp = windowWidth / display.getDefaultDisplaySync().densityPixels; let curBp: string = ''; if (windowWidthVp < BreakpointConstants.BREAKPOINT_RANGES[1]) { diff --git a/products/phone/src/main/ets/pages/MainPage.ets b/products/phone/src/main/ets/pages/MainPage.ets index e042774..51692bf 100644 --- a/products/phone/src/main/ets/pages/MainPage.ets +++ b/products/phone/src/main/ets/pages/MainPage.ets @@ -49,7 +49,7 @@ struct Index { NavDestination() { DetailPage() } - .onBackPressed(()=>{ + .onBackPressed(() => { AppStorage.setOrCreate('isDetailPage', false); return false; }) diff --git a/products/phone/src/main/ets/view/TabContentView.ets b/products/phone/src/main/ets/view/TabContentView.ets index 59febd6..8be43d8 100644 --- a/products/phone/src/main/ets/view/TabContentView.ets +++ b/products/phone/src/main/ets/view/TabContentView.ets @@ -84,13 +84,15 @@ export struct TabContentView { }) .barHeight(this.currentBreakpoint === Breakpoint.BREAKPOINT_LG ? Common.HALF_PERCENT : $r('app.float.bar_height')) .barWidth(this.currentBreakpoint === Breakpoint.BREAKPOINT_LG ? - $r('app.float.tab_bar_width') : Common.FULL_PERCENT) + $r('app.float.tab_bar_width') : Common.FULL_PERCENT) .scrollable(false) .height(Common.FULL_PERCENT) } .backgroundColor($r('app.color.bar_background_color')) - .padding({ bottom: this.currentBreakpoint !== Breakpoint.BREAKPOINT_LG ? - $r('app.float.tab_content_pb') : $r('app.float.zero') }) + .padding({ + bottom: this.currentBreakpoint !== Breakpoint.BREAKPOINT_LG ? + $r('app.float.tab_content_pb') : $r('app.float.zero') + }) .height(Common.FULL_PERCENT) } } \ No newline at end of file -- Gitee