From 638e294d83aca2d07a82a4f720b162c31b937c40 Mon Sep 17 00:00:00 2001 From: 15535735306 <15535735306@163.com> Date: Mon, 13 Oct 2025 12:12:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcodelinter=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/common/src/main/ets/utils/FormUtils.ets | 3 ++- features/healthylife/src/main/ets/viewmodel/HomeStore.ets | 2 +- .../healthylife/src/main/ets/views/mine/MineMenuComponent.ets | 1 + .../healthylife/src/main/ets/views/mine/UserInfoComponent.ets | 1 + products/default/src/main/ets/views/UserPrivacyDialog.ets | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/commons/common/src/main/ets/utils/FormUtils.ets b/commons/common/src/main/ets/utils/FormUtils.ets index 3e54d6e..1fc07fa 100644 --- a/commons/common/src/main/ets/utils/FormUtils.ets +++ b/commons/common/src/main/ets/utils/FormUtils.ets @@ -33,6 +33,7 @@ import { CommonConstants as Const } from '../constants/CommonConstants'; const TAG: string = 'FormUtils'; export class FormUtils { + private static date = new Date(); /* * Added service card information. * @param { Context } context context. @@ -70,7 +71,7 @@ export class FormUtils { * @returns { void } */ public static updateByFormName(formInfo: FormInfo): void { - const date = convertDate2Str(new Date()); + const date = convertDate2Str(FormUtils.date); let updateDate: FormStorageModel = {}; if (formInfo.formName === Const.FORM_NAME_AGENCY && Number(formInfo.formDimension) === Const.DEFAULT_DIMENSION_2X4) { diff --git a/features/healthylife/src/main/ets/viewmodel/HomeStore.ets b/features/healthylife/src/main/ets/viewmodel/HomeStore.ets index 982c93b..84a05cf 100644 --- a/features/healthylife/src/main/ets/viewmodel/HomeStore.ets +++ b/features/healthylife/src/main/ets/viewmodel/HomeStore.ets @@ -113,8 +113,8 @@ function getWeekDates(inputDate: Date, adjustDays: number): Date[] { monday.setDate(inputDate.getDate() - adjustDays - Const.WEEK_DAY_NUM); const dates: Date[] = []; + const currentDate = new Date(monday); for (let i = 0; i < Const.WEEK_DAY_NUM * 3; i++) { - const currentDate = new Date(monday); currentDate.setDate(monday.getDate() + i); dates.push(currentDate); } diff --git a/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets b/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets index 1c04518..71e4e5b 100644 --- a/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets +++ b/features/healthylife/src/main/ets/views/mine/MineMenuComponent.ets @@ -17,6 +17,7 @@ import { CommonConstants as Const } from 'common'; +@Reusable @Component export struct MineMenuComponent { build() { diff --git a/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets b/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets index d51323f..aeba4e1 100644 --- a/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets +++ b/features/healthylife/src/main/ets/views/mine/UserInfoComponent.ets @@ -17,6 +17,7 @@ import { CommonConstants as Const } from 'common'; +@Reusable @Component export struct UserInfoComponent { build() { diff --git a/products/default/src/main/ets/views/UserPrivacyDialog.ets b/products/default/src/main/ets/views/UserPrivacyDialog.ets index 036aab2..b48dd72 100644 --- a/products/default/src/main/ets/views/UserPrivacyDialog.ets +++ b/products/default/src/main/ets/views/UserPrivacyDialog.ets @@ -17,6 +17,7 @@ import { CommonConstants as Const } from 'common'; +@Reusable @CustomDialog export default struct UserPrivacyDialog { controller: CustomDialogController = new CustomDialogController({ builder: '' }); -- Gitee