HDL-ON_Android/Assets/Phone/FunctionIcon/FunctionBg/VideoDoorLockFunctionBg.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -428,6 +428,7 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\VideoDoorLockOpen.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\History.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\Cell.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\FunctionBg\VideoDoorLockFunctionBg.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1571,6 +1571,7 @@ <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\VideoDoorLockClose.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\VideoDoorLockOpen.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\Cell.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\FunctionBg\VideoDoorLockFunctionBg.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> HDL-ON_iOS/Resources/Phone/FunctionIcon/FunctionBg/VideoDoorLockFunctionBg.png
HDL_ON/Common/ApiUtlis.cs
@@ -229,7 +229,7 @@ foreach (var newFunction in deviceList.list) { newFunction.AssembleStatus(); newFunction.SaveFunctionFile(); newFunction.SaveFunctionFile(); FunctionList.List.IniFunctionList(newFunction.savePath,true); MainPage.Log($"============设备============{iiii++}"); } HDL_ON/DAL/Server/NewAPI.cs
@@ -462,6 +462,42 @@ /// 设备消息规则配置 /// </summary> public const string Api_Post_DeviceMessageRulesSet = "/home-wisdom/app/device/deviceMessageRulesSet"; #endregion #region Kaede -- 萤石视频门锁接口____________________________ /// <summary> /// 删除设备(萤石视频门锁) /// </summary> public const string Api_Post_DeleteDevice = "home-wisdom/platform/yingshi/child/deleteDevice"; /// <summary> /// 电池详情(萤石视频门锁) /// </summary> public const string Api_Post_Details = "/home-wisdom/platform/yingshi/lock/battery/details"; /// <summary> /// 门锁用户列表(萤石视频门锁) /// </summary> public const string Api_Post_UserList = "/home-wisdom/platform/yingshi/lock/user/list"; /// <summary> /// 门锁状态(萤石视频门锁) /// </summary> public const string Api_Post_Lockstatus = "/home-wisdom/platform/yingshi/lock/status"; /// <summary> /// 获取报警列表(萤石视频门锁) /// </summary> public const string Api_Post_Records = "/home-wisdom/platform/yingshi/alarm/records"; /// <summary> /// 删除报警记录(萤石视频门锁) /// </summary> public const string Api_Post_AlarmDelet= "/home-wisdom/platform/yingshi/alarm/delete"; /// <summary> /// 远程开锁(萤石视频门锁) /// </summary> public const string Api_Post_OpenDoor = "/home-wisdom/platform/yingshi/lock/remote/open/door"; #endregion #region Kaede -- 场景接口____________________________ HDL_ON/HDL_ON.projitems
@@ -531,7 +531,8 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockListPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\CommonMethod.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\Send.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\ObjectClass.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideDoorLockSend.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -1061,7 +1061,7 @@ { try { var faceIDList = Send.Current.GetListHomeFace(device.deviceId,true); var faceIDList = Send.Current.GetListHomeFace(device.deviceId, true); List<string> faceNameList = new List<string>(); for (int i = 0; i < faceIDList.Count; i++) { @@ -1086,13 +1086,20 @@ }); } catch { } finally { Application.RunOnMainThread(() => { loading.Hide(); }); } }); } /// <summary> /// 萤石视频门锁专用(二级界面) /// 萤石视频门锁专用 /// </summary> /// <param name="frame">当前界面</param> /// <param name="device">当前设备</param> @@ -1107,31 +1114,37 @@ { try { var userList = Send.Current.GetVideoDoorLockUserIdList(device.deviceId, true); var userList =FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockUserListInfo(device); List<string> userIdList = new List<string>(); for (int i = 0; i < userList.Count; i++) { var user = userList[i]; userIdList.Add(user.userName); userIdList.Add(user.extUserId); } Application.RunOnMainThread(() => { loading.Hide(); PublicInterface publicInterface = new PublicInterface(); PublicInterface publicInterface = new PublicInterface();//用户界面 publicInterface.FrameOrVv(this, userIdList, new List<string> { btnState.Text }, device.name, (index) => { var userId = userIdList[index]; //界面显示选中值 btnState.Text = userId; //数据封装 AddDictionary("open_type", "1", "integer"); AddDictionary("user_id", userId, "string"); AddDictionary("open_user", userId, "string"); }, false); }); } catch { } finally { Application.RunOnMainThread(() => { loading.Hide(); }); } }); HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -463,11 +463,11 @@ } /// <summary> /// 获取萤石视频门锁用户列表 /// 获取住宅已录入人脸信息 /// </summary> /// <param name="deviceId">可视对讲设备id</param> /// <returns></returns> public List<Face> GetVideoDoorLockUserIdList(string deviceId, bool isTip) public List<Face> GetHomeFaceList(string deviceId, bool isTip) { var jObject = new JObject(); jObject.Add("homeId", LogicMethod.Current.HomeId); HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -180,6 +180,11 @@ this.RemoveFromParent(); }; break; case SPK.VideoDoorLock: { //跳转到android那边去 HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.SkipActivity(); } break; } }; } HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPageBLL.cs
@@ -89,7 +89,7 @@ { new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () => { UI2.FuntionControlView.VideoDoorLock.Send.Currnet.DelDevice(this.function, (isBool) => UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.DelDevice(this.function, (isBool) => { Application.RunOnMainThread(() => { @@ -104,7 +104,7 @@ return; } //删除本地文件 FunctionList.List.DeleteFunction(this.function); UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function); this.RemoveFromParent(); this.actionDel?.Invoke(); }); HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -282,10 +282,11 @@ /// </summary> /// <param name="responsePackNew">回复数据对象</param> /// <returns></returns> public bool DataChecking(ResponsePackNew responsePackNew) private bool DataChecking(ResponsePackNew responsePackNew) { if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") if (responsePackNew.Data == null||responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "") { return false; } return true; HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
@@ -27,6 +27,13 @@ } /// <summary> /// 跳转到Android那边去 /// </summary> public void SkipActivity() { //未实现 } /// <summary> /// 萤石视频门锁的图标 /// </summary> public string GetVideoDoorLockIcon(Comerom comerom) @@ -41,6 +48,31 @@ } } /// <summary> /// 保存本地文件 /// </summary> /// <param name="function">当前设备</param> public void SaveFunctionFile(Function function) { if (function == null) return; function.AssembleStatus(); function.SaveFunctionFile(); FunctionList.List.IniFunctionList(function.savePath, true); MainPage.Log($"文件保存->{function.name}-->{function.spk}"); } /// <summary> /// 删除本地文件 /// </summary> /// <param name="function">当前设备</param> public void DeleteFunction(Function function) { if (function == null) return; FunctionList.List.DeleteFunction(function); MainPage.Log($"文件删除->{function.name}-->{function.spk}"); } /// <summary> /// 获取萤石视频门锁列表 @@ -50,10 +82,20 @@ { var list = FunctionList.List.GetVideoDoorLockList(); #if DEBUG list.Add(new Function { name = "视频门锁一", sid = "23456789", spk = SPK.VideoDoorLock }); list.Add(new Function { name = "视频门锁二", sid = "2345678922", spk = SPK.VideoDoorLock }); //list.Add(new Function { name = "视频门锁一", sid = "23456789", spk = SPK.VideoDoorLock }); //list.Add(new Function { name = "视频门锁二", sid = "2345678922", spk = SPK.VideoDoorLock }); #endif return list; } /// <summary> /// 弹框类型 /// </summary> public enum TipType { none,//无提示 flicker,//闪烁框 confirmation//确认框 } } } HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/ObjectClass.cs
New file @@ -0,0 +1,56 @@ using System; namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock { public class ObjectClass { } /// <summary> /// 用户信息(萤石视频门锁) /// </summary> public class UserInfo { /// <summary> /// 用户id /// </summary> public string extUserId = string.Empty; /// <summary> /// 用户名称 /// </summary> public string extUserName = string.Empty; } /// <summary> /// 门锁状态(萤石视频门锁) /// </summary> public class VideoDoorLockInfo { /// <summary> /// 锁状态(lock:锁;unlock:解锁) /// </summary> public string lockStatus = string.Empty; /// <summary> /// 门状态(open:开;close:关) /// </summary> public string doorStatus = string.Empty; } /// <summary> /// 电池详情(萤石视频门锁) /// </summary> public class CellInfo { /// <summary> /// 电量 /// </summary> public string remain = string.Empty; /// <summary> /// 电池名称 /// </summary> public string name = string.Empty; } } HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/Send.cs
File was deleted HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideDoorLockSend.cs
New file @@ -0,0 +1,194 @@ using System; using System.Collections.Generic; using System.Threading; using HDL_ON.DAL.Server; using HDL_ON.Entity; using Shared; using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod; namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock { /// <summary> /// 萤石视频门锁数据发送 /// </summary> public class VideDoorLockSend { private static VideDoorLockSend send = null; /// <summary> /// 获取当前的对象 /// </summary> public static VideDoorLockSend Current { get { if (send == null) { send = new VideDoorLockSend(); } return send; } } /// <summary> /// 解绑设备(萤石视频门锁) /// </summary> /// <param name="function">当前的设备</param> /// <param name="action">回调结果</param> public void DelDevice(Function function, Action<bool> action) { new Thread(() => { try { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceSerial", function.sid);//等同门锁序列号 d.Add("platform", 1);//平台 var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_DeleteDevice, "删除萤石门锁设备"); if (!this.DataChecking(responsePackNew)) { return; } if (function != null) { action?.Invoke(false); } } catch (Exception s) { } }) { IsBackground = true }.Start(); } /// <summary> /// 获取门锁状态(萤石视频门锁) /// </summary> /// <param name="function">当前的设备</param> /// <param name="return">返回结果不会为null</param> public VideoDoorLockInfo GetVideoDoorLockState(Function function, TipType tipType = TipType.flicker) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", function.deviceId); var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_Lockstatus, "删除萤石视频门锁状态"); if (!this.DataChecking(responsePackNew)) { return new VideoDoorLockInfo(); } var videoDoorLockInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoDoorLockInfo>(responsePackNew.Data.ToString()); if (videoDoorLockInfo == null) { return new VideoDoorLockInfo(); } return videoDoorLockInfo; } /// <summary> /// 获取电池电量(萤石视频门锁) /// </summary> /// <param name="function">当前的设备</param> /// <param name="return">返回结果不会为null</param> public CellInfo GetCellValue(Function function, TipType tipType = TipType.flicker) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", function.deviceId); var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_Details, "获取萤石门锁设备电量"); if (!this.DataChecking(responsePackNew)) { return new CellInfo(); } var cellInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<CellInfo>(responsePackNew.Data.ToString()); if (cellInfo == null) { return new CellInfo(); } return cellInfo; } /// <summary> /// 获取门锁用户列表(萤石视频门锁) /// </summary> /// <param name="function">当前的设备</param> /// /// <param name="return">返回结果不会为null</param> public List<UserInfo> GetVideoDoorLockUserListInfo(Function function, TipType tipType = TipType.flicker) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", function.deviceId); var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_UserList, "获取萤石门锁用户列表"); if (!this.DataChecking(responsePackNew)) { return new List<UserInfo>(); } var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserInfo>>(responsePackNew.Data.ToString()); if (list == null) { return new List<UserInfo>(); } return list; } /// <summary> /// 获取门锁设备列表(萤石视频门锁) /// </summary> /// <param name="spk">指定spk获取</param> /// <returns></returns> public List<Function> GetVideoDoorLockDeviceList(string spk) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("spk", spk); var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_UserList, "获取萤石门锁设备列表"); if (!this.DataChecking(responsePackNew)) { return new List<Function>(); } var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Function>>(responsePackNew.Data.ToString()); if (list == null) { return new List<Function>(); } return list; } /// <summary> /// 检验数据回复成功或者失败 /// </summary> /// <param name="responsePackNew">回复数据对象</param> /// <param name="tipType">是否需要提示,默认提示</param> /// <returns></returns> private bool DataChecking(ResponsePackNew responsePackNew, TipType tipType = TipType.flicker) { if (responsePackNew.Data == null || responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "") { if (TipType.flicker == tipType) { if (responsePackNew == null) { responsePackNew = new ResponsePackNew { message = "没回复,请确认网络是否正常.", Code = "-1", }; } //new Tip() //{ // CloseTime = 1, // Text = responsePackNew.message + "(" + responsePackNew.Code + ")", // Direction = AMPopTipDirection.None, //}.Show(MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1)); } return false; } return true; } } } HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -339,23 +339,34 @@ /// </summary> private void ReadData() { Loading loading = new Loading(); this.AddChidren(loading); loading.Start(); new System.Threading.Thread(() => { HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.Send.Currnet.GetCellValue(this.device, (value) => try { var videoDoorLockInfo = UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockState(this.device); var cellInfo =UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetCellValue(this.device); Application.RunOnMainThread(() => { //this.cellDiyArcSeekBar.Progress = i; //更新电量值 this.btnCell.Text = value + "%"; this.btnCell.Text = cellInfo.remain + "%"; this.btnDoorLockIcon.IsSelected = videoDoorLockInfo.doorStatus == "open"; }); }); } catch { } finally { Application.RunOnMainThread(() => { loading.Hide(); }); } }) { IsBackground = true }.Start(); { IsBackground = true }.Start() ; } } /// <summary> /// 自己弄一个FrameLayout