Browse Source

地图路径更改;

地图关闭旋转;
新人弹窗ui更改;
关闭积分签到板块;
更改获取ip地址接口;
dev
huixiang_app 1 year ago
parent
commit
3457326fbb
  1. BIN
      assets/image/2x/icon_by_bike.webp
  2. BIN
      assets/image/2x/icon_drive.webp
  3. BIN
      assets/image/2x/icon_transit.webp
  4. BIN
      assets/image/2x/icon_walk.webp
  5. BIN
      assets/image/2x/position_sort.webp
  6. BIN
      assets/image/3x/icon_by_bike.webp
  7. BIN
      assets/image/3x/icon_drive.webp
  8. BIN
      assets/image/3x/icon_transit.webp
  9. BIN
      assets/image/3x/icon_walk.webp
  10. BIN
      assets/image/3x/position_sort.webp
  11. BIN
      assets/image/icon_by_bike.webp
  12. BIN
      assets/image/icon_drive.webp
  13. BIN
      assets/image/icon_end.png
  14. BIN
      assets/image/icon_start.png
  15. BIN
      assets/image/icon_transit.webp
  16. BIN
      assets/image/icon_walk.webp
  17. BIN
      assets/image/position_sort.webp
  18. BIN
      assets/image/traffic_texture_smooth.png
  19. BIN
      assets/image/traffic_texture_unknown.png
  20. 11
      lib/address/address_map_page.dart
  21. 1
      lib/home/home_page.dart
  22. 1
      lib/main.dart
  23. 2
      lib/mine/mine_page.dart
  24. 16
      lib/mine/mine_view/mine_navbar.dart
  25. 93
      lib/mine/mine_view/mine_view.dart
  26. 106
      lib/retrofit/data/ip_data.dart
  27. 6
      lib/retrofit/min_api.dart
  28. 30
      lib/retrofit/retrofit_api.dart
  29. 69
      lib/retrofit/retrofit_api.g.dart
  30. 3
      lib/store/store_order.dart
  31. 2
      lib/store/store_view/store_header.dart
  32. 19
      lib/store/store_view/store_info.dart
  33. 992
      lib/union/location_map_page.dart
  34. 69
      lib/union/union_page.dart
  35. 4
      lib/union/union_select_city.dart
  36. 5
      lib/utils/flutter_utils.dart
  37. 20
      lib/view_widget/new_people_reward.dart
  38. 328
      pubspec.lock
  39. 20
      pubspec.yaml

BIN
assets/image/2x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
assets/image/2x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

BIN
assets/image/2x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
assets/image/2x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

BIN
assets/image/3x/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

BIN
assets/image/3x/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/icon_by_bike.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

BIN
assets/image/icon_drive.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

BIN
assets/image/icon_end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
assets/image/icon_start.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
assets/image/icon_transit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
assets/image/icon_walk.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

BIN
assets/image/position_sort.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
assets/image/traffic_texture_smooth.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
assets/image/traffic_texture_unknown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

11
lib/address/address_map_page.dart

@ -80,6 +80,9 @@ class _AddressMapPage extends State<AddressMapPage> {
BMFMapOptions(
center: latLng,
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
);
}
@ -339,6 +342,9 @@ class _AddressMapPage extends State<AddressMapPage> {
double.tryParse(value.getString("longitude")),
),
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
);
}
@ -362,7 +368,10 @@ class _AddressMapPage extends State<AddressMapPage> {
child: BMFMapWidget(
mapOptions: BMFMapOptions(
center: BMFCoordinate(30.553111, 114.342366),
zoomLevel: 12,
zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
),
onBMFMapCreated: onMapCreated,
// onCameraMoveEnd: (cameraPosition) {

1
lib/home/home_page.dart

@ -484,6 +484,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}),
///广
if(activityBannerData.length > 0)
spread(),
// ///

1
lib/main.dart

@ -73,6 +73,7 @@ import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/store/store_view/product_meals_sku.dart';
import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/union/location_map_pages.dart';
import 'package:huixiang/union/union_select_city.dart';
import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/vip/user_vip_service_page.dart';

2
lib/mine/mine_page.dart

