From ee888ab45a850245b1e1372375ba9040316086ab Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 30 四月 2020 18:05:34 +0800
Subject: [PATCH] 2020-04-30
---
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 169 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 136 insertions(+), 33 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
index 57a5a58..ae7f8e6 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
@@ -8,12 +8,31 @@
{
public class SoneLogicList : FrameLayout
{
+ /// <summary>
+ /// 缁橲one闂ㄩ攣寰愭鏇存柊鐣岄潰鐢ㄧ殑
+ /// </summary>
+ ///
public SoneLogicList()
{
Tag = "SoneLogic";
}
- public async void Show()
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="action">缁欏緪姊呭埛鏂扮晫闈㈢敤鐨�</param>
+ /// <param name="bool_If"></param>
+ public async void Show(Action action, bool bool_If = false)
{
+ #region 寰愭鍙繖鏍峰仛鐨�
+ string key = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint;
+ if (Send.CurrentDoorLock.IsDoorLockNormallyMode.ContainsKey(key))
+ {
+ if (Send.CurrentDoorLock.IsDoorLockNormallyMode[key] == true)
+ {
+ bool_If = true;
+ }
+ }
+ #endregion
#region 鐣岄潰鐨勫竷灞�浠g爜
UserView.HomePage.Instance.ScrollEnabled = false;//閿佷綇宸︽粦
TopView view = new TopView();
@@ -22,7 +41,13 @@
view.clickBtn.MouseDownEventHandler += (sender, e) =>
{
UserView.HomePage.Instance.ScrollEnabled = true;
+ if (action != null)
+ {
+ action();
+ }
+
RemoveFromParent();
+
};
var middle = new FrameLayout
@@ -54,10 +79,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,26 +108,52 @@
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);
- this.RemoveFromParent();
- var soneLogicList = new SoneLogicList();
- UserView.HomePage.Instance.AddChidren(soneLogicList);
- UserView.HomePage.Instance.PageIndex += 1;
- soneLogicList.Show();
+
+ Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock, action);
+
+ Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.LogicAction += (d) => {
+ this.RemoveFromParent();
+ var soneLogicList = new SoneLogicList();
+ UserView.HomePage.Instance.AddChidren(soneLogicList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ soneLogicList.Show(() => { }, false);
+
+ };
+
+ /////xm
+ //var result = await SkipView.OpenMode(false, Send.CurrentDoorLock);
+ //if (result)
+ //{
+ // if (logic != null)
+ // {
+ // ///鏈夊彲鑳藉彧鏈夊父寮�妯″紡锛屾病鏈夋椂鏁堟�ц嚜鍔ㄥ寲
+ // ///娌℃湁鍒ゆ柇鐨勮瘽锛岄�昏緫浼氫负绌猴紝鎶涘嚭寮傚父;
+ // Send.DelLogic(logic.LogicId);
+ // }
+ // this.RemoveFromParent();
+ // var soneLogicList = new SoneLogicList();
+ // UserView.HomePage.Instance.AddChidren(soneLogicList);
+ // UserView.HomePage.Instance.PageIndex += 1;
+ // soneLogicList.Show(()=>{ },false);
+ //}
+ //else {
+ // ///鎻愮ず澶辫触
+ //}
+
};
};
///鏄剧ず澶辨晥璁剧疆鏃堕棿鏂囨湰鎺т欢
- var timeTextBtn= new Button
+ var timeTextBtn = new Button
{
Y = Application.GetRealHeight(127 + 69),
X = Application.GetRealWidth(225),
@@ -111,19 +163,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 +211,8 @@
TextSize = 15,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
TextAlignment = TextAlignment.CenterLeft,
- // Text = "鏃舵晥鎬у父寮�璁剧疆",
- TextID=MyInternationalizationString.timeSetSone,
+ // Text = "鏃舵晥鎬у父寮�璁剧疆",
+ TextID = MyInternationalizationString.timeSetSone,
};
modeFl.AddChidren(modeTextBtn);
///涓嬩竴绾ц彍鍗曞浘鏍囨帶浠�
@@ -170,20 +226,67 @@
};
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);
+
+ nextIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
- clickBtn.MouseUpEventHandler += async (sender, e) =>
- {
- var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock);
- };
+ Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog(Send.CurrentDoorLock, action);
+ Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.LogicAction += (d) => {
+ this.RemoveFromParent();
+ var soneLogicList = new SoneLogicList();
+ UserView.HomePage.Instance.AddChidren(soneLogicList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ soneLogicList.Show(() => { }, true);
+
+ };
+ #region
+ /*
+ LogicView.TipView.ShowConfrimTip(() =>
+ {///鍐嶆纭
+ LogicView.TipView.ShowInputTip(true, async (str) =>
+ {///纭鍙戦�佸懡浠�
+ try
+ {
+ ///xm
+ var result = await SkipView.OpenMode(true,Send.CurrentDoorLock);
+ if (!result)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ ///鎻愮ず澶辫触
+ });
+ return;
+ }
+ else
+ {
+ ///鍥犱负鏈夊父寮�妯″紡涓嬫墠鍙互鍒涘缓澶辨晥閫昏緫锛�
+ SkipView.GetLogicAll();//鍒犻櫎涔嬪墠鎵�鏈夊け鏁堥�昏緫
+ var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//娣诲姞涓�鏉″け鏁堥�昏緫
+ if (!addResult)
+ {
+ ///鎻愮ず澶辫触
+ return;
+ }
+ this.RemoveFromParent();
+ var soneLogicList = new SoneLogicList();
+ UserView.HomePage.Instance.AddChidren(soneLogicList);
+ UserView.HomePage.Instance.PageIndex += 1;
+ soneLogicList.Show(() => { }, true);
+
+ }
+ }
+ catch
+ {
+
+ }
+ });
+
+ });
+ */
+
+ #endregion
+ };
}
#endregion
@@ -234,7 +337,7 @@
addLogicfL.AddChidren(addIconBtn);
addIconBtn.MouseUpEventHandler += (sender, e) =>
{
-
+
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
var h = DateTime.Now.ToString("HH");
--
Gitblit v1.8.0