From a7f60b109fd33d6defe0d828a911f5cf449803d0 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 24 五月 2022 17:12:11 +0800
Subject: [PATCH] 2022年05月24日17:12:01

---
 HDL-ON_Android/Assets/Language.ini                                |    5 +
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs    |   26 ++++++++
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   30 +++++++++
 HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs         |    2 
 HDL_ON/Common/ApiUtlis.cs                                         |    1 
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs             |    2 
 HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs           |   15 ++--
 HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs                |    7 +-
 HDL-ON_iOS/Resources/Language.ini                                 |    4 +
 HDL_ON/DAL/Server/HttpUtil.cs                                     |    4 
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs            |   17 +++++
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs   |   23 +++++--
 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs                   |    2 
 HDL_ON/Common/R.cs                                                |    9 +++
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs               |    1 
 15 files changed, 124 insertions(+), 24 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index f78a5cd..9d62f57 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -1038,6 +1038,9 @@
 7154=Arrive
 7155=Distress/Normal
 7156=Distress
+7157=whether to unlock
+7158=is
+
 
 
 
@@ -2172,6 +2175,8 @@
 7154=鍒拌揪
 7155=姹傛晳/姝e父
 7156=姹傛晳
+7157=鏄惁寮�閿佹椂
+7158=鏄�
 
 
  
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index d294712..1ca107b 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -1038,6 +1038,8 @@
 7154=Arrive
 7155=Distress/Normal
 7156=Distress
+7157=whether to unlock
+7158=is
 
 
 
@@ -2169,6 +2171,8 @@
 7154=鍒拌揪
 7155=姹傛晳/姝e父
 7156=姹傛晳
+7157=鏄惁寮�閿佹椂
+7158=鏄�
 
 
 
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 75c9bf3..22953a6 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -159,6 +159,7 @@
                         endTime = DateTime.Now.AddSeconds(5);
 
                         MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
+                        MainPage.Log($"sid鍒楄〃鑾峰彇===="+ deviceResult.Data.ToString());
                         var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                         if (deviceList == null)
                         {
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 05dceab..98dd5ac 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -2740,6 +2740,15 @@
         /// 姹傛晳
         /// </summary>
         public const int qiujiu = 7156;
+        /// <summary>
+        /// 鏄惁寮�閿佹椂
+        /// </summary>
+        public const int shifoukaisuoshi = 7157;
+        /// <summary>
+        /// 鏄�
+        /// </summary>
+        public const int shi = 7158;
+
 
 
         #region LE鏂板
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index ce16936..82b6dd0 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -17,8 +17,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm
         /// <summary>
         /// RegionMark
         /// </summary>
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
index 49990a0..eadc10b 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs
@@ -62,15 +62,16 @@
             likiadaodaView.frameLayout.Y = shiwaiView.frameLayout.Bottom;
             likiadaodaView.btnText.TextID = StringId.likiadaoda;
             likiadaodaView.btnIcon.UnSelectedImagePath = "LogicIcon/location.png";
-            int count = 0;//杈撳叆绫诲瀷涓暟
-            if (MainView.IsGatewayType)
-            {
-                count = 4;
-                viewLayout.AddChidren(likiadaodaView.FLayoutView());
-            }
+            int count = 3;//杈撳叆绫诲瀷涓暟
+            //2022骞�05鏈�24鏃�15:08:22 闅愯棌鎺夊湴鐞嗗洿鏍�
+            //if (MainView.IsGatewayType)
+            //{
+            //    count = 4;
+            //    viewLayout.AddChidren(likiadaodaView.FLayoutView());
+            //}
             ////鍔熻兘
             ///浜у搧缁忕悊鍚涚剷瑕佹眰锛岃澶囧姛鑳界Щ鍒拌繖閲屻��<2022-3-7>
-            new FunTpye(LogicMethod.condition_if).FunTypeView(viewLayout, likiadaodaView.frameLayout.Bottom, count);
+            new FunTpye(LogicMethod.condition_if).FunTypeView(viewLayout, shiwaiView.frameLayout.Bottom, count);
 
             #endregion
 
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 1dbfd7c..2b606ad 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -405,6 +405,23 @@
                         };
                     }
                     break;
