每日目标界面优化 3184/1 3184/head 3185/target/1
authorluozheng <1732036298@qq.com>
Wed, 4 Feb 2026 03:31:28 +0000 (11:31 +0800)
committerluozheng <1732036298@qq.com>
Wed, 4 Feb 2026 03:31:28 +0000 (11:31 +0800)
code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/include/Maingoalpresenter.h
code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/Maingoalpresenter.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalmodel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalother.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalview.cpp
code/sdk/zhihui/drivers/cywee/dml/cywee_data.c

index 3de0885..6f1d870 100644 (file)
@@ -37,9 +37,7 @@ namespace OHOS
         virtual ~MaingoalPresenter();
 
         void OnStart() override;
-        void OnPause() override;
         void OnResume() override;
-        void OnStop() override;
 
         static MaingoalPresenter *GetInstance();
 
index a3de49e..73a3f33 100644 (file)
@@ -40,20 +40,11 @@ namespace OHOS
 
     MaingoalPresenter *MaingoalPresenter::GetInstance()
     {
-
         return g_pMainWeatherPresenter;
     }
 
     void MaingoalPresenter::OnStart()
     {
-
-        Presenter<MaingoalrView>::OnStart();
-    }
-
-    void MaingoalPresenter::OnPause(void)
-    {
-
-        Presenter<MaingoalrView>::OnPause();
     }
 
     void MaingoalPresenter::OnResume(void)
@@ -61,11 +52,6 @@ namespace OHOS
         RootView::GetInstance()->SetOnKeyActListener(this);
     }
 
-    void MaingoalPresenter::OnStop(void)
-    {
-        Presenter<MaingoalrView>::OnStop();
-    }
-
     bool MaingoalPresenter::OnDrag(UIView &view, const DragEvent &event)
     {
         UNUSED(view);
@@ -113,12 +99,12 @@ namespace OHOS
 
     void MaingoalPresenter::OnSwipe(UISwipeView &view)
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherPresenter::OnSwipe,current tab index = %d", view.GetCurrentPage());
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherPresenter::OnSwipe,current tab index = %d", view.GetCurrentPage());
     }
 
     void GoalControlViewOnSwipeListener::OnSwipe(UISwipeView &view)
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GoalControlViewOnSwipeListener::OnSwipe,current tab index = %d", view.GetCurrentPage());
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalControlViewOnSwipeListener::OnSwipe,current tab index = %d", view.GetCurrentPage());
         return;
     }
 }
\ No newline at end of file
index 5415189..9eb81bb 100644 (file)
@@ -162,6 +162,7 @@ namespace OHOS
 
       distancenewstr=temp_str;
 
+      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalModel::getdistancenew:%s", distancenewstr.c_str());
       return distancenewstr;
    }
 
index 51cae63..6d38837 100644 (file)
@@ -194,9 +194,8 @@ namespace OHOS
         if (transverseline_1 == nullptr) {
         transverseline_1 = new UIImageView();
         }
-        transverseline_1->SetPosition(0, 169);         // widget's left position and top position
-        transverseline_1->Resize(466, 2);          // widget's width and height
-        transverseline_1->SetViewId("image1");// Set style
+        transverseline_1->SetPosition(0, 169);         
+        transverseline_1->Resize(466, 2);          
         transverseline_1->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333);
         transverseline_1->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
         transverseline_1->SetVisible(true);
@@ -205,9 +204,8 @@ namespace OHOS
         if (transverseline_2 == nullptr) {
             transverseline_2 = new UIImageView();
         }
-        transverseline_2->SetPosition(232, 191);         // widget's left position and top position
-        transverseline_2->Resize(2, 82);          // widget's width and height
-        transverseline_2->SetViewId("image2");// Set style
+        transverseline_2->SetPosition(232, 191);         
+        transverseline_2->Resize(2, 82);          
         transverseline_2->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333);
         transverseline_2->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
         transverseline_2->SetVisible(true);
@@ -216,9 +214,8 @@ namespace OHOS
         if (verticalline == nullptr) {
             verticalline = new UIImageView();
         }
-        verticalline->SetPosition(0, 296);         // widget's left position and top position
-        verticalline->Resize(466, 2);          // widget's width and height
-        verticalline->SetViewId("image1");// Set style
+        verticalline->SetPosition(0, 296);         
+        verticalline->Resize(466, 2);          
         verticalline->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333);
         verticalline->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
         verticalline->SetVisible(true);
@@ -228,12 +225,10 @@ namespace OHOS
         if (mileagegoalTitle == nullptr) {
             mileagegoalTitle = new UILabelExt();
         }
-        mileagegoalTitle->SetPosition(113, 61);         // widget's left position and top position
-        mileagegoalTitle->Resize(240, 35);          // widget's width and height
-        mileagegoalTitle->SetViewId("label1");// Set style
+        mileagegoalTitle->SetPosition(113, 61);         
+        mileagegoalTitle->Resize(240, 35);          
         mileagegoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
-        // Set additional property
         // mileagegoalTitle->SetText("里程(KM)");
         mileagegoalTitle->SetTextId(STR_MILEAGE);
         mileagegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
@@ -245,12 +240,10 @@ namespace OHOS
         if (fatburninggoalTitle == nullptr) {
             fatburninggoalTitle = new UILabelExt();
         }
-        fatburninggoalTitle->SetPosition(8, 188);         // widget's left position and top position
-        fatburninggoalTitle->Resize(200, 35);          // widget's width and height
-        fatburninggoalTitle->SetViewId("label1");// Set style
+        fatburninggoalTitle->SetPosition(8, 188);         
+        fatburninggoalTitle->Resize(200, 35);          
         fatburninggoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
-        // Set additional property
         // fatburninggoalTitle->SetText("燃脂时间");
         fatburninggoalTitle->SetTextId(STR_FAT_BURNING_TIME);
         fatburninggoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
@@ -262,11 +255,9 @@ namespace OHOS
         if (standgoalTitle == nullptr) {
             standgoalTitle = new UILabelExt();
         }
-        standgoalTitle->SetPosition(257, 188);         // widget's left position and top position
-        standgoalTitle->Resize(200, 35);          // widget's width and height
-        standgoalTitle->SetViewId("label1");// Set style
+        standgoalTitle->SetPosition(257, 188);         
+        standgoalTitle->Resize(200, 35);          
         standgoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
-        // Set additional property
         // standgoalTitle->SetText("站立次数");
         standgoalTitle->SetTextId(STR_NUMBER_OF_STANDS);
         standgoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
@@ -278,9 +269,8 @@ namespace OHOS
         if (caloriegoalTitle == nullptr) {
             caloriegoalTitle = new UILabelExt();
         }
-        caloriegoalTitle->SetPosition(53, 317);         // widget's left position and top position
-        caloriegoalTitle->Resize(360, 35);          // widget's width and height
-        caloriegoalTitle->SetViewId("label1");// Set style
+        caloriegoalTitle->SetPosition(53, 317);         
+        caloriegoalTitle->Resize(360, 35);          
         caloriegoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
         // Set additional property
         // caloriegoalTitle->SetText("消耗卡路里");
@@ -295,9 +285,8 @@ namespace OHOS
         if (mileagenowdataLabel == nullptr) {
             mileagenowdataLabel = new UILabel();
         }
-        mileagenowdataLabel->SetPosition(163-20+10, 87);         // widget's left position and top position
-        mileagenowdataLabel->Resize(75, 60);          // widget's width and height
-        mileagenowdataLabel->SetViewId("label2");// Set style
+        mileagenowdataLabel->SetPosition(163-20+10, 87);         
+        mileagenowdataLabel->Resize(75, 60);          
         mileagenowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -313,9 +302,8 @@ namespace OHOS
         if (mileagegoaldataLabel == nullptr) {
             mileagegoaldataLabel = new UILabel();
         }
-        mileagegoaldataLabel->SetPosition(243-20+10, 86);         // widget's left position and top position
-        mileagegoaldataLabel->Resize(82, 60);          // widget's width and height
-        mileagegoaldataLabel->SetViewId("label2");// Set style
+        mileagegoaldataLabel->SetPosition(243-20+10, 86);         
+        mileagegoaldataLabel->Resize(82, 60);          
         mileagegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -331,9 +319,8 @@ namespace OHOS
         if (fatburningnowdataLabel == nullptr) {
             fatburningnowdataLabel = new UILabel();
         }
