wxr
2022-04-14 f48b20ee2ed48652ff4f0bfcdc2cfb8b9340685c
Merge remote-tracking branch 'origin/wjc' into release0123
16个文件已修改
1 文件已重命名
359 ■■■■ 已修改文件
HDL-ON_iOS/HDL-ON_iOS.csproj 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_APP_Project.sln 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LogicMethod.cs 补丁 | 查看 | 原始文档 | blame | 历史
SiriIntents/SiriIntents.csproj 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SiriIntentsUI/SiriIntentsUI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -59,6 +59,7 @@
        <MtouchEnableSGenConc>false</MtouchEnableSGenConc>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodesignProvision>OnPro220307-2-Dev</CodesignProvision>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
        <DebugType>none</DebugType>
@@ -108,7 +109,7 @@
          <HintPath>..\DLL\Linphone\iOS\Shared.IOS.HDLLinphoneSDK.dll</HintPath>
        </Reference>
        <Reference Include="Shared.IOS.HDLSceneSiri">
          <HintPath>..\..\HDLXamarinSceneSiri\Shared.IOS.HDLSceneSiri\Shared.IOS.HDLSceneSiri\bin\Release\Shared.IOS.HDLSceneSiri.dll</HintPath>
          <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
        </Reference>
    </ItemGroup>
    <ItemGroup>
HDL_APP_Project.sln
@@ -18,6 +18,11 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSdk", "UMSdk\UMSdk.csproj", "{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{510DDCFF-AA25-4C6E-B578-B3B7A2EFBB96}"
    ProjectSection(SolutionItems) = preProject
        LogicMethod.cs = LogicMethod.cs
    EndProjectSection
EndProject
Global
    GlobalSection(SharedMSBuildProjectFiles) = preSolution
        HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4
HDL_ON/Entity/Function/Function.cs
@@ -111,13 +111,35 @@
        /// <returns></returns>
        public string GetAttrState(string key)
        {
            //一级查询keyValue值
            var attrState = attributes.Find((s) => s.key == key.ToString());
            if (attrState == null || string.IsNullOrEmpty(attrState.state))
            if (attrState == null)
            {
                return "0";
            }
            if (string.IsNullOrEmpty(attrState.state))
            {
                //二级查询keyValue值
                return GetOriginalState(key);
            }
            return attrState.state;
        }
        /// <summary>
        /// 获取初始状态
        /// 默认值:0
        /// </summary>
        /// <param name="key">语雀定义的属性值</param>
        /// <returns></returns>
        public string GetOriginalState(string key)
        {
            var originalState = status.Find((s) => s.key == key.ToString());
            if (originalState == null || string.IsNullOrEmpty(originalState.value))
            {
                return "0";
            }
            return originalState.value;
        }
        /// <summary>
        /// 设置属性状态
        /// </summary>
HDL_ON/HDL_ON.projitems
@@ -383,7 +383,6 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AirQuality.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\MainView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OnePortAutomation.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Time3.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddLogic.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Set.cs" />
HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs
@@ -9,13 +9,13 @@
    {
        public FunTpye(string str)
        {
            if_type = str;
            if_Type = str;
        }
        /// <summary>
        /// 表示是(条件/目标)
        /// </summary>
        private string if_type;
        private string if_Type;
        Loading loading = new Loading();
        /// <summary>
        /// 设备功能ui
        /// </summary>
@@ -23,6 +23,7 @@
        /// <param name="bottm"></param>
        /// <param name="funCount">支持功能类型个数<表示上面所占高度></param>
        public void FunTypeView(FrameLayout viewLayout,int bottm,int funCount) {
            viewLayout.AddChidren(loading);
            LogicView.FunAllAreaView funAllAreaView = new LogicView.FunAllAreaView();
            funAllAreaView.frameLayout.Y = bottm + Application.GetRealHeight(8);
            viewLayout.AddChidren(funAllAreaView.FLayoutView());
@@ -120,9 +121,9 @@
                        ///切换房间默认:全部功能
                        UserInfo.Current.logicselectedFunction = Language.StringByID(StringId.allFun);
                        ///获取显示设备列表
                        var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_type);
                        var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room, if_Type);
                        DeviceListView(vv, list);
                        this.LoadingDeviceListView(vv, list);
                    };
                    if (roomList.Count - 1 == i)
                    {
@@ -138,7 +139,7 @@
            {
                //获取最终显示列表
                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
                var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
                //获取设备列表的类型(例如:灯光类,窗帘类。。。)
                var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList);
                if (deviceTypeList.Count == 0)
@@ -220,11 +221,11 @@
                        fLayout.RemoveFromParent();
                        funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString();
                        UserInfo.Current.logicselectedFunction = areaView.btnClick.Tag.ToString();
                        ///获取单个类型(例如:灯光类。。)设备FunctionType列表<简称:spk列表>
                        ///获取设备单个大类spk列表(例如:灯光类,空调类...)
                        var typeFunctionList2 = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
                        ///获取单个灯光类型(例如:灯光1,灯光2。。)设备列表
                        ///获取设备单个小类列表(例如:灯光1,灯光2...)
                        var lists2 = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList2, functionList);
                        DeviceListView(vv, lists2);
                       this.LoadingDeviceListView(vv, lists2);
                    };
                    if (deviceTypeList.Count - 1 == i)
