| | |
| | | using ZigBee.Device; |
| | | namespace Shared.Phone.UserCenter.DoorLock |
| | | { |
| | | public class MemberFrozenPage : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | public class MemberFrozenPage : DoorLockCommonLayout |
| | | { |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; |
| | | } |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | #region 变量申明 |
| | | /// <summary> |
| | | /// 当前门锁 |
| | | /// </summary> |
| | | ZigBee.Device.DoorLock doorLock; |
| | | /// <summary> |
| | | /// 当前成员对象v |
| | | /// </summary> |
| | | Shared.Phone.UserCenter.MemberInfoRes curAccountObj; |
| | | /// <summary> |
| | | /// 刷新View |
| | | /// </summary> |
| | | VerticalRefreshLayout bodyView; |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 初始化数据信息 |
| | | /// </summary> |
| | | void ReadDoorLockUserInfo() |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | |
| | | ReadDoorLockUserInfo(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | | public async void MidRefresh() |
| | | { |
| | | bodyView.RemoveAll(); |
| | |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | btnRight.IsSelected = !btnRight.IsSelected; |
| | | |
| | | if (btnRight.IsSelected) |
| | | if (!btnRight.IsSelected) |
| | | { |
| | | FreezeUser(true); |
| | | } |
| | |
| | | } |
| | | else if (currentIndex == 2) |
| | | { |
| | | btnRight.IsSelected = !btnRight.IsSelected; |
| | | if (btnRight.IsSelected) |
| | | if (!btnRight.IsSelected) |
| | | { |
| | | HasRemoteUnlockAccessMethod(true); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //冻结账户 |
| | | /// <summary> |
| | | /// 冻结账户 |
| | | /// </summary> |
| | | /// <param name="isFreeze"></param> |
| | | void FreezeUser(bool isFreeze) |
| | | { |
| | | var dialog = new Dialog { }; |
| | |
| | | { |
| | | textFreeze = Language.StringByID(R.MyInternationalizationString.SureToUnFreeze); |
| | | } |
| | | var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip)); |
| | | doorDialog.Show(); |
| | | doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); |
| | | doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0); |
| | | doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogMidText.Text = textFreeze; |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm); |
| | | doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) =>
|
| | | {
|
| | | MidRefresh();
|
| | | dialog.Close(); |
| | | }; |
| | | doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => |
| | | |
| | | string msg = Language.StringByID(R.MyInternationalizationString.GoPersonalCenter); |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, textFreeze, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += () => |
| | | {
|
| | | System.Threading.Tasks.Task.Run(async () =>
|
| | | {
|
| | |
| | | foreach (var curDoorLockUser in curAccountDoorLockUserList)
|
| | | {
|
| | | // 账户中没有门锁用户
|
| | | if (curDoorLockUser.DoorLockLocalUserId == null || curDoorLockUser.DoorLockLocalUserId == "")
|
| | | if (string.IsNullOrEmpty(curDoorLockUser.DoorLockLocalUserId))
|
| | | {
|
| | | //
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | //冻结/解冻用户
|
| | | int count1 = tempGroupId.Count; |
| | | if (tempGroupId.Count == 1) |
| | | { |
| | | foreach (var a in tempGroupId) |
| | | { |
| | | if (a.Count == 0) |
| | | { |
| | | count1 = 0; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | int count2 = 0; |
| | | |
| | | int tempCount = 0; |
| | |
| | | var tempUserIdList1 = tempGroupId[i]; |
| | | if (tempUserIdList1.Count == 0) |
| | | { |
| | | return; |
| | | break; |
| | | } |
| | | var passData = doorLock.FreezeAccountData(tempUserIdList1, accessType);
|
| | | var resultData = await doorLock.DefaultControlAsync(passData);
|
| | |
| | | { |
| | | count2++; |
| | | } |
| | | //if (tempCount == tempGroupId.Count - 1) |
| | | //{ |
| | | System.Threading.Thread.Sleep(1000); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | });
|
| | | }
|
| | | });
|
| | | dialog.Close();
|
| | | }; |
| | | } |
| | | |
| | | //是否给子账户拥有远程开锁的条件 |
| | | /// <summary> |
| | | /// 是否给子账户拥有远程开锁的条件 |
| | | /// </summary> |
| | | /// <param name="hasAccess"></param> |
| | | void HasRemoteUnlockAccessMethod(bool hasAccess) |
| | | { |
| | | var dialog = new Dialog { }; |
| | | var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.Tip)); |
| | | doorDialog.Show(); |
| | | doorDialog.dialogMidFraFrameLayout.Height = Application.GetRealHeight(58); |
| | | doorDialog.dialogMidFraFrameLayout.X = Application.GetRealWidth(0); |
| | | doorDialog.dialogMidFraFrameLayout.Y = Application.GetRealHeight(202); |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogMidText.Text = Language.StringByID(R.MyInternationalizationString.SureGiveAccessToSubaccount); |
| | | doorDialog.dialogMidFraFrameLayout.AddChidren(doorDialog.dialogMidText); |
| | | doorDialog.dialogBtnConfirm.Text = Language.StringByID(R.MyInternationalizationString.DoorlockConfirm); |
| | | doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SureGiveAccessToSubaccount); |
| | | if (!hasAccess) |
| | | { |
| | | MidRefresh(); |
| | | dialog.Close(); |
| | | }; |
| | | doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => |
| | | msg = Language.StringByID(R.MyInternationalizationString.SureCancelAccessToSubaccount); |
| | | } |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | |
| | | }); |
| | | } |
| | | }); |
| | | dialog.Close(); |
| | | }; |
| | | } |
| | | |
| | | #region ◆ 接口实现__________________________ |
| | | /// <summary> |
| | | /// 处理变化事件 --将弃用 改用DeviceInfoChange() |
| | | /// </summary> |
| | | /// <returns>The changed.</returns> |
| | | /// <param name="common">Common.</param> |
| | | public void Changed(CommonDevice common) |
| | | { |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 处理变化事件 |
| | | /// </summary> |
| | | /// <param name="common"></param> |
| | | /// <param name="typeTag"></param> |
| | | public void DeviceInfoChange(CommonDevice common, string typeTag) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IL ogic status. |
| | | /// </summary> |
| | | /// <param name="logic">Logic.</param> |
| | | public void ChangedILogicStatus(ZigBee.Device.Logic logic) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IS cene status. |
| | | /// </summary> |
| | | /// <param name="scene">Scene.</param> |
| | | public void ChangedISceneStatus(Scene scene) |
| | | { |
| | | } |
| | | #endregion |
| | | } |
| | | } |