Browse Source

门店列表ip异常定位处理;

wr_2024_invoice
wurong 5 months ago
parent
commit
a0cad315d8
  1. 8
      lib/retrofit/data/address.dart
  2. 1
      lib/union/union_page.dart
  3. 2
      lib/utils/location.dart

8
lib/retrofit/data/address.dart

@ -9,8 +9,8 @@ class Address {
String cityInfo;
String id;
bool isDefault;
String latitude;
String longitude;
dynamic latitude;
dynamic longitude;
String mid;
String phone;
String province;
@ -24,8 +24,8 @@ class Address {
..cityInfo = json['cityInfo'] as String
..id = json['id'] as String
..isDefault = json['isDefault'] as bool
..latitude = json['latitude'] as String
..longitude = json['longitude'] as String
..latitude = json['latitude'] as dynamic
..longitude = json['longitude'] as dynamic
..mid = json['mid'] as String
..phone = json['phone'] as String
..province = json['province'] as String

1
lib/union/union_page.dart

@ -136,6 +136,7 @@ class UnionPageState extends State<UnionPage>
Address address = await LocationInstance.getInstance().getAddress(result.latitude, result.longitude);
if (address != null) {
await saveLatLng(latLng, address.province, address.city, address.area);
areaName = address.city;
}
LocationInstance.getInstance().stopLocation();
} else {

2
lib/utils/location.dart

@ -313,7 +313,7 @@ class LocationInstance {
Future<Address> getAddress(double lat, double lang) async {
var result = await ApiService(Dio()).geocodeRegeo("$lat", "$lang");
print("address_result: $result");
if (result["status"] == 1 &&
if (result["status"] == "1" &&
result["regeocode"] != null &&
result["regeocode"]["addressComponent"] != null) {
Address address = Address.fromJson({

Loading…
Cancel
Save