| | |
| | | |
| | | public static FrameLayout UserPageView = new FrameLayout (); |
| | | |
| | | public static Button LinkStatusTip = new Button () { |
| | | Height = Application.GetRealHeight (36), |
| | | Width = Application.GetRealWidth (640), |
| | | BackgroundColor = SkinStyle.Current.LinkStatusTipColor |
| | | }; |
| | | //public static Button LinkStatusTip = new Button () { |
| | | // Height = Application.GetRealHeight (36), |
| | | // Width = Application.GetRealWidth (640), |
| | | // BackgroundColor = SkinStyle.Current.LinkStatusTipColor |
| | | //}; |
| | | |
| | | public static PageLayout FavoritePageView = new PageLayout () { |
| | | IsShowPoint = false, |
| | |
| | | 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 |
| | |
| | | new AccountLogin ().Show (); |
| | | UserConfig.Instance.TipVersionBackup = UserConfig.Instance.VersionNumber; |
| | | } else { |
| | | if (UserConfig.Instance.GatewayList.Count == 0) { |
| | | UserHomePage.FrameLayoutMain.AddChidren (guidePageView); |
| | | //if (UserConfig.Instance.GatewayList.Count == 0) { |
| | | //2020-01-10 Mac没绑定并且为主账号 |
| | | if (!UserConfig.Instance.CheckHomeGatewaysNotEmpty() && MainPage.LoginUser.AccountType == 0) { |
| | | UserHomePage.FrameLayoutMain.AddChidren (guidePageView); |
| | | var guide = new GuideAddResidence (); |
| | | guide.IsHideBack = true; |
| | | guidePageView.AddChidren (guide); |
| | | guide.ShowHomeList (false); |
| | | |
| | | guide.ShowHomeList (true); |
| | | guidePageView.PageIndex = 0; |
| | | MainPage.LoginUser.LastTime = DateTime.MinValue; |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | |
| | | //后台验证账号 |
| | | 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; |
| | |
| | | Language.CurrentLanguage = "English"; |
| | | //var lii = new LightLogic () { Type = DeviceType.LightRGB, LoopID = 1, DeviceID = 4, SubnetID = 42, Name = "RGB" }; |
| | | //IO.FileUtils.SaveEquipmentMessage (lii, lii.LoopID.ToString ()); |
| | | //var lii1 = new LightSwitch () { LoopID = 1, DeviceID = 6, SubnetID = 42, Name = "继电器" }; |
| | | //IO.FileUtils.SaveEquipmentMessage (lii1, lii1.LoopID.ToString ()); |
| | | //var lii11 = new LightDimming () { LoopID = 1, DeviceID = 9, SubnetID = 42, Name = "调光器" }; |
| | | var lii1 = new LightSwitch () { LoopID = 1, DeviceID = 2, SubnetID = 232, Name = "继电器" }; |
| | | IO.FileUtils.SaveEquipmentMessage (lii1, lii1.LoopID.ToString ()); |
| | | //var lii11 = new LightDimming () { LoopID = 1, DeviceID = 1, SubnetID = 232, Name = "调光器" }; |
| | | //IO.FileUtils.SaveEquipmentMessage (lii11, lii11.LoopID.ToString ()); |
| | | //var lii111 = new LightDimming () { LoopID = 11, DeviceID = 9, SubnetID = 42, Name = "调光器2" }; |
| | | //var lii111 = new LightDimming () { LoopID = 1, DeviceID = 8, SubnetID = 232, Name = "调光器2" }; |
| | | //IO.FileUtils.SaveEquipmentMessage (lii111, lii111.LoopID.ToString ()); |
| | | |
| | | |
| | |
| | | //IO.FileUtils.SaveEquipmentMessage (ud3, "3"); |
| | | #endif |
| | | UserHomePage.FrameLayoutMain.AddChidren (UserPageView); |
| | | UserHomePage.FrameLayoutMain.AddChidren (LinkStatusTip); |
| | | //UserHomePage.FrameLayoutMain.AddChidren (LinkStatusTip); |
| | | |
| | | UserPageView.AddChidren (FavoritePageView); |
| | | FavoritePageView.AddChidren (FavoriteBodyView); |