From a100ed2898468add96398ae069080a103c355c08 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 17 七月 2023 16:41:41 +0800 Subject: [PATCH] 视频门锁优化 --- HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 17 + HDL-ON_iOS/Resources/Language.ini | 7 HDL-ON_Android/Assets/Language.ini | 7 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockBatteryManagementPage.cs | 39 +++ HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs | 200 ++++++++++---------- HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockAudioSetupPage.cs | 212 ++++++++++++++++++++ HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs | 38 ++- HDL_ON/Common/R.cs | 5 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 12 HDL_ON/DAL/Server/HttpServerRequest.cs | 4 HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs | 3 HDL_ON/HDL_ON.projitems | 1 12 files changed, 412 insertions(+), 133 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 2f08a7f..5190f56 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -662,6 +662,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. @@ -1998,6 +1999,7 @@ 675=浣� 676=涓� 677=楂� +678=褰撳墠鐢ㄦ埛鏁版嵁宸叉竻绌猴紝鍗冲皢杩斿洖涓婁竴椤点�� 2532=璁垮閭�璇疯褰� @@ -3331,8 +3333,7 @@ 675=Low 676=Moderate 677=High - - +678=Current user data has been cleared, about to return to the previous page. @@ -4663,6 +4664,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. @@ -5982,6 +5984,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 2f08a7f..5190f56 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -662,6 +662,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. @@ -1998,6 +1999,7 @@ 675=浣� 676=涓� 677=楂� +678=褰撳墠鐢ㄦ埛鏁版嵁宸叉竻绌猴紝鍗冲皢杩斿洖涓婁竴椤点�� 2532=璁垮閭�璇疯褰� @@ -3331,8 +3333,7 @@ 675=Low 676=Moderate 677=High - - +678=Current user data has been cleared, about to return to the previous page. @@ -4663,6 +4664,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. @@ -5982,6 +5984,7 @@ 675=Low 676=Moderate 677=High +678=Current user data has been cleared, about to return to the previous page. diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index efe31ce..34d0c0b 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,6 +4,11 @@ { public static class StringId { + + /// <summary> + /// 褰撳墠鐢ㄦ埛鏁版嵁鏄竻绌猴紝鍗冲皢杩斿洖涓婁竴椤点�� + /// </summary> + public const int VideoDoorlockDelDataTip = 678; /// <summary> /// 楂� /// </summary> diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 4e6e381..ffb4986 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -3404,7 +3404,7 @@ /// <param name="deviceId"></param> /// <param name="sound"></param> /// <returns></returns> - public ResponsePackNew SetDoorLockSystemSound(string deviceId,string sound) + public ResponsePackNew SetDoorLockSystemSound(string deviceId,int sound) { var d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); @@ -3434,7 +3434,7 @@ /// <param name="deviceId"></param> /// <param name="volume"></param> /// <returns></returns> - public ResponsePackNew SetDoorBellTone(string deviceId, string volume) + public ResponsePackNew SetDoorBellTone(string deviceId, int volume) { var d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 1a3d3f2..ae55268 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -564,6 +564,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockFaceUnlockTriggerSettingPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockFaceUnlockHelpPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockAudioSetupPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockBatteryManagementPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index be9d341..f4359b9 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -1026,7 +1026,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(200), + Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, @@ -1176,7 +1177,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(200), + Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, @@ -1534,7 +1536,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(200), + Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, @@ -1735,7 +1738,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(200), + Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs index e9a06e2..8b146ad 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs @@ -314,6 +314,13 @@ TextID = StringId.AudioSetup, }; audioSetupView.AddChidren(btnAudioSetupText); + btnAudioSetupText.MouseUpEventHandler = (sender, e) => { + var page = new VideoDoorlockAudioSetupPage(function); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + }; #endregion #region 鐢垫睜绠$悊 @@ -351,6 +358,12 @@ TextID = StringId.BatteryManagement, }; batteryManagementView.AddChidren(btnBatteryManagementText); + btnBatteryManagementText.MouseUpEventHandler = (sender, e) => { + var page = new VideoDoorlockBatteryManagementPage(); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; #endregion @@ -383,7 +396,7 @@ serialView.AddChidren(serialTextBtn); var serialValuesBtn = new Button() { - X = Application.GetRealWidth(86), + X = Application.GetRealWidth(106), Width = Application.GetRealWidth(237), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, @@ -421,7 +434,7 @@ modelView.AddChidren(modelTextBtn); var modelValuesBtn = new Button() { - X = Application.GetRealWidth(86), + X = Application.GetRealWidth(106), Width = Application.GetRealWidth(237), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs index b20ce5f..f1ee2e9 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/UnlockSettingFacePage.cs @@ -153,103 +153,11 @@ BackgroundColor = CSS_Color.BackgroundColor, }); - - #region 瑙﹀彂鏂瑰紡 TriggerMode - var triggerModeView = new FrameLayout() + var view = new VerticalScrolViewLayout() { - Height = Application.GetRealHeight(50), - BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + Height = Application.GetRealHeight(300), }; - contentView.AddChidren(triggerModeView); - - var btnTriggerModeRight = new Button() - { - X = Application.GetRealWidth(339), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/Right.png", - }; - triggerModeView.AddChidren(btnTriggerModeRight); - - var btnTriggerModeStateText = new Button() - { - X = Application.GetRealWidth(100), - Width = Application.GetRealWidth(223), - TextAlignment = TextAlignment.CenterRight, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.PromptingColor1, - }; - triggerModeView.AddChidren(btnTriggerModeStateText); - - var btnTriggerModeText = new Button() - { - X = Application.GetRealWidth(16), - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - TextAlignment = TextAlignment.CenterLeft, - TextID = StringId.TriggerMode, - }; - triggerModeView.AddChidren(btnTriggerModeText); - - btnTriggerModeText.MouseUpEventHandler = (sender, e) => - { - var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - - }; - #endregion - - contentView.AddChidren(new Button() - { - Height = 1, - BackgroundColor = CSS_Color.PromptingColor1, - Gravity = Gravity.CenterHorizontal, - }); - - - #region 浜鸿劯褰曞叆甯姪 - var faceEntryHelpView = new FrameLayout() - { - Height = Application.GetRealHeight(50), - BackgroundColor = CSS.CSS_Color.MainBackgroundColor, - }; - contentView.AddChidren(faceEntryHelpView); - - var btnFaceEntryHelpRight = new Button() - { - X = Application.GetRealWidth(339), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/Right.png", - }; - faceEntryHelpView.AddChidren(btnFaceEntryHelpRight); - - - var btnFaceEntryHelpText = new Button() - { - X = Application.GetRealWidth(16), - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - TextAlignment = TextAlignment.CenterLeft, - TextID = StringId.FaceEntryHelp, - }; - faceEntryHelpView.AddChidren(btnFaceEntryHelpText); - - btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) => { - var page = new VideoDoorlockFaceUnlockHelpPage(); - MainPage.BasePageView.AddChidren(page); - page.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - #endregion - - - - + contentView.AddChidren(view); new System.Threading.Thread(() => { try @@ -262,8 +170,7 @@ //鏇存柊鐣岄潰 faceUnlockSetup = Newtonsoft.Json.JsonConvert.DeserializeObject<FaceUnlockSetupObj>(pack.Data.ToString()); btnFaceUnlockSwitchIcon.IsSelected = faceUnlockSetup.enabled; - - btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering; + loadSubView(view, faceUnlockSetup); }); } else @@ -284,8 +191,6 @@ } }); } - - } catch (Exception ex) { @@ -304,6 +209,101 @@ } + void loadSubView(VerticalScrolViewLayout view, FaceUnlockSetupObj faceUnlockSetup) + { + if (faceUnlockSetup.enabled) + { + #region 瑙﹀彂鏂瑰紡 TriggerMode + var triggerModeView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + }; + view.AddChidren(triggerModeView); + + var btnTriggerModeRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + triggerModeView.AddChidren(btnTriggerModeRight); + + var btnTriggerModeStateText = new Button() + { + X = Application.GetRealWidth(100), + Width = Application.GetRealWidth(223), + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.PromptingColor1, + }; + triggerModeView.AddChidren(btnTriggerModeStateText); + btnTriggerModeStateText.TextID = faceUnlockSetup.mode == 0 ? StringId.AutomaticTriggering : StringId.ManualTriggering; + + var btnTriggerModeText = new Button() + { + X = Application.GetRealWidth(16), + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.TriggerMode, + }; + triggerModeView.AddChidren(btnTriggerModeText); + + btnTriggerModeText.MouseUpEventHandler = (sender, e) => + { + var page = new VideoDoorlockFaceUnlockTriggerSettingPage(device, faceUnlockSetup); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + + }; + #endregion + + view.AddChidren(new Button { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); + } + #region 浜鸿劯褰曞叆甯姪 + var faceEntryHelpView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + }; + view.AddChidren(faceEntryHelpView); + + var btnFaceEntryHelpRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/Right.png", + }; + faceEntryHelpView.AddChidren(btnFaceEntryHelpRight); + + + var btnFaceEntryHelpText = new Button() + { + X = Application.GetRealWidth(16), + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + TextID = StringId.FaceEntryHelp, + }; + faceEntryHelpView.AddChidren(btnFaceEntryHelpText); + + btnFaceEntryHelpText.MouseUpEventHandler = (sender, e) => + { + var page = new VideoDoorlockFaceUnlockHelpPage(); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + #endregion + + } + } /// <summary> @@ -314,7 +314,7 @@ /// <summary> /// 寮�鍏� /// </summary> - public bool enabled; + public bool enabled = false; /// <summary> /// 瑙i攣鏂瑰紡 0-鑷姩 1-鎵嬪姩 /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockAudioSetupPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockAudioSetupPage.cs index fda1210..cfa8765 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockAudioSetupPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockAudioSetupPage.cs @@ -12,6 +12,15 @@ FrameLayout bodyView; Function device; + + /// <summary> + /// 闂ㄩ搩绯荤粺闊抽噺 + /// </summary> + int doorlockSystemSound = 0; + /// <summary> + /// 闂ㄩ搩闊抽噺 + /// </summary> + int doorbelVol = 0; public VideoDoorlockAudioSetupPage(Function function) { device = function; @@ -65,7 +74,7 @@ btnDoorlockSystemVolumeText.MouseUpEventHandler = (sender, e) => { - + LoadEditDialog(StringId.DoorlockSystemVolume, 3-doorlockSystemSound, btnDoorlockSystemVolumeStateText); }; #endregion @@ -115,6 +124,7 @@ btnDoorbellVolumeText.MouseUpEventHandler = (sender, e) => { + LoadEditDialog(StringId.DoorbellVolume, doorbelVol, btnDoorbellVolumeStateText); }; #endregion @@ -145,15 +155,19 @@ switch (doorLockSystemSound.sound) { case 0: + doorlockSystemSound = 0; btnDoorlockSystemVolumeStateText.TextID = StringId.Mute; break; case 1: + doorlockSystemSound = 1; btnDoorlockSystemVolumeStateText.TextID = StringId.Low; break; case 2: + doorlockSystemSound = 2; btnDoorlockSystemVolumeStateText.TextID = StringId.Moderate; break; case 3: + doorlockSystemSound = 3; btnDoorlockSystemVolumeStateText.TextID = StringId.High; break; } @@ -191,18 +205,22 @@ { if (doorbellTone.volume == 0) { + doorbelVol = 3; btnDoorbellVolumeStateText.TextID = StringId.Mute; } else if (doorbellTone.volume > 0 && doorbellTone.volume < 35) { + doorbelVol = 2; btnDoorbellVolumeStateText.TextID = StringId.Low; } else if (doorbellTone.volume > 35 && doorbellTone.volume < 70) { + doorbelVol = 1; btnDoorbellVolumeStateText.TextID = StringId.Moderate; } else if (doorbellTone.volume > 70) { + doorbelVol = 0; btnDoorbellVolumeStateText.TextID = StringId.High; } } @@ -253,7 +271,7 @@ /// <summary> /// 鍔犺浇鍔熻兘灞炴�ф暟鎹�夋嫨寮圭獥 /// </summary> - void LoadEditDialog_FunctionPar(int titleId, int index, Button btn) + void LoadEditDialog(int titleId, int index, Button btn) { Button lastButton = new Button(); var lastData = ""; @@ -314,7 +332,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(200), + Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, @@ -349,7 +368,6 @@ Height = 1, }); } - hei++; var btnChoose = new Button() { @@ -373,7 +391,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, - Tag = index, + Tag = hei-1, Text = m }; row.AddChidren(btnPropertyTitle); @@ -388,6 +406,7 @@ lastData = btnPropertyTitle.Tag.ToString(); lastText = btnPropertyTitle.Text; }; + hei++; } @@ -404,9 +423,186 @@ }; btnConfrim.MouseUpEventHandler = (sender, e) => { dialog.Close(); - trait.value = lastData; - //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; - btn.Text = lastText; + if(titleId == StringId.DoorlockSystemVolume) + { + + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(""); + + new System.Threading.Thread(() => { + try + { + int sound = 0; + /// 0-闈欓煶 1-浣庨煶 2-涓煶 3-楂橀煶 4-鑷姩 + + switch (lastData) + { + case "0": + sound = 3; + break; + case "1": + sound = 2; + break; + case "2": + sound = 1; + break; + case "3": + sound = 0; + break; + } + + + var pack = ApiUtlis.Ins.HttpRequest.SetDoorLockSystemSound(device.deviceId,sound); + if (pack != null && pack.Code == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + //鏇存柊鐣岄潰 + switch (sound) + { + case 0: + btn.TextID = StringId.Mute; + break; + case 1: + btn.TextID = StringId.Low; + break; + case 2: + btn.TextID = StringId.Moderate; + break; + case 3: + btn.TextID = StringId.High; + break; + } + }); + } + else + { + //澶辫触鎻愮ず + Application.RunOnMainThread(() => + { + if (!string.IsNullOrEmpty(pack.message)) + { + 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($"{this.GetType()} error 4: {ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + waitPage.Hide(); + }); + } + + }) + { IsBackground = true }.Start(); + + + + } + else + { + + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(""); + + new System.Threading.Thread(() => { + try + { + int Vol = 0; + switch (lastData) + { + case "0": + Vol = 100; + break; + case "1": + Vol = 70; + break; + case "2": + Vol = 30; + break; + case "3": + Vol = 0; + break; + } + + var pack = ApiUtlis.Ins.HttpRequest.SetDoorBellTone(device.deviceId,Vol); + if (pack != null && pack.Code == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + //鏇存柊鐣岄潰 + switch (lastData) + { + case "0": + btn.TextID = StringId.High; + break; + case "1": + btn.TextID = StringId.Moderate; + break; + case "2": + btn.TextID = StringId.Low; + break; + case "3": + btn.TextID = StringId.Mute; + break; + } + }); + } + else + { + //澶辫触鎻愮ず + Application.RunOnMainThread(() => + { + if (!string.IsNullOrEmpty(pack.message)) + { + 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($"{this.GetType()} error 5 : {ex.Message}"); + } + finally + { + Application.RunOnMainThread(() => + { + waitPage.Hide(); + }); + } + + }) + { IsBackground = true }.Start(); + + + + } }; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockBatteryManagementPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockBatteryManagementPage.cs new file mode 100644 index 0000000..3491440 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockBatteryManagementPage.cs @@ -0,0 +1,39 @@ +锘縰sing System; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock +{ + public class VideoDoorlockBatteryManagementPage : FrameLayout + { + FrameLayout bodyView; + + + public VideoDoorlockBatteryManagementPage() + { + bodyView = this; + + } + + public void LoadPage() + { + new TopViewDiv(bodyView, Language.StringByID(StringId.AudioSetup)).LoadTopView(); + bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; + + var btn = new Button() + { + Width = Application.GetRealWidth(343), + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(64 + 24), + IsMoreLines = true, + TextAlignment = TextAlignment.TopLeft, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + }; + bodyView.AddChidren(btn); + + + + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs index 7faddc9..67cc900 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockFaceUnlockTriggerSettingPage.cs @@ -107,9 +107,6 @@ TextID = StringId.ManualTriggering, }; manualView.AddChidren(btnManualText); - btnManualText.MouseUpEventHandler = (sender, e) => { - - }; #endregion diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs index 36eea30..97ec8e1 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs @@ -98,6 +98,20 @@ void initOptionView(bool isEdit) { + if(doorlockUser.faceCount == 0&& + doorlockUser.faceCount == 0 && + doorlockUser.pwdCount == 0 && + doorlockUser.cardCount == 0) + { + new PublicAssmebly().TipMsg(StringId.Tip, StringId.VideoDoorlockDelDataTip, () => + { + delCallBackAction?.Invoke(); + this.RemoveFromParent(); + }); + return; + } + + int childrenViewHeight = Application.GetRealWidth(116); int permissionsViewHeight = Application.GetRealHeight(291 + 92); if (userPermissionsView!= null) @@ -241,6 +255,7 @@ { Application.RunOnMainThread(() => { + doorlockUser.fingerCount = 0; //鏇存柊鐣岄潰 initOptionView(true); }); @@ -310,17 +325,17 @@ }; digitalPasswordView.AddChidren(btnDigitalPasswordText); - if (doorlockUser.fingerCount > 0) + if (doorlockUser.pwdCount > 0) { btnDigitalPasswordIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordOnIcon.png"; btnDigitalPasswordText.TextColor = CSS_Color.FirstLevelTitleColor; if (Language.CurrentLanguage == "Chinese") { - btnDigitalPasswordText.Text = doorlockUser.fingerCount + "缁�" + Language.StringByID(StringId.DigitalPassword); + btnDigitalPasswordText.Text = doorlockUser.pwdCount + "缁�" + Language.StringByID(StringId.DigitalPassword); } else { - btnDigitalPasswordText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.DigitalPassword); + btnDigitalPasswordText.Text = doorlockUser.pwdCount + " " + Language.StringByID(StringId.DigitalPassword); } if (isEdit) @@ -350,6 +365,7 @@ { Application.RunOnMainThread(() => { + doorlockUser.pwdCount = 0; //鏇存柊鐣岄潰 initOptionView(true); }); @@ -419,17 +435,17 @@ }; nfcView.AddChidren(btnNfcText); - if (doorlockUser.fingerCount > 0) + if (doorlockUser.cardCount > 0) { btnNfcIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/NfcOnIcon.png"; btnNfcText.TextColor = CSS_Color.FirstLevelTitleColor; if (Language.CurrentLanguage == "Chinese") { - btnNfcText.Text = doorlockUser.fingerCount + "缁�" + Language.StringByID(StringId.NfcKey); + btnNfcText.Text = doorlockUser.cardCount + "缁�" + Language.StringByID(StringId.NfcKey); } else { - btnNfcText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.NfcKey); + btnNfcText.Text = doorlockUser.cardCount + " " + Language.StringByID(StringId.NfcKey); } if (isEdit) @@ -458,6 +474,7 @@ { Application.RunOnMainThread(() => { + doorlockUser.cardCount = 0; //鏇存柊鐣岄潰 initOptionView(true); }); @@ -500,7 +517,7 @@ var faceView = new FrameLayout() { X = Application.GetRealWidth(16), - Y = fingerprintView.Bottom, + Y = fingerprintView.Bottom+ Application.GetRealHeight(20), Width = Application.GetRealWidth(64 + 32), Height = childrenViewHeight }; @@ -526,17 +543,17 @@ }; faceView.AddChidren(btnFaceText); - if (doorlockUser.fingerCount > 0) + if (doorlockUser.faceCount > 0) { btnFaceIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/FaceOnIcon.png"; btnFaceText.TextColor = CSS_Color.FirstLevelTitleColor; if (Language.CurrentLanguage == "Chinese") { - btnFaceText.Text = doorlockUser.fingerCount + "缁�" + Language.StringByID(StringId.FaceKey); + btnFaceText.Text = doorlockUser.faceCount + "缁�" + Language.StringByID(StringId.FaceKey); } else { - btnFaceText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.FaceKey); + btnFaceText.Text = doorlockUser.faceCount + " " + Language.StringByID(StringId.FaceKey); } if (isEdit) @@ -565,6 +582,7 @@ { Application.RunOnMainThread(() => { + doorlockUser.faceCount = 0; //鏇存柊鐣岄潰 initOptionView(true); }); -- Gitblit v1.8.0