HDL-ON_Android/Assets/Language.ini
@@ -626,6 +626,14 @@ 639=Closed 640=Open 641=Automatic Coloring 642=LED Banner 643=Unlock method 644=Clear 645=Digital password 646=Card/NFC key 647=Face key 648=Delete user 649=Activity detection @@ -1924,6 +1932,16 @@ 639=当前门未关 640=当前门已关 641=自动炫彩 642=跑马灯 643=开锁方式 644=清空 645=数字密码 646=卡/NFC钥匙 647=人脸钥匙 648=删除用户 649=活动检测 2532=访客邀请记录 2533=访客管理 @@ -3220,6 +3238,16 @@ 639=Closed 640=Open 641=Automatic Coloring 642=LED Banner 643=Unlock method 644=Clear 645=Digital password 646=Card/NFC key 647=Face key 648=Delete user 649=Activity detection 2532=Visitor Invitation Record @@ -4511,6 +4539,15 @@ 639=Closed 640=Open 641=Automatic Coloring 642=LED Banner 643=Unlock method 644=Clear 645=Digital password 646=Card/NFC key 647=Face key 648=Delete user 649=Activity detection @@ -5791,6 +5828,16 @@ 639=Closed 640=Open 641=Automatic Coloring 642=LED Banner 643=Unlock method 644=Clear 645=Digital password 646=Card/NFC key 647=Face key 648=Delete user 649=Activity detection 2532=Visitor Invitation Record HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordOnIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/FaceIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/FaceOnIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/FingerprintIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/FingerprintOnIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/NfcIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/DoorLock/UserRightsManagement/NfcOnIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/groupControl.png
HDL-ON_Android/Assets/Phone/LogicIcon/SeriesIcon.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -432,6 +432,16 @@ <AndroidAsset Include="Assets\h5\static\img\coal-save-ic.6c5fd125.png" /> <AndroidAsset Include="Assets\h5\static\font\SourceHanSansCN-Normal.otf" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\DoorlockUserManager.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\groupControl.png" /> <AndroidAsset Include="Assets\Phone\LogicIcon\SeriesIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\NfcIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\DigitalPasswordIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\FingerprintIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\DigitalPasswordOnIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\FingerprintOnIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\NfcOnIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\FaceOnIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UserRightsManagement\FaceIcon.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1592,6 +1592,16 @@ <BundleResource Include="Resources\h5\static\img\coal-save-ic.6c5fd125.png" /> <BundleResource Include="Resources\h5\static\font\SourceHanSansCN-Normal.otf" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\DoorlockUserManager.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\groupControl.png" /> <BundleResource Include="Resources\Phone\LogicIcon\SeriesIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\NfcIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\DigitalPasswordIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\FingerprintIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\DigitalPasswordOnIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\FingerprintOnIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\NfcOnIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\FaceOnIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\UserRightsManagement\FaceIcon.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordOnIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/FaceIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/FaceOnIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/FingerprintIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/FingerprintOnIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/NfcIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/DoorLock/UserRightsManagement/NfcOnIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/groupControl.png
HDL-ON_iOS/Resources/Phone/LogicIcon/SeriesIcon.png
HDL_ON/Common/HDLCommon.cs
@@ -450,6 +450,7 @@ switch (UserInfo.Current.AccountString) { case "464027401@qq.com": case "13580507523": case "15626203746": return; } HDL_ON/Common/R.cs
@@ -6,6 +6,38 @@ { /// <summary> /// 活动检测 /// </summary> public const int ActivityDetection = 649; /// <summary> /// 删除用户 /// </summary> public const int DeleteUser = 648; /// <summary> /// 人脸钥匙 /// </summary> public const int FaceKey = 647; /// <summary> /// 卡/NFC钥匙 /// </summary> public const int NfcKey = 646; /// <summary> /// 数字密码 /// </summary> public const int DigitalPassword = 645; /// <summary> /// 清空 /// </summary> public const int Clear = 644; /// <summary> /// 开锁方式 /// </summary> public const int UnlockMethod = 643; /// <summary> /// 跑马灯 /// </summary> public const int HorseRaceLamp = 642; /// <summary> /// 自动炫彩 /// </summary> public const int AutomaticColoring = 641; HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -3117,6 +3117,44 @@ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DelTempPasswrod, requestJson); } #region 视频门锁 2023-07-07 16:47:20 /// <summary> /// 获取萤石门锁用户列表 /// </summary> /// <param name="deviceId"></param> /// <returns></returns> public ResponsePackNew GetDoorlockUserList(string deviceId) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", deviceId); var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDoorlockUserList, requestJson); } /// <summary> /// 修改门锁用户备注 /// </summary> /// <returns></returns> public ResponsePackNew EditDoorlockUserName(string deviceId,string lockUserIndex,string remarkName) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", deviceId); d.Add("lockUserIndex", lockUserIndex); d.Add("remarkName", remarkName); var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_setDoorUserRemark, requestJson); } #endregion #endregion #region ■ 音箱语言控制相关_________________________ HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@ /// 固定域名,正式环境 /// 公共域名就近解析 /// </summary> public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; const string APP_KEY = "HDL-HOME-APP-TEST"; const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm HDL_ON/DAL/Server/NewAPI.cs
@@ -896,6 +896,15 @@ /// 删除门锁临时密码 /// </summary> public const string Api_Post_DelTempPasswrod = "/home-wisdom/app/device/door/tempPwdDel"; /// <summary> /// 获取门锁用户列表 /// </summary> public const string Api_Post_GetDoorlockUserList = "/home-wisdom/platform/yingshi/lock/user/list"; /// <summary> /// 更改门锁用户备注名 /// </summary> public const string Api_Post_setDoorUserRemark = "/home-wisdom/platform/yingshi/lock/user/list"; #endregion HDL_ON/Entity/DB_ResidenceData.cs
@@ -78,6 +78,7 @@ ShowFunction.MechanicalArm , ShowFunction.SecurityMonitoring, ShowFunction.VideoDoorLock, ShowFunction.Series, }; } return dddd; HDL_ON/Entity/Enumerative/MyEnum.cs
@@ -189,6 +189,10 @@ /// 萤石视频门锁 /// </summary> VideoDoorLock = 0x26, /// <summary> /// 跑马灯(序列) /// </summary> Series = 0x27, } HDL_ON/Entity/Function/Function.cs
@@ -1470,9 +1470,14 @@ /// <summary> /// 猫眼 /// 猫眼(旧spk) /// </summary> public const string Peephole = "peephole"; /// <summary> /// 猫眼(新spk 暂时没用) /// </summary> //public const string PeepholeEz = "security.peephole.ez"; /// <summary> /// 萤石视频门锁 /// </summary> HDL_ON/HDL_ON.projitems
@@ -556,6 +556,9 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\GroupControlPage_V2.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockHistoryPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SetSceneRgbColorfulModePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicSeriesSettingPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockUserManagerPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockUserListPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -670,6 +670,10 @@ int functionOnCount = 0; switch (item) { case ShowFunction.Series: functionCount = FunctionList.List.GetSeries().Count; functionOnCount = FunctionList.List.GetSeries().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; break; case ShowFunction.IpCam: functionCount = FunctionList.List.GetIpCamImouList().Count; break; @@ -869,6 +873,10 @@ int functionPageTitleId = 0; switch (item) { case ShowFunction.Series: btnName.TextID = StringId.HorseRaceLamp; functionPageTitleId = StringId.HorseRaceLamp; break; case ShowFunction.Light: #region Light btnName.TextID = StringId.Lights; HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -78,9 +78,10 @@ } btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; if(function.spk == SPK.GroupControl) if(function.spk == SPK.GroupControl || function.spk == SPK.CommonSeries) { btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/lightswitch.png"; //btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/lightswitch.png"; btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/groupControl.png"; } if (SPK.CurtainSpkList().Contains(function.spk)) {//窗帘没有开关按钮 HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -166,10 +166,10 @@ { functionList.AddRange(FunctionList.List.groupControls); functionList.AddRange(FunctionList.List.GetLightList()); } else if(titleId == StringId.HorseRaceLamp) { functionList.AddRange(FunctionList.List.GetSeries()); } else if (titleId == StringId.AC) { @@ -199,11 +199,11 @@ { functionList.AddRange(FunctionList.List.GetAirFreshList()); } else if(titleId == StringId.MechanicalArm) else if (titleId == StringId.MechanicalArm) { functionList.AddRange(FunctionList.List.GetMechanicalArmList()); } else if(titleId == StringId.SecurityMonitoring) else if (titleId == StringId.SecurityMonitoring) { functionList.AddRange(FunctionList.List.GetIpCamImouList()); } HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -1,5 +1,6 @@ using System; using System.Collections.Generic; using HDL_ON.Entity; using Shared; namespace HDL_ON.UI.UI2.Intelligence.Automation { @@ -49,9 +50,33 @@ delayView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; //viewLayout.AddChidren(delayView.FLayoutView()); ////功能 ///产品经理君焕要求,设备功能移到这里。<2022-3-7> new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, securityView.frameLayout.Bottom, 2); var colorfulRgbList = FunctionList.List.GetLightList().FindAll((obj) => obj.spk == SPK.LightRGB && obj.GetAttributes().Contains(FunctionAttributeKey.Colorful)); if (colorfulRgbList.Count > 0) { LogicView.SelectTypeView seriesView = new LogicView.SelectTypeView(); seriesView.frameLayout.Y = securityView.frameLayout.Bottom; seriesView.btnText.TextID = StringId.HorseRaceLamp; seriesView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/SeriesIcon.png"; viewLayout.AddChidren(seriesView.FLayoutView()); seriesView.btnClick.MouseUpEventHandler = (sender, e) => { var settingPage = new LogicSeriesSettingPage(); MainPage.BasePageView.AddChidren(settingPage); settingPage.LoadPage(colorfulRgbList); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, seriesView.frameLayout.Bottom, 3); } else { ////功能 ///产品经理君焕要求,设备功能移到这里。<2022-3-7> new FunTpye(LogicMethod.target_if).FunTypeView(viewLayout, securityView.frameLayout.Bottom, 2); } #endregion #region 所有点击事件 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -696,6 +696,38 @@ } } break; case SPK.Peephole: LogicView.FunTypeView viewPeephole = new LogicView.FunTypeView(); viewPeephole.btnText.TextID = StringId.ActivityDetection; viewPeephole.btnText.Name = Language.StringByID(StringId.shipinmensuo); fLayout.AddChidren(viewPeephole.FLayoutView()); viewPeephole.btnClick.MouseUpEventHandler += (sender, e) => { this.identifier = "pir_event";//人体感应告警 this.DeviceView(device, viewPeephole.btnState, StringId.shi, StringId.offLogic, 1); }; if (edit) { this.GetEditState(device, index, viewPeephole.btnState, null, null, null); } break; case SPK.Ev_Ipcam: LogicView.FunTypeView viewEzIpcam = new LogicView.FunTypeView(); viewEzIpcam.btnText.TextID = StringId.ActivityDetection; viewEzIpcam.btnText.Name = Language.StringByID(StringId.shipinmensuo); fLayout.AddChidren(viewEzIpcam.FLayoutView()); viewEzIpcam.btnClick.MouseUpEventHandler += (sender, e) => { this.identifier = "motiondetect_event";//人体感应告警 this.DeviceView(device, viewEzIpcam.btnState, StringId.shi, StringId.offLogic, 1); }; if (edit) { this.GetEditState(device, index, viewEzIpcam.btnState, null, null, null); } break; } #region 保存 @@ -747,6 +779,18 @@ inputDevice.condition = new List<Dictionary<string, string>>(); } } else if(device.spk == SPK.Peephole) { //猫眼-人体感应告警 inputDevice.condition_type = "9"; inputDevice.identifier = this.identifier; } else if(device.spk == SPK.Ev_Ipcam) { //萤石摄像头-移动监测告警 inputDevice.condition_type = "9"; inputDevice.identifier = this.identifier; } else if (device.spk == SPK.VideoDoorLock) { ////萤石视频门锁 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -467,6 +467,12 @@ } break; case SPK.Ev_Ipcam: if (inputCondition.identifier == "pir_event") { inputView.btnState.Text = Language.StringByID(StringId.On); } break; case SPK.SensorPirHold: { string value = this.GetKeyValue("people_status", dicList); @@ -1002,7 +1008,10 @@ //区别不同设备,显示不同设备状态 switch (device.spk) { case SPK.CommonSeries: targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; stateStr = GetKeyValue("on_off", dicList) == "on" ? Language.StringByID(StringId.onLogic) : Language.StringByID(StringId.offLogic); break; //插座(有USB) case SPK.PanelSocket: { @@ -1045,6 +1054,24 @@ case SPK.LightCCT: case SPK.LightDimming: { if(device.spk == SPK.LightRGB) { string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList); if (!string.IsNullOrEmpty(colorful)) { targetView.btnIcon.UnSelectedImagePath = "FunctionIcon/Icon/groupControl.png"; if (colorful == "on") { stateStr = Language.StringByID(StringId.onLogic); } else if (colorful == "off") { stateStr = Language.StringByID(StringId.offLogic); } break; } } string on_off = GetKeyValue("on_off", dicList); string brightness = GetKeyValue("brightness", dicList); if (on_off == "on" && brightness != "") HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs
@@ -187,7 +187,9 @@ var list2 = this.GetVideoDeviceList(); list.AddRange(list1); list.AddRange(list2); //GetTestDevice(ref list, true); #if DEBUG GetTestDevice(ref list, true); #endif return list; } /// <summary> @@ -608,7 +610,7 @@ } ///摄像头类 var camera = deviceList.Find((device) => device.spk == SPK.IpCam_Imou); device.spk == SPK.IpCam_Imou || device.spk == SPK.Ev_Ipcam || device.spk == SPK.Peephole); if (camera != null) { deviceStrTypeList.Add(Language.StringByID(StringId.shexiangtou)); @@ -726,10 +728,14 @@ else if (deviceType == Language.StringByID(StringId.shexiangtou)) { functionTypeList.Add(SPK.IpCam_Imou); functionTypeList.Add(SPK.Ev_Ipcam); functionTypeList.Add(SPK.Peephole); } else { //全部区域 functionTypeList.Add(SPK.Peephole); functionTypeList.Add(SPK.Ev_Ipcam); functionTypeList.Add(SPK.LightSwitch); functionTypeList.Add(SPK.LightDimming); functionTypeList.Add(SPK.LightRGB); @@ -804,6 +810,8 @@ { case condition_if: { deviceTypeList.Add(SPK.Ev_Ipcam); deviceTypeList.Add(SPK.Peephole); deviceTypeList.Add(SPK.LightSwitch); deviceTypeList.Add(SPK.LightRGB); deviceTypeList.Add(SPK.LightRGBW); @@ -1192,7 +1200,9 @@ // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, //new Entity.Function { sid = "12345678933456", name = "门锁", spk = Entity.SPK.DoorLock }, // new Entity.Function { sid = "1234567895444", name = "视频门锁", spk = Entity.SPK.VideoDoorLock }, new Entity.Function { sid = "12345678968888", name = "人体存在传感器", spk = Entity.SPK.SensorPirHold }, //new Entity.Function { sid = "12345678968888", name = "人体存在传感器", spk = Entity.SPK.SensorPirHold }, new Entity.Function { sid = "12345678968888", name = "测试猫眼", spk = Entity.SPK.Peephole }, new Entity.Function { sid = "12345678968889", name = "测试萤石摄像头", spk = Entity.SPK.Ev_Ipcam }, // new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 }, // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow }, // new Entity.Function { sid = "12345678991234", name = "HDL机械手", spk = Entity.SPK.MechanicalArm }, HDL_ON/UI/UI2/3-Intelligence/Automation/LogicSeriesSettingPage.cs
New file @@ -0,0 +1,291 @@ using System; using System.Collections.Generic; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.Intelligence.Automation { public class LogicSeriesSettingPage :FrameLayout { FrameLayout bodyView; public LogicSeriesSettingPage() { bodyView = this; } public void LoadPage(List<Function> list) { new TopViewDiv(bodyView, Language.StringByID(StringId.HorseRaceLamp)).LoadTopView(); bodyView.BackgroundColor = CSS.CSS_Color.BackgroundColor; VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(603 - 50), }; bodyView.AddChidren(contentView); var seriesList = FunctionList.List.GetSeries(); foreach(var rgb in list) { var titleView = new FrameLayout() { Height = Application.GetRealHeight(44), BackgroundColor = CSS.CSS_Color.MainBackgroundColor, }; contentView.AddChidren(titleView); titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor, Gravity = Gravity.BottomCenter }); var btnViewTitle = new Button() { X = Application.GetRealWidth(16), TextSize = CSS.CSS_FontSize.SubheadingFontSize, IsBold = true, Text = rgb.name, TextAlignment = TextAlignment.CenterLeft, TextColor = CSS.CSS_Color.MainColor, }; titleView.AddChidren(btnViewTitle); var autoColorfulView = new FrameLayout() { Height = Application.GetRealHeight(44), BackgroundColor = CSS.CSS_Color.MainBackgroundColor, }; contentView.AddChidren(autoColorfulView); autoColorfulView.AddChidren(new Button() { Width = Application.GetRealWidth(343), Gravity = Gravity.BottomCenter, Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor, Y = Application.GetRealHeight(44) - 1 }); Button btnAutoColorfulRight = new Button() { X = Application.GetRealWidth(339), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), UnSelectedImagePath = "Public/Right.png", }; autoColorfulView.AddChidren(btnAutoColorfulRight); var btnAutoColorfulTitle = new Button() { X = Application.GetRealWidth(16), TextAlignment = TextAlignment.CenterLeft, TextSize = CSS.CSS_FontSize.TextFontSize, TextColor = CSS.CSS_Color.FirstLevelTitleColor, TextID = StringId.Auto, }; autoColorfulView.AddChidren(btnAutoColorfulTitle); btnAutoColorfulTitle.MouseUpEventHandler = (sender, e) => { LoadEditDialog_OnOff(rgb.sid,true); }; var rgbSeriesList = seriesList.FindAll((obj) => obj.sid.Substring(0, 16) == rgb.sid.Substring(0, 16)); foreach(var rgbSeries in rgbSeriesList) { var colorfulView = new FrameLayout() { Height = Application.GetRealHeight(44), BackgroundColor = CSS.CSS_Color.MainBackgroundColor, }; contentView.AddChidren(colorfulView); colorfulView.AddChidren(new Button() { Width = Application.GetRealWidth(343), Gravity = Gravity.BottomCenter, Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor, Y = Application.GetRealHeight(44) - 1 }); Button btnColorfulRight = new Button() { X = Application.GetRealWidth(339), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), UnSelectedImagePath = "Public/Right.png", }; colorfulView.AddChidren(btnColorfulRight); var btnColorfulTitle = new Button() { X = Application.GetRealWidth(16), TextAlignment = TextAlignment.CenterLeft, TextSize = CSS.CSS_FontSize.TextFontSize, TextColor = CSS.CSS_Color.FirstLevelTitleColor, Text = rgbSeries.name, }; colorfulView.AddChidren(btnColorfulTitle); btnColorfulTitle.MouseUpEventHandler = (sender, e) => { LoadEditDialog_OnOff(rgbSeries.sid); }; } contentView.AddChidren(new Button { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor, }); } } /// <summary> /// 加载开关选择弹窗 /// </summary> /// <param name="function"></param> /// <param name="btn"></param> void LoadEditDialog_OnOff(string sid, bool isRgb = false) { Dialog dialog = new Dialog(); var pView = new FrameLayout() { BackgroundColor = CSS_Color.DialogTransparentColor1, }; dialog.AddChidren(pView); var optionBaseView = new FrameLayout() { Y = Application.GetRealHeight(500), Height = Application.GetRealHeight(160), AnimateSpeed = 0.3f, Animate = Animate.DownToUp, }; pView.AddChidren(optionBaseView); var optionView = new VerticalScrolViewLayout() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(100), BackgroundColor = CSS_Color.MainBackgroundColor, Radius = (uint)Application.GetRealWidth(12), ScrollEnabled = false, }; optionBaseView.AddChidren(optionView); var btnOn = new Button() { Height = Application.GetRealHeight(50), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.On, }; optionView.AddChidren(btnOn); optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); var btnOff = new Button() { Height = Application.GetRealHeight(50), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.OFF, }; optionView.AddChidren(btnOff); var btnCancel = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(8) + optionView.Bottom, Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(50), BackgroundColor = CSS_Color.MainBackgroundColor, Radius = (uint)Application.GetRealWidth(12), TextID = StringId.Cancel, TextColor = CSS_Color.WarningColor, TextSize = CSS_FontSize.SubheadingFontSize, }; optionBaseView.AddChidren(btnCancel); dialog.Show(); pView.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; btnCancel.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; btnOn.MouseUpEventHandler = (sender, e) => { dialog.Close(); Output outputDevice = new Output(); outputDevice.target_type = "1"; outputDevice.sid = sid; outputDevice.delay = "0"; List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>(); Dictionary<string, string> diction = new Dictionary<string, string>(); if (isRgb) { diction.Add("key", FunctionAttributeKey.Colorful); } else { diction.Add("key", "on_off"); } diction.Add("value", "on"); dicSateteList.Add(diction); outputDevice.status = dicSateteList; var oldTemp = Logic.currlogic.output.Find((obj) => obj.sid.Substring(0, 16) == sid.Substring(0, 16)); if (oldTemp != null) { Logic.currlogic.output.Remove(oldTemp); } Logic.currlogic.output.Add(outputDevice); this.RemoveFromParent(); LogicMethod.Current.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnOff.MouseUpEventHandler = (sender, e) => { dialog.Close(); Output outputDevice = new Output(); List<Dictionary<string, string>> dicSateteList = new List<Dictionary<string, string>>(); Dictionary<string, string> diction = new Dictionary<string, string>(); if (isRgb) { diction.Add("key", FunctionAttributeKey.Colorful); } else { diction.Add("key", "on_off"); } diction.Add("value", "off"); dicSateteList.Add(diction); outputDevice.status = dicSateteList; var oldTemp = Logic.currlogic.output.Find((obj) => obj.sid.Substring(0, 16) == sid.Substring(0, 16)); if (oldTemp != null) { Logic.currlogic.output.Remove(oldTemp); } Logic.currlogic.output.Add(outputDevice); this.RemoveFromParent(); LogicMethod.Current.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } } } HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -294,6 +294,10 @@ userManagerView.GetTextButton().TextID = StringId.UserManagement; userManagerView.SetClickListener((fl, btnImage, btnText) => { var page = new VideoDoorlockUserListPage(device); MainPage.BasePageView.AddChidren(page); page.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }); HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserListPage.cs
New file @@ -0,0 +1,180 @@ using System; using System.Collections.Generic; using HDL_ON.Common; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock { public class VideoDoorlockUserListPage : FrameLayout { FrameLayout bodyView; Function device; public VideoDoorlockUserListPage(Function function) { bodyView = this; device = function; } public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.UserManagement)).LoadTopView(); bodyView.BackgroundColor = CSS_Color.BackgroundColor; var contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(667 - 70), }; bodyView.AddChidren(contentView); var waitPage = new Loading(); bodyView.AddChidren(waitPage); waitPage.Start(""); new System.Threading.Thread(() => { try { var pack = ApiUtlis.Ins.HttpRequest.GetDoorlockUserList(device.deviceId); if (pack != null) { if (pack.Code == StateCode.SUCCESS) { var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<VideoDoorlockUser>>(pack.Data.ToString()); if (list != null) { Application.RunOnMainThread(() => { foreach (var user in list) { contentView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); var row = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Height = Application.GetRealHeight(50), Radius = (uint)Application.GetRealWidth(12), BackgroundColor = CSS_Color.MainBackgroundColor, Width = Application.GetRealWidth(343), }; contentView.AddChidren(row); var btnRight = new Button() { X = Application.GetRealWidth(307), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(16), Height = Application.GetMinRealAverage(16), UnSelectedImagePath = "Public/Right.png", }; row.AddChidren(btnRight); var btnName = new Button() { X = Application.GetRealWidth(12), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, Text = user.lockUserName }; row.AddChidren(btnName); btnName.MouseUpEventHandler = (sender, e) => { var page = new VideoDoorlockUserManagerPage(device, user); MainPage.BasePageView.AddChidren(page); page.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } }); } } else { Application.RunOnMainThread(() => { IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); }); } } } catch (Exception ex) { MainPage.Log($"获取门锁用户异常:{ex.Message}"); } finally { Application.RunOnMainThread(() => { waitPage.Hide(); }); } }) { IsBackground = true }.Start(); } } public class VideoDoorlockUser { /// <summary> /// 开始时间 integer(int32) /// </summary> public string beginTime; /// <summary> /// 感应卡密码数量 integer(int32) /// </summary> public int cardCount; /// <summary> /// 结束时间 integer(int32) /// </summary> public int endTime; /// <summary> /// 是否过期 integer(int32) /// </summary> public string expiredEnable; /// <summary> /// 门锁用户id string /// </summary> public string extUserId; /// <summary> /// string /// </summary> public string extUserName; /// <summary> /// 人脸密码数量 integer(int32) /// </summary> public int faceCount; /// <summary> /// 指纹密码数量 integer(int32) /// </summary> public int fingerCount; /// <summary> /// 用户备注名 string /// </summary> public string lockRemarkName; /// <summary> /// 锁用户类型// 0-主用户,1-普通用户 integer(int32) /// </summary> public int lockType; /// <summary> /// 门锁用户id string /// </summary> public string lockUserIndex; /// <summary> /// 用户名 string /// </summary> public string lockUserName; /// <summary> /// 数字密码数量 integer(int32) /// </summary> public int pwdCount; } } HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorlockUserManagerPage.cs
New file @@ -0,0 +1,498 @@ using System; using System.Collections.Generic; using HDL_ON.Common; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock { /// <summary> /// 视频门锁用户管理界面 /// </summary> public class VideoDoorlockUserManagerPage : FrameLayout { FrameLayout bodyView; VerticalScrolViewLayout contentView; FrameLayout userPermissionsView; Button btnUserName; Function device; VideoDoorlockUser doorlockUser; public VideoDoorlockUserManagerPage(Function function,VideoDoorlockUser user) { bodyView = this; device = function; doorlockUser = user; BackgroundColor = CSS_Color.BackgroundColor; } public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.UserManagement)).LoadTopView(); contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(667 - 70), }; bodyView.AddChidren(contentView); #region 用户名称 var userNameView = new FrameLayout() { Height = Application.GetRealHeight(50), BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(userNameView); var btnUserNameTitle = new Button() { X = Application.GetRealWidth(16), Width = Application.GetRealWidth(120), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.User, }; userNameView.AddChidren(btnUserNameTitle); var btnEditUserNameIcon = new Button() { X = Application.GetRealWidth(333), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/EditIcon.png", }; userNameView.AddChidren(btnEditUserNameIcon); btnUserName = new Button() { X = Application.GetRealWidth(100), Width = Application.GetRealWidth(230), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, Text = doorlockUser.lockUserName }; userNameView.AddChidren(btnUserName); btnUserName.MouseUpEventHandler = (sender, e) => { LoadEvent_EditUserName(); }; #endregion contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); initOptionView(false); } void initOptionView(bool isEdit) { if(userPermissionsView!= null) { userPermissionsView.RemoveAll(); } int childrenViewHeight = Application.GetRealHeight( 108); int permissionsViewHeight = Application.GetRealHeight( 291+92); if (isEdit) { permissionsViewHeight = Application.GetRealHeight(391 + 92); childrenViewHeight = Application.GetRealHeight(136); } #region 门锁用户开锁方式管理 userPermissionsView = new FrameLayout() { Height = permissionsViewHeight, BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(userPermissionsView); var userPermissionsTitleView = new FrameLayout() { Height = Application.GetRealHeight(63), BackgroundColor = CSS_Color.MainBackgroundColor, }; userPermissionsView.AddChidren(userPermissionsTitleView); var btnUserPermissionsTitle = new Button() { X = Application.GetRealWidth(16), TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.FirstLevelTitleColor, TextID = StringId.UnlockMethod }; userPermissionsTitleView.AddChidren(btnUserPermissionsTitle); var btnEditUserPermissions = new Button() { X = Application.GetRealWidth(267), Width = Application.GetRealWidth(80), TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.MainColor, TextID = StringId.Edit, }; userPermissionsTitleView.AddChidren(btnEditUserPermissions); btnEditUserPermissions.MouseUpEventHandler = (sender, e) => { initOptionView(isEdit ? false : true); }; #region 开锁选项 var unlockOptionView = new FrameLayout() { Y = userPermissionsTitleView.Bottom, Height = Application.GetRealHeight(231), BackgroundColor = CSS_Color.MainBackgroundColor, }; userPermissionsView.AddChidren(unlockOptionView); #region 指纹 var fingerprintView = new FrameLayout() { X = Application.GetRealWidth(16), Width = Application.GetRealWidth(64 + 32), Height = Application.GetRealHeight(64 + 24 + 20) }; unlockOptionView.AddChidren(fingerprintView); var btnFingerprintIcon = new Button() { Width = Application.GetRealWidth(64), Height = Application.GetRealWidth(64), UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/FingerprintIcon.png", X = Application.GetRealWidth(16), }; fingerprintView.AddChidren(btnFingerprintIcon); var btnFingerprintText = new Button() { Y = btnFingerprintIcon.Bottom, Height = Application.GetRealHeight(44), TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, TextID = StringId.Fingerprints, }; fingerprintView.AddChidren(btnFingerprintText); if (doorlockUser.fingerCount > 0) { btnFingerprintIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/FingerprintOnIcon.png"; btnFingerprintText.TextColor = CSS_Color.FirstLevelTitleColor; if (Language.CurrentLanguage == "Chinese") { btnFingerprintText.Text = doorlockUser.fingerCount + "组" + Language.StringByID(StringId.Fingerprints); } else { btnFingerprintText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.Fingerprints); } } if (isEdit) { var btnClearFingerprints = new Button() { Y = btnFingerprintText.Bottom, Width = Application.GetRealWidth(60), Height = Application.GetRealHeight(28), BorderWidth = 1, BorderColor = CSS_Color.MainColor, Radius = (uint)Application.GetRealWidth(4), TextID = StringId.Clear, }; fingerprintView.AddChidren(btnClearFingerprints); btnClearFingerprints.MouseUpEventHandler = (sender, e) => { }; } #endregion #region 数字密码 var digitalPasswordView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(64 + 32), Height = Application.GetRealHeight(64 + 24 + 20) }; unlockOptionView.AddChidren(digitalPasswordView); var btnDigitalPasswordIcon = new Button() { Width = Application.GetRealWidth(64), Height = Application.GetRealWidth(64), UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/DigitalPasswordIcon.png", X = Application.GetRealWidth(16), }; digitalPasswordView.AddChidren(btnDigitalPasswordIcon); var btnDigitalPasswordText = new Button() { Y = btnDigitalPasswordIcon.Bottom, Height = Application.GetRealHeight(44), TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, TextID = StringId.DigitalPassword, }; digitalPasswordView.AddChidren(btnDigitalPasswordText); if (doorlockUser.fingerCount > 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); } else { btnDigitalPasswordText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.DigitalPassword); } } if (isEdit) { var btnClearDigitalPassword = new Button() { Y = btnDigitalPasswordText.Bottom, Width = Application.GetRealWidth(60), Height = Application.GetRealHeight(28), BorderWidth = 1, BorderColor = CSS_Color.MainColor, Radius = (uint)Application.GetRealWidth(4), TextID = StringId.Clear, }; digitalPasswordView.AddChidren(btnClearDigitalPassword); } #endregion #region NFC var nfcView = new FrameLayout() { X = Application.GetRealWidth(263), Width = Application.GetRealWidth(64 + 32), Height = Application.GetRealHeight(64 + 24 + 20) }; unlockOptionView.AddChidren(nfcView); var btnNfcIcon = new Button() { Width = Application.GetRealWidth(64), Height = Application.GetRealWidth(64), UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/NfcIcon.png", X = Application.GetRealWidth(16), }; nfcView.AddChidren(btnNfcIcon); var btnNfcText = new Button() { Y = btnNfcIcon.Bottom, Height = Application.GetRealHeight(44), TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, TextID = StringId.NfcKey, }; nfcView.AddChidren(btnNfcText); if (doorlockUser.fingerCount > 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); } else { btnNfcText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.NfcKey); } } if (isEdit) { var btnClearNfc = new Button() { Y = btnNfcText.Bottom, Width = Application.GetRealWidth(60), Height = Application.GetRealHeight(28), BorderWidth = 1, BorderColor = CSS_Color.MainColor, Radius = (uint)Application.GetRealWidth(4), TextID = StringId.Clear, }; nfcView.AddChidren(btnClearNfc); } #endregion #region 人脸 var faceView = new FrameLayout() { X = Application.GetRealWidth(16), Y = fingerprintView.Bottom+ Application.GetRealHeight(20), Width = Application.GetRealWidth(64 + 32), Height = Application.GetRealHeight(64 + 24 + 20) }; unlockOptionView.AddChidren(faceView); var btnFaceIcon = new Button() { Width = Application.GetRealWidth(64), Height = Application.GetRealWidth(64), UnSelectedImagePath = "FunctionIcon/DoorLock/UserRightsManagement/FaceIcon.png", X = Application.GetRealWidth(16), }; faceView.AddChidren(btnFaceIcon); var btnFaceText = new Button() { Y = btnFaceIcon.Bottom, Height = Application.GetRealHeight(44), TextAlignment = TextAlignment.Center, TextSize = CSS_FontSize.TextFontSize, TextColor = CSS_Color.PromptingColor1, TextID = StringId.FaceKey, }; faceView.AddChidren(btnFaceText); if (doorlockUser.fingerCount > 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); } else { btnFaceText.Text = doorlockUser.fingerCount + " " + Language.StringByID(StringId.FaceKey); } } if (isEdit) { var btnClearFace = new Button() { Y = btnFaceText.Bottom, Width = Application.GetRealWidth(60), Height = Application.GetRealHeight(28), BorderWidth = 1, BorderColor = CSS_Color.MainColor, Radius = (uint)Application.GetRealWidth(4), TextID = StringId.Clear, }; faceView.AddChidren(btnClearFace); } #endregion #endregion #endregion var delUserView = new FrameLayout() { Y = permissionsViewHeight - Application.GetRealHeight(92), Height = Application.GetRealHeight(92), BackgroundColor = CSS_Color.BackgroundColor, }; userPermissionsView.AddChidren(delUserView); Button btnDelUser = new Button() { Y = Application.GetRealHeight(48), Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(220), Height = Application.GetRealHeight(44), BackgroundColor = CSS_Color.MainBackgroundColor, TextColor = CSS_Color.WarningColor, Radius = (uint)Application.GetRealWidth(22), TextID = StringId.DeleteUser, }; delUserView.AddChidren(btnDelUser); } /// <summary> /// 加载修改用户名称事件 /// </summary> void LoadEvent_EditUserName() { EventHandler<MouseEventArgs> eventHandler = (sender, e) => { Action<string> callBack = (str) => { if (string.IsNullOrEmpty(str)) { new Tip() { CloseTime = 1, Text = Language.StringByID(StringId.UesrNameCannotBeEmpty), Direction = AMPopTipDirection.None, }.Show(bodyView); return; } if (str == UserInfo.Current.userName) { return; } var waitPage = new Loading(); bodyView.AddChidren(waitPage); waitPage.Start(Language.StringByID(StringId.PleaseWait)); new System.Threading.Thread(() => { try { var resultObj = ApiUtlis.Ins.HttpRequest.EditDoorlockUserName(device.deviceId, doorlockUser.extUserId,str); if (resultObj.Code == StateCode.SUCCESS) { UserInfo.Current.userName = str; UserInfo.Current.SaveUserInfo(); Application.RunOnMainThread(() => { btnUserName.Text = str; }); } else { //失败提示 IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); } } catch (Exception ex) { MainPage.Log($"update user name error : {ex.Message}"); } finally { Application.RunOnMainThread(() => { if (waitPage != null) { waitPage.RemoveFromParent(); waitPage = null; } }); } }) { IsBackground = true }.Start(); }; new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, doorlockUser.lockUserName, callBack, StringId.UesrNameCannotBeEmpty, 0, new System.Collections.Generic.List<string>()); }; btnUserName.MouseUpEventHandler = eventHandler; } } } SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@ /// 固定域名,正式环境 /// 公共域名就近解析 /// </summary> public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; const string APP_KEY = "HDL-HOME-APP-TEST"; const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm