| | |
| | | private VerticalScrolViewLayout bodyScrolView; |
| | | private List<VisitorTempPassword> pwdList; |
| | | |
| | | public VisitorHistoryPage() |
| | | Action backAction;// 后退按键,刷新UI |
| | | Action action; |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | backAction?.Invoke(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | public VisitorHistoryPage(Action action) |
| | | { |
| | | backAction = action; |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | action = () => |
| | | { |
| | | LoadPage(); |
| | | }; |
| | | |
| | | pwdList = getVisitorPasswordData(); |
| | | |
| | | #region 访客记录按钮 |
| | | Action click = () => |
| | | { |
| | | VisitorHistoryPage page = new VisitorHistoryPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorInvitation)) |
| | | .LoadTopView_SettingText(click, ""); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorRecord)).LoadTopView(); |
| | | #endregion |
| | | |
| | | bodyScrolView = new VerticalScrolViewLayout() |
| | |
| | | { |
| | | Height = Application.GetRealWidth(20), |
| | | Y = Application.GetRealWidth(6), |
| | | Text = Language.StringByID(StringId.VisitorQRCode), |
| | | Text = Language.StringByID(StringId.VisitorInvitationRecord), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.text1Color, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | |
| | | itemLayout.AddChidren(btn);//+= (sender, e) |
| | | btn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | VisitorQRCodePage page = new VisitorQRCodePage(temPwd); |
| | | #if __IOS__ |
| | | #else |
| | | VisitorQRCodePage page = new VisitorQRCodePage(action, temPwd); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endif |
| | | }; |
| | | bodyScrolView.AddChidren(itemLayout); |
| | | } |
| | |
| | | } |
| | | } |
| | | return dataList; |
| | | } |
| | | |
| | | private List<TempPasswordInfo> infoList; |
| | | private void getTestData() |
| | | { |
| | | infoList = new List<TempPasswordInfo>(); |
| | | TempPasswordInfo info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | info = new TempPasswordInfo(); |
| | | info.homeId = 11111; |
| | | info.deviceId = 11111; |
| | | info.phone = "1234567890"; |
| | | info.tempPwd = "134234"; |
| | | info.useCount = 10; |
| | | info.validBeginTime = "2022/5/10 14:21:00"; |
| | | info.validEndTime = "2022/5/12 14:21:00"; |
| | | infoList.Add(info); |
| | | |
| | | } |
| | | } |
| | | } |