From acc8caee31c4be90bd38d1af18136b0e84f6fe94 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 14:01:19 +0800
Subject: [PATCH] Merge branch 'feature/v2.7_迭代' into feature/V2.7_Google

---
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs |   98 ++++++++++++++++++++++++++++--------------------
 1 files changed, 57 insertions(+), 41 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 7693cb4..7bded39 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.Common;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -24,7 +25,11 @@
         /// <summary>
         /// 杩炴帴鐘舵�佹彁绀�
         /// </summary>
-        FrameLayout divLinkStateTip;
+        FrameLayout linkStateMsgView;
+        /// <summary>
+        /// 鐧诲綍鐘舵�佹彁绀哄尯鍩�
+        /// </summary>
+        FrameLayout tokenInvalidMsgView;
         /// <summary>
         /// 瀹夐槻鐘舵�佸浘鏍�
         /// </summary>
@@ -159,14 +164,14 @@
                 };
                 topView = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(113),//216),
+                    Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216),
                     BackgroundImagePath = DB_ResidenceData.Instance.residenceImage,
                 };
                 bodyView.AddChidren(topView);
 #else
                 VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout()
                 {
-                    Height = Application.GetRealHeight(113),//216),
+                    Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216),
                     BackgroundImagePath = DB_ResidenceData.Instance.residenceImage,
                 };
                 bodyView.AddChidren(refreshLayout);
@@ -179,20 +184,21 @@
                 };
                 topView = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(113),//216),
+                    Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216),
                 };
                 refreshLayout.AddChidren(topView);
 #endif
-                #region topView
-
-
-
-                Button btnTop;
-                btnTop = new Button()
+                topView.AddChidren(new Button()
                 {
                     BackgroundColor = CSS_Color.DialogTransparentColor2,
-                };
-                topView.AddChidren(btnTop);
+                });
+
+                topView.AddChidren(
+                    new Button() {Y = Application.GetRealHeight(113),
+                    BackgroundColor = CSS_Color.BackgroundColor,
+                    Height = Application.GetRealWidth(24) });
+
+                #region topView
 
                 btnResidenceName = new Button()
                 {
@@ -207,15 +213,19 @@
                     IsBold = true
                 };
                 topView.AddChidren(btnResidenceName);
+                //鐧诲綍鍑瘉鏄惁鏈夋晥
+                CheckTokenValid();
 
-                divLinkStateTip = new FrameLayout()
+                #region 缃戝叧杩炴帴鐘舵��
+                linkStateMsgView = new FrameLayout()
                 {
-                    Y = Application.GetRealHeight(113) - Application.GetRealWidth(24),
+                    Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24),
                     Height = Application.GetRealWidth(24),
                     BackgroundColor = 0xFFFF4747,
                     Visible = false,
                 };
-                topView.AddChidren(divLinkStateTip);
+                topView.AddChidren(linkStateMsgView);
+
                 Button btnLinkStateIcon = new Button()
                 {
                     X = Application.GetRealWidth(16),
@@ -224,7 +234,7 @@
                     Height = Application.GetRealWidth(20),
                     UnSelectedImagePath = "Collection/GatewayOnlineTipIcon.png"
                 };
-                divLinkStateTip.AddChidren(btnLinkStateIcon);
+                linkStateMsgView.AddChidren(btnLinkStateIcon);
 
                 var btnLinkStateTip = new Button()
                 {
@@ -234,15 +244,18 @@
                     TextColor = CSS_Color.MainBackgroundColor,
                     TextID = StringId.NetworkAnomaly,
                 };
-                divLinkStateTip.AddChidren(btnLinkStateTip);
+                linkStateMsgView.AddChidren(btnLinkStateTip);
+
                 //鏇存柊閾炬帴鐘舵�乮con棰滆壊
+                CheckLinkStatus();//2020-12-22
+                #endregion
+
                 environmentalView = new FrameLayout()
                 {
                     Y = Application.GetRealHeight(1) + btnResidenceName.Bottom,
                     Height = Application.GetRealHeight(32),
                 };
                 topView.AddChidren(environmentalView);
-                CheckLinkStatus();//2020-12-22
 
                 #region 鐜鏁版嵁
                 var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature);
@@ -535,7 +548,7 @@
 
                 #region 鍔熻兘鍦烘櫙鍒囨崲
 
-                bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 });
+                //bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 });
 
                 loadNavView();
 
@@ -553,10 +566,7 @@
 #if DEBUG
                 btnResidenceName.MouseUpEventHandler = (envent, ee) =>
                 {
-                    MainPage.Log("sss");
-
 #if __ANDROID__
-                    //HDLLinphoneKit.Instance.MediaPlayerLooping(true);
                     Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone();
 #elif __IOS__
 
@@ -996,10 +1006,10 @@
                     //    continue;
                     //}
                     //else
-                    {
-                        if (!function.collect)
-                            continue;
-                    }
+                    //{
+                    if (!function.collect&& function.spk != SPK.InverterJinmao)
+                        continue;
+                    //}
                     if (index % 2 == 0)
                     {
                         rowView = new FrameLayout()
@@ -1596,16 +1606,6 @@
                     btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png";
                     btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png";
                 }
-                else if (function.spk == SPK.VideoDoorLock)
-                {
-                    btnIcon.UnSelectedImagePath = UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect);
-                    //btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png";
-                }
-                else if (function.spk == SPK.AvZkAiks)
-                {
-                    //涓轰簡鍘绘帀寮�鍏虫寜閽�
-                    btnIcon.UnSelectedImagePath = "AksIcon/yingyinzhongkong1.png";
-                }
                 else if (function.spk == SPK.GroupControl)
                 {
                     btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png";
@@ -1710,8 +1710,7 @@
                 };
 
 
-                var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect, () =>
-                {
+                var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone, Comerom.collect,()=> {
                     this.LoadDeviceFunctionControlZone();//鍒犻櫎璁惧鍚庨噸鏂板埛鏂癠I
                 });
                 view.MouseUpEventHandler = skipControlPageEvent;
@@ -1765,7 +1764,8 @@
             {
                 X = Application.GetRealWidth(11),
                 Y = Application.GetRealWidth(10),
-                TextID = StringId.Acst,
+                Text = function.name,
+                //TextID = StringId.Acst,
                 IsBold = true,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.TextFontSize,
@@ -1785,12 +1785,28 @@
             };
             view.AddChidren(btnLogo);
 
+            try
+            {
+                if (function.extend.Contains("jinmao") && function.extend.Contains("true"))
+                {
+                    btnLogo.Visible = true;
+                }
+                else
+                {
+                    btnLogo.Visible = false;
+                }
+            }
+            catch (Exception ex)
+            {
+                MainPage.Log("Error", $"閲戣寕logo鏄剧ず澶勭悊寮傚父锛歿ex.Message}");
+            }
+
             Button btnFunctionViewBg;
             btnFunctionViewBg = new Button()
             {
                 Height = Application.GetRealWidth(100),
                 Width = Application.GetRealWidth(102),
-                UnSelectedImagePath = "FunctionIcon/FunctionBg/AcstFunctionBg.png",
+                UnSelectedImagePath = function.spk == SPK.AcstParent ? "FunctionIcon/FunctionBg/AcstFunctionBg.png" : "FunctionIcon/FunctionBg/InverterJinmaoFunctionBg.png",
             };
             view.AddChidren(btnFunctionViewBg);
             if (function.spk == SPK.AcstParent)
@@ -1805,7 +1821,7 @@
             }
             else if (function.spk == SPK.InverterJinmao)
             {
-                btnName.TextID = StringId.NewEnergy;
+                //btnName.TextID = StringId.NewEnergy;
                 btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                 {
                     var page = new InverterJinmaoPage();

--
Gitblit v1.8.0