diff --git a/lib/business_system/goods/on_sale/edit_assort.dart b/lib/business_system/goods/on_sale/edit_assort.dart index c8f75a1a..7a4134f9 100644 --- a/lib/business_system/goods/on_sale/edit_assort.dart +++ b/lib/business_system/goods/on_sale/edit_assort.dart @@ -17,149 +17,170 @@ class _EditAssort extends State { final RefreshController refreshController = RefreshController(); final TextEditingController editingSortController = TextEditingController(); final TextEditingController editingNameController = TextEditingController(); + FocusNode _focusNode = FocusNode(); + bool isKeyBoardShow = false; @override void 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 Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.white, - appBar: MyAppBar( - title: "编辑分类", - titleColor: Colors.black, - background: Colors.white, - leadingColor: Colors.black, - brightness: Brightness.dark, - ), - body:Container( - margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), - child: Column( - children: [ - Row( - children: [ - Expanded(child: - Text( - "分组排序", - style: TextStyle( - color: Color(0xFF30415B), - fontSize: 16.sp, - fontWeight: FontWeight.w500, - ), - ),), - 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, + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( + backgroundColor: Colors.white, + appBar: MyAppBar( + title: "编辑分类", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body:Container( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Row( + children: [ + Expanded(child: + Text( + "分组排序", style: TextStyle( - color: Color(0xFF7A797F), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, ), - ), - ), - ], - ), - Container( - height: 1.h, - width: double.infinity, - color: Color(0xFFEBEBEB) , - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded(child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: "*", - style: TextStyle( - color: Color(0xFFE02020), - fontSize: 16.sp, - fontWeight: FontWeight.w500, + ),), + 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), ), - TextSpan( - text: "分类名称", - style: TextStyle( - color: Color(0xFF30415B), - fontSize: 16.sp, - fontWeight: FontWeight.w500, - ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold ), - ], + ), ), - ),), - Expanded( - child: TextField( - controller: editingNameController, - decoration: InputDecoration( - hintText: "请输入分类名称", - hintTextDirection: TextDirection.rtl, - hintStyle: TextStyle( + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB) , + ), + 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), fontSize: 14.sp, 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( - 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), - ), + ], + ), + Container( + height: 1.h, 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, + 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, + 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, + ), ), ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index db7ee797..d5b624eb 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -146,7 +146,7 @@ class _BusinessMinePage extends State ///常用功能 Widget commonFunctions() { 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( children: [ Row( @@ -181,13 +181,13 @@ class _BusinessMinePage extends State color: Color(0xFFEBECEF), margin: EdgeInsets.only(left:32.w,bottom:12.h), ), - commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(left:32.w,bottom:12.h), - ), + // commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""), + // Container( + // width: double.infinity, + // height: 1.h, + // color: Color(0xFFEBECEF), + // margin: EdgeInsets.only(left:32.w,bottom:12.h), + // ), GestureDetector( behavior: HitTestBehavior.opaque, onTap: (){ diff --git a/lib/business_system/mine/merchant_info.dart b/lib/business_system/mine/merchant_info.dart index 253f446a..97ae9a36 100644 --- a/lib/business_system/mine/merchant_info.dart +++ b/lib/business_system/mine/merchant_info.dart @@ -16,7 +16,7 @@ class MerchantInfo extends StatefulWidget { class _MerchantInfo extends State { final RefreshController refreshController = RefreshController(); - bool checkState = false; + int checkIndex = 0; @override void initState() { @@ -51,117 +51,146 @@ class _MerchantInfo extends State { }, physics: BouncingScrollPhysics(), scrollController: ScrollController(), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child:Container( - margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), - child:Column( - children: [ - 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: [ - textItem("店铺名称","134****7777"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) - ), - textItem("经营类目","奶"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) - ), - textItem("所在地区","湖北省武汉市武昌区"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) - ), - textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) - ), - textItem("负责人电话","1122334444"), - Container( - width: double.infinity, - height: 1.h, - color: Color(0xFFEBECEF), - margin: EdgeInsets.only(top:2.h,bottom: 16.h) - ), - Row( - children: [ - Expanded(child:Text( - "是否在平台展示", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF808080), - fontWeight: MyFontWeight.medium),)), - Checkbox( - value: checkState, - onChanged: (a) { - setState(() { - checkState = !checkState; - }); - }, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(2.0), - ), - checkColor: Color(0xFFFFFFFF), - fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + child: Container( + margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), + child:Column( + children: [ + 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,bottom:44.h), + child: Column( + children: [ + textItem("店铺名称","134****7777"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("经营类目","奶"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("所在地区","湖北省武汉市武昌区"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("负责人电话","1122334444"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + Row( + children: [ + Expanded(child:Text( + "是否在平台展示", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF808080), + fontWeight: MyFontWeight.medium),)), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + checkIndex = 0; + }); + }, + child: Row( + children: [ + Image.asset( + checkIndex == 0? + "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox(width:5.w,), + Text( + "是", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),), + ], ), - Text( - "是", - style: TextStyle( - fontSize: 14.sp, - color: Color(0xFF1A1A1A), - fontWeight: MyFontWeight.medium),), - SizedBox(width: 36.w,), - Checkbox( - value: checkState, - onChanged: (a) { - setState(() { - checkState = !checkState; - }); - }, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(2.0), - ), - checkColor: Color(0xFFFFFFFF), - fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + SizedBox(width: 36.w,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + checkIndex = 1; + });}, + child: Row( + children: [ + Image.asset( + checkIndex == 1? + "assets/image/bs_check.webp":"assets/image/bs_uncheck.webp", + width: 16, + height: 16, + fit: BoxFit.cover, + ), + SizedBox(width:5.w,), + 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, ), ), - ], - ), + ) + ], ), ), ), diff --git a/lib/business_system/mine/security_setting.dart b/lib/business_system/mine/security_setting.dart index 4ca9735e..54bef572 100644 --- a/lib/business_system/mine/security_setting.dart +++ b/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:flutter_screenutil/flutter_screenutil.dart'; +import '../../utils/font_weight.dart'; import '../../view_widget/classic_header.dart'; import '../../view_widget/my_footer.dart'; @@ -15,19 +16,50 @@ class SecuritySetting extends StatefulWidget { class _SecuritySetting extends State { final RefreshController refreshController = RefreshController(); + int pageState = 1; + final TextEditingController newPasswordController = TextEditingController(); + final TextEditingController oldPasswordController = TextEditingController(); + FocusNode _focusNode = FocusNode(); + bool isKeyBoardShow = false; @override void 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 Widget build(BuildContext context) { - return - Scaffold( + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( backgroundColor: Color(0xFFF8F8FA), appBar: MyAppBar( - title: "安全设置", + title: pageState == 1 ?"安全设置": "修改登录密码", titleColor: Colors.black, background: Colors.white, leadingColor: Colors.black, @@ -55,13 +87,215 @@ class _SecuritySetting extends State { margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), child:Column( 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), + ), + ], + ), ); } + } diff --git a/lib/business_system/order/request_refund.dart b/lib/business_system/order/request_refund.dart index 2018e174..08565a4e 100644 --- a/lib/business_system/order/request_refund.dart +++ b/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:flutter_screenutil/flutter_screenutil.dart'; +import '../../generated/l10n.dart'; +import '../../view_widget/border_text.dart'; import '../../view_widget/classic_header.dart'; import '../../view_widget/my_footer.dart'; +import '../../view_widget/round_button.dart'; class RequestRefund extends StatefulWidget { @override @@ -16,16 +19,42 @@ class RequestRefund extends StatefulWidget { class _RequestRefund extends State { final RefreshController refreshController = RefreshController(); + final TextEditingController modifyAmountController = TextEditingController(); + FocusNode _focusNode = FocusNode(); + bool isKeyBoardShow = false; + int modifyAmountState = 0; @override void 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 Widget build(BuildContext context) { return Scaffold( + resizeToAvoidBottomInset: false, backgroundColor: Color(0xFFF8F8FA), appBar: MyAppBar( title: "申请退款", @@ -34,72 +63,251 @@ class _RequestRefund extends State { leadingColor: Colors.black, brightness: Brightness.dark, ), - body: SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader( - color: Colors.white, - ), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: () { - }, - physics: BouncingScrollPhysics(), - scrollController: ScrollController(), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child:Container( - margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), - child:Column( - children: [ - 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, + body: Container( + margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w), + child:Column( + children: [ + 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: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:6.w), + ), + Text( + "申请金额", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), ), ], ), - padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), - child: Column( + SizedBox(height:32.h,), + Row( children: [ - Row( - children: [ - Container( - width: 2.w, - height: 16.h, - color: Color(0xFF30415B), - margin: EdgeInsets.only(right:6.w), + if(modifyAmountState == 0) + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + 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( - "申请金额", - style: TextStyle( - color: Color(0xFF0D0D0D), - fontSize: 16.sp, - fontWeight: MyFontWeight.semi_bold, + )), + if(modifyAmountState == 1) + Text( + "¥", + style: TextStyle( + 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, ), - ], - ), - SizedBox(height:33.h,), + keyboardType: TextInputType.phone, + style: TextStyle( + 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, + ), + ], + ) + ], + ), + ), + ); + }, + ); + } + }