Browse Source

时间选择器待改

wr_2023_business
wurong 2 years ago
parent
commit
e7f2e2e198
  1. 259
      lib/business_system/goods/on_sale/edit_assort.dart
  2. 16
      lib/business_system/mine/business_mine_page.dart
  3. 245
      lib/business_system/mine/merchant_info.dart
  4. 240
      lib/business_system/mine/security_setting.dart
  5. 314
      lib/business_system/order/request_refund.dart

259
lib/business_system/goods/on_sale/edit_assort.dart

@ -17,149 +17,170 @@ class _EditAssort extends State<EditAssort> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final TextEditingController editingSortController = TextEditingController(); final TextEditingController editingSortController = TextEditingController();
final TextEditingController editingNameController = TextEditingController(); final TextEditingController editingNameController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
@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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return GestureDetector(
backgroundColor: Colors.white, behavior: HitTestBehavior.opaque,
appBar: MyAppBar( onTap: (){
title: "编辑分类", FocusScope.of(context).requestFocus(FocusNode());
titleColor: Colors.black, },
background: Colors.white, child: Scaffold(
leadingColor: Colors.black, backgroundColor: Colors.white,
brightness: Brightness.dark, appBar: MyAppBar(
), title: "编辑分类",
body:Container( titleColor: Colors.black,
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), background: Colors.white,
child: Column( leadingColor: Colors.black,
children: [ brightness: Brightness.dark,
Row( ),
children: [ body:Container(
Expanded(child: margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
Text( child: Column(
"分组排序", children: [
style: TextStyle( Row(
color: Color(0xFF30415B), children: [
fontSize: 16.sp, Expanded(child:
fontWeight: FontWeight.w500, Text(
), "分组排序",
),),
Expanded(
child: TextField(
controller: editingSortController,
decoration: InputDecoration(
hintText: "数字越大排名越靠前",
hintTextDirection: TextDirection.rtl,
hintStyle: TextStyle(
color: Color(0xFF7A797F),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left:16.w),
),
textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
color: Color(0xFF7A797F), color: Color(0xFF30415B),
fontSize: 14.sp, fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold fontWeight: FontWeight.w500,
), ),
), ),),
), Expanded(
], child: TextField(
), controller: editingSortController,
Container( decoration: InputDecoration(
height: 1.h, hintText: "数字越大排名越靠前",
width: double.infinity, hintTextDirection: TextDirection.rtl,
color: Color(0xFFEBEBEB) , hintStyle: TextStyle(
), color: Color(0xFF7A797F),
Row( fontSize: 14.sp,
mainAxisAlignment: MainAxisAlignment.center, fontWeight: MyFontWeight.semi_bold,
children: [
Expanded(child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "*",
style: TextStyle(
color: Color(0xFFE02020),
fontSize: 16.sp,
fontWeight: FontWeight.w500,
), ),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left:16.w),
), ),
TextSpan( textAlign: TextAlign.right,
text: "分类名称", style: TextStyle(
style: TextStyle( color: Color(0xFF7A797F),
color: Color(0xFF30415B), fontSize: 14.sp,
fontSize: 16.sp, fontWeight: MyFontWeight.semi_bold
fontWeight: FontWeight.w500,
),
), ),
], ),
), ),
),), ],
Expanded( ),
child: TextField( Container(
controller: editingNameController, height: 1.h,
decoration: InputDecoration( width: double.infinity,
hintText: "请输入分类名称", color: Color(0xFFEBEBEB) ,
hintTextDirection: TextDirection.rtl, ),
hintStyle: TextStyle( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Text.rich(
TextSpan(
children: [
TextSpan(
text: "*",
style: TextStyle(
color: Color(0xFFE02020),
fontSize: 16.sp,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: "分类名称",
style: TextStyle(
color: Color(0xFF30415B),
fontSize: 16.sp,
fontWeight: FontWeight.w500,
),
),
],
),
),),
Expanded(
child: TextField(
controller: editingNameController,
decoration: InputDecoration(
hintText: "请输入分类名称",
hintTextDirection: TextDirection.rtl,
hintStyle: TextStyle(
color: Color(0xFF7A797F),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xFF7A797F), color: Color(0xFF7A797F),
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold fontWeight: MyFontWeight.semi_bold
), ),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
textAlign: TextAlign.right,
style: TextStyle(
color: Color(0xFF7A797F),
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold
), ),
), ),
), ],
], ),
), Container(
Container( height: 1.h,
height: 1.h,
width: double.infinity,
color: Color(0xFFEBEBEB) ,
margin: EdgeInsets.only(bottom: 16.h),
),
Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
Navigator.pop(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B),
),
width: double.infinity, width: double.infinity,
alignment: Alignment.center, color: Color(0xFFEBEBEB) ,
padding: EdgeInsets.symmetric(vertical:16.h), margin: EdgeInsets.only(bottom: 16.h),
margin: EdgeInsets.only(bottom:34.h), ),
child:Text( Spacer(),
S.of(context).baocun, GestureDetector(
style: TextStyle( behavior: HitTestBehavior.opaque,
color: Colors.white, onTap: (){
fontSize: 16.sp, Navigator.pop(context);
fontWeight: FontWeight.bold, },
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(27),
color: Color(0xFF30415B),
),
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical:16.h),
margin: EdgeInsets.only(bottom:34.h),
child:Text(
S.of(context).baocun,
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
), ),
), ),
), ),
), ],
], ),
), ),
), ),
); );

16
lib/business_system/mine/business_mine_page.dart

@ -146,7 +146,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
/// ///
Widget commonFunctions() { Widget commonFunctions() {
return Container( return Container(
margin: EdgeInsets.only(top:26.h, left: 16.w, right:17.w,bottom: 43.h), margin: EdgeInsets.only(top:26.h, left: 16.w, right:17.w,bottom:23.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -181,13 +181,13 @@ class _BusinessMinePage extends State<BusinessMinePage>
color: Color(0xFFEBECEF), color: Color(0xFFEBECEF),
margin: EdgeInsets.only(left:32.w,bottom:12.h), margin: EdgeInsets.only(left:32.w,bottom:12.h),
), ),
commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""), // commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""),
Container( // Container(
width: double.infinity, // width: double.infinity,
height: 1.h, // height: 1.h,
color: Color(0xFFEBECEF), // color: Color(0xFFEBECEF),
margin: EdgeInsets.only(left:32.w,bottom:12.h), // margin: EdgeInsets.only(left:32.w,bottom:12.h),
), // ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: (){ onTap: (){

245
lib/business_system/mine/merchant_info.dart

@ -16,7 +16,7 @@ class MerchantInfo extends StatefulWidget {
class _MerchantInfo extends State<MerchantInfo> { class _MerchantInfo extends State<MerchantInfo> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
bool checkState = false; int checkIndex = 0;
@override @override
void initState() { void initState() {
@ -51,117 +51,146 @@ class _MerchantInfo extends State<MerchantInfo> {
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: ScrollController(), scrollController: ScrollController(),
child: SingleChildScrollView( child: Container(
physics: BouncingScrollPhysics(), margin: EdgeInsets.only(top: 24.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( Container(
children: [ decoration: BoxDecoration(
Container( color: Colors.white,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.w),
color: Colors.white, boxShadow: [
borderRadius: BorderRadius.circular(8.w), BoxShadow(
boxShadow: [ color: Color(0x0F06152E).withAlpha(12),
BoxShadow( offset: Offset(0, 2),
color: Color(0x0F06152E).withAlpha(12), blurRadius: 4,
offset: Offset(0, 2), spreadRadius: 0,
blurRadius: 4, ),
spreadRadius: 0, ],
), ),
], padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,bottom:44.h),
), child: Column(
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), children: [
child: Column( textItem("店铺名称","134****7777"),
children: [ Container(
textItem("店铺名称","134****7777"), width: double.infinity,
Container( height: 1.h,
width: double.infinity, color: Color(0xFFEBECEF),
height: 1.h, margin: EdgeInsets.only(top:2.h,bottom: 16.h)
color: Color(0xFFEBECEF), ),
margin: EdgeInsets.only(top:2.h,bottom: 16.h) textItem("经营类目",""),
), Container(
textItem("经营类目",""), width: double.infinity,
Container( height: 1.h,
width: double.infinity, color: Color(0xFFEBECEF),
height: 1.h, margin: EdgeInsets.only(top:2.h,bottom: 16.h)
color: Color(0xFFEBECEF), ),
margin: EdgeInsets.only(top:2.h,bottom: 16.h) textItem("所在地区","湖北省武汉市武昌区"),
), Container(
textItem("所在地区","湖北省武汉市武昌区"), width: double.infinity,
Container( height: 1.h,
width: double.infinity, color: Color(0xFFEBECEF),
height: 1.h, margin: EdgeInsets.only(top:2.h,bottom: 16.h)
color: Color(0xFFEBECEF), ),
margin: EdgeInsets.only(top:2.h,bottom: 16.h) textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"),
), Container(
textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"), width: double.infinity,
Container( height: 1.h,
width: double.infinity, color: Color(0xFFEBECEF),
height: 1.h, margin: EdgeInsets.only(top:2.h,bottom: 16.h)
color: Color(0xFFEBECEF), ),
margin: EdgeInsets.only(top:2.h,bottom: 16.h) textItem("负责人电话","1122334444"),
), Container(
textItem("负责人电话","1122334444"), width: double.infinity,
Container( height: 1.h,
width: double.infinity, color: Color(0xFFEBECEF),
height: 1.h, margin: EdgeInsets.only(top:2.h,bottom: 16.h)
color: Color(0xFFEBECEF), ),
margin: EdgeInsets.only(top:2.h,bottom: 16.h) Row(
), children: [
Row( Expanded(child:Text(
children: [ "是否在平台展示",
Expanded(child:Text( style: TextStyle(
"是否在平台展示", fontSize: 14.sp,
style: TextStyle( color: Color(0xFF808080),
fontSize: 14.sp, fontWeight: MyFontWeight.medium),)),
color: Color(0xFF808080), GestureDetector(
fontWeight: MyFontWeight.medium),)), behavior: HitTestBehavior.opaque,
Checkbox( onTap: (){
value: checkState, setState((){
onChanged: (a) { checkIndex = 0;
setState(() { });
checkState = !checkState; },
}); child: Row(
}, children: [
shape: RoundedRectangleBorder( Image.asset(
borderRadius: BorderRadius.circular(2.0), checkIndex == 0?
), "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp",
checkColor: Color(0xFFFFFFFF), width: 16,
fillColor:MaterialStateProperty.all(Color(0xFF30415B)), height: 16,
fit: BoxFit.cover,
),
SizedBox(width:5.w,),
Text(
"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.medium),),
],
), ),
Text( ),
"", SizedBox(width: 36.w,),
style: TextStyle( GestureDetector(
fontSize: 14.sp, behavior: HitTestBehavior.opaque,
color: Color(0xFF1A1A1A), onTap: (){
fontWeight: MyFontWeight.medium),), setState((){
SizedBox(width: 36.w,), checkIndex = 1;
Checkbox( });},
value: checkState, child: Row(
onChanged: (a) { children: [
setState(() { Image.asset(
checkState = !checkState; checkIndex == 1?
}); "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp",
}, width: 16,
shape: RoundedRectangleBorder( height: 16,
borderRadius: BorderRadius.circular(2.0), fit: BoxFit.cover,
), ),
checkColor: Color(0xFFFFFFFF), SizedBox(width:5.w,),
fillColor:MaterialStateProperty.all(Color(0xFF30415B)), Text(
"",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.medium),)
],
), ),
Text( ),
"", ],
style: TextStyle( ),
fontSize: 14.sp, ],
color: Color(0xFF1A1A1A), ),
fontWeight: MyFontWeight.medium),), ),
], Spacer(),
), 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,
), ),
), ),
], )
), ],
), ),
), ),
), ),

