| | |
| | | public static class MainPage |
| | | { |
| | | public static FrameLayout BaseView { get; internal set; } |
| | | public static PageLayout BasePageView { get; set; } |
| | | |
| | | public static bool DisplayCompleted = false; |
| | | |
| | |
| | | |
| | | public static List<string> LocationFiles; |
| | | |
| | | public static string VersionString = "3.01205"; |
| | | public static string VersionString = "1.0103"; |
| | | |
| | | /// <summary> |
| | | /// 公司代码 |
| | |
| | | Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | |
| | | Log("1"); |
| | | LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo>(System.Text.Encoding.UTF8.GetString(MyIO.FileUtils.ReadFile("Register_File"))); |
| | | Log("2"); |
| | | //判断需不需要登录,有没有登录,或者登录是否过期, |
| | | if (LoginUser == null || !LoginUser.IsLogin) |
| | | { |
| | | var fisrtView = new UI.UI1Login.LoginPage(); |
| | | fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | BaseView.AddChidren(fisrtView); |
| | | fisrtView.LoadView(); |
| | | |
| | | GoLoginPage(); |
| | | } |
| | | else |
| | | { |
| | | //跳转页面---- |
| | | var ss = new UI.UserPage(); |
| | | BaseView.AddChidren(ss); |
| | | ss.LoadPage(); |
| | | GoUserPage(); |
| | | } |
| | | } |
| | | catch |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | MainPage.Log("root erorr : " + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 进入登录界面 |
| | | /// </summary> |
| | | public static void GoLoginPage(string account ="") |
| | | { |
| | | BaseView.RemoveAll(); |
| | | |
| | | var fisrtView = new UI.UI1Login.LoginPage(); |
| | | fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | BaseView.AddChidren(fisrtView); |
| | | fisrtView.LoadView(account); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 进入主页 |
| | | /// </summary> |
| | | public static void GoUserPage() |
| | | { |
| | | BaseView.RemoveAll(); |
| | | BasePageView = new PageLayout(); |
| | | BaseView.AddChidren(BasePageView); |
| | | |
| | | //跳转页面---- |
| | | var userPage = new UI.UserPage(); |
| | | BasePageView.AddChidren(userPage); |
| | | userPage.LoadPage(); |
| | | |
| | | |
| | | BasePageView.PageChange += (sender, e) => { |
| | | while (e < BasePageView.ChildrenCount - 1) |
| | | { |
| | | BasePageView.GetChildren(BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 自定义日志输出 |
| | | /// </summary> |
| | | public static void Log(string msg) |