Browse Source

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

dev
fmk 1 year ago
parent
commit
60a49a301f
  1. 10
      lib/mine/mine_shop_recharge.dart
  2. 1
      lib/mine/mine_view/mine_item.dart
  3. 18
      lib/retrofit/data/member_recharge_list.dart
  4. 67
      lib/union/location_map_page.dart
  5. 5
      lib/union/union_list.dart
  6. 6
      lib/utils/flutter_utils.dart

10
lib/mine/mine_shop_recharge.dart

@ -92,10 +92,10 @@ class _MineShopRecharge extends State<MineShopRecharge> {
vipCard = baseData.data;
}
} finally {
if(isSingle)
setState((){});
if (isSingle)
setState(() {});
else
addLoadCount();
addLoadCount();
}
}
@ -617,7 +617,9 @@ class _MineShopRecharge extends State<MineShopRecharge> {
),
TextSpan(
text:
"${AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100))))}",
"${((memberRechargeList?.limitNum ?? 0) != 0 && ((memberRechargeList?.limitNum ?? 0) - (memberRechargeList?.useNum ?? 0) <= 0)) ?
(AppUtils.calculateDouble(double.tryParse(memberRechargeList.rechargeMoney) ?? 0)) :
(AppUtils.calculateDouble((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) + (double.tryParse(memberRechargeList.giftdMoney) ?? 0) + ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) - ((double.tryParse(memberRechargeList.rechargeMoney) ?? 0) * (discount / 100)))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',

1
lib/mine/mine_view/mine_item.dart

@ -1,6 +1,5 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';

18
lib/retrofit/data/member_recharge_list.dart

@ -20,7 +20,7 @@ class MemberRechargeList {
String id,
String rechargeMoney,
String giftdMoney,
num limitNum,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
@ -31,8 +31,8 @@ class MemberRechargeList {
num isDeleted,
num rechargeType,
String remark,
num sortValue,
num useNum,}){
num sortValue,
dynamic useNum,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
@ -72,7 +72,7 @@ class MemberRechargeList {
String _id;
String _rechargeMoney;
String _giftdMoney;
num _limitNum;
dynamic _limitNum;
dynamic _gitfdCouponId;
dynamic _startDate;
dynamic _endDate;
@ -84,11 +84,11 @@ class MemberRechargeList {
num _rechargeType;
String _remark;
num _sortValue;
num _useNum;
dynamic _useNum;
MemberRechargeList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
num limitNum,
dynamic limitNum,
dynamic gitfdCouponId,
dynamic startDate,
dynamic endDate,
@ -100,7 +100,7 @@ MemberRechargeList copyWith({ String id,
num rechargeType,
String remark,
num sortValue,
num useNum,
dynamic useNum,
}) => MemberRechargeList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
@ -121,7 +121,7 @@ MemberRechargeList copyWith({ String id,
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
num get limitNum => _limitNum;
dynamic get limitNum => _limitNum;
dynamic get gitfdCouponId => _gitfdCouponId;
dynamic get startDate => _startDate;
dynamic get endDate => _endDate;
@ -133,7 +133,7 @@ MemberRechargeList copyWith({ String id,
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
num get useNum => _useNum;
dynamic get useNum => _useNum;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};

67
lib/union/location_map_page.dart

@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
@ -12,7 +13,6 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:url_launcher/url_launcher.dart';
@ -72,10 +72,10 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
myAddress = result.locationDetail;
myCity = result.city;
if (distance == null) calculate();
AppUtils.coordConvert(myLatLng).then((value) {
this.myLatLng = value;
// AppUtils.coordConvert(myLatLng).then((value) {
// this.myLatLng = value;
locationShow();
});
// });
Location.getInstance().stopLocation();
}
});
@ -421,19 +421,19 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
BMFCoordinate startCoord = BMFCoordinate(
positionSorta == false
? myLatLng.latitude
: double.tryParse(widget.arguments["lat"]),
: latLng.latitude,
positionSorta == false
? myLatLng.longitude
: double.tryParse(widget.arguments["lng"]));
: latLng.longitude);
String startName = ((positionSorta == false) ? "我的位置" : "终点");
//
String endName = ((positionSorta == false) ? "终点" : "我的位置");
BMFCoordinate endCoord = BMFCoordinate(
positionSorta == false
? double.tryParse(widget.arguments["lat"])
? latLng.latitude
: myLatLng.latitude,
positionSorta == false
? double.tryParse(widget.arguments["lng"])
? latLng.longitude
: myLatLng.longitude);
BMFOpenRouteOption routeOption = BMFOpenRouteOption(
startCoord: startCoord,
@ -472,7 +472,7 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
? 'assets/image/traffic_texture_unknown.png'
: 'assets/image/traffic_texture_smooth.png'
],
width: Platform.isAndroid ? 16 :10,
width: Platform.isAndroid ? 16 : 10,
lineDashType: BMFLineDashType.LineDashTypeNone,
lineCapType: BMFLineCapType.LineCapButt,
lineJoinType: BMFLineJoinType.LineJoinRound);
@ -545,8 +545,8 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
? BMFCoordinate(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0)
: latLng);
BMFPlanNode to = BMFPlanNode(
cityName: positionSorta == false ? (storeInfo?.city ?? "") : myCity,
name: positionSorta == false ? (storeInfo?.address ?? "") : myAddress,
// cityName: positionSorta == false ? (storeInfo?.city ?? "") : myCity,
// name: positionSorta == false ? (storeInfo?.address ?? "") : myAddress,
pt: positionSorta == false
? latLng
: BMFCoordinate(myLatLng?.latitude ?? 0, myLatLng?.longitude ?? 0));
@ -1073,7 +1073,7 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
onTap: () {
setState(() {
navigationState = 1;
onOpenBaiduMapRoute();
showMapSelect();
});
},
child: Container(
@ -1106,6 +1106,41 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
);
}
showMapSelect() {
showCupertinoModalPopup(
context: context,
builder: (context) {
return CupertinoActionSheet(
actions: [
CupertinoActionSheetAction(
child: Text(
"百度地图",
style: TextStyle(
fontWeight: MyFontWeight.regular,
),
),
onPressed: () {
onOpenBaiduMapRoute();
Navigator.of(context).pop();
},
isDefaultAction: true,
isDestructiveAction: false,
),
],
cancelButton: CupertinoActionSheetAction(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(S.of(context).quxiao,
style: TextStyle(
color: Colors.blue,
),),
isDestructiveAction: true,
),
);
});
}
List<Widget> itemServer(String businessService) {
if (businessService == null || businessService == "") return [];
var list = businessService.split(",");
@ -1153,10 +1188,10 @@ class _LocationMap extends State<LocationMap> with WidgetsBindingObserver {
}
addMarker() async {
// latLng = await AppUtils.coordConvert(BMFCoordinate(double.tryParse(widget.arguments["lat"]),
// double.tryParse(widget.arguments["lng"])));
latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]),
double.tryParse(widget.arguments["lng"]));
latLng = await AppUtils.coordConvert(BMFCoordinate(double.tryParse(widget.arguments["lat"]),
double.tryParse(widget.arguments["lng"])));
// latLng = BMFCoordinate(double.tryParse(widget.arguments["lat"]),
// double.tryParse(widget.arguments["lng"]));
if (bmfMarker == null && _mapController != null) {
bmfMarker = BMFMarker.icon(

5
lib/union/union_list.dart

@ -102,9 +102,10 @@ class _UnionList extends State<UnionList> with AutomaticKeepAliveClientMixin {
? NoDataView(
src: "assets/image/di_zhi.webp",
isShowBtn: false,
text: "暂无店铺列表~",
text: ((widget.city??"") != "武汉" && (widget.city??"") != "郑州" && (widget.city??"") != "北京") ?
" 当前回乡开放门店 仅包含 武汉/北京/郑州,您当前的位置无法获取,请手动更换城市" :"暂无店铺列表~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
margin: EdgeInsets.only(top: 120.h,left:45.w,right:45.w),
)
: ListView.builder(
itemCount: storeList.length,

6
lib/utils/flutter_utils.dart

@ -78,12 +78,12 @@ class AppUtils {
return resString;
}
///
///()
static Future<BMFCoordinate> coordConvert(BMFCoordinate latLng) async {
return BMFCalculateUtils.coordConvert(
coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL,
toType: BMF_COORD_TYPE.COMMON);
fromType: BMF_COORD_TYPE.COMMON,
toType: BMF_COORD_TYPE.BD09LL);
}
static bool isPhone(mobile) {

Loading…
Cancel
Save