@ -450,7 +450,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
Widget spreadImage() {
return Container(
width: double.infinity,
// margin: EdgeInsets.symmetric(horizontal:14.w),
margin: EdgeInsets.only(bottom:24.h),
height: 85.h,
child: activityBannerData != null && activityBannerData.isNotEmpty
? Swiper(

16
lib/mine/mine_view/mine_navbar.dart

@ -175,14 +175,14 @@ class _MineNavbar extends State<MineNavbar> {
Expanded(
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
widget.toIntegralPage();
});
// SharedPreferences.getInstance().then((value) {
// if (value.getString("token") == null ||
// value.getString("token") == "") {
// LoginTipsDialog().show(context);
// return;
// }
// widget.toIntegralPage();
// });
},
child: mineBottomItem(
widget?.userInfo?.points?? "0",

93
lib/mine/mine_view/mine_view.dart

@ -373,55 +373,56 @@ class _MineView extends State<MineView> {
),
),
),
widget.userInfo == null
? Container(
alignment: Alignment.center,
height: 50.h,
child: Icon(
Icons.keyboard_arrow_right,
size: 20,
color: Colors.black,
),
)
: Container(
alignment: Alignment.bottomRight,
height: 50.h,
child: GestureDetector(
onTap: () {
widget.toIntegralPage();
},
child: Container(
padding: EdgeInsets.only(
top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
margin: EdgeInsets.only(right: 14.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
"assets/image/icon_gold_coin.webp",
width: 16,
height: 16,
),
Text(
S.of(context).tiantianlingjifen,
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
// Icon(
///
// widget.userInfo == null
// ? Container(
// alignment: Alignment.center,
// height: 50.h,
// child: Icon(
// Icons.keyboard_arrow_right,
// size: 16,
// size: 20,
// color: Colors.black,
// ),
// )
],
),
)),
),
// : Container(
// alignment: Alignment.bottomRight,
// height: 50.h,
// child: GestureDetector(
// onTap: () {
// widget.toIntegralPage();
// },
// child: Container(
// padding: EdgeInsets.only(
// top: 4.h, bottom: 4.h, right: 16.w, left: 7.w),
// margin: EdgeInsets.only(right: 14.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Image.asset(
// "assets/image/icon_gold_coin.webp",
// width: 16,
// height: 16,
// ),
// Text(
// S.of(context).tiantianlingjifen,
// style: TextStyle(
// color: Color(0xFF32A060),
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// ),
// ),
// // Icon(
// // Icons.keyboard_arrow_right,
// // size: 16,
// // color: Colors.black,
// // )
// ],
// ),
// )),
// ),
],
),
);

106
lib/retrofit/data/ip_data.dart

@ -1,42 +1,104 @@
/// id : 1887
/// ip : "27.18.151.119"
/// dz : "中国 湖北省 武汉市"
/// wl : "电信"
/// pro : "湖北省"
/// proCode : "420000"
/// city : "武汉市"
/// cityCode : "420100"
/// region : ""
/// regionCode : "0"
/// addr : "湖北省武汉市 电信"
/// regionNames : ""
/// err : ""
class IpData {
IpData({
int id,
String ip,
String dz,
String wl,}){
_id = id;
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,}){
_ip = ip;
_dz = dz;
_wl = wl;
_pro = pro;
_proCode = proCode;
_city = city;
_cityCode = cityCode;
_region = region;
_regionCode = regionCode;
_addr = addr;
_regionNames = regionNames;
_err = err;
}
IpData.fromJson(dynamic json) {
_id = json['id'];
_ip = json['ip'];
_dz = json['dz'];
_wl = json['wl'];
_pro = json['pro'];
_proCode = json['proCode'];
_city = json['city'];
_cityCode = json['cityCode'];
_region = json['region'];
_regionCode = json['regionCode'];
_addr = json['addr'];
_regionNames = json['regionNames'];
_err = json['err'];
}
int _id;
String _ip;
String _dz;
String _wl;
int get id => _id;
String _pro;
String _proCode;
String _city;
String _cityCode;
String _region;
String _regionCode;
String _addr;
String _regionNames;
String _err;
IpData copyWith({ String ip,
String pro,
String proCode,
String city,
String cityCode,
String region,
String regionCode,
String addr,
String regionNames,
String err,
}) => IpData( ip: ip ?? _ip,
pro: pro ?? _pro,
proCode: proCode ?? _proCode,
city: city ?? _city,
cityCode: cityCode ?? _cityCode,
region: region ?? _region,
regionCode: regionCode ?? _regionCode,
addr: addr ?? _addr,
regionNames: regionNames ?? _regionNames,
err: err ?? _err,
);
String get ip => _ip;
String get dz => _dz;
String get wl => _wl;
String get pro => _pro;
String get proCode => _proCode;
String get city => _city;
String get cityCode => _cityCode;
String get region => _region;
String get regionCode => _regionCode;
String get addr => _addr;
String get regionNames => _regionNames;
String get err => _err;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['ip'] = _ip;
map['dz'] = _dz;
map['wl'] = _wl;
map['pro'] = _pro;
map['proCode'] = _proCode;
map['city'] = _city;
map['cityCode'] = _cityCode;
map['region'] = _region;
map['regionCode'] = _regionCode;
map['addr'] = _addr;
map['regionNames'] = _regionNames;
map['err'] = _err;
return map;
}

