添加出借成功及失败页面

hmxc
张萌 4 years ago
parent 0fc2b0521e
commit 8529017dff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -124,10 +124,18 @@ class R {
static const String ASSETS_ICONS_ARTICLE_NAME_PNG =
'assets/icons/article_name.png';
/// ![preview](file:///Users/zhangmeng/akuCommunity/assets/icons/borrow_failure.png)
static const String ASSETS_ICONS_BORROW_FAILURE_PNG =
'assets/icons/borrow_failure.png';
/// ![preview](file:///Users/zhangmeng/akuCommunity/assets/icons/borrow_status.png)
static const String ASSETS_ICONS_BORROW_STATUS_PNG =
'assets/icons/borrow_status.png';
/// ![preview](file:///Users/zhangmeng/akuCommunity/assets/icons/borrow_success.png)
static const String ASSETS_ICONS_BORROW_SUCCESS_PNG =
'assets/icons/borrow_success.png';
/// ![preview](file:///Users/zhangmeng/akuCommunity/assets/icons/comment_notice.png)
static const String ASSETS_ICONS_COMMENT_NOTICE_PNG =
'assets/icons/comment_notice.png';

@ -166,6 +166,9 @@ class _Manager {
///
String get articleBorrowGoods => '/user/articleBorrow/borrow';
///id
String get articleReturnList => '/articleBorrow/findBorrowByUserId';
///list
String get dailyPaymentList => '/user/dailyPayment/list';

@ -0,0 +1,80 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/pages/home/home_page.dart';
import 'package:akuCommunity/widget/bee_scaffold.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';
import 'package:akuCommunity/const/resource.dart';
class BorrowFinshPage extends StatefulWidget {
final bool isSuccess;
final String failText;
BorrowFinshPage({Key key, this.isSuccess, this.failText}) : super(key: key);
@override
_BorrowFinshPageState createState() => _BorrowFinshPageState();
}
class _BorrowFinshPageState extends State<BorrowFinshPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '出借结果',
body: Center(
child: Column(
children: [
75.w.heightBox,
SizedBox(
width: 110.w,
height: 110.w,
child: Image.asset(widget.isSuccess
? R.ASSETS_ICONS_BORROW_SUCCESS_PNG
: R.ASSETS_ICONS_BORROW_FAILURE_PNG),
),
48.w.heightBox,
'${widget.isSuccess ? '出借成功' : '出借失败'}'
.text
.color(ktextPrimary)
.size(36.sp)
.bold
.make(),
16.w.heightBox,
'${widget.isSuccess ? '使用后请记得归还' : widget.failText}'
.text
.color(ktextSubColor)
.size(26.sp)
.make(),
95.w.heightBox,
MaterialButton(
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w)),
elevation: 0,
hoverElevation: 0,
highlightElevation: 0,
focusElevation: 0,
disabledElevation: 0,
padding: EdgeInsets.symmetric(vertical: 24.w),
minWidth: double.infinity,
onPressed: widget.isSuccess
? () {
Get.offAll(HomePage());
}
: () {
Get.back();
},
child: '${widget.isSuccess ? '返回首页' : '重新提交'}'
.text
.color(widget.isSuccess ? ktextPrimary : Colors.white)
.size(36.sp)
.make(),
)
],
),
).pSymmetric(
h: 24.w,
),
);
}
}

@ -2,7 +2,8 @@ import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:akuCommunity/model/manager/article_borrow_model.dart';
import 'package:akuCommunity/pages/goods_manage_page/borrow_goods_detail_page.dart';
import 'package:akuCommunity/pages/goods_manage_page/borrow/borrow_finsh_page.dart';
import 'package:akuCommunity/pages/goods_manage_page/borrow/borrow_goods_detail_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
@ -94,10 +95,11 @@ class _BorrowGoodsPageState extends State<BorrowGoodsPage> {
BaseModel baseModel = await NetUtil().post(
API.manager.articleBorrowGoods,
params: {"ids": _submitIds},
showMessage: true);
if (baseModel.status) {
Get.back();
}
showMessage: false);
Get.to(BorrowFinshPage(
isSuccess: baseModel.status,
failText: baseModel.message,
));
},
child: '借出'.text.black.size(32.sp).bold.make(),
),

Loading…
Cancel
Save