优化训练记录Id显示
authorCaisking <3449750381@qq.com>
Tue, 30 Jul 2024 11:52:11 +0000 (19:52 +0800)
committerCaisking <3449750381@qq.com>
Tue, 30 Jul 2024 11:52:11 +0000 (19:52 +0800)
code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h
code/sdk/application/wearable/fd230app/nativeui/main/src/MainPresenterSample.cpp
code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h
code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordView.cpp

index 7f3bb11..a815fde 100644 (file)
@@ -30,6 +30,8 @@ namespace OHOS
     static constexpr const char *MAIN_CLICK_ACTIVITY = "mainclickactivity";
     static constexpr const char *MAIN_CLICK_MESSAGE = "mainclickmessage";
     static constexpr const char *MAIN_CLICK_HEARTRATE = "mainclickheartrate";
+    static constexpr const char *MAIN_CLICK_BLOOD = "mainclickblood";     // 血氧检测
+    static constexpr const char *MAIN_CLICK_SETCARD = "mainclicksetcard"; // 设置卡片
 
     static constexpr const char *DROPDOWN_CLICK_DONOTDISTURB = "dropdownclickdonotdisturb";
     static constexpr const char *DROPDOWN_CLICK_BRIGHTENSCREEN = "dropdownclickbrightscreen";
index 6698e36..da7cec5 100644 (file)
@@ -44,6 +44,8 @@ namespace OHOS
         {DROPDOWN_CLICK_DNOTDISTURB, VIEW_DNOTDISTURB},     // 勿扰
         {DROPDOWN_CLICK_SAVEELE, VIEW_SAVEELE},             // 省电模式
         {DROPDOWN_CLICK_FINDMYPHONE, VIEW_FIND_PHONE},      // 查找手机
+        {MAIN_CLICK_BLOOD, VIEW_BLOODOXY_CHECK},            // 血氧检查
+        {MAIN_CLICK_SETCARD, VIEW_ADD_CARD},                // 卡片管理
     };
 
     static MainPresenterSample *g_pMainPresenterSample = nullptr;
@@ -154,11 +156,12 @@ namespace OHOS
             PullUpDown_StartTimer(1000); // 切回下拉控制中心视图开启定时器
             return true;
         }
-        // if(&view == PullUpDownView::GetInstance()->GetConnectedStatusView()->GetCloseButton())
-        // {
-        //     PullUpDownView::GetInstance()->ChangeView(CONNECTEDSTATUSVIEW,DROPDOWNVIEW);
-        //     return true;
-        // }
+        // 设置血氧进入
+        else if (curViewId == MAIN_CLICK_BLOOD)
+        {
+            MainModel::GetInstance().SetFromSetCardView(true);
+            MainModel::GetInstance().SetFromCardId(BLOODOXGEN);
+        }
 
         // 如果勿扰模式是开启状态,在下拉界面点击勿扰快捷入口会关闭勿扰模式不进入勿扰视图
         if (g_jumpView[curViewId] == VIEW_DNOTDISTURB && DnotDisturbModel::GetInstance().GetDoNotDisturbModeEnabled() == true)
@@ -170,7 +173,6 @@ namespace OHOS
 
         if (g_jumpView.count(curViewId) != 0)
         {
-            // NativeAbility::GetInstance().ChangeSlice(g_jumpView[curViewId]);
             NativeAbility::GetInstance().EnterSlice(g_jumpView[curViewId]);
         }
         return true;
@@ -394,7 +396,8 @@ namespace OHOS
         }
         break;
         case WEATHER:
-            if(WeatherModel::GetInstance().GetWeatherDataIsValid()) {
+            if (WeatherModel::GetInstance().GetWeatherDataIsValid())
+            {
                 WeatherModel::GetInstance().UpdateWeatherCurTime();
             }
             break;
index c3cd229..cdf47dc 100644 (file)
@@ -1,7 +1,7 @@
 /*** 
  * @Date: 2024-05-20 19:40:41
  * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-07-06 16:38:46
+ * @LastEditTime: 2024-07-27 17:47:13
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/traingrecord/include/TraingRecordView.h
  */
 /***
index 5363fc6..b70bba6 100644 (file)
@@ -148,12 +148,12 @@ namespace OHOS
         lackView->SetReboundSize(50);
         lackView->SetDirection(1);
         /*初始化label*/
-        InitLabelExt(labeltitle_, 83, 50, 300, 35, "labletitle", STR_TRAINGNO, DEFAULT_VECTOR_FONT_FILENAME, 30);
-        InitLabelExt(labelrecord_, 53, 260, 360, 40, "labelrecord", STR_TRAINGGO, DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabelExt(labeltitle_, 83, 50, 300, 35, "labletitle", STR_TRAINING_RECORD, DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabelExt(labelrecord_, 53, 260, 360, 40, "labelrecord", STR_TRAINGNO, DEFAULT_VECTOR_FONT_FILENAME, 30);
         /*初始化image*/
         InitImageView(imagerecord, 174, 120, 118, 120, "image", RECOED_IMAGE);
         /*初始化按键*/
-        InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINING, 26);
+        InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_TRAINGGO, 30);
         buttongo->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); // 设置按键颜色
         buttongo->SetOnClickListener(static_cast<UIView::OnClickListener *>(TraingRecordPresenter::GetInstance()));
 
@@ -252,6 +252,8 @@ namespace OHOS
     // 获取目前的view
     void TraingRecordView::OnStart()
     {
+        View<TraingRecordPresenter>::OnStart();
+
         container_ = new UIScrollView();
         if (container_ == nullptr)
         {