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/home/home_page.dart b/lib/home/home_page.dart index c3943e51..4f52ddb7 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 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 ac5c7392..9d19d9d0 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -23,6 +23,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; @@ -227,6 +229,7 @@ class _OrderHistoryList extends State context: context, token: value.getString("token")), queryOrder(), + queryUserBalance(), }); } @@ -574,12 +577,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..5f995898 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 == "订单待发货"|| 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/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();