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. 99
      lib/mine/mine_view/mine_view.dart
  26. 106
      lib/retrofit/data/ip_data.dart
  27. 6
      lib/retrofit/min_api.dart
  28. 34
      lib/retrofit/retrofit_api.dart
  29. 103
      lib/retrofit/retrofit_api.g.dart
  30. 3
      lib/store/store_order.dart
  31. 2
      lib/store/store_view/store_header.dart
  32. 35
      lib/store/store_view/store_info.dart
  33. 1030
      lib/union/location_map_page.dart
  34. 177
      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( BMFMapOptions(
center: latLng, center: latLng,
zoomLevel: 15, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
); );
} }
@ -339,6 +342,9 @@ class _AddressMapPage extends State<AddressMapPage> {
double.tryParse(value.getString("longitude")), double.tryParse(value.getString("longitude")),
), ),
zoomLevel: 15, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
); );
} }
@ -362,7 +368,10 @@ class _AddressMapPage extends State<AddressMapPage> {
child: BMFMapWidget( child: BMFMapWidget(
mapOptions: BMFMapOptions( mapOptions: BMFMapOptions(
center: BMFCoordinate(30.553111, 114.342366), center: BMFCoordinate(30.553111, 114.342366),
zoomLevel: 12, zoomLevel: 15,
showZoomControl: false,
showMapScaleBar: false,
rotateEnabled: false,
), ),
onBMFMapCreated: onMapCreated, onBMFMapCreated: onMapCreated,
// onCameraMoveEnd: (cameraPosition) { // onCameraMoveEnd: (cameraPosition) {

1
lib/home/home_page.dart

@ -484,6 +484,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}), }),
///广 ///广
if(activityBannerData.length > 0)
spread(), 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/store/store_view/product_meals_sku.dart';
import 'package:huixiang/test_page.dart'; import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_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/union/union_select_city.dart';
import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/vip/user_vip_service_page.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() { Widget spreadImage() {
return Container( return Container(
width: double.infinity, width: double.infinity,
// margin: EdgeInsets.symmetric(horizontal:14.w), margin: EdgeInsets.only(bottom:24.h),
height: 85.h, height: 85.h,
child: activityBannerData != null && activityBannerData.isNotEmpty child: activityBannerData != null && activityBannerData.isNotEmpty
? Swiper( ? Swiper(

16
lib/mine/mine_view/mine_navbar.dart

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

99
lib/mine/mine_view/mine_view.dart

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

106
lib/retrofit/data/ip_data.dart

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

6
lib/retrofit/min_api.dart

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

34
lib/retrofit/retrofit_api.dart

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:gbk2utf8/gbk2utf8.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.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:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/achievement_detail_list.dart'; import 'data/achievement_detail_list.dart';
import 'data/activity_pos.dart'; import 'data/activity_pos.dart';
import 'data/address.dart'; import 'data/address.dart';
@ -63,11 +65,15 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const localBaseUrl = "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 localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "http://platform-api.test.yixinhuixiang.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) @RestApi(baseUrl: localBaseUrl)
abstract class ApiService { abstract class ApiService {
@ -85,8 +91,7 @@ abstract class ApiService {
if (pay) { if (pay) {
headers["Environment"] = "app"; headers["Environment"] = "app";
} }
if (kReleaseMode) if (kReleaseMode) baseUrl = serviceBaseUrl;
baseUrl = serviceBaseUrl;
if (isIp) baseUrl = ipBaseUrl; if (isIp) baseUrl = ipBaseUrl;
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 60000, connectTimeout: 60000,
@ -96,21 +101,26 @@ abstract class ApiService {
); );
dio.interceptors.add( dio.interceptors.add(
InterceptorsWrapper(onRequest: (RequestOptions options) { InterceptorsWrapper(onRequest: (RequestOptions options) {
try {
debugPrint("\n======================= 请求数据 ======================="); debugPrint("\n======================= 请求数据 =======================");
debugPrint("method = ${options.method.toString()}"); debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}"); debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}"); debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) { if (showLoading && !EasyLoading.isShow) {
//loading //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) { if (options.data is FormData) {
debugPrint("params data = FormData"); debugPrint("params data = FormData");
} else { } else {
debugPrint("params data = ${jsonEncode(options.data)}"); debugPrint("params data = ${jsonEncode(options.data)}");
} }
debugPrint("params queryParameters = ${options.queryParameters}"); debugPrint("params queryParameters = ${options.queryParameters}");
} catch (e1) {}
}, onResponse: (Response response) { }, onResponse: (Response response) {
try {
debugPrint("\n======================= 响应数据开始 ======================="); debugPrint("\n======================= 响应数据开始 =======================");
if (showLoading && EasyLoading.isShow) { if (showLoading && EasyLoading.isShow) {
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -118,7 +128,7 @@ abstract class ApiService {
debugPrint("code = ${response.statusCode}"); debugPrint("code = ${response.statusCode}");
if (response.request.path != "/creditGoods/list") if (response.request.path != "/creditGoods/list")
p(jsonEncode(response.data)); p(jsonEncode(response.data));
// debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10); // debugPrint(jsonEncode(response.data), wrapWidth: response.data.toString().length * 10);
@ -136,6 +146,7 @@ abstract class ApiService {
// SmartDialog.showToast(map["msg"], alignment: Alignment.center); // SmartDialog.showToast(map["msg"], alignment: Alignment.center);
} }
debugPrint("======================= 响应数据结束 =======================\n"); debugPrint("======================= 响应数据结束 =======================\n");
} catch (e2) {}
}, onError: (DioError e) { }, onError: (DioError e) {
if (EasyLoading.isShow) { if (EasyLoading.isShow) {
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -225,7 +236,8 @@ abstract class ApiService {
/// ///
@GET("/wallet/rechargeActList?tenantCode={tenantCode}") @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}") @GET("/coupon/receive?couponId={couponId}")
@ -584,6 +596,6 @@ abstract class ApiService {
@Path("creditGoodsId") String creditGoodsId); @Path("creditGoodsId") String creditGoodsId);
///APP门店推广渠道 ///APP门店推广渠道
@GET("/ip/") @GET("/ipJson.jsp")
Future<IpData> getIpInfo(); Future<IpData> getIpInfo();
} }

103
lib/retrofit/retrofit_api.g.dart

@ -17,21 +17,18 @@ class _ApiService implements ApiService {
String baseUrl; String baseUrl;
@override @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(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId'); ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = FormData(); final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last; 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"; fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4")) else if (isVideo && !fileName.contains(".mp4")) fileName += ".mp4";
fileName += ".mp4";
_data.files.add(MapEntry( _data.files.add(MapEntry(
'file', 'file', MultipartFile.fromFileSync(data.path, filename: fileName)));
MultipartFile.fromFileSync(data.path,
filename: fileName)));
print("filename:$fileName"); print("filename:$fileName");
if (folderId != null) { if (folderId != null) {
_data.fields.add(MapEntry('folderId', folderId.toString())); _data.fields.add(MapEntry('folderId', folderId.toString()));
@ -93,7 +90,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData.fromJson( final value = BaseData.fromJson(
_result.data, _result.data,
(json) => json==null?null:json, (json) => json == null ? null : json,
); );
return value; return value;
} }
@ -114,13 +111,13 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<ChannelsList>.fromJson( final value = BaseData<ChannelsList>.fromJson(
_result.data, _result.data,
(json) => ChannelsList.fromJson(json), (json) => ChannelsList.fromJson(json),
); );
return value; return value;
} }
@override @override
Future<BaseData<dynamic>> sendVerify(areaCode,mobile) async { Future<BaseData<dynamic>> sendVerify(areaCode, mobile) async {
ArgumentError.checkNotNull(mobile, 'mobile'); ArgumentError.checkNotNull(mobile, 'mobile');
ArgumentError.checkNotNull(areaCode, 'areaCode'); ArgumentError.checkNotNull(areaCode, 'areaCode');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
@ -337,7 +334,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<RechargeActLists>.fromJson( final value = BaseData<RechargeActLists>.fromJson(
_result.data, _result.data,
(json) => RechargeActLists.fromJson(json), (json) => RechargeActLists.fromJson(json),
); );
return value; return value;
} }
@ -359,7 +356,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json == null ? null :json as dynamic, (json) => json == null ? null : json as dynamic,
); );
return value; return value;
} }
@ -592,9 +589,11 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<Store>>.fromJson( final value = BaseData<List<Store>>.fromJson(
_result.data, _result.data,
(json) => ((json??"") == "")?null:(json as List<dynamic>) (json) => ((json ?? "") == "")
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>)) ? null
.toList()); : (json as List<dynamic>)
.map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
.toList());
return value; return value;
} }
@ -885,10 +884,12 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<PageInfo<OrderInfo>>.fromJson( final value = BaseData<PageInfo<OrderInfo>>.fromJson(
_result.data, _result.data,
(json) => ((json??"") == "")?null:PageInfo<OrderInfo>.fromJson( (json) => ((json ?? "") == "")
json, ? null
(json) => OrderInfo.fromJson(json), : PageInfo<OrderInfo>.fromJson(
), json,
(json) => OrderInfo.fromJson(json),
),
); );
return value; return value;
} }
@ -1272,7 +1273,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<String>.fromJson( final value = BaseData<String>.fromJson(
_result.data, _result.data,
(json) => json==null?null:(json as String), (json) => json == null ? null : (json as String),
); );
return value; return value;
} }
@ -1295,7 +1296,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<bool>.fromJson( final value = BaseData<bool>.fromJson(
_result.data, _result.data,
(json) => (json??"")=="" ? null :(json as bool), (json) => (json ?? "") == "" ? null : (json as bool),
); );
return value; return value;
} }
@ -1881,7 +1882,8 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <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, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2018,7 +2020,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<HomeRank>.fromJson( final value = BaseData<HomeRank>.fromJson(
_result.data, _result.data,
(json) => HomeRank.fromJson(json), (json) => HomeRank.fromJson(json),
); );
return value; return value;
} }
@ -2039,7 +2041,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2051,7 +2053,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <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, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2061,7 +2064,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2073,7 +2076,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <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, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2083,7 +2087,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2093,8 +2097,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/vipCard/index',
'/vipCard/index',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2104,7 +2107,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<VipCardHome>.fromJson( final value = BaseData<VipCardHome>.fromJson(
_result.data, _result.data,
(json) => VipCardHome.fromJson(json), (json) => VipCardHome.fromJson(json),
); );
return value; return value;
} }
@ -2114,18 +2117,14 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<List<int>>('/ipJson.jsp',
'/ip/',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(method: 'GET', extra: _extra, baseUrl: baseUrl,responseType: ResponseType.bytes),
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data); data: _data);
final value = IpData.fromJson( var ts = gbk.decode(_result.data);
_result.data, final value = IpData.fromJson(jsonDecode(ts
); .substring(ts.indexOf("{\"ip\":\""))
.replaceAll(");}", "")));
return value; return value;
} }
@ -2136,7 +2135,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <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, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2146,7 +2146,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2156,8 +2156,7 @@ class _ApiService implements ApiService {
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>( final _result = await _dio.request<Map<String, dynamic>>('/raise/products',
'/raise/products',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',
@ -2167,7 +2166,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<FarmersList>>.fromJson( final value = BaseData<List<FarmersList>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => (json as List<dynamic>)
.map<FarmersList>( .map<FarmersList>(
(i) => FarmersList.fromJson(i as Map<String, dynamic>)) (i) => FarmersList.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
@ -2181,7 +2180,8 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <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, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',
@ -2191,7 +2191,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2213,7 +2213,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<dynamic>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => json as dynamic,
); );
return value; return value;
} }
@ -2235,9 +2235,8 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<List<Store>>.fromJson( final value = BaseData<List<Store>>.fromJson(
_result.data, _result.data,
(json) => (json as List<dynamic>) (json) => (json as List<dynamic>)
.map<Store>( .map<Store>((i) => Store.fromJson(i as Map<String, dynamic>))
(i) => Store.fromJson(i as Map<String, dynamic>))
.toList()); .toList());
return value; return value;
} }

