|
|
@ -4,8 +4,11 @@ import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import '../../generated/l10n.dart'; |
|
|
|
|
|
|
|
import '../../view_widget/border_text.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'; |
|
|
|
|
|
|
|
import '../../view_widget/round_button.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class RequestRefund extends StatefulWidget { |
|
|
|
class RequestRefund extends StatefulWidget { |
|
|
|
@override |
|
|
|
@override |
|
|
@ -16,16 +19,42 @@ class RequestRefund extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
|
|
class _RequestRefund extends State<RequestRefund> { |
|
|
|
class _RequestRefund extends State<RequestRefund> { |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
|
|
|
final TextEditingController modifyAmountController = TextEditingController(); |
|
|
|
|
|
|
|
FocusNode _focusNode = FocusNode(); |
|
|
|
|
|
|
|
bool isKeyBoardShow = false; |
|
|
|
|
|
|
|
int modifyAmountState = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
print("object: ${MediaQuery.of(context).viewInsets.bottom}"); |
|
|
|
|
|
|
|
if (MediaQuery.of(context).viewInsets.bottom == 0) { |
|
|
|
|
|
|
|
if (isKeyBoardShow) { |
|
|
|
|
|
|
|
isKeyBoardShow = false; |
|
|
|
|
|
|
|
//关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 |
|
|
|
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
isKeyBoardShow = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///离开页面记着销毁和清除 |
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void dispose() { |
|
|
|
|
|
|
|
_focusNode.unfocus(); |
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return |
|
|
|
return |
|
|
|
Scaffold( |
|
|
|
Scaffold( |
|
|
|
|
|
|
|
resizeToAvoidBottomInset: false, |
|
|
|
backgroundColor: Color(0xFFF8F8FA), |
|
|
|
backgroundColor: Color(0xFFF8F8FA), |
|
|
|
appBar: MyAppBar( |
|
|
|
appBar: MyAppBar( |
|
|
|
title: "申请退款", |
|
|
|
title: "申请退款", |
|
|
@ -34,72 +63,251 @@ class _RequestRefund extends State<RequestRefund> { |
|
|
|
leadingColor: Colors.black, |
|
|
|
leadingColor: Colors.black, |
|
|
|
brightness: Brightness.dark, |
|
|
|
brightness: Brightness.dark, |
|
|
|
), |
|
|
|
), |
|
|
|
body: SmartRefresher( |
|
|
|
body: Container( |
|
|
|
controller: refreshController, |
|
|
|
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), |
|
|
|
enablePullDown: true, |
|
|
|
child:Column( |
|
|
|
enablePullUp: false, |
|
|
|
children: [ |
|
|
|
header: MyHeader( |
|
|
|
Container( |
|
|
|
color: Colors.white, |
|
|
|
decoration: BoxDecoration( |
|
|
|
), |
|
|
|
color: Colors.white, |
|
|
|
footer: CustomFooter( |
|
|
|
borderRadius: BorderRadius.circular(8.w), |
|
|
|
builder: (context, mode) { |
|
|
|
boxShadow: [ |
|
|
|
return MyFooter(mode); |
|
|
|
BoxShadow( |
|
|
|
}, |
|
|
|
color: Color(0x0F06152E).withAlpha(12), |
|
|
|
), |
|
|
|
offset: Offset(0, 2), |
|
|
|
onRefresh: () { |
|
|
|
blurRadius: 4, |
|
|
|
}, |
|
|
|
spreadRadius: 0, |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
), |
|
|
|
scrollController: ScrollController(), |
|
|
|
], |
|
|
|
child: SingleChildScrollView( |
|
|
|
), |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), |
|
|
|
child:Container( |
|
|
|
child: Column( |
|
|
|
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), |
|
|
|
children: [ |
|
|
|
child:Column( |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
width: 2.w, |
|
|
|
color: Colors.white, |
|
|
|
height: 16.h, |
|
|
|
borderRadius: BorderRadius.circular(8.w), |
|
|
|
color: Color(0xFF30415B), |
|
|
|
boxShadow: [ |
|
|
|
margin: EdgeInsets.only(right:6.w), |
|
|
|
BoxShadow( |
|
|
|
), |
|
|
|
color: Color(0x0F06152E).withAlpha(12), |
|
|
|
Text( |
|
|
|
offset: Offset(0, 2), |
|
|
|
"申请金额", |
|
|
|
blurRadius: 4, |
|
|
|
style: TextStyle( |
|
|
|
spreadRadius: 0, |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), |
|
|
|
SizedBox(height:32.h,), |
|
|
|
child: Column( |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
if(modifyAmountState == 0) |
|
|
|
children: [ |
|
|
|
Expanded(child:Text.rich( |
|
|
|
Container( |
|
|
|
TextSpan( |
|
|
|
width: 2.w, |
|
|
|
children: [ |
|
|
|
height: 16.h, |
|
|
|
TextSpan( |
|
|
|
color: Color(0xFF30415B), |
|
|
|
text: "¥", |
|
|
|
margin: EdgeInsets.only(right:6.w), |
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 24.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
TextSpan( |
|
|
|
|
|
|
|
text: "1112.33", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 24.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
)), |
|
|
|
"申请金额", |
|
|
|
if(modifyAmountState == 1) |
|
|
|
style: TextStyle( |
|
|
|
Text( |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
"¥", |
|
|
|
fontSize: 16.sp, |
|
|
|
style: TextStyle( |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 24.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if(modifyAmountState == 1) |
|
|
|
|
|
|
|
Expanded(child: TextField( |
|
|
|
|
|
|
|
controller: modifyAmountController, |
|
|
|
|
|
|
|
decoration: InputDecoration( |
|
|
|
|
|
|
|
hintText: "请输入修改金额", |
|
|
|
|
|
|
|
hintStyle: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
border: InputBorder.none, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
keyboardType: TextInputType.phone, |
|
|
|
), |
|
|
|
style: TextStyle( |
|
|
|
SizedBox(height:33.h,), |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 24.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
),), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
// showModifyAmountDialog(); |
|
|
|
|
|
|
|
setState((){ |
|
|
|
|
|
|
|
modifyAmountState = 1; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Image.asset( |
|
|
|
|
|
|
|
"assets/image/bs_edit.webp", |
|
|
|
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
|
|
|
width:16, |
|
|
|
|
|
|
|
height:16, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox(width: 4.w,), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"修改金额", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF7A797F), |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
], |
|
|
|
height: 1.h, |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
color: Color(0xFFEBECEF), |
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom: 50.h), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Spacer(), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
showModifyAmountDialog(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
width: double.infinity, |
|
|
|
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom:55.h,top: 125.h), |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical:16.h), |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(27), |
|
|
|
|
|
|
|
color: Color(0xFF30415B) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
child: Text( |
|
|
|
|
|
|
|
"确定退款", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
color: Colors.white, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///修改金额提示 |
|
|
|
|
|
|
|
showModifyAmountDialog() { |
|
|
|
|
|
|
|
showDialog( |
|
|
|
|
|
|
|
context: context, |
|
|
|
|
|
|
|
builder: (context) { |
|
|
|
|
|
|
|
return AlertDialog( |
|
|
|
|
|
|
|
content: Container( |
|
|
|
|
|
|
|
width: MediaQuery.of(context).size.width - 84, |
|
|
|
|
|
|
|
height: 139.h, |
|
|
|
|
|
|
|
child: Column( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"申请退款", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 15.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"此操作将进行退款申请,是否继续?", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFFF4524D), |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 35.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded( |
|
|
|
|
|
|
|
child: InkWell( |
|
|
|
|
|
|
|
child: BorderText( |
|
|
|
|
|
|
|
text: S.of(context).quxiao, |
|
|
|
|
|
|
|
textColor: Color(0xFF30415B), |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
borderColor: Color(0xFF30415B), |
|
|
|
|
|
|
|
radius: 4, |
|
|
|
|
|
|
|
padding: EdgeInsets.all(12), |
|
|
|
|
|
|
|
borderWidth: 1, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
flex: 1, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 16.w, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Expanded( |
|
|
|
|
|
|
|
child: InkWell( |
|
|
|
|
|
|
|
child: RoundButton( |
|
|
|
|
|
|
|
text: S.of(context).queren, |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
radius: 4, |
|
|
|
|
|
|
|
padding: EdgeInsets.all(12), |
|
|
|
|
|
|
|
backgroup: Color(0xFF30415B), |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
flex: 1, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|