diff --git a/README.en.md b/README.en.md index bec2951281bdbeeffd497a4049c4d9636b9db933..0be20fe55635ad6d2b43b2f485b5ed53f93f2aa2 100644 --- a/README.en.md +++ b/README.en.md @@ -29,13 +29,16 @@ You can click different list items on the home page to display the effect of res Project Directory ``` ├──entry/src/main/ets/ -│ ├──constants +│ ├──constants +│ │ ├──CommonConstants.ets // common constant class +│ │ ├──ConversationConstants.ets // conversation related constant +│ │ └──ProductDetailConstants.ets // product related constant │ ├──entryability │ │ └──EntryAbility.ets │ ├──entrybackupability │ │ └──EntryBackupAbility.ets │ ├──pages -│ │ ├──DoubleColumnChatLayout.ets // Single/Dual-column chat page +│ │ ├──DoubleColumnConversation.ets // Single/Dual-column chat page │ │ ├──DoubleColumnLayout.ets // Single/Dual-column page │ │ ├──GridLayout.ets // Grid page │ │ ├──IndentedLayout.ets // Indentation layout page @@ -93,7 +96,7 @@ N/A. ## Constraints -1. This sample is only supported on Huawei phones running standard systems. +1. The sample app is supported on Huawei phones, tablets, and PC/2in1 running the standard system. 2. The HarmonyOS version must be HarmonyOS 5.0.5 Release or later. 3. The DevEco Studio version must be DevEco Studio 5.0.5 Release or later. 4. The HarmonyOS SDK version must be HarmonyOS 5.0.5 Release SDK or later. diff --git a/README.md b/README.md index ad403eb4692dae33302671ffe69c037ad858e7be..2f51cfa2993f5363b0d88e33ae9fd4e0606c2144 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,16 @@ ``` ├──entry/src/main/ets/ -│ ├──constants +│ ├──constants +│ │ ├──CommonConstants.ets // 通用常量类 +│ │ ├──ConversationConstants.ets // 会话相关常量类 +│ │ └──ProductDetailConstants.ets // 商品详情常量类 │ ├──entryability │ │ └──EntryAbility.ets │ ├──entrybackupability │ │ └──EntryBackupAbility.ets │ ├──pages -│ │ ├──DoubleColumnChatLayout.ets // 单双栏聊天页 +│ │ ├──DoubleColumnConversation.ets // 单双栏聊天页 │ │ ├──DoubleColumnLayout.ets // 单双栏页 │ │ ├──GridLayout.ets // 网格页 │ │ ├──IndentedLayout.ets // 缩进布局页 @@ -95,7 +98,7 @@ ## 约束与限制 -1. 本示例仅支持标准系统上运行,支持设备:华为手机。 +1. 本示例仅支持标准系统上运行,支持设备:华为手机、平板、PC/2in1。 2. HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 3. DevEco Studio版本:DevEco Studio 5.0.5 Release及以上。 4. HarmonyOS SDK版本:HarmonyOS 5.0.5 Release SDK及以上。 diff --git a/entry/src/main/ets/constants/ClassifyConstants.ets b/entry/src/main/ets/constants/ClassifyConstants.ets deleted file mode 100644 index 8d4806b7ac13bd3f89f77a140288e456177f049d..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/constants/ClassifyConstants.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export class ClassifyConstants { - /** - * Shop Matrix. - */ - static readonly SHOP_MATRIX: Array> = [ - ['Mate 60 Pro+', 'Mate 60', 'Mate 60 Pro', 'Mate X5'], - ['Mate 60 Pro+', 'Mate 60', 'Mate 60 Pro', 'Mate X5', 'Mate X3', 'Mate 50', 'Mate 50 Pro', 'Mate Xs 2', 'Mate 50E', - 'Mate 50 RS'], - ['P60 ', 'P60 Pro', 'P60 Art ', 'P50 Pro', 'P50E', 'P50 Pocket']]; - /** - * Banner image scale. - */ - static readonly BANNER_IMAGE_RATIO: number = 2.32; - /** - * Number of pictures displayed in the banner. - */ - static readonly SWIPER_DISPLAY_COUNT: number[] = [1, 2, 3]; - /** - * Interval of swiper. - */ - static readonly SWIPER_ITEM_SPACE: number[] = [0, 12, 16]; - /** - * Interval of swiper. - */ - static readonly SWIPER_DIVIDER_WIDTH: string = '2vp'; - /** - * Grid row gutters. - */ - static readonly GRID_ROW_GUTTERS: number[] = [24, 8, 16, 12]; - /** - * Page info list. - */ - static readonly PAGE_INFO_LIST: string[] = ['liveHome', 'moreDetail', 'productHome']; -} \ No newline at end of file diff --git a/entry/src/main/ets/constants/CommonConstants.ets b/entry/src/main/ets/constants/CommonConstants.ets index c9ebb47e7d370680d7ca914638e30ba211a897eb..27d3a5504b65f0fbab4bd17f235cbd3b2b83da09 100644 --- a/entry/src/main/ets/constants/CommonConstants.ets +++ b/entry/src/main/ets/constants/CommonConstants.ets @@ -26,43 +26,6 @@ const context = uiContext?.getHostContext() as common.UIAbilityContext; * Common constants for all features. */ export class CommonConstants { - /** - * Breakpoint sm. - */ - static readonly BREAK_POINT_SM: string = 'sm'; - /** - * Breakpoint md. - */ - static readonly BREAK_POINT_MD: string = 'md'; - /** - * Breakpoint lg. - */ - static readonly BREAK_POINT_LG: string = 'lg'; - /** - * DeviceType PC/2in1. - */ - static readonly DEVICE_TYPE_2IN1: string = '2in1'; - /** - * The break point value. - */ - static readonly BREAK_POINTS_VALUE: Array = ['300', '600', '840']; - /** - * Notes icon list. - */ - static readonly MEMO_LIST_ICON: Array = [ - $r('sys.symbol.doc_plaintext'), - $r('sys.symbol.star'), - $r('sys.symbol.lock'), - $r('sys.symbol.trash') - ]; - /** - * Notes number list. - */ - static readonly MEMO_LIST_NUMBER: Array = ['18', '2', '1', '10']; - /** - * Folder list number. - */ - static readonly FOLDER_LIST_NUMBER: Array = ['18', '2', '5', '7', '11']; /** * start time. */ @@ -200,10 +163,6 @@ export class CommonConstants { * Control button top. */ static readonly CONTROL_BUTTON_TOP: number = 44; - /** - * Control notes button top. - */ - static readonly CONTROL_NOTES_BUTTON_TOP: number = 12; /** * Common margin. */ @@ -276,11 +235,6 @@ export class CommonConstants { return []; } })(); - /** - * Notes page C English content. - */ - static readonly NOTES_ENGLISH_CONTENT: string = - 'When I was young. I\'d listen to the radio. Waiting for my favorite songs. When they played I\'d sing along. It made me smile...'; /** * Common font weight 500. */ @@ -293,44 +247,16 @@ export class CommonConstants { * Trip list. */ static readonly TRIP_LIST: Array = [1, 2]; - /** - * Notes content title height. - */ - static readonly NOTES_TITLE_HEIGHT: number = 230; - /** - * Notes content title height on PC/2in1. - */ - static readonly NOTES_TITLE_2IN1: number = 120; /** * Text opacity. */ static readonly TEXT_OPACITY: number[] = [1, 0.4, 0.6, 0.05]; - /** - * Window util list. - */ - static readonly WINDOW_UTIL_LIST: string[] = ['windowUtil', 'secondWindowUtil']; - - /** - * Default window width. - */ - static readonly DEFAULT_WINDOW_WIDTH: number = 331; - - /** - * Lg sidebar width. - */ - static readonly LG_SIDEBAR_WIDTH: number = 96; - /** * Two. */ static readonly TWO: number = 2; - /** - * Three. - */ - static readonly THREE: number = 3; - /** * Four. */ @@ -341,11 +267,6 @@ export class CommonConstants { */ static readonly FIVE: number = 5; - /** - * Width unit. - */ - static readonly WIDTH_UNIT: string = 'vp'; - /** * Constant for screen dpi. */ @@ -371,63 +292,4 @@ export class CommonConstants { */ static readonly BIND_SHEET_PAGE_TYPES: string[] = ['ShopBag', 'PayCard', 'ProductDetail', 'detailPayCard']; - /** - * Idle state of avPlayer. - */ - static readonly AV_PLAYER_IDLE_STATE: string = 'idle'; - - /** - * Initialized state of avPlayer. - */ - static readonly AV_PLAYER_INITIALIZED_STATE: string = 'initialized'; - - /** - * Prepared state of avPlayer. - */ - static readonly AV_PLAYER_PREPARED_STATE: string = 'prepared'; - - /** - * Playing state of avPlayer. - */ - static readonly AV_PLAYER_PLAYING_STATE: string = 'playing'; - - /** - * Pause state of avPlayer. - */ - static readonly AV_PLAYER_PAUSED_STATE: string = 'paused'; - - /** - * Completed state of avPlayer. - */ - static readonly AV_PLAYER_COMPLETED_STATE: string = 'completed'; - - /** - * Stopped state of avPlayer. - */ - static readonly AV_PLAYER_STOPPED_STATE: string = 'stopped'; - - /** - * Release state of avPlayer. - */ - static readonly AV_PLAYER_RELEASE_STATE: string = 'released'; - - /** - * Error state of avPlayer. - */ - static readonly AV_PLAYER_ERROR_STATE: string = 'error'; - - /** - * Live video name. - */ - static readonly LIVE_VIDEO_NAME: string = 'live.mp4'; - - /** - * Pip window util. - */ - static readonly PIP_WINDOW_UTIL: string = 'pipWindowUtil'; - - /** - * Av player util. - */ - static readonly AV_PLAYER_UTIL: string = 'avPlayerUtil'; } \ No newline at end of file diff --git a/entry/src/main/ets/constants/ConversationConstants.ets b/entry/src/main/ets/constants/ConversationConstants.ets index 59a8b80cb96d1e3516a22dac1583ab37ca0f63cd..85d96724c351f0c371a2bb8756b81cd2ccae4781 100644 --- a/entry/src/main/ets/constants/ConversationConstants.ets +++ b/entry/src/main/ets/constants/ConversationConstants.ets @@ -14,61 +14,23 @@ */ export class HomeConstants { - /** - * Grid row column list. - */ - static readonly GRID_ROW_COLUMNS: number[] = [1, 2, 3, 4, 5]; - static readonly GRID_COL_COLUMNS: number[] = [0, 1, 2, 3, 4, 5]; - static readonly TAB_MESSAGE_INDEX = 0; - /** - * Index of CONTACTS tab. - */ - static readonly TAB_CONTACTS_INDEX = 1; - /** - * Index of SOCIAL_CIRCLE tab. - */ - static readonly TAB_SOCIAL_CIRCLE_INDEX = 2; /** * Index of ME tab. */ - static readonly TAB_ME_INDEX = 3; static readonly CONTACTS_DETAIL_AVATAR_Z_INDEX = 2; - /** - * Image message - */ - static readonly USER_PHONE = '15988880000'; - static readonly LAST_POST = $r('app.string.news'); - static readonly IMAGES_SCOPE = 2; - static readonly IMAGE_ASPECT_RATIO = 1; - /** - * Contacts list detail - */ - static readonly CONTACTS_LIST = [$r('app.string.group'), $r('app.string.card')]; - static readonly CONTACTS_DEFAULT_SELECTED_INDEX = 0; - static readonly CONTACTS_DEFAULT_SELECTED_NAME = $r('app.string.Alan'); /** * Conversation detail */ - static readonly CONVERSATION_LIST_APPLET = [$r('app.string.milk'), $r('app.string.Speed'), $r('app.string.happy')]; - static readonly CONVERSATION_LIST_DOCUMENT = [$r('app.string.plan'), $r('app.string.jack'), $r('app.string.ok')]; - static readonly IS_APPLET_CONVERSATION = true; - static readonly IS_DOCUMENT_CONVERSATION = true; static readonly IS_RECEIVED = true; - static readonly CONVERSATION_DEFAULT_SIZE = 3; - static readonly CONVERSATION_TITLE = $r('app.string.message'); /** * Conversation top search */ static readonly SEARCH_TEXT_FLEX_BASIS = 150; - static readonly SEARCH_TEXT_INPUT = $r('app.string.search'); - static readonly ENABLE_KEY_BOARD_ON_FOCUS = false; static readonly FLEX_BASIS_AUTO = 'auto'; /** * Conversation detail */ static readonly CONVERSATION_DETAIL_BOTTOM_TEXT_RADIUS = 20; - static readonly CONVERSATION_DETAIL_TOP_TITLE = '张小萌'; - static readonly CONVERSATION_DETAIL_MAX_LINE = 1; static readonly CONVERSATION_DETAIL_FILL_OPACITY = 1; static readonly CONVERSATION_DETAIL_STROKE_WIDTH = 1; static readonly PATH_BORDER_RADIUS = 8; @@ -87,11 +49,6 @@ export class HomeConstants { * Default avatar */ static readonly DEFAULT_AVATAR = $r('app.media.avatar1') - /** - * Navigation navBarWidth percent - */ - static readonly NAVIGATION_NAV_BAR_WIDTH_MD = '50%' - static readonly NAVIGATION_NAV_BAR_WIDTH_LG = '44.5%' } /** @@ -112,9 +69,3 @@ export enum CurrentPage { SOCIAL_CIRCLE = 2, ME = 3 } - -export enum DeviceTypes { - PHONE = 'phone', - TABLET = 'tablet', - "2IN1" = '2in1', -} \ No newline at end of file diff --git a/entry/src/main/ets/constants/DetailConstants.ets b/entry/src/main/ets/constants/ProductDetailConstants.ets similarity index 96% rename from entry/src/main/ets/constants/DetailConstants.ets rename to entry/src/main/ets/constants/ProductDetailConstants.ets index c0bfd5c876986e270a3fa8456516561310755b24..adfe707c9ec228504de6d207315d9fdd97398008 100644 --- a/entry/src/main/ets/constants/DetailConstants.ets +++ b/entry/src/main/ets/constants/ProductDetailConstants.ets @@ -48,10 +48,6 @@ export class DetailConstants { static readonly RECOMMENDED_CONFIG_PRODUCTS: Resource[] = [$r('app.media.recommended_config_1'), $r('app.media.recommended_config_2'), $r('app.media.recommended_config_3'), $r('app.media.recommended_config_4')]; - /** - * Param string list. - */ - static readonly PARAM_STRING_LIST: string[] = ['shoppingBag', 'customerService']; /** * Product name list. */ @@ -194,18 +190,9 @@ export class DetailConstants { } }); - /** - * 80 percent. - */ - static readonly EIGHTY_PERCENT: string = '80%'; - /** * Comments list. */ static readonly COMMENTS_LIST: number[] = [1, 2]; - /** - * Navigation id. - */ - static readonly NAVIGATION_ID: string = 'navId'; } \ No newline at end of file diff --git a/entry/src/main/ets/pages/DoubleColumnChatLayout.ets b/entry/src/main/ets/pages/DoubleColumnConversation.ets similarity index 100% rename from entry/src/main/ets/pages/DoubleColumnChatLayout.ets rename to entry/src/main/ets/pages/DoubleColumnConversation.ets diff --git a/entry/src/main/ets/views/DoubleConversationView/ContactsItem.ets b/entry/src/main/ets/views/DoubleConversationView/ContactsItem.ets deleted file mode 100755 index d6137b8bb7f9c8717d51dbe55fa9857a4a4fa161..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/views/DoubleConversationView/ContactsItem.ets +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Component -export struct ContactsItem { - private name?: Resource; - private icon?: Resource; - - build() { - Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { - Column() { - Image(this.icon) - .height(40) - .width(40) - } - .width(40) - .margin({ left: 24, right: 12 }) - - Column() { - Text(this.name) - .fontSize(16) - .fontWeight(500) - .lineHeight('22fp') - .fontFamily('HarmonyHeiTi-Medium') - } - .flexShrink(1) - .margin({ left: 12 }) - - Blank() - } - .height('100%') - .width('100%') - } -} \ No newline at end of file diff --git a/entry/src/main/ets/views/DoubleConversationView/ConversationList.ets b/entry/src/main/ets/views/DoubleConversationView/ConversationList.ets index 9cf654597347e3e39896ddea157d1deaaa59dac5..79931c9604c85e2cb97de77466160dcadb2e3b89 100755 --- a/entry/src/main/ets/views/DoubleConversationView/ConversationList.ets +++ b/entry/src/main/ets/views/DoubleConversationView/ConversationList.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { ConversationDataInterface, ConversationListData } from './viewmodel/ConversationViewModel'; +import { ConversationDataInterface, ConversationListData } from './model/ConversationModel'; import { ConversationItem } from './ConversationItem'; import { HomeTopSearch } from './HomeTopSearch'; import { deviceInfo } from '@kit.BasicServicesKit'; diff --git a/entry/src/main/ets/views/DoubleConversationView/MessageBubble.ets b/entry/src/main/ets/views/DoubleConversationView/MessageBubble.ets index 598c800277686211acbaa0402e567b7c3f93e3cb..9f96fd5cb3baddbec103e3b65eaf43a597313840 100755 --- a/entry/src/main/ets/views/DoubleConversationView/MessageBubble.ets +++ b/entry/src/main/ets/views/DoubleConversationView/MessageBubble.ets @@ -14,7 +14,7 @@ */ import { HomeConstants } from '../../constants/ConversationConstants'; -import { ConversationListData } from './viewmodel/ConversationViewModel'; +import { ConversationListData } from './model/ConversationModel'; import { NormalText, IntroduceText } from './text/NormalText' @Component diff --git a/entry/src/main/ets/views/DoubleConversationView/viewmodel/ConversationViewModel.ets b/entry/src/main/ets/views/DoubleConversationView/model/ConversationModel.ets similarity index 60% rename from entry/src/main/ets/views/DoubleConversationView/viewmodel/ConversationViewModel.ets rename to entry/src/main/ets/views/DoubleConversationView/model/ConversationModel.ets index 5eae3285b82a806d2594af989a0d84cc25ad8074..5c112eb98b75964b252546b9eefbd11b76fbf373 100755 --- a/entry/src/main/ets/views/DoubleConversationView/viewmodel/ConversationViewModel.ets +++ b/entry/src/main/ets/views/DoubleConversationView/model/ConversationModel.ets @@ -13,10 +13,6 @@ * limitations under the License. */ -import { Want, common } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; - interface ConversationDataInterface { name: Resource msg: Resource @@ -39,44 +35,4 @@ const ConversationListData: ConversationDataInterface[] = [ { name: $r('app.string.sport_club'), msg: $r('app.string.waiting_for_long'), time: $r('app.string.yesterday'), icon: $r('app.media.avatar1') }, ]; -class ConversationViewModel { - public startAppletAbility(uiContext:UIContext, context: common.UIAbilityContext, index: number): void { - const want: Want = { - bundleName: uiContext.getHostContext()!.applicationInfo.name, - abilityName: 'AppletAbility', - parameters: { - position: index - } - }; - try { - context.startAbility(want, (err: BusinessError) => { - if (err.code) { - hilog.error(0x0000, 'ConversationViewModel',`startAbility failed, code is ${err.code}, message is ${err.message}`); - } - }); - } catch (error) { - hilog.error(0x00004, 'ConversationViewModel', '%{public}s', error); - } - } - - public startDocumentAbility(uiContext:UIContext,context: common.UIAbilityContext, index: number): void { - const want: Want = { - bundleName: uiContext.getHostContext()!.applicationInfo.name, - abilityName: 'DocumentAbility', - parameters: { - position: index - } - }; - try { - context.startAbility(want, (err: BusinessError) => { - if (err.code) { - hilog.error(0x00004, 'ConversationViewModel', `startAbility failed, code is ${err.code}, message is ${err.message}`); - } - }); - } catch (error) { - hilog.error(0x00004, 'ConversationViewModel', `startAbility failed, message is ${error}`); - } - } -} - -export { ConversationDataInterface, ConversationListData, ConversationViewModel }; \ No newline at end of file +export { ConversationDataInterface, ConversationListData }; \ No newline at end of file diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/CommonView.ets b/entry/src/main/ets/views/DoubleConversationView/productView/CommonView.ets index 482fab3c76c5bfc15b5c7682c4d502c927d3903d..b8a4649cc25f6e704affce749e355cbe332378aa 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/CommonView.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/CommonView.ets @@ -14,7 +14,7 @@ */ import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; +import { DetailConstants } from '../../../constants/ProductDetailConstants'; import { WindowInfo } from '../../../utils/WindowUtil'; import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; @@ -83,16 +83,6 @@ export struct UtilIcon { } } -@Component -export struct DetailTopIcon { - public imageResource: Resource = $r('app.media.ic_public_back'); - - build() { - Image(this.imageResource) - .width(30) - .height(30) - } -} @Component export struct CommentsTitle { @@ -149,29 +139,3 @@ export struct CommentsContent { .lineHeight($r('app.float.comment_text_line')) } } - -@Component -export struct CommentContentExtra { - @ObjectLink mainWindowInfo: WindowInfo; - private context: Context = this.getUIContext().getHostContext()! - - build() { - Column() { - Image($r('app.media.comment_picture')) - .width(CommonConstants.FULL_PERCENT) - .height($r('app.float.comment_extra_img_size')) - .aspectRatio(1) - .borderRadius(new WidthBreakpointType(16, 24, 40, 40).getValue(this.mainWindowInfo.widthBp)) - .padding({ - top: $r('app.float.tag_padding'), - bottom: $r('app.float.tag_padding') - }) - Text(DetailConstants.USER_COMMENT_NAMES(this.context)[7]) - .opacity(CommonConstants.TEXT_OPACITY[2]) - .fontSize($r('app.float.comment_extra_font')) - .fontWeight(FontWeight.Normal) - } - .width(CommonConstants.FULL_PERCENT) - .alignItems(HorizontalAlign.Start) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductConfig.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductConfig.ets index b87a128f0824a5c9b12628ea7ba84601cd05645f..1e09b6f2fe61e84c5ab5b8327a96270a7b1d5229 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductConfig.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/ProductConfig.ets @@ -13,10 +13,9 @@ * limitations under the License. */ -import { deviceInfo } from '@kit.BasicServicesKit'; import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; -import { CommentContentExtra, CommentsContent, CommentsTitle, ConfigTipIcon, ConfigTipText, ProductsConfigText, +import { DetailConstants } from '../../../constants/ProductDetailConstants'; +import { CommentsContent, CommentsTitle, ConfigTipIcon, ConfigTipText, ProductsConfigText, RightArrow, UserCommentInfo } from './CommonView'; import { WindowInfo } from '../../../utils/WindowUtil'; import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; @@ -209,59 +208,6 @@ export struct UserComments { } } -@Component -export struct AllComments { - @ObjectLink mainWindowInfo: WindowInfo; - private context: Context = this.getUIContext().getHostContext()! - - build() { - Scroll() { - Column() { - CommentsTitle() - - Scroll() { - Row() { - CommentsTag({ tagText: DetailConstants.USER_COMMENT_NAMES(this.context)[1] }) - CommentsTag({ tagText: DetailConstants.USER_COMMENT_NAMES(this.context)[2] }) - CommentsTag({ tagText: DetailConstants.USER_COMMENT_NAMES(this.context)[3] }) - } - } - .align(Alignment.Start) - .scrollable(ScrollDirection.Horizontal) - .scrollBar(BarState.Off) - .width(CommonConstants.FULL_PERCENT) - .margin({ top: $r('app.float.comments_title_margin') }) - - Column() { - ForEach(DetailConstants.COMMENTS_LIST, (item: number) => { - UserCommentInfo() - CommentsContent() - CommentContentExtra({mainWindowInfo: this.mainWindowInfo}) - if (item < CommonConstants.TWO) { - Divider() - .width(CommonConstants.FULL_PERCENT) - .strokeWidth(1) - .color($r('app.color.divider_color')) - .margin({ top: $r('app.float.comments_title_margin') }) - } - }, (item: number, index: number) => index + JSON.stringify(item)) - } - .alignItems(HorizontalAlign.Start) - } - .backgroundColor(Color.White) - .alignItems(HorizontalAlign.Start) - .width(CommonConstants.FULL_PERCENT) - .borderRadius(16) - .padding($r('app.float.user_comments_col_padding')) - .margin({ bottom: deviceInfo.deviceType === CommonConstants.DEVICE_TYPES[0] ? 0 : - CommonConstants.BOTTOM_RECT_HEIGHT }) - } - .width(CommonConstants.FULL_PERCENT) - .layoutWeight(1) - .scrollBar(BarState.Off) - } -} - @Component struct CommentsTag { public tagText: string = ''; diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductDetail.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductDetail.ets deleted file mode 100644 index 22061e54c2bc9862e8624bec05492d7e2c094777..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductDetail.ets +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { deviceInfo } from '@kit.BasicServicesKit'; -import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; -import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; -import { ProductPrice } from './ProductPrice'; -import { ProductDiscount } from './ProductDiscount'; -import { ProductConfig, UserComments } from './ProductConfig'; -import { WindowInfo } from '../../../utils/WindowUtil'; - -@Component -export struct ProductPicture { - @ObjectLink mainWindowInfo: WindowInfo; - @State currentSwiperIndex: number = 0; - pathStack: NavPathStack = new NavPathStack(); - private context: Context = this.getUIContext().getHostContext()! - - @Builder - PictureIndicator(text: string) { - Text(text) - .fontSize($r('app.float.picture_indicator_font')) - .fontWeight(FontWeight.Normal) - .margin({ right: $r('app.float.picture_indicator_margin') }) - } - - build() { - Column() { - Stack({ alignContent: this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? Alignment.TopEnd : - Alignment.End }) { - Swiper() { - ForEach(DetailConstants.PRODUCT_DETAIL_RESOURCES, (item: Resource) => { - Image(item) - .width(CommonConstants.FULL_PERCENT) - }, (item: Resource, index: number) => index + JSON.stringify(item)) - } - .align(Alignment.Center) - .indicator(false) - .displayCount(1) - .nextMargin(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_MD ? $r('app.float.product_swiper_margin') : - 0) - .prevMargin(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_MD ? $r('app.float.product_swiper_margin') : - 0) - .height(CommonConstants.FULL_PERCENT) - .width(CommonConstants.FULL_PERCENT) - .onChange((index: number) => { - this.currentSwiperIndex = index; - }) - - Row() { - Image($r('app.media.ic_public_back')) - .height(30) - .width(30) - .margin({ right: 24 }) - .onClick(() => { - this.pathStack.pop(); - }) - Blank() - // [Start product_detail] - Image($r('app.media.ic_more')) - .height(30) - .width(30) - .visibility(this.mainWindowInfo.widthBp !== WidthBreakpoint.WIDTH_SM ? Visibility.None : - Visibility.Visible) - } - .width(CommonConstants.FULL_PERCENT) - .position({ x: 0, y: DetailConstants.LIVE_ROW_Y_POSITION }) - .padding({ - left: new WidthBreakpointType(16, 24, 32, 32).getValue(this.mainWindowInfo.widthBp), - right: new WidthBreakpointType(16, 24, 32, 32).getValue(this.mainWindowInfo.widthBp) - }) - } - .width(CommonConstants.FULL_PERCENT) - .layoutWeight(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? 1 : -1) - .aspectRatio(new WidthBreakpointType(DetailConstants.LIVE_STACK_ASPECT_RATIO[0], - DetailConstants.LIVE_STACK_ASPECT_RATIO[1], -1, -1).getValue(this.mainWindowInfo.widthBp)) - - Row() { - Column() { - Text(JSON.stringify(this.currentSwiperIndex + 1) + DetailConstants.PICTURE_INDICATOR(this.context)[0]) - .fontSize($r('app.float.picture_number_font')) - .fontWeight(FontWeight.Normal) - .fontColor(Color.White) - } - .width(36) - .height(16) - .backgroundColor($r('app.color.swiper_indicator_background')) - .borderRadius(8) - .justifyContent(FlexAlign.Center) - } - .width(CommonConstants.FULL_PERCENT) - .justifyContent(FlexAlign.End) - .padding({ right: new WidthBreakpointType(16, 24, 32, 32).getValue(this.mainWindowInfo.widthBp) }) - - Row() { - this.PictureIndicator(DetailConstants.PICTURE_INDICATOR(this.context)[1]) - Image($r('app.media.arrow_right')) - .width(6) - .height(12) - .margin({ right: 12 }) - this.PictureIndicator(DetailConstants.PICTURE_INDICATOR(this.context)[2]) - Image($r('app.media.arrow_right')) - .width(6) - .height(12) - } - .padding({ - left: 12, - right: 8 - }) - .backgroundColor($r('app.color.products_compare')) - .width(112) - .height(24) - .borderRadius(12) - .margin({ top: 20 }) - - Row() { - List({ space: new WidthBreakpointType(DetailConstants.PICTURE_LIST_SPACES[0], DetailConstants.PICTURE_LIST_SPACES[1], - DetailConstants.PICTURE_LIST_SPACES[2], DetailConstants.PICTURE_LIST_SPACES[2]).getValue(this.mainWindowInfo.widthBp) }) { - ForEach(DetailConstants.PRODUCT_SMALL_RESOURCES, (item: Resource, index: number) => { - ListItem() { - Image(item) - .width(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? 48 : - 36) - .height(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? 48 : - 36) - .borderRadius(8) - .borderWidth(index === this.currentSwiperIndex ? 1 : 0) - } - }, (item: Resource, index: number) => JSON.stringify(item) + index) - } - .scrollBar(BarState.Off) - .listDirection(Axis.Horizontal) - .margin({ - top: 12, - bottom: 12 - }) - } - .height(this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG ? 72 : - 60) - .width(CommonConstants.FULL_PERCENT) - .padding({ - left: new WidthBreakpointType(16, 24, 32, 32).getValue(this.mainWindowInfo.widthBp), - right: new WidthBreakpointType(16, 24, 32, 32).getValue(this.mainWindowInfo.widthBp) - }) - } - .backgroundColor(Color.White) - .alignItems(HorizontalAlign.Center) - .padding({ - bottom: deviceInfo.deviceType === CommonConstants.DEVICE_TYPES[1] ? CommonConstants.BOTTOM_RECT_HEIGHT : 0 - }) - } -} - -@Component -export struct ProductInfo { - @ObjectLink mainWindowInfo: WindowInfo; - pathStack: NavPathStack = new NavPathStack(); - @Link isNavFullScreen: boolean; - - build() { - Column() { - ProductPrice({ mainWindowInfo: this.mainWindowInfo }) - ProductDiscount({ mainWindowInfo: this.mainWindowInfo }) - UserComments({ mainWindowInfo: this.mainWindowInfo, pathStack: this.pathStack, isNavFullScreen: this.isNavFullScreen }) - ProductConfig({ mainWindowInfo: this.mainWindowInfo }) - } - .backgroundColor($r('app.color.products_info')) - .width(CommonConstants.FULL_PERCENT) - .padding({ - bottom: 12 - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductDiscount.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductDiscount.ets index 745ae6db3d58237b0e075137fafa9eb8efb8c8d5..be8c3a0cf50acd1639ffb4143d77c6da48e00de0 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductDiscount.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/ProductDiscount.ets @@ -14,7 +14,7 @@ */ import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; +import { DetailConstants } from '../../../constants/ProductDetailConstants'; import { RightArrow } from './CommonView'; import { WindowInfo } from '../../../utils/WindowUtil'; import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductPage.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductPage.ets index 0fe00512449c7344aa913ff79abe7fc2b3bcf869..b29114e4b17bb10a51da75e0c1e247fb8d88c8cb 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductPage.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/ProductPage.ets @@ -15,10 +15,12 @@ import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; +import { DetailConstants } from '../../../constants/ProductDetailConstants'; import { WindowInfo } from '../../../utils/WindowUtil'; -import { ProductInfo } from './ProductDetail'; import { ProductUtilView } from './ProductUtilView'; +import { ProductPrice } from './ProductPrice'; +import { ProductDiscount } from './ProductDiscount'; +import { ProductConfig, UserComments } from './ProductConfig'; @Component export struct ProductPage { @@ -266,5 +268,26 @@ export struct ProductPicture { } +@Component +export struct ProductInfo { + @ObjectLink mainWindowInfo: WindowInfo; + pathStack: NavPathStack = new NavPathStack(); + @Link isNavFullScreen: boolean; + + build() { + Column() { + ProductPrice({ mainWindowInfo: this.mainWindowInfo }) + ProductDiscount({ mainWindowInfo: this.mainWindowInfo }) + UserComments({ mainWindowInfo: this.mainWindowInfo, pathStack: this.pathStack, isNavFullScreen: this.isNavFullScreen }) + ProductConfig({ mainWindowInfo: this.mainWindowInfo }) + } + .backgroundColor($r('app.color.products_info')) + .width(CommonConstants.FULL_PERCENT) + .padding({ + bottom: 12 + }) + } +} + diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductPrice.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductPrice.ets index 0b956d2dff8746a91a00a64fd21b0d3abc735e84..e23c20a878ead4fc2e1de44571c790913db26bbe 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductPrice.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/ProductPrice.ets @@ -14,7 +14,7 @@ */ import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; +import { DetailConstants } from '../../../constants/ProductDetailConstants'; import { WindowInfo } from '../../../utils/WindowUtil'; import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; import { RightArrow } from './CommonView'; diff --git a/entry/src/main/ets/views/DoubleConversationView/productView/ProductUtilView.ets b/entry/src/main/ets/views/DoubleConversationView/productView/ProductUtilView.ets index 3469eb99ad8d384b1eaa228a32cd1c64729cd42e..6b467056218407dcc72e9f50198ccb46c3a0288b 100644 --- a/entry/src/main/ets/views/DoubleConversationView/productView/ProductUtilView.ets +++ b/entry/src/main/ets/views/DoubleConversationView/productView/ProductUtilView.ets @@ -16,7 +16,7 @@ import { deviceInfo } from '@kit.BasicServicesKit'; import { WidthBreakpointType } from '../../../utils/WidthBreakpointType'; import { CommonConstants } from '../../../constants/CommonConstants'; -import { DetailConstants } from '../../../constants/DetailConstants'; +import { DetailConstants } from '../../../constants/ProductDetailConstants'; import { UtilIcon } from './CommonView'; import { WindowInfo } from '../../../utils/WindowUtil'; @@ -84,7 +84,7 @@ export struct ProductUtilView { // [End dialog_btn] } .backgroundColor($r('app.color.products_info')) - .height(deviceInfo.deviceType === CommonConstants.DEVICE_TYPES[0] ? CommonConstants.TAB_BAR_HEIGHT : + .height(deviceInfo.deviceType === '2in1' ? CommonConstants.TAB_BAR_HEIGHT : CommonConstants.TAB_BAR_HEIGHT + CommonConstants.BOTTOM_RECT_HEIGHT) .width(CommonConstants.FULL_PERCENT) .padding({ diff --git a/entry/src/main/ets/views/NavigationContentView.ets b/entry/src/main/ets/views/NavigationContentView.ets index 326978a7ad5162fecc67323e39750df8ad9c43a2..4b2ccc12d5263c70d1ab5a8b15c8fed9b20c182f 100644 --- a/entry/src/main/ets/views/NavigationContentView.ets +++ b/entry/src/main/ets/views/NavigationContentView.ets @@ -110,107 +110,3 @@ export struct NavigationContent2 { .backgroundColor('#FDBFFC') } } - -@Component -export struct NavigationContent3 { - @ObjectLink mainWindowInfo: WindowInfo; - @Link isNavFullScreen: boolean; - pathStack: NavPathStack = new NavPathStack(); - - build() { - NavDestination() { - Row() { - Image($r('app.media.arrow_left')) - .width(24) - .height(24) - .margin({ right: 12 }) - .onClick(() => { - this.pathStack.pop(); - }) - } - .width('100%') - .margin({ bottom: 12 }) - - Column() { - Text('Navigation') - .fontSize(18) - .margin({ bottom: 12 }) - Text($r('app.string.navigation_content_home')) - .fontSize(24) - .margin({ bottom: 12 }) - Button($r('app.string.navigation_content_switch')) - .onClick(() => { - this.isNavFullScreen = true; - this.pathStack.pushPathByName('navigationContent4', null) - }) - } - .height('100%') - .width('100%') - .justifyContent(FlexAlign.Center) - } - .width('100%') - .height('100%') - .onReady((context: NavDestinationContext) => { - this.pathStack = context.pathStack; - }) - .padding({ - top: this.getUIContext().px2vp(this.mainWindowInfo.AvoidSystem?.topRect.height) + 12, - bottom: this.getUIContext().px2vp(this.mainWindowInfo.AvoidNavigationIndicator?.bottomRect.height), - left: 12, - right: 12 - }) - .hideTitleBar(true) - .backgroundColor('#FDBFFC') - } -} - -@Component -export struct NavigationContent4 { - @ObjectLink mainWindowInfo: WindowInfo; - @Link isNavFullScreen: boolean; - pathStack: NavPathStack = new NavPathStack(); - - build() { - NavDestination() { - Column() { - Image($r('app.media.arrow_left')) - .width(24) - .height(24) - .position({ - x: 0, - y: 0 - }) - .onClick(() => { - this.isNavFullScreen = false; - this.pathStack.pop(); - }) - Text('Navigation') - .fontSize(18) - .margin({ bottom: 12 }) - Text($r('app.string.navigation_content_area_2')) - .fontSize(24) - } - .height('100%') - .width('100%') - .justifyContent(FlexAlign.Center) - .padding({ - top: this.getUIContext().px2vp(this.mainWindowInfo.AvoidSystem?.topRect.height) + 12, - bottom: this.getUIContext().px2vp(this.mainWindowInfo.AvoidNavigationIndicator?.bottomRect.height), - left: 16, - right: 16 - }) - } - .width('100%') - .height('100%') - .onReady((context: NavDestinationContext) => { - this.pathStack = context.pathStack; - }) - .hideTitleBar(true) - .backgroundColor('#FDBFFC') - .onBackPressed(() => { - this.isNavFullScreen = false; - this.pathStack.pop(); - return true; - }) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/views/TabsView/VideoInfoView.ets b/entry/src/main/ets/views/TabsView/VideoInfoView.ets index 25cf525866c3f1f5cebf8156084f5ba42234c709..419947a76598fb1b676158c2850786f4a7fe4784 100644 --- a/entry/src/main/ets/views/TabsView/VideoInfoView.ets +++ b/entry/src/main/ets/views/TabsView/VideoInfoView.ets @@ -14,7 +14,7 @@ */ import { WidthBreakpointType } from '../../utils/WidthBreakpointType'; -import { VideoViewModel } from './viewmodel/VideoViewModel'; +import { VideoViewModel } from './viewmodel/TabViewModel'; import { WindowInfo } from '../../utils/WindowUtil'; @Component diff --git a/entry/src/main/ets/views/TabsView/viewmodel/TabViewModel.ets b/entry/src/main/ets/views/TabsView/viewmodel/TabViewModel.ets index 40511745ab7dfb53fd79a2e8722b66c223ff51d5..7cbcf131c7823ab01468df5662cbad34c9807075 100644 --- a/entry/src/main/ets/views/TabsView/viewmodel/TabViewModel.ets +++ b/entry/src/main/ets/views/TabsView/viewmodel/TabViewModel.ets @@ -58,4 +58,37 @@ export class TabViewModel { getTabNameOfSecondLevel(firstTab: string, index: number): string { return this.tabMap.getSecondList(firstTab)[index]; } +} + +export class VideoDataModel { + private videoMap: Map; + + constructor(videoMap: Map) { + this.videoMap = videoMap; + } + + getVideoMap(): Map { + return this.videoMap; + } + + getVideo(index: number): Resource { + return this.videoMap.get(index)!; + } +} + +export class VideoViewModel { + private videoMap: VideoDataModel; + + constructor() { + let videoMap: Map = new Map(); + videoMap.set(0, $r('app.media.ic_video_1')); + videoMap.set(1, $r('app.media.ic_video_2')); + videoMap.set(2, $r('app.media.ic_video_3')); + videoMap.set(3, $r('app.media.ic_video_4')); + this.videoMap = new VideoDataModel(videoMap); + } + + getVideo(index: number): Resource { + return this.videoMap.getVideo(index); + } } \ No newline at end of file diff --git a/entry/src/main/ets/views/TabsView/viewmodel/VideoViewModel.ets b/entry/src/main/ets/views/TabsView/viewmodel/VideoViewModel.ets deleted file mode 100644 index 3eee2c7c917e970b62263a7490039cf27b6f4fbd..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/views/TabsView/viewmodel/VideoViewModel.ets +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { VideoDataModel } from './VideoDataModel'; - -export class VideoViewModel { - private videoMap: VideoDataModel; - - constructor() { - let videoMap: Map = new Map(); - videoMap.set(0, $r('app.media.ic_video_1')); - videoMap.set(1, $r('app.media.ic_video_2')); - videoMap.set(2, $r('app.media.ic_video_3')); - videoMap.set(3, $r('app.media.ic_video_4')); - this.videoMap = new VideoDataModel(videoMap); - } - - getVideo(index: number): Resource { - return this.videoMap.getVideo(index); - } -} \ No newline at end of file diff --git a/entry/src/main/ets/views/TripleCanlendarView/TripSchedule.ets b/entry/src/main/ets/views/TripleCanlendarView/TripSchedule.ets index cf761dd1573640b32ceb379e212278ff3f2e3eaa..f1a9833511a5d325c3c8e3b810439ca11c3d284e 100644 --- a/entry/src/main/ets/views/TripleCanlendarView/TripSchedule.ets +++ b/entry/src/main/ets/views/TripleCanlendarView/TripSchedule.ets @@ -32,7 +32,6 @@ export struct TripScheduleView { Column() { Text(tripItem.startTime) .fontSize($r('app.float.trip_content_font')) - Row() .border({ style: { left: BorderStyle.Solid }, diff --git a/entry/src/main/ets/views/TripleCanlendarView/TripleCalendarNavView.ets b/entry/src/main/ets/views/TripleCanlendarView/TripleCalendarNavView.ets index 26be9125704ac0c799b53d5200dac7acb63eb4ab..41e270409a513dedb6aa0d0e2071bdc7cb5d1e80 100644 --- a/entry/src/main/ets/views/TripleCanlendarView/TripleCalendarNavView.ets +++ b/entry/src/main/ets/views/TripleCanlendarView/TripleCalendarNavView.ets @@ -27,9 +27,6 @@ export struct TripleCalendarNavView { @ObjectLink @Watch('widthBpChange') mainWindowInfo: WindowInfo; @State isShowingSidebar: boolean = (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG || this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_XL) ? true : false; - pageInfos: NavPathStack = new NavPathStack(); - pathStack: NavPathStack = new NavPathStack(); - @StorageLink('monthStatus') monthStatus: boolean = (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG || this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_XL) ? false : true; @StorageLink('navMode') navMode: NavigationMode = NavigationMode.Split; @StorageLink('selectedItem') selectedItem: CalendarItem = new CalendarItem('', '', false); @@ -41,6 +38,8 @@ export struct TripleCalendarNavView { selectedBackgroundColor: $r('app.color.start_window_background') }); @State singleSelectCapsuleSelectedIndexes: number[] = [1]; + pageInfos: NavPathStack = new NavPathStack(); + pathStack: NavPathStack = new NavPathStack(); widthBpChange(): void { if (this.mainWindowInfo.widthBp === WidthBreakpoint.WIDTH_LG || @@ -263,8 +262,8 @@ export struct TripleCalendarNavView { shown: deviceInfo.deviceType === '2in1' ? $r('app.media.open_sidebar_calendar') : $r('app.media.open_sidebar_bg'), switching: this.isShowingSidebar ? - (CommonConstants.DEVICE_TYPE_2IN1 ? $r('app.media.open_sidebar_calendar') : $r('app.media.open_sidebar_bg')) : - (CommonConstants.DEVICE_TYPE_2IN1 ? $r('app.media.close_sidebar') : $r('app.media.close_sidebar_bg')) + ('2in1' ? $r('app.media.open_sidebar_calendar') : $r('app.media.open_sidebar_bg')) : + ('2in1' ? $r('app.media.close_sidebar') : $r('app.media.close_sidebar_bg')) }, top: deviceInfo.deviceType === '2in1' ? CommonConstants.COMMON_MARGIN : CommonConstants.CONTROL_BUTTON_TOP, diff --git a/entry/src/main/ets/views/TripleMailView/MailSideBarView.ets b/entry/src/main/ets/views/TripleMailView/MailSideBarView.ets index 2912b733a24b5331cdd8bf22eaa731fe8632d14e..2f40d81b1a44774bd580dda0d494a2d3032d2b90 100644 --- a/entry/src/main/ets/views/TripleMailView/MailSideBarView.ets +++ b/entry/src/main/ets/views/TripleMailView/MailSideBarView.ets @@ -76,7 +76,7 @@ struct AccountInfo { .backgroundColor(index === 0 ? '#61cfbe' : '#fec700') Text(item) .fontSize(16) - .fontColor(index === 0 ? '#000' : '#E5000000') + .fontColor(index === 0 ? '#000000' : '#E5000000') .margin({ left: 13 }) Blank() if (index === 0) { diff --git a/entry/src/main/resources/base/profile/route_map.json b/entry/src/main/resources/base/profile/route_map.json index c10c95a6aa6ea795f66ba5204d697337c50c6f00..0f8a9e153ac327d5859a03d0dfed8e878fb53b5c 100644 --- a/entry/src/main/resources/base/profile/route_map.json +++ b/entry/src/main/resources/base/profile/route_map.json @@ -18,7 +18,7 @@ }, { "name": "DoubleColumnConversation", - "pageSourceFile": "src/main/ets/pages/DoubleColumnChatLayout.ets", + "pageSourceFile": "src/main/ets/pages/DoubleColumnConversation.ets", "buildFunction": "DoubleColumnConversationBuilder", "data": { "description" : "This is double column page."