Browse Source

Merge remote-tracking branch 'origin/wu_2023_map' into wu_2023_map

# Conflicts:
#	lib/union/location_map_page.dart
dev
fmk 1 year ago
parent
commit
f9e7b247a0
  1. 4
      lib/store/store_view/store_info.dart
  2. 75
      lib/union/location_map_page.dart
  3. 6
      lib/union/union_list.dart
  4. 1
      lib/union/union_page.dart

4
lib/store/store_view/store_info.dart

@ -298,8 +298,8 @@ class _StoreInfoView extends State<StoreInfoView> {
text: "$e", text: "$e",
backgroup: Color(0xFFFF7A1A), backgroup: Color(0xFFFF7A1A),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 2.w, left: 4.w,
right: 2.w, right: 4.w,
), ),
fontSize: 10.sp, fontSize: 10.sp,
textColor: Colors.white, textColor: Colors.white,

75
lib/union/location_map_page.dart

@ -163,31 +163,33 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
Expanded( Expanded(
child: Container( child: Container(
//BMFMapWidget ,BMFTextureMapWidget不会强制遮盖其他控件 //BMFMapWidget ,BMFTextureMapWidget不会强制遮盖其他控件
child: (Platform.isAndroid) ? BMFTextureMapWidget( child: (Platform.isAndroid)
mapOptions: BMFMapOptions( ? BMFTextureMapWidget(
center: BMFCoordinate( mapOptions: BMFMapOptions(
double.tryParse(widget.arguments["lat"]), center: BMFCoordinate(
double.tryParse(widget.arguments["lng"]), double.tryParse(widget.arguments["lat"]),
), double.tryParse(widget.arguments["lng"]),
showZoomControl: false, ),
showMapScaleBar: false, showZoomControl: false,
rotateEnabled: false, showMapScaleBar: false,
zoomLevel: 15, rotateEnabled: false,
), zoomLevel: 15,
onBMFMapCreated: onMapCreated, ),
) : BMFMapWidget( onBMFMapCreated: onMapCreated,
mapOptions: BMFMapOptions( )
center: BMFCoordinate( : BMFMapWidget(
double.tryParse(widget.arguments["lat"]), mapOptions: BMFMapOptions(
double.tryParse(widget.arguments["lng"]), center: BMFCoordinate(
), double.tryParse(widget.arguments["lat"]),
showZoomControl: false, double.tryParse(widget.arguments["lng"]),
showMapScaleBar: false, ),
rotateEnabled: false, showZoomControl: false,
zoomLevel: 15, showMapScaleBar: false,
), rotateEnabled: false,
onBMFMapCreated: onMapCreated, zoomLevel: 15,
)), ),
onBMFMapCreated: onMapCreated,
)),
flex: 3, flex: 3,
), ),
navigationState == 0 navigationState == 0
@ -305,8 +307,9 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
onTap: () { onTap: () {
if (myCity == null) { if (myCity == null) {
// onOpenBaiduMap(); // onOpenBaiduMap();
SmartDialog.showToast("您定位服务未开启,请前往系统设置中开启定位服务", SmartDialog.showToast(
alignment: Alignment.center); "您定位服务未开启,请前往系统设置中开启定位服务",
alignment: Alignment.center);
} else { } else {
navigationState = 1; navigationState = 1;
if ((distance ?? 0) < 500) if ((distance ?? 0) < 500)
@ -407,7 +410,8 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
} }
void onOpenBaiduMap() async { void onOpenBaiduMap() async {
launch("baidumap://map/marker?location=${storeInfo.latitude},${storeInfo.longitude}&title=${storeInfo.storeName}&content=${storeInfo.storeName}&traffic=on&src=andr.baidu.openAPIdemo&coord_type=gcj02"); launch(
"baidumap://map/marker?location=${storeInfo.latitude},${storeInfo.longitude}&title=${storeInfo.storeName}&content=${storeInfo.storeName}&traffic=on&src=andr.baidu.openAPIdemo&coord_type=gcj02");
} }
//調APP //調APP
@ -451,7 +455,7 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
} }
updateMapLine(List<BMFCoordinate> coordinates, int needHours, int needMinutes, updateMapLine(List<BMFCoordinate> coordinates, int needHours, int needMinutes,
double needDistance) { double needDistance) async {
try { try {
// //
_mapController.cleanAllMarkers(); _mapController.cleanAllMarkers();
@ -498,12 +502,23 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
draggable: false, draggable: false,
); );
_mapController.addMarker(terminalBmfMarker); _mapController.addMarker(terminalBmfMarker);
_mapController.setVisibleMapRectWithPadding( SmartDialog.showToast(
"${startLocation.longitude} ${startLocation.latitude} ${endLocation.longitude} ${endLocation.latitude}",
alignment: Alignment.center);
bool tryFlag = await _mapController.setVisibleMapRectWithPadding(
visibleMapBounds: BMFCoordinateBounds( visibleMapBounds: BMFCoordinateBounds(
northeast: startLocation, southwest: endLocation), northeast: startLocation, southwest: endLocation),
animated: true, animated: true,
insets: insets:
EdgeInsets.only(top: 500, bottom: 200, left: 200, right: 200)); EdgeInsets.only(top: 500, bottom: 200, left: 200, right: 200));
if (!tryFlag) {
tryFlag = await _mapController.setVisibleMapBounds(
BMFCoordinateBounds(northeast: startLocation, southwest: endLocation),
true,
);
if (!tryFlag)
SmartDialog.showToast("还是不行", alignment: Alignment.center);
}
hours = needHours == 0 ? "" : "$needHours小时"; hours = needHours == 0 ? "" : "$needHours小时";
minutes = needMinutes == 0 ? "" : "$needMinutes分钟"; minutes = needMinutes == 0 ? "" : "$needMinutes分钟";

6
lib/union/union_list.dart

@ -208,7 +208,6 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
) )
]), ]),
width: double.infinity, width: double.infinity,
// height: 235.h,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -343,9 +342,9 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF65720), color: Color(0xFFF65720),
borderRadius: BorderRadius.circular(1), borderRadius: BorderRadius.circular(2),
), ),
padding: EdgeInsets.all(2), padding: EdgeInsets.symmetric(vertical:2.h,horizontal:3.w),
margin: EdgeInsets.only(right: 10.w), margin: EdgeInsets.only(right: 10.w),
child: Text( child: Text(
"$e", "$e",
@ -365,6 +364,7 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
width: 74.h, width: 74.h,
margin: EdgeInsets.only(right: 8.w), margin: EdgeInsets.only(right: 8.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(

1
lib/union/union_page.dart

@ -109,7 +109,6 @@ class UnionPageState extends State<UnionPage>
} }
}); });
queryIpInfo(); queryIpInfo();
// loadFinish(showLoading: false);
} }
startLocation() async { startLocation() async {

Loading…
Cancel
Save