添加收货成功页面

master
张萌 3 years ago
parent cf7d73171e
commit 487617616a

@ -8,6 +8,7 @@ import 'package:aku_new_community/ui/market/order/my_order_detail_page.dart';
import 'package:aku_new_community/ui/market/order/my_order_evaluation_page.dart';
import 'package:aku_new_community/ui/market/order/my_order_func.dart';
import 'package:aku_new_community/ui/market/order/my_order_refund_page.dart';
import 'package:aku_new_community/ui/market/order/receive_success.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/card_bottom_button.dart';
import 'package:flutter/material.dart';
@ -110,16 +111,6 @@ class _MyOrderCardState extends State<MyOrderCard> {
.make()
],
),
// 12.w.heightBox,
// Row(
// children: [
// ('${widget.model.levelTwoCategory}')
// .text
// .size(24.sp)
// .color(ktextSubColor)
// .make()
// ],
// ),
],
),
).expand()
@ -175,8 +166,11 @@ class _MyOrderCardState extends State<MyOrderCard> {
CardBottomButton.yellow(
text: '确认收货',
onPressed: () async {
await MyOrderFunc.confirmReceive(widget.model.id);
var re = await MyOrderFunc.confirmReceive(widget.model.id);
widget.callRefresh();
if (re) {
Get.to(() => ReceiveSuccess());
}
}),
].sepWidget(separate: 24.w.widthBox);
case 4:

@ -6,9 +6,10 @@ import 'package:aku_new_community/utils/network/net_util.dart';
class MyOrderFunc {
///
static Future confirmReceive(int goodsAppointmentId) async {
await NetUtil().get(API.market.confirmReceive,
static Future<bool> confirmReceive(int goodsAppointmentId) async {
var result = await NetUtil().get(API.market.confirmReceive,
params: {"goodsAppointmentId": goodsAppointmentId}, showMessage: true);
return result.status ?? false;
}
///退

@ -3,6 +3,7 @@ import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/model/order/order_list_model.dart';
import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart';
import 'package:aku_new_community/pages/life_pay/pay_util.dart';
import 'package:aku_new_community/ui/market/order/receive_success.dart';
import 'package:aku_new_community/ui/market/search/settlementGoodsDTO.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
@ -169,7 +170,10 @@ class _OrderCardState extends State<OrderCard> {
});
if (baseModel.status ?? false) {
BotToast.showText(text: '收货成功');
Get.back();
Get.off(() => ReceiveSuccess(
integralGood: widget.model.payType == 10,
integral: widget.model.payPrice!.toInt(),
));
widget.callRefresh();
}
cancel();

@ -0,0 +1,109 @@
import 'package:aku_new_community/pages/tab_navigator.dart';
import 'package:aku_new_community/ui/profile/order/order_page.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class ReceiveSuccess extends StatefulWidget {
final bool integralGood;
final int? integral;
const ReceiveSuccess({Key? key, this.integralGood = false, this.integral})
: super(key: key);
@override
_ReceiveSuccessState createState() => _ReceiveSuccessState();
}
class _ReceiveSuccessState extends State<ReceiveSuccess> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '订单结果',
body: SafeArea(
child: Center(
child: Column(
children: [
Container(
width: 56.w,
height: 56.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xFFE52E2E), Color(0xFFF58123)],
),
),
child: Icon(
CupertinoIcons.check_mark,
size: 42.w,
color: Colors.white,
),
),
24.w.heightBox,
'收货成功'.text.size(32.sp).color(Colors.black).make(),
widget.integral != null
? Column(
children: [
8.w.heightBox,
'已获得${widget.integral}积分'
.text
.size(28.sp)
.color(Colors.red)
.make(),
48.w.heightBox,
],
)
: Column(
children: [
8.w.heightBox,
'本单已享受积分兑换不予返还积分'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
32.w.heightBox,
],
),
Row(
children: [
MaterialButton(
onPressed: () {
Get.offAll(() => TabNavigator());
},
color: Colors.white,
minWidth: 168.w,
height: 68.w,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(34.w),
side: BorderSide(color: Colors.red),
),
child: '返回首页'.text.size(28.sp).color(Colors.red).make(),
),
24.w.widthBox,
MaterialButton(
onPressed: () {
Get.off(() => OrderPage(initIndex: 3));
},
color: Colors.white,
minWidth: 168.w,
height: 68.w,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(34.w),
side: BorderSide(color: Colors.red),
),
child: '查看详情'.text.size(28.sp).color(Colors.red).make(),
)
],
)
],
),
)),
);
}
}
Loading…
Cancel
Save