From 1a13c963a5fb8cad92bf03667e411f46d6a6a843 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 17 十二月 2020 15:10:33 +0800 Subject: [PATCH] Revert "Merge branch 'tzy' into NewFilePath" --- HDL_ON/UI/BindingResidence/BindingResidencePage.cs | 124 ++--------------------------------------- 1 files changed, 7 insertions(+), 117 deletions(-) diff --git a/HDL_ON/UI/BindingResidence/BindingResidencePage.cs b/HDL_ON/UI/BindingResidence/BindingResidencePage.cs index 92e3bfe..94abbbe 100644 --- a/HDL_ON/UI/BindingResidence/BindingResidencePage.cs +++ b/HDL_ON/UI/BindingResidence/BindingResidencePage.cs @@ -91,10 +91,15 @@ btnAddNewResidence.MouseUpEventHandler = (sender, e) => { + Action<string> action = (str) => { + Application.RunOnMainThread(() => { + var pm = new DAL.Server.HttpServerRequest(); + pm.BindingResidence(str); + }); + }; Scan.OpenScan((scanString) => { - //鎵ц缁戝畾浣忓畢 - this.DoBindResidence(scanString); + action(scanString); }); }; @@ -110,121 +115,6 @@ btnLogout.MouseUpEventHandler = (sender, e) => { MainPage.GoLoginPage(UserInfo.Current); - }; - } - - /// <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(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