From 621e4fdee47bccfaad55262973ca048e84f47041 Mon Sep 17 00:00:00 2001 From: Caisking Date: Mon, 15 Sep 2025 17:11:42 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E6=98=9F=E5=8E=86=E6=9C=89?= =?utf8?q?=E6=95=88=E6=9C=9F=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/EphemerisDownloadPresenter.cpp | 14 ++++++++------ .../src/EphemerisDownloadView.cpp | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp index d3caf087d..7862d6291 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp @@ -16,7 +16,6 @@ REGIST_SLICE(VIEW_EPHEMERIS_DOWNLOAD, EphemerisDownloadView, EphemerisDownloadPresenter); EphemerisDownloadPresenter::EphemerisDownloadPresenter() { - Attach(&EphemerisDownloadModel::GetInstance()); } EphemerisDownloadPresenter::~EphemerisDownloadPresenter() {} @@ -89,6 +88,14 @@ void EphemerisDownloadPresenter::Notify() { std::string progress = "下载中,正在下载"+std::to_string(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress())+"%"; EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText(progress.c_str()); } + else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 10) + { + //更新有效期 + if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) { + EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText( + EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str()); + } + } } } break; @@ -117,11 +124,6 @@ void EphemerisDownloadPresenter::Notify() { } break; } - //更新有效期 - if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) { - EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText( - EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str()); - } } } // namespace OHOS diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadView.cpp index 56d9da986..b4a3538b1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadView.cpp @@ -141,6 +141,11 @@ bool EphemerisDownloadView::EphemerisDownloadInit() { labelNote_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x5f)); AddViewToRootContainer(labelNote_); + //更新有效期 + EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText( + EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str()); + + return true; } -- 2.17.1