wxr
2023-08-08 884a8ce78b6d198a5878e85fc30cb85177e59826
三相空开验收
41个文件已修改
829 ■■■■■ 已修改文件
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/AC.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/FloorHeating.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 97 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBWPageBLL.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs 244 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308041">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308071">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <!--友盟-->
HDL-ON_Android/Resources/Resource.designer.cs
@@ -2,6 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
@@ -14,7 +15,7 @@
{
    
    
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.2.0.99")]
    public partial class Resource
    {
        
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -27,7 +27,7 @@
        <MtouchDebug>true</MtouchDebug>
        <CodesignKey>Apple Development: xuebiao huang (4P32GXQWWK)</CodesignKey>
        <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
        <CodesignProvision>OnPro230605-1-Dev</CodesignProvision>
        <CodesignProvision>OnPro2307291-Dev</CodesignProvision>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
@@ -59,7 +59,7 @@
        <MtouchEnableSGenConc>false</MtouchEnableSGenConc>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodesignProvision>OnPro230630-1-Dev</CodesignProvision>
<CodesignProvision>OnPro2307291-Dev</CodesignProvision>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
        <DebugType>none</DebugType>
HDL_ON/DAL/DriverLayer/Control.cs
@@ -1271,7 +1271,7 @@
            //    return;
            //}
            var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
            var temp = JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
            if (temp != null)
            {
                Control_Udp.ReceiveRepeatManager(temp.id, usefulBytes);
@@ -1328,7 +1328,11 @@
                        {
                            localFunction.time_stamp = temp.time_stamp;
                            localFunction.SetAttrState(attr.key, attr.value);
                        }
                        if(localFunction.spk == SPK.AirSwitchP3)
                        {
                            localFunction.online = updateTemp.online;
                        }
                        //更新界面状态
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -124,8 +124,8 @@
            //登录sip服务器
#if __IOS__
            Shared.IOS.HDLLinphoneSDK.HDLLinPhoneSDK.Instance().Login(mHDLSipInfo.sipAccount, mHDLSipInfo.sipPasswd, mHDLSipInfo.realm);
#else
            if (mInterphoneType == InterphoneType.FREEVIEW.ToString())
HDL_ON/Entity/Function/AC.cs
@@ -12,24 +12,28 @@
        public string GetTempUnitString(Function function)
        {
            //var attr = function.GetAttribute(FunctionAttributeKey.TempType)
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if (tt == "0")
            var tt = function.GetAttribute(FunctionAttributeKey.TempType);
            if(tt == null)
            {
                return "°C";
            }
            if (tt.unit == string.Empty)
            {
                return "°C";
            }
            else
            {
                if (tt == "C")
                if (tt.unit == "C")
                {
                    return "°C";
                }
                else if (tt == "F")
                else if (tt.unit == "F")
                {
                    return "°F";
                }
                else
                {
                    return tt;
                    return tt.unit;
                }
            }
        }
HDL_ON/Entity/Function/FloorHeating.cs
@@ -71,14 +71,29 @@
        /// </summary>
        public string GetTempUnitString(Function function)
        {
            var tt = function.GetAttrState(FunctionAttributeKey.TempType);
            if (tt == "0")
            var tt = function.GetAttribute(FunctionAttributeKey.TempType);
            if (tt == null)
            {
                return "°C";
            }
            if (tt.unit == string.Empty)
            {
                return "°C";
            }
            else
            {
                return tt;
                if (tt.unit == "C")
                {
                    return "°C";
                }
                else if (tt.unit == "F")
                {
                    return "°F";
                }
                else
                {
                    return tt.unit;
                }
            }
        }
HDL_ON/Entity/Function/Function.cs
@@ -445,20 +445,52 @@
        /// </summary>
        public bool collect = false;
        private bool _online = false;
        /// <summary>
        /// 是否在线
        /// </summary>
        public bool online
        {
        private bool _online;
        public bool online {
            get
            {
                if (spk == SPK.AirSwitchP3)
                {
                    return _online;
                }
                return true;
            }
            set
            {
                _online = value;
            }
        }
        ///// <summary>
        ///// 是否在线
        ///// </summary>
        //public bool online
        //{
        //    get
        //    {
        //        if(spk == SPK.AirSwitchP3)
        //        {
        //            return _online;
        //        }
        //        return true;
        //    }
        //    set
        //    {
        //        _online = value;
        //    }
        //}
        public bool isOnline()
        {
            if (spk == SPK.AirSwitchP3)
            {
                return online;
            }
            return true;
        }
        public void setOnine(bool isOnline)
        {
            online = isOnline;
        }
        /// <summary>
@@ -813,10 +845,10 @@
                    {
                        foreach (var temp in gc.sids)
                        {
                            var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
                            if (light != null)
                            var tempDevice = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
                            if (tempDevice != null)
                            {
                                foreach (var attr in light.attributes)
                                foreach (var attr in tempDevice.attributes)
                                {
                                    if (list.Find((obj) => obj.key == attr.key) == null)
                                    {
@@ -850,27 +882,54 @@
                    sFunc.type = "5";
                }
                string us = "";
                switch (attr.key)
                {
                    case FunctionAttributeKey.SetTemp:
                        var tt = GetAttribute(FunctionAttributeKey.TempType);
                        if (tt == null)
                        {
                            attr.unit = "°C";
                        }
                        else
                        {
                            if (tt.unit == string.Empty)
                            {
                                attr.unit = "°C";
                            }
                            else
                            {
                                if (tt.unit == "C")
                                {
                                    attr.unit = "°C";
                                }
                                else if (tt.unit == "F")
                                {
                                    attr.unit = "°F";
                                }
                                else
                                {
                                    attr.unit = tt.unit;
                                }
                            }
                        }
                        break;
                    case FunctionAttributeKey.RoomTemp:
                        us = "°C";
                        attr.unit = "°C";
                        var tempType = attributes.Find((obj) => obj.key == FunctionAttributeKey.TempType);
                        if (tempType != null)
                        {
                            us = tempType.curValue.ToString();
                            attr.unit = tempType.curValue.ToString();
                        }
                        break;
                    case FunctionAttributeKey.Percent:
                    case FunctionAttributeKey.Brightness:
                        us = "%";
                        attr.unit = "%";
                        break;
                    case FunctionAttributeKey.CCT:
                        us = "K";
                        attr.unit = "K";
                        break;
                    case FunctionAttributeKey.Angle:
                        us = "°";
                        attr.unit = "°";
                        break;
                }
@@ -934,13 +993,13 @@
                                vv = 26;
                            }
                            sFunc.status.Add(new SceneFunctionStatus() {
                                UintString = us,
                                UintString = attr.unit,
                                key = attr.key, value = Convert.ToInt32(vv).ToString(), max = attr.max, min = attr.min }) ;
                        }
                        else
                        {
                            sFunc.status.Add(new SceneFunctionStatus() {
                                UintString = us,
                                UintString = attr.unit,
                                key = attr.key, value = attr.curValue.ToString(), max = attr.max, min = attr.min });
                        }
                        break;
@@ -1088,6 +1147,10 @@
        /// 云端负责生成
        /// </summary>
        public string deviceId = "0";
        /// <summary>
        /// 在线状态
        /// </summary>
        public bool online = true;
        public List<AttributesStatus> status = new List<AttributesStatus>();
    }
    /// <summary>
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1618,7 +1618,7 @@
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                    TextAlignment = TextAlignment.CenterLeft,
                    Tag = "OnlineTag",
                    Visible = !function.online
                    Visible = !function.isOnline()
                };
                view.AddChidren(btnOffline);
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -33,7 +33,7 @@
                                    }
                                    if (btn.Tag.ToString() == function.sid)
                                    {
                                        if (function.online)
                                        if (function.isOnline())
                                        {
                                            btn.UnSelectedImagePath = "Collection/Functionbg.png";
                                            btn.IsSelected = false;
@@ -46,7 +46,7 @@
                                    }
                                    else if (btn.Tag.ToString() == "OnlineTag")
                                    {
                                        btn.Visible = !function.online;
                                        btn.Visible = !function.isOnline();
                                    }
                                }
                            }
@@ -546,7 +546,7 @@
        {
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
@@ -614,7 +614,7 @@
        {
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
@@ -658,16 +658,16 @@
        {
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!curtain.online)//离线不允许操作
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                    return;
                }
                //if (!curtain.isOnline())//离线不允许操作
                //{
                //    new Tip()
                //    {
                //        CloseTime = 1,
                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                //        Direction = AMPopTipDirection.None,
                //    }.Show(MainPage.BaseView);
                //    return;
                //}
                btnClose.IsSelected = true;
                curtain.trait_on_off.curValue = "off";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
@@ -678,16 +678,16 @@
            btnOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!curtain.online)//离线不允许操作
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                    return;
                }
                //if (!curtain.isOnline())//离线不允许操作
                //{
                //    new Tip()
                //    {
                //        CloseTime = 1,
                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                //        Direction = AMPopTipDirection.None,
                //    }.Show(MainPage.BaseView);
                //    return;
                //}
                btnOpen.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
@@ -708,7 +708,7 @@
            };
            btnUp.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