+                //闂ㄩ攣
+                case SPK.DoorLock:
+                    {
+
+                        LogicView.FunTypeView view = new LogicView.FunTypeView();
+                        view.btnText.TextID = StringId.shifoukaisuoshi;
+                        fLayout.AddChidren(view.FLayoutView());
+                        view.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            DeviceView(device, view.btnState, StringId.shi, StringId.offLogic,1);
+                        };
+                        if (edit)
+                        {
+                            GetEditState(device, index, view.btnState, null, null, null);
+                        }
+                    }
+                    break;
             }
             #region  淇濆瓨
             ///淇濆瓨View
@@ -482,12 +499,13 @@
         /// <param name="button">閫変腑鐘舵�佹樉绀烘枃鏈珺tn鎺т欢</param>
         /// <param name="btnText1">灞炴�х姸鎬佸�兼枃鏈�1</param>
         /// <param name="btnText2">灞炴�х姸鎬佸�兼枃鏈�2</param>
-        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2)
+        /// <param name="viewCount">view鏁伴噺</param>
+        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2)
         {
             FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence };
             this.AddChidren(frame);
             LogicView.SwitchView switchView = new LogicView.SwitchView();
-            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, (intValue) =>
+            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, viewCount,(intValue) =>
             {
                 //璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�;
                 string keyVlaue = "on_off";
@@ -540,6 +558,11 @@
                             }
                         }
                         break;
+                    case SPK.DoorLock:
+                        {
+                            keyVlaue = "door_status";
+                        }
+                        break;
 
                 }
                 switch (intValue)
@@ -583,6 +606,7 @@
                             }
                         }
                         break;
+                    case StringId.shi:
                     case StringId.kaiqi:
                         {
                             value = "open";
@@ -607,6 +631,8 @@
                         {
                             value = "fall";
                         }; break;
+                   
+
                 }
                 //鏄剧ず鏂囨湰
                 button.TextID = intValue;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
index dbe2972..13e261d 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -219,10 +219,11 @@
                     areaView.btnClick.MouseUpEventHandler += (sender, e2) =>
                     {
                         fLayout.RemoveFromParent();
-                        funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
-                        UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString();
+                        string clickText = areaView.btnClick.Tag.ToString(); 
+                        funAllAreaView.btnText2.Text = clickText;
+                        UserInfo.Current.logicselectedFunction = clickText;
                         ///鑾峰彇璁惧鍗曚釜澶х被spk鍒楄〃锛堜緥濡�:鐏厜绫�,绌鸿皟绫�...锛�
-                        var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
+                        var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(clickText);
                         ///鑾峰彇璁惧鍗曚釜灏忕被鍒楄〃锛堜緥濡傦細鐏厜1,鐏厜2...锛�
                         var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList);
                        this.LoadingDeviceListView(vv, lists2);
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 646c43e..ecbb380 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -447,6 +447,19 @@
 
                                     }
                                     break;
+                                case SPK.DoorLock:
+                                    {
+                                        foreach (var dic in dicList)
+                                        {
+                                            string value = dic["value"];
+                                            if (value == "open")
+                                            {
+                                                inputView.btnState.Text = Language.StringByID(StringId.kaiqi);
+                                            }
+
+                                        }
+                                    }
+                                    break;
                             }
                         }
                         break;
@@ -1984,6 +1997,19 @@
                         }
                     }
                     break;
+                case SPK.DoorLock:
+                    {
+                        foreach (var dic in dicList)
+                        {
+                            string value = dic["value"];
+                            if (value == "open")
+                            {
+                                button1.Text = Language.StringByID(StringId.shi);
+                            }
+                           
+                        }
+                    }
+                    break;
             }
         }
         /// <summary>
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
index 8bfe344..d863ed5 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -397,6 +397,11 @@
                         strPath = "LogicIcon/sensor.png";
                     }
                     break;
+                case SPK.DoorLock:
+                    {
+                        strPath = "FunctionIcon/DoorLock/DoorLock.png";
+                    }
+                    break;
 
             }
             return strPath;
@@ -488,6 +493,12 @@
             {
                 deviceStrTypeList.Add(Language.StringByID(StringId.Electric));
             }
+            ///闂ㄩ攣绫�
+            var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock);
+            if (doorlock != null)
+            {
+                deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock));
+            }
             return deviceStrTypeList;
 
         }
@@ -568,6 +579,11 @@
                 functionTypeList.Add(SPK.AirSwitch);
                 functionTypeList.Add(SPK.PanelSocket);
                 functionTypeList.Add(SPK.ElectricSocket);
