| | |
| | | Text = "+" + phoneZoneCode, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | |
| | | //跳转国家区号选择界面 |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => { |
| | | JLCountrycode.CountryCodeView.Current.Show((countryName, code) => { |
| | | if (!string.IsNullOrEmpty(code)) |
| | | { |
| | | phoneZoneCode = code; |
| | | btnGlobalRoaming.Text = "+" + phoneZoneCode; |
| | | } |
| | | }); |
| | | }; |
| | | btnGlobalRoaming.MouseUpEventHandler += eHandler; |
| | | |
| | | if (accountType == 0) |
| | | { |
| | | accountView.AddChidren(btnGlobalRoaming); |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => { |
| | | JLCountrycode.CountryCodeView.Current.Show((countryName, code) => { |
| | | if (!string.IsNullOrEmpty(code)) |
| | | { |
| | | phoneZoneCode = code; |
| | | btnGlobalRoaming.Text = "+" + phoneZoneCode; |
| | | |
| | | } |
| | | }); |
| | | }; |
| | | btnGlobalRoaming.MouseUpEventHandler += eHandler; |
| | | |
| | | } |
| | | |
| | | //btnDividingLineVertical_AccountView = new Button() |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | |
| | | var result = false; |
| | | //调用登录接口 |
| | | var loginResult = pm.LoginByPassword(account, password); |
| | | if (loginResult.Code == HttpUtil.SUCCESS_CODE) |
| | | if (loginResult.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); |
| | | MainPage.LoginUser = new UserInfo |
| | | { |
| | | userType = revertData.userType, |
| | | accountString = account, |
| | | password = password, |
| | | lastTime = DateTime.Now, |
| | | ID = revertData.userId, |
| | | loginTokenString = revertData.headerPrefix + revertData.accessToken, |
| | | refreshToken = revertData.refreshToken, |
| | | userName = revertData.name |
| | | }; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | // UserInfo.Current = new UserInfo |
| | | //{ |
| | | // userType = revertData.userType, |
| | | // accountString = account, |
| | | // password = password, |
| | | // lastTime = DateTime.Now, |
| | | // ID = revertData.userId, |
| | | // loginTokenString = revertData.headerPrefix + revertData.accessToken, |
| | | // refreshToken = revertData.refreshToken, |
| | | // userName = revertData.name |
| | | //}; |
| | | UserInfo.Current.userType = revertData.userType; |
| | | UserInfo.Current.accountString = account; |
| | | //UserInfo.Current.password = password; |
| | | UserInfo.Current.lastTime = DateTime.Now; |
| | | UserInfo.Current.ID = revertData.userId; |
| | | UserInfo.Current.loginTokenString = revertData.headerPrefix + revertData.accessToken; |
| | | UserInfo.Current.refreshToken = revertData.refreshToken; |
| | | UserInfo.Current.userName = revertData.name; |
| | | |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("登录成功。"); |
| | | result = true; |
| | | } |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, loginResult.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | |
| | | { |
| | | var result = false; |
| | | var responsePack = pm.GetHomePager(); |
| | | if (responsePack == HttpUtil.SUCCESS_CODE) |
| | | if (responsePack == StateCode.SUCCESS) |
| | | { |
| | | } |
| | | else |