From 608b97795c1419b0411b6320126c9681dd4126da Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 21 三月 2023 09:11:50 +0800
Subject: [PATCH] 组合调光

---
 HDL-ON_Android/Properties/AndroidManifest.xml                             |    2 
 HDL_ON/DAL/Server/NewAPI.cs                                               |   44 ++++++
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs            |   45 ++++++
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs                      |   13 +
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs   |  127 ++++++++++++++++++
 HDL_ON/DAL/Server/HttpServerRequest.cs                                    |   51 +++++++
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs |   83 +++++++++++
 HDL_ON/HDL_ON.projitems                                                   |    2 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                          |    4 
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs    |    2 
 10 files changed, 362 insertions(+), 11 deletions(-)

diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 60e9e18..9843f1a 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303171">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303172">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
 	<!--鍙嬬洘-->
 	<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 585b717..3b85c15 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -3133,7 +3133,7 @@
 
 
 
-#region 鍏変紡鍌ㄨ兘
+        #region 鍏変紡鍌ㄨ兘
         /// <summary>
         /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
         /// </summary>
@@ -3158,7 +3158,54 @@
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson);
             return pack;
         }
-#endregion
+        #endregion
+
+
+        #region 缇ゆ帶锛岀粍鍚堣皟鍏�
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶绫诲瀷
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlTypes(string spk)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("spk", spk);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew AddGroupControl()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
+            return pack;
+        }
+
+        #endregion
 
     }
 }
\ No newline at end of file
diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs
index 57dac3a..c812aa1 100644
--- a/HDL_ON/DAL/Server/NewAPI.cs
+++ b/HDL_ON/DAL/Server/NewAPI.cs
@@ -867,6 +867,50 @@
         public const string Api_Post_GetInverter_StatisticsInfo = "/home-wisdom/app/device/inverter/allInfo";
         #endregion
 
+        #region 缇ゆ帶锛岀粍鍚堣皟鍏�
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶绫诲瀷
+        /// </summary>
+        public const string Api_Post_GetGroupControlTypes = "/home-wisdom/app/device/groupcontrol/types";
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶鍒楄〃
+        /// </summary>
+        public const string Api_Post_GetGroupControlListByHome = "/home-wisdom/app/device/groupcontrol/list";
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public const string Api_Post_GetGroupControlInfos = "/home-wisdom/app/device/groupcontrol/infos";
+        /// <summary>
+        /// 娣诲姞缇ゆ帶
+        /// </summary>
+        public const string Api_Post_AddGroupControl = "/home-wisdom/app/device/groupcontrol/add";
+        /// <summary>
+        /// 鏇存柊缇ゆ帶
+        /// </summary>
+        public const string Api_Post_UpdateGroupControl = "/home-wisdom/app/device/groupcontrol/update";
+        /// <summary>
+        /// 鍒犻櫎缇ゆ帶
+        /// </summary>
+        public const string Api_Post_DeleteGroupControl = "/home-wisdom/app/device/groupcontrol/deleted";
+        /// <summary>
+        /// 鏀惰棌缇ゆ帶
+        /// </summary>
+        public const string Api_Post_CollectGroupControl = "/home-wisdom/app/device/groupcontrol/collect";
+        /// <summary>
+        /// 鍙栨秷鏀惰棌缇ゆ帶
+        /// </summary>
+        public const string Api_Post_CancelCollectGroupControl = "/home-wisdom/app/device/groupcontrol/cancelCollect";
+        /// <summary>
+        /// 鎺у埗缇ゆ帶
+        /// </summary>
+        public const string Api_Post_ControlGroupControl = "/home-wisdom/app/device/groupcontrol/controlDown";
+        /// <summary>
+        /// 缇ゆ帶鐘舵�佸埛鏂�
+        /// </summary>
+        public const string Api_Post_ReadGroupControlStatus = "/home-wisdom/app/device/groupcontrol/statusRefresh";
+
+        #endregion
+
     }
 
     ///// <summary>
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 7639f6c..6b31012 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -533,6 +533,8 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\DeliveryQrCodePage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\MemberManagement\MemberFaceManagementPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\CombinedDimmingListPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\GroupControl.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\AddCombineDimmingPage.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index d290c12..76402ed 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -230,11 +230,11 @@
                     //etAccount.Text = "18244942707";
                     //etAccount.Text = "12345678904";
                     //etAccount.Text = "13418062953";
