From efad979b6fae76fb37a4de7e94e6bac0a85cb72c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 30 十一月 2021 13:14:28 +0800
Subject: [PATCH] 2021-11-30 1.修复乐橙Android,没调用拒接接口问题。

---
 HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs |  212 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 195 insertions(+), 17 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs
index 61abb45..e8cc886 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs
@@ -7,7 +7,7 @@
 using Shared;
 namespace HDL_ON.UI
 {
-    public class CatchSceneAddPage : FrameLayout
+    public partial class CatchSceneAddPage : FrameLayout
     {
         FrameLayout bodyView;
         private ImageView addSceneImageView;
@@ -21,6 +21,13 @@
         private Button btnChooseZoneViewTitle;
         private VerticalScrolViewLayout functionListView;
         private Button btnComplete;
+        /// <summary>
+        /// 鎹曟崏鐨勫尯鍩熷垪琛�
+        /// </summary>
+        private List<Room> catchRooms = new List<Room>();
+
+        Button btnAddFunctionTitle;
+
 
         #region 鍥炬爣閫夋嫨閮ㄥ垎鍥炬爣
         /// <summary>
@@ -50,12 +57,6 @@
         #endregion
 
 
-
-        /// <summary>
-        /// 鎹曟崏鐨勫尯鍩熷垪琛�
-        /// </summary>
-        private List<Room> catchRooms = new List<Room>();
-
         /// <summary>
         /// 鍥炶皟鏇存柊
         /// </summary>
@@ -69,6 +70,7 @@
                 RemoveFromParent();
             };
         }
+
 
         public void LoadPage()
         {
@@ -105,14 +107,6 @@
 
             //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶
             ImageUtlis.Current.LoadLocalOrNetworkImages(scene.ImagePath, addSceneImageView);
-
-            /// <summary>
-            /// 淇敼鍦烘櫙鑳屾櫙浜嬩欢
-            /// </summary>
-            addSceneImageView.MouseUpEventHandler = (sender, e) =>
-            {
-                LoadPictureOptionView();
-            };
 
             #region 鍦烘櫙鍚嶇Оrow
             sceneNameView = new FrameLayout()
@@ -213,6 +207,71 @@
                 BackgroundColor = CSS_Color.BackgroundColor,
             });
             #endregion
+            #region 鍦烘櫙寤舵椂row
+            /*
+            if (DB_ResidenceData.Instance.GatewayType == 1)
+            {
+                FrameLayout sceneDelayRow = new FrameLayout()
+                {
+                    Y = sceneNameView.Bottom,
+                    Height = Application.GetRealWidth(50),
+                };
+                contentView.AddChidren(sceneDelayRow);
+
+                Button btnSceneDelayRight = new Button()
+                {
+                    X = Application.GetRealWidth(339),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetMinRealAverage(16),
+                    Height = Application.GetMinRealAverage(16),
+                    UnSelectedImagePath = "Public/Right.png",
+                };
+                sceneDelayRow.AddChidren(btnSceneDelayRight);
+
+                var btnSceneDelayInfo = new Button()
+                {
+                    Width = Application.GetRealWidth(327),
+                    TextAlignment = TextAlignment.CenterRight,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    Text = scene.GetDelayText()
+                };
+                sceneDelayRow.AddChidren(btnSceneDelayInfo);
+
+                Button btnSceneDelayTitle = new Button()
+                {
+                    X = Application.GetRealWidth(16),
+                    //Width = Application.GetRealWidth(90),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextID = StringId.SceneDelay,
+                };
+                sceneDelayRow.AddChidren(btnSceneDelayTitle);
+
+                btnSceneDelayTitle.MouseUpEventHandler = (sender, e) =>
+                {
+                    Action<string> action = (obj) => {
+                        scene.delay = obj;
+                        btnSceneDelayInfo.Text = scene.GetDelayText();
+                    };
+                    Dictionary<string, string> items = new Dictionary<string, string>();
+                    items.Add("30", "30s");
+                    items.Add("60", "1min");
+                    items.Add("120", "2min");
+                    items.Add("300", "5min");
+                    new PublicAssmebly().SetSceneDelayDialog(items, action, scene.delay);
+                };
+
+                contentView.AddChidren(new Button()
+                {
+                    Y = sceneDelayRow.Bottom,
+                    Height = Application.GetRealHeight(8),
+                    BackgroundColor = CSS_Color.BackgroundColor,
+                });
+            }
+            */
+            #endregion
 
             #region 閫夋嫨鍖哄煙
             FrameLayout chooseZoneView = new FrameLayout()
@@ -247,6 +306,8 @@
                 BackgroundColor = CSS_Color.BackgroundColor,
             };
             contentView.AddChidren(btnLine1);
+
+
 
             #endregion
 
@@ -302,7 +363,10 @@
                         {
                             if(temp.roomIds.Contains(catchRoom.roomId))
                             {
-                                catchFunctionList.Add(temp);
+                                if (MainPage.SceneSupportFunctionList.Contains(temp.spk))
+                                {
+                                    catchFunctionList.Add(temp);
+                                }
                             }
                         }
                     }
@@ -313,7 +377,13 @@
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 }
             };
