修改定位优化未连接文案
authorxue <2144439972@qq.com>
Tue, 26 May 2026 09:53:02 +0000 (17:53 +0800)
committerxue <2144439972@qq.com>
Tue, 26 May 2026 09:53:02 +0000 (17:53 +0800)
删除定位界面多余操作

code/sdk/application/wearable/fd272/nativeapp/nativeui/ephemeris_download/src/EphemerisDownloadPresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/include/FindPhoneModel.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhoneModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhonePresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/findphone/src/FindPhoneView.cpp

index 63081d9..84dd2f0 100644 (file)
@@ -121,9 +121,9 @@ bool EphemerisDownloadPresenter::OnClick(UIView &view,
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ble phone connect stat = %d", ble_connect_stat);
     
     if (ble_connect_stat == 0) {
-      //蓝牙未连接,跳转到查找手机Slice显示蓝牙未连接提示(隐藏「查找手机」标题)
+      //蓝牙未连接,跳转到查找手机页;标题显示「请连接手机」
       WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Bluetooth not connected, jump to find phone slice");
-      FindPhoneModel::GetInstance().SetHideTitle(true);
+      FindPhoneModel::GetInstance().SetTitleConnectPhone(true);
       OHOS::AbilityNavigation::EnterSlice(VIEW_FIND_PHONE);
       return true;
     }
@@ -205,53 +205,53 @@ void EphemerisDownloadPresenter::UpdateDownloadStatus() {
   }
   //根据下载状态更新视图
   switch (EphemerisDownloadModel::GetInstance().GetEphemerisDownloadStatus()) {
-  case EphemerisDownloadStatus::DOWNLOADING:
-    if (EphemerisDownloadView::GetInstance()) {
-      if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
-        //判断连接状态
-        //连接成功
-        //连接失败
-        //显示下载进度等
-        if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == -1)
-        {
-            if(ConfigModel::GetInstance()->GetLanguage() == 0)
-                EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("优化失败");  
-            else
-                EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Optimization Failed");  
-        }
-        else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 0)
-        {
-            if(ConfigModel::GetInstance()->GetLanguage() == 0)
-                EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("正在链接网络");  
-            else
-                EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Connecting to Network");  
-            //设置下载按键
-            EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
-        }
-        else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() > 0)
-        {
-            // 进度需要*10
-            int progress = EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() * 10;
-            if(progress > 100)
-            {
-                progress = 100;
-            }
-            std::string progress_str = "正在优化"+std::to_string(progress)+"%";
-            EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText(progress_str.c_str());
-            //设置下载按键
-            EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
-        }
-        else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 10)
-        {
-            //更新有效期
-            if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) {
-              EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText(
-                  EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str());
-            }
-        }
-      }
-    }
-    break;
+  // case EphemerisDownloadStatus::DOWNLOADING:
+  //   if (EphemerisDownloadView::GetInstance()) {
+  //     if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
+  //       //判断连接状态
+  //       //连接成功
+  //       //连接失败
+  //       //显示下载进度等
+  //       if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == -1)
+  //       {
+  //           if(ConfigModel::GetInstance()->GetLanguage() == 0)
+  //               EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("优化失败");  
+  //           else
+  //               EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Optimization Failed");  
+  //       }
+        // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 0)
+        // {
+        //     if(ConfigModel::GetInstance()->GetLanguage() == 0)
+        //         EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("正在链接网络");  
+        //     else
+        //         EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText("Connecting to Network");  
+        //     //设置下载按键
+        //     EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
+        // }
+        // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() > 0)
+        // {
+        //     // 进度需要*10
+        //     int progress = EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() * 10;
+        //     if(progress > 100)
+        //     {
+        //         progress = 100;
+        //     }
+        //     std::string progress_str = "正在优化"+std::to_string(progress)+"%";
+        //     EphemerisDownloadView::GetInstance()->GetDownloadLabel()->SetText(progress_str.c_str());
+        //     //设置下载按键
+        //     EphemerisDownloadView::GetInstance()->UpdateDownloadButton();
+        // }
+        // else if(EphemerisDownloadModel::GetInstance().GetEphemerisDownloadProgress() == 10)
+        // {
+        //     //更新有效期
+        //     if(EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()) {
+        //       EphemerisDownloadView::GetInstance()->GetValidityPeriodLabel()->SetText(
+        //           EphemerisDownloadModel::GetInstance().GetEphemerisValidityPeriod().c_str());
+        //     }
+        // }
+      // }
+    // }
+    // break;
   case EphemerisDownloadStatus::DOWNLOADED:
     if (EphemerisDownloadView::GetInstance()) {
       if (EphemerisDownloadView::GetInstance()->GetDownloadLabel()) {
index b9dcf17..4a92131 100644 (file)
@@ -18,9 +18,9 @@ namespace OHOS
         void SetBlueToothConnectedState(bool state);
         bool GetBlueToothConnectedState();
         void start_or_stop_find_phone(uint8_t val);
-        /* 从星历下载等场景跳转时隐藏「查找手机」标题 */
-        void SetHideTitle(bool hide);
-        bool GetHideTitle() const;
+        /* 从星历下载等场景跳转:标题显示「请连接手机」而非「查找手机」 */
+        void SetTitleConnectPhone(bool enable);
+        bool GetTitleConnectPhone() const;
     private:
         FindPhoneModel() {}
         ~FindPhoneModel() {}
@@ -28,7 +28,7 @@ namespace OHOS
         const FindPhoneModel &operator=(const FindPhoneModel &) = delete;
 
         bool isBlueToothConnected{false}; // 蓝牙是否连接
-        bool hideTitle_{false};           // 是否隐藏标题
+        bool titleConnectPhone_{false};   // 标题是否显示「请连接手机」
     };
 }
 #endif
