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/EntryStatusPage.cs | 97 ++++++++++++++++++++++++++++++++++--------------
1 files changed, 68 insertions(+), 29 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
index ed813a1..053522c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs
@@ -26,7 +26,6 @@
Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
string currentType = string.Empty;
FrameLayout bottomFrameLayout;
-
#endregion
/// <summary>
@@ -169,7 +168,6 @@
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
TextAlignment = TextAlignment.CenterLeft,
TextSize = 14,
- Text = curAccountObj.UserName,
};
personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonContent);
@@ -203,11 +201,29 @@
btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.ProximityRemark);
btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.ProximityCard) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID;
}
+ if (curAccountObj.UserName != "" && curAccountObj.UserName != null)
+ {
+ btnMatchPersonContent.Text = curAccountObj.UserName;
+ }
+ else
+ {
+ btnMatchPersonContent.Text = curAccountObj.Account;
+ }
completeBtn.MouseDownEventHandler += async (sender, e) =>
{
completeBtn.Enable = false;
+ if (doorLock.doorLockProgrammingEventNotificationCommand == null)
+ {
+ return;
+ }
var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData();
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
+ addLockInfo.IsOtherAccountCtrl = true;
+ }
+
addLockInfo.CloudAccountId = curAccountObj.SubAccountDistributedMark;
if (doorLock.DeviceAddr != null)
{
@@ -215,8 +231,7 @@
}
addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure;
addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString();
- var entryTime = ZigBee.Device.DoorLock.GetLocalTime(doorLock.doorLockProgrammingEventNotificationCommand.ZigbeeLocalTime, false);
- addLockInfo.EntryTime = entryTime;
+ addLockInfo.EntryTime = System.DateTime.Now;
if (btnPasswordRemarkContent.Text != "")
{
addLockInfo.UserIdRemarks = btnPasswordRemarkContent.Text;
@@ -227,47 +242,72 @@
}
try
{
- var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("App/AddDoorLock", addLockInfo);
- if (result.StateCode == "Success")
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo);
+ if (result != null)
{
- if (doorLock.localDoorLockUserList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID))
+ if (result.StateCode == "Success")
{
- doorLock.localDoorLockUserList.Remove(doorLock.doorLockProgrammingEventNotificationCommand.UserID);
-
- var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
- localDoorLockObj.UserID = doorLock.doorLockProgrammingEventNotificationCommand.UserID;
- localDoorLockObj.UnlockType = addLockInfo.OpenLockMode;
- localDoorLockObj.EntryTime = addLockInfo.EntryTime;
- localDoorLockObj.UserName = addLockInfo.UserIdRemarks;
- localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
- doorLock.localDoorLockUserList.Add(doorLock.doorLockProgrammingEventNotificationCommand.UserID, localDoorLockObj);
-
- completeBtn.Enable = true;
- this.RemoveFromParent();
-
- for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--)
+ if (doorLock.localDoorLockUserList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID))
{
- var form = UserView.HomePage.Instance.GetChildren(i);
-
- if (form is UnLockMethod)
+ //瀛橀棬閿佷俊鎭�
+ var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountObj.SubAccountDistributedMark);
+ if (resultList != null)
{
- ((UnLockMethod)form).RefreshList();
- break;
+ if (resultList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID) == true)
+ {
+ var a = resultList[doorLock.doorLockProgrammingEventNotificationCommand.UserID];
+ if (a?.ConnectedAccount == curAccountObj.SubAccountDistributedMark)
+ {
+ completeBtn.Enable = true;
+ this.RemoveFromParent();
+ for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--)
+ {
+ var form = UserView.HomePage.Instance.GetChildren(i);
+
+ if (form is UnLockMethod)
+ {
+ ((UnLockMethod)form).RefreshList();
+ break;
+ }
+ else
+ {
+ form.RemoveFromParent();
+ }
+ }
+ }
+ else
+ {
+ completeBtn.Enable = true;
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+ }
+ }
}
else
{
- form.RemoveFromParent();
+ completeBtn.Enable = true;
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
}
+
}
+ }
+ else
+ {
+ completeBtn.Enable = true;
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AddFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
}
}
else
{
completeBtn.Enable = true;
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent);
}
}
catch { }
+ finally
+ {
+ CommonPage.Loading.Hide();
+ }
};
}
@@ -376,7 +416,6 @@
Height = Application.GetRealHeight(58),
X = Application.GetRealWidth(81),
Y = Application.GetRealHeight(37),
- Text = "Krafty",
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
TextSize = 14,
TextAlignment = TextAlignment.CenterLeft,
--
Gitblit v1.8.0