| | |
| | | |
| | | btnAddNewResidence.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action<string> action = (str) => { |
| | | Application.RunOnMainThread(() => { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.BindingResidence(str); |
| | | }); |
| | | }; |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | action(scanString); |
| | | //执行绑定住宅 |
| | | this.DoBindResidence(scanString); |
| | | }); |
| | | }; |
| | | |
| | |
| | | MainPage.GoLoginPage(UserInfo.Current); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 执行绑定住宅 |
| | | /// </summary> |
| | | private void DoBindResidence(string scanString) |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var result = pm.BindingResidence(scanString); |
| | | if (result == null) { return; } |
| | | |
| | | if (result.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | //跳转页面---- |
| | | MainPage.GoUserPage(); |
| | | //显示欢迎回家的弹窗界面 |
| | | var form = new WellcomToHomeForm(); |
| | | form.ShowForm(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示二维码已经过期的弹窗 |
| | | /// </summary> |
| | | private void ShowQrCodeTimeOutView() |
| | | { |
| | | //整个界面的灰色背景 |
| | | var frameBack = new Dialog(); |
| | | |
| | | //中间白色区域 |
| | | var frameWite = new FrameLayout(); |
| | | frameWite.Y = Application.GetRealHeight(223); |
| | | frameWite.Height = Application.GetRealHeight(245); |
| | | frameWite.Width = Application.GetRealWidth(288); |
| | | frameWite.BackgroundColor = CSS.CSS_Color.MainBackgroundColor; |
| | | frameWite.Radius = (uint)Application.GetRealWidth(12); |
| | | frameWite.Gravity = Gravity.CenterHorizontal; |
| | | frameBack.AddChidren(frameWite); |
| | | |
| | | //Icon图标 |
| | | var picIcon = new Button(); |
| | | picIcon.Y = Application.GetRealHeight(152); |
| | | picIcon.Height = Application.GetRealWidth(160); |
| | | picIcon.Width = Application.GetRealWidth(160); |
| | | picIcon.Gravity = Gravity.CenterHorizontal; |
| | | picIcon.UnSelectedImagePath = "oRobot.png"; |
| | | frameBack.AddChidren(picIcon); |
| | | |
| | | //二维码失效,请重试 |
| | | var btnText = new Button(); |
| | | btnText.Y = Application.GetRealHeight(98); |
| | | btnText.Height = Application.GetRealHeight(24); |
| | | btnText.TextSize = 16; |
| | | btnText.TextAlignment = TextAlignment.Center; |
| | | btnText.TextColor = CSS.CSS_Color.FirstLevelTitleColor; |
| | | btnText.TextID = StringId.QRCodeIsInvalid; |
| | | frameWite.AddChidren(btnText); |
| | | |
| | | //取消 |
| | | var btnCancel = new Button(); |
| | | btnCancel.X = Application.GetRealWidth(30); |
| | | btnCancel.Y = btnText.Bottom + Application.GetRealHeight(48); |
| | | btnCancel.Height = Application.GetRealHeight(44); |
| | | btnCancel.Width = Application.GetRealWidth(108); |
| | | btnCancel.TextSize = 16; |
| | | btnCancel.IsBold = true; |
| | | btnCancel.TextAlignment = TextAlignment.Center; |
| | | btnCancel.TextColor = CSS.CSS_Color.MainColor; |
| | | btnCancel.BackgroundColor = CSS.CSS_Color.MainBackgroundColor; |
| | | btnCancel.Radius = (uint)Application.GetRealHeight(22); |
| | | btnCancel.TextID = StringId.Cancel; |
| | | btnCancel.BorderWidth = 1; |
| | | btnCancel.BorderColor = CSS.CSS_Color.MainColor; |
| | | frameWite.AddChidren(btnCancel); |
| | | |
| | | btnCancel.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | frameBack.Close(); |
| | | }; |
| | | |
| | | //重试 |
| | | var btnRedo = new Button(); |
| | | btnRedo.Y = btnText.Bottom + Application.GetRealHeight(48); |
| | | btnRedo.Height = Application.GetRealHeight(44); |
| | | btnRedo.Width = Application.GetRealWidth(108); |
| | | btnRedo.TextSize = 16; |
| | | btnRedo.IsBold = true; |
| | | btnRedo.TextAlignment = TextAlignment.Center; |
| | | btnRedo.TextColor = CSS.CSS_Color.MainBackgroundColor; |
| | | btnRedo.BackgroundColor = CSS.CSS_Color.MainColor; |
| | | btnRedo.Radius = (uint)Application.GetRealHeight(22); |
| | | btnRedo.TextID = StringId.Retry; |
| | | frameWite.AddChidren(btnRedo); |
| | | btnRedo.X = frameWite.Width - btnRedo.Width - Application.GetRealWidth(30); |
| | | |
| | | btnRedo.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | frameBack.Close(); |
| | | //执行绑定住宅 |
| | | this.DoBindResidence(scanString); |
| | | }); |
| | | }; |
| | | } |
| | | } |
| | | } |