@@ -237,16 +238,17 @@
            funAllAreaView.btnText2.MouseUpEventHandler += funClick;
            funAllAreaView.btnIcon2.MouseUpEventHandler += funClick;
            ///获取房间支持的设备列表
            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_type);
            ///获取单个类型(例如:灯光类。。)设备FunctionType列表<简称:spk列表>
            var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(UserInfo.Current.logicselectedRoom, if_Type);
            ///获取设备单个大类spk列表(例如:灯光类,空调类...)
            var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(UserInfo.Current.logicselectedFunction);
            ///获取单个灯光类型(例如:灯光1,灯光2。。)设备列表
            ///获取设备单个小类列表(例如:灯光1,灯光2...)
            var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, deviceList);
            ///房间名称
            funAllAreaView.btnText1.Text = UserInfo.Current.logicselectedRoom.roomName;
            ///功能类型名称<灯光类。。。。。>
            ///设备大类名称<灯光类。。。。。>
            funAllAreaView.btnText2.Text = UserInfo.Current.logicselectedFunction;
            DeviceListView(vv, lists);
            this.LoadingDeviceListView(vv, lists);
        }
@@ -255,40 +257,50 @@
        /// </summary>
        /// <param name="verticalScrolView">上下滑动</param>
        /// <param name="deviceList"></param>
        public void DeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
        private void LoadingDeviceListView(VerticalScrolViewLayout verticalScrolView, List<HDL_ON.Entity.Function> deviceList)
        {
            verticalScrolView.RemoveAll();
            foreach (var dev in deviceList)
            loading.Start();
            System.Threading.Tasks.Task.Run(() =>
            {
                LogicView.SelectTypeView funView = new LogicView.SelectTypeView();
                funView.btnText.Visible = false;
                funView.btnDeviceName.Visible = true;
                funView.btnRoomName.Visible = true;
                funView.btnLine.X = Application.GetRealWidth(16);
                funView.btnLine.Width = Application.GetRealWidth(343);
                verticalScrolView.AddChidren(funView.FLayoutView());
                funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk);
                funView.btnDeviceName.Text = dev.name;
                funView.btnRoomName.Text = dev.GetRoomListName();
                funView.btnClick.MouseUpEventHandler += (sen, e) => {
                    if (if_type == LogicMethod.condition_if)
                Application.RunOnMainThread(() =>
                {
                    loading.Hide();
                    verticalScrolView.RemoveAll();
                    foreach (var dev in deviceList)
                    {
                        ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList();
                        MainPage.BasePageView.AddChidren(conditionDeviceFunList);
                        conditionDeviceFunList.Show(dev, 0, false);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    }
                    else
                    {
                        TargetDeviceFunList targetDeviceFunList = new TargetDeviceFunList();
                        MainPage.BasePageView.AddChidren(targetDeviceFunList);
                        targetDeviceFunList.Show(dev, 0, false);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    }
                        LogicView.SelectTypeView funView = new LogicView.SelectTypeView();
                        funView.btnText.Visible = false;
                        funView.btnDeviceName.Visible = true;
                        funView.btnRoomName.Visible = true;
                        funView.btnLine.X = Application.GetRealWidth(16);
                        funView.btnLine.Width = Application.GetRealWidth(343);
                        verticalScrolView.AddChidren(funView.FLayoutView());
                        funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk);
                        funView.btnDeviceName.Text = dev.name;
                        funView.btnRoomName.Text = dev.GetRoomListName();
                        funView.btnClick.MouseUpEventHandler += (sen, e) =>
                        {
                            if (if_Type == LogicMethod.condition_if)
                            {
                                ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList();
                                MainPage.BasePageView.AddChidren(conditionDeviceFunList);
                                conditionDeviceFunList.Show(dev, 0, false);
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            }
                            else
                            {
                                TargetDeviceFunList targetDeviceFunList = new TargetDeviceFunList();
                                MainPage.BasePageView.AddChidren(targetDeviceFunList);
                                targetDeviceFunList.Show(dev, 0, false);
                                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            }
                };
            }
                        };
                    }
                });
            });
        }
    }
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -992,8 +992,6 @@
                                    }
                                    break;
                                case SPK.CurtainSwitch:
                                case SPK.CurtainTrietex:
                                case SPK.CurtainRoller:
                                    {
                                        foreach (var dic in dicList)
                                        {
@@ -1016,6 +1014,29 @@
                                                    }
                                                    break;
                                            }
                                        }
                                    }
                                    break;
                                case SPK.CurtainTrietex:
                                case SPK.CurtainRoller:
                                    {
                                        string on_off = GetKeyValue("on_off", dicList);
                                        string percent = GetKeyValue("percent", dicList);
                                        if (on_off == "on" && percent != "")
                                        {
                                            stateStr = Language.StringByID(StringId.onLogic) + percent + "%";
                                        }
                                        else if (on_off == "on")
                                        {
                                            stateStr = Language.StringByID(StringId.onLogic);
                                        }
                                        else if (on_off == "off")
                                        {
                                            stateStr = Language.StringByID(StringId.offLogic);
                                        }
                                        else if (percent != "")
                                        {
                                            stateStr = percent + "%";
                                        }
                                    }
                                    break;
