| | |
| | | using System; |
| | | using System.Threading; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | |
| | | var doorLockPage = new DoorLockPage(); |
| | | doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.IpCam_Imou: |
| | | #if __IOS__ |
| | | #else |
| | | FunctionList.List.GetIpCamImouList(); |
| | | if (string.IsNullOrEmpty(Com.Utils.HdlToLcUtils.Instance.SubAccessToken)) |
| | | { |
| | | var waitPage = new Loading(); |
| | | MainPage.BaseView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var pack = http.GetLcSubAccountToken(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if (pack.Data == null || string.IsNullOrEmpty(pack.Data.ToString())) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao)); |
| | | }); |
| | | } |
| | | Application.RunOnMainThread(() =>{ |
| | | try |
| | | { |
| | | Com.Utils.HdlToLcUtils.Instance.SubAccessToken = pack.Data.ToString(); |
| | | Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao) + $"({pack.Code})"); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("加载乐橙摄像头异常"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | #endif |
| | | break; |
| | | } |
| | | }; |
| | | return eventHandler; |