From 38ab16c66df6fc523f2c385fd583a2f2e86a781c Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 29 四月 2020 17:58:45 +0800
Subject: [PATCH] 2020-4-29-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs |  103 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 82 insertions(+), 21 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
index 57a5a58..b84b75c 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
@@ -8,11 +8,14 @@
 {
     public class SoneLogicList : FrameLayout
     {
+        /// <summary>
+        /// 缁橲one闂ㄩ攣寰愭鏇存柊鐣岄潰鐢ㄧ殑
+        /// </summary>
         public SoneLogicList()
         {
             Tag = "SoneLogic";
         }
-        public async void Show()
+        public async void Show(Action action = null, bool bool_If = false)
         {
             #region  鐣岄潰鐨勫竷灞�浠g爜
             UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
@@ -22,7 +25,13 @@
             view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                if (action != null)
+                {
+                    action();
+                }
+
                 RemoveFromParent();
+
             };
 
             var middle = new FrameLayout
@@ -54,10 +63,11 @@
                 SelectedImagePath = "ZigeeLogic/openMode.png",
             };
             fLayout.AddChidren(modeIconBtn);
-            var logic = await SkipView.GetLogicIfon();
-            if (logic != null)
-            {
 
+            if (bool_If)
+            {
+                /// 鏌ユ壘鏄惁瀛樺湪鏃舵晥鎬ц嚜鍔ㄥ寲锛涙湁鐨勮瘽灏辫繑鍥炶嚜鍔ㄥ寲瀵硅薄;
+                var logic = await SkipView.GetLogicIfon();
 
                 fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害
                 modeIconBtn.IsSelected = true;//鏀瑰彉鍥炬爣鐘舵��
@@ -82,16 +92,28 @@
                     TextSize = 16,
                 };
                 openModeFl.AddChidren(closeBtn);
-                closeBtn.MouseUpEventHandler += (sender,e) => {
-                    
+                closeBtn.MouseUpEventHandler += (sender, e) =>
+                {
 
                     var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                    Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                    Language.StringByID(MyInternationalizationString.confrim));
                     alert.Show();
-                    alert.ConfirmClickEvent += () =>
+                    alert.ConfirmClickEvent += async () =>
                     {
-                        Send.DelLogic(logic.LogicId);
+
+                        var bool_ = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(new ZigBee.Device.DoorLock { });
+                        if (bool_)
+                        {
+
+                        }
+                        else { }
+                        if (logic != null)
+                        {
+                            ///鏈夊彲鑳藉彧鏈夊父寮�妯″紡锛屾病鏈夋椂鏁堟�ц嚜鍔ㄥ寲
+                            ///娌℃湁鍒ゆ柇鐨勮瘽锛岄�昏緫浼氫负绌猴紝鎶涘嚭寮傚父;
+                            Send.DelLogic(logic.LogicId);
+                        }
                         this.RemoveFromParent();
                         var soneLogicList = new SoneLogicList();
                         UserView.HomePage.Instance.AddChidren(soneLogicList);
@@ -101,7 +123,7 @@
                 };
 
                 ///鏄剧ず澶辨晥璁剧疆鏃堕棿鏂囨湰鎺т欢
-                var timeTextBtn= new Button
+                var timeTextBtn = new Button
                 {
                     Y = Application.GetRealHeight(127 + 69),
                     X = Application.GetRealWidth(225),
@@ -111,19 +133,23 @@
                     TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                     Text = "鏃舵晥鎬у父寮�璁剧疆12:20",
                 };
-                openModeFl.AddChidren(timeTextBtn);
+                if (logic != null)
+                {
+                    ///鏈夋椂鏁堟�у父寮�鎵嶆樉绀烘椂闂存潯浠舵枃鏈�
+                    openModeFl.AddChidren(timeTextBtn);
+                }
                 ///鏃舵晥鎬у父寮�鍙湁涓�涓潯浠�;
                 try
                 {
                     var y = DateTime.Now.ToString("yy");//閭d竴骞�
                     var m = DateTime.Now.ToString("mm");//閭d竴鏈�
                     var d = DateTime.Now.ToString("dd");//閭d竴澶�
-                    var h =int.Parse(DateTime.Now.ToString("HH"));//褰撳墠绯荤粺鏃堕棿
+                    var h = int.Parse(DateTime.Now.ToString("HH"));//褰撳墠绯荤粺鏃堕棿
                     var me = DateTime.Now.ToLongDateString();
                     var timeInt = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]);
-                    int dayInt = (h + timeInt)/ 24;//绠楀嚭鍑犲ぉ鍚庢墽琛�
+                    int dayInt = (h + timeInt) / 24;//绠楀嚭鍑犲ぉ鍚庢墽琛�
                     int hour = (h + timeInt) % 24;//绠楀嚭鍑犲ぉ鍚庨偅涓椂闂存墽琛�
-                    timeTextBtn.Text = "鏃舵晥鎬у父寮�璁剧疆" + y + "骞�" + m + "鏈�" + d + dayInt + "鍙�" + timeInt + "鏃�"+ "鎵ц";
+                    timeTextBtn.Text = "鏃舵晥鎬у父寮�璁剧疆" + y + "骞�" + m + "鏈�" + d + dayInt + "鍙�" + timeInt + "鏃�" + "鎵ц";
                 }
                 catch { }
 
@@ -155,8 +181,8 @@
                     TextSize = 15,
                     TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                     TextAlignment = TextAlignment.CenterLeft,
-                   // Text = "鏃舵晥鎬у父寮�璁剧疆",
-                    TextID=MyInternationalizationString.timeSetSone,
+                    // Text = "鏃舵晥鎬у父寮�璁剧疆",
+                    TextID = MyInternationalizationString.timeSetSone,
                 };
                 modeFl.AddChidren(modeTextBtn);
                 ///涓嬩竴绾ц彍鍗曞浘鏍囨帶浠�
@@ -177,13 +203,48 @@
                     Height = Application.GetRealHeight(138),
                     Width = Application.GetRealWidth(1022),
                 };
-                modeFl.AddChidren(clickBtn);
+                // modeFl.AddChidren(clickBtn);
 
+                nextIconBtn.MouseUpEventHandler += (sender, e) =>
+               {
+                   Logic.LogicView.TipView tipView = new LogicView.TipView();
 
-                clickBtn.MouseUpEventHandler += async (sender, e) =>
-                {
-                    var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock);
-                };
+                   FrameLayout fLayout1 = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
+                   this.AddChidren(fLayout1);
+                   tipView.ShowTip(fLayout1);
+                   //string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n");
+                   //var confirm = Language.StringByID(R.MyInternationalizationString.Confrim);
+                   //var alert = new UserCenter.DoorLock.ShowDoorLockMsgControl(UserCenter.DoorLock.ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm);
+                   //alert.Show();
+                   //alert.ConfirmClickEvent += () =>
+                   // {
+                   //     string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime);
+                   //     var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim);
+                   //     var alertTimeInValidSetting = new UserCenter.DoorLock.ShowDoorLockMsgControl(UserCenter.DoorLock.ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim);
+                   //     alertTimeInValidSetting.Show();
+                   //     alertTimeInValidSetting.InvalidTimeAction += async (obj) =>
+                   //     {
+
+                   //         var result = await new ZigBee.Device.DoorLock { }.SetNormallyOpenModeFuncAsync(true);
+                   //         //var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock);
+                   //     };
+                   // };
+
+                   //   //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog(new ZigBee.Device.DoorLock { });
+
+                   //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeStartDialog(new ZigBee.Device.DoorLock { }, () =>
+                   //{
+                   //});
+                   // var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock);
+
+                   // var contr = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Tip, "sdgdgdfhfhfhgjggfg");
+                   //contr.Show();
+                   //contr.ConfirmClickEvent += () =>
+                   //  {
+                   //  };
+
+                   //UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog();
+               };
             }
 
             #endregion
@@ -234,7 +295,7 @@
             addLogicfL.AddChidren(addIconBtn);
             addIconBtn.MouseUpEventHandler += (sender, e) =>
             {
-               
+
                 //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
                 //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
                 var h = DateTime.Now.ToString("HH");

--
Gitblit v1.8.0