wxr
2022-11-25 a16dbea60b9fd0550dcdefd34c94ff6711af2cbc
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using Shared;
@@ -38,6 +39,12 @@
                        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:
                        var dimmerView = new DimmerPage(function);
                        MainPage.BasePageView.AddChidren(dimmerView);
@@ -57,9 +64,15 @@
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.CurtainRoller:
                        var rollingShutterView = new RollingShutterPage(function);
                        var rollingShutterView = new VenetianBlindsPage(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);
                        MainPage.BasePageView.AddChidren(curtainShadesView);
                        curtainShadesView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        break;
                    case SPK.CurtainDream:
@@ -123,6 +136,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 +165,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,6 +185,7 @@
                        doorwindowPage.ShowColltionButton = false;
                        doorwindowPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
                        break;
                    case SPK.SensorMmvPose:
                    case SPK.SenesorMegahealth:
                    case SPK.SenesorMegahealth2:
                        var smPage = new SenesorMegahealthPage();
@@ -209,6 +232,40 @@
                        var doorLockPage = new DoorLockPage();
                        doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
                        break;
                    case SPK.IpCam_Imou:
                        new System.Threading.Thread(() =>
                        {
                            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("", $"获取乐橙数据失败");
                                    });
                                }
                                Com.Utils.HdlToLcUtils.Instance.InitData(Shared.Application.Activity, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost);
                                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();
                                Application.RunOnMainThread(() =>
                                {
                                    //Com.Utils.HdlToLcUtils.Instance.OpenActivity();
                                    Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId,function.name);
                                });
                            }
                            else
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    new PublicAssmebly().TipMsg("", $"获取乐橙数据失败({pack.Code})");
                                });
                            }
                        })
                        { IsBackground = true }.Start();
                        break;
                }
            };
            return eventHandler;