You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
499 lines
17 KiB
499 lines
17 KiB
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), |
|
), |
|
),), |
|
], |
|
), |
|
); |
|
} |
|
}
|
|
|