From a76894820f50c805033f875cee0546437513b262 Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Mon, 17 Jul 2023 17:02:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E6=98=BE=E7=A4=BA=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F=E7=9A=84Toast;=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E7=AD=89=E5=BE=85=E9=85=8D=E9=A4=90?= =?UTF-8?q?=E6=BC=8F=E6=96=97=E5=A2=9E=E5=8A=A0=E6=97=8B=E8=BD=AC=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=EF=BC=9B=20=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=8A=A9=E5=86=9C?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E8=B7=9F=E7=BB=BF=E5=B8=81=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=AF=A5=E4=BD=99=E9=A2=9D=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=98=AF0=E5=88=A4=E6=96=AD=E6=98=BE=E7=A4=BA=E9=9A=90?= =?UTF-8?q?=E8=97=8F=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/order/order_detail_page.dart | 23 +++++++- lib/order/order_history_page.dart | 18 ++++++- lib/order/order_view/order_pay_selected.dart | 8 +++ lib/order/order_view/order_status.dart | 57 +++++++++++++++++--- lib/retrofit/min_api.dart | 4 +- lib/retrofit/retrofit_api.dart | 4 +- lib/settlement/settlement.dart | 5 +- 7 files changed, 103 insertions(+), 16 deletions(-) diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index e7837eeb..798a9c0b 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -19,6 +19,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../retrofit/data/user_info.dart'; import '../utils/flutter_utils.dart'; import '../view_widget/classic_header.dart'; import '../view_widget/my_footer.dart'; @@ -40,15 +41,18 @@ class _OrderDetailPage extends State { MinApiService minService; int jumpState; final RefreshController refreshController = RefreshController(); + UserInfo userInfo; @override void initState() { super.initState(); jumpState = widget.arguments["jumpState"]; SharedPreferences.getInstance().then((value) { + EasyLoading.show(status: S.of(context).zhengzaijiazai); apiService = ApiService(Dio(), - context: context, token: value.getString("token"), showLoading: jumpState == 2? true:false); + context: context, token: value.getString("token"),); queryDetails(); + queryUserBalance(); }); } @@ -81,6 +85,18 @@ class _OrderDetailPage extends State { }); } + ///查询用户信息 + queryUserBalance() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + if (mounted) setState(() {}); + }else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + OrderInfo orderInfo; int payStatus = 0; int orderStatus = 0; @@ -123,9 +139,11 @@ class _OrderDetailPage extends State { setState(() { statusTitle(); }); + EasyLoading.dismiss(); refreshController.refreshCompleted(); refreshController.loadComplete(); } else { + EasyLoading.dismiss(); SmartDialog.showToast(baseData.msg, alignment: Alignment.center); refreshController.refreshFailed(); refreshController.loadFailed(); @@ -196,6 +214,7 @@ class _OrderDetailPage extends State { orderInfo, ), + ///订单取货地址,或, 收货地址 if(orderInfo != null && orderInfo.addressExt != null) OrderAddress( @@ -241,7 +260,7 @@ class _OrderDetailPage extends State { context: context, backgroundColor: Colors.transparent, builder: (context) { - return OrderPaySelected(); + return OrderPaySelected(userInfo); }, ); if (payChannel != null && payChannel > 0) { diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 59b7e465..8e37518e 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -24,6 +24,8 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../retrofit/data/user_info.dart'; + class OrderHistoryPage extends StatefulWidget { final Map arguments; @@ -228,6 +230,7 @@ class _OrderHistoryList extends State context: context, token: value.getString("token")), queryOrder(), + queryUserBalance(), }); } @@ -575,12 +578,25 @@ class _OrderHistoryList extends State } } + UserInfo userInfo; + + queryUserBalance() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + if (mounted) setState(() {}); + }else { + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + } + } + paySelected(OrderInfo orderInfo, MinApiService minService) async { var payChannel = await showModalBottomSheet( context: context, backgroundColor: Colors.transparent, builder: (context) { - return OrderPaySelected(); + return OrderPaySelected(userInfo); }, ); if (payChannel != null && payChannel > 0) { diff --git a/lib/order/order_view/order_pay_selected.dart b/lib/order/order_view/order_pay_selected.dart index c3ea3250..2d442531 100644 --- a/lib/order/order_view/order_pay_selected.dart +++ b/lib/order/order_view/order_pay_selected.dart @@ -3,7 +3,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/utils/font_weight.dart'; +import '../../retrofit/data/settleOrderInfo.dart'; +import '../../retrofit/data/user_info.dart'; + class OrderPaySelected extends StatefulWidget { + final UserInfo userInfo; + OrderPaySelected(this.userInfo); @override State createState() { @@ -54,6 +59,7 @@ class _OrderPaySelected extends State { ), ), ), + if(widget.userInfo.raiseMoney != "0.00") GestureDetector( onTap: () { // Navigator.of(context).pop(3); @@ -147,6 +153,7 @@ class _OrderPaySelected extends State { SizedBox( height: 10, ), + if(widget.userInfo.greenMoney != "0.00") GestureDetector( onTap: () { // Navigator.of(context).pop(3); @@ -176,6 +183,7 @@ class _OrderPaySelected extends State { ], ), ), + if(widget.userInfo.greenMoney != "0.00") SizedBox( height: 10, ), diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index 23ec9774..a1438089 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; @@ -27,8 +29,35 @@ class OrderStatus extends StatefulWidget { } -class _OrderStatus extends State { +class _OrderStatus extends State with SingleTickerProviderStateMixin{ + AnimationController _controller; + Animation _animation; + + @override + void initState() { + super.initState(); + _controller = AnimationController( + duration: Duration(seconds: 1), + vsync: this, + ); + _animation = Tween(begin: 0, end: 1).animate(_controller); + _controller.addStatusListener((status) { + if (status == AnimationStatus.completed) { + Future.delayed(Duration(seconds: 1), () { + _controller.reset(); + }); + } else if (status == AnimationStatus.dismissed) { + _controller.forward(); + } + }); + _controller.forward(); + } + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } @override Widget build(BuildContext context) { @@ -126,11 +155,25 @@ class _OrderStatus extends State { ], ), if(widget.payStatus != 0) - Image.asset( - statusPicture(widget.title), - height: 66.h, - width:66.w, - ), + (widget.title == "商家正在配餐" || widget.title == "订单待发货") ? + AnimatedBuilder( + animation: _animation, + builder: (BuildContext context, Widget child) { + return Transform.rotate( + angle: _animation.value * 1 * 3.14159, + child: Image.asset( + statusPicture(widget.title), + height: 66.h, + width:66.w, + ), + alignment: Alignment.center, + ); + }, + ):Image.asset( + statusPicture(widget.title), + height: 66.h, + width:66.w, + ), ], ), ], @@ -252,7 +295,7 @@ class _OrderStatus extends State { tripStatus = "assets/image/order_refund.webp"; } else if (status.contains(S.of(context).yiquxiao)) { tripStatus = "assets/image/oeder_cancel.webp"; - } else if (status.contains(S.of(context).dengdaiyonghuqucan)) { + } else if (status.contains(S.of(context).dengdaiyonghuqucan)|| status.contains("商家正在配餐")) { tripStatus = "assets/image/wait_meal.webp"; }else if (status.contains(S.of(context).zhengzaihujiaoqishou)) { tripStatus = "assets/image/distribution.webp"; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 15d058e5..286a292b 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -26,8 +26,8 @@ import 'data/shopping_home_config.dart'; part 'min_api.g.dart'; -// const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 -const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///测试 +const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/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 13c3a7de..78a38906 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -66,8 +66,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -// const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 -const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///测试 +const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///测试 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @RestApi(baseUrl: localBaseUrl) diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index d2bc5d6c..e23aca93 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -726,7 +726,7 @@ class _Settlement extends State { }); // orderButton = false; if (baseData != null && baseData.isSuccess) { - SmartDialog.showToast(baseData.data, alignment: Alignment.center); + // SmartDialog.showToast(baseData.data, alignment: Alignment.center); toOrderDetails(placeOrderFirst.id); } else { SmartDialog.show( @@ -807,7 +807,8 @@ class _Settlement extends State { '/router/order_details', arguments: { "id": orderId, - "jumpState": 1, + //原结算页跳转详情无需正在加载样式,因为,结算页支付成功会显示一个“订单支付成功”的toast,避免两者重叠显示;现在据要求,去掉toast,故而需要显示正在加载样式;1不需要加载,2需要加载 + "jumpState": 2, }, ); // Navigator.of(context).pop(); From 1a39f7ef54da848d82cfb83c0784dd8dbeefa359 Mon Sep 17 00:00:00 2001 From: fmk Date: Mon, 17 Jul 2023 18:03:56 +0800 Subject: [PATCH 2/3] ios --- ios/Runner.xcodeproj/project.pbxproj | 12 ++++++------ lib/order/order_view/order_status.dart | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c6d4b722..c1914e4e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -617,7 +617,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -667,7 +667,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.16; + MARKETING_VERSION = 3.2.17; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -819,7 +819,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -869,7 +869,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.16; + MARKETING_VERSION = 3.2.17; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -912,7 +912,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -962,7 +962,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 3.2.16; + MARKETING_VERSION = 3.2.17; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index a1438089..5f995898 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -155,7 +155,7 @@ class _OrderStatus extends State with SingleTickerProviderStateMixi ], ), if(widget.payStatus != 0) - (widget.title == "商家正在配餐" || widget.title == "订单待发货") ? + (widget.title == "商家正在配餐" || widget.title == "订单待发货"|| widget.title == "商家已发货") ? AnimatedBuilder( animation: _animation, builder: (BuildContext context, Widget child) { From aed73137f64aa834e7bcc8dc811ef51502a9c68d Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Tue, 18 Jul 2023 14:33:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/home_page.dart | 4 ++-- lib/home/points_mall_view/points_goods_view.dart | 2 ++ lib/home/welfare_exchange.dart | 6 +++--- lib/integral_store/integral_store_details_page.dart | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index f17ab8ae..1730b133 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -200,7 +200,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { "orderDesc": true, "orderType": 1, "pageNum": 1, - "pageSize": 10, + "pageSize": 100, "state": 1 }).catchError((onError) { refreshController.refreshFailed(); @@ -238,7 +238,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { "orderDesc": orderDesc, "orderType": orderType, "pageNum": pageNum, - "pageSize": 10, + "pageSize": 100, "state": 1 }; BaseData> pageGoods = diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 6bc20bb2..eac4013b 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -38,6 +38,8 @@ class _PointGoods extends State { : " + ${AppUtils.calculateDouble(double.tryParse(goods?.money) ?? 0)}元"); } else if (goods.oneMoney != null && goods.oneMoney != "0.00") { return "${AppUtils.calculateDouble(double.tryParse(goods.oneMoney) ?? 0)}元"; + } else { + return ""; } } diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index af27cb1c..4fa8ecaa 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -88,7 +88,7 @@ class _WelfareExchange extends State "orderDesc": true, "orderType": 1, "pageNum": 1, - "pageSize": 10, + "pageSize": 100, "state": 1 }).catchError((onError) { refreshController.refreshFailed(); @@ -126,7 +126,7 @@ class _WelfareExchange extends State "orderDesc": orderDesc, "orderType": orderType, "pageNum": pageNum, - "pageSize": 10, + "pageSize": 100, "state": 1 }; BaseData> pageGoods = @@ -260,7 +260,7 @@ class _WelfareExchange extends State body: SmartRefresher( controller: refreshController, enablePullDown: true, - enablePullUp: true, + enablePullUp: false, physics: ClampingScrollPhysics(), header: MyHeader(), footer: CustomFooter( diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 7f0395ac..73d266e8 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -96,6 +96,7 @@ class _IntegralStoreDetailsPage extends State { }else if(goods.oneMoney != null && goods.oneMoney != "0.00"){ return "${AppUtils.calculateDouble(double.tryParse(goods?.oneMoney) ?? 0)}元"; } + return ""; } @override