Browse Source

Merge branch 'new_revision_app' into wr_202303

# Conflicts:
#	lib/home/home_page.dart
#	lib/settlement/settlement_view/settlement_order_commodity.dart
#	lib/view_widget/activity_poster.dart
dart3_last
wurong 2 years ago
parent
commit
5f8b96f7f8
  1. 1
      lib/home/home_page.dart
  2. 1
      lib/main_page.dart
  3. 3
      lib/message/system_details.dart
  4. 43
      lib/mine/mine_page.dart
  5. 6
      lib/order/order_detail_page.dart
  6. 5
      lib/order/order_history_page.dart
  7. 9
      lib/retrofit/data/order_product_vo.dart
  8. 132
      lib/retrofit/data/shoppingCart.dart
  9. 9
      lib/settlement/settlement.dart
  10. 2
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  11. 130
      lib/settlement/settlement_view/settlement_order_commodity.dart
  12. 3
      lib/union/location_map_page.dart
  13. 1
      lib/union/union_list.dart
  14. 62
      lib/utils/location.dart
  15. 122
      lib/view_widget/activity_poster.dart
  16. 5
      lib/view_widget/new_coupon_widget.dart
  17. 2
      pubspec.yaml

1
lib/home/home_page.dart

@ -84,6 +84,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
// //
// if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) // if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0)
// showNew = true; // showNew = true;
} }
/// ///

1
lib/main_page.dart

@ -162,6 +162,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
queryUserInfo(); queryUserInfo();
///App自动更新
appAutoUpdate(); appAutoUpdate();
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();

3
lib/message/system_details.dart

@ -51,8 +51,7 @@ class _SystemDetails extends State<SystemDetails> {
msgType = widget.arguments["msgType"]; msgType = widget.arguments["msgType"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = apiService = ApiService(Dio(), token: value.getString("token"),showLoading: true, context: context);
ApiService(Dio(), token: value.getString("token"), context: context);
queryMessage(); queryMessage();
}); });
} }

43
lib/mine/mine_page.dart

@ -78,6 +78,7 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
super.initState(); super.initState();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
queryCoupon();
// queryCard(); // queryCard();
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
@ -118,22 +119,6 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
ranks.addAll(rankData.data); ranks.addAll(rankData.data);
} }
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
BaseData<UserInfo> baseDate = BaseData<UserInfo> baseDate =
await apiService.queryInfo().catchError((onError) { await apiService.queryInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
@ -152,8 +137,34 @@ class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin {
// EasyLoading.dismiss(); // EasyLoading.dismiss();
} }
queryCoupon()async{
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
BaseData<PageInfo<Coupon>> baseData = await apiService.queryCard({
"centre": true,
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
couponNum = baseData.data.total;
_refreshController.refreshCompleted();
} else {
_refreshController.refreshFailed();
}
}
_onRefresh() { _onRefresh() {
// queryUserInfo(); // queryUserInfo();
queryCoupon();
querySocialInfo(); querySocialInfo();
queryMsgStats(); queryMsgStats();
} }

6
lib/order/order_detail_page.dart

@ -119,6 +119,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
}else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }
@ -172,7 +174,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
), ),
/// ///
if(orderInfo != null) if(orderInfo != null && orderInfo.addressExt != null)
OrderAddress( OrderAddress(
orderStatus, orderStatus,
isTakeOut, isTakeOut,
@ -521,6 +523,8 @@ class _OrderDetailPage extends State<OrderDetailPage> {
// Future.delayed(Duration(milliseconds:450), () { // Future.delayed(Duration(milliseconds:450), () {
queryDetails(); queryDetails();
// }); // });
}else{
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }

5
lib/order/order_history_page.dart

@ -364,7 +364,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
], ],
), ),
Container( Container(
margin: EdgeInsets.only(left: 12.w), margin: EdgeInsets.only(left: 12.w,top:3.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -614,6 +614,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("订单取消成功"); SmartDialog.showToast("订单取消成功");
_onRefresh(); _onRefresh();
}else{
if(baseData.msg != null)
SmartDialog.showToast(baseData.msg,alignment: Alignment.center);
} }
} }

9
lib/retrofit/data/order_product_vo.dart

@ -1,3 +1,5 @@
import 'package:huixiang/retrofit/data/shoppingCart.dart';
class OrderProductVOList { class OrderProductVOList {
OrderProductVOList({ OrderProductVOList({
ActInfo actInfo, ActInfo actInfo,
@ -17,6 +19,7 @@ class OrderProductVOList {
String skuId, String skuId,
String skuImg, String skuImg,
String skuNameStr, String skuNameStr,
List<SetMealDataList> setMealDataList
}) { }) {
this.actInfo = actInfo; this.actInfo = actInfo;
this.additionalComment = additionalComment; this.additionalComment = additionalComment;
@ -35,6 +38,7 @@ class OrderProductVOList {
this.skuId = skuId; this.skuId = skuId;
this.skuImg = skuImg; this.skuImg = skuImg;
this.skuNameStr = skuNameStr; this.skuNameStr = skuNameStr;
this.setMealDataList = setMealDataList;
} }
OrderProductVOList.fromJson(dynamic json) { OrderProductVOList.fromJson(dynamic json) {
@ -59,6 +63,9 @@ class OrderProductVOList {
this.skuId = json['skuId']; this.skuId = json['skuId'];
this.skuImg = json['skuImg']; this.skuImg = json['skuImg'];
this.skuNameStr = json['skuNameStr']; this.skuNameStr = json['skuNameStr'];
this.setMealDataList = []..addAll(
(json['setMealDataList'] as List ?? [])
.map((o) => SetMealDataList.fromJson(o)));
} }
ActInfo actInfo; ActInfo actInfo;
@ -78,6 +85,7 @@ class OrderProductVOList {
String skuId; String skuId;
String skuImg; String skuImg;
String skuNameStr; String skuNameStr;
List<SetMealDataList> setMealDataList;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -105,6 +113,7 @@ class OrderProductVOList {
map['skuId'] = this.skuId; map['skuId'] = this.skuId;
map['skuImg'] = this.skuImg; map['skuImg'] = this.skuImg;
map['skuNameStr'] = this.skuNameStr; map['skuNameStr'] = this.skuNameStr;
map['setMealDataList']=this.setMealDataList;
return map; return map;
} }

132
lib/retrofit/data/shoppingCart.dart

@ -18,8 +18,8 @@ class ShoppingCart {
int selectDiscount; int selectDiscount;
String storeName; String storeName;
String tableId; String tableId;
List<PromotionInfoListBean> promotionInfoList; List<PromotionInfoListBeans> promotionInfoList;
List<CouponListBean> couponList; List<CouponListBeans> couponList;
static ShoppingCart fromJson(Map<String, dynamic> map) { static ShoppingCart fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -35,10 +35,10 @@ class ShoppingCart {
shoppingCartBean.selectDiscount = map['selectDiscount']; shoppingCartBean.selectDiscount = map['selectDiscount'];
shoppingCartBean.tableId = map['tableId']; shoppingCartBean.tableId = map['tableId'];
shoppingCartBean.promotionInfoList = List()..addAll( shoppingCartBean.promotionInfoList = List()..addAll(
(map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o)) (map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBeans.fromJson(o))
); );
shoppingCartBean.couponList = List()..addAll( shoppingCartBean.couponList = List()..addAll(
(map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o)) (map['couponList'] as List ?? []).map((o) => CouponListBeans.fromJson(o))
); );
return shoppingCartBean; return shoppingCartBean;
} }
@ -308,7 +308,7 @@ class ProductInfoList {
/// isMaxPromotion : true /// isMaxPromotion : true
/// promotionProuctList : null /// promotionProuctList : null
class PromotionInfoListBean { class PromotionInfoListBeans {
String id; String id;
String createTime; String createTime;
String createUser; String createUser;
@ -339,43 +339,43 @@ class PromotionInfoListBean {
bool isMaxPromotion; bool isMaxPromotion;
dynamic promotionProuctList; dynamic promotionProuctList;
static PromotionInfoListBean fromJson(Map<String, dynamic> map) { static PromotionInfoListBeans fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean(); PromotionInfoListBeans promotionInfoListBeans = PromotionInfoListBeans();
promotionInfoListBean.id = map['id']; promotionInfoListBeans.id = map['id'];
promotionInfoListBean.createTime = map['createTime']; promotionInfoListBeans.createTime = map['createTime'];
promotionInfoListBean.createUser = map['createUser']; promotionInfoListBeans.createUser = map['createUser'];
promotionInfoListBean.updateTime = map['updateTime']; promotionInfoListBeans.updateTime = map['updateTime'];
promotionInfoListBean.updateUser = map['updateUser']; promotionInfoListBeans.updateUser = map['updateUser'];
promotionInfoListBean.storeId = map['storeId']; promotionInfoListBeans.storeId = map['storeId'];
promotionInfoListBean.name = map['name']; promotionInfoListBeans.name = map['name'];
promotionInfoListBean.image = map['image']; promotionInfoListBeans.image = map['image'];
promotionInfoListBean.description = map['description']; promotionInfoListBeans.description = map['description'];
promotionInfoListBean.status = map['status']; promotionInfoListBeans.status = map['status'];
promotionInfoListBean.applyStartTime = map['applyStartTime']; promotionInfoListBeans.applyStartTime = map['applyStartTime'];
promotionInfoListBean.applyEndTime = map['applyEndTime']; promotionInfoListBeans.applyEndTime = map['applyEndTime'];
promotionInfoListBean.activityStartTime = map['activityStartTime']; promotionInfoListBeans.activityStartTime = map['activityStartTime'];
promotionInfoListBean.activityEndTime = map['activityEndTime']; promotionInfoListBeans.activityEndTime = map['activityEndTime'];
promotionInfoListBean.doStartTime = map['doStartTime']; promotionInfoListBeans.doStartTime = map['doStartTime'];
promotionInfoListBean.doEndTime = map['doEndTime']; promotionInfoListBeans.doEndTime = map['doEndTime'];
promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit']; promotionInfoListBeans.isNeedSecurityDeposit = map['isNeedSecurityDeposit'];
promotionInfoListBean.securityDeposit = map['securityDeposit']; promotionInfoListBeans.securityDeposit = map['securityDeposit'];
promotionInfoListBean.tag = map['tag']; promotionInfoListBeans.tag = map['tag'];
promotionInfoListBean.promotionType = map['promotionType']; promotionInfoListBeans.promotionType = map['promotionType'];
promotionInfoListBean.promotionPlan = map['promotionPlan']; promotionInfoListBeans.promotionPlan = map['promotionPlan'];
promotionInfoListBean.promotionDetail = List()..addAll( promotionInfoListBeans.promotionDetail = List()..addAll(
(map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o)) (map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o))
); );
promotionInfoListBean.channels = List()..addAll( promotionInfoListBeans.channels = List()..addAll(
(map['channels'] as List ?? []).map((o) => o.toString()) (map['channels'] as List ?? []).map((o) => o.toString())
); );
promotionInfoListBean.isVip = map['isVip']; promotionInfoListBeans.isVip = map['isVip'];
promotionInfoListBean.isDelete = map['isDelete']; promotionInfoListBeans.isDelete = map['isDelete'];
promotionInfoListBean.tenantCode = map['tenantCode']; promotionInfoListBeans.tenantCode = map['tenantCode'];
promotionInfoListBean.canPartake = map['canPartake']; promotionInfoListBeans.canPartake = map['canPartake'];
promotionInfoListBean.isMaxPromotion = map['isMaxPromotion']; promotionInfoListBeans.isMaxPromotion = map['isMaxPromotion'];
promotionInfoListBean.promotionProuctList = map['promotionProuctList']; promotionInfoListBeans.promotionProuctList = map['promotionProuctList'];
return promotionInfoListBean; return promotionInfoListBeans;
} }
Map toJson() => { Map toJson() => {
@ -437,7 +437,7 @@ class PromotionInfoListBean {
/// isMaxCoupon:true /// isMaxCoupon:true
/// productList : null /// productList : null
class CouponListBean { class CouponListBeans {
String id; String id;
String storeId; String storeId;
int bizType; int bizType;
@ -466,35 +466,35 @@ class CouponListBean {
bool isEx; bool isEx;
static CouponListBean fromJson(Map<String, dynamic> map) { static CouponListBeans fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
CouponListBean couponListBean = CouponListBean(); CouponListBeans couponListBeans = CouponListBeans();
couponListBean.id = map['id']; couponListBeans.id = map['id'];
couponListBean.storeId = map['storeId']; couponListBeans.storeId = map['storeId'];
couponListBean.bizType = map['bizType']; couponListBeans.bizType = map['bizType'];
couponListBean.fullAmount = map['fullAmount']; couponListBeans.fullAmount = map['fullAmount'];
couponListBean.discountAmount = map['discountAmount']; couponListBeans.discountAmount = map['discountAmount'];
couponListBean.fullNumber = map['fullNumber']; couponListBeans.fullNumber = map['fullNumber'];
couponListBean.discountPercent = map['discountPercent']; couponListBeans.discountPercent = map['discountPercent'];
couponListBean.bizId = map['bizId']; couponListBeans.bizId = map['bizId'];
couponListBean.publishStartTime = map['publishStartTime']; couponListBeans.publishStartTime = map['publishStartTime'];
couponListBean.publishEndTime = map['publishEndTime']; couponListBeans.publishEndTime = map['publishEndTime'];
couponListBean.useStartTime = map['useStartTime']; couponListBeans.useStartTime = map['useStartTime'];
couponListBean.useEndTime = map['useEndTime']; couponListBeans.useEndTime = map['useEndTime'];
couponListBean.promotionId = map['promotionId']; couponListBeans.promotionId = map['promotionId'];
couponListBean.mid = map['mid']; couponListBeans.mid = map['mid'];
couponListBean.couponId = map['couponId']; couponListBeans.couponId = map['couponId'];
couponListBean.receiveTime = map['receiveTime']; couponListBeans.receiveTime = map['receiveTime'];
couponListBean.useTime = map['useTime']; couponListBeans.useTime = map['useTime'];
couponListBean.status = map['status']; couponListBeans.status = map['status'];
couponListBean.tenantCode = map['tenantCode']; couponListBeans.tenantCode = map['tenantCode'];
couponListBean.type = map['type']; couponListBeans.type = map['type'];
couponListBean.promotionName = map['promotionName']; couponListBeans.promotionName = map['promotionName'];
couponListBean.usable = map['usable']; couponListBeans.usable = map['usable'];
couponListBean.allProduct = map['allProduct']; couponListBeans.allProduct = map['allProduct'];
couponListBean.isMaxCoupon = map['isMaxCoupon']; couponListBeans.isMaxCoupon = map['isMaxCoupon'];
couponListBean.productList = map['productList']; couponListBeans.productList = map['productList'];
return couponListBean; return couponListBeans;
} }
Map toJson() => { Map toJson() => {

9
lib/settlement/settlement.dart

@ -33,11 +33,10 @@ import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart'; import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/shoppingCart.dart';
import '../view_widget/settlement_tips_dialog.dart'; import '../view_widget/settlement_tips_dialog.dart';
class Settlement extends StatefulWidget { class Settlement extends StatefulWidget {
@ -85,6 +84,7 @@ class _Settlement extends State<Settlement> {
bool useVipPriceSelect = true; bool useVipPriceSelect = true;
bool showVipTips = false; bool showVipTips = false;
bool isRaiseChannel = false; bool isRaiseChannel = false;
ShoppingCart shopCarGoods;
@override @override
void initState() { void initState() {
@ -107,6 +107,8 @@ class _Settlement extends State<Settlement> {
productSkuId = widget.arguments["productSkuId"]; productSkuId = widget.arguments["productSkuId"];
count1 = widget.arguments["buyNum"]; count1 = widget.arguments["buyNum"];
productId = widget.arguments["productId"]; productId = widget.arguments["productId"];
shopCarGoods = widget.arguments["shoppingCart"];
if (tableId == 0) { if (tableId == 0) {
placeOrder = true; placeOrder = true;
} }
@ -516,6 +518,9 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.storeId = storeInfo.id; placeOrderFirst.storeId = storeInfo.id;
placeOrderFirst.subcribeTime = null; placeOrderFirst.subcribeTime = null;
placeOrderFirst.tableId = "$tableId"; placeOrderFirst.tableId = "$tableId";
for(int i = 0;i<placeOrderFirst.shoppingCartSkuItemList.length;i++){
placeOrderFirst.shoppingCartSkuItemList[i].setMealDataList = shopCarGoods.shoppingCartSkuItemList[i].setMealDataList;
}
if (tableId == 0) { if (tableId == 0) {
/// ///

2
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -76,7 +76,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
if(!(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false)) if( !(widget?.settleOrderInfo?.isRaise ?? false) && (widget?.settleOrderInfo?.memberVO?.isVip ?? false) && widget.placeOrder)
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

130
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -21,13 +21,18 @@ class SettlementOrderCommodity extends StatefulWidget {
final bool showVipTips; final bool showVipTips;
SettlementOrderCommodity( SettlementOrderCommodity(
this.isTakeOut, this.settleOrderInfo, this.minOrderInfo,this.tableId,this.pageType,this.useVipPriceSelect,this.showVipTips); this.isTakeOut,
this.settleOrderInfo,
this.minOrderInfo,
this.tableId,
this.pageType,
this.useVipPriceSelect,
this.showVipTips);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _SettlementOrderCommodity(); return _SettlementOrderCommodity();
} }
} }
class _SettlementOrderCommodity extends State<SettlementOrderCommodity> { class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
@ -105,38 +110,47 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
if(widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (!widget.settleOrderInfo.isRaise) && (widget?.settleOrderInfo?.discountAmount!= "0")){ if (widget.useVipPriceSelect &&
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠", widget?.settleOrderInfo?.discountAmount ?? "")); widget.settleOrderInfo.memberVO.isVip &&
(!widget.settleOrderInfo.isRaise) &&
(widget?.settleOrderInfo?.discountAmount != "0")) {
widgets.add(vipItem(Color(0xFFFF7A1A), "VIP优惠",
widget?.settleOrderInfo?.discountAmount ?? ""));
} }
if(widget.showVipTips){ if (widget.showVipTips) {
widgets.add(GestureDetector(child: Container( widgets.add(GestureDetector(
alignment: Alignment.centerLeft, child: Container(
child:Text.rich( alignment: Alignment.centerLeft,
TextSpan( child: Text.rich(
children: [ TextSpan(
TextSpan( children: [
text: "您未购买回乡VIP卡,无法享受优惠,", TextSpan(
style: TextStyle( text: "您未购买回乡VIP卡,无法享受优惠,",
fontSize: 12.sp, style: TextStyle(
fontWeight: MyFontWeight.regular, fontSize: 12.sp,
color: Colors.black, fontWeight: MyFontWeight.regular,
color: Colors.black,
),
), ),
), TextSpan(
TextSpan( text: "点击立即购买",
text: "点击立即购买", style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFFFF7A1A),
color: Color(0xFFFF7A1A), ),
), ),
), ],
], ),
), ),
),),onTap: (){ ),
Navigator.of(context) onTap: () {
.pushNamedAndRemoveUntil('/router/main_page', (route) => false,arguments: {"index":2}); Navigator.of(context).pushNamedAndRemoveUntil(
},)); '/router/main_page', (route) => false,
arguments: {"index": 2});
},
));
} }
widgets.add(Container( widgets.add(Container(
@ -154,7 +168,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
return widgets; return widgets;
} }
Widget commodityItem(OrderProductVOList productList) { Widget commodityItem(OrderProductVOList productList) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
@ -173,7 +186,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
flex: 1, flex: 1,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left:8.w, left: 8.w,
), ),
// height: 44.h, // height: 44.h,
child: Column( child: Column(
@ -190,7 +203,9 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
SizedBox(height: 4.h,), SizedBox(
height: 4.h,
),
Text( Text(
productList.skuNameStr != null productList.skuNameStr != null
? "${productList.skuNameStr ?? ""}" ? "${productList.skuNameStr ?? ""}"
@ -208,7 +223,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
color: Color(0xFF727272), color: Color(0xFF727272),
), ),
), ),
], ],
), ),
), ),
@ -218,26 +232,26 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
productList.buyNum > 1 ? productList.buyNum > 1
S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0")/productList.buyNum)))) ? S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - AppUtils.stringAsFixedDouble2((double.tryParse(productList.discountAmount ?? "0") / productList.buyNum))))
:S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))), : S.of(context).yuan_(AppUtils.calculateDouble(double.tryParse(productList.sellPrice ?? "0") - double.tryParse(productList.discountAmount ?? "0"))),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF4C4C4C), color: Color(0xFF4C4C4C),
), ),
), ),
if(productList.discountAmount != null) if (productList.discountAmount != null)
Text( Text(
S.of(context).yuan_(productList.sellPrice), S.of(context).yuan_(productList.sellPrice),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
fontFamily: 'JDZhengHT', fontFamily: 'JDZhengHT',
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
), ),
) )
], ],
) )
], ],
@ -405,13 +419,13 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String countAllGoods(){ String countAllGoods() {
int count = 0; int count = 0;
if(widget.minOrderInfo != null){ if (widget.minOrderInfo != null) {
widget.minOrderInfo.orderProductVOList.forEach((element) { widget.minOrderInfo.orderProductVOList.forEach((element) {
count += element.buyNum; count += element.buyNum;
}); });
}else if(widget.settleOrderInfo != null){ } else if (widget.settleOrderInfo != null) {
widget.settleOrderInfo.orderProductList.forEach((element) { widget.settleOrderInfo.orderProductList.forEach((element) {
count += element.buyNum; count += element.buyNum;
}); });
@ -452,7 +466,6 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
SizedBox( SizedBox(
width: 15.w, width: 15.w,
), ),
Container( Container(
child: Text( child: Text(
S.of(context).jiesuanjine, S.of(context).jiesuanjine,
@ -481,13 +494,16 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String discountPrice(){ String discountPrice() {
if(widget.minOrderInfo != null){ if (widget.minOrderInfo != null) {
return AppUtils.calculateDouble(double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") + double.tryParse(widget.settleOrderInfo?.benefitDiscountAmount ?? "0")); return AppUtils.calculateDouble(
}else if(widget.tableId < 0){ double.tryParse(widget.minOrderInfo?.couponSubPrice ?? "0") +
double.tryParse(
widget.settleOrderInfo?.benefitDiscountAmount ?? "0"));
} else if (widget.tableId < 0) {
return "0"; return "0";
}else { } else {
return widget?.settleOrderInfo?.discountAmount ?? "0"; return widget?.settleOrderInfo?.discountAmount ?? "0";
} }
} }

3
lib/union/location_map_page.dart

@ -76,7 +76,8 @@ class _LocationMap extends State<LocationMap> {
leadingColor: Colors.black, leadingColor: Colors.black,
), ),
body: Container( body: Container(
child: BMFMapWidget( //BMFMapWidget ,BMFTextureMapWidget不会强制遮盖其他控件
child: BMFTextureMapWidget(
mapOptions: BMFMapOptions( mapOptions: BMFMapOptions(
center: BMFCoordinate( center: BMFCoordinate(
double.tryParse(widget.arguments["lat"]), double.tryParse(widget.arguments["lat"]),

1
lib/union/union_list.dart

@ -121,6 +121,7 @@ class _UnionList extends State<UnionList> {
child: TextField( child: TextField(
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
onEditingComplete: () { onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode());
widget.queryStore(editingController.text); widget.queryStore(editingController.text);
}, },
controller: editingController, controller: editingController,

62
lib/utils/location.dart

@ -2,11 +2,15 @@ import 'dart:io';
import 'package:android_intent_plus/android_intent.dart'; import 'package:android_intent_plus/android_intent.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bmflocation/flutter_bmflocation.dart'; import 'package:flutter_bmflocation/flutter_bmflocation.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'font_weight.dart';
BaiduLocationAndroidOption initAndroidOptions() { BaiduLocationAndroidOption initAndroidOptions() {
BaiduLocationAndroidOption options = BaiduLocationAndroidOption( BaiduLocationAndroidOption options = BaiduLocationAndroidOption(
@ -99,14 +103,18 @@ class Location {
} }
return true; return true;
} else if (await Permission.location.isUndetermined) { } else if (await Permission.location.isUndetermined) {
showAlertDialog(context);
await Permission.location.request(); await Permission.location.request();
Navigator.of(context).pop();
return false; return false;
} else { } else {
if (Platform.isIOS) { if (Platform.isIOS) {
// //
requestDialog(context, locationCallback); requestDialog(context, locationCallback);
} else { } else {
showAlertDialog(context);
await Permission.location.request(); await Permission.location.request();
Navigator.of(context).pop();
} }
return false; return false;
} }
@ -162,4 +170,58 @@ class Location {
}, },
); );
} }
///
showAlertDialog(context) {
//
showDialog(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
titlePadding: EdgeInsets.all(10),
backgroundColor: Colors.transparent,
elevation: 0,
alignment: Alignment.topCenter,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
children: <Widget>[
Container(
width: double.infinity,
height: 120.h,
padding: EdgeInsets.all(16),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"访问精确地理位置信息权限说明",
style: TextStyle(
fontSize: 15.sp,
fontWeight:MyFontWeight.regular,
color: Colors.black,
),
),
SizedBox(height: 3.h,),
Text(
"为了向您推荐附近的门店信息,推荐您在使用期间让我们使用位置信息,不授权该权限不影响app正常使用。",
style: TextStyle(
fontSize: 13.sp,
height: 1.3.h,
fontWeight:MyFontWeight.regular,
color: Colors.black,
),
),
],
),
),
],
);
},
);
}
} }

122
lib/view_widget/activity_poster.dart

@ -1,5 +1,3 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,7 +12,7 @@ class ActivityPoster extends StatefulWidget {
final ActivityPos activityPos; final ActivityPos activityPos;
final List<FirstLoginCouponList> firstLoginCouponList; final List<FirstLoginCouponList> firstLoginCouponList;
ActivityPoster(this.activityPos,this.firstLoginCouponList); ActivityPoster(this.activityPos, this.firstLoginCouponList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -28,67 +26,65 @@ class _ActivityPoster extends State<ActivityPoster> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.firstLoginCouponList != null && widget.firstLoginCouponList.length > 0) if (widget.firstLoginCouponList != null &&
showNew = true; widget.firstLoginCouponList.length > 0) showNew = true;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return WillPopScope(
onWillPop: () async => false, onWillPop: () async => false,
child:Container( child: Container(
width: double.infinity, width: double.infinity,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left:27.w, left: 27.w,
right:27.w, right: 27.w,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
onTap: (){
jumpClick(widget.activityPos);
},
child:
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
),
child:MImage(
widget?.activityPos?.showImage ?? "",
aspectRatio: 0.75,
fit: BoxFit.cover,
noCompress: true,
radius: BorderRadius.all(Radius.circular(12)),
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),),
), ),
Container( child: Column(
margin: EdgeInsets.only(top:35.h,right: 8.w,bottom:8.w), mainAxisAlignment: MainAxisAlignment.center,
child:GestureDetector( crossAxisAlignment: CrossAxisAlignment.center,
behavior: HitTestBehavior.opaque, children: [
onTap: (){ GestureDetector(
Navigator.of(context).pop(); onTap: () {
jumpClick(widget.activityPos);
if (showNew) {
newShowAlertDialog(widget.firstLoginCouponList);
showNew = false;
}
}, },
child: Image.asset( child: Container(
"assets/image/yq_qx.webp", decoration: BoxDecoration(
width: 40, borderRadius: BorderRadius.circular(12),
height: 40, ),
fit: BoxFit.cover, child: MImage(
color: Colors.white, widget?.activityPos?.showImage ?? "",
) aspectRatio: 0.75,
) ) fit: BoxFit.cover,
], noCompress: true,
), radius: BorderRadius.all(Radius.circular(12)),
)); errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
),
Container(
margin: EdgeInsets.only(top: 35.h, right: 8.w, bottom: 8.w),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
if (showNew) {
newShowAlertDialog(widget.firstLoginCouponList);
showNew = false;
}
},
child: Image.asset(
"assets/image/yq_qx.webp",
width: 40,
height: 40,
fit: BoxFit.cover,
color: Colors.white,
)))
],
),
));
} }
/// ///
@ -110,21 +106,18 @@ class _ActivityPoster extends State<ActivityPoster> {
arguments: {"goodsId": widget.activityPos.jumpUrl}); arguments: {"goodsId": widget.activityPos.jumpUrl});
break; break;
case 2: case 2:
Navigator.of(context) Navigator.of(context).pushNamed('/router/web_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"activityId": widget.activityPos.jumpUrl, "activityId": widget.activityPos.jumpUrl,
}); });
break; break;
case 3: case 3:
Navigator.of(context) Navigator.of(context).pushNamed('/router/web_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"articleId": widget.activityPos.jumpUrl, "articleId": widget.activityPos.jumpUrl,
}); });
break; break;
case 4: case 4:
String router = widget.activityPos.jumpUrl; String router = widget.activityPos.jumpUrl;
// String router = "/router/store_order?{\"id\":\"1333246101343436800\",\"tenant\":\"1175\",\"storeName\":\"海峡姐妹茶(汉街店)\"}";
// String router = "/router/store_order?{\"id\":\"1333246101343436800\",\"tenant\":\"1175\",\"storeName\":\"海峡姐妹茶(汉街店)\"}";
if (router.contains("?")) { if (router.contains("?")) {
String params = router.substring(router.indexOf("?")+1); String params = router.substring(router.indexOf("?")+1);
Map map = jsonDecode(params); Map map = jsonDecode(params);
@ -134,8 +127,7 @@ class _ActivityPoster extends State<ActivityPoster> {
} }
break; break;
case 5: case 5:
Navigator.of(context) Navigator.of(context).pushNamed('/router/class_details', arguments: {
.pushNamed('/router/class_details', arguments: {
"id": widget.activityPos.jumpUrl, "id": widget.activityPos.jumpUrl,
}); });
break; break;

5
lib/view_widget/new_coupon_widget.dart

@ -43,7 +43,7 @@ class NewCouponWidget extends StatelessWidget {
// } // }
return Container( return Container(
height: (coupon != null && coupon.isEx) ? 155.h : 135.h, height: (coupon != null && coupon.isEx) ? 160.h : 140.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h), margin: EdgeInsets.fromLTRB(14.w, 6.h, 14.w, 6.h),
padding: EdgeInsets.only(right: 5), padding: EdgeInsets.only(right: 5),
@ -83,11 +83,12 @@ class NewCouponWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"券名称:${coupon != null ? coupon.couponName ?? "" : ""}", "${coupon != null ? coupon.couponName ?? "" : ""}",
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 15.sp, fontSize: 15.sp,
height: 1.2.h,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF0D0D0D), color: Color(0xFF0D0D0D),
), ),

2
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.3+44 version: 3.2.4+48
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save