Browse Source

Merge branch 'dev' into wr_2023_business

wr_2023_business
wurong 2 years ago
parent
commit
bbf7557359
  1. 12
      ios/Runner.xcodeproj/project.pbxproj
  2. 4
      lib/home/home_page.dart
  3. 2
      lib/home/points_mall_view/points_goods_view.dart
  4. 6
      lib/home/welfare_exchange.dart
  5. 1
      lib/integral_store/integral_store_details_page.dart
  6. 23
      lib/order/order_detail_page.dart
  7. 18
      lib/order/order_history_page.dart
  8. 8
      lib/order/order_view/order_pay_selected.dart
  9. 57
      lib/order/order_view/order_status.dart
  10. 5
      lib/settlement/settlement.dart

12
ios/Runner.xcodeproj/project.pbxproj

@ -617,7 +617,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -667,7 +667,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.16; MARKETING_VERSION = 3.2.17;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -819,7 +819,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -869,7 +869,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.16; MARKETING_VERSION = 3.2.17;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
@ -912,7 +912,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YF3Q8DVP52; DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -962,7 +962,7 @@
"$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu", "$(PROJECT_DIR)/Runner/baidu",
); );
MARKETING_VERSION = 3.2.16; MARKETING_VERSION = 3.2.17;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",

4
lib/home/home_page.dart

@ -200,7 +200,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
"orderDesc": true, "orderDesc": true,
"orderType": 1, "orderType": 1,
"pageNum": 1, "pageNum": 1,
"pageSize": 10, "pageSize": 100,
"state": 1 "state": 1
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -238,7 +238,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
"orderDesc": orderDesc, "orderDesc": orderDesc,
"orderType": orderType, "orderType": orderType,
"pageNum": pageNum, "pageNum": pageNum,
"pageSize": 10, "pageSize": 100,
"state": 1 "state": 1
}; };
BaseData<PageInfo<Goods>> pageGoods = BaseData<PageInfo<Goods>> pageGoods =

2
lib/home/points_mall_view/points_goods_view.dart

@ -38,6 +38,8 @@ class _PointGoods extends State<PointGoods> {
: " + ${AppUtils.calculateDouble(double.tryParse(goods?.money) ?? 0)}"); : " + ${AppUtils.calculateDouble(double.tryParse(goods?.money) ?? 0)}");
} else if (goods.oneMoney != null && goods.oneMoney != "0.00") { } else if (goods.oneMoney != null && goods.oneMoney != "0.00") {
return "${AppUtils.calculateDouble(double.tryParse(goods.oneMoney) ?? 0)}"; return "${AppUtils.calculateDouble(double.tryParse(goods.oneMoney) ?? 0)}";
} else {
return "";
} }
} }

6
lib/home/welfare_exchange.dart

@ -88,7 +88,7 @@ class _WelfareExchange extends State<WelfareExchange>
"orderDesc": true, "orderDesc": true,
"orderType": 1, "orderType": 1,
"pageNum": 1, "pageNum": 1,
"pageSize": 10, "pageSize": 100,
"state": 1 "state": 1
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -126,7 +126,7 @@ class _WelfareExchange extends State<WelfareExchange>
"orderDesc": orderDesc, "orderDesc": orderDesc,
"orderType": orderType, "orderType": orderType,
"pageNum": pageNum, "pageNum": pageNum,
"pageSize": 10, "pageSize": 100,
"state": 1 "state": 1
}; };
BaseData<PageInfo<Goods>> pageGoods = BaseData<PageInfo<Goods>> pageGoods =
@ -260,7 +260,7 @@ class _WelfareExchange extends State<WelfareExchange>
body: SmartRefresher( body: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: false,
physics: ClampingScrollPhysics(), physics: ClampingScrollPhysics(),
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(

1
lib/integral_store/integral_store_details_page.dart

@ -96,6 +96,7 @@ class _IntegralStoreDetailsPage extends State<IntegralStoreDetailsPage> {
}else if(goods.oneMoney != null && goods.oneMoney != "0.00"){ }else if(goods.oneMoney != null && goods.oneMoney != "0.00"){
return "${AppUtils.calculateDouble(double.tryParse(goods?.oneMoney) ?? 0)}"; return "${AppUtils.calculateDouble(double.tryParse(goods?.oneMoney) ?? 0)}";
} }
return "";
} }
@override @override