-                    //etAccount.Text = "13138683659";
+                    etAccount.Text = "13138683659";
                     //etAccount.Text = "15217626103";
                     //etAccount.Text = "18100573477";
                     //etAccount.Text = "18321091245";
-                    etAccount.Text = "13751916353";
+                    //etAccount.Text = "13751916353";
                 }
                 else
                 {
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs
new file mode 100644
index 0000000..9779f31
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs
@@ -0,0 +1,127 @@
+锘縰sing System;
+using Shared;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+
+namespace HDL_ON.UI
+{
+    public class AddCombineDimmingPage : FrameLayout
+    {
+        FrameLayout bodyView;
+
+        public AddCombineDimmingPage()
+        {
+            bodyView = this;
+        }
+
+        public void LoadPage()
+        {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView();
+
+            var contentView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Height = Application.GetRealHeight(550),
+            };
+            bodyView.AddChidren(contentView);
+
+            #region 浣忓畢鍚嶇О
+            FrameLayout residenceNameRow;
+            residenceNameRow = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(72),
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            contentView.AddChidren(residenceNameRow);
+            Button btnResidenceNameTitle = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(78),
+                TextID = StringId.ResidenceName,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            residenceNameRow.AddChidren(btnResidenceNameTitle);
+
+            var btnResidenceName = new Button()
+            {
+                X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
+                Width = Application.GetRealWidth(200),
+                Text = DB_ResidenceData.Instance.CurrentRegion.homeName,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.TextualColor,
+            };
+            residenceNameRow.AddChidren(btnResidenceName);
+
+            var btnEditResidenceNameIcon = new Button()
+            {
+                X = Application.GetRealWidth(333),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                UnSelectedImagePath = "Public/Edit.png",
+            };
+            residenceNameRow.AddChidren(btnEditResidenceNameIcon);
+
+            #endregion
+            residenceNameRow.AddChidren(
+                new Button()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Y = Application.GetRealHeight(49),
+                    Height = Application.GetRealHeight(1),
+                    Width = Application.GetRealWidth(343),
+                    BackgroundColor = CSS_Color.DividingLineColor,
+                });
+            #region 浣忓畢鍦板潃
+            var residenceAddressRow = new FrameLayout()
+            {
+                Y = residenceNameRow.Bottom,
+                Height = Application.GetRealHeight(50),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            contentView.AddChidren(residenceAddressRow);
+
+            var btnResidenceAddressTitle = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Width = Application.GetRealWidth(78),
+                TextID = StringId.ResidenceAddress,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            residenceAddressRow.AddChidren(btnResidenceAddressTitle);
+
+            var btnLocationAddressIcon = new Button()
+            {
+                X = Application.GetRealWidth(333),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(28),
+                Height = Application.GetMinRealAverage(28),
+                //UnSelectedImagePath = "Public/LocationAddressIcon.png",
+                UnSelectedImagePath = "Public/Edit.png",
+            };
+            residenceAddressRow.AddChidren(btnLocationAddressIcon);
+
+            var btnResidenceAddress = new Button()
+            {
+                X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right,
+                Width = Application.GetRealWidth(200),
+                Text = DB_ResidenceData.Instance.CurrentRegion.homeAddress,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.TextualColor,
+            };
+            residenceAddressRow.AddChidren(btnResidenceAddress);
+            #endregion
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+
+
+        }
+    }
+}
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
index 5f0518a..ec63191 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
@@ -1,4 +1,7 @@
 锘縰sing System;
+using HDL_ON.DAL.Server;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
 using Shared;
 
 namespace HDL_ON.UI
