From 75a2f82f91d6568c0b3ea60ea93086e65f8a2e49 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 06 四月 2023 15:30:30 +0800
Subject: [PATCH] 2023年04月06日15:11:02
---
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 124 ++++++++++++++++++++++++++--------------
1 files changed, 80 insertions(+), 44 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
index 78a0c6a..0fe6cc6 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -3,6 +3,7 @@
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using Shared;
+using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod;
namespace HDL_ON.UI
{
@@ -12,7 +13,7 @@
/// <summary>
/// 鍔熻兘鎺у埗鐣岄潰璺宠浆浜嬩欢
/// </summary>
- public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor
+ public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor, Comerom comerom,Action action
)
{
EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
@@ -64,13 +65,13 @@
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
break;
case SPK.CurtainRoller:
- var rollingShutterView = new VenetianBlindsPage(function);
+ var rollingShutterView = new RollingShutterPage(function);
MainPage.BasePageView.AddChidren(rollingShutterView);
rollingShutterView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
break;
case SPK.CurtainShades:
- var curtainShadesView = new RollingShutterPage(function);
+ var curtainShadesView = new VenetianBlindsPage(function);
MainPage.BasePageView.AddChidren(curtainShadesView);
curtainShadesView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -233,66 +234,101 @@
doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
case SPK.IpCam_Imou:
- FunctionList.List.GetIpCamImouList();
- var waitPage = new Loading();
- MainPage.BaseView.AddChidren(waitPage);
- waitPage.Start("");
- new System.Threading.Thread(() =>
+#if __IOS__
+ if (Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken == null)
+ {//鏈垵濮嬪寲鎽勫儚澶�
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().InitSDKWithAppKey("HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost);
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken = UserInfo.Current.LoginTokenString;
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshToken = UserInfo.Current.RefreshToken;
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList();
+ }
+ //璺宠浆澶у崕鎽勫儚澶�
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList();
+ Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().ToMonitorViewWithDeviceId(function.extDevId, function.name, Shared.Application.currentVC);
+#else
+ FunctionList.List.GetIpCamImouList();
+ if (string.IsNullOrEmpty(Com.Utils.HdlToLcUtils.Instance.SubAccessToken))
{
- try
+ var waitPage = new Loading();
+ MainPage.BaseView.AddChidren(waitPage);
+ waitPage.Start("");
+ new System.Threading.Thread(() =>
{
- var http = new HttpServerRequest();
- var pack = http.GetLcSubAccountToken();
- if (pack.Code == StateCode.SUCCESS)
+ try
{
- if (pack.Data == null || string.IsNullOrEmpty(pack.Data.ToString()))
+ 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("", $"鑾峰彇涔愭鏁版嵁澶辫触");
+ new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao) + $"({pack.Code})");
});
}
-#if __ANDROID__
- Application.RunOnMainThread(() =>
- {
- try
- {
- Com.Utils.HdlToLcUtils.Instance.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
- Com.Utils.HdlToLcUtils.Instance.Token = UserInfo.Current.AccessToken;
- Com.Utils.HdlToLcUtils.Instance.SubAccessToken = pack.Data.ToString();
- Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name);
- }
- catch (Exception ex)
- {
-
- }
- });
-#endif
}
- else
+ catch (Exception ex)
+ {
+ MainPage.Log("鍔犺浇涔愭鎽勫儚澶村紓甯�");
+ }
+ finally
{
Application.RunOnMainThread(() =>
{
- new PublicAssmebly().TipMsg("", $"鑾峰彇涔愭鏁版嵁澶辫触({pack.Code})");
+ if (waitPage != null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
});
}
- }catch(Exception ex)
+ })
+ { IsBackground = true }.Start();
+ }
+ else
+ {
+ try
{
- MainPage.Log("鍔犺浇涔愭鎽勫儚澶村紓甯�");
+
+ Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name);
}
- finally
+ catch (Exception ex)
{
- Application.RunOnMainThread(() => {
- if (waitPage != null)
- {
- waitPage.RemoveFromParent();
- waitPage = null;
- }
- });
+
}
- })
- { IsBackground = true }.Start();
+ }
+#endif
+ break;
+ case SPK.VideoDoorLock: {
+ //钀ょ煶瑙嗛闂ㄩ攣
+ var form = new VideoDoorLockPage(function, btnName, btnFromFloor,comerom,action);
+ MainPage.BasePageView.AddChidren(form);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ form.Show();
+ }
break;
}
};
--
Gitblit v1.8.0