From ce5551eb99b1d0ae0f8e8c919d3f44498ebcf994 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 30 May 2023 15:53:49 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8A=A8=E6=80=81=E8=AF=A6=E6=83=85=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0=EF=BC=9B?= =?UTF-8?q?=202.=E5=8A=A8=E6=80=81=E8=AF=A6=E6=83=85=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=9B=BE=E7=89=87=E6=94=BE=E5=A4=A7=EF=BC=8C=E9=99=90?= =?UTF-8?q?=E5=88=B6=E7=BC=A9=E6=94=BE=E5=B0=BA=E5=AF=B8=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=EF=BC=8C=E8=B6=85=E5=87=BA=E8=AE=BE=E7=BD=AE=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E6=97=A2=E8=BF=98=EF=BC=9B=203.=E5=90=8E=E5=8F=B0=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=A4=84=E7=90=86=EF=BC=8C=E5=8E=BB=E6=8E=89=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=88=B7=E6=96=B0=E8=AF=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=8A=B6=E6=80=81=EF=BC=9B=204.=E4=BC=9A=E5=91=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=EF=BC=9A=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=9B=86=E6=8D=A2=E5=8D=A1=E5=AD=97=E6=AE=B5=205.=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5+=E6=89=93=E5=8C=85=E8=B4=B9=EF=BC=9B?= =?UTF-8?q?=EF=BC=88=E5=A6=82=E6=9E=9C=E6=98=AF=E5=A4=96=E5=B8=A6=E5=B0=B1?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=89=93=E5=8C=85=E8=B4=B9=EF=BC=89[?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E9=A1=B5=E6=95=B0=E6=8D=AE=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=EF=BC=8C=E4=B8=8B=E5=8D=95=E5=90=8E=E7=9A=84=E9=87=91=E9=A2=9D?= =?UTF-8?q?=EF=BC=8C=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BE=85=E5=90=8E=E7=AB=AF=E4=BF=AE=E6=94=B9]=206.?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=EF=BC=8C=E5=A6=82=E8=8B=A5?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=BD=9C=E8=80=85=EF=BC=8C=E5=88=99=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=89=8D=E9=9D=A2=E7=9A=84=E9=97=B4=E8=B7=9D=EF=BC=9B?= =?UTF-8?q?=207.=E9=9B=86=E6=8D=A2=E5=8D=A1=EF=BC=8C=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=A1=B5=E9=9D=A2=E9=83=A8=E5=88=86=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/photo_view_gallery_screen.dart | 4 + .../points_mall_view/points_goods_view.dart | 2 +- .../integral_store_details_page.dart | 12 +- lib/main_page.dart | 4 +- lib/mine/mine_vip/mine_vip_core.dart | 186 ++++++++++++++++++ lib/order/exchange_order_page.dart | 29 +-- lib/order/exchange_order_success_page.dart | 64 ++++-- lib/retrofit/data/min_order_info.dart | 5 + lib/retrofit/data/order_product_vo.dart | 8 +- lib/retrofit/data/settleOrderInfo.dart | 3 + lib/retrofit/data/user_info.dart | 5 +- lib/retrofit/min_api.dart | 2 +- lib/retrofit/retrofit_api.dart | 2 +- lib/settlement/settlement.dart | 73 +++++-- .../activity_coupon_remarks.dart | 2 +- .../settlement_order_commodity.dart | 19 +- lib/web/web_view/web_header.dart | 5 +- 17 files changed, 356 insertions(+), 69 deletions(-) diff --git a/lib/community/photo_view_gallery_screen.dart b/lib/community/photo_view_gallery_screen.dart index 5b301b22..1ae25e9d 100644 --- a/lib/community/photo_view_gallery_screen.dart +++ b/lib/community/photo_view_gallery_screen.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:network_to_file_image/network_to_file_image.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view_gallery.dart'; import 'package:path/path.dart' as p; @@ -58,6 +59,9 @@ class _PhotoViewGalleryScreenState extends State { .replaceAll("https://pos.upload.gznl.top/", "").replaceAll("/", "")), debug: true, ), + //图片的缩放级别 + maxScale: PhotoViewComputedScale.contained *2.5, + minScale: PhotoViewComputedScale.contained *1, ); }, itemCount: widget.images.length, diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 6bc20bb2..bd09122d 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -23,7 +23,7 @@ class _PointGoods extends State { String pointPrice(Goods goods) { if (goods == null) return ""; if (goods?.oneBean != null && goods?.oneBean != "0") { - return "${goods?.oneBean}印章"; + return "${goods?.oneBean}集换卡"; } if (goods?.onePrice != null && goods?.onePrice != "0") { return S.of(context).jifen_(goods?.onePrice); diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 583c2835..764b886c 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -34,6 +34,7 @@ class IntegralStoreDetailsPage extends StatefulWidget { class _IntegralStoreDetailsPage extends State { ApiService apiService; String points; + String happyBean; int payType = 0; final ScrollController scrollController = ScrollController(); final RefreshController refreshController = RefreshController(); @@ -48,6 +49,7 @@ class _IntegralStoreDetailsPage extends State { queryGoodsById(); if (value.getString('user') != null) { points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points; + happyBean = UserInfo.fromJson(jsonDecode(value.getString('user'))).happyBean; } }); } @@ -62,8 +64,8 @@ class _IntegralStoreDetailsPage extends State { if (baseData != null && baseData.isSuccess) { setState(() { goods = baseData.data; - if(goods != null && points != null && double.tryParse(goods?.oneBean ?? "0") - != 0 && double.tryParse(goods?.oneBean ?? "0") <= double.tryParse(points)){ + if(goods != null && happyBean != null && double.tryParse(goods?.oneBean ?? "0") + != 0 && double.tryParse(goods?.oneBean ?? "0") <= double.tryParse(happyBean)){ payType = 1; } else if(goods != null && points != null && double.tryParse(goods.onePrice) != 0 && double.tryParse(goods.onePrice) <= double.tryParse(points)){ @@ -86,7 +88,7 @@ class _IntegralStoreDetailsPage extends State { if(goods == null) return ""; if(goods?.oneBean!=null && goods?.oneBean!="0"){ - return "${goods?.oneBean}印章"; + return "${goods?.oneBean}集换卡"; }else if(goods?.onePrice!=null && goods?.onePrice!="0"){ return S.of(context).jifen_(goods?.onePrice); }else if((goods?.onePrice == null || goods?.onePrice == "0") && ((goods?.price != null && goods?.price != "0") || (goods?.money != null && goods?.money != "0.00"))){ @@ -173,7 +175,7 @@ class _IntegralStoreDetailsPage extends State { if(payType > 0){ toExchangeOrder(); }else{ - SmartDialog.showToast(pointPrice().contains("印章")?"您的印章数量不足!" : "您的积分不足!", alignment: Alignment.center); + SmartDialog.showToast(pointPrice().contains("集换卡")?"您的集换卡数量不足!" : "您的积分不足!", alignment: Alignment.center); return; } }, @@ -192,7 +194,7 @@ class _IntegralStoreDetailsPage extends State { child: Text( (payType > 0) ? "立即兑换" - : pointPrice().contains("印章")?"您的印章数量不足" :S.of(context).jifenbuzu, + : pointPrice().contains("集换卡")?"您的集换卡数量不足" :S.of(context).jifenbuzu, // "兑换功能暂未开放", style: TextStyle( fontSize: 16.sp, diff --git a/lib/main_page.dart b/lib/main_page.dart index 937b2d89..e1d4dfa6 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -75,7 +75,9 @@ class _MainPage extends State with WidgetsBindingObserver { case AppLifecycleState.resumed: //从后台切换前台,界面可见 pushRoute(); if (DateTime.now().millisecondsSinceEpoch - lastTime > 420000) - Navigator.of(context).popAndPushNamed('/router/start_page'); + //处于后台**分钟后刷新应用 + // Navigator.of(context).popAndPushNamed('/router/start_page'); + setState((){}); break; case AppLifecycleState.paused: // 界面不可见,后台 lastTime = DateTime.now().millisecondsSinceEpoch; diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 953ea947..82d7f446 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -82,6 +82,7 @@ class _MineVipCore extends State { }); } + ///会员等级列表 queryVipLevel() async { BaseData> rankData = await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { @@ -577,8 +578,193 @@ class _MineVipCore extends State { ], ), ); + } + Widget vipCar(){ + return Container( + margin:EdgeInsets.fromLTRB(16.w, 16.h, 8.w, 8.h), + width: MediaQuery.of(context).size.width - 32.w, + height: ((MediaQuery.of(context).size.width - 32.w) / + 2.11 * + AppUtils.textScale(context)), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // decoration: BoxDecoration( + // color: levelColor, + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(8), + // bottomRight: Radius.circular(8), + // ), + // ), + // child: Text( + // topLeft, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // margin: EdgeInsets.only(top: 10,right: 10), + // decoration: BoxDecoration( + // color: levelColor, + // borderRadius: BorderRadius.circular(10), + // ), + // child: Text( + // S.of(context).chakanquanyi, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFFF5EEE9), + // ), + // ), + // ) + // ], + // ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 86.w, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + ), + child: Text( + "111", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.white, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 13.w), + child: Text( + "hhh", + style: TextStyle( + color: Colors.grey, + fontWeight: MyFontWeight.semi_bold, + fontSize:22.sp, + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(right: 11.w, bottom: 9.h), + child: Image.asset( + "assets/image/icon_mine_huixiang_logo.webp", + width: 86.w, + height: 86.w, + fit: BoxFit.contain, + ), + ), + ], + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 13.w, + right: 12.w, + bottom: 12.h, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Expanded( + child: Text( + "消费¥", + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: Colors.black, + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + flex: 1, + ), + Text.rich( + TextSpan( + children: [ + TextSpan( + text:"555", + style: TextStyle( + fontSize: 20.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + ), + ], + ), + // if (isUserVip) + Expanded(child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).kaitongriqi( + "2021-01-01" + ), + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 12.sp, + ), + ), + Icon( + Icons.qr_code, + size: 24, + ), + ], + ),), + ], + ), + ), + flex: 1, + ), + ], + ), + ); } ///vip diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index 43d6edca..50db4bc0 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -41,6 +41,8 @@ class _ExchangeOrderPage extends State { UserInfo userInfo; dynamic payListen; dynamic mBalance = 0; + String happyBean; + String points; @override void initState() { @@ -49,8 +51,8 @@ class _ExchangeOrderPage extends State { SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), context: context, token: value.getString("token")), - points = - UserInfo.fromJson(jsonDecode(value.getString('user'))).points, + points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points, + happyBean = UserInfo.fromJson(jsonDecode(value.getString('user'))).happyBean, queryUserBalance(), }); @@ -66,6 +68,7 @@ class _ExchangeOrderPage extends State { ? realPay.substring(0, realPay.indexOf("积分")) : "0", "points": points, + "happyBean":happyBean, "realPay": realPay, "payChannel": widget.arguments["payChannel"], }, @@ -93,8 +96,6 @@ class _ExchangeOrderPage extends State { } } - String points; - @override Widget build(BuildContext context) { return Scaffold( @@ -639,7 +640,7 @@ class _ExchangeOrderPage extends State { // : (widget.arguments["payType"] == 2 ?"${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分" // :((widget.arguments["price"] == null || // widget.arguments["price"] == "0" - // ? (widget.arguments["oneBean"] != "0" && double.parse(userInfo?.points ?? "0") <= double.parse(widget.arguments["oneBean"] ??"0") + // ? (widget.arguments["oneBean"] != "0" && double.parse(userInfo?.happyBean ?? "0") <= double.parse(widget.arguments["oneBean"] ??"0") // ? "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}印章" // :(widget.arguments["onePrice"] != "0" && double.parse(userInfo?.points ?? "0") <= double.parse(widget.arguments["onePrice"]) // ?"${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分" @@ -679,7 +680,7 @@ class _ExchangeOrderPage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - payableAmount().contains("印章")? "现金抵扣印章":"现金抵扣积分", + payableAmount().contains("集换卡")? "现金抵扣集换卡":"现金抵扣积分", style: TextStyle( fontSize: 14, color: Color(0xFF353535), @@ -785,7 +786,7 @@ class _ExchangeOrderPage extends State { ? (double.parse(widget .arguments["oneBean"]) * (buyNum + 1)) > - double.parse(points) + double.parse(happyBean) : (widget.arguments["payType"] == 2 ? (double.parse(widget.arguments[ "onePrice"]) * @@ -901,7 +902,7 @@ class _ExchangeOrderPage extends State { ), ), SizedBox( - height: 10, + height: 10.h, ), // GestureDetector( // onTap: () { @@ -941,7 +942,7 @@ class _ExchangeOrderPage extends State { // ), // ), SizedBox( - height: 10, + height: 10.h, ), GestureDetector( onTap: () { @@ -1069,14 +1070,14 @@ class _ExchangeOrderPage extends State { String payableAmount() { if (widget.arguments["payType"] == 0) return ""; if (widget.arguments["payType"] == 1) { - return "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}印章"; + return "${(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum).toInt()}集换卡"; } else if (widget.arguments["payType"] == 2) { return "${(double.parse(widget.arguments["onePrice"]) * buyNum).toInt()}积分"; } else if (widget.arguments["payType"] == 3) { return "${(double.parse(widget.arguments["price"]) * buyNum).toInt()}积分" + " + ${AppUtils.calculateDouble(double.tryParse(widget.arguments["money"]) * buyNum) ?? 0}元"; } else if (widget.arguments["payType"] == 4) { if ((widget.arguments["oneBean"] ?? "0") != "0") { - return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}印章"; + return "${AppUtils.calculateDouble(double.parse(widget.arguments["oneBean"] ?? "0") * buyNum)}集换卡"; } else if (widget.arguments["onePrice"] != "0") { return "${AppUtils.calculateDouble(double.parse(widget.arguments["onePrice"]) * buyNum)}积分"; } else if ((widget.arguments["price"] != null || widget.arguments["price"] != "0") && (widget.arguments["money"] != null || widget.arguments["money"] != "0.00")) { @@ -1092,7 +1093,7 @@ class _ExchangeOrderPage extends State { String handleNeedPay() { if (widget.arguments["payType"] == 0) return ""; if (widget.arguments["payType"] == 1) { - return "${(double.parse(widget.arguments["oneBean"]) * buyNum).toInt()}印章"; + return "${(double.parse(widget.arguments["oneBean"]) * buyNum).toInt()}集换卡"; } if (widget.arguments["payType"] == 2) { return S.of(context).jifen_( @@ -1214,11 +1215,11 @@ class _ExchangeOrderPage extends State { : "0", "realPay": realPay, "points": points, + "happyBean":happyBean, "payChannel": widget.arguments["payChannel"], "id": baseDate.data }); - points = - "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; + points = "${int.tryParse(points) - int.tryParse(widget.arguments["price"])}"; Navigator.of(context).pop(); } else { SmartDialog.showToast(baseDate.msg, alignment: Alignment.center); diff --git a/lib/order/exchange_order_success_page.dart b/lib/order/exchange_order_success_page.dart index 50f4d462..60908438 100644 --- a/lib/order/exchange_order_success_page.dart +++ b/lib/order/exchange_order_success_page.dart @@ -25,6 +25,7 @@ class ExchangeOrderSuccessPage extends StatefulWidget { class _ExchangeOrderSuccessPage extends State { int price = 0; + int happyBean = 0; ApiService apiService; @override void initState() { @@ -37,6 +38,7 @@ class _ExchangeOrderSuccessPage extends State { apiService = ApiService(Dio(), context: context, token: value.getString("token")); userInfo = UserInfo.fromJson(jsonDecode(value.getString('user'))); userInfo.points = "$price"; + userInfo.happyBean = "$happyBean"; value.setString('user', jsonEncode(userInfo.toJson())); }); @@ -79,7 +81,27 @@ class _ExchangeOrderSuccessPage extends State { fontWeight: MyFontWeight.semi_bold), ), SizedBox( - height: 70.h, + height:45.h, + ), + Text( + widget.arguments["realPay"].toString().contains("集换卡") ? "消费集换卡":S.of(context).xiaofeijifen, + style: TextStyle( + color: Color(0xFF727272), + fontSize: 14.sp, + ), + ), + SizedBox( + height: 5.h, + ), + Text( + widget.arguments["realPay"], + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 21.sp, + fontWeight: MyFontWeight.bold), + ), + SizedBox( + height: 34.h, ), Row( children: [ @@ -87,53 +109,53 @@ class _ExchangeOrderSuccessPage extends State { child: Column( children: [ Text( - widget.arguments["realPay"], + "可用集换卡", style: TextStyle( - color: Colors.black, - fontSize: 21.sp, - fontWeight: MyFontWeight.semi_bold), + color: Color(0xFF727272), + fontSize: 14.sp, + ), ), SizedBox( height: 14.h, ), Text( - S.of(context).xiaofeijifen, + "$happyBean", style: TextStyle( - color: Color(0xFF727272), - fontSize: 14.sp, - ), - ) + color: Colors.black, + fontSize: 21.sp, + fontWeight: MyFontWeight.regular), + ), ], ), flex: 1, ), Container( - width: 2.w, - height: 34.h, - color: Color(0xFFABABAB), + width: 1.w, + height: 53.h, + color: Color(0xFFD8D8D8), margin: EdgeInsets.only(top: 18.h, bottom: 7.h), ), Expanded( child: Column( children: [ Text( - "$price", + S.of(context).keyongjifen, style: TextStyle( - color: Colors.black, - fontSize: 21.sp, - fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF727272), + fontSize: 14.sp, ), ), SizedBox( height: 14.h, ), Text( - S.of(context).keyongjifen, + "$price", style: TextStyle( - color: Color(0xFF727272), - fontSize: 14.sp, + color: Colors.black, + fontSize: 21.sp, + fontWeight: MyFontWeight.regular, ), - ) + ), ], ), flex: 1, diff --git a/lib/retrofit/data/min_order_info.dart b/lib/retrofit/data/min_order_info.dart index 384bc124..c4aac5c2 100644 --- a/lib/retrofit/data/min_order_info.dart +++ b/lib/retrofit/data/min_order_info.dart @@ -61,6 +61,7 @@ class MinOrderInfo { String activityNoPrice, String activityDiscountPrice, String totalDiscountPrice, + String totalPackagingFee, String benefitDiscountAmount, int orderSource, dynamic address, @@ -145,6 +146,7 @@ class MinOrderInfo { this.activityNoPrice = activityNoPrice; this.activityDiscountPrice = activityDiscountPrice; this.totalDiscountPrice = totalDiscountPrice; + this.totalPackagingFee = totalPackagingFee; this.benefitDiscountAmount = benefitDiscountAmount; this.orderSource = orderSource; this.address = address; @@ -232,6 +234,7 @@ class MinOrderInfo { this.activityNoPrice = json['activityNoPrice']; this.activityDiscountPrice = json['activityDiscountPrice']; this.totalDiscountPrice = json['totalDiscountPrice']; + this.totalPackagingFee = json['totalPackagingFee']; this.benefitDiscountAmount = json['benefitDiscountAmount']; this.orderSource = json['orderSource']; this.address = json['address']; @@ -322,6 +325,7 @@ class MinOrderInfo { String activityNoPrice; String activityDiscountPrice; String totalDiscountPrice; + String totalPackagingFee; String benefitDiscountAmount; int orderSource; dynamic address; @@ -409,6 +413,7 @@ class MinOrderInfo { map['activityNoPrice'] = this.activityNoPrice; map['activityDiscountPrice'] = this.activityDiscountPrice; map['totalDiscountPrice'] = this.totalDiscountPrice; + map['totalPackagingFee'] = this.totalPackagingFee; map['benefitDiscountAmount'] = this.benefitDiscountAmount; map['orderSource'] = this.orderSource; map['address'] = this.address; diff --git a/lib/retrofit/data/order_product_vo.dart b/lib/retrofit/data/order_product_vo.dart index b0c75db1..64259663 100644 --- a/lib/retrofit/data/order_product_vo.dart +++ b/lib/retrofit/data/order_product_vo.dart @@ -19,7 +19,8 @@ class OrderProductVOList { String skuId, String skuImg, String skuNameStr, - List setMealDataList + List setMealDataList, + String packagingFee, }) { this.actInfo = actInfo; this.additionalComment = additionalComment; @@ -39,6 +40,7 @@ class OrderProductVOList { this.skuImg = skuImg; this.skuNameStr = skuNameStr; this.setMealDataList = setMealDataList; + this.packagingFee = packagingFee; } OrderProductVOList.fromJson(dynamic json) { @@ -66,6 +68,7 @@ class OrderProductVOList { this.setMealDataList = []..addAll( (json['setMealDataList'] as List ?? []) .map((o) => SetMealDataList.fromJson(o))); + this.packagingFee = json['packagingFee']; } ActInfo actInfo; @@ -86,7 +89,7 @@ class OrderProductVOList { String skuImg; String skuNameStr; List setMealDataList; - + String packagingFee; Map toJson() { final map = {}; @@ -114,6 +117,7 @@ class OrderProductVOList { map['skuImg'] = this.skuImg; map['skuNameStr'] = this.skuNameStr; map['setMealDataList']=this.setMealDataList; + map['packagingFee'] = this.packagingFee; return map; } diff --git a/lib/retrofit/data/settleOrderInfo.dart b/lib/retrofit/data/settleOrderInfo.dart index 06c74d0b..5daf8752 100644 --- a/lib/retrofit/data/settleOrderInfo.dart +++ b/lib/retrofit/data/settleOrderInfo.dart @@ -25,6 +25,7 @@ class SettleOrderInfo { String vipDiscountAmount; String totalDiscountAmount; String discountType; + String packagingFee; static SettleOrderInfo fromJson(Map map) { @@ -58,6 +59,7 @@ class SettleOrderInfo { settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount']; settleOrderInfoBean.totalDiscountAmount = map['totalDiscountAmount']; settleOrderInfoBean.discountType = map['discountType']; + settleOrderInfoBean.packagingFee = map['packagingFee']; return settleOrderInfoBean; } @@ -84,6 +86,7 @@ class SettleOrderInfo { "vipDiscountAmount":vipDiscountAmount, "totalDiscountAmount": totalDiscountAmount, "discountType":discountType, + "packagingFee" : packagingFee, }; diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index 1c1c03ad..22a44cf2 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -49,8 +49,7 @@ class UserInfo { String signature; String background; bool hasPayPassword; - - + String happyBean; factory UserInfo.fromJson(Map json) => UserInfo() @@ -83,6 +82,7 @@ class UserInfo { ..signature = json['signature'] as String ..background = json['background'] as String ..hasPayPassword = json['hasPayPassword'] as bool + ..happyBean = json['happyBean'] as String ..memberRankVo = json['memberRankVo'] == null ? null : MemberRank.fromJson(json['memberRankVo'] as Map); @@ -117,6 +117,7 @@ class UserInfo { 'signature' : this.signature, 'background' : this.background, 'hasPayPassword' : this.hasPayPassword, + 'happyBean':this.happyBean, 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), }; } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index a1ad9f27..dc0384e3 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,7 +26,7 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index e27f691c..f03753ed 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -66,7 +66,7 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const localBaseUrl = "http://192.168.10.129:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 // const localBaseUrl = "https://2946-27-19-77-115.jp.ngrok.io/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 397d44a9..86cd7b8f 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -141,7 +141,9 @@ class _Settlement extends State { if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, widget.arguments["pid"] ?? (productId ?? 0), @@ -157,7 +159,9 @@ class _Settlement extends State { } else if (coupons != null && coupons != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, widget.arguments["cid"], 0, productId ?? 0, @@ -173,7 +177,9 @@ class _Settlement extends State { } else queryOrderInfo( null, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, @@ -268,7 +274,9 @@ class _Settlement extends State { isRaiseChannel = true; queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, couponListBean?.id, 0, promotion?.id ?? productId, @@ -360,7 +368,9 @@ class _Settlement extends State { if (address != null) { queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -414,7 +424,9 @@ class _Settlement extends State { } await queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -444,7 +456,9 @@ class _Settlement extends State { queryOrderInfo( address.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, @@ -542,10 +556,7 @@ class _Settlement extends State { ? true : false; //是否预约 placeOrderFirst.isTakeOut = - ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && - (subscribeParam?.isEnableSubscribe ?? false) == false && - selectedBtn != 1 && - selectedBtn != 2) + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) ? diningStatus : selectedBtn; placeOrderFirst.notes = remakers + @@ -837,7 +848,9 @@ class _Settlement extends State { }); queryOrderInfo( addressId, - isTake, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, memberCouponId, orderId, promotionId ?? (productId ?? 0), @@ -885,6 +898,7 @@ class _Settlement extends State { minOrderInfo != null) SettlementOrderCommodity( selectedBtn, + diningStatus, settleOrderInfo, minOrderInfo, tableId, @@ -1146,6 +1160,21 @@ class _Settlement extends State { onTap: () { setState(() { diningStatus = 3; + queryOrderInfo( + address?.id, + 3, + 0, + 0, + productId ?? 0, + productSkuId ?? "", + actProductId ?? "", + actProductSkuId ?? "", + "AUTO", + // useVipPriceSelect, + // useBenefitSelect, + count1, + payChannel, + tableId); }); }, child: Container( @@ -1216,7 +1245,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, (settleOrderInfo.isRaise || payChannel == 5) ? "" : couponListBean?.id, @@ -1251,7 +1282,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, productId ?? 0, @@ -1275,7 +1308,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, null, 0, productId ?? null, @@ -1333,7 +1368,9 @@ class _Settlement extends State { } else { queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, couponBean?.id, 0, productId ?? 0, @@ -1372,7 +1409,9 @@ class _Settlement extends State { // this.couponListBean = null; queryOrderInfo( address?.id, - selectedBtn, + ((storeInfo?.pickupType?.dineInTakeStatus ?? false) == true && (subscribeParam?.isEnableSubscribe ?? false) == false && selectedBtn != 1 && selectedBtn != 2) + ? diningStatus + : selectedBtn, 0, 0, (pro?.id ?? 0) ?? productId, diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index a8630df5..d80201bb 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -122,7 +122,7 @@ class _ActivityCouponRemarks extends State { (widget.coupons != null && widget.coupons != "" || widget.promotions != null && widget.promotions != "" || - widget.payChannell == 5 || widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" ||(widget.payChannell == 4 && widget.settleOrderInfo.promotionInfoList.length <=0 && widget.settleOrderInfo.couponList.length <= 0)) + widget.payChannell == 5 || widget.payChannell == 7 ||(widget?.settleOrderInfo?.discountType ?? "") == "MEMBER_RANK" ) ? false : vipSelect, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, diff --git a/lib/settlement/settlement_view/settlement_order_commodity.dart b/lib/settlement/settlement_view/settlement_order_commodity.dart index e8f4cd49..c8c36e43 100644 --- a/lib/settlement/settlement_view/settlement_order_commodity.dart +++ b/lib/settlement/settlement_view/settlement_order_commodity.dart @@ -14,6 +14,7 @@ import '../../retrofit/data/shoppingCart.dart'; class SettlementOrderCommodity extends StatefulWidget { final int isTakeOut; + final int diningStatus; final int tableId; final SettleOrderInfo settleOrderInfo; @@ -26,6 +27,7 @@ class SettlementOrderCommodity extends StatefulWidget { SettlementOrderCommodity( this.isTakeOut, + this.diningStatus, this.settleOrderInfo, this.minOrderInfo, this.tableId, @@ -116,6 +118,20 @@ class _SettlementOrderCommodity extends State { ); } + if (widget.diningStatus == 3) { + //打包费 + widgets.add( + discountItem( + Color(0xFFFF7A1A), + "打包费", + "", + (widget.minOrderInfo != null) + ? "+ ${widget.minOrderInfo?.totalPackagingFee ?? "0"}" + : "+ ${widget.settleOrderInfo?.packagingFee ?? "0"}", + ), + ); + } + if (widget.useVipPriceSelect && widget.settleOrderInfo.memberVO.isVip && (widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)) && @@ -125,7 +141,8 @@ class _SettlementOrderCommodity extends State { } if (widget.useBenefitSelect && - (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) { + (widget?.settleOrderInfo?.discountType == "MEMBER_RANK" && widget?.settleOrderInfo?.benefitDiscountAmount != "0") && ((widget.tableId > 0 + ? !(widget?.minOrderInfo?.isRaise ?? false) : !(widget?.settleOrderInfo?.isRaise ?? false)))) { widgets.add(vipItem(Color(0xFFFF7A1A), "会员优惠金额", (widget.minOrderInfo != null && widget.minOrderInfo.orderProductVOList != null) ? (widget.minOrderInfo?.benefitDiscountAmount ?? "") :(widget?.settleOrderInfo?.benefitDiscountAmount ?? ""))); } diff --git a/lib/web/web_view/web_header.dart b/lib/web/web_view/web_header.dart index ae67f404..d4356941 100644 --- a/lib/web/web_view/web_header.dart +++ b/lib/web/web_view/web_header.dart @@ -47,8 +47,8 @@ class _WebHeader extends State { InkWell( child: Text( "${widget.activity != null ? (widget.activity.storeName ?? "") - : (widget.article != null && widget.article.author != null) - ? (widget.article.author.name ?? "") : ""}", + : ((widget.article != null && widget.article.author != null) + ? (widget.article.author.name ?? "") : "")}", style: TextStyle( fontWeight: FontWeight.normal, fontSize: widget.fontSize - 2, @@ -85,6 +85,7 @@ class _WebHeader extends State { } }, ), + if((widget?.activity?.storeName ?? "") != "" || (widget?.article?.author?.name ?? "") != "") SizedBox( width: 10.w, ),