Browse Source

IP获取城市修改,其他UI修改

dart3_last
fff 1 day ago
parent
commit
34c334449e
  1. 2
      lib/generated/intl/messages_en.dart
  2. 2
      lib/generated/intl/messages_en_US.dart
  3. 2
      lib/generated/intl/messages_zh_CN.dart
  4. 2
      lib/generated/intl/messages_zh_Hans_CN.dart
  5. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  6. 2
      lib/generated/intl/messages_zh_TW.dart
  7. 4
      lib/generated/l10n.dart
  8. 2
      lib/l10n/intl_en.arb
  9. 2
      lib/l10n/intl_en_US.arb
  10. 2
      lib/l10n/intl_zh_CN.arb
  11. 2
      lib/l10n/intl_zh_Hans_CN.arb
  12. 2
      lib/l10n/intl_zh_Hant_CN.arb
  13. 2
      lib/l10n/intl_zh_TW.arb
  14. 54
      lib/retrofit/retrofit_api.dart
  15. 11
      lib/union/union_list.dart
  16. 10
      lib/union/union_page.dart

2
lib/generated/intl/messages_en.dart

@ -76,7 +76,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送";
static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分";

2
lib/generated/intl/messages_en_US.dart

@ -76,7 +76,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/person";
static String m28(second) => "${second}s and then resend";
static String m28(second) => "resend (${second}s)";
static String m29(jifen) => "Product credit ${jifen}credit";

2
lib/generated/intl/messages_zh_CN.dart

@ -76,7 +76,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送";
static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分";

2
lib/generated/intl/messages_zh_Hans_CN.dart

@ -76,7 +76,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送";
static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分";

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -74,7 +74,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新發送";
static String m28(second) => "重新發送(${second}s)";
static String m29(jifen) => "商品積分 ${jifen}積分";

2
lib/generated/intl/messages_zh_TW.dart