3
lib/store/store_order.dart

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

2
lib/store/store_view/store_header.dart

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

35
lib/store/store_view/store_info.dart

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

1030
lib/union/location_map_page.dart

File diff suppressed because it is too large Load Diff

177
lib/union/union_page.dart

@ -55,13 +55,8 @@ class UnionPageState extends State<UnionPage>
super.dispose(); super.dispose();
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
if (Location.getInstance() != null && if (Location.getInstance() != null &&
Location Location.getInstance().aMapFlutterLocation != null)
.getInstance() Location.getInstance().aMapFlutterLocation.stopLocation();
.aMapFlutterLocation != null)
Location
.getInstance()
.aMapFlutterLocation
.stopLocation();
} }
@override @override
@ -69,14 +64,8 @@ class UnionPageState extends State<UnionPage>
super.didChangeMetrics(); super.didChangeMetrics();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() { setState(() {
print("object: ${MediaQuery print("object: ${MediaQuery.of(context).viewInsets.bottom}");
.of(context) if (MediaQuery.of(context).viewInsets.bottom == 0) {
.viewInsets
.bottom}");
if (MediaQuery
.of(context)
.viewInsets
.bottom == 0) {
if (isKeyBoardShow) { if (isKeyBoardShow) {
isKeyBoardShow = false; isKeyBoardShow = false;
// //
@ -101,39 +90,46 @@ class UnionPageState extends State<UnionPage>
} }
}); });
queryIpInfo(); queryIpInfo();
// loadFinish(showLoading: false);
} }
startLocation() async { startLocation() async {
bool powerFlag = false; bool powerFlag = false;
try { // bool finallyFlag = false;
powerFlag = await Location.getInstance().startLocation(context, try {
(BaiduLocation result) async { Future.delayed(Duration(seconds: 5), () {
if (result != null && // if (!finallyFlag)
result.latitude != null && Location.getInstance().stopLocation();
result.longitude != null) { });
print("location: $result"); powerFlag = await Location.getInstance().startLocation(context,
latLng = BMFCoordinate(result.latitude, result.longitude); (BaiduLocation result) async {
latLng = await BMFCalculateUtils.coordConvert( if (result != null &&
coordinate: latLng, result.latitude != null &&
fromType: BMF_COORD_TYPE.BD09LL, result.longitude != null) {
toType: BMF_COORD_TYPE.COMMON); print("location: $result");
await saveLatLng( latLng = BMFCoordinate(result.latitude, result.longitude);
latLng, result.province, result.city, result.district); latLng = await BMFCalculateUtils.coordConvert(
print("union: Location result ${latLng.latitude} " coordinate: latLng,
"${latLng.longitude}"); fromType: BMF_COORD_TYPE.BD09LL,
Location.getInstance().stopLocation(); toType: BMF_COORD_TYPE.COMMON);
} else { await saveLatLng(
await getLatLng(); latLng, result.province, result.city, result.district);
} print("union: Location result ${latLng.latitude} "
loadFinish(showLoading: false); "${latLng.longitude}");
}); Location.getInstance().stopLocation();
} finally { } else {
if (!powerFlag) { await getLatLng();
if (await Permission.locationWhenInUse.status.isGranted) { }
startLocation();
} else
loadFinish(showLoading: false); loadFinish(showLoading: false);
} });
} finally {
// finallyFlag = true;
if (!powerFlag) {
if (await Permission.locationWhenInUse.status.isGranted) {
startLocation();
} else
loadFinish(showLoading: false);
}
} }
} }
@ -159,17 +155,24 @@ class UnionPageState extends State<UnionPage>
} }
queryIpInfo() async { queryIpInfo() async {
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black); EasyLoading.show(
ApiService apiIpService = ApiService(Dio(), context: context, isIp: true); status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
IpData baseData = await apiIpService.getIpInfo().catchError((onError) {}); try {
if (baseData?.dz != null) { ApiService apiIpService = ApiService(Dio(), context: context, isIp: true);
areaName = baseData.dz.substring(baseData.dz.lastIndexOf(" ") +1).replaceAll("", ""); IpData baseData = await apiIpService.getIpInfo().catchError((onError) {});
if (baseData?.city != null) {
areaName = baseData.city.replaceAll("", "");
}
} finally {
startLocation();
} }
startLocation();
} }
loadFinish({bool showLoading = true}) { 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()]; _allKey = [GlobalKey(), GlobalKey(), GlobalKey(), GlobalKey()];
setState(() {}); setState(() {});
} }
@ -245,51 +248,40 @@ class UnionPageState extends State<UnionPage>
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
// //
tabs: <Widget>[ tabs: <Widget>[
MyTab(text: S MyTab(text: S.of(context).quanbu),
.of(context) MyTab(text: S.of(context).chi),
.quanbu), MyTab(text: S.of(context).he),
MyTab(text: S MyTab(text: S.of(context).wan),
.of(context)
.chi),
MyTab(text: S
.of(context)
.he),
MyTab(text: S
.of(context)
.wan),
], ],
), ),
), ),
_allKey.isEmpty _allKey.isEmpty
? NoDataView( ? NoDataView(
src: "assets/image/di_zhi.webp", src: "assets/image/di_zhi.webp",
isShowBtn: false, isShowBtn: false,
text: "暂无店铺列表~", text: "暂无店铺列表~",
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h), margin: EdgeInsets.only(top: 120.h),
) )
: Expanded( : Expanded(
child: TabBarView( child: TabBarView(
controller: tabController, controller: tabController,
children: [ children: [
UnionList(_allKey[0], "", latLng, UnionList(_allKey[0], "", latLng,
editingController.text, areaName), editingController.text, areaName),
UnionList(_allKey[1], "EATSTORE", latLng, UnionList(_allKey[1], "EATSTORE", latLng,
editingController.text, areaName), editingController.text, areaName),
UnionList(_allKey[2], "DRINKSTORE", latLng, UnionList(_allKey[2], "DRINKSTORE", latLng,
editingController.text, areaName), editingController.text, areaName),
UnionList(_allKey[3], "HAPPYSTORE", latLng, UnionList(_allKey[3], "HAPPYSTORE", latLng,
editingController.text, areaName), editingController.text, areaName),
], ],
), ),
) )
], ],
), ),
padding: padding:
EdgeInsets.only(top: MediaQuery EdgeInsets.only(top: MediaQuery.of(context).padding.top + 17.h),
.of(context)
.padding
.top + 17.h),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
@ -344,11 +336,14 @@ class UnionPageState extends State<UnionPage>
color: Color(0xFFB3B3B3), color: Color(0xFFB3B3B3),
), ),
isCollapsed: true, isCollapsed: true,
prefixIcon:Padding(padding: EdgeInsets.only(left: 5.w,right: 5.w),child: Image.asset( prefixIcon: Padding(
"assets/image/icon_search.webp", padding: EdgeInsets.only(left: 5.w, right: 5.w),
width: 16.h, child: Image.asset(
height: 16.h, "assets/image/icon_search.webp",
),), width: 16.h,
height: 16.h,
),
),
prefixIconConstraints: BoxConstraints(), prefixIconConstraints: BoxConstraints(),
border: InputBorder.none, border: InputBorder.none,
), ),

