| | |
| | | /// 进入主页 |
| | | /// </summary> |
| | | /// <param name="isFirstOpen">如果是第一次启动 检测校验密码</param> |
| | | /// <param name="pageShowEvent">主页显示之后触发的事件(没有住宅的话,则不会触发)</param> |
| | | public static void GoUserPage(bool isFirstOpen = false, Action pageShowEvent = null) |
| | | public static void GoUserPage(bool isFirstOpen = false) |
| | | { |
| | | //加载Loading效果 |
| | | var waitPage = new Loading(); |
| | | BaseView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | |
| | | //当没有住宅时,不能让它往下走 |
| | | if (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | waitPage.Hide(); |
| | | var addResidencePage = new BindingResidencePage(); |
| | | BaseView.AddChidren(addResidencePage); |
| | | addResidencePage.LoadView(); |
| | | return; |
| | | } |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Entity.FunctionList.List.Clear(); |
| | | Entity.SpatialInfo.CurrentSpatial.Clear(); |
| | | if (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | bool loadPage = true; |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | while (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | pm.GetHomePager();//刷新住宅信息 |
| | | System.Threading.Thread.Sleep(2000); |
| | | if (loadPage) |
| | | { |
| | | loadPage = false; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | var addResidencePage = new BindingResidencePage(); |
| | | BaseView.AddChidren(addResidencePage); |
| | | addResidencePage.LoadView(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Entity.FunctionList.List.Clear(); |
| | | Entity.SpatialInfo.CurrentSpatial.Clear(); |
| | | } |
| | | ///等待获取住宅信息 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | //启动密码验证 |
| | | new AppUnlockPage().LoadPage(isFirstOpen); |
| | | } |
| | | //主页加载完成,回调事件 |
| | | pageShowEvent?.Invoke(); |
| | | pageShowEvent = null; |
| | | }); |
| | | } |
| | | catch (Exception ex) |