陈嘉乐
2021-03-16 e1ac4ab0e68024e6289e0b11756962d662749b04
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -430,6 +430,7 @@
            var lastY1 = Application.GetRealWidth(16);
            var lastY2 = Application.GetRealWidth(16);
            var functionContentViewHeight = Application.GetRealWidth(16);
            var functionCategoryCount = 0;
@@ -441,41 +442,41 @@
                {
                    case ShowFunction.Light:
                        #region Light
                        functionCount = FunctionList.List.lights.Count;
                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetLightList().Count;
                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.AC:
                        #region AC
                        functionCount = FunctionList.List.aCs.Count;
                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetAcList().Count;
                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.Curtain:
                        #region Curtain
                        functionCount = FunctionList.List.curtains.Count;
                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetCurtainList().Count;
                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.FloorHeating:
                        #region 地热
                        functionCount = FunctionList.List.floorHeatings.Count;
                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetFloorHeatingList().Count;
                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.DoorLock:
                        break;
                    case ShowFunction.Electric:
                        #region 电器
                        functionCount = FunctionList.List.electricals.Count;
                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionCount = FunctionList.List.GetElectricals().Count;
                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.EnergyMonitoring:
                        break;
                    case ShowFunction.Environmental:
                        #region 环境数据
                        functionCount = FunctionList.List.sensorsEnvironmentalScience.Count;
                        functionCount = FunctionList.List.GetEnvirSensorsList().Count;
                        #endregion
                        break;
                    case ShowFunction.FreshAir:
@@ -487,39 +488,23 @@
                    case ShowFunction.Panel:
                        break;
                    case ShowFunction.SecurityMonitoring:
                        functionCount = 1;
                        break;
                    case ShowFunction.Sensor:
                        functionCount = FunctionList.List.GetArmSensorList().Count;
                        break;
                    case ShowFunction.VideoIntercom:
                        break;
                }
                if (functionCount == 0 && item != ShowFunction.Music)
                if(functionCount == 0)
                {
                    continue;
                }
                functionCategoryCount++;
                //FunctionType ft = FunctionType.A31Music
                //switch (item)
                //{
                //    case SPK.FloorHeatStandard:
                //        break;
                //    case SPK.AcStandard:
                //        break;
                //    case SPK.CurtainTrietex:
                //    case SPK.CurtainSwitch:
                //    case SPK.CurtainRoller:
                //        break;
                //    case SPK.LightSwitch:
                //    case SPK.LightDimming:
                //    case SPK.LightRGB:
                //    case SPK.LightCCT:
                //        break;
                //    case SPK.ElectricSocket:
                //        break;
                //}
                FrameLayout functionView = new FrameLayout()
                {
                    Height = Application.GetRealWidth(161),
@@ -550,6 +535,7 @@
                {
                    s2View.AddChidren(functionView);
                }
                functionContentViewHeight = functionView.Bottom;
                Button btnName = new Button()
@@ -563,6 +549,38 @@
                    TextAlignment = TextAlignment.CenterLeft,
                };
                functionView.AddChidren(btnName);
                if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom
                    && item != ShowFunction.SecurityMonitoring
                    && functionCount != 0)
                {
                    Button btnFunctionCount = new Button()
                    {
                        X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * functionCount.ToString().Length),
                        Y = btnName.Bottom,
                        Width = Application.GetRealWidth(120),
                        Height = Application.GetRealHeight(24),
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                        TextAlignment = TextAlignment.CenterLeft,
                        Text = "/" + functionCount,
                    };
                    functionView.AddChidren(btnFunctionCount);
                    Button btnOpenCount = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Y = btnName.Bottom,
                        Width = Application.GetRealWidth(14 * functionCount.ToString().Length),
                        Height = Application.GetRealHeight(24),
                        TextColor = CSS_Color.MainColor,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                        TextAlignment = TextAlignment.CenterLeft,
                        Text = functionOnCount.ToString(),
                        Tag = item + "_onCount",
                        BorderWidth = 0,
                    };
                    functionView.AddChidren(btnOpenCount);
                }
                Button btnFunctionViewBg;