@@ -739,7 +739,7 @@
            };
            btnDown.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -304,7 +304,7 @@
                        {
                            if (scrolView.GetChildren(i).GetType() == typeof(FunctionControlZone)) {
                                var fcView = scrolView.GetChildren(i) as FunctionControlZone;
                                fcView.UpdataOnline(updataFunction.online);
                                fcView.UpdataOnline(updataFunction.isOnline());
                            }
                        }
                    }
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -1290,7 +1290,7 @@
                int count = 0;
                foreach (var temp in FunctionList.List.InverterList())
                {
                    if (temp.online)
                    if (temp.isOnline())
                    {
                        if (temp.trait_on_off.state.ToString() == "on")
                        {
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -457,7 +457,7 @@
                bodyDiv.AddChidren(btnCollectionIcon);
            }
            if (!function.online)
            if (!function.isOnline())
            {
                bodyDiv.BackgroundColor = CSS_Color.PromptingColor2;
                btnOffline = new Button()
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -86,7 +86,7 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
@@ -133,7 +133,7 @@
        /// </summary>
        void LoadEvent_LightDimming(DiyImageSeekBar dimmerControlBar)
        {
            if (!function.online)//离线不允许操作
            if (!function.isOnline())//离线不允许操作
            {
                //new Tip()
                //{
@@ -280,7 +280,7 @@
            };
            btnUp.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
@@ -311,7 +311,7 @@
            };
            btnDown.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.isOnline())//离线不允许操作
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -206,7 +206,7 @@
                function.spk = videoDevice.spk;
                function.name = videoDevice.deviceName;
                function.deviceId = videoDevice.deviceId;
                function.online = videoDevice.status == "online";
                function.setOnine( videoDevice.status == "online");
                function.sid = videoDevice.sid;
                var video = functionList.Find((o) => o.deviceId == function.deviceId);
                if (video == null)
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
@@ -200,9 +200,8 @@
        /// <summary>
        /// 显示功能Row
        /// </summary>
        void LoadFunctionListRow(List<Function> functions)
        void LoadFunctionListRow(List<Function> functions, bool isAppend = false)
        {
            functionListView.RemoveAll();
            if (functions == null)
            {
                //初始值
@@ -210,8 +209,20 @@
                functions.AddRange(unallocatedList);
                functions.AddRange(allocatedList);
            }
            foreach (var function in functions)
            if (!isAppend)
            {
                showCount = -1;
                functionListView.RemoveAll();
            }
            for (var i = 0; i < 100; i++)
            //foreach (var function in functions)
            {
                showCount++;
                if (showCount >= functions.Count)
                {
                    break;
                }
                var function = functions[showCount];
                if (!MainPage.SceneSupportFunctionList.Contains(function.spk))
                {
                    continue;
@@ -290,10 +301,33 @@
                };
                functionRow.AddChidren(btnChooseIcon);
                LoadEvent_SkipEditFunctionInfo(functionRow, btnFunctionFloorName, btnChooseIcon, btnFunctionName, function);
            }
            if (functions.Count > showCount)
            {
                var btnAppend = new Button()
                {
                    Height = Application.GetRealHeight(60),
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextID = StringId.LoadMore,
                };
                functionListView.AddChidren(btnAppend);
                btnAppend.MouseUpEventHandler = (sender, e) =>
                {
                    btnAppend.RemoveFromParent();
                    LoadFunctionListRow(functions, true);
                };
            }
        }
        /// <summary>
        /// 显示的设备的总数
        /// </summary>
        int showCount = -1;
        /// <summary>
        /// 住宅列表点击事件
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -169,7 +169,7 @@
            //红外宝当前有多少个遥控器
            pirView.geBtn.Text = Pir.currPir.FunctioList.Count.ToString();
            //红外宝是否在线-离线
            if (Pir.currPir.online)
            if (Pir.currPir.isOnline())
            {
                pirView.stateIconBtn.IsSelected = true;
                pirView.stateTextBtn.IsSelected = true;
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs
@@ -21,7 +21,7 @@
                pirDevice.name = function.name;
                pirDevice.deviceId = function.deviceId;
                pirDevice.sid = function.sid;
                pirDevice.online = function.online;
                //pirDevice.setOnine = function.isOnline();
                pirDevice.versions = function.versions;
            }
            Pir.currPir = pirDevice;
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -458,7 +458,7 @@
                };
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                {
                    if (!device.online)
                    if (!device.isOnline())
                    {
                        new Tip()
                        {
@@ -524,7 +524,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (!device.online)
                if (!device.isOnline())
                {
                    new Tip()
                    {
@@ -552,7 +552,7 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (!device.online)
                if (!device.isOnline())
                {
                    new Tip()
                    {
@@ -579,7 +579,7 @@
                Control.Ins.SendWriteCommand(device, d);
            };
            if (!device.online)
            if (!device.isOnline())
            {
                arcBar.OnStopTrackingTouchEvent = (sender, e) =>
                {
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs
@@ -424,7 +424,7 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -453,7 +453,7 @@
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
            if (!function.online)
            if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -481,7 +481,7 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
            if (!function.online)
            if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -508,7 +508,7 @@
                CurtainAnimation(100);
            };
            if (function.online)
            if (function.isOnline())
            {
                btnCurtainStop.MouseDownEventHandler = (sender, e) =>
                {
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -72,7 +72,7 @@
        void LoadEvent_ControlEvent()
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) => {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -117,7 +117,7 @@
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -141,7 +141,7 @@
            };
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -139,7 +139,7 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -168,7 +168,7 @@
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -196,7 +196,7 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -223,7 +223,7 @@
                CurtainAnimation(100);
            };
            if (function.online)
            if (function.isOnline())
            {
                btnCurtainStop.MouseDownEventHandler = (sender, e) =>
                {
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -138,7 +138,7 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -167,7 +167,7 @@
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -193,7 +193,7 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -238,7 +238,7 @@
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            if (function.online)
            if (function.isOnline())
            {
                btnCurtainStop.MouseDownEventHandler = (sender, e) =>
HDL_ON/UI/UI2/FuntionControlView/Curtain/VenetianBlindsPageBLL.cs
@@ -149,7 +149,7 @@
        {
            btnCurtainClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -178,7 +178,7 @@
            btnCurtainStop.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -204,7 +204,7 @@
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -249,7 +249,7 @@
            //    DriverLayer.Control.Ins.SendWriteCommand(function, d);
            //};
            if (function.online)
            if (function.isOnline())
            {
                btnCurtainStop.MouseDownEventHandler = (sender, e) =>
HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockPage.cs
@@ -1118,7 +1118,7 @@
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
            this.doorLockData.IsOnline = i_LocalDevice.online;
            this.doorLockData.IsOnline = i_LocalDevice.isOnline();
            for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
            {
                var data = i_LocalDevice.attributes[i];
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3Page.cs
@@ -422,7 +422,7 @@
        {
            btnSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -444,7 +444,7 @@
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchP3SubloopEnergyPage.cs
@@ -1,8 +1,13 @@
using System;
using System.Collections.Generic;
using System.Net;
using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Newtonsoft.Json;
//using OpenTK;
using Shared;
namespace HDL_ON.UI
@@ -573,11 +578,52 @@
            #endregion
            new System.Threading.Thread(() =>
            if (Control.Ins.GatewayOnline_Local == true)
            {
                DriverLayer.Control.Ins.SendReadCommand(device);
            })
            { IsBackground = true }.Start();
                new System.Threading.Thread(() =>
                {
                    Control.Ins.SendReadCommand(device);
                })
                { IsBackground = true }.Start();
            }
            else
            {
                if (Control.Ins.GatewayOnline_Cloud)
                {
                    new System.Threading.Thread(() =>
                    {
                        try
                        {
                            var deviceResult = ApiUtlis.Ins.HttpRequest.GetDeviceInfo(device.deviceId);
                            if (deviceResult != null)
                            {
                                if (deviceResult.Code == StateCode.SUCCESS)
                                {
                                    if (deviceResult.Data != null)
                                    {
                                        var packList = JsonConvert.DeserializeObject<List<Function>>(deviceResult.Data.ToString());
                                        if (packList != null)
                                        {
                                            if (packList.Count > 0)
                                            {
                                                if (packList[0].isOnline())
                                                {
                                                    Control.Ins.SendReadCommand(device);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }catch(Exception ex)
                        {
                        }
                    })
                    { IsBackground = true }.Start();
                }
            }
@@ -715,6 +761,10 @@
        /// </summary>
        public static void UpdataStatus(Function updataTemp)
        {
            if (!updataTemp.online)//设备不在线不更新状态
            {
                return;
            }
            Application.RunOnMainThread(() =>
            {
                try
HDL_ON/UI/UI2/FuntionControlView/Electrical/AirSwitchPage.cs
@@ -153,7 +153,7 @@
                    TextAlignment = TextAlignment.Center,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                //controlView.AddChidren(btnRunStatus); //状态无法测试,暂时隐藏--2021-10-14 13:58:48 董泽斌
                controlView.AddChidren(btnRunStatus);
                UpdataRunStatus();
            }
@@ -417,7 +417,7 @@
        {
            btnSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -439,7 +439,7 @@
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -62,7 +62,7 @@
        {
            btnSwitchIcon.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -86,7 +86,7 @@
            };
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -108,7 +108,7 @@
                { IsBackground = true }.Start();
            };
            if (function.online)
            if (function.isOnline())
            {
                barGradualChange.OnStopTrackingTouchEvent = (sender, e) =>
                {
HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs
@@ -90,7 +90,7 @@
                btn.MouseUpEventHandler = (sender, e) => {
                    if (!device.online)
                    if (!device.isOnline())
                    {
                        new Tip()
                        {
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
@@ -290,7 +290,7 @@
        {
            btnSwitchIcon.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -316,7 +316,7 @@
            };
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs
@@ -40,7 +40,7 @@
        /// </summary>
        void LoadControlEvent()
        {
            if (!function.online)
            if (!function.isOnline())
            {
                new Tip()
                {
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -147,7 +147,7 @@
        /// </summary>
        void LoadEvent_TempChange()
        {
            if (!function.online)
            if (!function.isOnline())
            {
                new Tip()
                {
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -92,7 +92,7 @@
        /// </summary>
        void LoadEvet_ChangeColorTemplatrue()
        {
            if (!function.online)
            if (!function.isOnline())
            {
                new Tip()
                {
@@ -148,7 +148,7 @@
        {
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -226,7 +226,7 @@
        {
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -93,7 +93,7 @@
        /// </summary>
        void LoadEvent_DimmerBar()
        {
            if (function.online)
            if (function.isOnline())
            {
                dimmerBar.OnStartTrackingTouchEvent = (sender, e) =>
                {
@@ -158,7 +158,7 @@
        {
            btnSwitch.MouseUpEventHandler += (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
@@ -372,85 +372,91 @@
        /// </summary>
        public void LoadDiv(List<Function> functions,Action action)
        {
            btnIcon = new Button()
            try
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(15),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"
            };
            bodyDiv.AddChidren(btnIcon);
            btnName = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(24),
                Text = function.name,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
            };
            bodyDiv.AddChidren(btnName);
            btnFromFloor = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10 + 24),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(18),
                Text = function.GetRoomListName(),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            bodyDiv.AddChidren(btnFromFloor);
            btnSelect = new Button()
            {
                X = Application.GetRealWidth(303),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png",
                SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png",
                IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null,
                Tag = "ChooseIcon"
            };
            if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
            {
                btnSelect.X = Application.GetRealWidth(323);
            }
            bodyDiv.AddChidren(btnSelect);
            btnSelect.MouseUpEventHandler = (sender, e) => {
                Application.HideSoftInput();
                btnSelect.IsSelected = !btnSelect.IsSelected;
                if(btnSelect.IsSelected)
                btnIcon = new Button()
                {
                    var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
                    if (addTemp == null)
                    {
                        functions.Add(function);
                    }
                }
                else
                    X = Application.GetRealWidth(10),
                    Y = Application.GetRealHeight(15),
                    Width = Application.GetRealWidth(32),
                    Height = Application.GetRealWidth(32),
                    UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"
                };
                bodyDiv.AddChidren(btnIcon);
                btnName = new Button()
                {
                    var removeTemp = functions.Find((obj) => obj.sid == function.sid);
                    if (removeTemp != null)
                    {
                        functions.Remove(removeTemp);
                    }
                    X = Application.GetRealWidth(8 + 10 + 32),
                    Y = Application.GetRealHeight(10),
                    Width = Application.GetRealWidth(200),
                    Height = Application.GetRealHeight(24),
                    Text = function.name,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.FirstLevelTitleColor,
                    TextSize = CSS_FontSize.TextFontSize,
                };
                bodyDiv.AddChidren(btnName);
                btnFromFloor = new Button()
                {
                    X = Application.GetRealWidth(8 + 10 + 32),
                    Y = Application.GetRealHeight(10 + 24),
                    Width = Application.GetRealWidth(200),
                    Height = Application.GetRealHeight(18),
                    Text = function.GetRoomListName(),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = CSS_Color.PromptingColor1,
                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                };
                bodyDiv.AddChidren(btnFromFloor);
                btnSelect = new Button()
                {
                    X = Application.GetRealWidth(303),
                    Gravity = Gravity.CenterVertical,
                    Width = Application.GetRealWidth(32),
                    Height = Application.GetRealWidth(32),
                    UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png",
                    SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png",
                    IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null,
                    Tag = "ChooseIcon"
                };
                if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
                {
                    btnSelect.X = Application.GetRealWidth(323);
                }
                ///刷新界面
                //if (functions.Count == 0 || functions.Count == 1)
                //{
                bodyDiv.AddChidren(btnSelect);
                btnSelect.MouseUpEventHandler = (sender, e) =>
                {
                    Application.HideSoftInput();
                    btnSelect.IsSelected = !btnSelect.IsSelected;
                    if (btnSelect.IsSelected)
                    {
                        var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
                        if (addTemp == null)
                        {
                            functions.Add(function);
                        }
                    }
                    else
                    {
                        var removeTemp = functions.Find((obj) => obj.sid == function.sid);
                        if (removeTemp != null)
                        {
                            functions.Remove(removeTemp);
                        }
                    }
                    ///刷新界面
                    //if (functions.Count == 0 || functions.Count == 1)
                    //{
                    action();
                //}
            };
                    //}
                };
            }catch (Exception ex)
            {
            }
        }
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -102,7 +102,7 @@
        /// </summary>
        void LoadColorChangeEvent()
        {
            if (!function.online)
            if (!function.isOnline())
            {
                new Tip()
                {
@@ -214,7 +214,7 @@
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -231,7 +231,7 @@
                Control.Ins.SendWriteCommand(function, d);
            };
            if (function.online)
            if (function.isOnline())
            {
                dimmerBar.OnStartTrackingTouchEvent = (sender, e) =>
                {
@@ -335,7 +335,7 @@
        {
            btnRestoredPoint.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    return;
                }
HDL_ON/UI/UI2/FuntionControlView/Light/RGBWPageBLL.cs
@@ -88,7 +88,7 @@
        /// </summary>
        void LoadColorChangeEvent()
        {
            if (!function.online)
            if (!function.isOnline())
            {
                new Tip()
                {
@@ -218,7 +218,7 @@
            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -235,7 +235,7 @@
                Control.Ins.SendWriteCommand(function, d);
            };
            if (function.online)
            if (function.isOnline())
            {
                dimmerBar.OnStartTrackingTouchEvent = (sender, e) =>
                {
@@ -339,7 +339,7 @@
        {
            btnRestoredPoint.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    return;
                }
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -63,7 +63,7 @@
        {
            btnSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
@@ -85,7 +85,7 @@
            };
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)
                if (!function.isOnline())
                {
                    new Tip()
                    {
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -142,7 +142,7 @@
                {
                    var a31player = A31MusicModel.A31MusicModelList[i];
                    //if (a31player.functionMusic.online == false)
                    //if (a31player.functionMusic.isOnline() == false)
                    //{
                    //    //不在线不显示
                    //    continue;
@@ -158,7 +158,7 @@
                {
                    var a31player = A31MusicModel.A31MusicModelList[i];
                    if (a31player.functionMusic.online == false)
                    if (a31player.functionMusic.isOnline() == false)
                    {
                        //不在线不读取
                        continue;
@@ -278,7 +278,7 @@
            {
                while (true)
                {
                    if (!player.functionMusic.online)
                    if (!player.functionMusic.isOnline())
                    {
                        ///不在线不读状态
                        continue;
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs
@@ -72,17 +72,17 @@
            };
            faceUnlockView.AddChidren(btnFaceUnlockTipText);
            var btnFaceUnlockSwitchIcon = new Button()
            {
                X = Application.GetRealWidth(322),
                Y = Application.GetRealHeight(8),
                Width = Application.GetMinRealAverage(36),
                Height = Application.GetMinRealAverage(36),
                UnSelectedImagePath = "Public/Switch_2.png",
                SelectedImagePath = "Public/SwitchOn_2.png",
                IsSelected = faceUnlockSwitch,
            };
            faceUnlockView.AddChidren(btnFaceUnlockSwitchIcon);
            //var btnFaceUnlockSwitchIcon = new Button()
            //{
            //    X = Application.GetRealWidth(322),
            //    Y = Application.GetRealHeight(8),
            //    Width = Application.GetMinRealAverage(36),
            //    Height = Application.GetMinRealAverage(36),
            //    UnSelectedImagePath = "Public/Switch_2.png",
            //    SelectedImagePath = "Public/SwitchOn_2.png",
            //    IsSelected = faceUnlockSwitch,
            //};
            //faceUnlockView.AddChidren(btnFaceUnlockSwitchIcon);
@@ -105,119 +105,119 @@
            contentView.AddChidren(view);
            btnFaceUnlockSwitchIcon.MouseUpEventHandler = (sender, e) =>
            {
                waitPage.Start("");
                bool changeState = false;
                if (!btnFaceUnlockSwitchIcon.IsSelected)
                {
                    btnFaceUnlockSwitchIcon.IsSelected = true;
                    changeState = true;
                }
                new System.Threading.Thread(() =>
                {
                    try
                    {
                        var pack = ApiUtlis.Ins.HttpRequest.SetFaceUnlockCfg(device.deviceId, changeState, faceUnlockSetup.mode);
                        if (pack != null && pack.Code == StateCode.SUCCESS)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                //更新界面
                                faceUnlockSetup.enabled = btnFaceUnlockSwitchIcon.IsSelected = changeState;
                                loadSubView(view, faceUnlockSetup);
                            });
                        }
                        else
                        {
                            //失败提示
                            Application.RunOnMainThread(() =>
                            {
                                if (!string.IsNullOrEmpty(pack.message))
                                {
                                    if (string.IsNullOrEmpty(pack.message))
                                    {
                                        pack.message = Language.StringByID(StringId.OperationFailed);
                                    }
                                    var tip = new Tip()
                                    {
                                        MaxWidth = Application.GetRealWidth(300),
                                        Text = $"{pack.message}({pack.Code})",
                                        CloseTime = 3,
                                        Direction = AMPopTipDirection.None
                                    };
                                    tip.Show(MainPage.BaseView);
                                }
                            });
                        }
                    }
                    catch (Exception ex)
                    {
                        MainPage.Log($"btnFaceUnlockSwitchIcon error : {ex.Message}");
                    }
                    finally
                    {
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                        });
                    }
                })
                { IsBackground = true }.Start();
            };
            //btnFaceUnlockSwitchIcon.MouseUpEventHandler = (sender, e) =>
            //{
            //    waitPage.Start("");
            //    bool changeState = false;
            //    if (!btnFaceUnlockSwitchIcon.IsSelected)
            //    {
            //        btnFaceUnlockSwitchIcon.IsSelected = true;
            //        changeState = true;
            //    }
            //    new System.Threading.Thread(() =>
            //    {
            //        try
            //        {
            //            var pack = ApiUtlis.Ins.HttpRequest.SetFaceUnlockCfg(device.deviceId, changeState, faceUnlockSetup.mode);
            //            if (pack != null && pack.Code == StateCode.SUCCESS)
            //            {
            //                Application.RunOnMainThread(() =>
            //                {
            //                    //更新界面
            //                    faceUnlockSetup.enabled = btnFaceUnlockSwitchIcon.IsSelected = changeState;
            //                    loadSubView(view, faceUnlockSetup);
            //                });
            //            }
            //            else
            //            {
            //                //失败提示
            //                Application.RunOnMainThread(() =>
            //                {
            //                    if (!string.IsNullOrEmpty(pack.message))
            //                    {
            //                        if (string.IsNullOrEmpty(pack.message))
            //                        {
            //                            pack.message = Language.StringByID(StringId.OperationFailed);
            //                        }
            //                        var tip = new Tip()
            //                        {
            //                            MaxWidth = Application.GetRealWidth(300),
            //                            Text = $"{pack.message}({pack.Code})",
            //                            CloseTime = 3,
            //                            Direction = AMPopTipDirection.None
            //                        };
            //                        tip.Show(MainPage.BaseView);
            //                    }
            //                });
            //            }
            //        }
            //        catch (Exception ex)
            //        {
            //            MainPage.Log($"btnFaceUnlockSwitchIcon error : {ex.Message}");
            //        }
            //        finally
            //        {
            //            Application.RunOnMainThread(() =>
            //            {
            //                waitPage.Hide();
            //            });
            //        }
            //    })
            //    { IsBackground = true }.Start();
            //};
            new System.Threading.Thread(() => {
                try
                {
                    var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId);
                    if (pack != null && pack.Code == StateCode.SUCCESS)
                    {
                        Application.RunOnMainThread(() =>
                        {
                            //更新界面
                            faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString());
                            btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled;
                            loadSubView(view, faceUnlockSetup);
                        });
                    }
                    else
                    {
                        //失败提示
                        Application.RunOnMainThread(() =>
                        {
                            if (!string.IsNullOrEmpty(pack.message))
                            {
                                if (string.IsNullOrEmpty(pack.message))
                                {
                                    pack.message = Language.StringByID(StringId.OperationFailed);
                                }
                                var tip = new Tip()
                                {
                                    MaxWidth = Application.GetRealWidth(300),
                                    Text = $"{pack.message}({pack.Code})",
                                    CloseTime = 3,
                                    Direction = AMPopTipDirection.None
                                };
                                tip.Show(MainPage.BaseView);
                            }
                        });
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log($"UnlockSettingPage error : {ex.Message}");
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                    });
                }
            //new System.Threading.Thread(() => {
            //    try
            //    {
            //        var pack = ApiUtlis.Ins.HttpRequest.GetFaceUnlockCfg(device.deviceId);
            //        if (pack != null && pack.Code == StateCode.SUCCESS)
            //        {
            //            Application.RunOnMainThread(() =>
            //            {
            //                //更新界面
            //                faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString());
            //                btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled;
            //                loadSubView(view, faceUnlockSetup);
            //            });
            //        }
            //        else
            //        {
            //            //失败提示
            //            Application.RunOnMainThread(() =>
            //            {
            //                if (!string.IsNullOrEmpty(pack.message))
            //                {
            //                    if (string.IsNullOrEmpty(pack.message))
            //                    {
            //                        pack.message = Language.StringByID(StringId.OperationFailed);
            //                    }
            //                    var tip = new Tip()
            //                    {
            //                        MaxWidth = Application.GetRealWidth(300),
            //                        Text = $"{pack.message}({pack.Code})",
            //                        CloseTime = 3,
            //                        Direction = AMPopTipDirection.None
            //                    };
            //                    tip.Show(MainPage.BaseView);
            //                }
            //            });
            //        }
            //    }
            //    catch (Exception ex)
            //    {
            //        MainPage.Log($"UnlockSettingPage error : {ex.Message}");
            //    }
            //    finally
            //    {
            //        Application.RunOnMainThread(() =>
            //        {
            //            waitPage.Hide();
            //        });
            //    }
            })
            { IsBackground = true }.Start();
            //})
            //{ IsBackground = true }.Start();
        }
@@ -330,7 +330,7 @@
        /// <summary>
        /// 开关
        /// </summary>
        public bool enabled = false;
        public bool enabled = true;
        /// <summary>
        /// 解锁方式 0-自动 1-手动
        /// </summary>