| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\VideoDoorlockClose.png" /> |
| | | <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\DoorLock\Cell.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | /// <summary> |
| | | /// 萤石视频门锁 |
| | | /// </summary> |
| | | public const string VideoDoorLock= "萤石视频门锁"; |
| | | public const string VideoDoorLock="security.door.ezviz"; |
| | | /// <summary> |
| | | /// 萤石视频门锁spk列表 |
| | | /// </summary> |
| | |
| | | <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" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 功能控制界面跳转事件 |
| | | /// </summary> |
| | | public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor, Comerom comerom |
| | | public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor, Comerom comerom,Action action |
| | | ) |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | |
| | | break; |
| | | case SPK.VideoDoorLock: { |
| | | //萤石视频门锁 |
| | | var form = new VideoDoorLockPage(function, btnName, btnFromFloor,comerom); |
| | | var form = new VideoDoorLockPage(function, btnName, btnFromFloor,comerom,action); |
| | | MainPage.BasePageView.AddChidren(form); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | form.Show(); |
| | |
| | | }; |
| | | |
| | | |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone,Comerom.collect); |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone,Comerom.collect,()=> { |
| | | this.LoadDeviceFunctionControlZone();//删除设备后重新刷新UI |
| | | }); |
| | | view.MouseUpEventHandler = skipControlPageEvent; |
| | | btnName.MouseUpEventHandler = skipControlPageEvent; |
| | | btnIcon.MouseUpEventHandler = skipControlPageEvent; |
| | |
| | | /// 是否在调光 |
| | | /// </summary> |
| | | bool onDimmerBar; |
| | | /// <summary> |
| | | /// 删除设备后回调给界面刷新 |
| | | /// </summary> |
| | | Action action; |
| | | |
| | | #endregion |
| | | public FunctionControlZone(Function func) |
| | | public FunctionControlZone(Function func,Action action) |
| | | { |
| | | bodyDiv = this; |
| | | bodyDiv.Tag = func.sid; |
| | | function = func; |
| | | this.action = action; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | |
| | | /// </summary> |
| | | void LoadEvent_DivSkipEvent() |
| | | { |
| | | var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor,Comerom.function); |
| | | var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor,Comerom.room,this.action); |
| | | this.MouseUpEventHandler = eventHandler; |
| | | btnName.MouseUpEventHandler = eventHandler; |
| | | btnFromFloor.MouseUpEventHandler = eventHandler; |
| | |
| | | } |
| | | if (function.spk == SPK.LightRGBW || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else if (function.spk == SPK.IpCam_Imou) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | deleteAction = delAction; |
| | | this.modifyImageAction = modifyImageAction; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重载界面 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView,room.roomName).LoadTopView_RoomTop(ReloadRoomName, skipEditPageAction); |
| | | new TopViewDiv(bodyView, room.roomName).LoadTopView_RoomTop(ReloadRoomName, skipEditPageAction); |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603-12), |
| | | Height = Application.GetRealHeight(603 - 12), |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | foreach (var function in room.GetRoomFunctions(false)) |
| | | var list = room.GetRoomFunctions(false); |
| | | |
| | | foreach (var function in list) |
| | | { |
| | | if (MainPage.RoomNotSupportFunctionList.Contains( function.spk)) |
| | | if (MainPage.RoomNotSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function, null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function, () => |
| | | { |
| | | this.ReLoadPage(); |
| | | }) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = "Scene-" + scene.sid |
| | | Tag = "Scene-" + scene.sid |
| | | }; |
| | | functionListView.AddChidren(sceneRow); |
| | | LoadSceneRow(sceneRow, scene); |
| | |
| | | /// </summary> |
| | | public void LoadSceneRow(FrameLayout bodyDiv, Scene scene) |
| | | { |
| | | var btnIcon = new Button() |
| | | var btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(15), |
| | |
| | | btnName.X = Application.GetRealWidth(52 + 16); |
| | | } |
| | | //加载场景控制事件 |
| | | LoadEvent_ControlScene(btnName,btnFromFloor,bodyDiv,scene ); |
| | | LoadEvent_ControlScene(btnName, btnFromFloor, bodyDiv, scene); |
| | | |
| | | LoadEvent_FunctionCollection(btnCollectionIcon,scene); |
| | | LoadEvent_FunctionCollection(btnCollectionIcon, scene); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载功能收藏按钮事件 |
| | | /// </summary> |
| | | void LoadEvent_FunctionCollection(Button btnCollectionIcon,Scene scene) |
| | | void LoadEvent_FunctionCollection(Button btnCollectionIcon, Scene scene) |
| | | { |
| | | btnCollectionIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 加载场景控制事件 |
| | | /// </summary> |
| | | void LoadEvent_ControlScene(Button btnName,Button btnFromFloor,FrameLayout bodyDiv, Scene scene) |
| | | void LoadEvent_ControlScene(Button btnName, Button btnFromFloor, FrameLayout bodyDiv, Scene scene) |
| | | { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => |
| | | { |
| | | DriverLayer.Control.Ins.ControlScene(scene); |
| | | string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | |
| | | bodyDiv.MouseUpEventHandler = upEvent; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | //萤石视频门锁 |
| | | case SPK.VideoDoorLock: |
| | | { |
| | | LogicView.FunTypeView view1 = new LogicView.FunTypeView(); |
| | | view1.btnText.Text = "用户人员";// StringId.shipintonghuahujiao; |
| | | view1.btnText.Name = Language.StringByID(StringId.shipinmensuo); |
| | | fLayout.AddChidren(view1.FLayoutView()); |
| | | view1.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.VideoDoorLockAction(this, device, view1.btnState); |
| | | }; |
| | | if (edit) |
| | | { |
| | | this.GetEditState(device, index, view1.btnState,null, null, null); |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 萤石视频门锁专用(二级界面) |
| | | /// </summary> |
| | | /// <param name="frame">当前界面</param> |
| | | /// <param name="device">当前设备</param> |
| | | /// <param name="btnState">旧状态</param> |
| | | public void VideoDoorLockAction(FrameLayout frame, Entity.Function device, Button btnState) |
| | | { |
| | | selectedState = device.spk + "_"; |
| | | Loading loading = new Loading(); |
| | | frame.AddChidren(loading); |
| | | loading.Start(); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var userList = Send.Current.GetVideoDoorLockUserIdList(device.deviceId, true); |
| | | List<string> userIdList = new List<string>(); |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | var user = userList[i]; |
| | | userIdList.Add(user.userName); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | 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"); |
| | | |
| | | }, false); |
| | | |
| | | }); |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示编辑之前的设备状态 |
| | | /// </summary> |
| | | /// <param name="device">编辑设备</param> |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.VideoDoorLock: |
| | | { |
| | | string value = this.GetValue(dicList); |
| | | inputView.btnState.Text = value; |
| | | } |
| | | break; |
| | | case SPK.doorgate: |
| | | { |
| | | if (inputCondition.identifier == "door_call_cloud_event") |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.VideoDoorLock: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | button1.Text = value; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | { |
| | |
| | | var list2 = this.GetVideoDeviceList(); |
| | | list.AddRange(list1); |
| | | list.AddRange(list2); |
| | | //GetTestDevice(ref list, true); |
| | | GetTestDevice(ref list, true); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | return "LogicIcon/sensor.png"; |
| | | } |
| | | else if (SPK.DoorLock == device.spk) |
| | | else if (SPK.DoorLock == device.spk |
| | | || SPK.VideoDoorLock == device.spk) |
| | | { |
| | | return "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Electric)); |
| | | } |
| | | ///门锁类 |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock); |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock |
| | | || device.spk == SPK.VideoDoorLock); |
| | | if (doorlock != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); |
| | |
| | | else if (deviceType == Language.StringByID(StringId.DoorLock)) |
| | | { |
| | | functionTypeList.Add(SPK.DoorLock); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | } |
| | | ///音乐类 |
| | | else if (deviceType == Language.StringByID(StringId.Music)) |
| | |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | |
| | | } |
| | | |
| | |
| | | deviceTypeList.Add(SPK.doorgate); |
| | | deviceTypeList.Add(SPK.IpCam_Imou); |
| | | deviceTypeList.Add(SPK.SensorPm10); |
| | | deviceTypeList.Add(SPK.VideoDoorLock); |
| | | |
| | | } |
| | | break; |
| | |
| | | //new Entity.Function { sid = "1234567890", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic }, |
| | | // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature }, |
| | | // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, |
| | | new Entity.Function { sid = "12345678933456", name = "调光灯", spk = Entity.SPK.LightDimming }, |
| | | new Entity.Function { sid = "1234567895444", name = "面板", spk = Entity.SPK.PanelSocket }, |
| | | new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.SensorPm10 }, |
| | | 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 = "pm10", spk = Entity.SPK.SensorPm10 }, |
| | | // 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 }, |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取萤石视频门锁用户列表 |
| | | /// </summary> |
| | | /// <param name="deviceId">可视对讲设备id</param> |
| | | /// <returns></returns> |
| | | public List<Face> GetVideoDoorLockUserIdList(string deviceId, bool isTip) |
| | | { |
| | | var jObject = new JObject(); |
| | | jObject.Add("homeId", LogicMethod.Current.HomeId); |
| | | jObject.Add("deviceId", deviceId); |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.Api_Post_GetListHomeFace, "获取住宅已录入人脸信息"); |
| | | //如果是token过期则刷新token |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | { |
| | | RefreshToken(); |
| | | GetListHomeFace(deviceId, isTip); |
| | | } |
| | | if (Check(responsePackNew, isTip) == false) |
| | | { |
| | | return new List<Face>(); |
| | | } |
| | | var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Face>>(responsePackNew.Data.ToString()); |
| | | if (list == null) |
| | | { |
| | | list = new List<Face>(); |
| | | } |
| | | faceList.Clear(); |
| | | faceList.AddRange(list); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///请求服务器(与住宅有关:例如;homeId) |
| | | /// </summary> |
| | |
| | | /// 位置信息跳转编辑按钮 |
| | | /// </summary> |
| | | Button btnLocationInfoRight; |
| | | /// <summary> |
| | | /// 删除设备 |
| | | /// </summary> |
| | | Button delTextBtn; |
| | | /// <summary> |
| | | /// 下一级图标 |
| | | /// </summary> |
| | | Button delRightBtn; |
| | | /// <summary> |
| | | /// 删除设备行FrameLayout |
| | | /// </summary> |
| | | FrameLayout delView; |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// 后退时,刷新之前界面的显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | |
| | | /// <summary> |
| | | /// 解绑设备回调 |
| | | /// </summary> |
| | | Action actionDel; |
| | | #endregion |
| | | |
| | | public FunctionBaseInfoSetPage(Function func, Action action) |
| | | public FunctionBaseInfoSetPage(Function func, Action action,Action actionDel=null) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | actionRefresh = action; |
| | | this.actionDel = actionDel; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | |
| | | #endregion |
| | | } |
| | | #region 共享 |
| | | |
| | | //var sharedView = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealHeight(55), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //}; |
| | | //contentView.AddChidren(sharedView); |
| | | |
| | | //var btnSharedText = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | |
| | | // }); |
| | | #endregion |
| | | |
| | | #region 删除设备行 |
| | | |
| | | delView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | if (this.function.spk == SPK.VideoDoorLock) |
| | | { |
| | | contentView.AddChidren(delView); |
| | | } |
| | | var lineBtn = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1) |
| | | }; |
| | | delView.AddChidren(lineBtn); |
| | | delTextBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeleteDevice, |
| | | }; |
| | | delView.AddChidren(delTextBtn); |
| | | |
| | | delRightBtn= new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delView.AddChidren(delRightBtn); |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | #if stage2 |
| | | #region 添加到桌面 |
| | | var addToDesktopView = new FrameLayout() |
| | |
| | | { |
| | | LoadEvent_ChangeFunctionName (); |
| | | SkipChooseRoomPage(); |
| | | DelDeviceEvent(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 解绑设备的事件 |
| | | /// </summary> |
| | | void DelDeviceEvent() |
| | | { |
| | | |
| | | EventHandler<MouseEventArgs> ClickEvent = (sener, e) => |
| | | { |
| | | new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () => |
| | | { |
| | | UI2.FuntionControlView.VideoDoorLock.Send.Currnet.DelDevice(this.function, (isBool) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!isBool) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.delFail), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | //删除本地文件 |
| | | FunctionList.List.DeleteFunction(this.function); |
| | | this.RemoveFromParent(); |
| | | this.actionDel?.Invoke(); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | }; |
| | | this.delView.MouseUpEventHandler += ClickEvent; |
| | | this.delTextBtn.MouseUpEventHandler += ClickEvent; |
| | | this.delRightBtn.MouseUpEventHandler += ClickEvent; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", functionIds); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "刷新设备状态"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | 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 (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | d.Add("deviceInfos", new List<Dictionary<string, object>> { deviceIds }); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupList, "获取列表名列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return new List<GroupList>(); |
| | | } |
| | |
| | | d.Add("sidGroups", new List<Dictionary<string, object>> { d1 }); |
| | | |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList, "通过列表名获取歌曲列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return new List<PalyerSongListInfo>(); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="responsePackNew">回复数据对象</param> |
| | | /// <returns></returns> |
| | | private bool dataChecking(ResponsePackNew responsePackNew) |
| | | public bool DataChecking(ResponsePackNew responsePackNew) |
| | | { |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | { |
New file |
| | |
| | | using System; |
| | | using System.Threading; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock |
| | | { |
| | | public class Send |
| | | { |
| | | public Send() |
| | | { |
| | | } |
| | | |
| | | private static Send send = null; |
| | | |
| | | public static Send Currnet |
| | | { |
| | | get |
| | | { |
| | | if (send == null) |
| | | { |
| | | send = new Send(); |
| | | } |
| | | |
| | | return send; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解绑设备 |
| | | /// </summary> |
| | | /// <param name="function">当前的设备</param> |
| | | /// <param name="action">回调结果</param> |
| | | public void DelDevice(Function function, Action<bool> action) |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | //HDL_ON.UI.Music.SendMethod.Current.RequestServerhomeId(); |
| | | |
| | | if (function != null) |
| | | { |
| | | action?.Invoke(false); |
| | | } |
| | | } |
| | | catch(Exception s) { |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取电池电量 |
| | | /// </summary> |
| | | /// <param name="function">当前的设备</param> |
| | | /// <param name="action">回调结果</param> |
| | | public void GetCellValue(Function function, Action<int> action) |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | //HDL_ON.UI.Music.SendMethod.Current.RequestServerhomeId(); |
| | | |
| | | if (function != null) |
| | | { |
| | | action?.Invoke(8); |
| | | } |
| | | } |
| | | catch (Exception s) |
| | | { |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | this.dicBatteryContr[i_device.sid] = btnBattery; |
| | | frameBack.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var form = new VideoDoorLockPage(i_device, btnName, btnRoom,Comerom.function); |
| | | var form = new VideoDoorLockPage(i_device, btnName, btnRoom,Comerom.function,()=> { |
| | | this.CloseForm(); |
| | | }); |
| | | MainPage.BasePageView.AddChidren(form); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | form.Show(); |
| | | |
| | | //var form = new VideoDoorLockPage(); |
| | | //form.AddForm(i_device, new Button(), btnName, btnRoom); |
| | | }; |
| | |
| | | /// </summary> |
| | | private Button btnCell; |
| | | /// <summary> |
| | | /// 电量进度条 |
| | | /// </summary> |
| | | private DiyArcSeekBar cellDiyArcSeekBar; |
| | | /// <summary> |
| | | ///收藏图标 |
| | | /// </summary> |
| | | private Button btnCollectIcon; |
| | |
| | | /// 实时视频 |
| | | /// </summary> |
| | | private CustomFrameLayout rtvFL; |
| | | /// <summary> |
| | | /// 一键开锁 |
| | | /// </summary> |
| | | private CustomFrameLayout openFL; |
| | | /// <summary> |
| | | /// 临时密码 |
| | | /// </summary> |
| | |
| | | /// 表示来自那个界面 |
| | | /// </summary> |
| | | private Comerom Comerom; |
| | | /// <summary> |
| | | /// 删除设备后需要更新界面的回调 |
| | | /// </summary> |
| | | public Action action; |
| | | #endregion |
| | | |
| | | |
| | |
| | | /// <param name="function">设备</param> |
| | | /// <param name="btnDeviceName">上一级界面的设备名字控件</param> |
| | | /// <param name="btnRoomName">上一级界面的房间名字控件</param> |
| | | public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, Comerom comerom) |
| | | public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, Comerom comerom, Action action) |
| | | { |
| | | this.device = function; |
| | | this.btnDeviceName = btnDeviceName; |
| | | this.btnRoomName = btnRoomName; |
| | | this.Comerom = comerom; |
| | | this.action = action; |
| | | |
| | | } |
| | | |
| | |
| | | //初始化UI |
| | | this.InitUI(); |
| | | //初始化事件 |
| | | this.EventListener (); |
| | | this.EventListener(); |
| | | //读取数据 |
| | | this.ReadData(); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化界面 |
| | | /// </summary> |
| | |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | this.topView = new TopView(); |
| | | this.topView.setBtn.Visible = true; |
| | | this.topView.topNameBtn.TextID =StringId.shipinmensuo; |
| | | this.topView.topNameBtn.TextID = StringId.shipinmensuo; |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | var middleFl=new FrameLayout |
| | | var middleFl = new FrameLayout |
| | | { |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(middleFl); |
| | | |
| | | var whiteFl = new FrameLayout |
| | | var whiteFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | |
| | | }; |
| | | middleFl.AddChidren(whiteFl); |
| | | |
| | | |
| | | btnCurrDeviceName= new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment=TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceName); |
| | | |
| | | btnCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = btnCurrDeviceName.Bottom+ Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceRoom); |
| | | btnCurrDeviceRoom.Width=btnCurrDeviceName.GetTextWidth(); |
| | | |
| | | btnCell = new Button |
| | | { |
| | | TextSize = TextSize.Text10, |
| | | TextColor = MusicColor.TextColor, |
| | | Y = Application.GetRealHeight(43), |
| | | X = btnCurrDeviceRoom.Right+Application.GetRealWidth(17), |
| | | //Text ="60"+"%", |
| | | //TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | UnSelectedImagePath ="FunctionIcon/DoorLock/Cell.png", |
| | | }; |
| | | whiteFl.AddChidren(btnCell); |
| | | |
| | | btnCollectIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(264), |
| | |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | IsSelected= this.device.collect, |
| | | IsSelected = this.device.collect, |
| | | Name = "collect" |
| | | }; |
| | | whiteFl.AddChidren(btnCollectIcon); |
| | | |
| | | btnCurrDeviceName = new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceName); |
| | | |
| | | btnCurrDeviceName.Width = btnCurrDeviceName.GetTextWidth(); |
| | | if (btnCurrDeviceName.GetTextWidth() > btnCollectIcon.X) |
| | | { |
| | | btnCurrDeviceName.Width = btnCollectIcon.X; |
| | | } |
| | | btnCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(17), |
| | | Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceRoom); |
| | | btnCurrDeviceRoom.Width = btnCurrDeviceRoom.GetTextWidth(); |
| | | |
| | | var cellFrame = new FrameLayout |
| | | { |
| | | X = btnCurrDeviceRoom.Right + Application.GetRealWidth(20), |
| | | Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(5), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(16), |
| | | }; |
| | | whiteFl.AddChidren(cellFrame); |
| | | |
| | | |
| | | |
| | | cellDiyArcSeekBar = new DiyArcSeekBar |
| | | { |
| | | X = Application.GetRealWidth(3), |
| | | Y = Application.GetRealHeight(3), |
| | | Width = cellFrame.Width + Application.GetRealWidth(-6), |
| | | Height = cellFrame.Height + Application.GetRealHeight(-6), |
| | | Progress = 60, |
| | | ProgressBarColor = MusicColor.MusicNoTxetColor, |
| | | MaxValue = 100, |
| | | MinValue = 0, |
| | | |
| | | //IsCanMove = false, |
| | | //IsCanScrolled=false, |
| | | }; |
| | | //cellFrame.AddChidren(cellDiyArcSeekBar); |
| | | |
| | | btnCell = new Button |
| | | { |
| | | TextSize = TextSize.Text10, |
| | | TextColor = MusicColor.TextColor, |
| | | Text = "60" + "%", |
| | | TextAlignment = TextAlignment.Center, |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/Cell.png", |
| | | }; |
| | | cellFrame.AddChidren(btnCell); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //门锁状态 |
| | | btnDoorLockIcon = new Button |
| | | { |
| | |
| | | SelectedImagePath = "FunctionIcon/DoorLock/UnLocking.png", |
| | | }; |
| | | whiteFl.AddChidren(btnDoorLockIcon); |
| | | |
| | | int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(70); |
| | | //实时视频 |
| | | rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | whiteFl.AddChidren(rtvFL); |
| | | rtvFL.Y = btnDoorLockIcon.Bottom+ Application.GetRealHeight(45); |
| | | rtvFL.X = Application.GetRealWidth(68); |
| | | rtvFL.Y = heightY; |
| | | rtvFL.X = Application.GetRealWidth(41); |
| | | rtvFL.AddImageView(); |
| | | rtvFL.AddTextButtonView(); |
| | | rtvFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/RTV.png"; |
| | |
| | | //历史记录 |
| | | recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | whiteFl.AddChidren(recordFL); |
| | | recordFL.Y = btnDoorLockIcon.Bottom + Application.GetRealHeight(45); |
| | | recordFL.X = rtvFL.Right + Application.GetRealHeight(CustomFrameLayout.interval); |
| | | recordFL.Y = heightY; |
| | | recordFL.X = rtvFL.Right + Application.GetRealWidth(CustomFrameLayout.interval); |
| | | recordFL.AddImageView(); |
| | | recordFL.AddTextButtonView(); |
| | | recordFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/HistoryList.png"; |
| | | recordFL.GetTextButton().TextID = StringId.lishijilu; |
| | | //一键开锁 |
| | | openFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | whiteFl.AddChidren(openFL); |
| | | openFL.X = rtvFL.X; |
| | | openFL.Y = rtvFL.Bottom+Application.GetRealHeight(14); |
| | | openFL.AddImageView(); |
| | | openFL.AddTextButtonView(); |
| | | openFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png"; |
| | | openFL.GetTextButton().TextID = StringId.yijiankaisuo; |
| | | //临时密码 |
| | | pswFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | whiteFl.AddChidren(pswFL); |
| | | pswFL.X = recordFL.X; |
| | | pswFL.Y = rtvFL.Bottom + Application.GetRealHeight(14); |
| | | pswFL.Y = heightY; |
| | | pswFL.X = recordFL.Right + Application.GetRealWidth(CustomFrameLayout.interval); |
| | | pswFL.AddImageView(); |
| | | pswFL.AddTextButtonView(); |
| | | pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png"; |
| | | pswFL.GetTextButton().TextID = StringId.linshimima1; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | this.btnRoomName.Text = this.device.GetRoomListName(); |
| | | this.topView.topNameBtn.Text = this.device.name; |
| | | this.btnCurrDeviceName.Text = this.device.name; |
| | | this.btnCurrDeviceRoom.Text= this.device.GetRoomListName(); |
| | | this.btnCurrDeviceRoom.Text = this.device.GetRoomListName(); |
| | | |
| | | ////从新计算宽度 |
| | | //this.btnDeviceName.Text = btnDeviceName.Text; |
| | |
| | | |
| | | ////回调事件 |
| | | //this.SettionFinishEvent?.Invoke(); |
| | | }, () => |
| | | { |
| | | //解绑设备后 |
| | | this.RemoveFromParent(); |
| | | this.action?.Invoke(); |
| | | }); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | //收藏 |
| | | btnCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | this.btnCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | }; |
| | | //实时视频 |
| | | rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | //一键开锁 |
| | | openFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | //临时密码 |
| | | pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | //历史记录 |
| | | recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | |
| | | this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | | { |
| | | |
| | | }); |
| | | //临时密码 |
| | | this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | //历史记录 |
| | | this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 初始数据 |
| | | /// </summary> |
| | | private void ReadData() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.Send.Currnet.GetCellValue(this.device, (value) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //this.cellDiyArcSeekBar.Progress = i; |
| | | //更新电量值 |
| | | this.btnCell.Text = value + "%"; |
| | | }); |
| | | |
| | | }); |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | class CustomFrameLayout : FrameLayout |
| | | { |
| | | public const int widthFrameLayout = 74; |
| | | public const int heightFrameLayout = 70; |
| | | public const int yFrameLayout = 353; |
| | | public const int xFrameLayout = 68; |
| | | public const int interval = 47;//行中的列间隔值 |
| | | public const int widthFrameLayout = 48; |
| | | public const int heightFrameLayout = 53; |
| | | public const int yFrameLayout = 378; |
| | | public const int xFrameLayout = 41; |
| | | public const int interval = 51;//行中的列间隔值 |
| | | |
| | | public CustomFrameLayout(int width, int height, int x = 0, int y = 0) |
| | | { |
| | |
| | | { |
| | | EventHandler<MouseEventArgs> click = (sender, e) => |
| | | { |
| | | if (action == null) |
| | | { |
| | | return; |
| | | } |
| | | action(this, btnStateImage, btnStateText); |
| | | action?.Invoke(this, btnStateImage, btnStateText); |
| | | }; |
| | | this.MouseUpEventHandler += click; |
| | | btnStateImage.MouseUpEventHandler += click; |