4
lib/union/union_select_city.dart

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

5
lib/utils/flutter_utils.dart

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -10,11 +11,11 @@ import 'package:path_provider/path_provider.dart';
class AppUtils { class AppUtils {
///线 ///线
static Future<String> calculateDistance( static Future<String> calculateDistance(
BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng) async { BMFCoordinate bmfCoordinate, BMFCoordinate myLatLng, {bool isMi = false}) async {
double mi = double mi =
await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng); await BMFCalculateUtils.getLocationDistance(bmfCoordinate, myLatLng);
NumberFormat numberFormat = NumberFormat("#.#"); 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, width: double.infinity,
height: 500.h, height: 500.h,
padding: EdgeInsets.only(top: 210.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( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
fit: BoxFit.fill, fit: BoxFit.fill,
@ -58,7 +58,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
borderRadius: BorderRadius.circular(22.5), borderRadius: BorderRadius.circular(22.5),
), ),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 40, height: 40.h,
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
S.of(context).lijilingqu, S.of(context).lijilingqu,
@ -73,7 +73,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
], ],
), ),
), ),
SizedBox(height: 35), SizedBox(height: 35.h),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
@ -82,8 +82,8 @@ class _NewPeopleReward extends State<NewPeopleReward> {
}, },
child: Image.asset( child: Image.asset(
"assets/image/yq_qx.webp", "assets/image/yq_qx.webp",
width: 34, width: 34.h,
height: 34, height: 34.h,
), ),
) )
], ],
@ -117,7 +117,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
image: AssetImage("assets/image/xin_rq.webp"), 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), padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -150,13 +150,13 @@ class _NewPeopleReward extends State<NewPeopleReward> {
), ),
), ),
Expanded(child:Padding( 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
firstLoginCouponList.storeName, firstLoginCouponList.couponName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
@ -166,7 +166,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
), ),
), ),
Text( Text(
firstLoginCouponList.couponName, firstLoginCouponList.storeName,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
style: TextStyle( 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 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: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -13,9 +13,9 @@ dependencies:
sdk: flutter sdk: flutter
flutter_localizations: flutter_localizations:
sdk: flutter 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 gradient_widgets: ^0.6.0
@ -38,11 +38,11 @@ dependencies:
permission_handler: ^5.0.1+1 permission_handler: ^5.0.1+1
flutter_bmflocation: ^3.2.1 flutter_bmflocation: 3.2.1
flutter_baidu_mapapi_base: ^3.2.0 flutter_baidu_mapapi_base: 3.2.0
flutter_baidu_mapapi_map: ^3.2.1 flutter_baidu_mapapi_map: 3.2.1
flutter_baidu_mapapi_search: ^3.2.0 flutter_baidu_mapapi_search: 3.2.0
flutter_baidu_mapapi_utils: ^3.2.0 flutter_baidu_mapapi_utils: 3.2.0
dio: ^3.0.10 dio: ^3.0.10
rxdart: ^0.26.0 rxdart: ^0.26.0
@ -52,9 +52,11 @@ dependencies:
pin_input_text_field: ^4.1.2 pin_input_text_field: ^4.1.2
android_intent_plus: ^1.0.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 bubble_tab_indicator: ^0.1.6
gbk2utf8: ^1.0.1
event_bus: ^2.0.0 event_bus: ^2.0.0
intl: ^0.17.0 intl: ^0.17.0
shared_preferences: ^2.0.6 shared_preferences: ^2.0.6

Loading…
Cancel
Save