-        fatburningnowdataLabel->SetPosition(47-20-10, 223);         // widget's left position and top position
-        fatburningnowdataLabel->Resize(75, 60);          // widget's width and height
-        fatburningnowdataLabel->SetViewId("label2");// Set style
+        fatburningnowdataLabel->SetPosition(47-20-10, 223);         
+        fatburningnowdataLabel->Resize(75, 60);          
         fatburningnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -348,9 +335,8 @@ namespace OHOS
         if (fatburninggoaldataLabel == nullptr) {
             fatburninggoaldataLabel = new UILabel();
         }
-        fatburninggoaldataLabel->SetPosition(128-20-10, 223);         // widget's left position and top position
-        fatburninggoaldataLabel->Resize(82, 60);          // widget's width and height
-        fatburninggoaldataLabel->SetViewId("label2");// Set style
+        fatburninggoaldataLabel->SetPosition(128-20-10, 223);        
+        fatburninggoaldataLabel->Resize(82, 60);          
         fatburninggoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -365,9 +351,8 @@ namespace OHOS
         if (standnowdataLabel == nullptr) {
             standnowdataLabel = new UILabel();
         }
-        standnowdataLabel->SetPosition(47+200+10, 223);         // widget's left position and top position
-        standnowdataLabel->Resize(75, 60);          // widget's width and height
-        standnowdataLabel->SetViewId("label2");// Set style
+        standnowdataLabel->SetPosition(47+200+10, 223);        
+        standnowdataLabel->Resize(75, 60);          
         standnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -383,9 +368,8 @@ namespace OHOS
         if (standgoaldataLabel == nullptr) {
             standgoaldataLabel = new UILabel();
         }
-        standgoaldataLabel->SetPosition(128+200+10, 223);         // widget's left position and top position
-        standgoaldataLabel->Resize(82, 60);          // widget's width and height
-        standgoaldataLabel->SetViewId("label2");// Set style
+        standgoaldataLabel->SetPosition(128+200+10, 223);         
+        standgoaldataLabel->Resize(82, 60);          
         standgoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -400,9 +384,8 @@ namespace OHOS
         if (calorienowdataLabel == nullptr) {
             calorienowdataLabel = new UILabel();
         }
-        calorienowdataLabel->SetPosition(163-20-10, 353);         // widget's left position and top position
-        calorienowdataLabel->Resize(75, 60);          // widget's width and height
-        calorienowdataLabel->SetViewId("label2");// Set style
+        calorienowdataLabel->SetPosition(163-20-10, 353);         
+        calorienowdataLabel->Resize(75, 60);         
         calorienowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
@@ -417,9 +400,8 @@ namespace OHOS
         if (caloriegoaldataLabel == nullptr) {
             caloriegoaldataLabel = new UILabel();
         }
-        caloriegoaldataLabel->SetPosition(243-20-10, 353);         // widget's left position and top position
-        caloriegoaldataLabel->Resize(82+40, 60);          // widget's width and height
-        caloriegoaldataLabel->SetViewId("label2");// Set style
+        caloriegoaldataLabel->SetPosition(243-20-10, 353);         
+        caloriegoaldataLabel->Resize(82+40, 60);          
         caloriegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
 
         // Set additional property
index 5672706..4de01b2 100644 (file)
@@ -150,12 +150,10 @@ namespace OHOS
          if (goalTitle == nullptr) {
             goalTitle = new UILabelExt();
         }
-        goalTitle->SetPosition(83, 50);         // widget's left position and top position
-        goalTitle->Resize(300, 35);          // widget's width and height
-        goalTitle->SetViewId("label1");// Set style
+        goalTitle->SetPosition(83, 50);         
+        goalTitle->Resize(300, 35);          
         goalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
-        // Set additional property
         // goalTitle->SetText("今日步数");
         goalTitle->SetTextId(STR_STEPS_OF_THE_DAY);
         goalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
@@ -169,13 +167,9 @@ namespace OHOS
         if (nowstepLabel == nullptr) {
             nowstepLabel = new UILabelExt();
         }
