黄学彪
2020-12-19 f4c86f68b900bd506ef7214b2ae9bd23a9d2ffa8
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -20,6 +21,10 @@
        /// 场景内容显示区域
        /// </summary>
        FrameLayout floorChangeView;
        /// <summary>
        /// 楼层房间选择的下拉对象
        /// </summary>
        FloorRoomSelectPopupView floorRoomSelectView = null;
        Button btnSceneTilte;
        #region 场景底部切换显示区域
@@ -70,7 +75,9 @@
            bodyView.AddChidren(topView);
            //不是A网关或者是成员 只允许添加场景隐藏自动化
            if (DB_ResidenceData.Instance.GatewayType != 1 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
            var HideAutoPage = DB_ResidenceData.Instance.GatewayType != 1 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare;
            //判断是否需要隐藏自动化
            if (HideAutoPage)
            {
                btnSceneTilte = new Button()
                {
@@ -147,7 +154,11 @@
            bodyView.AddChidren(contentPageView);
            LoadScenePageView();
            LoadAutomationPageView();
            //判断是否需要隐藏自动化
            if (!HideAutoPage)
            {
                LoadAutomationPageView();
            }
            LoadEventList();
        }
@@ -202,23 +213,40 @@
                TextAlignment = TextAlignment.CenterLeft,
                Text = DB_ResidenceData.Instance.CurFloor.roomName,
            };
            floorChangeView.AddChidren(btnFloor);
            floorChangeView.AddChidren(btnFloor);
            string nowSelectId = null;
            btnFloor.MouseUpEventHandler += (sender, e) =>
            {
                if (this.floorRoomSelectView == null)
                {
                    //先初始化
                    this.floorRoomSelectView = new FloorRoomSelectPopupView();
                }
                //显示下拉列表
                this.floorRoomSelectView.ShowSceneView(btnFloor, (selectId, listScene) =>
                {
                    nowSelectId = selectId;
                    //重新刷新场景列表
                    this.LoadSceneFunctionControlZone(listScene);
                }, nowSelectId);
            };
            #endregion
            sceneFunctionView = new VerticalScrolViewLayout()
            {
                Y = floorChangeView.Bottom,
                Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30),
            };
            scenePageView.AddChidren(sceneFunctionView);
            LoadSceneFunctionControlZone();
            LoadSceneFunctionControlZone(null);
        }
        /// <summary>
        /// 加载场景功能显示区域
        /// </summary>
        void LoadSceneFunctionControlZone()
        void LoadSceneFunctionControlZone(List<Scene> listScene)
        {
            //topView.AddChidren(btnAddIcon);
@@ -227,7 +255,18 @@
            try
            {
                int index = 0;
                foreach (var scene in FunctionList.List.scenes)
                //获取能够显示的场景
                if (listScene == null)
                {
                    //初始值
                    if (this.floorRoomSelectView == null)
                    {
                        //先初始化
                        this.floorRoomSelectView = new FloorRoomSelectPopupView();
                    }
                    listScene = this.floorRoomSelectView.GetCanShowListScene();
                }
                foreach (var scene in listScene)
                {
                    //if (scene.roomIds.Count == 0)//如何在房间已经移除了这个功能,则收藏界面也不会再显示
                    //{
@@ -374,7 +413,7 @@
                LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene);
                btnSettingIcon.MouseUpEventHandler = (sender, e) => {
                    Action backAction = () => {
                        LoadSceneFunctionControlZone();
                        LoadSceneFunctionControlZone(null);
                    };
                    Action refreshAction = () => {
                        btnName.Text = scene.name;
@@ -406,7 +445,7 @@
            contentPageView.AddChidren(automationPage);
            UI2.Intelligence.Automation.MainView.automationPage = automationPage;
            UI2.Intelligence.Automation.MainView.MainShow();
        }
        }
        #endregion
    }
@@ -499,7 +538,7 @@
                    Action action = () =>
                    {
                        LoadSceneFunctionControlZone();
                        LoadSceneFunctionControlZone(null);
                    };
                    var aep = new NewSceneMenuListPage(action);
                    MainPage.BasePageView.AddChidren(aep);