From 83d3a5b39efa7bea47ed418cab8ebc2f9fec8b14 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 12:44:24 +0800
Subject: [PATCH] 20201223-4

---
 HDL_ON/Common/ApiUtlis.cs |   41 +++++++++++++++++++++--------------------
 1 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 069acdc..d1aace8 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -55,7 +55,7 @@
             return result;
         }
 
-        public bool DownloadDataComplete = false;
+        public bool DownloadDataComplete = true;
         /// <summary>
         /// 涓嬭浇鏁版嵁
         /// </summary>
@@ -64,7 +64,7 @@
             if (MainPage.InternetStatus == 0)
                 return;
             //绾跨▼寮�濮嬫椂闂�
-            var beginTime = DateTime.MinValue;
+            var beginTime = DateTime.Now.AddSeconds(6);
 
             DownloadDataComplete = false;
 
@@ -194,7 +194,7 @@
                     var pack = Ins.HttpRequest.GetSceneList();
                     if (pack.Code == StateCode.SUCCESS)
                     {
-                        MainPage.Log($"璇诲彇鍦烘櫙鏁版嵁鎴愬姛");//:\r\n{pack.Data.ToString()}");
+                        MainPage.Log($"璇诲彇鍦烘櫙鏁版嵁鎴愬姛");
                         var sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
                         if (sceneList != null)
                         {
@@ -249,7 +249,7 @@
                 {
                     Application.RunOnMainThread(() =>
                     {
-                        beginTime = DateTime.Now;
+                        beginTime = DateTime.MinValue;
                         DownloadDataComplete = true;
                         waitPage.Hide();
                         waitPage.RemoveFromParent();
@@ -260,31 +260,32 @@
             downloadDataThread.Start();
 
             //缃戠粶鍗¢】锛岀粓姝笅杞界嚎绋�
-            new System.Threading.Thread(() => {
-                while (beginTime.AddSeconds(6) > DateTime.Now)
+            new System.Threading.Thread(() =>
+            {
+                while (beginTime < DateTime.Now)
                 {
-                    if(DownloadDataComplete)
+                    if (DownloadDataComplete)
                     {
                         break;
                     }
                     System.Threading.Thread.Sleep(100);
                 }
-                if (DownloadDataComplete)
-                {
-                    //涓嬭浇瀹屾垚鍒濆鍖栨暟鎹�
-                    SpatialInfo.CurrentSpatial.Clear();
-                    
-
-                }
-                else
+                if (!DownloadDataComplete)
                 {
                     downloadDataThread.Abort();
-                    Application.RunOnMainThread(() => {
-                        waitPage.Hide();
-                        waitPage.RemoveFromParent();
-                    });
                 }
-            }) { IsBackground = true }.Start();
+                DownloadDataComplete = true;
+                Application.RunOnMainThread(() =>
+                {
+                    waitPage.Hide();
+                    waitPage.RemoveFromParent();
+                });
+                //鍒濆鍖栨暟鎹�
+                //SpatialInfo.CurrentSpatial.Clear();
+
+
+            })
+            { IsBackground = true }.Start();
         }
     }
 }

--
Gitblit v1.8.0