After Width: | Height: | Size: 718 B |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 922 B |
After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 668 B |
After Width: | Height: | Size: 996 B |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 928 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 964 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 888 B |
After Width: | Height: | Size: 896 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 940 B |
After Width: | Height: | Size: 626 B |
After Width: | Height: | Size: 672 B |
After Width: | Height: | Size: 648 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 632 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 606 B |
After Width: | Height: | Size: 622 B |
After Width: | Height: | Size: 590 B |
After Width: | Height: | Size: 670 B |
After Width: | Height: | Size: 632 B |
@ -0,0 +1,277 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import '../../view_widget/my_appbar.dart'; |
||||
|
||||
class GoodsSearchPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
GoodsSearchPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _GoodsSearchPage(); |
||||
} |
||||
} |
||||
|
||||
class _GoodsSearchPage extends State<GoodsSearchPage> |
||||
with WidgetsBindingObserver { |
||||
final TextEditingController editingController = TextEditingController(); |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
int optionIndex = 0; |
||||
bool isKeyBoardShow = false; |
||||
List<ProductListBean> productListBeans = []; |
||||
List<String> hotSearch = []; |
||||
List<String> historySearch = []; |
||||
FocusNode _focusNode = FocusNode(); |
||||
bool hasFocus = true; |
||||
int priceOrder = 0; |
||||
|
||||
@override |
||||
void didChangeMetrics() { |
||||
super.didChangeMetrics(); |
||||
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 |
||||
void initState() { |
||||
super.initState(); |
||||
_focusNode.addListener(() { |
||||
setState(() { |
||||
hasFocus = _focusNode.hasFocus; |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
_onRefresh() { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.translucent, |
||||
onTap: (){ |
||||
FocusScope.of(context).requestFocus(FocusNode()); |
||||
}, |
||||
child: Scaffold( |
||||
appBar: MyAppBar( |
||||
title: "搜索", |
||||
titleColor: Colors.black, |
||||
leadingColor: Colors.black, |
||||
background: Colors.white, |
||||
), |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Colors.white, |
||||
margin: EdgeInsets.only(bottom:16.h), |
||||
child: Container( |
||||
height: 40.h, |
||||
margin: EdgeInsets.only(left: 18.w,right: 18.w,top:17.h,bottom: 10.h), |
||||
padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF7F8FA), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
child: TextField( |
||||
focusNode: _focusNode, |
||||
textInputAction: TextInputAction.search, |
||||
onEditingComplete: () { |
||||
FocusScope.of(context).requestFocus(FocusNode()); |
||||
}, |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF808080), |
||||
), |
||||
controller: editingController, |
||||
decoration: InputDecoration( |
||||
hintText: "请输入搜索内容", |
||||
hintStyle: TextStyle( |
||||
color: Color(0xFF808080), |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
contentPadding: EdgeInsets.symmetric( |
||||
vertical: 12.h, |
||||
), |
||||
prefixIcon: Image.asset( |
||||
"assets/image/bs_goods_search.webp", |
||||
width: 20, |
||||
height: 20, |
||||
), |
||||
border: InputBorder.none, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
child: SmartRefresher( |
||||
controller:refreshController, |
||||
enablePullUp: false, |
||||
enablePullDown: true, |
||||
physics: BouncingScrollPhysics(), |
||||
header: MyHeader(), |
||||
onRefresh:(){ |
||||
_onRefresh(); |
||||
}, |
||||
child:ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: NeverScrollableScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: searchGoodsItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
),) |
||||
|
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget searchGoodsItem(){ |
||||
return Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
margin: EdgeInsets.only(bottom:12.h,left: 16.w,right: 16.w), |
||||
padding: EdgeInsets.only(left: 12.w,top: 12.h,bottom: 12.h,right:24.w), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 70, |
||||
height: 70, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox(width:12.w,), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), |
||||
child: Text( |
||||
"台湾甄选手抓饺子三生", |
||||
maxLines:1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF000000), |
||||
), |
||||
),), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"库存4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Text( |
||||
"销量4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF999999), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Row( |
||||
children: [ |
||||
Expanded(child:Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "19", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(33), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1, |
||||
), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:12.w), |
||||
child: Text( |
||||
"下架", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,291 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
|
||||
class OffShelfPage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _OffShelfPage(); |
||||
} |
||||
} |
||||
|
||||
class _OffShelfPage extends State<OffShelfPage> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
var checkStatus = false; |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async {} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
body: Stack( |
||||
alignment: Alignment.bottomCenter, |
||||
children: [ |
||||
Column( |
||||
children: [ |
||||
Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
goodsSearch(), |
||||
], |
||||
), |
||||
Expanded( |
||||
child: Container( |
||||
child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Container( |
||||
color: Colors.white, |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:5.w), |
||||
child: Row(children: [ |
||||
Checkbox( |
||||
value: checkStatus, |
||||
onChanged: (a) { |
||||
setState(() { |
||||
checkStatus = !checkStatus; |
||||
}); |
||||
}, |
||||
shape: RoundedRectangleBorder( |
||||
borderRadius: BorderRadius.circular(2.0), |
||||
), |
||||
checkColor: Color(0xFFFFFFFF), |
||||
fillColor: |
||||
MaterialStateProperty.all(Color(0xFF30415B)), |
||||
), |
||||
Text( |
||||
"全选", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF000000), |
||||
), |
||||
), |
||||
],),), |
||||
ListView.builder( |
||||
itemCount:15, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () {}, |
||||
child: shelfGoodsItem(), |
||||
); |
||||
}, |
||||
), |
||||
SizedBox(height:70.h,) |
||||
], |
||||
), |
||||
)), |
||||
), |
||||
)) |
||||
], |
||||
), |
||||
Container( |
||||
color: Color(0xFFEDEDED), |
||||
padding: EdgeInsets.only( |
||||
left: 44.w, |
||||
right: 44.w, |
||||
top: 21.h, |
||||
bottom: 24.h, |
||||
), |
||||
child: Row( |
||||
children: [ |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Text( |
||||
"批量上架", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: Text( |
||||
"批量删除", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
)) |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
/// 搜索框 |
||||
Widget goodsSearch() { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed('/router/goods_search_page'); |
||||
}, |
||||
child: Container( |
||||
height: 40.h, |
||||
margin: EdgeInsets.fromLTRB(18.w, 16.h, 18.w, 10.h), |
||||
padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF7F8FA), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_goods_search.webp", |
||||
width: 20, |
||||
height: 20, |
||||
), |
||||
SizedBox( |
||||
width: 3.w, |
||||
), |
||||
Text( |
||||
"请输入搜索内容", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF808080), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget shelfGoodsItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 22.h), |
||||
padding: EdgeInsets.only(left: 5.w,), |
||||
child: Row( |
||||
children: [ |
||||
Checkbox( |
||||
value: checkStatus, |
||||
onChanged: (a) { |
||||
setState(() { |
||||
checkStatus = !checkStatus; |
||||
}); |
||||
}, |
||||
shape: RoundedRectangleBorder( |
||||
borderRadius: BorderRadius.circular(2.0), |
||||
), |
||||
checkColor: Color(0xFFFFFFFF), |
||||
fillColor:MaterialStateProperty.all(Color(0xFF30415B)), |
||||
), |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 70, |
||||
height: 70, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox(width:12.w,), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), |
||||
child: Text( |
||||
"台湾甄选手抓饺子三生", |
||||
maxLines:1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF000000), |
||||
), |
||||
),), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"库存4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Text( |
||||
"销量4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF999999), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "19", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,194 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../generated/l10n.dart'; |
||||
|
||||
class AddAssort extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _AddAssort(); |
||||
} |
||||
} |
||||
|
||||
class _AddAssort extends State<AddAssort> { |
||||
final TextEditingController editingSortController = TextEditingController(); |
||||
final TextEditingController editingNameController = TextEditingController(); |
||||
bool isKeyBoardShow = false; |
||||
FocusNode _focusNode = FocusNode(); |
||||
|
||||
@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 GestureDetector( |
||||
behavior: HitTestBehavior.translucent, |
||||
onTap: (){ |
||||
FocusScope.of(context).unfocus(); |
||||
}, |
||||
child: Scaffold( |
||||
resizeToAvoidBottomInset: false, |
||||
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, |
||||
style: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
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 |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
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), |
||||
), |
||||
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, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,261 @@
|
||||
import 'package:flutter/material.dart'; |
||||
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'; |
||||
|
||||
class BatchShelf extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BatchShelf(); |
||||
} |
||||
} |
||||
|
||||
class _BatchShelf extends State<BatchShelf> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); |
||||
final ScrollController controller = ScrollController(); |
||||
var checkStatus = false; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
} |
||||
|
||||
@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: 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: Container( |
||||
margin: EdgeInsets.only(top: 24.h,), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Container( |
||||
width: 100.w, |
||||
color: Color(0xFFFAFAFA), |
||||
height: double.infinity, |
||||
child: ListView.builder( |
||||
itemCount:5, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: shelfLeftItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
Expanded(child: Container( |
||||
width: MediaQuery.of(context).size.width - 100.w, |
||||
child: ListView.builder( |
||||
itemCount: 6, |
||||
controller: controller, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return shelfRightItem(); |
||||
}, |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
|
||||
|
||||
///左边list |
||||
Widget shelfLeftItem(){ |
||||
return Container( |
||||
width: 100.w, |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
setState(() { |
||||
// controller.jumpTo(appletProducts[index].goodsIndex); |
||||
}); |
||||
}, |
||||
child: |
||||
Container( |
||||
// color: Color(0xFFFAFAFA), |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), |
||||
// margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
"人气必点榜", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Color(0xFF000000), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.semi_bold, |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///右边List |
||||
Widget shelfRightItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(left:16.w,right:14.w), |
||||
width: double.infinity, |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.symmetric(vertical: 16.h), |
||||
child: Text("人气必点榜",style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.regular, |
||||
),)), |
||||
ListView.builder( |
||||
itemCount: 3, |
||||
controller: controller, |
||||
physics: scrollPhysics, |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return shelfGoodsItem(); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget shelfGoodsItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 21.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 77, |
||||
height: 77, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox(width:12.w,), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(top: 2.h), |
||||
child:Text( |
||||
"台湾甄选手抓饺子三生", |
||||
maxLines:1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF000000), |
||||
), |
||||
)), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"库存4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Expanded(child: Text( |
||||
"销量4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF999999), |
||||
), |
||||
)), |
||||
Checkbox( |
||||
visualDensity: VisualDensity.compact, |
||||
value: checkStatus, |
||||
onChanged: (a) { |
||||
setState(() { |
||||
checkStatus = !checkStatus; |
||||
}); |
||||
}, |
||||
shape: RoundedRectangleBorder( |
||||
borderRadius: BorderRadius.circular(2.0), |
||||
), |
||||
checkColor: Color(0xFFFFFFFF), |
||||
fillColor: |
||||
MaterialStateProperty.all(Color(0xFF30415B)), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Row( |
||||
children: [ |
||||
Expanded(child:Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "19", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
], |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,167 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
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'; |
||||
|
||||
class EditAssort extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _EditAssort(); |
||||
} |
||||
} |
||||
|
||||
class _EditAssort extends State<EditAssort> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
final TextEditingController editingSortController = TextEditingController(); |
||||
final TextEditingController editingNameController = TextEditingController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
} |
||||
|
||||
@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, |
||||
style: TextStyle( |
||||
color: Color(0xFF7A797F), |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
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 |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
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), |
||||
), |
||||
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, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,138 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
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 '../../../view_widget/classic_header.dart'; |
||||
import '../../../view_widget/my_footer.dart'; |
||||
|
||||
class GoodsAssort extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _GoodsAssort(); |
||||
} |
||||
} |
||||
|
||||
class _GoodsAssort extends State<GoodsAssort> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@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: 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: Container( |
||||
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), |
||||
child: Column( |
||||
children: [ |
||||
Expanded(child: ListView.builder( |
||||
itemCount: 5, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: assortItem(), |
||||
); |
||||
}, |
||||
)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/add_assort'); |
||||
}, |
||||
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( |
||||
"添加分类", |
||||
style: TextStyle( |
||||
color: Colors.white, |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget assortItem() { |
||||
return Container( |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"台湾甄选手抓饺子", |
||||
style: TextStyle( |
||||
color: Color(0xFF000000), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap:(){ |
||||
Navigator.of(context).pushNamed('/router/edit_assort'); |
||||
}, |
||||
child: Padding(padding: EdgeInsets.only(right: 16.w), |
||||
child: |
||||
Text( |
||||
"编辑", |
||||
style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
),),), |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(vertical: 16.h), |
||||
color: Color(0xFFEBEBEB), |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,255 @@
|
||||
import 'package:flutter/material.dart'; |
||||
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'; |
||||
|
||||
class GoodsSort extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _GoodsSort(); |
||||
} |
||||
} |
||||
|
||||
class _GoodsSort extends State<GoodsSort> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); |
||||
final ScrollController controller = ScrollController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
|
||||
} |
||||
|
||||
@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: 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: Container( |
||||
margin: EdgeInsets.only(top: 24.h,), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Container( |
||||
width: 100.w, |
||||
color: Color(0xFFFAFAFA), |
||||
height: double.infinity, |
||||
child: ListView.builder( |
||||
itemCount:5, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: sortLeftItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
Expanded(child: Container( |
||||
width: MediaQuery.of(context).size.width - 100.w, |
||||
child: ListView.builder( |
||||
itemCount: 6, |
||||
controller: controller, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return sortRightItem(); |
||||
}, |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///左边list |
||||
Widget sortLeftItem(){ |
||||
return Container( |
||||
width: 100.w, |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
setState(() { |
||||
// controller.jumpTo(appletProducts[index].goodsIndex); |
||||
}); |
||||
}, |
||||
child: |
||||
Container( |
||||
// color: Color(0xFFFAFAFA), |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), |
||||
// margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
"人气必点榜", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Color(0xFF000000), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.semi_bold, |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///右边List |
||||
Widget sortRightItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(left:16.w,right: 14.w), |
||||
width: double.infinity, |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.symmetric(vertical: 16.h), |
||||
child: Text("人气必点榜",style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.regular, |
||||
),)), |
||||
ListView.builder( |
||||
itemCount: 3, |
||||
controller: controller, |
||||
physics: scrollPhysics, |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return sortGoodsItem(); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget sortGoodsItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 21.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 77, |
||||
height: 77, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox(width:12.w,), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"台湾甄选手抓饺子三生", |
||||
maxLines:1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF000000), |
||||
), |
||||
)), |
||||
Text( |
||||
"置顶", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
) |
||||
], |
||||
),), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"库存4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Text( |
||||
"销量4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF999999), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Row( |
||||
children: [ |
||||
Expanded(child:Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "19", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
], |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,428 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
|
||||
class OnSalePage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _OnSalePage(); |
||||
} |
||||
} |
||||
|
||||
class _OnSalePage extends State<OnSalePage> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); |
||||
final ScrollController controller = ScrollController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async {} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
body: Stack( |
||||
alignment: Alignment.bottomCenter, |
||||
children: [ |
||||
Column( |
||||
children: [ |
||||
Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
goodsSearch(), |
||||
Container( |
||||
color: Color(0xFFEBEBEB), |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
), |
||||
], |
||||
), |
||||
Expanded(child:Container( |
||||
child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Container( |
||||
color: Colors.white, |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisSize: MainAxisSize.max, |
||||
children: [ |
||||
Container( |
||||
width: 100.w, |
||||
child: ListView.builder( |
||||
itemCount:5, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () {}, |
||||
child: leftItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
Container( |
||||
width: MediaQuery.of(context).size.width - 100.w, |
||||
child: ListView.builder( |
||||
itemCount: 6, |
||||
controller: controller, |
||||
physics: scrollPhysics, |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return rightItem(); |
||||
}, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:70.h,) |
||||
], |
||||
), |
||||
)), |
||||
), |
||||
)) |
||||
], |
||||
), |
||||
Container( |
||||
color: Color(0xFFEDEDED), |
||||
padding: EdgeInsets.only( |
||||
left: 16.w, |
||||
right: 16.w, |
||||
top:21.h, |
||||
bottom:24.h, |
||||
), |
||||
child: Row( |
||||
children: [ |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/goods_assort'); |
||||
}, |
||||
child: Row( |
||||
children: [ |
||||
Text( |
||||
"分类管理", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 2.w, |
||||
), |
||||
Image.asset( |
||||
"assets/image/business.webp", |
||||
width: 18, |
||||
height: 18, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/goods_sort'); |
||||
}, |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Text( |
||||
"商品排序", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 2.w, |
||||
), |
||||
Image.asset( |
||||
"assets/image/bs_px.webp", |
||||
width: 18, |
||||
height: 18, |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/batch_shelf');}, |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.end, |
||||
children: [ |
||||
Text( |
||||
"批量下架", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
SizedBox( |
||||
width: 2.w, |
||||
), |
||||
Image.asset( |
||||
"assets/image/bs_xj.webp", |
||||
width: 18, |
||||
height: 18, |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
/// 搜索框 |
||||
Widget goodsSearch() { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed('/router/goods_search_page'); |
||||
}, |
||||
child: Container( |
||||
height: 40.h, |
||||
margin: EdgeInsets.fromLTRB(18.w, 16.h, 18.w, 10.h), |
||||
padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF7F8FA), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_goods_search.webp", |
||||
width: 20, |
||||
height: 20, |
||||
), |
||||
SizedBox( |
||||
width: 3.w, |
||||
), |
||||
Text( |
||||
"请输入搜索内容", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF808080), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///左边list |
||||
Widget leftItem(){ |
||||
return Container( |
||||
width: 100.w, |
||||
child: GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
setState(() { |
||||
// controller.jumpTo(appletProducts[index].goodsIndex); |
||||
}); |
||||
}, |
||||
child: |
||||
Container( |
||||
color: Color(0xFFFAFAFA), |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), |
||||
// margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
"人气必点榜", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
color: Color(0xFF000000), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.semi_bold, |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///右边List |
||||
Widget rightItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.symmetric(horizontal:16.w), |
||||
width: double.infinity, |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.symmetric(vertical: 16.h), |
||||
child: Text("人气必点榜",style: TextStyle( |
||||
color: Color(0xFF30415B), |
||||
fontSize: 12.sp, |
||||
fontWeight:MyFontWeight.regular, |
||||
),)), |
||||
ListView.builder( |
||||
itemCount: 8, |
||||
controller: controller, |
||||
physics: scrollPhysics, |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return rightGoodsItem(); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget rightGoodsItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 21.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 70, |
||||
height: 70, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox(width:12.w,), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), |
||||
child: Text( |
||||
"台湾甄选手抓饺子三生", |
||||
maxLines:1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF000000), |
||||
), |
||||
),), |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"库存4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFFA29E9E), |
||||
), |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Text( |
||||
"销量4321", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF999999), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Row( |
||||
children: [ |
||||
Expanded(child:Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "19", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFFF4524D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(33), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1, |
||||
), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:12.w), |
||||
child: Text( |
||||
"下架", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
) |
||||
], |
||||
) |
||||
], |
||||
)), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,36 @@
|
||||
/// Donut chart with labels example. This is a simple pie chart with a hole in |
||||
/// the middle. |
||||
import 'package:charts_common/src/common/color.dart' show Color; |
||||
import 'package:charts_flutter/flutter.dart' as charts; |
||||
import 'package:charts_flutter/flutter.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
|
||||
import 'my_arc_label_decorator.dart'; |
||||
|
||||
class DonutAutoLabelChart extends StatelessWidget { |
||||
final List<charts.Series> seriesList; |
||||
final bool animate; |
||||
|
||||
DonutAutoLabelChart(this.seriesList, {this.animate = false}); |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return new charts.PieChart(seriesList, |
||||
animate: animate, |
||||
defaultRenderer: new charts.ArcRendererConfig( |
||||
arcWidth: 15, |
||||
strokeWidthPx: 0, |
||||
arcRendererDecorators: [ |
||||
new MyArcLabelDecorator(MediaQuery.of(context).size.width) |
||||
])); |
||||
} |
||||
} |
||||
|
||||
/// Sample linear data type. |
||||
class LinearSales { |
||||
final int year; |
||||
final int sales; |
||||
final Color color; |
||||
|
||||
LinearSales(this.year, this.sales, this.color); |
||||
} |
@ -0,0 +1,477 @@
|
||||
// Copyright 2018 the Charts project authors. Please see the AUTHORS file |
||||
// for details. |
||||
// |
||||
// Licensed under the Apache License, Version 2.0 (the "License"); |
||||
// you may not use this file except in compliance with the License. |
||||
// You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
import 'dart:math' show cos, min, sin, pi, Point, Rectangle; |
||||
|
||||
import 'package:charts_common/src/chart/cartesian/axis/spec/axis_spec.dart' |
||||
show TextStyleSpec; |
||||
import 'package:charts_common/src/chart/common/chart_canvas.dart' |
||||
show ChartCanvas; |
||||
import 'package:charts_common/src/chart/pie/arc_renderer_decorator.dart' |
||||
show ArcRendererDecorator; |
||||
import 'package:charts_common/src/chart/pie/arc_renderer_element.dart' |
||||
show ArcRendererElement, ArcRendererElementList; |
||||
import 'package:charts_common/src/common/color.dart' show Color; |
||||
import 'package:charts_common/src/common/graphics_factory.dart' |
||||
show GraphicsFactory; |
||||
import 'package:charts_common/src/common/style/style_factory.dart' |
||||
show StyleFactory; |
||||
import 'package:charts_common/src/common/text_element.dart' |
||||
show MaxWidthStrategy, TextDirection, TextElement; |
||||
import 'package:charts_common/src/common/text_style.dart' show TextStyle; |
||||
import 'package:charts_common/src/data/series.dart' show AccessorFn; |
||||
import 'package:meta/meta.dart' show immutable, protected; |
||||
|
||||
/// Renders labels for arc renderers. |
||||
/// |
||||
/// This decorator performs very basic label collision detection. If the y |
||||
/// position of a label positioned outside collides with the previously drawn |
||||
/// label (on the same side of the chart), then that label will be skipped. |
||||
class MyArcLabelDecorator<D> extends ArcRendererDecorator<D> { |
||||
// Default configuration |
||||
static const _defaultLabelPosition = ArcLabelPosition.auto; |
||||
static const _defaultLabelPadding = 5; |
||||
static final _defaultInsideLabelStyle = |
||||
TextStyleSpec(fontSize: 12, color: Color.white); |
||||
static final _defaultLineColors = [ |
||||
Color.fromHex(code: "#21CCFF"), |
||||
Color.fromHex(code: "#313CA9") |
||||
]; |
||||
static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"]; |
||||
static final _defaultOutsideLabelStyle = |
||||
TextStyleSpec(fontSize: 14, color: Color.fromHex(code: "#333333"),); |
||||
static final _defaultTextLabelStyle = |
||||
TextStyleSpec(fontSize: 10, color: Color.fromHex(code: "#999999")); |
||||
static final _defaultLeaderLineStyle = ArcLabelLeaderLineStyleSpec( |
||||
length: 15.0, |
||||
thickness: 1.0, |
||||
color: StyleFactory.style.arcLabelOutsideLeaderLine); |
||||
static const _defaultShowLeaderLines = true; |
||||
|
||||
/// Configures [TextStyleSpec] for labels placed inside the arcs. |
||||
final TextStyleSpec insideLabelStyleSpec; |
||||
|
||||
/// Configures [TextStyleSpec] for labels placed outside the arcs. |
||||
final TextStyleSpec outsideLabelStyleSpec; |
||||
|
||||
/// Configures [ArcLabelLeaderLineStyleSpec] for leader lines for labels |
||||
/// placed outside the arcs. |
||||
final ArcLabelLeaderLineStyleSpec leaderLineStyleSpec; |
||||
|
||||
/// Configures where to place the label relative to the arcs. |
||||
final ArcLabelPosition labelPosition; |
||||
|
||||
/// Space before and after the label text. |
||||
final int labelPadding; |
||||
|
||||
/// Whether or not to draw leader lines for labels placed outside the arcs. |
||||
final bool showLeaderLines; |
||||
|
||||
/// Render the labels on top of series data. |
||||
@override |
||||
final bool renderAbove = true; |
||||
|
||||
/// fields for collision detection. |
||||
num _previousOutsideLabelY; |
||||
bool _previousLabelLeftOfChart; |
||||
|
||||
final double mediaQueryWidth; |
||||
|
||||
MyArcLabelDecorator(this.mediaQueryWidth, |
||||
{TextStyleSpec insideLabelStyleSpec, |
||||
TextStyleSpec outsideLabelStyleSpec, |
||||
ArcLabelLeaderLineStyleSpec leaderLineStyleSpec, |
||||
this.labelPosition = _defaultLabelPosition, |
||||
this.labelPadding = _defaultLabelPadding, |
||||
this.showLeaderLines = _defaultShowLeaderLines, |
||||
Color leaderLineColor}) |
||||
: insideLabelStyleSpec = insideLabelStyleSpec ?? _defaultInsideLabelStyle, |
||||
outsideLabelStyleSpec = |
||||
outsideLabelStyleSpec ?? _defaultOutsideLabelStyle, |
||||
leaderLineStyleSpec = leaderLineStyleSpec ?? _defaultLeaderLineStyle; |
||||
|
||||
@override |
||||
void decorate(List<ArcRendererElementList<D>> arcElementsList, |
||||
ChartCanvas canvas, GraphicsFactory graphicsFactory, |
||||
{Rectangle drawBounds, |
||||
double animationPercent, |
||||
bool rtl = false}) { |
||||
// Only decorate the arcs when animation is at 100%. |
||||
if (animationPercent != 1.0) { |
||||
return; |
||||
} |
||||
|
||||
// Create [TextStyle] from [TextStyleSpec] to be used by all the elements. |
||||
// The [GraphicsFactory] is needed so it can't be created earlier. |
||||
final insideLabelStyle = |
||||
_getTextStyle(graphicsFactory, insideLabelStyleSpec); |
||||
final outsideLabelStyle = |
||||
_getTextStyle(graphicsFactory, outsideLabelStyleSpec); |
||||
final textLabelStyle = |
||||
_getTextStyle(graphicsFactory, _defaultTextLabelStyle); |
||||
|
||||
// Track the Y position of the previous outside label for collision |
||||
// detection purposes. |
||||
int i = 0; |
||||
for (var arcElements in arcElementsList) { |
||||
_previousOutsideLabelY = null; |
||||
_previousLabelLeftOfChart = null; |
||||
|
||||
for (var element in arcElements.arcs) { |
||||
final labelFn = element.series.labelAccessorFn; |
||||
final datumIndex = element.index; |
||||
final label = (labelFn != null) ? labelFn(datumIndex) : null; |
||||
|
||||
// If there are custom styles, use that instead of the default or the |
||||
// style defined for the entire decorator. |
||||
final datumInsideLabelStyle = _getDatumStyle( |
||||
element.series.insideLabelStyleAccessorFn, |
||||
datumIndex, |
||||
graphicsFactory, |
||||
defaultStyle: insideLabelStyle); |
||||
final datumOutsideLabelStyle = _getDatumStyle( |
||||
element.series.outsideLabelStyleAccessorFn, |
||||
datumIndex, |
||||
graphicsFactory, |
||||
defaultStyle: outsideLabelStyle); |
||||
final datumTextLabelStyle = _getDatumStyle( |
||||
element.series.outsideLabelStyleAccessorFn, |
||||
datumIndex, |
||||
graphicsFactory, |
||||
defaultStyle: textLabelStyle); |
||||
|
||||
// Skip calculation and drawing for this element if no label. |
||||
if (label == null || label.isEmpty) { |
||||
continue; |
||||
} |
||||
|
||||
final arcAngle = element.endAngle - element.startAngle; |
||||
|
||||
final centerAngle = element.startAngle + (arcAngle / 2); |
||||
|
||||
final centerRadius = arcElements.innerRadius + |
||||
((arcElements.radius - arcElements.innerRadius) / 2); |
||||
|
||||
final outerPoint = Point<double>( |
||||
arcElements.center.x + arcElements.radius * cos(centerAngle), |
||||
arcElements.center.y + arcElements.radius * sin(centerAngle)); |
||||
|
||||
final bounds = |
||||
Rectangle<double>.fromPoints(arcElements.center, outerPoint); |
||||
|
||||
// Get space available inside and outside the arc. |
||||
final totalPadding = labelPadding * 2; |
||||
final insideArcWidth = min( |
||||
(((arcAngle * 180 / pi) / 360) * (2 * pi * centerRadius)) |
||||
.round(), |
||||
(arcElements.radius - arcElements.innerRadius) - labelPadding) |
||||
.round(); |
||||
|
||||
final leaderLineLength = |
||||
showLeaderLines ? leaderLineStyleSpec.length : 0; |
||||
|
||||
final outsideArcWidth = ((mediaQueryWidth / 2) - |
||||
bounds.width - |
||||
totalPadding - |
||||
// Half of the leader line is drawn inside the arc |
||||
leaderLineLength / 2) |
||||
.round(); |
||||
|
||||
final labelElement = graphicsFactory.createTextElement(label) |
||||
..maxWidthStrategy = MaxWidthStrategy.ellipsize; |
||||
|
||||
final labelTextElement = graphicsFactory |
||||
.createTextElement(_defaultLabelText[i]) |
||||
..maxWidthStrategy = MaxWidthStrategy.ellipsize; |
||||
|
||||
var calculatedLabelPosition = calculateLabelPosition( |
||||
labelElement, |
||||
datumInsideLabelStyle, |
||||
insideArcWidth, |
||||
outsideArcWidth, |
||||
element, |
||||
labelPosition); |
||||
|
||||
// Set the max width and text style. |
||||
if (calculatedLabelPosition == ArcLabelPosition.inside) { |
||||
labelElement.textStyle = datumInsideLabelStyle; |
||||
labelElement.maxWidth = insideArcWidth; |
||||
} else { |
||||
// calculatedLabelPosition == LabelPosition.outside |
||||
labelElement.textStyle = datumOutsideLabelStyle; |
||||
labelElement.maxWidth = outsideArcWidth; |
||||
labelTextElement.maxWidth = outsideArcWidth; |
||||
} |
||||
labelTextElement.textStyle = datumTextLabelStyle; |
||||
|
||||
// Only calculate and draw label if there's actually space for the |
||||
// label. |
||||
if (labelElement.maxWidth > 0) { |
||||
// Calculate the start position of label based on [labelAnchor]. |
||||
if (calculatedLabelPosition == ArcLabelPosition.inside) { |
||||
_drawInsideLabel(canvas, arcElements, labelElement, centerAngle); |
||||
} else { |
||||
final l = _drawOutsideLabel( |
||||
canvas, |
||||
drawBounds, |
||||
arcElements, |
||||
labelElement, |
||||
labelTextElement, |
||||
centerAngle, |
||||
_defaultLineColors[i]); |
||||
i += 1; |
||||
|
||||
if (l != null) { |
||||
updateCollisionDetectionParams(l); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
@protected |
||||
ArcLabelPosition calculateLabelPosition( |
||||
TextElement labelElement, |
||||
TextStyle labelStyle, |
||||
int insideArcWidth, |
||||
int outsideArcWidth, |
||||
ArcRendererElement arcRendererelement, |
||||
ArcLabelPosition labelPosition) { |
||||
if (labelPosition == ArcLabelPosition.auto) { |
||||
// For auto, first try to fit the text inside the arc. |
||||
labelElement.textStyle = labelStyle; |
||||
|
||||
// A label fits if the space inside the arc is >= outside arc or if the |
||||
// length of the text fits and the space. This is because if the arc has |
||||
// more space than the outside, it makes more sense to place the label |
||||
// inside the arc, even if the entire label does not fit. |
||||
return (insideArcWidth >= outsideArcWidth || |
||||
labelElement.measurement.horizontalSliceWidth < insideArcWidth) |
||||
? ArcLabelPosition.inside |
||||
: ArcLabelPosition.outside; |
||||
} else { |
||||
return labelPosition; |
||||
} |
||||
} |
||||
|
||||
/// Helper function that converts [TextStyleSpec] to [TextStyle]. |
||||
TextStyle _getTextStyle( |
||||
GraphicsFactory graphicsFactory, TextStyleSpec labelSpec) { |
||||
return graphicsFactory.createTextPaint() |
||||
..color = labelSpec.color ?? Color.black |
||||
..fontFamily = labelSpec.fontFamily |
||||
..fontSize = labelSpec.fontSize ?? 12 |
||||
..lineHeight = labelSpec.lineHeight; |
||||
} |
||||
|
||||
/// Helper function to get datum specific style |
||||
TextStyle _getDatumStyle(AccessorFn<TextStyleSpec> labelFn, int datumIndex, |
||||
GraphicsFactory graphicsFactory, |
||||
{TextStyle defaultStyle}) { |
||||
final styleSpec = (labelFn != null) ? labelFn(datumIndex) : null; |
||||
return (styleSpec != null) |
||||
? _getTextStyle(graphicsFactory, styleSpec) |
||||
: defaultStyle; |
||||
} |
||||
|
||||
/// Draws a label inside of an arc. |
||||
void _drawInsideLabel( |
||||
ChartCanvas canvas, |
||||
ArcRendererElementList<D> arcElements, |
||||
TextElement labelElement, |
||||
double centerAngle) { |
||||
// Center the label inside the arc. |
||||
final labelRadius = arcElements.innerRadius + |
||||
(arcElements.radius - arcElements.innerRadius) / 2; |
||||
|
||||
final labelX = |
||||
(arcElements.center.x + labelRadius * cos(centerAngle)).round(); |
||||
|
||||
final labelY = (arcElements.center.y + |
||||
labelRadius * sin(centerAngle) - |
||||
insideLabelStyleSpec.fontSize / 2) |
||||
.round(); |
||||
|
||||
labelElement.textDirection = TextDirection.center; |
||||
|
||||
canvas.drawText(labelElement, labelX, labelY); |
||||
} |
||||
|
||||
@protected |
||||
void updateCollisionDetectionParams(List<Object> params) { |
||||
// List destructuring. |
||||
_previousLabelLeftOfChart = params[0] as bool; |
||||
_previousOutsideLabelY = params[1] as int; |
||||
} |
||||
|
||||
double getLabelRadius(ArcRendererElementList<D> arcElements) => |
||||
arcElements.radius + leaderLineStyleSpec.length / 2; |
||||
|
||||
/// Draws a label outside of an arc. |
||||
List<Object> _drawOutsideLabel( |
||||
ChartCanvas canvas, |
||||
Rectangle drawBounds, |
||||
ArcRendererElementList<D> arcElements, |
||||
TextElement labelElement, |
||||
TextElement labelTextElement, |
||||
double centerAngle, |
||||
Color color) { |
||||
final labelRadius = getLabelRadius(arcElements); |
||||
|
||||
final labelPoint = Point<double>( |
||||
arcElements.center.x + labelRadius * cos(centerAngle), |
||||
arcElements.center.y + labelRadius * sin(centerAngle)); |
||||
|
||||
// Use the label's chart quandrant to determine whether it's rendered to the |
||||
// right or left. |
||||
final centerAbs = centerAngle.abs() % (2 * pi); |
||||
final labelLeftOfChart = pi / 2 < centerAbs && centerAbs < pi * 3 / 2; |
||||
|
||||
// Shift the label horizontally away from the center of the chart. |
||||
var labelX = labelLeftOfChart |
||||
? (labelPoint.x - labelPadding).round() |
||||
: (labelPoint.x + labelPadding).round(); |
||||
|
||||
// Shift the label up by the size of the font. |
||||
final labelY = (labelPoint.y - outsideLabelStyleSpec.fontSize / 2).round(); |
||||
|
||||
// Outside labels should flow away from the center of the chart |
||||
labelElement.textDirection = |
||||
labelLeftOfChart ? TextDirection.rtl : TextDirection.ltr; |
||||
labelTextElement.textDirection = labelElement.textDirection; |
||||
|
||||
// Skip this label if it collides with the previously drawn label. |
||||
if (detectOutsideLabelCollision(labelY, labelLeftOfChart, |
||||
_previousOutsideLabelY, _previousLabelLeftOfChart)) { |
||||
return null; |
||||
} |
||||
|
||||
if (showLeaderLines) { |
||||
final tailX = _drawLeaderLine(canvas, labelLeftOfChart, labelPoint, |
||||
arcElements.radius, arcElements.center, centerAngle, color); |
||||
|
||||
// Shift the label horizontally by the length of the leader line. |
||||
labelX = (labelX + tailX).round(); |
||||
|
||||
labelElement.maxWidth = (labelElement.maxWidth - tailX.abs()).round(); |
||||
} |
||||
|
||||
canvas.drawText(labelElement, labelX, labelY); |
||||
|
||||
canvas.drawText(labelTextElement, labelX, labelY + 18); |
||||
|
||||
// Return a structured list of values. |
||||
return [labelLeftOfChart, labelY]; |
||||
} |
||||
|
||||
/// Detects whether the current outside label collides with the previous label. |
||||
@protected |
||||
bool detectOutsideLabelCollision(num labelY, bool labelLeftOfChart, |
||||
num previousOutsideLabelY, bool previousLabelLeftOfChart) { |
||||
var collides = false; |
||||
|
||||
// Given that labels are vertically centered, we can assume they will |
||||
// collide if the current label's Y coordinate +/- the font size |
||||
// crosses past the Y coordinate of the previous label drawn on the |
||||
// same side of the chart. |
||||
if (previousOutsideLabelY != null && |
||||
labelLeftOfChart == previousLabelLeftOfChart) { |
||||
if (labelY > previousOutsideLabelY) { |
||||
if (labelY - outsideLabelStyleSpec.fontSize <= previousOutsideLabelY) { |
||||
collides = true; |
||||
} |
||||
} else { |
||||
if (labelY + outsideLabelStyleSpec.fontSize >= previousOutsideLabelY) { |
||||
collides = true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
return collides; |
||||
} |
||||
|
||||
/// Draws a leader line for the current arc. |
||||
double _drawLeaderLine( |
||||
ChartCanvas canvas, |
||||
bool labelLeftOfChart, |
||||
Point<double> labelPoint, |
||||
double radius, |
||||
Point<double> arcCenterPoint, |
||||
double centerAngle, |
||||
Color color) { |
||||
final tailX = (labelLeftOfChart ? -1 : 1) * leaderLineStyleSpec.length; |
||||
|
||||
final leaderLineTailPoint = |
||||
Point<double>(labelPoint.x + tailX, labelPoint.y); |
||||
|
||||
final centerRadius = radius - leaderLineStyleSpec.length / 2; |
||||
final leaderLineStartPoint = Point<double>( |
||||
arcCenterPoint.x + centerRadius * cos(centerAngle), |
||||
arcCenterPoint.y + centerRadius * sin(centerAngle)); |
||||
|
||||
canvas.drawLine(points: [ |
||||
leaderLineStartPoint, |
||||
labelPoint, |
||||
leaderLineTailPoint, |
||||
], stroke: color, strokeWidthPx: leaderLineStyleSpec.thickness); |
||||
|
||||
return tailX; |
||||
} |
||||
} |
||||
|
||||
/// Configures where to place the label relative to the arcs. |
||||
enum ArcLabelPosition { |
||||
/// Automatically try to place the label inside the arc first and place it on |
||||
/// the outside of the space available outside the arc is greater than space |
||||
/// available inside the arc. |
||||
auto, |
||||
|
||||
/// Always place label on the outside. |
||||
outside, |
||||
|
||||
/// Always place label on the inside. |
||||
inside |
||||
} |
||||
|
||||
/// Style configuration for leader lines. |
||||
@immutable |
||||
class ArcLabelLeaderLineStyleSpec { |
||||
final Color color; |
||||
final double length; |
||||
final double thickness; |
||||
|
||||
ArcLabelLeaderLineStyleSpec({ |
||||
this.color, |
||||
this.length, |
||||
this.thickness, |
||||
}); |
||||
|
||||
@override |
||||
bool operator ==(Object other) { |
||||
return other is ArcLabelLeaderLineStyleSpec && |
||||
color == other.color && |
||||
thickness == other.thickness && |
||||
length == other.length; |
||||
} |
||||
|
||||
@override |
||||
int get hashCode { |
||||
var hashcode = color.hashCode; |
||||
hashcode = (hashcode * 37) + thickness.hashCode; |
||||
hashcode = (hashcode * 37) + length.hashCode; |
||||
return hashcode; |
||||
} |
||||
} |
@ -0,0 +1,499 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
|
||||
class TradeGoods extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeGoods(); |
||||
} |
||||
} |
||||
|
||||
class _TradeGoods extends State<TradeGoods> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFD8D8D8), |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
), |
||||
Expanded(child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all(color: Color(0xFFCFD0D1), |
||||
width: 1.w), |
||||
), |
||||
margin: EdgeInsets.only( |
||||
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"日报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"周报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"月报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"自定义", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
), |
||||
Align(alignment: Alignment.center, |
||||
child: Container( |
||||
width: 154.w, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.all(8), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
margin: EdgeInsets.only(bottom:16.h), |
||||
child: Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 20.w), |
||||
child: Text( |
||||
"2023年06月01日(今日)", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.black, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_calendar_logo.webp", |
||||
width:15, |
||||
height:15, |
||||
), |
||||
], |
||||
), |
||||
),), |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), |
||||
child:Text( |
||||
"商品分析", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Colors.black, |
||||
), |
||||
)), |
||||
goodsTypeRecord(), |
||||
Container( |
||||
margin: EdgeInsets.only(top: 14.h,left:16.w,right: 16.w), |
||||
color: Color(0xFFECECEC), |
||||
height: 1.h, |
||||
width: double.infinity, |
||||
), |
||||
singleSalesStatement(), |
||||
], |
||||
)), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///商品种类销售数据 |
||||
Widget goodsTypeRecord(){ |
||||
return Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom: 19.h), |
||||
child:Row( |
||||
children: [ |
||||
Container( |
||||
width: 4.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right:12.w), |
||||
), |
||||
Text( |
||||
"商品种类销售数据", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color:Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
SizedBox(width:8.w,), |
||||
Text( |
||||
"比上周一同时段", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color:Color(0xFF666666), |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(horizontal: 16.w), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all( |
||||
color: Color(0xFFD6D6D6), |
||||
width: 1, |
||||
), |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFF3F7FF), |
||||
padding: EdgeInsets.only(top: 7.h,left: 11.w,right:24.w,bottom: 8.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"分类", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),), |
||||
Text( |
||||
"销售额", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
height: 183.h, |
||||
child: ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:1, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: goodsTypeItem(), |
||||
); |
||||
}, |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
Widget goodsTypeItem(){ |
||||
return Container( |
||||
color: Color(0xFFF9FAF8), |
||||
padding: EdgeInsets.only(top:8.h,left: 11.w,right:24.w,bottom:7.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"招牌奶", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),), |
||||
Text( |
||||
"3423", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///单品销量报表 |
||||
Widget singleSalesStatement(){ |
||||
return Container( |
||||
padding: EdgeInsets.only(top:23.h,bottom:45.h), |
||||
child: Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), |
||||
child:Row( |
||||
children: [ |
||||
Container( |
||||
width: 4.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right:12.w), |
||||
), |
||||
Text( |
||||
"单品销量报表", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color:Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
SizedBox(width:8.w,), |
||||
Text( |
||||
"比上周一同时段", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color:Color(0xFF666666), |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Container( |
||||
margin: EdgeInsets.symmetric(horizontal: 16.w), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all( |
||||
color: Color(0xFFD6D6D6), |
||||
width: 1, |
||||
), |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFF3F7FF), |
||||
padding: EdgeInsets.only(top: 7.h,left:17.w,bottom: 8.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"分类", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),flex: 2,), |
||||
Expanded(child:Text( |
||||
"名称", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),flex: 2,), |
||||
Expanded(child:Text( |
||||
"销售额", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),), |
||||
Expanded(child:Text( |
||||
"单价", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),), |
||||
Expanded(child:Text( |
||||
"销量", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF969799), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
height: 203.h, |
||||
child: ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: singleSalesItem(), |
||||
); |
||||
}, |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget singleSalesItem(){ |
||||
return Container( |
||||
color: Color(0xFFF9FAF8), |
||||
padding: EdgeInsets.only(top:8.h,left:16.w,bottom:7.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
"金贵牛肉面", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),flex: 2,), |
||||
Expanded(child:Text( |
||||
"番茄牛肉面", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),flex: 2,), |
||||
Expanded(child:Text( |
||||
"3423", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),), |
||||
Expanded(child:Text( |
||||
"113", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),), |
||||
Expanded(child:Text( |
||||
"3423", |
||||
textAlign: TextAlign.center, |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color:Color(0xFF000000), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,283 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
import '../home_view/my_line_chart.dart'; |
||||
|
||||
class TradeOrder extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeOrder(); |
||||
} |
||||
} |
||||
|
||||
class _TradeOrder extends State<TradeOrder> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
List<LineChartSample2Data> lineChartSample2DataAmount = |
||||
[LineChartSample2Data(0,10,"2023-03-09"), |
||||
LineChartSample2Data(1,10,"2023-03-10"), |
||||
LineChartSample2Data(2,60,"2023-03-11"), |
||||
LineChartSample2Data(3,35,"2023-03-12"), |
||||
LineChartSample2Data(4,20,"2023-03-13"), |
||||
LineChartSample2Data(5,55,"2023-03-14"), |
||||
LineChartSample2Data(6,99,"2023-03-15")]; |
||||
List<LineChartSample2Data> lineChartSample2DataNum = |
||||
[LineChartSample2Data(0,60,"2023-03-09"), |
||||
LineChartSample2Data(1,30,"2023-03-10"), |
||||
LineChartSample2Data(2,50,"2023-03-11"), |
||||
LineChartSample2Data(3,80,"2023-03-12"), |
||||
LineChartSample2Data(4,5,"2023-03-13"), |
||||
LineChartSample2Data(5,55,"2023-03-14"), |
||||
LineChartSample2Data(6,98,"2023-03-15")]; |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFD8D8D8), |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
), |
||||
Expanded(child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all(color: Color(0xFFCFD0D1), |
||||
width: 1.w), |
||||
), |
||||
margin: EdgeInsets.only( |
||||
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"日报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"周报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"月报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"自定义", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
), |
||||
Align(alignment: Alignment.center, |
||||
child: Container( |
||||
width: 154.w, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.all(8), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
margin: EdgeInsets.only(bottom:16.h), |
||||
child: Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 20.w), |
||||
child: Text( |
||||
"2023年06月01日(今日)", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.black, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_calendar_logo.webp", |
||||
width:15, |
||||
height:15, |
||||
), |
||||
], |
||||
), |
||||
),), |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), |
||||
child:Text( |
||||
"订单分析", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Colors.black, |
||||
), |
||||
)), |
||||
orderAmount(), |
||||
orderNumTrend(), |
||||
], |
||||
)), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///订单金额 |
||||
Widget orderAmount(){ |
||||
return Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), |
||||
child:Row( |
||||
children: [ |
||||
Container( |
||||
width: 4.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right:12.w), |
||||
), |
||||
Text( |
||||
"订单金额", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color:Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
SizedBox(width:8.w,), |
||||
Text( |
||||
"近12周", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color:Color(0xFF666666), |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
||||
child:LineChartSample2(lineChartSample2DataAmount,"金额"),), |
||||
SizedBox(height:16.h,), |
||||
], |
||||
); |
||||
} |
||||
|
||||
///订单量趋势 |
||||
Widget orderNumTrend(){ |
||||
return Container( |
||||
padding: EdgeInsets.only(top:12.h,bottom: 33.h), |
||||
child: Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), |
||||
child:Row( |
||||
children: [ |
||||
Container( |
||||
width: 4.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right:12.w), |
||||
), |
||||
Text( |
||||
"订单趋势", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color:Color(0xFF0D0D0D), |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
||||
child:LineChartSample2(lineChartSample2DataNum,"订单量"),), |
||||
SizedBox(height:16.h,), |
||||
|
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,449 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
import '../home_view/donut_auto_label_chart.dart'; |
||||
import '../home_view/my_line_chart.dart'; |
||||
import 'package:charts_flutter/flutter.dart' as charts; |
||||
|
||||
class TradeSummary extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeSummary(); |
||||
} |
||||
} |
||||
|
||||
class _TradeSummary extends State<TradeSummary> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
int operateSelect = 0; |
||||
int expensesSelect = 0; |
||||
List<LineChartSample2Data> lineChartSample2DataAmount = |
||||
[LineChartSample2Data(0,40,"2023-03-09"), |
||||
LineChartSample2Data(1,10,"2023-03-10"), |
||||
LineChartSample2Data(2,50,"2023-03-11"), |
||||
LineChartSample2Data(3,35,"2023-03-12"), |
||||
LineChartSample2Data(4,20,"2023-03-13"), |
||||
LineChartSample2Data(5,55,"2023-03-14"), |
||||
LineChartSample2Data(6,100,"2023-03-15")]; |
||||
List<LineChartSample2Data> lineChartSample2DataNum = |
||||
[LineChartSample2Data(0,20,"2023-03-09"), |
||||
LineChartSample2Data(1,30,"2023-03-10"), |
||||
LineChartSample2Data(2,50,"2023-03-11"), |
||||
LineChartSample2Data(3,60,"2023-03-12"), |
||||
LineChartSample2Data(4,5,"2023-03-13"), |
||||
LineChartSample2Data(5,55,"2023-03-14"), |
||||
LineChartSample2Data(6,95,"2023-03-15")]; |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFD8D8D8), |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
), |
||||
Expanded(child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all(color: Color(0xFFCFD0D1), |
||||
width: 1.w), |
||||
), |
||||
margin: EdgeInsets.only( |
||||
top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"日报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"周报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"月报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
child: Text( |
||||
"自定义", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
), |
||||
Align(alignment: Alignment.center, |
||||
child: Container( |
||||
width: 154.w, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.all(8), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
margin: EdgeInsets.only(bottom:16.h), |
||||
child: Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 20.w), |
||||
child: Text( |
||||
"2023年06月01日(今日)", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.black, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_calendar_logo.webp", |
||||
width:15, |
||||
height:15, |
||||
), |
||||
], |
||||
), |
||||
),), |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), |
||||
child:Text( |
||||
"经营分析", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Colors.black, |
||||
), |
||||
)), |
||||
operateAnalysis(), |
||||
Container( |
||||
color: Color(0xFFF9FAF8), |
||||
height: 16.h, |
||||
width: double.infinity, |
||||
), |
||||
expensesAnalysis(), |
||||
], |
||||
)), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///经营分析 |
||||
Widget operateAnalysis(){ |
||||
return Column( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(left:21.w,bottom: 1.h), |
||||
child: Row( |
||||
children: [ |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
setState((){ |
||||
operateSelect = 0; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom: 10.h), |
||||
child:Text( |
||||
"营业额", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: operateSelect == 0 ? Colors.black:Color(0xFF969696), |
||||
), |
||||
)), |
||||
if(operateSelect == 0) |
||||
Container( |
||||
height: 2.h, |
||||
width: 44.w, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox(width:47.w,), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
setState((){ |
||||
operateSelect = 1; |
||||
});}, |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom: 10.h), |
||||
child:Text( |
||||
"交易笔数", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: operateSelect == 1 ? Colors.black:Color(0xFF969696), |
||||
), |
||||
)), |
||||
if(operateSelect == 1) |
||||
Container( |
||||
height: 2.h, |
||||
width: 44.w, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
),), |
||||
Container( |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
color: Color(0xFFD8D8D8), |
||||
margin: EdgeInsets.only(bottom:30.h), |
||||
), |
||||
if(operateSelect== 0) |
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
||||
child:LineChartSample2(lineChartSample2DataAmount,"金额"),), |
||||
if(operateSelect == 1) |
||||
Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), |
||||
child:LineChartSample2(lineChartSample2DataNum,"交易笔数"),), |
||||
SizedBox(height:16.h,), |
||||
], |
||||
); |
||||
} |
||||
|
||||
///收退款分析 |
||||
Widget expensesAnalysis(){ |
||||
return Container( |
||||
padding: EdgeInsets.only(top:12.h,bottom: 33.h), |
||||
child: Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), |
||||
child:Row( |
||||
children: [ |
||||
Container( |
||||
width: 4.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right:12.w), |
||||
), |
||||
Text( |
||||
"收退款分析", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color:Color(0xFF0D0D0D), |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Padding(padding: EdgeInsets.only(left:21.w,bottom: 1.h), |
||||
child: Row( |
||||
children: [ |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
setState((){ |
||||
expensesSelect = 0; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom: 10.h), |
||||
child:Text( |
||||
"交易金额", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: expensesSelect == 0 ? Colors.black:Color(0xFF969696), |
||||
), |
||||
)), |
||||
if(expensesSelect == 0) |
||||
Container( |
||||
height: 2.h, |
||||
width: 44.w, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox(width:37.w,), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
setState((){ |
||||
expensesSelect = 1; |
||||
});}, |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom: 10.h), |
||||
child:Text( |
||||
"交易笔数", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: expensesSelect == 1 ? Colors.black:Color(0xFF969696), |
||||
), |
||||
)), |
||||
if(expensesSelect == 1) |
||||
Container( |
||||
height: 2.h, |
||||
width: 44.w, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(2), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
),), |
||||
if(expensesSelect == 0) |
||||
Container( |
||||
height:150.h, |
||||
child: DonutAutoLabelChart([ |
||||
new charts.Series<LinearSales, int>( |
||||
id: 'Sales', |
||||
colorFn: (LinearSales sales, __) => |
||||
sales.color, |
||||
domainFn: (LinearSales sales, _) => |
||||
sales.year, |
||||
measureFn: (LinearSales sales, _) => |
||||
sales.sales, |
||||
data: [ |
||||
new LinearSales(0, 78100, charts.Color.fromHex(code: "#313CA9")), |
||||
new LinearSales(1, 135458, charts.Color.fromHex(code: "#30415B")) |
||||
], |
||||
// Set a label accessor to control the text of the arc label. |
||||
labelAccessorFn: (LinearSales row, _) => |
||||
'${(row.sales / 100)}', |
||||
) |
||||
]), |
||||
), |
||||
if(expensesSelect == 1) |
||||
Container( |
||||
height:150.h, |
||||
child: DonutAutoLabelChart([ |
||||
new charts.Series<LinearSales, int>( |
||||
id: 'Sales', |
||||
colorFn: (LinearSales sales, __) => |
||||
sales.color, |
||||
domainFn: (LinearSales sales, _) => |
||||
sales.year, |
||||
measureFn: (LinearSales sales, _) => |
||||
sales.sales, |
||||
data: [ |
||||
new LinearSales(0, 66, charts.Color.fromHex(code: "#313CA9")), |
||||
new LinearSales(1, 998, charts.Color.fromHex(code: "#30415B")), |
||||
new LinearSales(2, 155, charts.Color.fromHex(code: "#30415B")), |
||||
], |
||||
// Set a label accessor to control the text of the arc label. |
||||
labelAccessorFn: (LinearSales row, _) => |
||||
'${(row.sales)} 笔', |
||||
), |
||||
]), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -1,162 +0,0 @@
|
||||
import 'dart:convert'; |
||||
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/coupon.dart'; |
||||
import 'package:huixiang/retrofit/data/page.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/coupon_details_dialog.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:huixiang/view_widget/new_coupon_widget.dart'; |
||||
import 'package:huixiang/view_widget/no_data_view.dart'; |
||||
import 'package:huixiang/view_widget/receive_success.dart'; |
||||
import 'package:huixiang/view_widget/selector_store_dialog.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../utils/font_weight.dart'; |
||||
|
||||
class TradeSummary extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _TradeSummary(); |
||||
} |
||||
} |
||||
|
||||
class _TradeSummary extends State<TradeSummary> { |
||||
ApiService apiService; |
||||
final RefreshController _refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
body: Column( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFD8D8D8), |
||||
width:double.infinity, |
||||
height: 1.h, |
||||
), |
||||
Expanded(child: SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: scrollController, |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() {}); |
||||
}, |
||||
child: SingleChildScrollView( |
||||
physics: NeverScrollableScrollPhysics(), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF6F6F6), |
||||
borderRadius: BorderRadius.circular(2), |
||||
border: Border.all(color: Color(0xFFCFD0D1), width: 1.w), |
||||
), |
||||
margin: EdgeInsets.only(top: 16.h,right: 20.w,left: 20.w,bottom:12.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"日报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"周报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"月报", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
Expanded(child:Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2), |
||||
// color: Color(0xFF30415B), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical:9.h), |
||||
child: Text( |
||||
"自定义", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
),), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,123 @@
|
||||
import 'package:flutter/material.dart'; |
||||
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'; |
||||
|
||||
class AccountInformation extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _AccountInformation(); |
||||
} |
||||
} |
||||
|
||||
class _AccountInformation extends State<AccountInformation> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return |
||||
Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "账号信息", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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: 16.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("账号","22221ff"), |
||||
Container( |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
color: Color(0xFFEBECEF), |
||||
margin: EdgeInsets.only(top:2.h,bottom: 16.h) |
||||
), |
||||
textItem("电话","13466667777"), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget textItem(left,right){ |
||||
return Container( |
||||
padding: EdgeInsets.only(bottom: 16.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
left, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.medium),)), |
||||
Text( |
||||
right, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.medium),), |
||||
], |
||||
) |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,197 @@
|
||||
import 'package:flutter/material.dart'; |
||||
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'; |
||||
|
||||
class MerchantInfo extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _MerchantInfo(); |
||||
} |
||||
} |
||||
|
||||
class _MerchantInfo extends State<MerchantInfo> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
bool checkState = false; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return |
||||
Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "商户信息", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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, |
||||
), |
||||
], |
||||
), |
||||
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)), |
||||
), |
||||
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)), |
||||
), |
||||
Text( |
||||
"否", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.medium),), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget textItem(left,right){ |
||||
return Container( |
||||
padding: EdgeInsets.only(bottom: 16.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Text( |
||||
left, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF808080), |
||||
fontWeight: MyFontWeight.medium),)), |
||||
Expanded(child: |
||||
Text( |
||||
right, |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
textAlign: TextAlign.right, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.medium),),flex: 3,), |
||||
], |
||||
) |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,67 @@
|
||||
import 'package:flutter/material.dart'; |
||||
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 '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class SecuritySetting extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _SecuritySetting(); |
||||
} |
||||
} |
||||
|
||||
class _SecuritySetting extends State<SecuritySetting> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return |
||||
Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "安全设置", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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: [ |
||||
|
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,311 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
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 '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class BusinessOrderDetail extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessOrderDetail(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessOrderDetail extends State<BusinessOrderDetail> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "订单详情", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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: NeverScrollableScrollPhysics(), |
||||
child: Container( |
||||
margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), |
||||
child: Column( |
||||
children: [goodsInfo(), orderInfo()], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///商品信息 |
||||
Widget goodsInfo() { |
||||
return Container( |
||||
padding: EdgeInsets.all(12), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular( |
||||
2, |
||||
), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 2.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right: 4.w), |
||||
), |
||||
Expanded( |
||||
child: Text( |
||||
"商品信息", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
)), |
||||
Text( |
||||
"已完成", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFFFA5151), |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
) |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount: 5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () {}, |
||||
child: goodsInfoItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget goodsInfoItem() { |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 12.h), |
||||
height: 77.h, |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/hot_list.webp", |
||||
width: 77, |
||||
height: 77, |
||||
fit: BoxFit.fill, |
||||
), |
||||
SizedBox( |
||||
width: 12.w, |
||||
), |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"御林古桑园啤酒节大肠包小肠美味...", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
)), |
||||
Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"×1", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
)), |
||||
Text( |
||||
"¥12", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
) |
||||
], |
||||
) |
||||
], |
||||
)) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///订单信息 |
||||
Widget orderInfo() { |
||||
return Container( |
||||
padding: EdgeInsets.all(12), |
||||
margin: EdgeInsets.only(top: 12.h,bottom:30.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular( |
||||
2, |
||||
), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 2.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right: 4.w), |
||||
), |
||||
Text( |
||||
"订单信息", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
) |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: Text( |
||||
"订单号", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF808080), |
||||
), |
||||
)), |
||||
Text( |
||||
"1222222222222222", |
||||
textAlign: TextAlign.end, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular( |
||||
2, |
||||
), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1.w, |
||||
), |
||||
), |
||||
padding: EdgeInsets.symmetric(horizontal: 7.w, vertical: 2.h), |
||||
margin: EdgeInsets.only(left: 4.w), |
||||
child: Text( |
||||
"复制", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
color: Color(0xFF30415B), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
orderInfoItem("创建时间", "2022-08-09 12:33:12"), |
||||
orderInfoItem("门店", "海峡姐妹茶"), |
||||
orderInfoItem("用户名", "2233"), |
||||
orderInfoItem("手机号", "17671877666"), |
||||
orderInfoItem("订单金额", "766"), |
||||
orderInfoItem("创建时间", "海峡姐妹茶"), |
||||
orderInfoItem("优惠金额", "22.33"), |
||||
orderInfoItem("实付金额", "2233.00"), |
||||
orderInfoItem("预约时间", "2022-08-09 12:33:12"), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget orderInfoItem(leftText, rightText) { |
||||
return Container( |
||||
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
leftText, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF808080), |
||||
), |
||||
), |
||||
SizedBox(width: 10.w), |
||||
Expanded( |
||||
child: Text( |
||||
rightText, |
||||
textAlign: TextAlign.end, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.regular), |
||||
), |
||||
flex: 1, |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,275 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../../utils/font_weight.dart'; |
||||
|
||||
class OrderList extends StatefulWidget { |
||||
final int status; |
||||
OrderList(this.status); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _OrderList(); |
||||
} |
||||
} |
||||
|
||||
class _OrderList extends State<OrderList> { |
||||
final RefreshController _refreshController = RefreshController(); |
||||
ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); |
||||
final ScrollController controller = ScrollController(); |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_refreshController.dispose(); |
||||
} |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
_onRefresh() async {} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return SmartRefresher( |
||||
controller: _refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader(), |
||||
physics: BouncingScrollPhysics(), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
setState(() { |
||||
_onRefresh(); |
||||
}); |
||||
}, |
||||
child:Padding(padding:EdgeInsets.symmetric(vertical: 16.w), |
||||
child: ListView.builder( |
||||
itemCount: 5, |
||||
physics: BouncingScrollPhysics(), |
||||
shrinkWrap: true, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed('/router/business_order_detail'); |
||||
}, |
||||
child: orderItem(), |
||||
); |
||||
}, |
||||
),), |
||||
); |
||||
} |
||||
|
||||
Widget orderItem() { |
||||
return Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
margin: EdgeInsets.only(left: 16.w,right: 16.w,bottom: 16.h), |
||||
padding:EdgeInsets.symmetric(vertical: 12.h), |
||||
child: Column( |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:12.h,left: 12.w,right: 12.w), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_switch_shop.webp", |
||||
width:16, |
||||
height:16, |
||||
), |
||||
SizedBox(width: 3.w,), |
||||
Expanded(child: Text( |
||||
"海峡姐妹奶茶", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
)), |
||||
Text( |
||||
widget.status == 0 ?"全部":widget.status == 1 ? "未付款":widget.status == 2 ? "已付款":"已退款", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFFFA5151), |
||||
fontWeight: MyFontWeight.semi_bold |
||||
), |
||||
) |
||||
], |
||||
),), |
||||
Container( |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
color: Color(0xFFF4F6F7), |
||||
), |
||||
Padding(padding:EdgeInsets.symmetric(horizontal: 12.w), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
height:170.h, |
||||
margin: EdgeInsets.only(top: 17.h,bottom:13.h), |
||||
child: |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:6, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: orderGoodsList(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
Row(children: [ |
||||
Text( |
||||
"订单编号:", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
), |
||||
Padding(padding:EdgeInsets.only(left: 14.w), |
||||
child: |
||||
Text( |
||||
"1223211111112333333", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
),), |
||||
],), |
||||
SizedBox(height: 4.h,), |
||||
Row(children: [ |
||||
Text( |
||||
"支付时间::", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
), |
||||
SizedBox(width: 14.w,), |
||||
Expanded(child: Text( |
||||
"2022-08-09 12:33:12", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF7A797F), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
),), |
||||
Text( |
||||
"¥245", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF181818), |
||||
fontWeight: MyFontWeight.medium |
||||
), |
||||
), |
||||
],), |
||||
SizedBox(height:20.h,), |
||||
Row( |
||||
children: [ |
||||
Spacer(), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/order_write_off'); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(4), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 26.w), |
||||
margin: EdgeInsets.only(right:20.h), |
||||
child:Text( |
||||
"核销", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Colors.white, |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
), |
||||
), |
||||
),GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/request_refund'); |
||||
}, |
||||
child: Container( |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(4), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1, |
||||
), |
||||
), |
||||
padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 14.w), |
||||
child:Text( |
||||
"申请退款", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
color: Color(0xFF30415B), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
) |
||||
|
||||
], |
||||
),), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget orderGoodsList(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom: 13.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"葡萄榨汁饮料", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.medium |
||||
), |
||||
)), |
||||
Text( |
||||
"x1", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF000000), |
||||
fontWeight: MyFontWeight.regular |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,299 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
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 '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class OrderWriteOff extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _OrderWriteOff(); |
||||
} |
||||
} |
||||
|
||||
class _OrderWriteOff extends State<OrderWriteOff> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
var writeOffCheck = false; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "核销", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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: NeverScrollableScrollPhysics(), |
||||
child: Container( |
||||
margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), |
||||
child: Column( |
||||
children: [ |
||||
basicInfo(), |
||||
writeOffInfo(), |
||||
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, |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///基本信息 |
||||
Widget basicInfo() { |
||||
return Container( |
||||
padding: EdgeInsets.all(12), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular( |
||||
2, |
||||
), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 2.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right: 4.w), |
||||
), |
||||
Text( |
||||
"基础信息", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
basicInfoItem("票券名称:","单人尊享票"), |
||||
basicInfoItem("用户名称::","李哈哈"), |
||||
basicInfoItem("票券编号::","177777622222223"), |
||||
basicInfoItem("订单编号::","7666677777777772233") |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget basicInfoItem(leftText, rightText) { |
||||
return Container( |
||||
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
leftText, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF808080), |
||||
), |
||||
), |
||||
SizedBox(width: 10.w), |
||||
Text( |
||||
rightText, |
||||
textAlign: TextAlign.end, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF1A1A1A), |
||||
fontWeight: MyFontWeight.regular), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///待核销信息 |
||||
Widget writeOffInfo() { |
||||
return Container( |
||||
padding: EdgeInsets.all(12), |
||||
margin: EdgeInsets.only(top: 12.h,bottom:30.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular( |
||||
2, |
||||
), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x0F06152E).withAlpha(12), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container( |
||||
width: 2.w, |
||||
height: 16.h, |
||||
color: Color(0xFF30415B), |
||||
margin: EdgeInsets.only(right: 4.w), |
||||
), |
||||
Text( |
||||
"待核销项", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.semi_bold), |
||||
) |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 17.h, |
||||
), |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount: 3, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () {}, |
||||
child: writeOffInfoItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget writeOffInfoItem(){ |
||||
return Container( |
||||
width: double.infinity, |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"台湾天然手作牡丹茶*1(牡丹野餐区茶饮车兑换)", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.regular, |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
)), |
||||
Expanded(child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right:10.w), |
||||
child: Text( |
||||
"已核销", |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 12.sp, |
||||
color: Color(0xFFACACAC), |
||||
), |
||||
),), |
||||
SizedBox(height:25.h,), |
||||
Checkbox( |
||||
value: writeOffCheck, |
||||
onChanged: (a) { |
||||
setState(() { |
||||
writeOffCheck = !writeOffCheck; |
||||
}); |
||||
}, |
||||
shape: RoundedRectangleBorder( |
||||
borderRadius: BorderRadius.circular(2.0), |
||||
), |
||||
checkColor: Color(0xFFFFFFFF), |
||||
fillColor:MaterialStateProperty.all(Color(0xFF30415B)), |
||||
), |
||||
], |
||||
)) |
||||
], |
||||
), |
||||
// Align( |
||||
// alignment: Alignment.centerRight, |
||||
// child:Container( |
||||
// decoration: BoxDecoration( |
||||
// color: Colors.white, |
||||
// borderRadius: BorderRadius.circular( |
||||
// 2, |
||||
// ), |
||||
// border: Border.all( |
||||
// color: Color(0xFFCFCFCF), |
||||
// width: 1.w, |
||||
// ), |
||||
// ), |
||||
// child: Icon( |
||||
// Icons.check, |
||||
// color: Color(0xFFCFCFCF), |
||||
// size: 14.w, |
||||
// ) |
||||
// ),), |
||||
Container( |
||||
margin: EdgeInsets.only(bottom:11.h,top: 13.h), |
||||
width: double.infinity, |
||||
height: 1.h, |
||||
color: Color(0xFFEBECEF), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,105 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
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 '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class RequestRefund extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _RequestRefund(); |
||||
} |
||||
} |
||||
|
||||
class _RequestRefund extends State<RequestRefund> { |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return |
||||
Scaffold( |
||||
backgroundColor: Color(0xFFF8F8FA), |
||||
appBar: MyAppBar( |
||||
title: "申请退款", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
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, |
||||
), |
||||
], |
||||
), |
||||
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, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:33.h,), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |