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/Entity/Function/Scene.cs | 50 ++++++++++++++++++++++++++++---------------------- 1 files changed, 28 insertions(+), 22 deletions(-) diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index c6ad0eb..fef4381 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.Common; using HDL_ON.DAL.Server; using Shared; @@ -236,23 +237,17 @@ { Application.RunOnMainThread(() => { - if (time / 60 > 1) + if (time > 60) { - btnShowDelay.Text = (time / 60).ToString() + "min"; + btnShowDelay.Text = (time / 60).ToString() + "min" + time % 60 + "s"; } else { - btnShowDelay.Text = (time--).ToString() + "s"; + btnShowDelay.Text = time.ToString() + "s"; } }); - if (time / 60 > 1) - { - System.Threading.Thread.Sleep(time / 60 * 60000); - } - else - { - System.Threading.Thread.Sleep(1000); - } + System.Threading.Thread.Sleep(1000); + time--; } Application.RunOnMainThread(() => { @@ -285,19 +280,30 @@ /// 鏀惰棌鍦烘櫙 /// </summary> /// <returns></returns> - public string CollectScene() + public void CollectScene() { - var pm = new HttpServerRequest(); - if (this.collect) + var result = StateCode.SUCCESS; + new System.Threading.Thread(() => { - var revPack = pm.CollectScene(this.userSceneId); - return revPack; - } - else - { - var revPack = pm.CancelCollectScene(this.userSceneId); - return revPack; - } + if (collect) + { + result = ApiUtlis.Ins.HttpRequest.CollectScene(userSceneId); + } + else + { + result = ApiUtlis.Ins.HttpRequest.CancelCollectScene(userSceneId); + } + //鎻愮ず閿欒 + if (result != StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + collect = !collect; + IMessageCommon.Current.ShowErrorInfoAlter(result); + }); + } + }) + { IsBackground = true }.Start(); } /// <summary> -- Gitblit v1.8.0