Browse Source

时间选择器待改

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

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

@ -17,16 +17,36 @@ class _EditAssort extends State<EditAssort> {
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(
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
backgroundColor: Colors.white,
appBar: MyAppBar(
title: "编辑分类",
@ -162,6 +182,7 @@ class _EditAssort extends State<EditAssort> {
],
),
),
),
);
}
}

16
lib/business_system/mine/business_mine_page.dart

@ -146,7 +146,7 @@ class _BusinessMinePage extends State<BusinessMinePage>
///
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<BusinessMinePage>
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: (){

89
lib/business_system/mine/merchant_info.dart

@ -16,7 +16,7 @@ class MerchantInfo extends StatefulWidget {
class _MerchantInfo extends State<MerchantInfo> {
final RefreshController refreshController = RefreshController();
bool checkState = false;
int checkIndex = 0;
@override
void initState() {
@ -51,9 +51,7 @@ class _MerchantInfo extends State<MerchantInfo> {
},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:Container(
child: Container(
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w),
child:Column(
children: [
@ -70,7 +68,7 @@ class _MerchantInfo extends State<MerchantInfo> {
),
],
),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,),
padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,bottom:44.h),
child: Column(
children: [
textItem("店铺名称","134****7777"),
@ -116,53 +114,84 @@ class _MerchantInfo extends State<MerchantInfo> {
fontSize: 14.sp,
color: Color(0xFF808080),
fontWeight: MyFontWeight.medium),)),
Checkbox(
value: checkState,
onChanged: (a) {
setState(() {
checkState = !checkState;
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
setState((){
checkIndex = 0;
});
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(2.0),
),
checkColor: Color(0xFFFFFFFF),
fillColor:MaterialStateProperty.all(Color(0xFF30415B)),
),
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),),
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),),
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: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<SecuritySetting> {
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<SecuritySetting> {
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),
),
],
),
);
}
}

248
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<RequestRefund> {
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,25 +63,7 @@ class _RequestRefund extends State<RequestRefund> {
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(
body: Container(
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w),
child:Column(
children: [
@ -90,15 +101,212 @@ class _RequestRefund extends State<RequestRefund> {
),
],
),
SizedBox(height:33.h,),
SizedBox(height:32.h,),
Row(
children: [
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,
),
),
],
),
)),
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,
),
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,
),
],
)
],
),
),
);
},
);
}

Loading…
Cancel
Save