From a1b0ab7044100daaa7e0f1da2d2ca45e38098963 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 29 三月 2021 09:13:25 +0800
Subject: [PATCH] 2021-3-29-2
---
HDL_ON/UI/BindingResidence/BindingResidencePage.cs | 129 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 119 insertions(+), 10 deletions(-)
diff --git a/HDL_ON/UI/BindingResidence/BindingResidencePage.cs b/HDL_ON/UI/BindingResidence/BindingResidencePage.cs
index 94abbbe..601d6d5 100644
--- a/HDL_ON/UI/BindingResidence/BindingResidencePage.cs
+++ b/HDL_ON/UI/BindingResidence/BindingResidencePage.cs
@@ -91,15 +91,10 @@
btnAddNewResidence.MouseUpEventHandler = (sender, e) =>
{
- Action<string> action = (str) => {
- Application.RunOnMainThread(() => {
- var pm = new DAL.Server.HttpServerRequest();
- pm.BindingResidence(str);
- });
- };
Scan.OpenScan((scanString) =>
{
- action(scanString);
+ //鎵ц缁戝畾浣忓畢
+ this.DoBindResidence(scanString);
});
};
@@ -108,13 +103,127 @@
//鎴戠殑浜岀淮鐮�
var page = new MyQRCodePage();
AddChidren(page);
- page.LoadPage();
- //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ page.LoadPage(true);
};
btnLogout.MouseUpEventHandler = (sender, e) =>
{
- MainPage.GoLoginPage(UserInfo.Current);
+ HDLCommon.Current.Logout();
+ };
+ }
+
+ /// <summary>
+ /// 鎵ц缁戝畾浣忓畢
+ /// </summary>
+ private void DoBindResidence(string scanString)
+ {
+ var pm = new DAL.Server.HttpServerRequest();
+ var result = pm.BindingResidence(scanString);
+ if (result == null) { return; }
+
+ if (result.Code == DAL.Server.StateCode.SUCCESS)
+ {
+ //璋冪敤On鍘熸潵鐨勬柟娉�,鍒锋柊浣忓畢鍒楄〃鍙婂叾缂撳瓨
+ pm.GetHomePager();
+ //璺宠浆椤甸潰----
+ MainPage.GoUserPage(true, false, () =>
+ {
+ //鏄剧ず娆㈣繋鍥炲鐨勫脊绐楃晫闈�
+ var form = new WellcomToHomeForm();
+ form.ShowForm();
+ });
+ }
+ //鍏朵粬鎯呭喌鍏ㄩ儴鎻愮ず澶辨晥
+ else
+ {
+ //鏄剧ず浜岀淮鐮佸凡缁忚繃鏈熺殑寮圭獥
+ this.ShowQrCodeTimeOutView();
+ }
+ }
+
+ /// <summary>
+ /// 鏄剧ず浜岀淮鐮佸凡缁忚繃鏈熺殑寮圭獥
+ /// </summary>
+ private void ShowQrCodeTimeOutView()
+ {
+ //鏁翠釜鐣岄潰鐨勭伆鑹茶儗鏅�
+ var frameBack = new Dialog();
+ frameBack.Show();
+
+ //涓棿鐧借壊鍖哄煙
+ var frameWite = new FrameLayout();
+ frameWite.Y = Application.GetRealHeight(223);
+ frameWite.Height = Application.GetRealHeight(245);
+ frameWite.Width = Application.GetRealWidth(288);
+ frameWite.BackgroundColor = CSS.CSS_Color.MainBackgroundColor;
+ frameWite.Radius = (uint)Application.GetRealWidth(12);
+ frameWite.Gravity = Gravity.CenterHorizontal;
+ frameBack.AddChidren(frameWite);
+
+ //Icon鍥炬爣
+ var picIcon = new Button();
+ picIcon.Y = Application.GetRealHeight(152);
+ picIcon.Height = Application.GetRealWidth(160);
+ picIcon.Width = Application.GetRealWidth(160);
+ picIcon.Gravity = Gravity.CenterHorizontal;
+ picIcon.UnSelectedImagePath = "ErrorIcon.png";
+ frameBack.AddChidren(picIcon);
+
+ //浜岀淮鐮佸け鏁堬紝璇烽噸璇�
+ var btnText = new Button();
+ btnText.Y = Application.GetRealHeight(98);
+ btnText.Height = Application.GetRealHeight(24);
+ btnText.TextSize = 16;
+ btnText.TextAlignment = TextAlignment.Center;
+ btnText.TextColor = CSS.CSS_Color.FirstLevelTitleColor;
+ btnText.TextID = StringId.QRCodeIsInvalid;
+ frameWite.AddChidren(btnText);
+
+ //鍙栨秷
+ var btnCancel = new Button();
+ btnCancel.X = Application.GetRealWidth(30);
+ btnCancel.Y = btnText.Bottom + Application.GetRealHeight(48);
+ btnCancel.Height = Application.GetRealHeight(44);
+ btnCancel.Width = Application.GetRealWidth(108);
+ btnCancel.TextSize = 16;
+ btnCancel.IsBold = true;
+ btnCancel.TextAlignment = TextAlignment.Center;
+ btnCancel.TextColor = CSS.CSS_Color.MainColor;
+ btnCancel.BackgroundColor = CSS.CSS_Color.MainBackgroundColor;
+ btnCancel.Radius = (uint)Application.GetRealHeight(22);
+ btnCancel.TextID = StringId.Cancel;
+ btnCancel.BorderWidth = 1;
+ btnCancel.BorderColor = CSS.CSS_Color.MainColor;
+ frameWite.AddChidren(btnCancel);
+
+ btnCancel.MouseUpEventHandler += (sender, e) =>
+ {
+ frameBack.Close();
+ };
+
+ //閲嶈瘯
+ var btnRedo = new Button();
+ btnRedo.Y = btnText.Bottom + Application.GetRealHeight(48);
+ btnRedo.Height = Application.GetRealHeight(44);
+ btnRedo.Width = Application.GetRealWidth(108);
+ btnRedo.TextSize = 16;
+ btnRedo.IsBold = true;
+ btnRedo.TextAlignment = TextAlignment.Center;
+ btnRedo.TextColor = CSS.CSS_Color.MainBackgroundColor;
+ btnRedo.BackgroundColor = CSS.CSS_Color.MainColor;
+ btnRedo.Radius = (uint)Application.GetRealHeight(22);
+ btnRedo.TextID = StringId.Retry;
+ frameWite.AddChidren(btnRedo);
+ btnRedo.X = frameWite.Width - btnRedo.Width - Application.GetRealWidth(30);
+
+ btnRedo.MouseUpEventHandler += (sender, e) =>
+ {
+ Scan.OpenScan((scanString) =>
+ {
+ frameBack.Close();
+ //鎵ц缁戝畾浣忓畢
+ this.DoBindResidence(scanString);
+ });
};
}
}
--
Gitblit v1.8.0