+            }
+            ///闂ㄩ攣绫�
+            else if (deviceType == Language.StringByID(StringId.DoorLock))
+            {
+                functionTypeList.Add(SPK.DoorLock); 
             }
             else
             {
@@ -668,6 +684,7 @@
                         deviceTypeList.Add(SPK.ElectricSocket);
                         deviceTypeList.Add(SPK.HvacCac);
                         deviceTypeList.Add(SPK.SensorHelp);
+                        deviceTypeList.Add(SPK.DoorLock);
 
                     }
                     break;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
index 0b9a0d1..290a07f 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SwitchView.cs
@@ -97,7 +97,7 @@
         /// View鐨勬柟娉�
         /// </summary>
         ///  <param name="frame">鐖舵帶浠�</param>
-        /// <param name="i">鏄剧ず閫夋嫨View鏁伴噺</param>
+        /// <param name="i">琛ㄧずView鏁伴噺</param>
         ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
         /// <returns></returns>
@@ -166,23 +166,30 @@
         /// View鐨勬柟娉�
         /// </summary>
         ///  <param name="frame">鐖舵帶浠�</param>
-        /// <param name="text1">鐖舵帶浠�</param>
-        /// <param name="text2">鏄剧ず閫夋嫨View鏁伴噺</param>
+        /// <param name="text1">绗竴涓娉�</param>
+        /// <param name="text2">绗簩涓娉�</param>
         ///<param name="stateVuale">涔嬪墠鐨勭姸鎬佸��</param>
+        /// <param name="i">琛ㄧずView鏁伴噺</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
         /// <returns></returns>
-        public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, Action<int> action,bool tag=true)
+        public void FLayoutView(FrameLayout frame, int text1, int text2, string stateVuale, int i, Action<int> action,bool tag=true)
         {
-            int i = 2;
             frameLayout.Y = Application.GetRealHeight(603 - (44 * i));
             frameLayout.Height = Application.GetRealHeight(44 * i);
             frame.AddChidren(frameLayout);
             frame.AddChidren(btnCancel);
             btnOn.TextID = text1;
             btnOff.TextID = text2;
-            frameLayout.AddChidren(btnOn);
-            frameLayout.AddChidren(btnLine);
-            frameLayout.AddChidren(btnOff);
+            if (i == 1)
+            {
+                frameLayout.AddChidren(btnOn);
+            }
+            else if (i == 2)
+            {
+                frameLayout.AddChidren(btnOn);
+                frameLayout.AddChidren(btnLine);
+                frameLayout.AddChidren(btnOff);
+            }
             //鍙栨秷鐐瑰嚮浜嬩欢
             btnCancel.MouseUpEventHandler += (sender1, e1) =>
             {
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
index 7258f5f..f429ada 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -173,7 +173,7 @@
         logicIfon.Add("noticeConfig", noticeConfigJObject);
         logicIfon.Add("pushConfigs", pushConfigsArray);
         logicjArray.Add(logicIfon);
-        //string str = logicIfon.ToString();
+       //string str = logicIfon.ToString();
         var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
         responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add, 5);
         //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs
index 4d7538c..4e1a37e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs
@@ -574,6 +574,8 @@
                                 str = Language.StringByID(StringId.shebeibucunzai);
                             }
                             break;
+                            
+                        case "124006":
                         case "14006":
                             {
                                 str = Language.StringByID(StringId.shebeibuzaixian);
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
index 6f4b31f..4575ac6 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -291,6 +291,7 @@
         /// <returns></returns>
         public static ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 20)
         {
+            MainPage.Log("璇锋眰鏁版嵁=="+o.ToString());
             var requestJson = HttpUtil.GetSignRequestJson(o);
             return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs
index 7d9146c..6b7887f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs
@@ -170,7 +170,7 @@
             this.picLockControl = new PicViewControl(256, 260);
             picLockControl.Y = Application.GetRealHeight(129);
             picLockControl.Gravity = Gravity.CenterHorizontal;
-            picLockControl.UnSelectedImagePath = "FunctionIcon/DoorLock/LockPictrue1.png";
+            picLockControl.UnSelectedImagePath = "FunctionIcon/DoorLock/LockPictrue1.png"; 
             FrameWhiteCentet1.AddChidren(picLockControl);
             picLockControl.ButtonClickEvent += (sender, e) =>
             {

--
Gitblit v1.8.0