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. 49
      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_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)",

4
lib/home/home_page.dart

@ -200,7 +200,7 @@ class HomePageState extends State<HomePage> 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<HomePage> with AutomaticKeepAliveClientMixin {
"orderDesc": orderDesc,
"orderType": orderType,
"pageNum": pageNum,
"pageSize": 10,
"pageSize": 100,
"state": 1
};
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)}");
} else if (goods.oneMoney != null && goods.oneMoney != "0.00") {
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,
"orderType": 1,
"pageNum": 1,
"pageSize": 10,
"pageSize": 100,
"state": 1
}).catchError((onError) {
refreshController.refreshFailed();
@ -126,7 +126,7 @@ class _WelfareExchange extends State<WelfareExchange>
"orderDesc": orderDesc,
"orderType": orderType,
"pageNum": pageNum,
"pageSize": 10,
"pageSize": 100,
"state": 1
};
BaseData<PageInfo<Goods>> pageGoods =
@ -260,7 +260,7 @@ class _WelfareExchange extends State<WelfareExchange>
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
enablePullUp: false,
physics: ClampingScrollPhysics(),
header: MyHeader(),
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"){
return "${AppUtils.calculateDouble(double.tryParse(goods?.oneMoney) ?? 0)}";
}
return "";
}
@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: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<OrderDetailPage> {
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<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;
int payStatus = 0;
int orderStatus = 0;
@ -123,9 +139,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
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<OrderDetailPage> {
orderInfo,
),
///
if(orderInfo != null && orderInfo.addressExt != null)
OrderAddress(
@ -241,7 +260,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
return OrderPaySelected(userInfo);
},
);
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: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<OrderHistoryList>
context: context,
token: value.getString("token")),
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 {
var payChannel = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return OrderPaySelected();
return OrderPaySelected(userInfo);
},
);
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/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<StatefulWidget> createState() {
@ -54,6 +59,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
),
),
),
if(widget.userInfo.raiseMoney != "0.00")
GestureDetector(
onTap: () {
// Navigator.of(context).pop(3);
@ -147,6 +153,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
SizedBox(
height: 10,
),
if(widget.userInfo.greenMoney != "0.00")
GestureDetector(
onTap: () {
// Navigator.of(context).pop(3);
@ -176,6 +183,7 @@ class _OrderPaySelected extends State<OrderPaySelected> {
],
),
),
if(widget.userInfo.greenMoney != "0.00")
SizedBox(
height: 10,
),

49
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<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
Widget build(BuildContext context) {
@ -126,7 +155,21 @@ class _OrderStatus extends State<OrderStatus> {
],
),
if(widget.payStatus != 0)
Image.asset(
(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<OrderStatus> {
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";

5
lib/settlement/settlement.dart

@ -726,7 +726,7 @@ class _Settlement extends State<Settlement> {
});
// 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<Settlement> {
'/router/order_details',
arguments: {
"id": orderId,
"jumpState": 1,
//toasttoast12
"jumpState": 2,
},
);
// Navigator.of(context).pop();

Loading…
Cancel
Save