From 0957b014d467adf1c5830a6c2c26c8afb6cdf2b7 Mon Sep 17 00:00:00 2001 From: Caisking Date: Sun, 21 Sep 2025 18:51:38 +0800 Subject: [PATCH] =?utf8?q?=E7=BB=91=E5=AE=9A=E5=85=88=E5=A2=9E=E5=8A=A0?= =?utf8?q?=E5=A4=96=E7=BD=91=E5=88=A4=E6=96=AD=EF=BC=9B=E6=B2=A1=E6=9C=89?= =?utf8?q?=E5=A4=96=E7=BD=91=E6=98=AF=E6=97=A0=E6=95=88=E4=BA=8C=E7=BB=B4?= =?utf8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/thunderbird/include/ThunderBirdModel.h | 3 +++ .../nativeui/thunderbird/src/ThunderBirdModel.cpp | 11 ++++++++++- .../nativeui/thunderbird/src/ThunderBirdPresenter.cpp | 11 ++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h index b1cd44855..ce774129a 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdModel.h @@ -156,6 +156,9 @@ namespace OHOS bool GetQrcodeChecked(); void SetQrcodeChecked(bool checked); + bool getbind_status(); + + bool Get_is_ln_get_device_token_success(); private: ThunderBirdModel(); diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index 24da3b683..a94fec254 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -317,6 +317,10 @@ { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::StartBootOperation"); return bind_status; + } + bool ThunderBirdModel::getbind_status() + { + return bind_status; } //判断是否绑定 ThunderBirdModel::BindingStatus ThunderBirdModel::CheckBindingStatus() @@ -998,6 +1002,11 @@ m_statusTimer = nullptr; } } + // 获取token是否有效 其实是是否有外网 + bool ThunderBirdModel::Get_is_ln_get_device_token_success() + { + return get_is_ln_get_device_token_success(); + } /** * @brief 状态管理回调处理 */ @@ -1218,7 +1227,7 @@ } // 二维码是否有效更新过 - bool ThunderBirdModel::GetQrcodeChecked() const + bool ThunderBirdModel::GetQrcodeChecked() { return m_qrcodeChecked; } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index 28fd80494..aab20df46 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -224,7 +224,7 @@ namespace OHOS // 短按FUNC键(息屏状态下) if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -251,7 +251,7 @@ namespace OHOS { if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -285,7 +285,7 @@ namespace OHOS if (keyState == InputDevice::STATE_PRESS && screenState == 0) { // 检查绑定状态 - if (ThunderBirdModel::GetInstance()->CheckBindingStatus() != ThunderBirdModel::BindingStatus::BOUND) { + if (ThunderBirdModel::GetInstance()->getbind_status() != true) { if (currentSubView != ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3) { ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3); } @@ -620,6 +620,11 @@ namespace OHOS void ThunderBirdPresenter::UpdateQrcodeIfValid() { + if(ThunderBirdModel::GetInstance()->Get_is_ln_get_device_token_success() == false) + { + return; + } + // 检查IMEI是否有效 并且 二维码是否有效更新过 if (ThunderBirdModel::GetInstance()->IsIMEIValid() && ThunderBirdModel::GetInstance()->GetQrcodeChecked() == true) { return; -- 2.17.1