From d53f7315de145266e6465d9f95d11d1712b9a91b Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 18 十二月 2020 20:55:28 +0800
Subject: [PATCH] 20201218-6

---
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
old mode 100644
new mode 100755
index 804209e..232670a
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -94,6 +94,12 @@
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
         }
 
+        public override void RemoveFromParent()
+        {
+            UnregisterGetPushMessageAction();
+            base.RemoveFromParent();
+        }
+
         public void LoadPage()
         {
             try
@@ -160,7 +166,7 @@
                     System.Threading.Tasks.Task.Run(() =>
                         {
                             //DriverLayer.Control.Ins.SearchLoaclGateway();
-                            MainPage.InitializationData();
+                            //MainPage.InitializationData();
                             //DriverLayer.Control.Ins.IsRemote = true;
                         });
                 };
@@ -370,6 +376,7 @@
 
                 // 鏌ヨ鏈娑堟伅骞舵樉绀�
                 GetUnreadPushMessages();
+                RegisterGetPushMessageAction();
             }
             catch (Exception ex)
             {
@@ -656,7 +663,13 @@
                     SelectedImagePath = "Collection/CollectionWhiteIcon.png",
                     UnSelectedImagePath = "Collection/CollectionIcon.png",
                 };
-                view.AddChidren(btnCollection);
+                //view.AddChidren(btnCollection);
+                //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
+                if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+                {
+                    view.AddChidren(btnCollection);
+                }
+
                 LoadEvent_FunctionCollection(btnCollection, function);
 
                 if (function.functionCategory == FunctionCategory.Curtain)
@@ -809,7 +822,23 @@
                     }
                     LoadEvent_SwitchFunction(function, btnSwitch);
                 }
-                var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, new Button(), new Button(), new Button());
+                //鍙栨秷鏀惰棌浜嬩欢
+                Action cannelCollect = () => {
+                    function.collect = false;
+                    if (function.functionCategory == FunctionCategory.Music)//澶勭悊闊充箰涓讳粠鍏崇郴
+                    {
+                        if ((function as Music.A31MusicModel).ServerClientType == 1)
+                        {
+                            (function as Music.A31MusicModel).MainPlayCollection = false;
+                            Music.A31MusicModel.Save();
+                        }
+                    }
+                    string msg = function.name + Language.StringByID(StringId.CollectionCancelled);
+                    LoadDeviceFunctionControlZone();
+                    function.SaveFunctionData(true);
+                };
+
+                var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone);
                 view.MouseUpEventHandler = skipControlPageEvent;
                 btnName.MouseUpEventHandler = skipControlPageEvent;
                 btnIcon.MouseUpEventHandler = skipControlPageEvent;
@@ -890,7 +919,13 @@
                     SelectedImagePath = "Collection/CollectionWhiteIcon.png",
                     UnSelectedImagePath = "Collection/CollectionIcon.png",
                 };
-                view.AddChidren(btnCollection);
+                //view.AddChidren(btnCollection);
+                //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
+                if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+                {
+                    view.AddChidren(btnCollection);
+                }
+
                 LoadEvent_SceneCollection(btnCollection, scene);
               
                 LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene);

--
Gitblit v1.8.0