| | |
| | | Y = Application.GetRealHeight (1136 - 90 - 90), |
| | | Width = Application.GetRealWidth (640), |
| | | Height = Application.GetRealHeight (90), |
| | | Text = Language.StringByID (R.MyInternationalizationString.Version) + " : " + MainPage.CodeIDString, |
| | | Text = Language.StringByID (R.MyInternationalizationString.Version) + " : " + MainPage.RequestVersion, |
| | | TextColor = SkinStyle.Current.TextColor1, |
| | | BackgroundColor = SkinStyle.Current.ViewColor, |
| | | Enable = false |
| | |
| | | UserMiddle.updateSensorhreadList.Clear (); |
| | | } |
| | | |
| | | public static void Init (bool isGuide = false) |
| | | //2020-01-11 |
| | | public static void Init (bool isGuide = false, bool bFromLogin = false) |
| | | { |
| | | if (MainPage.LoginUser == null) |
| | | MainPage.LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo> (System.Text.Encoding.UTF8.GetString (Shared.IO.FileUtils.ReadFile (UserInfo.GlobalRegisterFile))); |
| | |
| | | new AccountLogin ().Show (); |
| | | UserConfig.Instance.TipVersionBackup = UserConfig.Instance.VersionNumber; |
| | | } else { |
| | | if (UserConfig.Instance.GatewayList.Count == 0) { |
| | | UserHomePage.FrameLayoutMain.AddChidren (guidePageView); |
| | | var guide = new GuideAddResidence (); |
| | | guidePageView.AddChidren (guide); |
| | | guide.ShowHomeList (false); |
| | | guidePageView.PageIndex = 0; |
| | | MainPage.LoginUser.LastTime = DateTime.MinValue; |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | | guidePageView.PageChange += (ddf, ffd) => { |
| | | if (ffd < guidePageView.ChildrenCount - 1) { |
| | | guidePageView.GetChildren (guidePageView.ChildrenCount - 1).RemoveFromParent (); |
| | | } |
| | | }; |
| | | return; |
| | | //if (UserConfig.Instance.GatewayList.Count == 0) { |
| | | //2020-01-11 Mac没绑定并且为主账号 是否来只登录界面 |
| | | if (bFromLogin) { |
| | | if (!UserConfig.Instance.CheckHomeGatewaysNotEmpty () && MainPage.LoginUser.AccountType == 0) { |
| | | UserHomePage.FrameLayoutMain.AddChidren (guidePageView); |
| | | var guide = new GuideAddResidence (); |
| | | guide.IsHideBack = true; |
| | | guidePageView.AddChidren (guide); |
| | | |
| | | guide.ShowHomeList (true); |
| | | guidePageView.PageIndex = 0; |
| | | MainPage.LoginUser.LastTime = DateTime.MinValue; |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | | guidePageView.PageChange += (ddf, ffd) => { |
| | | if (ffd < guidePageView.ChildrenCount - 1) { |
| | | guidePageView.GetChildren (guidePageView.ChildrenCount - 1).RemoveFromParent (); |
| | | } |
| | | }; |
| | | return; |
| | | } |
| | | } |
| | | InitHomePageView (); |
| | | //后台验证账号 |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | try { |
| | | var requestObj = new LoginObj () { Account = MainPage.LoginUser.AccountString, Password = MainPage.LoginUser.Password }; |
| | | var requestObj = new LoginObj () { Account = MainPage.LoginUser.AccountString, Password = MainPage.LoginUser.Password, Company = MainPage.SoftSmsType }; |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj); |
| | | var revertObj = MainPage.RequestHttps ("Login", requestJson, false, false); |
| | | var revertObj = MainPage.RequestHttps (API.Login, requestJson); |
| | | if (revertObj != null) { |
| | | Application.RunOnMainThread (() => { |
| | | if (revertObj.StateCode == "SUCCESS") { |
| | | if (revertObj.StateCode.ToUpper () == "SUCCESS") { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes> (revertObj.ResponseData.ToString ()); |
| | | MainPage.LoginUser.AllVisionRegisterDevUserNameGuid = revertData.AllVisionRegisterDevUserNameGuid; |
| | | MainPage.LoginUser.LastTime = DateTime.Now; |
| | |
| | | UserDeviceToFH.readAllStatus (true); |
| | | } |
| | | } |
| | | } |
| | | } |