@@ -1455,8 +1476,6 @@
                    }
                    break;
                case SPK.CurtainSwitch:
                case SPK.CurtainTrietex:
                case SPK.CurtainRoller:
                    {
                        foreach (var dic in dicList)
                        {
@@ -1480,6 +1499,52 @@
                                    break;
                            }
                        }
                    }
                    break;
                case SPK.CurtainTrietex:
                case SPK.CurtainRoller:
                    {
                        foreach (var dic in dicList)
                        {
                            string value = dic["value"];
                            switch (dic["key"])
                            {
                                case "on_off":
                                    {
                                        switch (value)
                                        {
                                            case "on":
                                                {
                                                    button1.Text = Language.StringByID(StringId.onLogic);
                                                }
                                                break;
                                            case "off":
                                                {
                                                    button1.Text = Language.StringByID(StringId.offLogic);
                                                }
                                                break;
                                            case "stop":
                                                {
                                                    button1.Text = Language.StringByID(StringId.stop);
                                                }
                                                break;
                                        }
                                    }
                                    break;
                                case "percent":
                                    {
                                        if (button2 == null)
                                        {
                                            //怕调试软件乱上东西导致抛异常
                                            break;
                                        }
                                        button2.Text = value + "%";
                                    }
                                    break;
                            }
                        }
                    }
                    break;
                case SPK.AcStandard:
@@ -2147,11 +2212,11 @@
            //确定点击事件
            timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) =>
            {
                if (timepoint == 0)
                {
                    //提示
                    return;
                }
                //if (timepoint == 0)
                //{
                //    //提示
                //    return;
                //}
                fLayout.RemoveFromParent();
                action(timepoint);
            };
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -173,6 +173,7 @@
        logicIfon.Add("noticeConfig", noticeConfigJObject);
        logicIfon.Add("pushConfigs", pushConfigsArray);
        logicjArray.Add(logicIfon);
        //string str = logicIfon.ToString();
        var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } };
        responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add, 5);
        //如果是token过期则刷新token
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -68,6 +68,7 @@
                        lightSwitchView.btnText.TextID = StringId.switchLogic;
                        fLayout.AddChidren(lightSwitchView.FLayoutView());
                        ///设备延时iewv
                        DelayView(fLayout, lightSwitchView.frameLayout.Bottom);
                        #endregion
