ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -2,28 +2,34 @@ <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.5c86e4357d63" /> <MonoDevelop.Ide.ItemProperties.GateWay.Ios PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.a8099274022ed2dc56ddf73bdd3a308ad9575ec5" /> <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.5c86e4357d63" /> <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs"> <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs"> <Files> <File FileName="Shared/Phone/ZigBee/Device/BindObj.cs" Line="316" Column="9" /> <File FileName="Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs" Line="597" Column="63" /> <File FileName="Shared/Phone/UserCenter/Device/Bind/BindInfo.cs" Line="92" Column="64" /> <File FileName="Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs" Line="119" Column="63" /> <File FileName="Shared/Phone/ZigBee/Device/DoorLock.cs" Line="1" Column="1" /> <File FileName="Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs" Line="1" Column="1" /> <File FileName="Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs" Line="1" Column="1" /> <File FileName="GateWay.Droid/Assets/Language.ini" Line="75" Column="8" /> <File FileName="Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs" Line="1" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="GateWay" expanded="True"> <Node name="GateWay.Droid" expanded="True" /> <Node name="GateWay.Droid" expanded="True"> <Node name="Assets" expanded="True" /> </Node> <Node name="Shared" expanded="True"> <Node name="Phone" expanded="True"> <Node name="UserCenter" expanded="True"> <Node name="CommonBase" expanded="True" /> <Node name="CommonBase" expanded="True"> <Node name="Common" expanded="True" /> <Node name="Logic" expanded="True" /> </Node> <Node name="Device" expanded="True"> <Node name="Bind" expanded="True"> <Node name="BindTargetsPage.cs" selected="True" /> <Node name="Bind" expanded="True" /> </Node> <Node name="DoorLock" expanded="True"> <Node name="EntryStatusPage.cs" selected="True" /> </Node> <Node name="DoorLock" expanded="True" /> </Node> <Node name="ZigBee" expanded="True"> <Node name="Device" expanded="True" /> @@ -33,6 +39,12 @@ </Node> </State> </Pad> <Pad Id="MonoDevelop.Debugger.WatchPad"> <State> <Value>curAccountObj.SubAccountDistributedMark</Value> <Value>curDoorLockUser.ConnectedAccount</Value> </State> </Pad> </Pads> </MonoDevelop.Ide.Workbench> <MonoDevelop.Ide.DebuggingService.PinnedWatches /> ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ideBinary files differ
ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -71,7 +71,7 @@ 66=请将IC卡放在感应区域上 67=录入状态 68=密码录入成功 69=密码备注: 69=密码备注: 70=配对客户 71=无 72=成员管理 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind.zipBinary files differ
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs
@@ -1072,114 +1072,8 @@ CommonPage.Loading.Start(""); var delResult = new DelDeviceBindResponseAllData(); delResult = await currentKey.DelDeviceBindAsync(delDevice); if (delResult != null) { if (delResult.removeBindResultResponseData != null) { if (delResult.removeBindResultResponseData.Result == 0) { currentKey.bindList.Remove(bindDevice); RefreshList(); return 0; } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); } } else if (delResult.delDeviceBindResponseData != null) { foreach (var remTarget in delResult.delDeviceBindResponseData.RemoveBindList) { if (remTarget.Result == 0) { currentKey.bindList.Remove(bindDevice); RefreshList(); //如果是场景,用户删除清空当前到房间列表 currentKey.RoomId = ""; currentKey.ReSave(); return 0; } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); } } } } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); } //if (delResult.delDeviceBindResponseData?.RemoveBindList != null) //if (delResult != null) //{ // foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList) // { // switch (re.Result) // { // case 0: // currentKey.bindList.Remove(bindDevice); // RefreshList(); // //如果是场景,用户删除清空当前到房间列表 // currentKey.RoomId = ""; // currentKey.ReSave(); // return 0; // break; // case 1: // currentKey.bindList.Clear(); // try // { // CommonPage.Loading.Start(""); // var getBindList = await currentKey.GetDeviceBindAsync(); // var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; // var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; // if (getBindList != null) // { // if (getBindList.getAllBindResponseData != null) // { // foreach (var b in getBindList.getAllBindResponseData.BindList) // { // if (b.BindCluster == currentClusterID) // { // if (b.BindCluster == 6) // { // if (b.BindType == 2) // { // bindSceneListTemp.Add(b); // } // else // { // bindDeviceListTemp.Add(b); // } // } // else // { // currentKey.bindList.Add(b); // } // } // } // } // } // if (currentKey.panelMode == 1) // { // currentKey.bindList = bindSceneListTemp; // } // else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102) // { // currentKey.bindList = bindDeviceListTemp; // } // } // catch { } // finally // { // RefreshList(); // CommonPage.Loading.Hide(); // } // break; // case 4: // if (delResult.removeBindResultResponseData != null) // { // if (delResult.removeBindResultResponseData.Result == 0) @@ -1190,19 +1084,132 @@ // } // else // { // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); // } // } // break; // default: // break; // else if (delResult.delDeviceBindResponseData != null) // { // foreach (var remTarget in delResult.delDeviceBindResponseData.RemoveBindList) // { // if (remTarget.Result == 0) // { // currentKey.bindList.Remove(bindDevice); // RefreshList(); // //如果是场景,用户删除清空当前到房间列表 // currentKey.RoomId = ""; // currentKey.ReSave(); // return 0; // } // else // { // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); // } // } // } //} //else //{ // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); //} if (delResult != null && delResult.removeBindResultResponseData != null) { if (delResult.delDeviceBindResponseData?.RemoveBindList != null) { foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList) { switch (re.Result) { case 0: currentKey.bindList.Remove(bindDevice); RefreshList(); //如果是场景,用户删除清空当前到房间列表 currentKey.RoomId = ""; currentKey.ReSave(); return 0; break; case 1: currentKey.bindList.Clear(); try { CommonPage.Loading.Start(""); var getBindList = await currentKey.GetDeviceBindAsync(); var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; if (getBindList != null) { if (getBindList.getAllBindResponseData != null) { foreach (var b in getBindList.getAllBindResponseData.BindList) { if (b.BindCluster == currentClusterID) { if (b.BindCluster == 6) { if (b.BindType == 2) { bindSceneListTemp.Add(b); } else { bindDeviceListTemp.Add(b); } } else { currentKey.bindList.Add(b); } } } } } if (currentKey.panelMode == 1) { currentKey.bindList = bindSceneListTemp; } else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102) { currentKey.bindList = bindDeviceListTemp; } } catch { } finally { RefreshList(); CommonPage.Loading.Hide(); } break; case 2: if (delResult.removeBindResultResponseData != null) { if (delResult.removeBindResultResponseData.Result == 0) { currentKey.bindList.Remove(bindDevice); RefreshList(); return 0; } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); } } break; default: break; } } } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnDel); } } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); } } catch { } finally ZigbeeApp/Shared/Phone/UserCenter/DoorLock.zipBinary files differ
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -64,7 +64,7 @@ Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextColor = Shared.Common.ZigbeeColor.Current.XMOrange, TextSize = 14, }; #endregion @@ -424,9 +424,8 @@ var dialog = new Dialog { }; var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip)); doorDialog.Show(); doorDialog.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415); doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(190); doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0); doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.BindRemoteUnlockDoorlock); @@ -529,12 +528,12 @@ var dialog3 = new Dialog { }; var doorDialog3 = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog3, Language.StringByID(R.MyInternationalizationString.UnlockRequest)); doorDialog3.Show(); doorDialog3.dialogMidFraFrameLayout.Width = Application.GetRealWidth(415); doorDialog3.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); doorDialog3.dialogMidFraFrameLayout.X = Application.GetRealWidth(228); doorDialog3.dialogMidFraFrameLayout.X = Application.GetRealWidth(0); doorDialog3.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); doorDialog3.dialogMidFraFrameLayout.AddChidren(doorDialog3.dialogMidText); doorDialog3.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureToOpenDoorLock); doorDialog3.dialogMidText.TextAlignment = TextAlignment.Center; doorDialog3.dialogMidFraFrameLayout.AddChidren(doorDialog3.dialogMidText); doorDialog3.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.Confrim); doorDialog3.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorlockDialog.cs
@@ -48,7 +48,6 @@ /// </summary> public FrameLayout dialogMidFraFrameLayout = new FrameLayout { Width = Application.GetRealWidth(415), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(190), Y = Application.GetRealHeight(202), @@ -60,6 +59,8 @@ public Button dialogMidText = new Button { TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, TextAlignment = TextAlignment.Center, }; /// <summary> ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.csold mode 100755 new mode 100644
@@ -131,7 +131,7 @@ var btnLine = new FrameLayout() { Width = Application.GetRealWidth(965), Height = Application.GetRealHeight(5), Height = 1, X = Application.GetRealWidth(58), Y = Application.GetRealHeight(81 + 127), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, @@ -152,7 +152,7 @@ Width = Application.GetRealWidth(222), Height = Application.GetRealHeight(58), Y = Application.GetRealHeight(35), Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), Text = Language.StringByID(R.MyInternationalizationString.MatchPerson) + ":", TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.CenterLeft, TextSize = 14, @@ -171,6 +171,16 @@ }; personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonContent); var btnLine1 = new FrameLayout() { Width = Application.GetRealWidth(965), Height = 1, X = Application.GetRealWidth(58), Y = Application.GetRealHeight(81 + 127 + 12 + 127), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, }; bottomFrameLayout.AddChidren(btnLine1); var completeBtn = new Button { X = Application.GetRealWidth(86), ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -163,10 +163,9 @@ if (i == 0) { bottomRowLayout.Y = Application.GetRealHeight(220); btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm); btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); btnNextFrameLayout.X = Application.GetRealWidth(233); btnNext.Text = doorLock.DeviceName; btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":"; btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20); btnNextFrameLayout.X = Application.GetRealWidth(233 + 20); var btnDeviceNameEditText = new EditText() { X = Application.GetRealWidth(46), @@ -239,9 +238,8 @@ { bottomRowLayout.Y = Application.GetRealHeight(481); btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":"; btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); btnNextFrameLayout.X = Application.GetRealWidth(233); btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20); btnNextFrameLayout.X = Application.GetRealWidth(253); btnNext.TextAlignment = TextAlignment.CenterLeft; btnNext.Height = Application.GetRealHeight(58); btnNext.Text = doorLock.DeviceName; @@ -286,7 +284,7 @@ btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime); btnNextFrameLayout.Y = btnName.Y; btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png"; btnLine.Visible = false; btnLine.Visible = true; btnLine.Y = Application.GetRealHeight(992); } int currentIndex = i; ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.csold mode 100755 new mode 100644
@@ -145,10 +145,9 @@ if (i == 0) { bottomRowLayout.Y = Application.GetRealHeight(220); btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm); btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); btnNextFrameLayout.X = Application.GetRealWidth(233); btnNext.Text = doorLock.DeviceName; btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":"; btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20); btnNextFrameLayout.X = Application.GetRealWidth(233 + 20); var btnDeviceNameEditText = new EditText() { X = Application.GetRealWidth(46), @@ -220,9 +219,8 @@ { bottomRowLayout.Y = Application.GetRealHeight(481); btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":"; btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58); btnNextFrameLayout.X = Application.GetRealWidth(233); btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58 - 20); btnNextFrameLayout.X = Application.GetRealWidth(253); btnNext.TextAlignment = TextAlignment.CenterLeft; btnNext.Height = Application.GetRealHeight(58); btnNext.Text = doorLock.DeviceName; ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
@@ -227,11 +227,24 @@ } } }; if (i == 0) { btnRightFrameLayout.MouseUpEventHandler += eHandler; btnRight.MouseUpEventHandler += eHandler; RowView.MouseUpEventHandler += eHandler; btnText.MouseUpEventHandler += eHandler; } else if (i == 1) { btnRightFrameLayout.MouseUpEventHandler += eHandler; btnRight.MouseUpEventHandler += eHandler; } else if (i == 2) { btnRightFrameLayout.MouseUpEventHandler += eHandler; btnRight.MouseUpEventHandler += eHandler; } } } ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.csold mode 100755 new mode 100644
@@ -350,7 +350,7 @@ Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextColor = Shared.Common.ZigbeeColor.Current.XMOrange, TextSize = 14, }; this.bottomRadiusFrameLayout.AddChidren(btnOk); @@ -522,7 +522,7 @@ Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextColor = Shared.Common.ZigbeeColor.Current.XMOrange, TextSize = 14, }; this.bottomRadiusFrameLayout.AddChidren(btnOk); ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -46,17 +46,20 @@ } #region ◆ 变量申明__________________________ ZigBee.Device.DoorLock doorLock; VerticalRefreshLayout bodyView; ZigBee.Device.DoorLock doorLock;//当前门锁 VerticalRefreshLayout bodyView;//刷新View Button currentMethod;// 当前选择的方式 Shared.Phone.UserCenter.MemberInfoRes curAccountObj; Shared.Phone.UserCenter.MemberInfoRes curAccountObj;//当前账户 Button entryStatusPic; Button btnPicTip; Button btnPicTip1; bool isSecondDel; FrameLayout blankFrameLayout; bool isSecondDel;//是否二次删除 FrameLayout blankFrameLayout;//空数据显示布局 #endregion /// <summary> /// 读取门锁存储的最新数据 /// </summary> void ReadDoorLockUserInfo() { System.Threading.Tasks.Task.Run(async () => @@ -238,6 +241,9 @@ BlankPicUI(); } /// <summary> /// 空数据UI显示 /// </summary> void BlankPicUI() { blankFrameLayout = new FrameLayout @@ -334,6 +340,7 @@ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, }; bodyView.AddChidren(frameLayoutRow); int i = 0; foreach (var curUserId in curAccountDoorLockUserList.Keys) { @@ -655,6 +662,20 @@ #endregion i++; } //遮挡RowLayout多余的线条 for (int j = 0; j < curAccountDoorLockUserList.Keys.Count; j++) { var frameLayoutRowLineHide = new FrameLayout() { Height = 10, Width = Application.GetRealWidth(173), X = Application.GetRealWidth(58), Y = (j + 1) * Application.GetRealHeight(145), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, }; frameLayoutRow.AddChidren(frameLayoutRowLineHide); } frameLayoutRow.Height = i * Application.GetRealHeight(150); } } @@ -697,6 +718,8 @@ var rowFrameLayout = new RowLayout() { Height = Application.GetRealHeight(150), LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, X = Application.GetRealWidth(81), }; sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); @@ -704,7 +727,6 @@ { Width = Application.GetRealWidth(81), Height = Application.GetRealHeight(81), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(55), }; rowFrameLayout.AddChidren(btnAllMethod); @@ -713,7 +735,7 @@ { Width = Application.GetRealWidth(311), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(173), X = Application.GetRealWidth(92), Y = Application.GetRealHeight(69), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.csold mode 100755 new mode 100644
@@ -1,5 +1,6 @@ using System; using System.Collections.Generic; using Android.Views; using Shared.Common; using ZigBee.Device; namespace Shared.Phone.UserCenter.DoorLock @@ -249,7 +250,7 @@ var line2 = new Button() { Y = rowFrameLayout.Height - 1, X = Application.GetRealWidth(58), X = Application.GetRealWidth(176), Width = Application.GetRealWidth(965), Height = 1, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, @@ -364,33 +365,35 @@ var btnMatchUser = new Button { X = Application.GetRealWidth(446), X = Application.GetRealWidth(159), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(284), Width = Application.GetRealWidth(762), Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 16, TextAlignment = TextAlignment.Center, }; matchUsersFrameLayout.AddChidren(btnMatchUser); var btnFinish = new Button { X = Application.GetRealWidth(919), X = Application.GetRealWidth(921), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Width = Application.GetRealWidth(101 + 81), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextColor = Shared.Common.ZigbeeColor.Current.XMOrange, TextSize = 14, TextAlignment = TextAlignment.CenterLeft, }; matchUsersFrameLayout.AddChidren(btnFinish); var btnTopLine = new FrameLayout() { Height = Application.GetRealHeight(5), Height = 1, Y = Application.GetRealHeight(138), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, }; bottomFrameLayout2.AddChidren(btnTopLine); @@ -644,6 +647,8 @@ var rowFrameLayout = new RowLayout() { Height = Application.GetRealHeight(150), LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, X = Application.GetRealWidth(81), }; sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); @@ -651,7 +656,6 @@ { Width = Application.GetRealWidth(81), Height = Application.GetRealHeight(81), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(55), }; rowFrameLayout.AddChidren(btnAllMethod); @@ -660,7 +664,7 @@ { Width = Application.GetRealWidth(311), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(173), X = Application.GetRealWidth(92), Y = Application.GetRealHeight(69), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.csold mode 100755 new mode 100644
@@ -117,6 +117,7 @@ Height = Application.GetRealHeight(1238), Width = Application.GetRealWidth(965), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, Radius = 6, }; this.midFrameLayout.AddChidren(midTopFrameLayout); @@ -286,12 +287,22 @@ }; closeFrameLayout.AddChidren(btnDoorClosePic); var btnCurrentTopFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(50), Width = Application.GetRealWidth(965), BackgroundColor = ZigbeeColor.Current.XMBlack, Y = Application.GetRealHeight(1100), }; midTopFrameLayout.AddChidren(btnCurrentTopFrameLayout); var btnCurrentFrameLayout = new FrameLayout() { Width = Application.GetRealWidth(965), Height = Application.GetRealHeight(138), Y = Application.GetRealHeight(1100), BackgroundColor = ZigbeeColor.Current.XMBlack, Radius = 6, }; midTopFrameLayout.AddChidren(btnCurrentFrameLayout); @@ -321,6 +332,8 @@ EventHandler<MouseEventArgs> hander1 = async (sender, e) => { openFrameLayout.Enable = false; btnDoorOpenPic.Enable = false; if (UserCenterResourse.UserInfo.AuthorityNo != 1) { var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid); @@ -340,15 +353,21 @@ deviceUI.CommonDevice.ReSave(); } }; openFrameLayout.Enable = true; btnDoorOpenPic.Enable = true; } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); openFrameLayout.Enable = true; btnDoorOpenPic.Enable = true; } } else { new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); openFrameLayout.Enable = true; btnDoorOpenPic.Enable = true; } } else @@ -364,6 +383,8 @@ deviceUI.CommonDevice.ReSave(); } }; openFrameLayout.Enable = true; btnDoorOpenPic.Enable = true; } }; openFrameLayout.MouseUpEventHandler += hander1; ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs
@@ -317,134 +317,15 @@ /// <summary> /// 解除绑定 /// </summary> public async System.Threading.Tasks.Task<DelDeviceBindResponseAllData> DelDeviceBindAsync(DelDeviceBindData delDeviceBindData) { return await System.Threading.Tasks.Task.Run(async () => { DelDeviceBindResponseAllData responseData = null; var mainGateway = ZbGateway.MainGateWay; if (mainGateway == null) { responseData = new DelDeviceBindResponseAllData { errorMessageBase = "当前没有主网关" }; } Action<string, string> action = (topic, message) => { var gatewayID = topic.Split('/')[0]; var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); if (topic == gatewayID + "/" + "Error_Respon") { var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { responseData = new DelDeviceBindResponseAllData { errorMessageBase = "网关错误回复,且数据是空" }; } else { responseData = new DelDeviceBindResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; } } //场景移除 if (topic == gatewayID + "/" + "Bind/RemoveBind_Respon") { var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelDeviceBindResponseData>(jobject["Data"].ToString()); if (tempData == null) { responseData = new DelDeviceBindResponseAllData { errorMessageBase = "网关返回的数据为空" }; } else { responseData = new DelDeviceBindResponseAllData { delDeviceBindResponseData = tempData }; System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); } } //设备移除 if (topic == gatewayID + "/" + "Bind/RemoveBindResult") { var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveBindResultResponseData>(jobject["Data"].ToString()); if (tempData != null) { responseData = new DelDeviceBindResponseAllData { removeBindResultResponseData = tempData }; System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("DeviceBind/DelBind_Actions 启动" + "_" + System.DateTime.Now.ToString()); try { if (delDeviceBindData != null) { var jObject = new JObject { { "DeviceAddr", delDeviceBindData.DeviceAddr }, { "Epoint", delDeviceBindData.Epoint }, { "Cluster_ID", 0 }, { "Command", 5003 } }; var removeBindList = new JArray { }; foreach (var removeBindInfo in delDeviceBindData.RemoveBindList) { if (removeBindInfo.BindType == 0) { var dInfo = new JObject{ { "BindMacAddr",removeBindInfo.BindMacAddr}, { "BindEpoint", removeBindInfo.BindEpoint} , { "BindCluster", removeBindInfo.BindCluster} , { "BindType",removeBindInfo.BindType} }; removeBindList.Add(dInfo); } else if (removeBindInfo.BindType == 1) { var dInfo = new JObject{ { "BindCluster", removeBindInfo.BindCluster} , { "BindType",removeBindInfo.BindType}, { "BindScenesId", removeBindInfo.BindScenesId} }; removeBindList.Add(dInfo); } } var data = new JObject { {"RemoveBindList",removeBindList} }; jObject.Add("Data", data); mainGateway.Send("Bind/RemoveBind", jObject.ToString()); } } catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { await System.Threading.Tasks.Task.Delay(10); if (responseData != null) { break; } } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { responseData = new DelDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; } mainGateway.Actions -= action; System.Console.WriteLine("DeviceBind/DelBind_Actions 退出" + System.DateTime.Now.ToString()); return responseData; }); } //之前2种方式反馈结果 //public async System.Threading.Tasks.Task<DelDeviceBindResponseAllData> DelDeviceBindAsync(DelDeviceBindData delDeviceBindData) //{ // return await System.Threading.Tasks.Task.Run(async () => // { // var responseData = new DelDeviceBindResponseAllData(); // DelDeviceBindResponseAllData responseData = null; // var mainGateway = ZbGateway.MainGateWay; // if (mainGateway == null) // { // responseData.errorMessageBase = "当前没有主网关"; // return responseData; // responseData = new DelDeviceBindResponseAllData { errorMessageBase = "当前没有主网关" }; // } // Action<string, string> action = (topic, message) => @@ -459,15 +340,14 @@ // if (temp == null) // { // responseData.errorMessageBase = "网关错误回复,且数据是空"; // responseData = new DelDeviceBindResponseAllData { errorMessageBase = "网关错误回复,且数据是空" }; // } // else // { // responseData.errorResponData = temp; // responseData.errorMessageBase = ErrorMess(temp.Error); // responseData = new DelDeviceBindResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; // } // } // //场景移除 // if (topic == gatewayID + "/" + "Bind/RemoveBind_Respon") // { // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; @@ -475,16 +355,15 @@ // if (tempData == null) // { // responseData.errorMessageBase = "网关返回的数据为空"; // responseData = new DelDeviceBindResponseAllData { errorMessageBase = "网关返回的数据为空" }; // } // else // { // responseData.delDeviceBindResponseData = tempData; // responseData = new DelDeviceBindResponseAllData { delDeviceBindResponseData = tempData }; // System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); // } // } // //设备移除 // if (topic == gatewayID + "/" + "Bind/RemoveBindResult") // { // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; @@ -492,7 +371,7 @@ // if (tempData != null) // { // responseData.removeBindResultResponseData = tempData; // responseData = new DelDeviceBindResponseAllData { removeBindResultResponseData = tempData }; // System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); // } // } @@ -531,7 +410,6 @@ // {"RemoveBindList",removeBindList} // }; // jObject.Add("Data", data); // //ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID; // mainGateway.Send("Bind/RemoveBind", jObject.ToString()); // } // } @@ -540,46 +418,168 @@ // var dateTime = DateTime.Now; // while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) // { // await System.Threading.Tasks.Task.Delay(100); // if (responseData == null || responseData.delDeviceBindResponseData == null) // { // continue; // } // if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) // { // if (responseData.removeBindResultResponseData != null) // { // break; // } // } // else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) // { // if (responseData.removeBindResultResponseData != null) // { // break; // } // } // else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 4).Count) // { // if (responseData.removeBindResultResponseData != null) // { // break; // } // } // else // await System.Threading.Tasks.Task.Delay(10); // if (responseData != null) // { // break; // } // } // if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) // { // responseData.errorMessageBase = "回复超时,请重新操作"; // responseData = new DelDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; // } // mainGateway.Actions -= action; // System.Console.WriteLine("DeviceBind/DelBind_Actions 退出" + System.DateTime.Now.ToString()); // return responseData; // }); //} //之前2种方式反馈结果 public async System.Threading.Tasks.Task<DelDeviceBindResponseAllData> DelDeviceBindAsync(DelDeviceBindData delDeviceBindData) { return await System.Threading.Tasks.Task.Run(async () => { var responseData = new DelDeviceBindResponseAllData(); var mainGateway = ZbGateway.MainGateWay; if (mainGateway == null) { responseData.errorMessageBase = "当前没有主网关"; return responseData; } Action<string, string> action = (topic, message) => { var gatewayID = topic.Split('/')[0]; var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); if (topic == gatewayID + "/" + "Error_Respon") { var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { responseData.errorMessageBase = "网关错误回复,且数据是空"; } else { responseData.errorResponData = temp; responseData.errorMessageBase = ErrorMess(temp.Error); } } if (topic == gatewayID + "/" + "Bind/RemoveBind_Respon") { var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelDeviceBindResponseData>(jobject["Data"].ToString()); if (tempData == null) { responseData.errorMessageBase = "网关返回的数据为空"; } else { responseData.delDeviceBindResponseData = tempData; System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); } } if (topic == gatewayID + "/" + "Bind/RemoveBindResult") { var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveBindResultResponseData>(jobject["Data"].ToString()); if (tempData != null) { responseData.removeBindResultResponseData = tempData; System.Console.WriteLine($"UI收到通知后的主题_{ topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("DeviceBind/DelBind_Actions 启动" + "_" + System.DateTime.Now.ToString()); try { if (delDeviceBindData != null) { var jObject = new JObject { { "DeviceAddr", delDeviceBindData.DeviceAddr }, { "Epoint", delDeviceBindData.Epoint }, { "Cluster_ID", 0 }, { "Command", 5003 } }; var removeBindList = new JArray { }; foreach (var removeBindInfo in delDeviceBindData.RemoveBindList) { if (removeBindInfo.BindType == 0) { var dInfo = new JObject{ { "BindMacAddr",removeBindInfo.BindMacAddr}, { "BindEpoint", removeBindInfo.BindEpoint} , { "BindCluster", removeBindInfo.BindCluster} , { "BindType",removeBindInfo.BindType} }; removeBindList.Add(dInfo); } else if (removeBindInfo.BindType == 1) { var dInfo = new JObject{ { "BindCluster", removeBindInfo.BindCluster} , { "BindType",removeBindInfo.BindType}, { "BindScenesId", removeBindInfo.BindScenesId} }; removeBindList.Add(dInfo); } } var data = new JObject { {"RemoveBindList",removeBindList} }; jObject.Add("Data", data); //ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID; mainGateway.Send("Bind/RemoveBind", jObject.ToString()); } } catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { await System.Threading.Tasks.Task.Delay(100); if (responseData == null || responseData.delDeviceBindResponseData == null) { continue; } if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) { if (responseData.removeBindResultResponseData != null) { break; } } else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) { if (responseData.removeBindResultResponseData != null) { break; } } else if (0 < responseData.delDeviceBindResponseData.RemoveBindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count) { if (responseData.removeBindResultResponseData != null) { break; } } else { break; } } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { responseData.errorMessageBase = "回复超时,请重新操作"; } mainGateway.Actions -= action; System.Console.WriteLine("DeviceBind/DelBind_Actions 退出" + System.DateTime.Now.ToString()); return responseData; }); } /// <summary> ///解除绑定数据,网关反馈信息 @@ -1123,7 +1123,8 @@ break; } } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) //一键清除目标,会因为目标数量多而加长时间,目前暂定10秒 if ((DateTime.Now - dateTime).TotalMilliseconds > 10 * 1000) { d = new ClearBindInfoResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; }