From 7b60238359b94125d591678eff105ae2bf47843f Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 15 十一月 2019 13:16:21 +0800
Subject: [PATCH] 2019.11.15
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs | 72 +++++++++++++++++++++++++-----------
1 files changed, 50 insertions(+), 22 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
index b6ddc9d..bb7014c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
@@ -40,7 +40,7 @@
{
currentTitle = Language.StringByID(R.MyInternationalizationString.AddFingerprint);
}
- else
+ else if (currentType == "proximity")
{
currentTitle = Language.StringByID(R.MyInternationalizationString.AddIcCard);
}
@@ -48,11 +48,6 @@
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
{
- if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
- {
- doorLock.Gateway.GwResDataAction -= action;
- }
-
this.RemoveFromParent();
};
this.btnBack.MouseUpEventHandler += eHandlerBack;
@@ -60,6 +55,19 @@
this.MidFrameLayout(this);
MidFrameLayoutContent();
+ }
+
+ /// <summary>
+ /// 閲嶅啓绉婚櫎鏂规硶
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ ZbGateway.StatusList.Remove(this);
+ if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
+ {
+ doorLock.Gateway.GwResDataAction -= action;
+ }
+ base.RemoveFromParent();
}
public void MidFrameLayoutContent()
@@ -126,7 +134,7 @@
X = Application.GetRealWidth(202),
Y = Application.GetRealHeight(1388),
Height = Application.GetRealHeight(49),
- Width = Application.GetRealWidth(674),
+ Width = Application.GetRealWidth(685),
TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
Gravity = Gravity.CenterHorizontal,
TextSize = 12,
@@ -139,7 +147,7 @@
Y = Application.GetRealHeight(1472),
Height = Application.GetRealHeight(127),
Width = Application.GetRealWidth(907),
- Text = Language.StringByID(R.MyInternationalizationString.NextStep),
+ Text = Language.StringByID(R.MyInternationalizationString.NextStepXm),
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
Gravity = Gravity.CenterHorizontal,
Radius = 10,
@@ -178,7 +186,7 @@
btnPicTip1.X = Application.GetRealWidth(450);
btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip);
}
- else
+ else if (currentType == "proximity")
{
topMidFrameLayout.BackgroundImagePath = "DoorLock/AddIcCardTipPic.png";
btnPicTip3.Width = Application.GetRealWidth(495);
@@ -214,21 +222,41 @@
var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jObjectdata["Data"].ToString());
if (ProgrammingEventNotificationData != null)
{
- doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData;
- var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
- localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID;
- localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure;
- var entryTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(ProgrammingEventNotificationData.ZigbeeLocalTime);
- localDoorLockObj.EntryTime = entryTime;
- if (!doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj.UserID))
+ int curMethod = -1;
+ if (currentType == "password")
{
- doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj);
+ curMethod = 0;
}
- Application.RunOnMainThread(() =>
+ else if (currentType == "fingerprint")
{
- nextBtn.Enable = true;
- nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- });
+ curMethod = 15;
+ }
+ else if (currentType == "proximity")
+ {
+ curMethod = 3;
+ }
+ else
+ {
+ return;
+ }
+ if (ProgrammingEventNotificationData.ProgramEventSoure == curMethod)
+ {
+ doorLock.doorLockProgrammingEventNotificationCommand = ProgrammingEventNotificationData;
+ var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
+ localDoorLockObj.UserID = ProgrammingEventNotificationData.UserID;
+ localDoorLockObj.UnlockType = ProgrammingEventNotificationData.ProgramEventSoure;
+ localDoorLockObj.EntryTime = System.DateTime.Now;
+ //鍏堟殏鏃跺姞鍏ワ紝绛変簯绔坊鍔犲拰鑾峰彇鐪熸鎴愬姛鍚庢墠鐪熺殑鍔犲叆
+ if (!doorLock.localDoorLockUserList.ContainsKey(localDoorLockObj.UserID))
+ {
+ doorLock.localDoorLockUserList.Add(ProgrammingEventNotificationData.UserID, localDoorLockObj);
+ }
+ Application.RunOnMainThread(() =>
+ {
+ nextBtn.Enable = true;
+ nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ });
+ }
}
}
};
@@ -240,11 +268,11 @@
nextBtn.MouseDownEventHandler += (sende, e) =>
{
+ this.RemoveFromParent();
var entryStatusPage = new Shared.Phone.UserCenter.DoorLock.EntryStatusPage(doorLock, curAccountObj, currentType);
Shared.Phone.UserView.HomePage.Instance.AddChidren(entryStatusPage);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
entryStatusPage.Show();
- this.RemoveFromParent();
};
}
--
Gitblit v1.8.0