-        nowstepLabel->SetPosition(121-40, 201);         // widget's left position and top position
-        nowstepLabel->Resize(223+80, 94);          // widget's width and height
-        nowstepLabel->SetViewId("nowstepLabel");// Set style
+        nowstepLabel->SetPosition(121-40, 201);         
+        nowstepLabel->Resize(223+80, 94);          
         nowstepLabel->SetStyle(STYLE_TEXT_FONT, 80);
-
-        // Set additional property
-        
         nowstepLabel->SetText(GoalModel::GetInstance().getstepnew().c_str());//);
         nowstepLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         //nowstepLabel->SetTextColor(0x4FC34C);
@@ -189,12 +183,9 @@ namespace OHOS
         if (goalstepLabel == nullptr) {
             goalstepLabel = new UILabelExt();
         }
-        goalstepLabel->SetPosition(157, 297);         // widget's left position and top position
-        goalstepLabel->Resize(152, 47);          // widget's width and height
-        goalstepLabel->SetViewId("goalstepLabel");// Set style
+        goalstepLabel->SetPosition(157, 297);        
+        goalstepLabel->Resize(152, 47);          
         goalstepLabel->SetStyle(STYLE_TEXT_FONT, 40);
-
-        // Set additional property
         goalstepLabel->SetText(GoalModel::GetInstance().getstepGoal().c_str());
         goalstepLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         goalstepLabel->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
@@ -204,39 +195,22 @@ namespace OHOS
 
 
         /*----------------------------------------------------------------------------- */
-
-            // Add ImageView to App
         if (circleProgressimage == nullptr) {
             circleProgressimage = new UIImageView();
         }
-        circleProgressimage->SetPosition(28, 80-5);         // widget's left position and top position
-        circleProgressimage->Resize(100, 100);          // widget's width and height
-        circleProgressimage->SetViewId("image5");// Set style
-
-     
+        circleProgressimage->SetPosition(28, 80-5);         
+        circleProgressimage->Resize(100, 100);          
         char* image5imagesPath = "/user/res/step/step_b.bin";
         ImageInfo *info= ImageCacheManager::GetInstance().LoadSingleRes(image5imagesPath);
         circleProgressimage->SetSrc(info);
-
-            // Add to rootView
-      
         circleProgressimage->SetVisible(true);
-        if(circleProgressimage!=NULL)
-        {
-             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "circleProgressimage");
-        }
-
 
         if (circleProgress1_ == nullptr) {
             circleProgress1_ = new UICircleProgress();
         }
-        circleProgress1_->SetPosition(0, -5);         // widget's left position and top position
-        circleProgress1_->Resize(466, 466);          // widget's width and height
-        circleProgress1_->SetViewId("circleProgress1");// Set style
+        circleProgress1_->SetPosition(0, -5);         
+        circleProgress1_->Resize(466, 466);          
         circleProgress1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
-
-        // Set additional property
-        // Set BackgroundStyle
         circleProgress1_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
         circleProgress1_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00);
         circleProgress1_->SetBackgroundStyle(STYLE_LINE_HEIGHT, 200);
index 8a89aad..19e299e 100644 (file)
@@ -769,8 +769,9 @@ int32_t cywee_get_now_hour_data(void*value, uint8_t type)
             
         case DISTANCE:
             f_data= cywee_get_sport_data_float(HISTORY_DISTANCE) + cywee_get_sport_data_float(NEW_DISTANCE);
-            printf("cywee_get_now_hour_data DISTANCE %f %f %f %f\n",cywee_get_sport_data_float(HISTORY_DISTANCE),cywee_get_sport_data_float(NEW_DISTANCE),cywee_get_sport_data_float(HISTORY_DISTANCE_),f_data);
+            // printf("cywee_get_now_hour_data DISTANCE %f %f %f %f\n",cywee_get_sport_data_float(HISTORY_DISTANCE),cywee_get_sport_data_float(NEW_DISTANCE),cywee_get_sport_data_float(HISTORY_DISTANCE_),f_data);
             f_data=f_data/1000.0-cywee_get_sport_data_float(HISTORY_DISTANCE_);
+            // printf("cywee_get_now_hour_data DISTANCE %f\n",f_data);
             if(f_data<0)
             return 0;
             memcpy_s(value,4,&f_data,4);