+
+
+            LoadEventList();
+
         }
+
+
 
         /// <summary>
         /// 鍔犺浇鍔熻兘鍒楄〃
@@ -402,6 +472,7 @@
             }
         }
 
+
         /// <summary>
         /// 鍔犺浇鍥炬爣閫夋嫨閫夐」
         /// </summary>
@@ -489,6 +560,51 @@
             LoadEvent_PictureOptionViewEventList(pView);
         }
 
+
+    }
+
+    //--------------------------------------
+    public partial class CatchSceneAddPage
+    {
+        void LoadEventList()
+        {
+            LoadEvent_ChangeSceneImage();
+            LoadEvent_ChangeSceneZone();
+            LoadEvent_EditRoomName();
+        }
+
+        /// <summary>
+        /// 淇敼鍦烘櫙鎵�灞炲尯鍩�
+        /// </summary>
+        void LoadEvent_ChangeSceneZone()
+        {
+            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            {
+                Action backAction = () => {
+                    btnZoneName.Text = scene.GetRoomListName();
+                };
+                var ssl = new SetSceneLocationPage(scene, backAction);
+                MainPage.BasePageView.AddChidren(ssl);
+                ssl.LoadPage();
+                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+            };
+            btnZoneName.MouseUpEventHandler = eventHandler;
+            belongToZoneRow.MouseUpEventHandler = eventHandler;
+            btnBelongToZoneRight.MouseUpEventHandler = eventHandler;
+
+        }
+
+   
+        /// <summary>
+        /// 淇敼鍦烘櫙鑳屾櫙浜嬩欢
+        /// </summary>
+        void LoadEvent_ChangeSceneImage()
+        {
+            addSceneImageView.MouseUpEventHandler = (sender, e) => {
+                LoadPictureOptionView();
+            };
+        }
+
         /// <summary>
         /// 鍔犺浇鑳屾櫙鍥鹃�夋嫨鍖哄煙浜嬩欢鍒楄〃
         /// </summary>
@@ -514,13 +630,30 @@
             {
                 btnTakePicture.IsSelected = false;
 
+                //var pid = Guid.NewGuid();
+                //CropImage.TakePicture((imagePath) =>
+                //{
+                //    if (imagePath != null)
+                //    {
+                //        addSceneImageView.ImagePath = imagePath.ToString();
+                //        scene.ImagePath = addSceneImageView.ImagePath;
+                //        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                //    }
+                //}, pid.ToString(), 4, 3);
+
+
                 var imageName = Guid.NewGuid().ToString();
+                //var imageName = scene.sid;
                 CropImage.TakePicture((imagePath) =>
                 {
                     CropImageCallBack(imagePath);
 
                 }, imageName, 4, 3);
 
+                //if (pageTitleId == StringId.EditScene)
+                //{
+                //    scene.SaveFunctionData();
+                //}
                 pictureOptionView.Parent.RemoveFromParent();
             };
             btnAlbum.MouseDownEventHandler = (sender, e) => {
@@ -530,6 +663,16 @@
             btnAlbum.MouseUpEventHandler = (sender, e) =>
             {
                 btnAlbum.IsSelected = false;
+                //var pid = Guid.NewGuid();
+                //CropImage.SelectPicture((imagePath) =>
+                //{
+                //    if (imagePath != null)
+                //    {
+                //        addSceneImageView.ImagePath = imagePath.ToString();
+                //        scene.ImagePath = addSceneImageView.ImagePath;
+                //        MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                //    }
+                //}, pid.ToString(), 4, 3);
 
                 //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
                 var imageName = Guid.NewGuid().ToString();
@@ -583,6 +726,41 @@
             };
             //涓婁紶鍥剧墖鍒颁簯绔�
             UploadImage(selectImagePath, addSceneImageView, scene, uploadSuccessAction);
+        }
+
+        /// <summary>
+        /// 鍔犺浇淇敼鍦烘櫙鍚嶇О绐楀彛浜嬩欢
+        /// </summary>
+        void LoadEvent_EditRoomName()
+        {
+            Action<string> callBack = (str) =>
+            {
+                //鍚嶇О涓嶈兘涓虹┖
+                if (string.IsNullOrEmpty(str))
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.SceneNameCannotBeEmpty),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(bodyView);
+                    return;
+                }
+                btnSceneName.Text = str;
+                scene.name = str;
+            };
+            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+            {
+                List<string> sceneNameList = new List<string>();
+                foreach (var tempScene in FunctionList.List.scenes)
+                {
+                    sceneNameList.Add(tempScene.name);
+                }
+                new PublicAssmebly().LoadDialog_EditParater(StringId.SceneName, scene.name, callBack, StringId.SceneNameCannotBeEmpty, StringId.SceneNameAlreadyExists, sceneNameList);
+            };
+            sceneNameView.MouseUpEventHandler = eventHandler;
+            btnSceneName.MouseUpEventHandler = eventHandler;
+            btnEditSceneNameIcon.MouseUpEventHandler = eventHandler;
         }
 
         /// <summary>
@@ -669,6 +847,6 @@
             }
             catch { }
         }
-
     }
+
 }

--
Gitblit v1.8.0