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/Safety/SafetyManagementMainForm.cs | 106 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 80 insertions(+), 26 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
index 47ea583..437df5b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs
@@ -52,11 +52,9 @@
{
//娓呯┖bodyFrame
this.ClearBodyFrame();
- if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
- {
- //鍒濆鍖栧彸涓婅鍥炬爣
- this.InitTopRightIcon();
- }
+
+ //鍒濆鍖栧彸涓婅鍥炬爣
+ this.InitTopRightIcon();
//鍒濆鍖栧叏閮ㄥ唴瀛樹俊鎭�
this.InitAllMemoryData();
@@ -168,28 +166,84 @@
/// </summary>
private void InitTopRightIcon()
{
- var btnIcon = new MostRightIconControl(69, 69);
- btnIcon.UnSelectedImagePath = "Item/More.png";
- topFrameLayout.AddChidren(btnIcon);
- btnIcon.InitControl();
- btnIcon.ButtonClickEvent += (sender, e) =>
+ //蹇嵎鏂瑰紡
+ var btnShortCut = new MostRightIconControl(69, 69);
+ btnShortCut.UnSelectedImagePath = "Safeguard/SafetyShortcut.png";
+ btnShortCut.SelectedImagePath = "Safeguard/SafetyShortcutSelected.png";
+
+ if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
{
- //鑿滃崟鎺т欢
- var frameMenu = new TopRightMenuControl(2);
- //闃插尯鍒楄〃
- string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
- frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
+ //蹇嵎鏂瑰紡鍚戝乏绉诲姩
+ btnShortCut.X = Application.GetRealWidth(855);
+
+ var btnIcon = new MostRightIconControl(69, 69);
+ btnIcon.UnSelectedImagePath = "Item/More.png";
+ topFrameLayout.AddChidren(btnIcon);
+ btnIcon.InitControl();
+ btnIcon.ButtonClickEvent += (sender, e) =>
{
- var form = new GarrisonAreaListMenuForm();
- form.AddForm();
- });
- //瀵嗙爜璁剧疆
- string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
- frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
+ //鑿滃崟鎺т欢
+ var frameMenu = new TopRightMenuControl(2);
+ //闃插尯鍒楄〃
+ string menu1 = Language.StringByID(R.MyInternationalizationString.uGarrisonAreaList);
+ frameMenu.AddRowMenu(menu1, "Item/GarrisonList.png", "Item/GarrisonListSelected.png", () =>
+ {
+ HdlCheckLogic.Current.CheckSecondarySecurity(() =>
+ {
+ //楠岃瘉鎴愬姛
+ var form = new GarrisonAreaListMenuForm();
+ form.AddForm();
+ },
+ () =>
+ {
+ //璇峰墠寰�涓汉涓績{0}璁剧疆浜屾瀹夊叏楠岃瘉鏂瑰紡
+ string msg = Language.StringByID(R.MyInternationalizationString.uGotoCenterAndSetSecondAuthentication).Replace("{0}", "\r\n");
+ this.ShowMassage(ShowMsgType.Confirm, msg, () =>
+ {
+ var form = new UserMain.SecondAuthenticationForm();
+ form.AddForm();
+ });
+ });
+ });
+ //瀵嗙爜璁剧疆
+ string menu2 = Language.StringByID(R.MyInternationalizationString.uPasswordSettion);
+ frameMenu.AddRowMenu(menu2, "Item/PswSettion.png", "Item/PswSettionSelected.png", () =>
+ {
+ var form = new PasswordMenuForm();
+ form.AddForm();
+ });
+ };
+ }
+
+ topFrameLayout.AddChidren(btnShortCut);
+ btnShortCut.InitControl();
+ if (UserCenterResourse.Option.SafetyShortcut == true)
+ {
+ //浣跨敤蹇嵎鏂瑰紡
+ btnShortCut.IsSelected = true;
+ }
+ btnShortCut.ButtonClickEvent += (sender, e) =>
+ {
+ if (btnShortCut.IsSelected == true)
{
- var form = new SafetyPasswordMenuForm();
- form.AddForm();
- });
+ //纭畾鍙栨秷涓婚〉鐨勩�屽畨闃层�嶆嵎寰勶紵
+ this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCancelSafetyShortcutMsg), () =>
+ {
+ UserCenterResourse.Option.SafetyShortcut = false;
+ UserCenterResourse.Option.Save();
+ btnShortCut.IsSelected = false;
+ });
+ }
+ else
+ {
+ //纭畾鍒涘缓銆屽畨闃层�嶆嵎寰勫埌涓婚〉锛�
+ this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uCreatSafetyShortcutMsg), () =>
+ {
+ UserCenterResourse.Option.SafetyShortcut = true;
+ UserCenterResourse.Option.Save();
+ btnShortCut.IsSelected = true;
+ });
+ }
};
}
@@ -456,7 +510,7 @@
oldGetOnlineTime = DateTime.Now;
//浠庤澶囧垪琛ㄤ腑鑾峰彇鍦ㄧ嚎鐘舵��
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//棣栧厛鑾峰彇杩欎簺浼犳劅鍣ㄦ墍鍦ㄧ殑缃戝叧
var listWay = new List<ZbGateway>();
@@ -477,7 +531,7 @@
//鐣岄潰鍏抽棴
return;
}
- await Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
+ Common.LocalDevice.Current.GetDeviceListFromGateway(zbway, false, this.ReceiveDeviceStatuPush, ShowErrorMode.NO);
}
});
}
--
Gitblit v1.8.0