From ae7c46bda98a987d170a9b8419fc014564790359 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 06 五月 2020 14:20:12 +0800 Subject: [PATCH] 上传 --- ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 129 ++++++++++++++++++++++++++++++++----------- 1 files changed, 96 insertions(+), 33 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs index 57a5a58..e647ad7 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs @@ -8,12 +8,23 @@ { public class SoneLogicList : FrameLayout { + /// <summary> + /// 缁橲one闂ㄩ攣寰愭鏇存柊鐣岄潰鐢ㄧ殑 + /// </summary> + /// public SoneLogicList() { Tag = "SoneLogic"; } + /// <summary> + /// + /// </summary> + /// <param name="action">缁欏緪姊呭埛鏂扮晫闈㈢敤鐨�</param> + /// <param name="bool_If"></param> + public Action<bool> action; public async void Show() { + #region 鐣岄潰鐨勫竷灞�浠g爜 UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦 TopView view = new TopView(); @@ -22,7 +33,13 @@ view.clickBtn.MouseDownEventHandler += (sender, e) => { UserView.HomePage.Instance.ScrollEnabled = true; + if (action != null) + { + action(Send.CurrentDoorLock.IsDoorLockNormallyMode); + } + RemoveFromParent(); + }; var middle = new FrameLayout @@ -54,10 +71,11 @@ SelectedImagePath = "ZigeeLogic/openMode.png", }; fLayout.AddChidren(modeIconBtn); - var logic = await SkipView.GetLogicIfon(); - if (logic != null) - { + if (Send.CurrentDoorLock.IsDoorLockNormallyMode) + { + /// 鏌ユ壘鏄惁瀛樺湪鏃舵晥鎬ц嚜鍔ㄥ寲锛涙湁鐨勮瘽灏辫繑鍥炶嚜鍔ㄥ寲瀵硅薄; + var logic = await SkipView.GetLogicIfon(); fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害 modeIconBtn.IsSelected = true;//鏀瑰彉鍥炬爣鐘舵�� @@ -82,26 +100,33 @@ TextSize = 16, }; openModeFl.AddChidren(closeBtn); - closeBtn.MouseUpEventHandler += (sender,e) => { - - - var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, - Language.StringByID(MyInternationalizationString.doyouwanttodelete), - Language.StringByID(MyInternationalizationString.confrim)); - alert.Show(); - alert.ConfirmClickEvent += () => + closeBtn.MouseUpEventHandler += async (sender, e) => + { + var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); + if (result) { - Send.DelLogic(logic.LogicId); + if (logic != null) + { + ///鏈夊彲鑳藉彧鏈夊父寮�妯″紡锛屾病鏈夋椂鏁堟�ц嚜鍔ㄥ寲 + ///娌℃湁鍒ゆ柇鐨勮瘽锛岄�昏緫浼氫负绌猴紝鎶涘嚭寮傚父; + Send.DelLogic(logic.LogicId); + } + Send.CurrentDoorLock.IsDoorLockNormallyMode = false; this.RemoveFromParent(); var soneLogicList = new SoneLogicList(); UserView.HomePage.Instance.AddChidren(soneLogicList); UserView.HomePage.Instance.PageIndex += 1; soneLogicList.Show(); - }; + } + else + { + ///鎻愮ず澶辫触 + } + }; ///鏄剧ず澶辨晥璁剧疆鏃堕棿鏂囨湰鎺т欢 - var timeTextBtn= new Button + var timeTextBtn = new Button { Y = Application.GetRealHeight(127 + 69), X = Application.GetRealWidth(225), @@ -111,19 +136,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 +184,8 @@ TextSize = 15, TextColor = ZigbeeColor.Current.LogicTextBlackColor, TextAlignment = TextAlignment.CenterLeft, - // Text = "鏃舵晥鎬у父寮�璁剧疆", - TextID=MyInternationalizationString.timeSetSone, + // Text = "鏃舵晥鎬у父寮�璁剧疆", + TextID = MyInternationalizationString.timeSetSone, }; modeFl.AddChidren(modeTextBtn); ///涓嬩竴绾ц彍鍗曞浘鏍囨帶浠� @@ -170,20 +199,54 @@ }; modeFl.AddChidren(nextIconBtn); - var clickBtn = new Button - { - Y = Application.GetRealHeight(478), - X = Application.GetRealWidth(58), - Height = Application.GetRealHeight(138), - Width = Application.GetRealWidth(1022), - }; - modeFl.AddChidren(clickBtn); - clickBtn.MouseUpEventHandler += async (sender, e) => - { - var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock); - }; + nextIconBtn.MouseUpEventHandler += (sender, e) => + { + LogicView.TipView.ShowConfrimTip(() => + {///鍐嶆纭 + LogicView.TipView.ShowInputTip(true, async (str) => + {///纭鍙戦�佸懡浠� + try + { + ///xm + var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); + if (!result) + { + Application.RunOnMainThread(() => + { + ///鎻愮ず澶辫触 + }); + return; + } + else + { + ///鍥犱负鏈夊父寮�妯″紡涓嬫墠鍙互鍒涘缓澶辨晥閫昏緫锛� + SkipView.GetLogicAll();//鍒犻櫎涔嬪墠鎵�鏈夊け鏁堥�昏緫 + var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//娣诲姞涓�鏉″け鏁堥�昏緫 + if (!addResult) + { + ///鎻愮ず澶辫触 + return; + } + Send.CurrentDoorLock.IsDoorLockNormallyMode = true; + this.RemoveFromParent(); + var soneLogicList = new SoneLogicList(); + UserView.HomePage.Instance.AddChidren(soneLogicList); + UserView.HomePage.Instance.PageIndex += 1; + soneLogicList.Show(); + + } + } + catch + { + + } + }); + + }); + + }; } #endregion @@ -234,7 +297,7 @@ addLogicfL.AddChidren(addIconBtn); addIconBtn.MouseUpEventHandler += (sender, e) => { - + //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� var h = DateTime.Now.ToString("HH"); -- Gitblit v1.8.0