@ -74,7 +74,7 @@ class MessageLookup extends MessageLookupByLibrary {
static String m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新發送";
static String m28(second) => "重新發送(${second}s)";
static String m29(jifen) => "商品積分 ${jifen}積分";

4
lib/generated/l10n.dart

@ -120,10 +120,10 @@ class S {
);
}
/// `{second}s后重新发送`
/// `({second}s)`
String resend_in_seconds(Object second) {
return Intl.message(
'${second}s后重新发送',
'重新发送(${second}s)',
name: 'resend_in_seconds',
desc: '',
args: [second],

2
lib/l10n/intl_en.arb

@ -6,7 +6,7 @@
"input_code_hide": "请输入验证码",
"login": "登录",
"send_code": "发送验证码",
"resend_in_seconds": "{second}s后重新发送",
"resend_in_seconds": "重新发送({second}s)",
"phone_error": "手机格式错误",
"code_error": "验证码输入错误",
"privacy_policy1": "登录既同意",

2
lib/l10n/intl_en_US.arb

@ -6,7 +6,7 @@
"input_code_hide": "Please enter the verification code",
"login": "login",
"send_code": "Validate code",
"resend_in_seconds": "{second}s and then resend",
"resend_in_seconds": "resend ({second}s)",
"phone_error": "Wrong phone format",
"code_error": "Wrong input of verification code",
"privacy_policy1": "Login Agreed",

2
lib/l10n/intl_zh_CN.arb

@ -6,7 +6,7 @@
"input_code_hide": "请输入验证码",
"login": "登录",
"send_code": "发送验证码",
"resend_in_seconds": "{second}s后重新发送",
"resend_in_seconds": "重新发送({second}s)",
"phone_error": "手机格式错误",
"code_error": "验证码输入错误",
"privacy_policy1": "登录既同意",

2
lib/l10n/intl_zh_Hans_CN.arb

@ -6,7 +6,7 @@
"input_code_hide": "请输入验证码",
"login": "登录",
"send_code": "发送验证码",
"resend_in_seconds": "{second}s后重新发送",
"resend_in_seconds": "重新发送({second}s)",
"phone_error": "手机格式错误",
"code_error": "验证码输入错误",
"privacy_policy1": "登录既同意",

2
lib/l10n/intl_zh_Hant_CN.arb

@ -6,7 +6,7 @@
"input_code_hide": "請輸入驗證碼",
"login": "登錄",
"send_code": "發送驗證碼",
"resend_in_seconds": "{second}s后重新發送",
"resend_in_seconds": "重新發送({second}s)",
"phone_error": "手機格式錯誤",
"code_error": "驗證碼輸入錯誤",
"privacy_policy1": "登錄既同意",

2
lib/l10n/intl_zh_TW.arb

@ -6,7 +6,7 @@
"input_code_hide": "請輸入驗證碼",
"login": "登錄",
"send_code": "發送驗證碼",
"resend_in_seconds": "{second}s后重新發送",
"resend_in_seconds": "重新發送({second}s)",
"phone_error": "手機格式錯誤",
"code_error": "驗證碼輸入錯誤",
"privacy_policy1": "登錄既同意",

54
lib/retrofit/retrofit_api.dart

@ -119,38 +119,34 @@ abstract class ApiService {
} catch (e1) {}
handler.next(options);
}, onResponse: (Response response, ResponseInterceptorHandler handler) {
try {
debugPrint("\n======================= 响应数据开始 =======================");
if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) {
AppUtils.removeLoadingPath(response.requestOptions.path);
} else {
AppUtils.cleanLoadingPath();
}
debugPrint("code = ${response.statusCode}");
p(jsonEncode(response.data));
if (response.data is Map) {
Map map = response.data;
if (map["code"] == 40005 || map["code"] == 40001) {
if (context != null) {
LoginTipsDialog.instance.show(context);
}
}
debugPrint("======================= 响应数据结束 =======================\n");
if (map["code"] == 0 || map["code"] == 200 || map["infocode"] == "10000") {
handler.next(response);
} else {
throw DioException(
requestOptions: response.requestOptions,
type: DioExceptionType.unknown,
response: response,
message: "${map["msg"] ?? map["message"] ?? map["repMsg"]}",
);
debugPrint("\n======================= 响应数据开始 =======================");
if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) {
AppUtils.removeLoadingPath(response.requestOptions.path);
} else {
AppUtils.cleanLoadingPath();
}
debugPrint("code = ${response.statusCode}");
p(jsonEncode(response.data));
if (response.data is Map) {
Map map = response.data;
if (map["code"] == 40005 || map["code"] == 40001) {
if (context != null) {
LoginTipsDialog.instance.show(context);
}
} else {
}
debugPrint("======================= 响应数据结束 =======================\n");
if (map["code"] == 0 || map["code"] == 200 || map["repCode"] == "0000" || map["infocode"] == "10000") {
handler.next(response);
} else {
throw DioException(
requestOptions: response.requestOptions,
type: DioExceptionType.unknown,
response: response,
message: "${map["msg"] ?? map["message"] ?? map["repMsg"]}",
);
}
} catch (e2) {
print("respon: ${e2}");
} else {
handler.next(response);
}
}, onError: (DioException e, ErrorInterceptorHandler handler) {
if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) {

11
lib/union/union_list.dart

@ -55,10 +55,13 @@ class UnionListState extends State<UnionList>
@override
bool get wantKeepAlive => true;
late String cityName;
@override
void initState() {
super.initState();
powerFlag = false;
cityName = widget.city ?? "所有门店";
getLocation();
}
@ -128,6 +131,11 @@ class UnionListState extends State<UnionList>
}
}
void refreshData(String areaName) {
this.cityName = areaName;
getLocation();
}
queryStore() async {
apiService ??= ApiService(
Dio(),
@ -135,7 +143,7 @@ class UnionListState extends State<UnionList>
token: SharedInstance.instance.token,
);
BaseListData<Store>? baseData = await apiService?.queryStore({
"city": widget.city ?? "所有门店",
"city": cityName,
"latitude": (widget.latLng?.latitude ?? "").toString(),
"longitude": (widget.latLng?.longitude ?? "").toString(),
if (widget.searchKey != "") "searchKey": widget.searchKey,
@ -818,4 +826,5 @@ class UnionListState extends State<UnionList>
),
);
}
}

10
lib/union/union_page.dart

@ -104,10 +104,19 @@ class UnionPageState extends State<UnionPage> with AutomaticKeepAliveClientMixin
String string = ipResult.replaceAll("\n", "");
MIpData ipData = MIpData.fromJson(jsonDecode(string));
areaName = ipData.data?.location?[2];
refreshChild();
setState(() {});
}
}
refreshChild() {
if (areaName?.isNotEmpty ?? false) {
_allKey.forEach((key1) {
key1.currentState?.refreshData(areaName!);
});
}
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
@ -171,6 +180,7 @@ class UnionPageState extends State<UnionPage> with AutomaticKeepAliveClientMixin
}).then((value) {
if (value != null) {
areaName = "$value";
refreshChild();
setState(() {});
}
});

Loading…
Cancel
Save