\ No newline at end of file
index 4760c2a..3a100a9 100644 (file)
@@ -41,14 +41,14 @@ namespace OHOS
             return false;
     }
 
-    void FindPhoneModel::SetHideTitle(bool hide)
+    void FindPhoneModel::SetTitleConnectPhone(bool enable)
     {
-        hideTitle_ = hide;
+        titleConnectPhone_ = enable;
     }
 
-    bool FindPhoneModel::GetHideTitle() const
+    bool FindPhoneModel::GetTitleConnectPhone() const
     {
-        return hideTitle_;
+        return titleConnectPhone_;
     }
 
     // 开始或停止查找手机
index 3570571..af1e267 100644 (file)
@@ -76,7 +76,7 @@ namespace OHOS
 
     void FindPhonePresenter::OnStop(void)
     {
-        FindPhoneModel::GetInstance().SetHideTitle(false);
+        FindPhoneModel::GetInstance().SetTitleConnectPhone(false);
 #ifdef SUPPORT_BLE_SERVICE
         FindPhoneModel::GetInstance().start_or_stop_find_phone(FINDPHONE_STOP); // 发送指令停止震动
         if (FindPhoneModel::GetInstance().GetBlueToothConnectedState() &&
index 7d77916..75cf689 100644 (file)
@@ -18,6 +18,7 @@
 #include "UiConfig.h"
 #include "ui_resource_string.h"
 #include "uicomponents/UIComponents.h"
+#include "ConfigModel.h"
 
 #ifdef SUPPORT_BLE_SERVICE
 #include "bleInstruct.h"
@@ -114,12 +115,17 @@ namespace OHOS
             FindPhoneTitleLabel->SetPosition(83, 50, 300, 35);
             FindPhoneTitleLabel->SetStyle(STYLE_TEXT_FONT, 30);
             FindPhoneTitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
-            FindPhoneTitleLabel->SetTextId(STR_FIND_PHONE); // 查找手机
             FindPhoneTitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
             FindPhoneTitleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
             FindPhoneTitleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
-            if (FindPhoneModel::GetInstance().GetHideTitle()) {
-                FindPhoneTitleLabel->SetVisible(false);
+            if (FindPhoneModel::GetInstance().GetTitleConnectPhone()) {
+                if (ConfigModel::GetInstance()->GetLanguage() == 0) {
+                    FindPhoneTitleLabel->SetText("请连接手机");
+                } else {
+                    FindPhoneTitleLabel->SetText("Connect Phone");
+                }
+            } else {
+                FindPhoneTitleLabel->SetTextId(STR_FIND_PHONE); // 查找手机
             }
             /* ----------------------- FindPhoneImageView ---------------------- */
             FindPhoneImageView = new UIImageView();