6
lib/retrofit/min_api.dart

@ -27,9 +27,9 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart';
const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///线
// const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
///

30
lib/retrofit/retrofit_api.dart

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:gbk2utf8/gbk2utf8.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
@ -17,6 +18,7 @@ import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart';
import 'data/address.dart';
@ -63,11 +65,15 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///线
// const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";
const ipBaseUrl = "https://api.asilu.com";///ip
///线
const ipBaseUrl = "http://whois.pconline.com.cn";
///ip
@RestApi(baseUrl: localBaseUrl)
abstract class ApiService {
@ -85,8 +91,7 @@ abstract class ApiService {
if (pay) {
headers["Environment"] = "app";
}
if (kReleaseMode)
baseUrl = serviceBaseUrl;
if (kReleaseMode) baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions(
connectTimeout: 60000,
@ -96,13 +101,16 @@ abstract class ApiService {
);
dio.interceptors.add(
InterceptorsWrapper(onRequest: (RequestOptions options) {
try {
debugPrint("\n======================= 请求数据 =======================");
debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) {
//loading
EasyLoading.show(status: S.of(context).zhengzaijiazai,maskType: EasyLoadingMaskType.black);
EasyLoading.show(
status: S.of(context).zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
}
if (options.data is FormData) {
debugPrint("params data = FormData");
@ -110,7 +118,9 @@ abstract class ApiService {
debugPrint("params data = ${jsonEncode(options.data)}");
}
debugPrint("params queryParameters = ${options.queryParameters}");
} catch (e1) {}
}, onResponse: (Response response) {
try {
debugPrint("\n======================= 响应数据开始 =======================");
if (showLoading && EasyLoading.isShow) {
EasyLoading.dismiss();
@ -136,6 +146,7 @@ abstract class ApiService {
// SmartDialog.showToast(map["msg"], alignment: Alignment.center);
}
debugPrint("======================= 响应数据结束 =======================\n");
} catch (e2) {}
}, onError: (DioError e) {
if (EasyLoading.isShow) {
EasyLoading.dismiss();
@ -225,7 +236,8 @@ abstract class ApiService {
///
@GET("/wallet/rechargeActList?tenantCode={tenantCode}")
Future<BaseData<RechargeActLists>> rechargeActList(@Path("tenantCode") String tenantCode);
Future<BaseData<RechargeActLists>> rechargeActList(
@Path("tenantCode") String tenantCode);
///
@GET("/coupon/receive?couponId={couponId}")
@ -584,6 +596,6 @@ abstract class ApiService {
@Path("creditGoodsId") String creditGoodsId);
///APP门店推广渠道
@GET("/ip/")
@GET("/ipJson.jsp")
Future<IpData> getIpInfo();
}

69
lib/retrofit/retrofit_api.g.dart

@ -17,21 +17,18 @@ class _ApiService implements ApiService {
String baseUrl;
@override
Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async {
Future<BaseData<UploadResult>> upload(data, folderId, bool isVideo) async {
ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last;
if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
if (!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4"))
fileName += ".mp4";
else if (isVideo && !fileName.contains(".mp4")) fileName += ".mp4";
_data.files.add(MapEntry(
'file',
MultipartFile.fromFileSync(data.path,
filename: fileName)));
'file', MultipartFile.fromFileSync(data.path, filename: fileName)));
print("filename:$fileName");
if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString()));
@ -93,7 +90,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData.fromJson(
_result.data,
(json) => json==null?null:json,
(json) => json == null ? null : json,
);
return value;
}
@ -120,7 +117,7 @@ class _ApiService implements ApiService {
}
@override
Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async {
Future<BaseData<dynamic>> sendVerify(areaCode, mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile');
ArgumentError.checkNotNull(areaCode, 'areaCode');
const _extra = <String, dynamic>{};
@ -359,7 +356,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json == null ? null :json as dynamic,
(json) => json == null ? null : json as dynamic,
);
return value;
}
@ -592,7 +589,9 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<List<Store>>.fromJson(
_result.data,
(json) => ((json??"") == "")?null:(json as List<dynamic>)
(json) => ((json ?? "") == "")
? null
: (json as List<dynamic>)
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList());
return value;
@ -885,7 +884,9 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<PageInfo<OrderInfo>>.fromJson(
_result.data,
(json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson(
(json) => ((json ?? "") == "")
? null
: PageInfo<OrderInfo>.fromJson(
json,
(json) => OrderInfo.fromJson(json),
),
@ -1272,7 +1273,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<String>.fromJson(
_result.data,
(json) => json==null?null:(json as String),
(json) => json == null ? null : (json as String),
);
return value;
}
@ -1295,7 +1296,7 @@ class _ApiService implements ApiService {
data: _data);
final value = BaseData<bool>.fromJson(
_result.data,
(json) => (json??"")=="" ? null :(json as bool),
(json) => (json ?? "") == "" ? null : (json as bool),
);
return value;
}
@ -1881,7 +1882,8 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>('coupon/detail/$memberCouponId',
final _result = await _dio.request<Map<String, dynamic>>(
'coupon/detail/$memberCouponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2051,7 +2053,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/updatePayPwd',
final _result = await _dio.request<Map<String, dynamic>>(
'/member/updatePayPwd',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2073,7 +2076,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/verifyByUpdatePayPwd',
final _result = await _dio.request<Map<String, dynamic>>(
'/member/verifyByUpdatePayPwd',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2093,8 +2097,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/index',
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/index',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2114,18 +2117,14 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/ip/',
final _result = await _dio.request<List<int>>('/ipJson.jsp',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
options: RequestOptions(method: 'GET', extra: _extra, baseUrl: baseUrl,responseType: ResponseType.bytes),
data: _data);
final value = IpData.fromJson(
_result.data,
);
var ts = gbk.decode(_result.data);
final value = IpData.fromJson(jsonDecode(ts
.substring(ts.indexOf("{\"ip\":\""))
.replaceAll(");}", "")));
return value;
}
@ -2136,7 +2135,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/vipCard/orderVip',
final _result = await _dio.request<Map<String, dynamic>>(
'/vipCard/orderVip',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2156,8 +2156,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/raise/products',
final _result = await _dio.request<Map<String, dynamic>>('/raise/products',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -2181,7 +2180,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/auth/changePhone',
final _result = await _dio.request<Map<String, dynamic>>(
'/auth/changePhone',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
@ -2236,8 +2236,7 @@ class _ApiService implements ApiService {
final value = BaseData<List<Store>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<Store>(
(i) => Store.fromJson(i as Map<String, dynamic>))
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}

3
lib/store/store_order.dart

@ -327,7 +327,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
CrossAxisAlignment.start,
children: [
///
StoreInfoView(storeInfo),
StoreInfoView(storeInfo,widget.arguments["distance"],),
// Padding(padding:EdgeInsets.only(left: 14.w),
// child: Text(
// S.of(context).diandan,
@ -657,7 +657,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
"distance": widget.arguments["distance"],
"vipLevelName": memberVo?.memberRankVo?.rankName ??"",
"isVips": memberVo?.isVip ?? false,
"distance": widget.arguments["distance"],
"subscribeParam": miNiDetail?.subscribeParam,
},
);

2
lib/store/store_view/store_header.dart

@ -43,7 +43,7 @@ class StoreHeader extends SliverPersistentHeaderDelegate {
child: Column(
children: [
///
StoreInfoView(storeInfo),
StoreInfoView(storeInfo,0),
///
if (storeInfo != null && storeInfo.couponVOList != null)

19
lib/store/store_view/store_info.dart

@ -11,8 +11,9 @@ import 'package:url_launcher/url_launcher.dart';
class StoreInfoView extends StatefulWidget {
final StoreInfo storeInfo;
final double distance;
StoreInfoView(this.storeInfo);
StoreInfoView(this.storeInfo,this.distance);
@override
State<StatefulWidget> createState() {
@ -172,13 +173,14 @@ class _StoreInfoView extends State<StoreInfoView> {
arguments: {
"lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName,
"storeInfo":widget.storeInfo,
"distance":widget.distance
},
);
},
child:Container(
color: Colors.transparent,
padding:EdgeInsets.only(right: 8.w) ,
padding:EdgeInsets.only(right: 8.w,bottom: 16.h) ,
child: Image.asset(
"assets/image/icon_union_location.webp",
width: 20,
@ -196,13 +198,15 @@ class _StoreInfoView extends State<StoreInfoView> {
arguments: {
"lat": widget.storeInfo.latitude,
"lng": widget.storeInfo.longitude,
"storeName": widget.storeInfo.storeName,
"storeInfo":widget.storeInfo,
"distance":widget.distance
},
);
}else{
return;
}
},
child:Padding(padding: EdgeInsets.only(bottom: 16.h,),
child: Text(
"${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}",
maxLines: 2,
@ -215,15 +219,15 @@ class _StoreInfoView extends State<StoreInfoView> {
),
),
),
),
if((widget?.storeInfo?.tel ?? "") != "")
GestureDetector(
behavior: HitTestBehavior.translucent,
behavior: HitTestBehavior.opaque,
onTap: () {
showCallMobile();
},
child: Container(
padding:EdgeInsets.only(left: 16.w,right: 8.w) ,
padding:EdgeInsets.only(left: 16.w,right: 8.w,bottom: 16.h) ,
child: Image.asset(
"assets/image/icon_union_call.webp",
width: 24,
@ -237,7 +241,6 @@ class _StoreInfoView extends State<StoreInfoView> {
width: double.infinity,
height: 1,
color: Color(0xFFF4F5F2),
margin: EdgeInsets.only(top: 16),
)
],
),

992
lib/union/location_map_page.dart

File diff suppressed because it is too large Load Diff

69
lib/union/union_page.dart

@ -55,13 +55,8 @@ class UnionPageState extends State<UnionPage>
super.dispose();
WidgetsBinding.instance.removeObserver(this);
if (Location.getInstance() != null &&
Location
.getInstance()
.aMapFlutterLocation != null)
Location
.getInstance()
.aMapFlutterLocation
.stopLocation();
Location.getInstance().aMapFlutterLocation != null)
Location.getInstance().aMapFlutterLocation.stopLocation();
}
@override
@ -69,14 +64,8 @@ class UnionPageState extends State<UnionPage>
super.didChangeMetrics();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
print("object: ${MediaQuery
.of(context)
.viewInsets
.bottom}");
if (MediaQuery
.of(context)
.viewInsets
.bottom == 0) {
print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
isKeyBoardShow = false;
//
@ -101,11 +90,17 @@ class UnionPageState extends State<UnionPage>
}
});
queryIpInfo();
// loadFinish(showLoading: false);
}
startLocation() async {
bool powerFlag = false;
// bool finallyFlag = false;
try {
Future.delayed(Duration(seconds: 5), () {
// if (!finallyFlag)
Location.getInstance().stopLocation();
});
powerFlag = await Location.getInstance().startLocation(context,
(BaiduLocation result) async {
if (result != null &&
@ -128,6 +123,7 @@ class UnionPageState extends State<UnionPage>
loadFinish(showLoading: false);
});
} finally {
// finallyFlag = true;
if (!powerFlag) {
if (await Permission.locationWhenInUse.status.isGranted) {
startLocation();
@ -159,17 +155,24 @@ class UnionPageState extends State<UnionPage>
}
queryIpInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
try {
ApiService apiIpService = ApiService(Dio(), context: context, isIp: true);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData?.dz != null) {
areaName = baseData.dz.substring(baseData.dz.lastIndexOf(" ") +1).replaceAll("", "");
if (baseData?.city != null) {
areaName = baseData.city.replaceAll("", "");
}
} finally {
startLocation();
}
}
loadFinish({bool showLoading = true}) {
if (showLoading) EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
if (showLoading)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
_allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {});
}
@ -245,18 +248,10 @@ class UnionPageState extends State<UnionPage>
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: S
.of(context)
.quanbu),
MyTab(text: S
.of(context)
.chi),
MyTab(text: S
.of(context)
.he),
MyTab(text: S
.of(context)
.wan),
MyTab(text: S.of(context).quanbu),
MyTab(text: S.of(context).chi),
MyTab(text: S.of(context).he),
MyTab(text: S.of(context).wan),
],
),
),
@ -286,10 +281,7 @@ class UnionPageState extends State<UnionPage>
],
),
padding:
EdgeInsets.only(top: MediaQuery
.of(context)
.padding
.top + 17.h),
EdgeInsets.only(top: MediaQuery.of(context).padding.top + 17.h),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
@ -344,11 +336,14 @@ class UnionPageState extends State<UnionPage>
color: Color(0xFFB3B3B3),
),
isCollapsed: true,
prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset(
prefixIcon: Padding(
padding: EdgeInsets.only(left: 5.w, right: 5.w),
child: Image.asset(
"assets/image/icon_search.webp",
width: 16.h,
height: 16.h,
),),
),
),
prefixIconConstraints: BoxConstraints(),
border: InputBorder.none,
),

4
lib/union/union_select_city.dart

@ -67,8 +67,8 @@ class _UnionSelectCity extends State<UnionSelectCity> {
isIp: true
);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData?.dz != null) {
ipName = baseData.dz.substring(baseData.dz.lastIndexOf(" ")+1).replaceAll("", "");
if (baseData?.city != null) {
ipName = baseData.city.replaceAll("", "");
if(ipName != widget.arguments["cityName"] ){
ipState=2;
setState((){});

5
lib/utils/flutter_utils.dart

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
@ -10,11 +11,11 @@ import 'package:path_provider/path_provider.dart';
class AppUtils {
///线
static Future<String> calculateDistance(
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async {
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng, {bool isMi = false}) async {
double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#");
return "${numberFormat.format(mi / 1000)}";
return "${numberFormat.format(mi / (isMi ? 1 :1000))}";
}

20
lib/view_widget/new_people_reward.dart

@ -27,7 +27,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
width: double.infinity,
height: 500.h,
padding: EdgeInsets.only(top: 210.h),
margin: EdgeInsets.only(top: 20.h, left: 20, right: 20),
margin: EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
@ -58,7 +58,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
borderRadius: BorderRadius.circular(22.5),
),
width: MediaQuery.of(context).size.width,
height: 40,
height: 40.h,
alignment: Alignment.center,
child: Text(
S.of(context).lijilingqu,
@ -73,7 +73,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
],
),
),
SizedBox(height: 35),
SizedBox(height: 35.h),
GestureDetector(
onTap: () {
setState(() {
@ -82,8 +82,8 @@ class _NewPeopleReward extends State<NewPeopleReward> {
},
child: Image.asset(
"assets/image/yq_qx.webp",
width: 34,
height: 34,
width: 34.h,
height: 34.h,
),
)
],
@ -117,7 +117,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
image: AssetImage("assets/image/xin_rq.webp"),
),
),
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 50.w, vertical: 5.h),
padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
@ -150,13 +150,13 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
),
Expanded(child:Padding(
padding: EdgeInsets.only(top: 4, bottom: 4,left:30),
padding: EdgeInsets.only(top: 4.h, bottom: 4.h,left:30.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
firstLoginCouponList.storeName,
firstLoginCouponList.couponName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@ -166,7 +166,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
),
Text(
firstLoginCouponList.couponName,
firstLoginCouponList.storeName,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(

328
pubspec.lock

File diff suppressed because it is too large Load Diff

20
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.2.16+60
version: 3.2.20+63
environment:
sdk: ">=2.7.0 <3.0.0"
@ -13,9 +13,9 @@ dependencies:
sdk: flutter
flutter_localizations:
sdk: flutter
fluwx: ^3.9.0+2
fluwx: 3.9.0+2
tobias: ^2.4.1
tobias: 2.4.1
gradient_widgets: ^0.6.0
@ -38,11 +38,11 @@ dependencies:
permission_handler: ^5.0.1+1
flutter_bmflocation: ^3.2.1
flutter_baidu_mapapi_base: ^3.2.0
flutter_baidu_mapapi_map: ^3.2.1
flutter_baidu_mapapi_search: ^3.2.0
flutter_baidu_mapapi_utils: ^3.2.0
flutter_bmflocation: 3.2.1
flutter_baidu_mapapi_base: 3.2.0
flutter_baidu_mapapi_map: 3.2.1
flutter_baidu_mapapi_search: 3.2.0
flutter_baidu_mapapi_utils: 3.2.0
dio: ^3.0.10
rxdart: ^0.26.0
@ -52,9 +52,11 @@ dependencies:
pin_input_text_field: ^4.1.2
android_intent_plus: ^1.0.2
flutter_screenutil: ^5.0.0+1
flutter_screenutil: 5.0.0+1
bubble_tab_indicator: ^0.1.6
gbk2utf8: ^1.0.1
event_bus: ^2.0.0
intl: ^0.17.0
shared_preferences: ^2.0.6

Loading…
Cancel
Save