@@ -101,7 +102,7 @@
                        brightnessView.frameLayout.Y = lightSwitchView.frameLayout.Bottom;
                        brightnessView.btnText.TextID = StringId.brightnesLogic;
                        fLayout.AddChidren(brightnessView.FLayoutView());
                        brightnessView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06
                        //brightnessView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06
                        ///设备延时iewv
                        DelayView(fLayout, brightnessView.frameLayout.Bottom);
                        #endregion
@@ -127,15 +128,12 @@
                    break;
                //窗帘
                case SPK.CurtainSwitch:
                case SPK.CurtainTrietex:
                case SPK.CurtainRoller:
                    {
                        #region 界面
                        ///开关
                        LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView();
                        curtainSwitchView.btnText.TextID = StringId.switchLogic;
                        fLayout.AddChidren(curtainSwitchView.FLayoutView());
                        ///设备延时iewv
                        DelayView(fLayout, curtainSwitchView.frameLayout.Bottom);
                        #endregion
                        #region 点击事件
@@ -148,6 +146,42 @@
                        {
                            //显示编辑之前的设备状态
                            GetEditState(device, index, curtainSwitchView.btnState, null, null, null);
                        }
                        #endregion
                    }
                    break;
                case SPK.CurtainTrietex:
                case SPK.CurtainRoller:
                    {
                        #region 界面
                        ///开关
                        LogicView.FunTypeView curtainSwitchView = new LogicView.FunTypeView();
                        curtainSwitchView.btnText.TextID = StringId.switchLogic;
                        fLayout.AddChidren(curtainSwitchView.FLayoutView());
                        ///百分比
                        LogicView.FunTypeView crtainPercentumView = new LogicView.FunTypeView();
                        crtainPercentumView.frameLayout.Y = curtainSwitchView.frameLayout.Bottom;
                        crtainPercentumView.btnText.TextID = StringId.percentum;
                        fLayout.AddChidren(crtainPercentumView.FLayoutView());
                        crtainPercentumView.btnState.Text = "5%";//产品经理晓辉要求改的 2021-11-06
                        ///设备延时iewv
                        DelayView(fLayout, crtainPercentumView.frameLayout.Bottom);
                        #endregion
                        #region 点击事件
                        ///开关点击事件
                        curtainSwitchView.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            SwitchViewMethod(device, curtainSwitchView.btnState, 3);
                        };
                        ///百分比点击事件
                        crtainPercentumView.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            BrightnessMethod(device, crtainPercentumView.btnState, crtainPercentumView.btnText.Text);
                        };
                        if (edit)
                        {
                            //显示编辑之前的设备状态
                            GetEditState(device, index, curtainSwitchView.btnState, crtainPercentumView.btnState, null, null);
                        }
                        #endregion
                    }
@@ -604,8 +638,9 @@
        /// <summary>
        /// 亮度/百分比=功能下一级界面
        /// </summary>
        /// <param name="device"></param>
        /// <param name="button"></param>
        /// <param name="device">设备对象</param>
        /// <param name="button">显示状态对象</param>
        /// <param name="titleName">标题</param>
        private void BrightnessMethod(Entity.Function device, Button button, string titleName)
        {
            #region 界面
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
@@ -52,7 +52,7 @@
        {
            bodyView = this;
            function = func;
        }
        /// <summary>
        /// 加载界面
HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicModel.cs
@@ -57,13 +57,14 @@
        /// ((当前时间)DateTime.Now - (记录时间)LastDateTimeLastDateTime).TotalSeconds=误差时间(秒)
        /// </summary>
        public DateTime LastDateTime;
        /// <summary>
        /// 记录滑动音量条时间<用来处理音量跳动>
        /// </summary>
        public static DateTime ProgressDateTime = DateTime.MinValue;
        /// <summary>
        /// 音乐播放器ID
        /// </summary>
        public string UniqueDeviceName = string.Empty;
        public MusicInfo CurrentMusic = new MusicInfo();
@@ -114,10 +115,7 @@
       
        public Slaves Slave = new Slaves();
        /// <summary>
        /// 记录时间
        /// </summary>
        public static DateTime ProgressDateTime = DateTime.Now;
        /// <summary>
        /// 判断是否是json数据
HDL_ON/UI/UI2/FuntionControlView/Music/A31PlayMusicPage.cs
@@ -92,7 +92,8 @@
             {
                 string modeValueString = string.Empty; 
                 string msg = Language.StringByID(StringId.switchTo);
                 switch (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.mode))
                 string modeKeyValue = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.mode);
                 switch (modeKeyValue)
                 {
                     //list_cycle列表循环,single_cycle单曲循环,random随机播放;
                     case ValueProperty.list_cycle:
@@ -110,6 +111,7 @@
                         playView.playOrderBtn.UnSelectedImagePath = "MusicIcon/list.png";
                         msg += Language.StringByID(StringId.listMode);
                         break;
                 }
                 A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.mode, modeValueString);
                 new PublicAssmebly().TipMsgAutoClose(msg, false,1000);
