From e1a8f2f7e4d850beedeb1469610b878c1427e976 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 15 十二月 2021 09:01:53 +0800 Subject: [PATCH] 更新 --- HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs | 122 +++++++++++++++++++++------------------- 1 files changed, 64 insertions(+), 58 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs index f7a2d84..e511612 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs @@ -554,7 +554,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, - TextID = StringId.AddResidence, + TextID = StringId.ScanQRCoden, }; addResidenceView.AddChidren(btnAddResidenceText); @@ -562,67 +562,73 @@ { Scan.OpenScan((scanString) => { - if (scanString.StartsWith("source://bind/")) + if (string.IsNullOrEmpty(scanString)) { - var waitPage = new Loading(); - new System.Threading.Thread(() => - { - try - { - Application.RunOnMainThread(() => - { - waitPage.Start("Plaese wait..."); - }); - var sendString = scanString.Replace("source://bind/", ""); - MainPage.Log($"缁戝畾source灞�:{sendString}"); - //缁戝畾source灞� - var pack = new HDL_ON.DAL.Server.HttpServerRequest().BindSourcePanel(scanString); - Application.RunOnMainThread(() => - { - var title = Language.StringByID(StringId.Tip); - var msg = ""; - if(pack.Code == StateCode.SUCCESS) - { - if(Language.CurrentLanguage=="Chinese") - { - msg = "Source灞忕粦瀹氭垚鍔�."; - } - else - { - msg = "Source Hub binding succeeded"; - } - new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); - } - else - { - if (Language.CurrentLanguage == "Chinese") - { - msg = "Source灞忕粦瀹氬け璐�."; - } - else - { - msg = "Source Hub binding failed"; - } - new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); - } - }); - } - catch(Exception ex) - { } - finally - { - Application.RunOnMainThread(() => - { - waitPage.Hide(); - }); - } - }) - { IsBackground = true }.Start(); } else { - //鎵ц缁戝畾浣忓畢 - new BindingResidencePage().DoBindResidence(scanString); + if (scanString.StartsWith("source://bind/")) + { + var waitPage = new Loading(); + new System.Threading.Thread(() => + { + try + { + Application.RunOnMainThread(() => + { + waitPage.Start("Plaese wait..."); + }); + var sendString = scanString.Replace("source://bind/", ""); + MainPage.Log($"缁戝畾source灞�:{sendString}"); + //缁戝畾source灞� + var pack = new HttpServerRequest().BindSourcePanel(sendString); + Application.RunOnMainThread(() => + { + var title = Language.StringByID(StringId.Tip); + var msg = ""; + if (pack.Code == StateCode.SUCCESS) + { + if (Language.CurrentLanguage == "Chinese") + { + msg = "Source灞忕粦瀹氭垚鍔�."; + } + else + { + msg = "Source Hub binding succeeded"; + } + new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); + } + else + { + if (Language.CurrentLanguage == "Chinese") + { + msg = $"Source灞忕粦瀹氬け璐�.({pack.Code})"; + } + else + { + msg = "Source Hub binding failed"; + } + new HDL_ON.UI.PublicAssmebly().TipMsg(title, msg); + } + }); + } + catch (Exception ex) + { } + finally + { + Application.RunOnMainThread(() => + { + waitPage.Hide(); + }); + } + }) + { IsBackground = true }.Start(); + } + else + { + //鎵ц缁戝畾浣忓畢 + new BindingResidencePage().DoBindResidence(scanString); + } } }); }; -- Gitblit v1.8.0