You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/pages/personal/refund_apply_page.dart

229 lines
6.7 KiB

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/utils/screenutil.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/routers/page_routers.dart';
import 'widget/refund_shop_card.dart';
import 'widget/refund_tile_card.dart';
class RefundApplyPage extends StatefulWidget {
final Bundle bundle;
RefundApplyPage({Key key, this.bundle}) : super(key: key);
@override
_RefundApplyPageState createState() => _RefundApplyPageState();
}
class _RefundApplyPageState extends State<RefundApplyPage> {
TextEditingController _refundContent = new TextEditingController();
String hintText = '选填';
AppBar _appBar() {
return AppBar(
elevation: 0,
backgroundColor: BaseStyle.colorffd000,
leading: IconButton(
icon: Icon(AntDesign.left, size: 40.sp),
onPressed: () {
Navigator.pop(context);
},
),
centerTitle: true,
title: Text(
'申请退款',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize32,
color: BaseStyle.color333333,
),
),
);
}
Container _containerContentList(List<Map<String, dynamic>> listContent) {
return Container(
child: Column(
children: listContent
.map((item) => RefundShopCard(
imagePath: item['imagePath'],
content: item['content'],
specs: item['specs'],
))
.toList(),
),
);
}
Container _containerRefundPrice(double payPrice) {
return Container(
padding: EdgeInsets.only(
top: 22.w,
left: 32.w,
right: 32.w,
),
color: Colors.white,
child: Container(
padding: EdgeInsets.only(bottom: 26.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'退款金额',
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,
),
),
Text(
'${payPrice}',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: BaseStyle.fontSize32,
color: BaseStyle.colorff8500,
),
),
],
),
),
);
}
Container _containerRefundTextField() {
return Container(
padding: EdgeInsets.only(
top: 22.w,
left: 32.w,
right: 32.w,
),
color: Colors.white,
child: Container(
padding: EdgeInsets.only(bottom: 26.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(color: BaseStyle.coloreeeeee, width: 0.5)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'退款说明',
style: TextStyle(
fontSize: BaseStyle.fontSize34,
color: BaseStyle.color333333,
),
),
SizedBox(height: 23.w),
TextFormField(
cursorColor: Color(0xffffc40c),
style: TextStyle(
fontSize: BaseStyle.fontSize34,
),
controller: _refundContent,
onChanged: (String value) {},
maxLines: 1,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.only(
top: 0.w,
bottom: 0.w,
),
hintText: hintText,
border: InputBorder.none, //去掉输入框的下滑线
fillColor: Colors.white,
filled: true,
hintStyle: TextStyle(
color: BaseStyle.color999999,
fontSize: BaseStyle.fontSize28,
fontWeight: FontWeight.normal,
),
),
),
],
),
),
);
}
InkWell _inkWellBottom() {
return InkWell(
onTap: () {},
child: Container(
alignment: Alignment.center,
color: BaseStyle.colorffc40c,
padding: EdgeInsets.symmetric(
vertical: 26.5.w,
),
child: Text(
'提交',
style: TextStyle(
fontSize: BaseStyle.fontSize32,
color: BaseStyle.color333333,
),
),
),
);
}
@override
Widget build(BuildContext context) {
double _statusHeight = MediaQuery.of(context).padding.top;
List<Map<String, dynamic>> _listTile = [
{'title': '退款原因', 'subtitle': '请选择', 'fun': null, 'isRight': true},
{'title': '退款方式', 'subtitle': '物业上门取件', 'fun': null, 'isRight': false}
];
return Scaffold(
appBar: _appBar(),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height -
kToolbarHeight -
_statusHeight,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Stack(
children: [
Column(
children: [
SizedBox(height: 24.w),
_containerContentList(
widget.bundle.getMap('details')['listContent'],
),
SizedBox(height: 24.w),
RefundTileCard(
listTile:
widget.bundle.getMap('details')['isRefundGood']
? _listTile
: _listTile.take(1).toList()),
_containerRefundPrice(
widget.bundle.getMap('details')['payPrice']),
SizedBox(height: 24.w),
_containerRefundTextField(),
],
),
Positioned(
bottom: 0,
child: Container(
alignment: Alignment.center,
height: 98.w,
width: MediaQuery.of(context).size.width,
child: Row(children: [Expanded(child: _inkWellBottom())]),
),
)
],
),
),
),
),
);
}
}