From 679c2a4c459c7ad0e9f727ad4196c0754716c28f Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 08 四月 2020 11:39:20 +0800
Subject: [PATCH] 2020-04-08-1
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 187 +++++++++++++++++++++++++---------------------
1 files changed, 100 insertions(+), 87 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
index 1a1a47d..08dbd3b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -247,7 +247,7 @@
DateTime oldTime = DateTime.MaxValue;
doorDialog.dialogBtnConfirm.MouseUpEventHandler += async (sender1, e1) =>
{
- Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); });
if (DateTime.Now < ZigBee.Device.DoorLock.minValue)
{
CommonPage.Loading.Hide();
@@ -296,7 +296,7 @@
{
btnNext.IsSelected = true;
}
- if (!UserCenterResourse.Option.DoorUnLockByRemote)
+ if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
{
string msg = Language.StringByID(R.MyInternationalizationString.RemoteUnlockBindSucessTip).Replace("{0}", "\r\n");
var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.GoSetting));
@@ -355,6 +355,52 @@
}
/// <summary>
+ /// 缁戝畾杩滅▼寮�閿佹潈闄愮獥鍙�
+ /// </summary>
+ /// <param name="doorLock"></param>
+ /// <param name="btnDoorLockTitle"></param>
+ public void BindRemoteUnlockDoorlock(ZigBee.Device.DoorLock doorLock, Button btnDoorLockTitle = null)
+ {
+ string msgRemoteUnlockRequest = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock);
+ var alertRemoteUnlockRequest = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgRemoteUnlockRequest, Language.StringByID(R.MyInternationalizationString.GoSetting));
+ alertRemoteUnlockRequest.Show();
+ //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
+ alertRemoteUnlockRequest.ConfirmClickEvent += () =>
+ {
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
+ Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ };
+ };
+ }
+
+ /// <summary>
+ /// 绯荤粺浜屾纭绐楀彛
+ /// </summary>
+ public void SystemSecondAuthentication()
+ {
+ string msgDoorUnLockByRemote = Language.StringByID(R.MyInternationalizationString.GoPersonalCenter).Replace("{0}", "\r\n");
+ var alertDoorUnLockByRemote = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgDoorUnLockByRemote, Language.StringByID(R.MyInternationalizationString.GoSetting));
+ alertDoorUnLockByRemote.Show();
+ //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
+ alertDoorUnLockByRemote.ConfirmClickEvent += () =>
+ {
+ var form = new UserCenter.UserMain.SecondAuthenticationForm();
+ form.AddForm();
+ };
+ }
+
+ /// <summary>
/// 杩滅▼寮�閿佽姹�
/// </summary>
/// <param name="doorLock">闂ㄩ攣璁惧</param>
@@ -365,41 +411,13 @@
{
if (string.IsNullOrEmpty(doorLock.RemoteUnlockPassword))
{
- string msgRemoteUnlockRequest = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock);
- var alertRemoteUnlockRequest = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgRemoteUnlockRequest, Language.StringByID(R.MyInternationalizationString.GoSetting));
- alertRemoteUnlockRequest.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alertRemoteUnlockRequest.ConfirmClickEvent += () =>
- {
- var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
- Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- functionSetting.Show();
- functionSetting.devicNameAction += (deviceRename) =>
- {
- if (!string.IsNullOrEmpty(deviceRename))
- {
- if (btnDoorLockTitle != null)
- {
- btnDoorLockTitle.Text = deviceRename;
- }
- }
- };
- };
+ BindRemoteUnlockDoorlock(doorLock, btnDoorLockTitle);
return;
}
- if (!UserCenterResourse.Option.DoorUnLockByRemote)
+ if (!UserCenterResourse.AccountOption.DoorUnLockByRemote)
{
- string msgDoorUnLockByRemote = Language.StringByID(R.MyInternationalizationString.GoPersonalCenter).Replace("{0}", "\r\n");
- var alertDoorUnLockByRemote = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msgDoorUnLockByRemote, Language.StringByID(R.MyInternationalizationString.GoSetting));
- alertDoorUnLockByRemote.Show();
- //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁�
- alertDoorUnLockByRemote.ConfirmClickEvent += () =>
- {
- var form = new UserCenter.UserMain.SecondAuthenticationForm();
- form.AddForm();
- };
+ SystemSecondAuthentication();
return;
}
@@ -434,7 +452,8 @@
});
//杩滅▼寮�閿�
var remoteControlResult = await doorLock.RemoteControlAsync(doorLock.RemoteUnlockPassword);
- //寮�閿佹垚鍔燂紝杩斿洖榛樿鍝嶅簲
+
+ //杩滅▼寮�閿佹垚鍔燂紝杩斿洖榛樿鍝嶅簲
if (remoteControlResult != null && remoteControlResult.responseData != null)
{
if (remoteControlResult.responseData.status == 0)
@@ -444,80 +463,47 @@
{
if (progressButton != null)
{
- progressButton.Y = Application.GetRealHeight(347);
+ progressButton.Y = Application.GetRealHeight(10);
}
if (btnDoorLockPic != null)
{
- btnDoorLockPic.IsSelected = false;
+ btnDoorLockPic.IsSelected = true;
}
if (btnStatus != null)
{
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.DoorLockOpen);
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockSuccess), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
}
});
+ //寮�閿佹垚鍔燂紝榛樿5绉掑悗闂ㄩ攣鑷姩鍏抽攣锛屾牴鎹笉鍚岀殑闂ㄩ攣鍙兘鏃堕棿涓嶅悓锛岃繖閲屼互鈥淗06C鈥濋棬閿佺粰鐨勬椂闂�
System.Threading.Thread.Sleep(5000);
}
else
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
}
+ //鐢ㄤ簬杩滅▼寮�閿佺殑闂ㄩ攣涓殑瀵嗙爜琚垹闄ゆ儏鍐�
else if (remoteControlResult != null && remoteControlResult.IsPawDispear == true)
{
+ //杩滅▼寮�閿佹湁3娆¤繛缁搷浣滃け璐ョ殑鏈轰細
ZigBee.Device.DoorLock.failedCount--;
if (ZigBee.Device.DoorLock.failedCount != 0)
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnlockFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
else
{
+ //3娆℃搷浣滃け璐ヨ繙绋嬪紑閿佸け璐ュ悗锛岄噸鍐欒缃繙绋嬪紑閿佸瘑鐮�
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.DoorlockPasswordDispear), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
- CommonPage.Loading.Hide();
doorLock.RemoteUnlockPassword = "";
var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
@@ -536,22 +522,11 @@
});
}
}
+ //杩滅▼寮�閿佸け璐ョ殑鎯呭喌
else
{
Application.RunOnMainThread(() =>
{
- if (progressButton != null)
- {
- progressButton.Y = Application.GetRealHeight(347);
- }
- if (btnDoorLockPic != null)
- {
- btnDoorLockPic.IsSelected = false;
- }
- if (btnStatus != null)
- {
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
- }
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
});
}
@@ -561,9 +536,17 @@
{
Application.RunOnMainThread(() =>
{
+ if (progressButton != null)
+ {
+ progressButton.Y = Application.GetRealHeight(347);
+ }
+ if (btnDoorLockPic != null)
+ {
+ btnDoorLockPic.IsSelected = false;
+ }
if (btnStatus != null)
{
- btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose);
+ btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Current) + Language.StringByID(R.MyInternationalizationString.CLose);
}
CommonPage.Loading.Hide();
});
@@ -626,5 +609,35 @@
}
}
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鏄剧ず閿欒淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ public void ShowErrorMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Error, msg);
+ contr.Show();
+ });
+ }
+
+ /// <summary>
+ /// 鏄剧ずTip淇℃伅绐楀彛
+ /// </summary>
+ /// <param name="msg"></param>
+ public void ShowTipMsg(string msg)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ var contr = new ShowMsgControl(ShowMsgType.Tip, msg);
+ contr.Show();
+ CommonPage.Loading.Hide();
+ });
+ }
+
+ #endregion
}
}
--
Gitblit v1.8.0