23
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:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart';
import '../utils/flutter_utils.dart'; import '../utils/flutter_utils.dart';
import '../view_widget/classic_header.dart'; import '../view_widget/classic_header.dart';
import '../view_widget/my_footer.dart'; import '../view_widget/my_footer.dart';
@ -40,15 +41,18 @@ class _OrderDetailPage extends State<OrderDetailPage> {
MinApiService minService; MinApiService minService;
int jumpState; int jumpState;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
UserInfo userInfo;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
jumpState = widget.arguments["jumpState"]; jumpState = widget.arguments["jumpState"];
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token"), showLoading: jumpState == 2? true:false); context: context, token: value.getString("token"),);
queryDetails(); queryDetails();
queryUserBalance();
}); });
} }
@ -81,6 +85,18 @@ class _OrderDetailPage extends State<OrderDetailPage> {
}); });
} }
///
queryUserBalance() async {
BaseData<UserInfo> 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; OrderInfo orderInfo;
int payStatus = 0; int payStatus = 0;
int orderStatus = 0; int orderStatus = 0;
@ -123,9 +139,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
setState(() { setState(() {
statusTitle(); statusTitle();
}); });
EasyLoading.dismiss();
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
} else { } else {
EasyLoading.dismiss();
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
@ -196,6 +214,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
orderInfo, orderInfo,
), ),
/// ///
if(orderInfo != null && orderInfo.addressExt != null) if(orderInfo != null && orderInfo.addressExt != null)
OrderAddress( OrderAddress(
@ -241,7 +260,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return OrderPaySelected(); return OrderPaySelected(userInfo);
}, },
); );
if (payChannel != null && payChannel > 0) { if (payChannel != null && payChannel > 0) {

18
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:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../retrofit/data/user_info.dart';
class OrderHistoryPage extends StatefulWidget { class OrderHistoryPage extends StatefulWidget {
final Map arguments; final Map arguments;
@ -227,6 +229,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
context: context, context: context,
token: value.getString("token")), token: value.getString("token")),
queryOrder(), queryOrder(),
queryUserBalance(),
}); });
} }
@ -574,12 +577,25 @@ class _OrderHistoryList extends State<OrderHistoryList>
} }
} }
UserInfo userInfo;
queryUserBalance() async {
BaseData<UserInfo> 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 { paySelected(OrderInfo orderInfo, MinApiService minService) async {
var payChannel = await showModalBottomSheet( var payChannel = await showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return OrderPaySelected(); return OrderPaySelected(userInfo);
}, },
); );
if (payChannel != null && payChannel > 0) { if (payChannel != null && payChannel > 0) {

8
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/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import '../../retrofit/data/settleOrderInfo.dart';
import '../../retrofit/data/user_info.dart';
class OrderPaySelected extends StatefulWidget { class OrderPaySelected extends StatefulWidget {
final UserInfo userInfo;
OrderPaySelected(this.userInfo);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -54,6 +59,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
), ),
), ),
), ),
if(widget.userInfo.raiseMoney != "0.00")
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).pop(3); // Navigator.of(context).pop(3);
@ -147,6 +153,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
if(widget.userInfo.greenMoney != "0.00")
GestureDetector( GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).pop(3); // Navigator.of(context).pop(3);
@ -176,6 +183,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
], ],
), ),
), ),
if(widget.userInfo.greenMoney != "0.00")
SizedBox( SizedBox(
height: 10, height: 10,
), ),

57
lib/order/order_view/order_status.dart

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
@ -27,8 +29,35 @@ class OrderStatus extends StatefulWidget {
} }
class _OrderStatus extends State<OrderStatus> { class _OrderStatus extends State<OrderStatus> with SingleTickerProviderStateMixin{
AnimationController _controller;
Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: Duration(seconds: 1),
vsync: this,
);
_animation = Tween<double>(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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -126,11 +155,25 @@ class _OrderStatus extends State<OrderStatus> {
], ],
), ),
if(widget.payStatus != 0) if(widget.payStatus != 0)
Image.asset( (widget.title == "商家正在配餐" || widget.title == "订单待发货"|| widget.title == "商家已发货") ?
statusPicture(widget.title), AnimatedBuilder(
height: 66.h, animation: _animation,
width:66.w, 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<OrderStatus> {
tripStatus = "assets/image/order_refund.webp"; tripStatus = "assets/image/order_refund.webp";
} else if (status.contains(S.of(context).yiquxiao)) { } else if (status.contains(S.of(context).yiquxiao)) {
tripStatus = "assets/image/oeder_cancel.webp"; 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"; tripStatus = "assets/image/wait_meal.webp";
}else if (status.contains(S.of(context).zhengzaihujiaoqishou)) { }else if (status.contains(S.of(context).zhengzaihujiaoqishou)) {
tripStatus = "assets/image/distribution.webp"; tripStatus = "assets/image/distribution.webp";

5
lib/settlement/settlement.dart

@ -726,7 +726,7 @@ class _Settlement extends State<Settlement> {
}); });
// orderButton = false; // orderButton = false;
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(baseData.data, alignment: Alignment.center); // SmartDialog.showToast(baseData.data, alignment: Alignment.center);
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
} else { } else {
SmartDialog.show( SmartDialog.show(
@ -807,7 +807,8 @@ class _Settlement extends State<Settlement> {
'/router/order_details', '/router/order_details',
arguments: { arguments: {
"id": orderId, "id": orderId,
"jumpState": 1, //toasttoast12
"jumpState": 2,
}, },
); );
// Navigator.of(context).pop(); // Navigator.of(context).pop();

Loading…
Cancel
Save