diff --git a/README.md b/README.md index b2b9656cc4e8a6a9b65d3d8d081691b7441b1d8a..184f3f78a4ee3d9506da87db0d7537c6db299575 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,11 @@ ## 效果预览 -| | | | -|---------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------| -| | | | +| | | | | +|-----------------------------------------------------------|-----------------------------------------------------------|---------------------------------------------------------|----------------------------------------------------------| + +| | | | | +|-----------------------------------------------------------|-----------------------------------------------------------|---------------------------------------------------------|----------------------------------------------------------| ## 使用说明 @@ -18,10 +20,10 @@ 4. 当用户连续打卡天数达到3、7、30、50、73、99天时,可以获得相应的成就。成就在获得时会以动画形式弹出,并可以在“成就”页面查看。 5. 用户可以查看以前的健康生活任务完成情况。 6. 打开应用,显示主页面,点击加号添加任务,添加完任务后,任务列表显示所有添加的任务。 -7. 应用退出到后台,长按应用,点击服务卡片,选择2x4卡片,添加到桌面,显示已添加任务。 +7. 应用退出到后台,长按应用,点击服务卡片,选择1x2卡片,添加到桌面,显示已添加任务。 8. 应用退出到后台,长按应用,点击服务卡片,选择2x2卡片,添加到桌面,显示任务完成进度。 -9. 点击2x2或2x4元服务卡片,拉起主页面,看到任务列表。 -10. 在卡片配置文件中,设置卡片更新时间,更新时间到后,桌面上2x2或2x4卡片会重置第二天任务,需要重新添加。 +9. 点击1x2或2x2元服务卡片,拉起主页面,看到任务列表。 +10. 在卡片配置文件中,设置卡片更新时间,更新时间到后,桌面上1x2或2x2卡片会重置第二天任务,需要重新添加。 11. 用户可以设置通知提醒,仅限早起、早睡。 ## 工程目录 @@ -57,7 +59,7 @@ │ ├──PromptActionClass.ets // 自定义弹窗工具类 │ └──Utils.ets └──common/src/main/resource - +│ ├───healthylife/src/main/ets │ ├──healthyfileability │ │ └──HealthylifeAbility.ets // 模块入口类 @@ -83,7 +85,6 @@ │ │ ├──TaskListComponent.ets // 任务列表组件 │ │ └──WeekCalendarComponent.ets // 周视图组件 │ ├──mine -│ │ ├──MineMenuComponent.ets // 菜单组件 │ │ └──UserInfoComponent.ets // 用户信息组件 │ ├──task │ │ ├──AddTaskComponent.ets // 添加任务组件 @@ -91,8 +92,8 @@ │ ├──AchievementComponent.ets // 成就页面 │ ├──HomeComponent.ets // 首页页面 │ └──MineComponent.ets // 我的页面 -└──common/src/main/resource - +└──healthylife/src/main/resource +│ ├───default/src/main/ets │ ├──agency │ │ └──pages @@ -110,7 +111,7 @@ │ │ └──ProgressCard.ets // 任务进度-服务卡片 │ └──view │ └──UserPrivacyDialog.ets // 用户隐私协议弹窗 -└──common/src/main/resource +└──default/src/main/resource ``` ## 具体实现 @@ -135,6 +136,6 @@ ## 约束与限制 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS 6.0.0 Release及以上。 +2. HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。 3. DevEco Studio版本:DevEco Studio 6.0.0 Release及以上。 4. HarmonyOS SDK版本:HarmonyOS 6.0.0 Release SDK及以上。 diff --git a/build-profile.json5 b/build-profile.json5 index 94274780dc618df3e4ddb4f031ecbc94d6741e28..d39580ea645b5f05918731731a51bc5d23e74c5a 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,13 +1,14 @@ { "app": { "signingConfigs": [ + ], "products": [ { "name": "default", "signingConfig": "default", "targetSdkVersion": "6.0.0(20)", - "compatibleSdkVersion": "6.0.0(20)", + "compatibleSdkVersion": "5.0.5(17)", "runtimeOS": "HarmonyOS", "buildOption": { "strictMode": { diff --git a/commons/common/src/main/ets/constants/CommonConstants.ets b/commons/common/src/main/ets/constants/CommonConstants.ets index 6d6684904ac3ccf29b7eecbf6bd2f6899c80d4e0..1cb5710a4ca93e92ae433bbc9070598f95dfe1ea 100644 --- a/commons/common/src/main/ets/constants/CommonConstants.ets +++ b/commons/common/src/main/ets/constants/CommonConstants.ets @@ -24,17 +24,23 @@ export enum PickerType { export class CommonConstants { // thousandth static readonly THOUSANDTH_15: string = '1.5%'; + static readonly THOUSANDTH_30: string = '3%'; static readonly THOUSANDTH_33: string = '3.3%'; static readonly THOUSANDTH_50: string = '5%'; static readonly THOUSANDTH_66: string = '6.6%'; static readonly THOUSANDTH_80: string = '8%'; static readonly THOUSANDTH_100: string = '10%'; + static readonly THOUSANDTH_130: string = '13%'; static readonly THOUSANDTH_150: string = '15%'; + static readonly THOUSANDTH_200: string = '20%'; static readonly THOUSANDTH_333: string = '33.3%'; static readonly THOUSANDTH_400: string = '40%'; static readonly THOUSANDTH_420: string = '42%'; + static readonly THOUSANDTH_440: string = '44%'; static readonly THOUSANDTH_500: string = '50%'; static readonly THOUSANDTH_560: string = '56%'; + static readonly THOUSANDTH_730: string = '73%'; + static readonly THOUSANDTH_780: string = '78%'; static readonly THOUSANDTH_800: string = '80%'; static readonly THOUSANDTH_830: string = '83%'; static readonly THOUSANDTH_880: string = '88%'; @@ -120,9 +126,11 @@ export class CommonConstants { static readonly DEFAULT_MENU_INFO: Resource[] = [ $r('app.string.mine_personal_data'), $r('app.string.mine_check_updates'), - $r('app.string.mine_about') + // $r('app.string.mine_about'), + // $r('app.string.mine_achievement') ]; // Card Constants + static readonly DEFAULT_DIMENSION_1X2 = 1; static readonly DEFAULT_DIMENSION_2X2 = 2; static readonly DEFAULT_DIMENSION_2X4 = 3; static readonly FORM_NAME_AGENCY = "agency"; diff --git a/commons/common/src/main/ets/utils/FormUtils.ets b/commons/common/src/main/ets/utils/FormUtils.ets index 3f74f157da028236e4d578005afcb0393537dbb8..d8f666c3778811981aa6ed41f0c639f650910103 100644 --- a/commons/common/src/main/ets/utils/FormUtils.ets +++ b/commons/common/src/main/ets/utils/FormUtils.ets @@ -74,7 +74,7 @@ export class FormUtils { const date = convertDate2Str(new Date()); let updateDate: FormStorageModel = {}; if (formInfo.formName === Const.FORM_NAME_AGENCY && - Number(formInfo.formDimension) === Const.DEFAULT_DIMENSION_2X4) { + Number(formInfo.formDimension) === Const.DEFAULT_DIMENSION_1X2) { DayTaskInfoApi.queryDayTaskInfo(date).then((dayTaskInfos: DayTaskInfo[]) => { updateDate.dayTaskInfos = dayTaskInfos; FormUtils.updateFormByDate(updateDate, formInfo); diff --git a/commons/common/src/main/resources/base/element/color.json b/commons/common/src/main/resources/base/element/color.json index c6c477e96d9ad066d112326b3deca542ef763959..476a8779f4d0a269e517e9733f826e3bc73a45d1 100644 --- a/commons/common/src/main/resources/base/element/color.json +++ b/commons/common/src/main/resources/base/element/color.json @@ -16,9 +16,21 @@ "name": "task_clock_bg_color", "value": "#66FFFFFF" }, + { + "name": "button_red", + "value": "#E84026" + }, { "name": "ach_bg_color", "value": "#000000" + }, + { + "name": "mine_font_color", + "value": "#E5000000" + }, + { + "name": "text_font_color", + "value": "#0A59F7" } ] } \ No newline at end of file diff --git a/commons/common/src/main/resources/base/element/string.json b/commons/common/src/main/resources/base/element/string.json index 1ec9d11229e89f70d6f419f3893119ce037aba1c..270506c8fa8f8241506baafbc6393bee07939916 100644 --- a/commons/common/src/main/resources/base/element/string.json +++ b/commons/common/src/main/resources/base/element/string.json @@ -112,6 +112,10 @@ "name": "mine_about", "value": "About" }, + { + "name": "mine_achievement", + "value": "achievement" + }, { "name": "add_task", "value": "Add task" diff --git a/commons/common/src/main/resources/base/media/ach_back.svg b/commons/common/src/main/resources/base/media/ach_back.svg new file mode 100644 index 0000000000000000000000000000000000000000..1a8818683b800940f5f52cbe14435b59960a02c0 --- /dev/null +++ b/commons/common/src/main/resources/base/media/ach_back.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/commons/common/src/main/resources/base/media/arrow_up_circle.svg b/commons/common/src/main/resources/base/media/arrow_up_circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..339b5c140e69b32d6b4ee20b537a5fe80d6aeaad --- /dev/null +++ b/commons/common/src/main/resources/base/media/arrow_up_circle.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/commons/common/src/main/resources/base/media/book_closed_per.svg b/commons/common/src/main/resources/base/media/book_closed_per.svg new file mode 100644 index 0000000000000000000000000000000000000000..56f44dfcd65ea306857e9662c5a7f2da40a0c66b --- /dev/null +++ b/commons/common/src/main/resources/base/media/book_closed_per.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/commons/common/src/main/resources/base/media/house_fill.svg b/commons/common/src/main/resources/base/media/house_fill.svg new file mode 100644 index 0000000000000000000000000000000000000000..83001060558b03c8f648ddaa659800fb3367103c --- /dev/null +++ b/commons/common/src/main/resources/base/media/house_fill.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/commons/common/src/main/resources/base/media/ic_home_add.png b/commons/common/src/main/resources/base/media/ic_home_add.png index e81f66c18ae36f8f5e33b03d4c33b9d64f6ec0b3..a318509182841d68212ab51e0f3e4a0be7bbe57b 100644 Binary files a/commons/common/src/main/resources/base/media/ic_home_add.png and b/commons/common/src/main/resources/base/media/ic_home_add.png differ diff --git a/commons/common/src/main/resources/base/media/person_crop_circle.svg b/commons/common/src/main/resources/base/media/person_crop_circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..0ff01391aff443c249088e36ea46360d479958d7 --- /dev/null +++ b/commons/common/src/main/resources/base/media/person_crop_circle.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/commons/common/src/main/resources/base/media/person_crop_circle_fill.svg b/commons/common/src/main/resources/base/media/person_crop_circle_fill.svg new file mode 100644 index 0000000000000000000000000000000000000000..e423af73a8e51f2a89f1f87a3fbf169f8b5a89d6 --- /dev/null +++ b/commons/common/src/main/resources/base/media/person_crop_circle_fill.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/commons/common/src/main/resources/base/media/star_trophy.svg b/commons/common/src/main/resources/base/media/star_trophy.svg new file mode 100644 index 0000000000000000000000000000000000000000..467f86bc5e281dc883e923635ab37d85baadeb4b --- /dev/null +++ b/commons/common/src/main/resources/base/media/star_trophy.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/commons/common/src/main/resources/en_US/element/string.json b/commons/common/src/main/resources/en_US/element/string.json index 1ec9d11229e89f70d6f419f3893119ce037aba1c..270506c8fa8f8241506baafbc6393bee07939916 100644 --- a/commons/common/src/main/resources/en_US/element/string.json +++ b/commons/common/src/main/resources/en_US/element/string.json @@ -112,6 +112,10 @@ "name": "mine_about", "value": "About" }, + { + "name": "mine_achievement", + "value": "achievement" + }, { "name": "add_task", "value": "Add task" diff --git a/commons/common/src/main/resources/zh_CN/element/string.json b/commons/common/src/main/resources/zh_CN/element/string.json index e6ceafc2ece4d98fc5d1464394189f871f91fb29..d387fa1a8912b91f654e378b5f0e8ab382aecd72 100644 --- a/commons/common/src/main/resources/zh_CN/element/string.json +++ b/commons/common/src/main/resources/zh_CN/element/string.json @@ -112,6 +112,10 @@ "name": "mine_about", "value": "关于" }, + { + "name": "mine_achievement", + "value": "成就" + }, { "name": "add_task", "value": "添加任务" diff --git a/features/healthylife/src/main/ets/model/NavItemModel.ets b/features/healthylife/src/main/ets/model/NavItemModel.ets index cc6365b89e572c5fd4362464b0d8efbba559cb7d..0d1fcb54a6bd6284cd9dd578e07742d8994d01fb 100644 --- a/features/healthylife/src/main/ets/model/NavItemModel.ets +++ b/features/healthylife/src/main/ets/model/NavItemModel.ets @@ -27,26 +27,19 @@ export interface NavItem { export enum TabId { HOME, - ACHIEVEMENT, MINE } export const NavList: NavItem[] = [ { icon: $r('app.media.ic_tabs_home_normal'), - icon_selected: $r('app.media.ic_tabs_home_sel'), + icon_selected: $r('app.media.house_fill'), text: $r('app.string.tab_home'), id: TabId.HOME }, - { - icon: $r('app.media.ic_tabs_achievement_normal'), - icon_selected: $r('app.media.ic_tabs_achievement_sel'), - text: $r('app.string.tab_achievement'), - id: TabId.ACHIEVEMENT - }, { icon: $r('app.media.ic_tabs_mine_normal'), - icon_selected: $r('app.media.ic_tabs_mine_sel'), + icon_selected: $r('app.media.person_crop_circle_fill'), text: $r('app.string.tab_mine'), id: TabId.MINE }, diff --git a/features/healthylife/src/main/ets/pages/HealthyLifePage.ets b/features/healthylife/src/main/ets/pages/HealthyLifePage.ets index cf97c927ce9fd735dfcbb5cf8236efbb3e486781..74cc7ece8c5e14e0604054c7ea9a0252e763f297 100644 --- a/features/healthylife/src/main/ets/pages/HealthyLifePage.ets +++ b/features/healthylife/src/main/ets/pages/HealthyLifePage.ets @@ -19,7 +19,6 @@ import { HomeComponent } from '../views/HomeComponent'; import { MineComponent } from '../views/MineComponent'; import { NavList, TabId } from '../model/NavItemModel'; import { CommonConstants as Const, convertDate2Str } from 'common'; -import { AchievementComponent } from '../views/AchievementComponent'; import DayInfoApi from 'common/src/main/ets/database/tables/DayInfoApi'; import { AchievementStore, initAchievementStore } from '../viewmodel/AchievementStore'; import { HomeStore } from '../viewmodel/HomeStore'; @@ -56,16 +55,12 @@ export struct HealthyLifePage { } .tabBar(this.tabBuilder(TabId.HOME)) - TabContent() { - AchievementComponent() - } - .tabBar(this.tabBuilder(TabId.ACHIEVEMENT)) - TabContent() { MineComponent() } .tabBar(this.tabBuilder(TabId.MINE)) } + .backgroundColor($r('sys.color.background_secondary')) .scrollable(false) .width(Const.THOUSANDTH_1000) .height(Const.THOUSANDTH_1000) @@ -96,7 +91,7 @@ export struct HealthyLifePage { Text(NavList[index].text) .fontSize($r('app.float.default_10')) .fontWeight(FontWeight.Regular) - .fontColor(this.currentIndex === index ? $r('sys.color.brand') : $r('sys.color.font_tertiary')) + .fontColor(this.currentIndex === index ? $r('app.color.text_font_color') : $r('sys.color.font_tertiary')) .margin({ top: $r('app.float.default_4') }) diff --git a/features/healthylife/src/main/ets/views/AchievementComponent.ets b/features/healthylife/src/main/ets/views/AchievementComponent.ets index 4cfb6c4c5d9a25c2a11228997e0aec133032c5f0..ccedd0b142ff40d964ca1ee135536c50ed9b71e0 100644 --- a/features/healthylife/src/main/ets/views/AchievementComponent.ets +++ b/features/healthylife/src/main/ets/views/AchievementComponent.ets @@ -3,42 +3,70 @@ import { AchievementStore } from '../viewmodel/AchievementStore'; import { openAchievementCustomDialog } from './dialog/AchievementDialog'; import { AchievementItem, AchievementList } from '../model/AchievementModel'; +@Builder +export function achBuilder() { + AchievementComponent(); +} + @Component export struct AchievementComponent { @Consume achievementStore: AchievementStore; + @Consume('pathStack') pageStack: NavPathStack; build() { - Column() { - Text($r('app.string.my_achievement')) - .fontFamily($r(Const.HARMONY_HEI_TI_MEDIUM)) - .fontWeight(FontWeight.Regular) - .fontColor($r(`sys.color.font_on_primary`)) - .fontSize($r('app.float.default_24')) - .width(Const.THOUSANDTH_1000) - .height($r('app.float.default_56')) - .padding({ - left: Const.THOUSANDTH_66, - top: Const.THOUSANDTH_150 + NavDestination() { + Column() { + Row() { + Image($r('app.media.ach_back')) + .height($r('app.float.default_40')) + .width($r('app.float.default_40')) + .margin({ + right: $r('app.float.default_8') + }) + .onClick(() => { + this.pageStack.pop(); + }) + Text($r('app.string.my_achievement')) + .fontFamily($r(Const.HARMONY_HEI_TI_MEDIUM)) + .fontWeight(FontWeight.Bold) + .fontColor($r(`sys.color.font_on_primary`)) + .fontSize($r('app.float.default_20')) + .width(Const.THOUSANDTH_1000) + .height($r('app.float.default_56')) + } + .margin({ + left: $r('app.float.default_12'), + right: $r('app.float.default_12') }) - Flex({ - direction: FlexDirection.Row, - wrap: FlexWrap.Wrap - }) { - ForEach(AchievementList, (item: AchievementItem, index: number) => { - this.achievementBuilder(index, item) - }, (item: AchievementItem, index: number) => index + JSON.stringify(item)) + Flex({ + direction: FlexDirection.Row, + wrap: FlexWrap.Wrap + }) { + ForEach(AchievementList, (item: AchievementItem, index: number) => { + this.achievementBuilder(index, item) + }, (item: AchievementItem, index: number) => index + JSON.stringify(item)) + } + .width(Const.THOUSANDTH_1000) } .width(Const.THOUSANDTH_1000) + .height(Const.THOUSANDTH_1000) + .backgroundColor($r('app.color.ach_bg_color')) + .justifyContent(FlexAlign.Start) + .padding({ + left: $r('app.float.default_10'), + right: $r('app.float.default_10'), + bottom: $r('app.float.default_10') + }) } - .width(Const.THOUSANDTH_1000) - .height(Const.THOUSANDTH_1000) + .size({ + width: Const.THOUSANDTH_1000, + height: Const.THOUSANDTH_1000 + }) .backgroundColor($r('app.color.ach_bg_color')) - .justifyContent(FlexAlign.Start) + .hideTitleBar(true) .padding({ - left: $r('app.float.default_10'), - right: $r('app.float.default_10'), - bottom: $r('app.float.default_10') + top: $r('app.float.default_40') }) } diff --git a/features/healthylife/src/main/ets/views/HomeComponent.ets b/features/healthylife/src/main/ets/views/HomeComponent.ets index 6ebc24a149fb0020086d3ee6349d89fc52cf1b7d..55b764d374361e5787f3975980e52b3f29ba52e4 100644 --- a/features/healthylife/src/main/ets/views/HomeComponent.ets +++ b/features/healthylife/src/main/ets/views/HomeComponent.ets @@ -21,8 +21,6 @@ import { TaskListComponent } from './home/TaskListComponent'; import { AchievementStore } from '../viewmodel/AchievementStore'; import { HomeStore, initCurrentDateInfo } from '../viewmodel/HomeStore'; -const WHITE_COLOR_0X = 255; - @Builder export function homeBuilder() { HomeComponent(); @@ -36,17 +34,6 @@ export struct HomeComponent { @State naviAlpha: number = 0; @State flag: boolean = false; private scroller: Scroller = new Scroller(); - private yOffset: number = 0; - - // change navigator alpha when scrolling the Scroll component - onScrollAction() { - this.yOffset = this.scroller.currentOffset().yOffset; - if (this.yOffset > Const.DEFAULT_56) { - this.naviAlpha = 1; - } else { - this.naviAlpha = this.yOffset / Const.DEFAULT_56; - } - } async aboutToAppear() { this.homeStore = await initCurrentDateInfo(new Date()); @@ -62,7 +49,7 @@ export struct HomeComponent { Column() { Text($r('app.string.healthy_life')) .fontFamily($r(Const.HARMONY_HEI_TI_MEDIUM)) - .fontWeight(FontWeight.Regular) + .fontWeight(FontWeight.Bold) .fontColor($r(`sys.color.font_primary`)) .fontSize($r('app.float.default_24')) .width(Const.THOUSANDTH_1000) @@ -80,14 +67,14 @@ export struct HomeComponent { Text($r('app.string.task_list')) .fontFamily(Const.HARMONY_HEI_TI_MEDIUM) - .fontWeight(FontWeight.Regular) + .fontWeight(FontWeight.Bold) .fontColor($r(`sys.color.font_primary`)) - .fontSize($r('app.float.default_16')) + .fontSize($r('app.float.default_20')) .width(Const.THOUSANDTH_1000) .padding({ - top: Const.THOUSANDTH_15, - bottom: Const.THOUSANDTH_15, - left: Const.THOUSANDTH_33 + top: $r('app.float.default_24'), + bottom: $r('app.float.default_8'), + left: $r('app.float.default_16') }) TaskListComponent() @@ -101,9 +88,6 @@ export struct HomeComponent { alwaysEnabled: false, effectEdge: EffectEdge.END }) - .onWillScroll(() => { - this.onScrollAction(); - }) Button({ type: ButtonType.Circle, @@ -115,8 +99,8 @@ export struct HomeComponent { .width($r('app.float.default_48')) .height($r('app.float.default_48')) .position({ - x: Const.THOUSANDTH_830, - y: Const.THOUSANDTH_880 + x: Const.THOUSANDTH_440, + y: Const.THOUSANDTH_900 }) .zIndex(Const.HOME_COMPONENT_Z_INDEX) .onClick(() => { diff --git a/features/healthylife/src/main/ets/views/MineComponent.ets b/features/healthylife/src/main/ets/views/MineComponent.ets index 22df9efcbca964dbab3c3177c8471ce141bf8118..1e03b7c8cdb162c6d19deee1cb28c37ab7bcb72a 100644 --- a/features/healthylife/src/main/ets/views/MineComponent.ets +++ b/features/healthylife/src/main/ets/views/MineComponent.ets @@ -16,21 +16,111 @@ */ import { CommonConstants as Const } from 'common'; -import { MineMenuComponent } from './mine/MineMenuComponent'; import { UserInfoComponent } from './mine/UserInfoComponent'; @Component export struct MineComponent { @Provide uiContext: UIContext = this.getUIContext(); + @Consume('pathStack') pageStack: NavPathStack; build() { - Column() { - UserInfoComponent() + Navigation() { + Column() { + UserInfoComponent() + Row({ space: $r('app.float.default_16') }) { + Image($r('app.media.book_closed_per')) + .width($r('app.float.default_24')) + .height($r('app.float.default_24')) + Text($r('app.string.mine_personal_data')) + .fontColor($r('app.color.mine_font_color')) + .fontSize($r('app.float.default_18')) + .fontWeight(FontWeight.Medium) + Blank(); + SymbolGlyph($r('sys.symbol.chevron_right')) + .fontColor([$r('sys.color.icon_fourth')]) + .fontWeight(FontWeight.Normal) + .fontSize($r('app.float.default_24')) + } + .width(Const.THOUSANDTH_940) + .height(Const.THOUSANDTH_100) + .borderRadius({ + topLeft: $r('app.float.default_16'), + topRight: $r('app.float.default_16') + }) + .padding({ + left: $r('app.float.default_12'), + right: $r('app.float.default_12') + }) + .backgroundColor($r('sys.color.background_primary')) + .margin({ + top: $r('app.float.default_6') + }) - MineMenuComponent() + Divider() + .color($r('app.float.default_1')) + .width(Const.THOUSANDTH_880) + Row({ space: $r('app.float.default_16') }) { + Image($r('app.media.arrow_up_circle')) + .width($r('app.float.default_24')) + .height($r('app.float.default_24')) + Text($r('app.string.mine_check_updates')) + .fontColor($r('app.color.mine_font_color')) + .fontSize($r('app.float.default_18')) + .fontWeight(FontWeight.Medium) + Blank(); + SymbolGlyph($r('sys.symbol.chevron_right')) + .fontColor([$r('sys.color.icon_fourth')]) + .fontWeight(FontWeight.Normal) + .fontSize($r('app.float.default_24')) + } + .width(Const.THOUSANDTH_940) + .height(Const.THOUSANDTH_100) + .borderRadius({ + bottomLeft: $r('app.float.default_16'), + bottomRight: $r('app.float.default_16') + }) + .padding({ + left: $r('app.float.default_12'), + right: $r('app.float.default_12') + }) + .backgroundColor($r('sys.color.background_primary')) + .margin({ + bottom: $r('app.float.default_6') + }) + + Row({ space: $r('app.float.default_16') }) { + Image($r('app.media.star_trophy')) + .width($r('app.float.default_24')) + .height($r('app.float.default_24')) + Text($r('app.string.mine_achievement')) + .fontColor($r('app.color.mine_font_color')) + .fontSize($r('app.float.default_18')) + .fontWeight(FontWeight.Medium) + Blank(); + SymbolGlyph($r('sys.symbol.chevron_right')) + .fontColor([$r('sys.color.icon_fourth')]) + .fontWeight(FontWeight.Normal) + .fontSize($r('app.float.default_24')) + } + .width(Const.THOUSANDTH_940) + .height(Const.THOUSANDTH_100) + .borderRadius($r('app.float.default_16')) + .padding({ + left: $r('app.float.default_12'), + right: $r('app.float.default_12') + }) + .backgroundColor($r('sys.color.background_primary')) + .margin({ + top: $r('app.float.default_6') + }) + .onClick(() => { + this.pageStack.pushPathByName('AchievementComponent', ''); + }) + } + .width(Const.THOUSANDTH_1000) + .height(Const.THOUSANDTH_1000) } - .width(Const.THOUSANDTH_1000) - .height(Const.THOUSANDTH_1000) + .title($r('app.string.tab_mine')) .backgroundColor($r('sys.color.background_secondary')) } } \ No newline at end of file diff --git a/features/healthylife/src/main/ets/views/dialog/TargetSettingDialog.ets b/features/healthylife/src/main/ets/views/dialog/TargetSettingDialog.ets index d501f6bdbf6cfd95bde48cc95a93cc197f74ef81..26dad568500950a8151c5def9f390619e5b3d7ce 100644 --- a/features/healthylife/src/main/ets/views/dialog/TargetSettingDialog.ets +++ b/features/healthylife/src/main/ets/views/dialog/TargetSettingDialog.ets @@ -42,17 +42,16 @@ export function targetSettingDialogBuilder(params: TargetSettingDialogParams) { Row() { Text($r('app.string.target_setting')) .fontSize($r('app.float.default_20')) + .fontWeight(FontWeight.Bold) .margin({ - right: $r('app.float.default_12') + top: $r('app.float.default_12'), + right: $r('app.float.default_12'), + bottom: $r('app.float.default_16') }) - - if (params.taskBaseInfo.limit) { - Text(`(${params.taskBaseInfo.limit})`) - .fontSize($r('app.float.default_16')) - } } .width(Const.THOUSANDTH_1000) - .justifyContent(FlexAlign.Start) + .height($r('app.float.default_56')) + .justifyContent(FlexAlign.Center) if (params.taskBaseInfo.pickerType === PickerType.TIME) { TimePicker({ @@ -61,7 +60,10 @@ export function targetSettingDialogBuilder(params: TargetSettingDialogParams) { start: params.startDate, end: params.endDate }) - .height(Const.THOUSANDTH_800) + .margin({ + left: $r('app.float.default_24'), + right: $r('app.float.default_24') + }) .useMilitaryTime(true) .onChange((value: TimePickerResult) => { if (value.hour != undefined && value.minute != undefined) { @@ -74,7 +76,10 @@ export function targetSettingDialogBuilder(params: TargetSettingDialogParams) { value: params.selectedValue }) .width(Const.THOUSANDTH_900) - .height(Const.THOUSANDTH_800) + .margin({ + left: $r('app.float.default_24'), + right: $r('app.float.default_24') + }) .onChange((value: string | string[]) => { params.selectedValue = value as string; }) @@ -82,14 +87,14 @@ export function targetSettingDialogBuilder(params: TargetSettingDialogParams) { Row() { Text($r('app.string.cancel')) - .fontColor($r('sys.color.brand')) + .fontColor($r('app.color.text_font_color')) .fontSize($r('app.float.default_20')) .onClick(() => { PromptActionClass.closeDialog(); }) Text($r('app.string.confirm')) - .fontColor($r('sys.color.brand')) + .fontColor($r('app.color.text_font_color')) .fontSize($r('app.float.default_20')) .onClick(() => { params.taskInfo.targetValue = params.selectedValue; @@ -97,16 +102,20 @@ export function targetSettingDialogBuilder(params: TargetSettingDialogParams) { }) } .width(Const.THOUSANDTH_1000) - .height($r('app.float.default_28')) + .height($r('app.float.default_56')) .justifyContent(FlexAlign.SpaceAround) .margin({ - bottom: $r('app.float.default_20') + top: $r('app.float.default_8') }) } .backgroundColor($r('sys.color.background_primary')) - .height(Const.THOUSANDTH_500) + .height(Const.THOUSANDTH_420) .justifyContent(FlexAlign.SpaceAround) - .borderRadius($r('app.float.default_24')) - .margin($r('app.float.default_18')) + .borderRadius($r('app.float.default_32')) + .margin({ + left: $r('app.float.default_18'), + right: $r('app.float.default_18'), + bottom: Const.THOUSANDTH_500 + }) .padding($r('app.float.default_12')) } \ No newline at end of file diff --git a/features/healthylife/src/main/ets/views/dialog/TaskClockCustomDialog.ets b/features/healthylife/src/main/ets/views/dialog/TaskClockCustomDialog.ets index fd6b8e3ced6a63c943cf110004241e8673662c49..bcc535ef49390c67ff39b2162b444f5588ad4933 100644 --- a/features/healthylife/src/main/ets/views/dialog/TaskClockCustomDialog.ets +++ b/features/healthylife/src/main/ets/views/dialog/TaskClockCustomDialog.ets @@ -59,19 +59,6 @@ export function taskClockDialogBuilder(params: TaskInfoDialogParams) { .onClick(async () => { await taskClock(params); }); - - Text($r('app.string.got_it')) - .fontFamily(Const.HARMONY_HEI_TI) - .fontWeight(FontWeight.Regular) - .fontColor($r(`sys.color.font_on_primary`)) - .fontSize($r('app.float.default_14')) - .margin({ - top: $r('app.float.default_12') - }) - .onClick(() => { - PromptActionClass.closeDialog(); - }); - } .height($r('app.float.default_451')) .width($r('app.float.default_316')) @@ -82,8 +69,8 @@ export function taskClockDialogBuilder(params: TaskInfoDialogParams) { }) .justifyContent(FlexAlign.End) .padding({ - bottom: $r('app.float.default_12'), - left: $r('app.float.default_20') + bottom: $r('app.float.default_16'), + left: $r('app.float.default_10') }) } diff --git a/features/healthylife/src/main/ets/views/home/TaskListComponent.ets b/features/healthylife/src/main/ets/views/home/TaskListComponent.ets index 6c16e67903bb124304720aed1d6ef6ad47ca131e..006f36716903cd596130e20b8372d96dee71b87b 100644 --- a/features/healthylife/src/main/ets/views/home/TaskListComponent.ets +++ b/features/healthylife/src/main/ets/views/home/TaskListComponent.ets @@ -38,8 +38,8 @@ export struct TaskListComponent { .width(Const.THOUSANDTH_1000) .padding({ top: Const.THOUSANDTH_15, - right: Const.THOUSANDTH_33, - left: Const.THOUSANDTH_33 + left:$r('app.float.default_16'), + right:$r('app.float.default_16') }) } else { Column() { @@ -86,7 +86,7 @@ export struct TaskListComponent { } .width(Const.THOUSANDTH_1000) .height($r('app.float.default_62')) - .borderRadius($r('app.float.default_24')) + .borderRadius($r('app.float.default_16')) .padding({ left: Const.THOUSANDTH_50, right: Const.THOUSANDTH_50 @@ -115,7 +115,7 @@ export struct TaskListComponent { this.taskValueBuilder($r('app.string.was_done'), $r(`sys.color.font_primary`)) } else { Row() { - this.taskValueBuilder((item.finValue || `--`), $r(`sys.color.font_secondary`)) + this.taskValueBuilder((item.finValue || `--`), $r(`sys.color.font_primary`)) this.taskValueBuilder(` / ${item.targetValue} `, $r(`sys.color.font_primary`)) diff --git a/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets b/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets deleted file mode 100644 index 71e4e5b2095886da7b0ff4d59532146a0585f6a9..0000000000000000000000000000000000000000 --- a/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets +++ /dev/null @@ -1,73 +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 { CommonConstants as Const } from 'common'; - -@Reusable -@Component -export struct MineMenuComponent { - build() { - List() { - ForEach(Const.DEFAULT_MENU_INFO, (item: Resource) => { - ListItem() { - Flex({ - justifyContent: FlexAlign.SpaceBetween, - alignItems: ItemAlign.Center - }) { - Text(item) - .fontSize($r('app.float.default_16')) - .height($r('app.float.default_40')) - - SymbolGlyph($r('sys.symbol.chevron_right')) - .fontColor([$r('sys.color.icon_secondary')]) - .fontWeight(FontWeight.Normal) - .fontSize($r('app.float.default_24')) - } - } - .backgroundColor($r('sys.color.background_primary')) - .margin({ - left: $r('app.float.default_24'), - right: $r('app.float.default_24') - }) - .height($r('app.float.default_48')) - .border({ - width: { - bottom: $r('app.float.default_1') - }, - color: $r('sys.color.background_tertiary') - }) - }, (item: Resource, index: number) => index + JSON.stringify(item)); - } - .border({ - radius: { - topLeft: $r('app.float.default_24'), - topRight: $r('app.float.default_24') - } - }) - .width(Const.THOUSANDTH_1000) - .height(Const.THOUSANDTH_560) - .backgroundColor($r('sys.color.background_primary')) - .margin({ - top: $r('app.float.default_24') - }) - .padding({ - top: $r('app.float.default_16') - }) - .flexGrow(Const.FLEX_GROW_1) - .clip(true) - } -} \ No newline at end of file diff --git a/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets b/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets index aeba4e1cd1d1cc7c9f06a438cc4968f33661e129..8d98c0f3dbc8a63ec266250b75966d60fceee31a 100644 --- a/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets +++ b/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets @@ -21,46 +21,26 @@ import { CommonConstants as Const } from 'common'; @Component export struct UserInfoComponent { build() { - Column() { - Image($r('app.media.ic_user')) - .objectFit(ImageFit.Contain) - .height($r('app.float.default_66')) - .width($r('app.float.default_66')) - .margin({ - top: $r('app.float.default_71') - }) - - Column() { - Text($r('app.string.user_level')) - .fontWeight(FontWeight.Bolder) - .fontColor($r('app.color.user_level_font_color')) - .fontSize($r('app.float.default_12')) - } - .width($r('app.float.default_44')) - .height($r('app.float.default_16')) - .margin({ - top: $r('app.float.default_n8') - }) - .border({ - radius: $r('app.float.default_5') - }) - .backgroundColor($r('app.color.user_level_bg_color')) - .justifyContent(FlexAlign.Center) + Row({ space: $r('app.float.default_12') }) { + Image($r('app.media.person_crop_circle')) + .width($r('app.float.default_48')) + .height($r('app.float.default_48')) Text($r('app.string.user_name')) - .fontFamily(Const.HELVETICA) - .fontWeight(FontWeight.Normal) - .fontColor($r('sys.color.font_primary')) - .fontSize($r('app.float.default_20')) - .margin({ - bottom: $r('app.float.default_6') - }) - - Text($r('app.string.user_signature')) - .fontFamily(Const.PING_FANG_SC_REGULAR) - .fontWeight(FontWeight.Normal) - .fontColor($r('sys.color.font_secondary')) - .fontSize($r('app.float.default_16')) + .fontColor($r('app.color.mine_font_color')) + .fontSize($r('app.float.default_18')) + .fontWeight(FontWeight.Medium) } + .width(Const.THOUSANDTH_940) + .height(Const.THOUSANDTH_130) + .borderRadius($r('app.float.default_16')) + .padding({ + left: $r('app.float.default_12'), + right: $r('app.float.default_12') + }) + .backgroundColor($r('sys.color.background_primary')) + .margin({ + bottom: $r('app.float.default_6') + }) } } \ No newline at end of file diff --git a/features/healthylife/src/main/ets/views/task/AddTaskComponent.ets b/features/healthylife/src/main/ets/views/task/AddTaskComponent.ets index 3133e0330bcc6e1a5d5b0b97f79d50f7244c76f6..8c45598fd8bf601a60ddf84c63cc00e3389e7f4d 100644 --- a/features/healthylife/src/main/ets/views/task/AddTaskComponent.ets +++ b/features/healthylife/src/main/ets/views/task/AddTaskComponent.ets @@ -38,7 +38,7 @@ export struct AddTaskComponent { NavDestination() { if (this.flag) { Column({ - space: $r('app.float.default_2') + space: $r('app.float.default_12') }) { ForEach(this.taskList, (item: TaskInfo, index: number) => { this.taskInfoBuilder(item, index) @@ -46,6 +46,7 @@ export struct AddTaskComponent { } .width(Const.THOUSANDTH_940) .justifyContent(FlexAlign.Center) + .margin($r('app.float.default_8')) } } .size({ @@ -55,7 +56,9 @@ export struct AddTaskComponent { .backgroundColor($r('sys.color.background_secondary')) .title($r('app.string.add_task')) .padding({ - top: $r('app.float.default_36') + top: $r('app.float.default_40'), + left:$r('app.float.default_6'), + right:$r('app.float.default_6') }) } @@ -72,7 +75,7 @@ export struct AddTaskComponent { Text(taskBaseInfoList[item.taskId].name) .fontColor($r(`sys.color.font_primary`)) - .fontSize($r('app.float.default_20')) + .fontSize($r('app.float.default_18')) Blank(); @@ -91,7 +94,7 @@ export struct AddTaskComponent { } .width(Const.THOUSANDTH_1000) .height(Const.THOUSANDTH_80) - .borderRadius($r('app.float.default_12')) + .borderRadius($r('app.float.default_16')) .padding({ left: $r('app.float.default_12'), right: $r('app.float.default_12') diff --git a/features/healthylife/src/main/ets/views/task/EditTaskComponent.ets b/features/healthylife/src/main/ets/views/task/EditTaskComponent.ets index 815b67304843a4220e3b8eede18fae46142431ad..6c8ae97a55c8227def16df4e7e03abc00ad3bf30 100644 --- a/features/healthylife/src/main/ets/views/task/EditTaskComponent.ets +++ b/features/healthylife/src/main/ets/views/task/EditTaskComponent.ets @@ -121,19 +121,19 @@ export struct EditTaskComponent { build() { NavDestination() { Column({ - space: $r('app.float.default_2') + space: $r('app.float.default_12') }) { Row() { Text(this.taskBaseInfo.name) .fontWeight(FontWeight.Medium) - .fontSize($r('app.float.default_20')) + .fontSize($r('app.float.default_18')) Toggle({ type: ToggleType.Switch, isOn: this.taskInfo.isOpen }) - .width($r('app.float.default_56')) - .height($r('app.float.default_32')) + .width($r('app.float.default_36')) + .height($r('app.float.default_20')) .onChange((isOn) => { this.taskInfo.isOpen = isOn; }) @@ -142,7 +142,7 @@ export struct EditTaskComponent { .justifyContent(FlexAlign.SpaceBetween) .backgroundColor($r('sys.color.background_primary')) .height($r('app.float.default_56')) - .borderRadius($r('app.float.default_10')) + .borderRadius($r('app.float.default_16')) .padding({ left: $r('app.float.default_12'), right: $r('app.float.default_12') @@ -151,7 +151,7 @@ export struct EditTaskComponent { Row() { Text($r('app.string.target_setting')) .fontWeight(FontWeight.Medium) - .fontSize($r('app.float.default_20')) + .fontSize($r('app.float.default_18')) Blank() @@ -172,7 +172,7 @@ export struct EditTaskComponent { } .width(Const.THOUSANDTH_940) .height($r('app.float.default_56')) - .borderRadius($r('app.float.default_10')) + .borderRadius($r('app.float.default_16')) .backgroundColor($r('sys.color.background_primary')) .justifyContent(FlexAlign.SpaceBetween) .padding({ @@ -189,14 +189,15 @@ export struct EditTaskComponent { Button() { Text($r('app.string.complete')) - .fontSize($r('app.float.default_20')) + .fontSize($r('app.float.default_18')) } - .width(Const.THOUSANDTH_800) - .height($r('app.float.default_48')) - .backgroundColor($r('sys.color.background_primary')) + .buttonStyle(ButtonStyleMode.NORMAL) + .width(Const.THOUSANDTH_940) + .height($r('app.float.default_40')) + .backgroundColor($r('sys.color.button_background_color_transparent')) .position({ - x: Const.THOUSANDTH_100, - y: Const.THOUSANDTH_800 + x: Const.THOUSANDTH_30, + y: Const.THOUSANDTH_880 }) .onClick(async () => { await this.finishTaskEdit(); @@ -204,6 +205,7 @@ export struct EditTaskComponent { } .width(Const.THOUSANDTH_1000) .justifyContent(FlexAlign.Center) + .margin($r('app.float.default_8')) } .size({ width: Const.THOUSANDTH_1000, @@ -211,7 +213,9 @@ export struct EditTaskComponent { }) .title($r('app.string.edit_task')) .padding({ - top: $r('app.float.default_36') + top: $r('app.float.default_40'), + left:$r('app.float.default_6'), + right:$r('app.float.default_6') }) .backgroundColor($r('sys.color.background_secondary')) } diff --git a/features/healthylife/src/main/resources/base/profile/router_map.json b/features/healthylife/src/main/resources/base/profile/router_map.json index c3b3b9986e16b3d1f1ce7d2335ed7062a26c98ed..6719f3068a582958bd7c456d1dc3cb4e3e40a3f1 100644 --- a/features/healthylife/src/main/resources/base/profile/router_map.json +++ b/features/healthylife/src/main/resources/base/profile/router_map.json @@ -14,6 +14,11 @@ "name": "EditTaskComponent", "pageSourceFile": "src/main/ets/views/task/EditTaskComponent.ets", "buildFunction": "editTaskBuilder" + }, + { + "name": "AchievementComponent", + "pageSourceFile": "src/main/ets/views/AchievementComponent.ets", + "buildFunction": "achBuilder" } ] } \ No newline at end of file diff --git a/products/default/src/main/ets/agency/pages/AgencyCard.ets b/products/default/src/main/ets/agency/pages/AgencyCard.ets index 936953be2cd2a9af63cc2cbe51e8e44723e6d2c7..d043349d456cc3be118f9261e7b83414b6a9d0f1 100644 --- a/products/default/src/main/ets/agency/pages/AgencyCard.ets +++ b/products/default/src/main/ets/agency/pages/AgencyCard.ets @@ -46,7 +46,7 @@ struct AgencyCard { /* * The agency component height percentage setting. */ - readonly AGENCY_COMPONENT_HEIGHT: string = '30.5%'; + readonly AGENCY_COMPONENT_HEIGHT: string = '45%'; /* * The empty image height percentage setting. */ @@ -70,7 +70,7 @@ struct AgencyCard { /* * The list component space. */ - readonly LIST_SPACE: number = 5; + readonly LIST_SPACE: number = 3; /* * The list component two lanes. */ @@ -96,25 +96,17 @@ struct AgencyCard { Column() { if (this.dayTaskInfos.length > 0) { List({ space: this.LIST_SPACE }) { - ForEach(this.dayTaskInfos, (taskItem: DayTaskInfo) => { + ForEach(this.dayTaskInfos.slice(0, 1), (taskItem: DayTaskInfo) => { ListItem() { this.AgencyComponent(taskItem) } - .margin({ - right: $r("app.float.agency_item_margin") - }) + .width(this.FULL_WIDTH_PERCENT) + .height(this.FULL_HEIGHT_PERCENT) .borderRadius($r("app.float.agency_item_radius")) .backgroundColor(Color.White) }, (item: DayTaskInfo, index: number) => index + JSON.stringify(item)) } - .padding({ - left: $r('app.float.agency_padding_left'), - top: $r('app.float.agency_padding_top'), - right: $r('app.float.agency_padding_right'), - bottom: $r('app.float.agency_padding_bottom') - }) - .lanes(this.LIST_TWO_LANES) - .backgroundColor($r("app.color.list_background_color")) + .backgroundColor($r("sys.color.background_tertiary")) .width(this.FULL_WIDTH_PERCENT) .height(this.FULL_HEIGHT_PERCENT) } else { @@ -130,42 +122,54 @@ struct AgencyCard { .width($r('app.float.agency_image_size')) .height($r('app.float.agency_image_size')) .objectFit(ImageFit.Contain) + Column() { + Text(taskBaseInfoList[taskItem.taskId].name) + .fontSize($r('app.float.card_title_size')) + .fontWeight(FontWeight.Medium) + .margin({ + top: $r('app.float.default_2'), + bottom: $r('app.float.default_4') + }) + Row() { + if (taskBaseInfoList[taskItem.taskId].step === 0) { + Text(taskItem.isDone ? taskItem.targetValue : this.TARGET_VALUE_SPLICING + taskItem.targetValue) + .fontWeight(FontWeight.Normal) + .fontColor($r("app.color.text_common_color")) + .fontSize($r("app.float.text_common_size")) + .opacity(this.TARGET_TEXT_OPACITY) + .textAlign(TextAlign.End) + } else { + Text(taskItem.finValue === '' ? this.CROSS_BAR_SYMBOL : taskItem.finValue) + .fontWeight(taskItem.finValue === '' ? FontWeight.Normal : this.TEXT_SLIGHTLY_BOLD) + .fontColor(taskItem.finValue === '' ? $r('app.color.hex_common_color') : + $r('app.color.text_common_color')) + .fontSize(taskItem.finValue === '' ? $r("app.float.text_common_size") : $r('app.float.agency_text_bold')) - Row() { - if (taskBaseInfoList[taskItem.taskId].step === 0) { - Text(taskItem.isDone ? taskItem.targetValue : this.TARGET_VALUE_SPLICING + taskItem.targetValue) - .fontWeight(FontWeight.Normal) - .fontColor($r("app.color.text_common_color")) - .fontSize($r("app.float.text_common_size")) - .opacity(this.TARGET_TEXT_OPACITY) - .textAlign(TextAlign.End) - } else { - Text(taskItem.finValue === '' ? this.CROSS_BAR_SYMBOL : taskItem.finValue) - .fontWeight(taskItem.finValue === '' ? FontWeight.Normal : this.TEXT_SLIGHTLY_BOLD) - .fontColor(taskItem.finValue === '' ? $r('app.color.hex_common_color') : $r('app.color.text_common_color')) - .fontSize(taskItem.finValue === '' ? $r("app.float.text_common_size") : $r('app.float.agency_text_bold')) + Text(this.SLASHES + taskItem.targetValue) + .fontWeight(FontWeight.Normal) + .fontColor($r('app.color.hex_common_color')) + .fontSize($r("app.float.text_common_size")) + } - Text(this.SLASHES + taskItem.targetValue) + Text(taskBaseInfoList[taskItem.taskId].unit) .fontWeight(FontWeight.Normal) .fontColor($r('app.color.hex_common_color')) .fontSize($r("app.float.text_common_size")) } - - Text(taskBaseInfoList[taskItem.taskId].unit) - .fontWeight(FontWeight.Normal) - .fontColor($r('app.color.hex_common_color')) - .fontSize($r("app.float.text_common_size")) + .justifyContent(FlexAlign.End) } - .layoutWeight(this.TARGET_TEXT_WEIGHT) - .justifyContent(FlexAlign.End) - + .alignItems(HorizontalAlign.Start) + .padding({ + left: $r('app.float.agency_row_padding'), + right: $r('app.float.agency_row_padding') + }) } .padding({ left: $r('app.float.agency_row_padding'), right: $r('app.float.agency_row_padding') }) .width(this.FULL_WIDTH_PERCENT) - .height(this.AGENCY_COMPONENT_HEIGHT) + .height(this.FULL_WIDTH_PERCENT) .onClick(() => { this.jumpToAbility(); }) diff --git a/products/default/src/main/ets/pages/SplashPage.ets b/products/default/src/main/ets/pages/SplashPage.ets index 2ad7e652db0fa3ad0ab7e88489aaa6d796569c97..1342cae4611b8959db7fdca0201150484a467caf 100644 --- a/products/default/src/main/ets/pages/SplashPage.ets +++ b/products/default/src/main/ets/pages/SplashPage.ets @@ -15,63 +15,16 @@ * */ -import { common } from '@kit.AbilityKit'; -import { preferences } from '@kit.ArkData'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { BusinessError } from '@kit.BasicServicesKit'; import { CommonConstants as Const } from 'common'; -import UserPrivacyDialog from '../views/UserPrivacyDialog'; // hilog tag. const TAG: string = 'SplashPage'; -// app preferences name -const H_STORE: string = 'healthAppStore'; -const IS_PRIVACY: string = 'isPrivacy'; @Entry @Component struct SplashPage { - context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; - dialogController: CustomDialogController = new CustomDialogController({ - builder: UserPrivacyDialog( - { - cancel: () => { - this.exitApp(); - }, - confirm: () => { - this.onConfirm(); - } - }), - cancel: () => { - this.exitApp(); - }, - autoCancel: false, - alignment: DialogAlignment.Bottom, - offset: { - dx: $r('app.float.default_0'), - dy: $r('app.float.default_24') - } - }); - - onConfirm() { - preferences.getPreferences(this.context, H_STORE).then((res) => { - res.put(IS_PRIVACY, true).then(() => { - res.flush(); - hilog.info(0x0000, TAG, 'isPrivacy is put success'); - }).catch((err: BusinessError) => { - hilog.error(0x0000, TAG, `isPrivacy put failed, code is ${err.code},message is ${err.message}`); - }); - }).catch((err: BusinessError) => { - hilog.error(0x0000, TAG, `Get preferences failed, code is ${err.code},message is ${err.message}`); - }); - this.jumpAdPage(); - } - - exitApp() { - this.context.terminateSelf().catch((err: BusinessError) => { - hilog.error(0x0000, TAG, `Exit app failed, code is ${err.code},message is ${err.message}`); - }); - } jumpAdPage() { setTimeout(() => { @@ -82,11 +35,7 @@ struct SplashPage { } aboutToAppear() { - preferences.getPreferences(this.context, H_STORE).then((res) => { - this.jumpAdPage(); - }).catch((err: BusinessError) => { - hilog.error(0x0000, TAG, `Get preferences failed, code is ${err.code},message is ${err.message}`); - }) + this.jumpAdPage(); } aboutToDisappear() { diff --git a/products/default/src/main/resources/base/element/float.json b/products/default/src/main/resources/base/element/float.json index fc3ee163ebd24b4322971ed4b6aac91ce07f5ae3..9ecb4ff14ab61fbbf4ae358495560c60bd068d12 100644 --- a/products/default/src/main/resources/base/element/float.json +++ b/products/default/src/main/resources/base/element/float.json @@ -46,23 +46,23 @@ }, { "name": "agency_item_radius", - "value": "6vp" + "value": "16vp" }, { "name": "agency_padding_left", - "value": "12vp" + "value": "5vp" }, { "name": "agency_padding_top", - "value": "10vp" + "value": "3vp" }, { "name": "agency_padding_right", - "value": "6vp" + "value": "5vp" }, { "name": "agency_padding_bottom", - "value": "10vp" + "value": "3vp" }, { "name": "empty_data_size", @@ -83,6 +83,10 @@ { "name": "agency_row_padding", "value": "15vp" + }, + { + "name": "card_title_size", + "value": "18fp" } ] } \ No newline at end of file diff --git a/products/default/src/main/resources/base/profile/form_config.json b/products/default/src/main/resources/base/profile/form_config.json index 41df7da34e9abf3b794f9e726f532535d1377ce3..048fffd04b8ce8e884c4f040a959879a04182fdc 100644 --- a/products/default/src/main/resources/base/profile/form_config.json +++ b/products/default/src/main/resources/base/profile/form_config.json @@ -37,9 +37,9 @@ "updateEnabled": false, "scheduledUpdateTime": "10:30", "updateDuration": 1, - "defaultDimension": "2*4", + "defaultDimension": "1*2", "supportDimensions": [ - "2*4" + "1*2" ] } ] diff --git a/screenshots/healthyfile1.png b/screenshots/healthyfile1.png index 03c3f269bed237a089f16ead9e0c905b238ba04b..e2e8bc913c56d8aead7981af2ee0f326430d885d 100644 Binary files a/screenshots/healthyfile1.png and b/screenshots/healthyfile1.png differ diff --git a/screenshots/healthyfile2.png b/screenshots/healthyfile2.png index 5234e5e36db15f2a01cd0c6b2b868a701db8e597..4d882d89b37c465f19a689e5166995016f0ef747 100644 Binary files a/screenshots/healthyfile2.png and b/screenshots/healthyfile2.png differ diff --git a/screenshots/healthyfile3.png b/screenshots/healthyfile3.png index 1c6030c2610497ed35ab865f4a5351fd29321713..43a9d35c23729c1327f7380ad7b18223c2000682 100644 Binary files a/screenshots/healthyfile3.png and b/screenshots/healthyfile3.png differ diff --git a/screenshots/healthyfile4.png b/screenshots/healthyfile4.png index 08dfaa62f5dd79f75b427847d4daa0fc035dd575..9960b6128bbf4701f01a2c56b65e027497a55ff1 100644 Binary files a/screenshots/healthyfile4.png and b/screenshots/healthyfile4.png differ diff --git a/screenshots/healthyfile5.png b/screenshots/healthyfile5.png index e333bd2ebd264c60759c4fa7e0a5212e194c7f4b..99350eabc0aa7d3896c97fa06bea3d46d5716d61 100644 Binary files a/screenshots/healthyfile5.png and b/screenshots/healthyfile5.png differ diff --git a/screenshots/healthyfile6.png b/screenshots/healthyfile6.png index 876bcdf786aef87d3328cea221d1cc6909aa7e90..879a3b1a3d19995ffd749d31e6e4fbfd412037df 100644 Binary files a/screenshots/healthyfile6.png and b/screenshots/healthyfile6.png differ diff --git a/screenshots/healthyfile7.png b/screenshots/healthyfile7.png new file mode 100644 index 0000000000000000000000000000000000000000..78017083220246510287ef1cbc3198a2fcd5cabb Binary files /dev/null and b/screenshots/healthyfile7.png differ diff --git a/screenshots/healthyfile8.png b/screenshots/healthyfile8.png new file mode 100644 index 0000000000000000000000000000000000000000..876bcdf786aef87d3328cea221d1cc6909aa7e90 Binary files /dev/null and b/screenshots/healthyfile8.png differ