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 m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送"; static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分"; 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 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"; 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 m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送"; static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分"; 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 m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新发送"; static String m28(second) => "重新发送(${second}s)";
static String m29(jifen) => "商品积分 ${jifen}积分"; 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 m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新發送"; static String m28(second) => "重新發送(${second}s)";
static String m29(jifen) => "商品積分 ${jifen}積分"; 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 m27(ren) => "¥${ren}/人";
static String m28(second) => "${second}s后重新發送"; static String m28(second) => "重新發送(${second}s)";
static String m29(jifen) => "商品積分 ${jifen}積分"; 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) { String resend_in_seconds(Object second) {
return Intl.message( return Intl.message(
'${second}s后重新发送', '重新发送(${second}s)',
name: 'resend_in_seconds', name: 'resend_in_seconds',
desc: '', desc: '',
args: [second], args: [second],

2
lib/l10n/intl_en.arb

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

2
lib/l10n/intl_en_US.arb

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

2
lib/l10n/intl_zh_CN.arb

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

2
lib/l10n/intl_zh_Hans_CN.arb

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

2
lib/l10n/intl_zh_Hant_CN.arb

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

2
lib/l10n/intl_zh_TW.arb

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

54
lib/retrofit/retrofit_api.dart

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

11
lib/union/union_list.dart

@ -55,10 +55,13 @@ class UnionListState extends State<UnionList>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
late String cityName;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
powerFlag = false; powerFlag = false;
cityName = widget.city ?? "所有门店";
getLocation(); getLocation();
} }
@ -128,6 +131,11 @@ class UnionListState extends State<UnionList>
} }
} }
void refreshData(String areaName) {
this.cityName = areaName;
getLocation();
}
queryStore() async { queryStore() async {
apiService ??= ApiService( apiService ??= ApiService(
Dio(), Dio(),
@ -135,7 +143,7 @@ class UnionListState extends State<UnionList>
token: SharedInstance.instance.token, token: SharedInstance.instance.token,
); );
BaseListData<Store>? baseData = await apiService?.queryStore({ BaseListData<Store>? baseData = await apiService?.queryStore({
"city": widget.city ?? "所有门店", "city": cityName,
"latitude": (widget.latLng?.latitude ?? "").toString(), "latitude": (widget.latLng?.latitude ?? "").toString(),
"longitude": (widget.latLng?.longitude ?? "").toString(), "longitude": (widget.latLng?.longitude ?? "").toString(),
if (widget.searchKey != "") "searchKey": widget.searchKey, 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", ""); String string = ipResult.replaceAll("\n", "");
MIpData ipData = MIpData.fromJson(jsonDecode(string)); MIpData ipData = MIpData.fromJson(jsonDecode(string));
areaName = ipData.data?.location?[2]; areaName = ipData.data?.location?[2];
refreshChild();
setState(() {}); setState(() {});
} }
} }
refreshChild() {
if (areaName?.isNotEmpty ?? false) {
_allKey.forEach((key1) {
key1.currentState?.refreshData(areaName!);
});
}
}
@override @override
void didChangeAppLifecycleState(AppLifecycleState state) { void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) { if (state == AppLifecycleState.resumed) {
@ -171,6 +180,7 @@ class UnionPageState extends State<UnionPage> with AutomaticKeepAliveClientMixin
}).then((value) { }).then((value) {
if (value != null) { if (value != null) {
areaName = "$value"; areaName = "$value";
refreshChild();
setState(() {}); setState(() {});
} }
}); });

Loading…
Cancel
Save