@@ -213,6 +215,8 @@
                playView.volValueBtn.Text = playView.volSeekBar.Progress + "%";
                if (startVolume != e)
                {
                    ///更新最新值
                    A31MusicModel.ProgressDateTime = DateTime.Now;
                    startVolume = e;
                    A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.volume, startVolume);
                    Dictionary<string, string> dic = new Dictionary<string, string>();
@@ -245,7 +249,8 @@
                if (playView.playBtn.IsSelected)
                {
                    playView.playBtn.IsSelected = false;
                    status = ValueProperty.off;
                    status = ValueProperty.off;
                }
                else
                {
@@ -388,8 +393,8 @@
                            //        playView.volValueBtn.Text = A31MusicModel.Current.A31PlayStatus.vol + "%";
                            //    }
                            //}
                            if (1000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds)
                            //为了防止音量条跳动,延长更新时间(多加1s)
                            if (2000 < (DateTime.Now - A31MusicModel.ProgressDateTime).TotalMilliseconds || A31MusicModel.ProgressDateTime==DateTime.MinValue)
                            {
                                //音量进度条;
                                playView.volSeekBar.Progress = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume));
@@ -397,15 +402,31 @@
                                playView.volValueBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.volume) + "%";
                            }
                            //更新播放器音量给系统音量
                            Volume.MusicVolume = playView.volSeekBar.Progress;
                            //Volume.MusicVolume = playView.volSeekBar.Progress;
                            //当前播放音乐时间
                            //按道理不会为空,GetAttrState("playing_time")值可能为空,强制转换int.Parse()会出现异常,不过也做了异常处理了
                            int playSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playing_time))+ (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
                            int playSecond = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playing_time));
                            //识别音乐状态是否在播放状态
                            if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
                            {
                                //音乐在播放时,再计算播放时间(现在时间=原来时间+1秒)
                                playSecond +=(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds;
                                ///歌曲记录暂时时间写入缓存;
                                A31MusicModel.Current.functionMusic.SetAttrState(KeyProperty.playing_time, playSecond);
                            }
                            if (playSecond<=0)
                            {
                                ///播放时间不能小于0;
                                playSecond = 0;
                            }
                            if (playSecond >=totalSecond)
                            {
                                ///播放时间不能超过总时间;
                                playSecond = totalSecond;
                            }
                            int playMusicMinute = playSecond / 60;
                            //秒钟
                            int playMusicSecond = playSecond % 60;
                            string playTime = (playMusicMinute.ToString().Length < 2 ? "0" + playMusicMinute.ToString() : playMusicMinute.ToString()) + ":" + (playMusicSecond.ToString().Length < 2 ? "0" + playMusicSecond.ToString() : playMusicSecond.ToString());
                            if (A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
@@ -431,6 +452,9 @@
                                playView.playBtn.IsSelected = false;
                                //停止播放
                                playView.startTimeBtn.Text =playTime;
                                //playView.startTimeBtn.Text ="00:00";
                                ///歌曲记录暂停时间;<LastDateTime 计算时间播放时间有用到>
                                A31MusicModel.Current.LastDateTime = DateTime.Now;
                            }
                            playView.songNameTextView.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
                            playView.singerBtn.Text = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name) == null ? "Unkown" : A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.song_name);
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -167,6 +167,7 @@
                    {
                        try
                        {
                            SendMethod.mMethod.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId });
                            System.Threading.Thread.Sleep(500);
                        }
@@ -290,6 +291,7 @@
                        musicView.musicNameBtn.Text = player.functionMusic.name;
                        if (player.functionMusic.GetAttrState(KeyProperty.on_off) == ValueProperty.on)
                        {
                            musicView.playBtn.IsSelected = true;
                        }
                        else
