From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs | 205 +++++++++++++++++++++++++++++++++------------------
1 files changed, 132 insertions(+), 73 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
index 86e098e..1f5b154 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/AddUnLockMethodTip.cs
@@ -5,7 +5,7 @@
namespace Shared.Phone.UserCenter.DoorLock
{
- public class AddUnLockMethodTip : DoorLockCommonLayout, ZigBee.Common.IStatus
+ public class AddUnLockMethodTip : DoorLockCommonLayout
{
/// 鏋勯�犲嚱鏁�
/// </summary>
@@ -18,11 +18,23 @@
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
}
- #region 鈼� 鍙橀噺鐢虫槑__________________________
+ #region 鍙橀噺鐢虫槑
+ /// <summary>
+ /// 褰撳墠闂ㄩ攣
+ /// </summary>
ZigBee.Device.DoorLock doorLock;
+ /// <summary>
+ /// 褰撳墠璐︽埛
+ /// </summary>
Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
+ /// <summary>
+ /// 褰撳墠绫诲瀷
+ /// </summary>
string currentType = string.Empty;
- Action<string, string> action;//鎺ユ敹閫氱煡
+ /// <summary>
+ /// 鎺ユ敹閫氱煡
+ /// </summary>
+ Action<string, string> action;
#endregion
@@ -40,19 +52,22 @@
{
currentTitle = Language.StringByID(R.MyInternationalizationString.AddFingerprint);
}
- else
+ else if (currentType == "proximity")
{
currentTitle = Language.StringByID(R.MyInternationalizationString.AddIcCard);
+ }
+ else if (currentType == "faceID")
+ {
+ currentTitle = Language.StringByID(R.MyInternationalizationString.AddDoorLockFaceID);
+ }
+ else if (currentType == "calmFingerprint")
+ {
+ currentTitle = Language.StringByID(R.MyInternationalizationString.AddDoorLockCalmFingerprint);
}
this.TopFrameLayout(this, currentTitle);
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
{
- if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
- {
- doorLock.Gateway.GwResDataAction -= action;
- }
-
this.RemoveFromParent();
};
this.btnBack.MouseUpEventHandler += eHandlerBack;
@@ -62,6 +77,21 @@
MidFrameLayoutContent();
}
+ /// <summary>
+ /// 閲嶅啓绉婚櫎鏂规硶
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ if (doorLock.Gateway != null || doorLock.Gateway.GwResDataAction != null)
+ {
+ doorLock.Gateway.GwResDataAction -= action;
+ }
+ base.RemoveFromParent();
+ }
+
+ /// <summary>
+ /// 涓儴甯冨眬
+ /// </summary>
public void MidFrameLayoutContent()
{
var topMidFrameLayout = new FrameLayout
@@ -77,9 +107,9 @@
{
X = Application.GetRealWidth(446),
Y = Application.GetRealHeight(330),
- Height = Application.GetRealHeight(81 / 2),
+ Height = Application.GetRealHeight(80 / 2),
Width = Application.GetRealWidth(407),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
TextSize = 10,
TextAlignment = TextAlignment.CenterLeft,
};
@@ -88,10 +118,10 @@
var btnPicTip2 = new Button
{
X = Application.GetRealWidth(446),
- Y = btnPicTip1.Bottom,
- Height = Application.GetRealHeight(81 / 2),
+ Y = btnPicTip1.Y + Application.GetRealHeight(30),
+ Height = Application.GetRealHeight(76 / 2),
Width = Application.GetRealWidth(207),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
TextSize = 10,
TextAlignment = TextAlignment.CenterLeft,
};
@@ -101,9 +131,9 @@
{
X = Application.GetRealWidth(294),
Y = Application.GetRealHeight(1089),
- Height = Application.GetRealHeight(173 / 2),
+ Height = Application.GetRealHeight(100 / 2),
Width = Application.GetRealWidth(488),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
Gravity = Gravity.CenterHorizontal,
TextSize = 14,
};
@@ -112,10 +142,10 @@
var btnPicTip4 = new Button
{
X = Application.GetRealWidth(397),
- Y = btnPicTip3.Bottom,
+ Y = btnPicTip3.Y + Application.GetRealHeight(50),
Width = Application.GetRealWidth(288),
- Height = Application.GetRealHeight(173 / 2),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ Height = Application.GetRealHeight(100 / 2),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray2,
Gravity = Gravity.CenterHorizontal,
TextSize = 14,
};
@@ -126,8 +156,8 @@
X = Application.GetRealWidth(202),
Y = Application.GetRealHeight(1388),
Height = Application.GetRealHeight(49),
- Width = Application.GetRealWidth(674),
- TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ Width = Application.GetRealWidth(685),
+ TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
Gravity = Gravity.CenterHorizontal,
TextSize = 12,
};
@@ -139,11 +169,12 @@
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,
- TextSize = 20,
+ Radius = (uint)Application.GetRealHeight(127 / 2),
+ TextSize = 16,
+ IsBold = true,
Enable = false,
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect,
};
@@ -178,7 +209,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);
@@ -190,6 +221,41 @@
btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityCard);
btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryProximityTip2);
btnPicTip4.Text = btnPicTip2.Text;
+ btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip);
+ }
+ else if (currentType == "faceID")
+ {
+ topMidFrameLayout.BackgroundImagePath = "DoorLock/AddFaceIDTipPic.png";
+ topMidFrameLayout.X = Application.GetMinRealAverage(158);
+ topMidFrameLayout.Height = Application.GetMinRealAverage(789);
+ topMidFrameLayout.Width = Application.GetMinRealAverage(818);
+ btnPicTip2.Width = btnPicTip1.Width = Application.GetMinRealAverage(307);
+ btnPicTip3.Width = Application.GetMinRealAverage(576);
+ btnPicTip1.X = btnPicTip2.X = Application.GetMinRealAverage(420);
+ btnPicTip1.Y = Application.GetMinRealAverage(325);
+ btnPicTip2.Y = btnPicTip1.Y + Application.GetMinRealAverage(30);
+ btnPicTip3.Y = Application.GetMinRealAverage(1089);
+ btnPicTip4.Y = btnPicTip3.Y + Application.GetMinRealAverage(50);
+ btnPicTip3.X = Application.GetMinRealAverage(233);
+ btnPicTip4.X = Application.GetRealWidth(397 + 40);
+ btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryFaceIDTip1);
+ btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryFaceIDTip2);
+ btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryFaceIDTip3);
+ btnPicTip4.Text = Language.StringByID(R.MyInternationalizationString.EntryFaceIDTip4);
+ btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip);
+ }
+ else if (currentType == "calmFingerprint")
+ {
+ topMidFrameLayout.BackgroundImagePath = "DoorLock/AddFingerprintTipPic.png";
+ btnPicTip1.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip1);
+ btnPicTip2.Text = Language.StringByID(R.MyInternationalizationString.EntryCalmFingerprint);
+ btnPicTip3.Text = Language.StringByID(R.MyInternationalizationString.EntryFingerprintTip2);
+ btnPicTip4.Text = btnPicTip2.Text;
+ btnPicTip1.X = Application.GetRealWidth(486);
+ btnPicTip1.Y = Application.GetRealHeight(320);
+ btnPicTip2.X = Application.GetRealWidth(517);
+ btnPicTip2.Width = Application.GetRealWidth(207);
+ btnPicTip1.X = Application.GetRealWidth(450);
btnPicTip5.Text = Language.StringByID(R.MyInternationalizationString.EntryTip);
}
@@ -214,21 +280,49 @@
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 = ZigBee.Device.DoorLock.GetLocalTime(ProgrammingEventNotificationData.ZigbeeLocalTime, false);
- 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 == "proximity")
{
- nextBtn.Enable = true;
- nextBtn.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- });
+ curMethod = 3;
+ }
+ else if (currentType == "calmFingerprint")
+ {
+ curMethod = 13;
+ }
+ else if (currentType == "faceID")
+ {
+ curMethod = 14;
+ }
+ else if (currentType == "fingerprint")
+ {
+ curMethod = 15;
+ }
+ 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,47 +334,12 @@
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();
};
}
-
-
- #region 鈼� 鎺ュ彛瀹炵幇__________________________
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
- /// </summary>
- /// <returns>The changed.</returns>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
-
- }
- /// <summary>
- /// 澶勭悊鍙樺寲浜嬩欢
- /// </summary>
- /// <param name="common"></param>
- /// <param name="typeTag"></param>
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
- /// <summary>
- /// Changeds the IL ogic status.
- /// </summary>
- /// <param name="logic">Logic.</param>
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
- /// <summary>
- /// Changeds the IS cene status.
- /// </summary>
- /// <param name="scene">Scene.</param>
- public void ChangedISceneStatus(Scene scene)
- {
- }
- #endregion
}
}
--
Gitblit v1.8.0