/// <summary> /// 新增地址 /// </summary> private async void AddAddress() { try { if (!Tools.IsPhoneNumber(Tel)) { CrossToastPopUp.Current.ShowToastWarning("手机号格式不标准,请检查。", ToastLength.Long); return; } if (!Tools.IsNetConnective()) { CrossToastPopUp.Current.ShowToastError("无网络连接,请检查网络。", ToastLength.Long); return; } AddressInfo addressInfo = new AddressInfo { addressId = 0, userId = GlobalVariables.LoggedUser.id, userName = UserName, tel = Tel, streetName = StreetName, isDefault = IsDefault }; SimpleRD simpleRD = await RestSharpService.AddAddress(addressInfo); if (simpleRD.success) { CrossToastPopUp.Current.ShowToastSuccess("添加成功!", ToastLength.Long); await Application.Current.MainPage.Navigation.PopAsync(); } else { CrossToastPopUp.Current.ShowToastError("添加失败!网络可能出问题了!", ToastLength.Long); } } catch (Exception) { throw; } }