HDL_ON/UI/UI2/FuntionControlView/Music/MusicProperty.cs
@@ -105,14 +105,18 @@
        /// </summary>
        public const string down = "down";
        /// <summary>
        /// 开<on>
        /// 开/播放<on>
        /// </summary>
        public const string on = "on";
        /// <summary>
        /// 关<off>
        /// 关/停止<off>
        /// </summary>
        public const string off = "off";
        /// <summary>
        /// 暂停
        /// </summary>
        public const string pause = "pause";
        /// <summary>
        /// 单曲<single>
        /// </summary>
        public const string single = "single";
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -12,7 +12,7 @@
{
    public class SendMethod
    {
        private static SendMethod sMethod=null;
        private static SendMethod sMethod = null;
        public static SendMethod mMethod
        {
            get
@@ -48,7 +48,8 @@
            })
            { IsBackground = true }.Start();
        }
        //记录歌曲播放时间
        private int songPlayTime = -1;
        /// <summary>
        /// 获取设备最新的状态
        /// </summary>
@@ -58,7 +59,7 @@
            try
            {
                //RefreshDeviceStatus(functionIds);
                a31Music.LastDateTime = DateTime.Now;
                //a31Music.LastDateTime = DateTime.Now;
                ///从缓存里面查找音乐播放器对象<缓存数据收到推送过来的状态会更新缓存数据>
                var allLocalFuntion = FunctionList.List.GetDeviceFunctionList();
                var localFunction = allLocalFuntion.Find((obj) => obj.sid == sid);
@@ -68,6 +69,13 @@
                }
                ///更新的数据
                a31Music.functionMusic = localFunction;
                if (int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time)) != songPlayTime)
                {
                    ///歌曲记录时间和当前时间不一样,立即更新数据反馈时间
                    a31Music.LastDateTime = DateTime.Now;
                    ///歌曲记录时间和当前时间不一样,立即更新歌曲播放时间
                    songPlayTime = int.Parse(A31MusicModel.Current.functionMusic.GetAttrState(UI2.FuntionControlView.Music.KeyProperty.playing_time));
                }
            }
            catch { }
@@ -89,6 +97,7 @@
                {
                    return;
                }
            }
            catch { }
        }
@@ -121,7 +130,7 @@
                d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
                d.Add("deviceIds", new List<string> { music.deviceId });
                var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList);
                if (responsePackNew.Code != "0"||responsePackNew.Data == null ||responsePackNew.Data.ToString() == "")
                if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "")
                {
                    return;
                }
@@ -130,7 +139,7 @@
                var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str);
                if (palyLists == null)
                {
                    palyLists =new List<PalyListInfo>();
                    palyLists = new List<PalyListInfo>();
                }
                if (palyLists.Count > 0)
                {
@@ -143,12 +152,12 @@
            }
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId) 
        /// </summary>
        /// <returns></returns>
        public  ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
        public ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 5)
        {
            var requestJson = HttpUtil.GetSignRequestJson(o);
            return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
LogicMethod.cs
SiriIntents/SiriIntents.csproj
@@ -28,6 +28,7 @@
    <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
    <DeviceSpecificBuild>false</DeviceSpecificBuild>
    <MtouchVerbosity></MtouchVerbosity>
    <CodesignProvision>OnProSiri220307-2-Dev</CodesignProvision>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
    <DebugType>pdbonly</DebugType>
@@ -85,15 +86,15 @@
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
    <Reference Include="Xamarin.iOS" />
    <Reference Include="Shared.IOS.HDLSceneSiri">
      <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
    </Reference>
    <Reference Include="Newtonsoft.Json">
      <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
    </Reference>
    <Reference Include="RestSharp">
      <HintPath>..\packages\RestSharp.106.13.0\lib\netstandard2.0\RestSharp.dll</HintPath>
    </Reference>
    <Reference Include="Shared.IOS.HDLSceneSiri">
      <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Resources\" />
SiriIntentsUI/SiriIntentsUI.csproj
@@ -29,6 +29,7 @@
    <DeviceSpecificBuild>false</DeviceSpecificBuild>
    <MtouchVerbosity></MtouchVerbosity>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <CodesignProvision>OnProSiriUI220307-2-Dev</CodesignProvision>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
    <DebugType>pdbonly</DebugType>