@@ -15,11 +18,89 @@
         public void LoadPage()
         {
 
-            new TopViewDiv(bodyView, Language.StringByID(StringId.MemberManagement)).LoadTopView_AddIcon("CombinedDimming",
+            new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView_AddIcon("CombinedDimming",
                 (s,c)=>{
 
                 });
 
+            var contentView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(550),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            bodyView.AddChidren(contentView);
+
+
+            new System.Threading.Thread(() => {
+                var http = new HttpServerRequest();
+                var pack = http.GetGroupControlList();
+                if(pack != null)
+                {
+                    if(pack.Code == StateCode.SUCCESS)
+                    {
+                        var data = Newtonsoft.Json.JsonConvert.DeserializeObject<GroupControl>(pack.Data.ToString());
+                    }
+                }
+
+            }) { IsBackground = true }.Start();
+
+            #region 
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+            var row = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(65),
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+
+            var btnTitle = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(308),
+                Height = Application.GetRealHeight(24),
+                TextID = StringId.AdministratorPermissionMigration,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+            };
+            row.AddChidren(btnTitle);
+
+            var btnAdministratorPermissionMigrationExplan = new Button()
+            {
+                X = Application.GetRealWidth(16),
+                Y = btnTitle.Bottom,
+                Width = Application.GetRealWidth(308),
+                Height = Application.GetRealHeight(21),
+                TextID = StringId.AdministratorPermissionMigrationExPlan,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextColor = CSS_Color.PromptingColor1,
+            };
+            row.AddChidren(btnAdministratorPermissionMigrationExplan);
+
+
+            var btnAdministratorPermissionMigrationSkinIcon = new Button()
+            {
+                X = Application.GetRealWidth(343),
+                Gravity = Gravity.CenterVertical,
+                Width = Application.GetMinRealAverage(16),
+                Height = Application.GetMinRealAverage(16),
+                UnSelectedImagePath = "Public/RightIcon.png",
+            };
+            row.AddChidren(btnAdministratorPermissionMigrationSkinIcon);
+
+            row.AddChidren(
+                new Button()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Y = Application.GetRealHeight(64),
+                    Height = Application.GetRealHeight(1),
+                    Width = Application.GetRealWidth(343),
+                    BackgroundColor = CSS_Color.DividingLineColor,
+                });
+            #endregion
+
         }
     }
 }
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
new file mode 100644
index 0000000..932bb37
--- /dev/null
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
@@ -0,0 +1,45 @@
+锘縰sing System;
+using System.Collections.Generic;
+
+namespace HDL_ON.Entity
+{
+    public class GroupControl
+    {
+        public GroupControl()
+        {
+        }
+        /// <summary>
+        /// 缇ゆ帶sid
+        /// </summary>
+        public string sid = string.Empty;
+        /// <summary>
+        /// 缇ゆ帶鍚嶇О
+        /// </summary>
+        public string name = string.Empty;
+        /// <summary>
+        /// 缇ゆ帶绫诲瀷
+        /// </summary>
+        public string type = string.Empty;
+        /// <summary>
+        /// 鎴块棿uid
+        /// </summary>
+        public List<String> uids = new List<string>();
+        /// <summary>
+        /// 缇ゆ帶鍔熻兘sid閰嶇疆
+        /// </summary>
+        public List<GroupControlFunction> sids = new List<GroupControlFunction>();
+    }
+
+    public class GroupControlFunction
+    {
+        /// <summary>
+        /// 鍔熻兘sid
+        /// </summary>
+        public string sid = string.Empty;
+        /// <summary>
+        /// 鍔熻兘spk
+        /// </summary>
+        public string spk = string.Empty;
+    }
+}
+
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
index fa38584..34a2c9b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -585,7 +585,7 @@
                     #endregion
 
                     residenceFunctionCount++;
-                    #region ---浜鸿劯绠$悊
+                    #region ---缁勫悎璋冨厜
                     var faceManagementView = new FrameLayout()
                     {
                         X = Application.GetRealWidth(28 - 24),
@@ -608,7 +608,7 @@
                     {
                         Y = btnResidenceManageIcon.Bottom,
                         Height = Application.GetRealHeight(29),
-                        TextID = StringId.FaceManagemant,
+                        TextID = StringId.CombinedDimming,
                         TextAlignment = TextAlignment.Center,
                         TextColor = CSS_Color.FirstLevelTitleColor,
                         TextSize = CSS_FontSize.PromptFontSize_FirstLevel
@@ -617,9 +617,14 @@
                     #endregion
 
                     EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
-
+                        var page = new CombinedDimmingListPage();
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage();
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                     };
-
+                    faceManagementView.MouseUpEventHandler = eventHandler;
+                    btnFaceManagementText.MouseUpEventHandler = eventHandler;
+                    btnFaceManagementIcon.MouseUpEventHandler = eventHandler;
                 }
             }
             else
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
index 5aab611..81224f4 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -202,9 +202,9 @@
             };
             residenceAddressRow.AddChidren(btnResidenceAddress);
             #endregion
-            #region 妤煎眰绠$悊
             contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
 
+            #region 妤煎眰绠$悊
             floorManagementRow = new FrameLayout()
             {
                 Height = Application.GetRealHeight(50),

--
Gitblit v1.8.0