240
lib/business_system/mine/security_setting.dart

@ -3,6 +3,7 @@ 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 '../../utils/font_weight.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';
@ -15,19 +16,50 @@ class SecuritySetting extends StatefulWidget {
class _SecuritySetting extends State<SecuritySetting> { class _SecuritySetting extends State<SecuritySetting> {
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
int pageState = 1;
final TextEditingController newPasswordController = TextEditingController();
final TextEditingController oldPasswordController = TextEditingController();
FocusNode _focusNode = FocusNode();
bool isKeyBoardShow = false;
@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 GestureDetector(
Scaffold( behavior: HitTestBehavior.opaque,
onTap: (){
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
backgroundColor: Color(0xFFF8F8FA), backgroundColor: Color(0xFFF8F8FA),
appBar: MyAppBar( appBar: MyAppBar(
title: "安全设置", title: pageState == 1 ?"安全设置": "修改登录密码",
titleColor: Colors.black, titleColor: Colors.black,
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
@ -55,13 +87,215 @@ class _SecuritySetting extends State<SecuritySetting> {
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w),
child:Column( child:Column(
children: [ children: [
if(pageState == 1)
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
boxShadow: [
BoxShadow(
color: Color(0x0F06152E).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
child: Column(
children: [
Row(
children: [
Expanded(child:Text(
"登录手机号",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),)),
Text(
"134****7777",
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.medium),),
],
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(top:16.h,bottom: 16.h),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
pageState = 2;
});
},
child: Row(
children: [
Expanded(child:Text(
"修改登录密码",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),)),
Image.asset(
"assets/image/icon_right_z.webp",
width: 16,
height:16,
color: Color(0xFF353535),
),
],
),
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(top:16.h,bottom: 16.h),
),
],
),
),
if(pageState == 2)
changePassword(),
if(pageState == 2)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
pageState = 1;
});
},
child: Container(
width: double.infinity,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom:55.h,top: 36.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,
),
),
),
)
], ],
), ),
), ),
), ),
), ),
),
);
}
Widget changePassword(){
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
boxShadow: [
BoxShadow(
color: Color(0x0F06152E).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
child: Column(
children: [
Row(
children: [
Text(
"旧密码",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),),
Expanded(
child: TextField(
controller: oldPasswordController,
decoration: InputDecoration(
hintText: "请输入旧密码",
hintStyle: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
keyboardType: TextInputType.phone,
style: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
),
),
],
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(bottom: 16.h),
),
Row(
children: [
Text(
"新密码",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),),
Expanded(
child: TextField(
controller: newPasswordController,
decoration: InputDecoration(
hintText: "请输入新密码",
hintStyle: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
border: InputBorder.none,
contentPadding: EdgeInsets.only(left: 16.w),
),
keyboardType: TextInputType.phone,
style: TextStyle(
color: Color(0xFF808080),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular
),
),
),
],
),
Container(
height: 1.h,
width: double.infinity,
color: Color(0xFFEBECEF),
margin: EdgeInsets.only(bottom: 16.h),
),
],
),
); );
} }
} }

314
lib/business_system/order/request_refund.dart

@ -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,
),
],
)
],
),
),
);
},
);
}
} }

Loading…
Cancel
Save