| | |
| | | Tag = "LockLogic"; |
| | | } |
| | | Button selectedIcon = new Button(); |
| | | VerticalScrolViewLayout middle; |
| | | VerticalRefreshLayout middle; |
| | | public int conditionsIndex = -1; |
| | | |
| | | public async void Show() |
| | | public void Show() |
| | | { |
| | | #region 最上面的布局代码 |
| | | var topRowLayout = new RowLayout |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.userlist, |
| | | IsBold = true, |
| | | //Text = "选择用户", |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | |
| | | |
| | | #endregion |
| | | |
| | | middle = new VerticalScrolViewLayout |
| | | middle = new VerticalRefreshLayout |
| | | { |
| | | Y = topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(1920 - 184), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | | middle.BeginHeaderRefreshingAction += () => |
| | | { |
| | | //重新刷新logic列表 |
| | | string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString(); |
| | | for (int i = 0; i < Send.LockList.Count; i++) |
| | | { |
| | | if (Send.LockList[i].DoorLockMacPort == macport) |
| | | { |
| | | ///从列表移除当前门锁全部的旧数据; |
| | | Send.LockList.Remove(Send.LockList[i]); |
| | | i--; |
| | | } |
| | | } |
| | | Read(); |
| | | //关闭刷新View; |
| | | middle.EndHeaderRefreshing(); |
| | | }; |
| | | //Read(); |
| | | CommonPage.Loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Read(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 读取当前门锁的云端数据; |
| | | /// </summary> |
| | | public async void Read() |
| | | { |
| | | bool d = false; |
| | | string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString(); |
| | | for (int i = 0; i < Send.LockList.Count; i++) |
| | |
| | | } |
| | | UserAllView(macport); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 显示所有用户 |
| | | /// </summary> |
| | | void UserAllView(string macport) |
| | | public void UserAllView(string macport) |
| | | { |
| | | |
| | | middle.RemoveAll(); |
| | | for (int i = 0; i < Send.LockList.Count; i++) |
| | | { |
| | | var user = Send.LockList[i]; |
| | |
| | | /// 选择某个用户 |
| | | /// </summary> |
| | | /// <param name="membershipIfon">触发源列表</param> |
| | | /// <param name="userName">用户名字</param> |
| | | void SelectedUserID(Send.MembershipIfon membershipIfon) { |
| | | public void SelectedUserID(Send.MembershipIfon membershipIfon) |
| | | { |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | |
| | | flMain.MouseUpEventHandler += (sender1, e1) => |
| | |
| | | flMain.RemoveFromParent(); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | var lockcolorfra1 = new FrameLayout |
| | | { |
| | |
| | | TextSize = 14, |
| | | }; |
| | | doorlockRow.AddChidren(doorlockBtn); |
| | | |
| | | |
| | | var doorlockSelected = new Button |
| | | { |
| | | X = Application.GetRealWidth(860), |
| | |
| | | selectedIcon = doorlockSelected; |
| | | doorlockSelected.Visible = true; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var lockConditionsInfo = new Dictionary<string, string>(); |
| | |
| | | lockConditionsInfo.Add("Range", "0"); |
| | | var accounts = new Dictionary<string, string>(); |
| | | accounts.Add("Type", "1"); |
| | | accounts.Add("Account", membershipIfon.UserName+ modeName); |
| | | accounts.Add("Account", membershipIfon.UserName + modeName); |
| | | accounts.Add("UserId", attriButeData2); |
| | | if (SelectedLockStatus != "") |
| | | { |
| | |
| | | if (conditionsIndex == -1) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.usertip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | lockLogicCommunalPage.Show(() => { }); |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |