From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 128 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 126 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
index 87c90f9..12a85bf 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -1,7 +1,9 @@
锘縰sing System;
using System.Threading;
+using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using Shared;
+using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod;
namespace HDL_ON.UI
{
@@ -11,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) =>
@@ -20,6 +22,10 @@
//璺宠浆鍒板姛鑳戒俊鎭缃〉闈�
switch (function.spk)
{
+ case SPK.GroupControl:
+ var dialog = new GroupControlPage(FunctionList.List.groupControls.Find((obj) => obj.sid == function.sid));
+ dialog.ShowDialog();
+ break;
case SPK.AirSwitch:
var airSwitchPage = new AirSwitchPage(function);
MainPage.BasePageView.AddChidren(airSwitchPage);
@@ -36,6 +42,12 @@
var rgbView = new RGBPage(function);
MainPage.BasePageView.AddChidren(rgbView);
rgbView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ break;
+ case SPK.LightRGBW:
+ var rgbwView = new RGBWPage(function);
+ MainPage.BasePageView.AddChidren(rgbwView);
+ rgbwView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
break;
case SPK.LightDimming:
@@ -60,6 +72,12 @@
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 VenetianBlindsPage(function);
+ MainPage.BasePageView.AddChidren(curtainShadesView);
+ curtainShadesView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
break;
case SPK.CurtainDream:
@@ -123,6 +141,10 @@
case SPK.ElectricTuyaWaterValve2:
var tyWaterValve = new TuyaWaterValvePage();
tyWaterValve.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
+ break;
+ case SPK.MechanicalArm:
+ var mechanicalArmPage = new MechanicalArmPage();
+ mechanicalArmPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
case SPK.ElectricTuyaWeepRobot:
case SPK.ElectricTuyaWeepRobot2:
@@ -148,6 +170,11 @@
pirPage.ShowColltionButton = false;
pirPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
+ case SPK.SensorHelp:
+ var helpPage = new PanelHelpPage();
+ helpPage.ShowColltionButton = false;
+ helpPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
+ break;
case SPK.SensorWater:
var waterPage = new SensorWaterImmersionPage();
waterPage.ShowColltionButton = false;
@@ -163,10 +190,10 @@
doorwindowPage.ShowColltionButton = false;
doorwindowPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
+ case SPK.SensorMmvPose:
case SPK.SenesorMegahealth:
case SPK.SenesorMegahealth2:
var smPage = new SenesorMegahealthPage();
- smPage.ShowColltionButton = false;
smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
case SPK.SensorGas:
@@ -210,6 +237,103 @@
var doorLockPage = new DoorLockPage();
doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
break;
+ case SPK.IpCam_Imou:
+
+#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))
+ {
+ 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;
+ 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;
}
};
return eventHandler;
--
Gitblit v1.8.0