From d020a48f69f1acd8d97fc15372e19cde7779d934 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 15 十一月 2021 10:46:43 +0800
Subject: [PATCH] 绑定source面板

---
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs |   68 ++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
index e7f2bb5..f7a2d84 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -1,4 +1,5 @@
 锘�    using System;
+using HDL_ON.DAL.Server;
 using HDL_ON.UI;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -561,17 +562,78 @@
             {
                 Scan.OpenScan((scanString) =>
                 {
-                    //鎵ц缁戝畾浣忓畢
-                    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 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);
+                    }
                 });
             };
 
-            optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
             #endregion
 
             if (Entity.DB_ResidenceData.Instance.SupportFacePass)
             {
                 #region 涓汉閫夐」-浜鸿劯閫氳绠$悊
+                optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
+
                 faceManagementView = new FrameLayout()
                 {
                     Height = Application.GetRealHeight(50),

--
Gitblit v1.8.0