@@ -579,8 +597,6 @@
                    case ShowFunction.Light:
                        #region Light
                        btnName.TextID = StringId.Lights;
                        functionCount = FunctionList.List.lights.Count;
                        functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnLightPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -605,8 +621,6 @@
                    case ShowFunction.AC:
                        #region AC
                        btnName.TextID = StringId.AC;
                        functionCount = FunctionList.List.aCs.Count;
                        functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnAcPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -629,8 +643,6 @@
                    case ShowFunction.Curtain:
                        #region Curtain
                        btnName.TextID = StringId.Curtain;
                        functionCount = FunctionList.List.curtains.Count;
                        functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnClose;
                        btnClose = new Button()
                        {
@@ -664,8 +676,6 @@
                    case ShowFunction.FloorHeating:
                        #region 地热
                        btnName.TextID = StringId.FloorHeating;
                        functionCount = FunctionList.List.floorHeatings.Count;
                        functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnFhPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -691,8 +701,6 @@
                    case ShowFunction.Electric:
                        #region 电器
                        btnName.TextID = StringId.Electric;
                        functionCount = FunctionList.List.electricals.Count;
                        functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        Button btnElectricPower = new Button()
                        {
                            X = Application.GetRealWidth(120),
@@ -732,8 +740,6 @@
                        break;
                    case ShowFunction.Music:
                        btnName.TextID = StringId.Music;
                        functionCount = Music.A31MusicModel.A31MusicModelList.Count;
                        functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                        {
                            var musicMain = new Music.MusicMain();
@@ -747,10 +753,19 @@
                        break;
                    case ShowFunction.SecurityMonitoring:
                        btnName.TextID = StringId.SecurityMonitoring;
                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                        {
#if __IOS__
                            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
#else  //安卓摄像头
                            HDLCommon.Current.Go2EZvizMonitor(bodyView);
#endif
                        };
                        break;
                    case ShowFunction.Sensor:
                        btnName.TextID = StringId.Sensor;
                        functionPageTitleId = StringId.Sensor;
                        break;
                    case ShowFunction.VideoIntercom:
                        btnName.TextID = StringId.VideoIntercom;
@@ -758,7 +773,7 @@
                }
                //界面跳转--音乐跳转自己的界面--环境跳转自己的界面
                if (item != ShowFunction.Music && item != ShowFunction.Environmental)
                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring)
                {
                    btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                    {
@@ -768,48 +783,19 @@
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    };
                }
                if (item != ShowFunction.Environmental && functionCount != 0)
                {
                    Button btnFunctionCount = new Button()
                    {
                        X = Application.GetRealWidth(17) + Application.GetRealWidth(7 * functionCount.ToString().Length),
                        Y = btnName.Bottom,
                        Width = Application.GetRealWidth(120),
                        Height = Application.GetRealHeight(24),
                        TextColor = CSS_Color.PromptingColor1,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                        TextAlignment = TextAlignment.CenterLeft,
                        Text = "/" + functionCount,
                    };
                    functionView.AddChidren(btnFunctionCount);
                    Button btnOpenCount = new Button()
                    {
                        X = Application.GetRealWidth(16),
                        Y = btnName.Bottom,
                        Width = Application.GetRealWidth(14 * functionCount.ToString().Length),
                        Height = Application.GetRealHeight(24),
                        TextColor = CSS_Color.MainColor,
                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                        TextAlignment = TextAlignment.CenterLeft,
                        Text = functionOnCount.ToString(),
                        Tag = item + "_onCount",
                        BorderWidth = 0,
                    };
                    functionView.AddChidren(btnOpenCount);
                }
                index++;
            }
            if (functionCategoryCount > 4)
            //if (functionCategoryCount > 4)
            {
                functionContentView.Height = Application.GetRealHeight((220 * functionCategoryCount / 2) + 20);
                s1View.Height = s2View.Height = functionContentView.Height;
                //functionContentView.Height = functionContentViewHeight;// Application.GetRealWidth((240 * (functionCategoryCount / 2)));
                s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40);
            }
            #endregion
#endregion
        }
        #region 切换楼层
#region 切换楼层
        /// <summary>
        /// 楼层显示切换
        /// </summary>
@@ -966,6 +952,6 @@
        {
        }
        #endregion
#endregion
    }
}