登录页(ok), 首页,首页今日流水跳转,门店切换(待修改未完结)(ok),首页细节跳转页面为完结,统计图ui待修改; 底部按钮(ok);wr_2023_business
After Width: | Height: | Size: 840 B |
After Width: | Height: | Size: 662 B |
After Width: | Height: | Size: 922 B |
After Width: | Height: | Size: 880 B |
After Width: | Height: | Size: 768 B |
After Width: | Height: | Size: 834 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 742 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 914 B |
After Width: | Height: | Size: 944 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 922 B |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 914 B |
After Width: | Height: | Size: 840 B |
After Width: | Height: | Size: 840 B |
After Width: | Height: | Size: 644 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 818 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 355 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 648 B |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 648 B |
After Width: | Height: | Size: 656 B |
After Width: | Height: | Size: 636 B |
After Width: | Height: | Size: 656 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 950 B |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 706 B |
After Width: | Height: | Size: 668 B |
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 672 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 636 B |
After Width: | Height: | Size: 644 B |
After Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 926 B |
@ -0,0 +1,224 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:huixiang/business_system/goods/business_goods_page.dart'; |
||||
import 'package:huixiang/business_system/mine/business_mine_page.dart'; |
||||
import 'package:huixiang/business_system/order/business_order_page.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/retrofit/data/activity.dart'; |
||||
import 'package:huixiang/retrofit/data/base_data.dart'; |
||||
import 'package:huixiang/retrofit/data/store_info.dart'; |
||||
import 'package:huixiang/retrofit/min_api.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/store/shopping/shopping_cart/shopping_cart_page.dart'; |
||||
import 'package:huixiang/store/shopping/shopping_home/shopping_home_page.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
import 'home/business_home_page.dart'; |
||||
|
||||
class BusinessPage extends StatefulWidget { |
||||
final arguments; |
||||
|
||||
BusinessPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessPage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessPage extends State<BusinessPage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
MinApiService minService; |
||||
int choiceIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Stack( |
||||
children: [ |
||||
Container( |
||||
color: Color(0xFFF7F7F7), |
||||
), |
||||
Stack( |
||||
children: [ |
||||
if(choiceIndex == 0) |
||||
BusinessHomePage(), |
||||
|
||||
if(choiceIndex == 1) |
||||
BusinessOrderPage(), |
||||
|
||||
if(choiceIndex == 2) |
||||
BusinessHomePage(), |
||||
|
||||
if(choiceIndex == 3) |
||||
BusinessGoodsPage(), |
||||
|
||||
if(choiceIndex == 4) |
||||
BusinessMinePage(), |
||||
|
||||
Align( |
||||
alignment: Alignment.bottomCenter, |
||||
child: Container( |
||||
height:95.h, |
||||
width: double.infinity, |
||||
padding: EdgeInsets.only(top: 30.h), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Expanded( |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
choiceIndex = 0; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
choiceIndex == 0 |
||||
? "assets/image/business_home.webp" |
||||
: "assets/image/business_ home_h.webp", |
||||
width: 30, |
||||
height: 30, |
||||
), |
||||
SizedBox(height: 5.h,), |
||||
Text( |
||||
"首页", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: choiceIndex == 0 |
||||
? Color(0xFF4C4C4C) |
||||
: Color(0xFFACACAC), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
choiceIndex = 1; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
(choiceIndex == 0 || choiceIndex == 2 || choiceIndex == 3 || choiceIndex == 4) |
||||
? "assets/image/business_order_h.webp" |
||||
: "assets/image/business_order.webp", |
||||
width: 30, |
||||
height: 30, |
||||
), |
||||
SizedBox(height: 5.h,), |
||||
Text( |
||||
"订单", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: (choiceIndex == 0 || choiceIndex == 2 || choiceIndex == 3 || choiceIndex == 4) |
||||
? Color(0xFFACACAC) |
||||
: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
choiceIndex = 2; |
||||
}); |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/business_scan_code.webp", |
||||
width: 52, |
||||
height: 52, |
||||
), |
||||
)), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
choiceIndex = 3; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
(choiceIndex == 0 || choiceIndex == 1 || choiceIndex == 2 || choiceIndex == 4) |
||||
? "assets/image/business_goods_h.webp" |
||||
: "assets/image/business_goods.webp", |
||||
width: 30, |
||||
height: 30, |
||||
), |
||||
SizedBox(height: 5.h,), |
||||
Text( |
||||
"商品", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: (choiceIndex == 0 || choiceIndex == 1 || choiceIndex == 2 || choiceIndex == 4) |
||||
? Color(0xFFACACAC) |
||||
: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Expanded( |
||||
child: GestureDetector( |
||||
onTap: () { |
||||
setState(() { |
||||
choiceIndex = 4; |
||||
}); |
||||
}, |
||||
child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
(choiceIndex == 0 || choiceIndex == 1 || choiceIndex == 2 || choiceIndex == 3) |
||||
? "assets/image/business_mine_h.webp" |
||||
: "assets/image/business_mine.webp", |
||||
width: 30, |
||||
height: 30, |
||||
), |
||||
SizedBox(height: 5.h,), |
||||
Text( |
||||
"我的", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: (choiceIndex == 0 || choiceIndex == 1 || choiceIndex == 2 || choiceIndex == 3) |
||||
? Color(0xFFACACAC) |
||||
: Color(0xFF4C4C4C), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |
@ -0,0 +1,70 @@
|
||||
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'; |
||||
|
||||
class BusinessGoodsPage extends StatefulWidget { |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessGoodsPage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessGoodsPage extends State<BusinessGoodsPage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Column( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
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: [ |
||||
Text("商品管理") |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 76.h, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |
@ -0,0 +1,932 @@
|
||||
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'; |
||||
import 'my_line_chart.dart'; |
||||
|
||||
class BusinessHomePage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessHomePage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessHomePage extends State<BusinessHomePage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
List<LineChartSample2Data> lineChartSample2Data = |
||||
[LineChartSample2Data(0,100,"2023-06-20"), |
||||
LineChartSample2Data(1,200,"2023-06-21"), |
||||
LineChartSample2Data(2,400,"2023-06-22"), |
||||
LineChartSample2Data(3,10,"2023-06-23"), |
||||
LineChartSample2Data(4,250,"2023-06-24"), |
||||
LineChartSample2Data(5,175,"2023-06-25"), |
||||
LineChartSample2Data(6,500,"2023-06-26")]; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Column( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
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: [ |
||||
homeTop(), |
||||
businessOverview(), |
||||
userOverview(), |
||||
hotSellHotCharts(), |
||||
todayFlow(), |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 76.h, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
///首页头部 |
||||
Widget homeTop() { |
||||
return Container( |
||||
color: Color(0xFF30415B), |
||||
width: double.infinity, |
||||
padding: EdgeInsets.only( |
||||
top: MediaQuery.of(context).padding.top + 23.h, |
||||
bottom: 16.h, |
||||
left: 16.w, |
||||
right: 16.w), |
||||
child: Column( |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: (){ |
||||
showAlertDialog(); |
||||
}, |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_more.webp", |
||||
width: 16.w, |
||||
height: 13.h, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 7.w), |
||||
child: Text( |
||||
"海峽姐妹茶 郑州新田360店", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 14.h, |
||||
), |
||||
Container( |
||||
padding: EdgeInsets.symmetric(horizontal: 23.w, vertical: 12.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(4), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_home_bill.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 3.w), |
||||
child: Text( |
||||
"营业额(元)", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 6.h, bottom: 17.h), |
||||
child: Text( |
||||
"1288890.00", |
||||
style: TextStyle( |
||||
fontSize: 24.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_trade_num.webp", |
||||
width: 16, |
||||
height: 16, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 3.w), |
||||
child: Text( |
||||
"交易笔数", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 5.h), |
||||
child: Text( |
||||
"12", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Expanded( |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_refund.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 3.w), |
||||
child: Text( |
||||
"退款金额(元)", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 5.h), |
||||
child: Text( |
||||
"12999.00", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Expanded( |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.end, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_refund_num.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 3.w), |
||||
child: Text( |
||||
"退款笔数", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 5.h), |
||||
child: Text( |
||||
"129", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
)) |
||||
], |
||||
), |
||||
], |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///侧面弹窗 |
||||
showAlertDialog() { |
||||
showCupertinoModalPopup( |
||||
builder: (BuildContext context) { |
||||
return StatefulBuilder(builder: ( |
||||
context, |
||||
state, |
||||
) { |
||||
return WillPopScope( |
||||
///点击背景不收起弹窗; |
||||
// onWillPop: () async => false, |
||||
child: Container( |
||||
width: double.infinity, |
||||
margin: EdgeInsets.only(right:61.w), |
||||
height: double.infinity, |
||||
padding: EdgeInsets.only(top: 55.h), |
||||
decoration: new BoxDecoration( |
||||
color: Colors.white, |
||||
), |
||||
child: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Container( |
||||
child: |
||||
Column( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
padding:EdgeInsets.only(left:14.w,bottom: 33.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/default_user.webp", |
||||
width:57, |
||||
height:57, |
||||
), |
||||
SizedBox(width: 10.w,), |
||||
Expanded(child: |
||||
Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children:[ |
||||
Text("前进麦味烘焙*海峡姐妹茶", |
||||
maxLines: 1, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF1A1A1A) |
||||
),), |
||||
SizedBox(height: 5.h,), |
||||
Text("123****1234", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF4D4D4D) |
||||
),), |
||||
], |
||||
)) |
||||
], |
||||
), |
||||
), |
||||
Padding(padding: EdgeInsets.only(left: 16.w,bottom: 22.h), |
||||
child: |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_switch_shop.webp", |
||||
width:24, |
||||
height:24, |
||||
), |
||||
SizedBox(width: 4.w,), |
||||
Text("门店切换", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF1A1A1A) |
||||
),), |
||||
], |
||||
),), |
||||
Container( |
||||
height: 450.h, |
||||
child: ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: shopItem(), |
||||
); |
||||
}, |
||||
), |
||||
) |
||||
, |
||||
Container( |
||||
alignment: Alignment.center, |
||||
width: double.infinity, |
||||
padding: EdgeInsets.symmetric(vertical: 9.h), |
||||
margin: EdgeInsets.only(left:16.w,right: 16.w,bottom: 103.h,top: 20.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
), |
||||
child:Text("退出登录", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white |
||||
),),), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
),); |
||||
}); |
||||
}, |
||||
context: context); |
||||
} |
||||
|
||||
///门店选择 |
||||
Widget shopItem(){ |
||||
return Container( |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFF8F9FA), |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
), |
||||
margin:EdgeInsets.only(bottom: 11.h), |
||||
padding: EdgeInsets.only(top: 5.h,bottom: 8.h,left: 16.w,right: 17.w), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child:Text("前进麦味烘焙*海峡姐妹茶(哈乐城店)", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B) |
||||
),)), |
||||
Icon( |
||||
Icons.check, |
||||
size: 20, |
||||
color: Color(0xFF4D4D4D),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///生意总览 |
||||
Widget businessOverview() { |
||||
return Container( |
||||
padding: |
||||
EdgeInsets.only(left: 16.w, right: 21.w, top: 12.h, bottom: 16.h), |
||||
color: Colors.white, |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B)), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 12.w, right: 8.w), |
||||
child: Text( |
||||
"生意总览", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Expanded( |
||||
child: Text( |
||||
"近一周订单量趋势", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0x99000000), |
||||
), |
||||
)), |
||||
Text( |
||||
"更多数据", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF252626), |
||||
), |
||||
), |
||||
SizedBox(width: 5.w,), |
||||
Image.asset( |
||||
"assets/image/bs_right.webp", |
||||
width: 8.w, |
||||
height: 12.h, |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 18.h, |
||||
), |
||||
LineChartSample2(lineChartSample2Data), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///用户概览 |
||||
Widget userOverview() { |
||||
return Container( |
||||
color: Colors.white, |
||||
margin: EdgeInsets.only(top: 16.h), |
||||
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 12.h), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B)), |
||||
Padding( |
||||
padding: EdgeInsets.only( |
||||
left: 12.w, |
||||
), |
||||
child: Text( |
||||
"用户概览", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 12.h, |
||||
), |
||||
Row( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
padding: EdgeInsets.symmetric(horizontal: 8.w,vertical:6.h), |
||||
decoration: BoxDecoration( |
||||
gradient: LinearGradient( |
||||
colors: [Color(0xFFFC5A58), Color(0xFFFF716F)], |
||||
begin: Alignment.topCenter, |
||||
end: Alignment.bottomCenter, |
||||
), |
||||
borderRadius: BorderRadius.circular(6.w), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 6.w), |
||||
child: Text( |
||||
"今日会员充值", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_query_logo.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 7.h, |
||||
), |
||||
Text( |
||||
"108088", |
||||
style: TextStyle( |
||||
fontSize: 24.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
SizedBox(width:9.w,), |
||||
Expanded( |
||||
child: Container( |
||||
padding: EdgeInsets.symmetric(horizontal: 8.w,vertical:6.h), |
||||
decoration: BoxDecoration( |
||||
gradient: LinearGradient( |
||||
colors: [Color(0xFFFFA238), Color(0xFFFFBA6D)], |
||||
begin: Alignment.topCenter, |
||||
end: Alignment.bottomCenter, |
||||
), |
||||
borderRadius: BorderRadius.circular(6.w), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 6.w), |
||||
child: Text( |
||||
"今日新增会员", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_query_logo.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 7.h, |
||||
), |
||||
Text( |
||||
"666", |
||||
style: TextStyle( |
||||
fontSize: 24.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
SizedBox(width:9.w,), |
||||
Expanded( |
||||
child: Container( |
||||
padding: EdgeInsets.symmetric(horizontal: 8.w,vertical:6.h), |
||||
decoration: BoxDecoration( |
||||
gradient: LinearGradient( |
||||
colors: [Color(0xFF4B77FC), Color(0xFF7091FF)], |
||||
begin: Alignment.topCenter, |
||||
end: Alignment.bottomCenter, |
||||
), |
||||
borderRadius: BorderRadius.circular(6.w), |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Padding(padding: EdgeInsets.only(right: 6.w), |
||||
child: Text( |
||||
"总会员数", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Colors.white, |
||||
), |
||||
),), |
||||
Image.asset( |
||||
"assets/image/bs_query_logo.webp", |
||||
width: 14, |
||||
height: 14, |
||||
), |
||||
], |
||||
), |
||||
SizedBox( |
||||
height: 7.h, |
||||
), |
||||
Text( |
||||
"23455", |
||||
style: TextStyle( |
||||
fontSize: 24.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///热销榜单 |
||||
Widget hotSellHotCharts(){ |
||||
return Container( |
||||
color: Colors.white, |
||||
margin: EdgeInsets.only(top: 16.h), |
||||
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), |
||||
child: Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B)), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 12.w,), |
||||
child: Text( |
||||
"热销榜单", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:14.h,), |
||||
Container( |
||||
height:25.h, |
||||
margin:EdgeInsets.only(bottom:26.h), |
||||
child: ListView.builder( |
||||
scrollDirection: Axis.horizontal, |
||||
physics: BouncingScrollPhysics(), |
||||
itemCount:4, |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: dayItem(), |
||||
); |
||||
}, |
||||
), |
||||
), |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: salesVolumeItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///天数item |
||||
Widget dayItem(){ |
||||
return Container( |
||||
padding: EdgeInsets.symmetric(horizontal:19.w,), |
||||
alignment: Alignment.center, |
||||
margin: EdgeInsets.only(right:16.w), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(2.w), |
||||
// color: Color(0xFF30415B), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1.w, |
||||
), |
||||
), |
||||
child: Text( |
||||
"今天", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0XFF30415B), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///销量item |
||||
Widget salesVolumeItem(){ |
||||
return Container( |
||||
padding: EdgeInsets.only(bottom:12.h), |
||||
child: Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_trophy_one.webp", |
||||
width:26, |
||||
height:26, |
||||
), |
||||
// Text( |
||||
// "1", |
||||
// style: TextStyle( |
||||
// fontSize: 12.sp, |
||||
// fontWeight: MyFontWeight.regular, |
||||
// color: Color(0xFF0D0D0D), |
||||
// ), |
||||
// ), |
||||
SizedBox(width:8.w,), |
||||
Expanded(child:Text( |
||||
"满杯花青素", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
),), |
||||
Text( |
||||
"已售", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
Padding(padding:EdgeInsets.only(left: 7.w), |
||||
child: Text( |
||||
"1888件", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
),) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///今日流水 |
||||
Widget todayFlow(){ |
||||
return Container( |
||||
color: Colors.white, |
||||
margin: EdgeInsets.only(top: 16.h), |
||||
padding: EdgeInsets.only(left: 16.w, right:21.w, top: 12.h, bottom: 16.h), |
||||
child:Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Container(width: 4.w, height: 16.h, color: Color(0xFF30415B),margin: EdgeInsets.only(right:12.w),), |
||||
Expanded( |
||||
child: Text( |
||||
"今日流水", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
)), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).pushNamed('/router/flow_page'); |
||||
}, |
||||
child: Row( |
||||
children: [ |
||||
Text( |
||||
"更多数据", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF252626), |
||||
), |
||||
), |
||||
SizedBox(width:5.w,), |
||||
Image.asset( |
||||
"assets/image/bs_right.webp", |
||||
width: 8.w, |
||||
height: 12.h, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:20.h,), |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: flowItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///流水item |
||||
Widget flowItem(){ |
||||
return Container( |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(0.w), |
||||
color: Color(0xFFF3F7FF), |
||||
), |
||||
margin: EdgeInsets.only(bottom: 12.h), |
||||
padding: EdgeInsets.symmetric(horizontal: 17.w, vertical:8.h), |
||||
child:Row( |
||||
children: [ |
||||
Expanded(child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
"2023-06-04 9:00:05", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xD9000000), |
||||
), |
||||
), |
||||
SizedBox(height:7.h,), |
||||
Text( |
||||
"海峽姐妹茶 郑州新田360店", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0x99000000), |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text:"+", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xD9000000), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "34.00", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xD9000000), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |
@ -0,0 +1,236 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.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 FlowPage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _FlowPage(); |
||||
} |
||||
} |
||||
|
||||
class _FlowPage extends State<FlowPage> { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
var isShowMore = 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: [ |
||||
Row( |
||||
children: [ |
||||
Text( |
||||
"2023年6月", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
Icon( |
||||
Icons.keyboard_arrow_down, |
||||
color: Color(0xFF0D0D0D), |
||||
size: 24, |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height: 16.h,), |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: billItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///月份账单大概 |
||||
Widget billItem(){ |
||||
return Container( |
||||
padding: EdgeInsets.all(12.h), |
||||
margin: EdgeInsets.only(bottom:12.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8.w), |
||||
), |
||||
child:Column( |
||||
children: [ |
||||
GestureDetector( |
||||
onTap: (){ |
||||
setState((){ |
||||
isShowMore = !isShowMore; |
||||
}); |
||||
}, |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"06/10", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
)), |
||||
Icon( |
||||
isShowMore ? Icons.keyboard_arrow_up :Icons.keyboard_arrow_down, |
||||
color: Color(0xFF0D0D0D), |
||||
size: 24, |
||||
), |
||||
], |
||||
), |
||||
), |
||||
SizedBox(height:15.h,), |
||||
Row( |
||||
children: [ |
||||
Expanded(child: Text( |
||||
"交易金额 76555.22元", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
)), |
||||
Text( |
||||
"共76笔", |
||||
style: TextStyle( |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
SizedBox(height:20.h,), |
||||
if(isShowMore) |
||||
ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:5, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
|
||||
}, |
||||
child: billIDetailsItem(), |
||||
); |
||||
}, |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
///月份账单明细 |
||||
Widget billIDetailsItem(){ |
||||
return Container( |
||||
margin: EdgeInsets.only(bottom:20.h), |
||||
child: Row( |
||||
children: [ |
||||
Expanded(child: |
||||
Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding(padding:EdgeInsets.only(bottom:15.h), |
||||
child:Text( |
||||
"11:20:12", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
),), |
||||
Text( |
||||
"JJJJ", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
color: Color(0xFF1A1A1A), |
||||
), |
||||
), |
||||
], |
||||
),), |
||||
Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text:"+", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "22.33", |
||||
style: TextStyle( |
||||
fontSize: 18.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
], |
||||
) |
||||
); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,222 @@
|
||||
import 'package:fl_chart/fl_chart.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
|
||||
import '../../utils/font_weight.dart'; |
||||
|
||||
class LineChartSample2 extends StatefulWidget { |
||||
final List<LineChartSample2Data> lineChartSample2Data; |
||||
|
||||
LineChartSample2(this.lineChartSample2Data, {Key key}) : super(key: key); |
||||
|
||||
@override |
||||
State<LineChartSample2> createState() => _LineChartSample2State(); |
||||
} |
||||
|
||||
class _LineChartSample2State extends State<LineChartSample2> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return AspectRatio( |
||||
aspectRatio: 1.70, |
||||
child: LineChart( |
||||
mainData(), |
||||
swapAnimationDuration: Duration(milliseconds: 500), |
||||
swapAnimationCurve: Curves.decelerate, |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget bottomTitleWidgets(double value, TitleMeta meta) { |
||||
String text = widget.lineChartSample2Data[value.toInt()].time ?? ""; |
||||
if (text.length == 10) |
||||
text = text.substring(5, 10); |
||||
else if (text.length == 7) text = text.substring(2, 7); |
||||
text = text.replaceAll("-", "/"); |
||||
return SideTitleWidget( |
||||
axisSide: meta.axisSide, |
||||
child: Text(text, |
||||
style: const TextStyle( |
||||
fontWeight: MyFontWeight.light, |
||||
fontSize: 10, |
||||
color: Color(0xFF999999))), |
||||
); |
||||
} |
||||
|
||||
static double processDouble(double input) { |
||||
if (input < 10) return 10; |
||||
String inputString = input.toInt().toString().substring(1); |
||||
String outputString = ""; |
||||
bool flag = false; |
||||
for (int i = 0; i < inputString.length; i++) { |
||||
if (inputString[i] != "0") flag = true; |
||||
outputString += "0"; |
||||
} |
||||
if (flag) |
||||
outputString = |
||||
(int.parse(input.toString().substring(0, 1)) + 1).toString() + |
||||
outputString; |
||||
else |
||||
outputString = input.toString().substring(0, 1) + outputString; |
||||
return double.parse(outputString); |
||||
} |
||||
|
||||
Widget leftTitleWidgets(double value, TitleMeta meta) { |
||||
String text; |
||||
if (value >= 1000000000) { |
||||
text = '${value ~/ 1000000000}B'; |
||||
} else if (value >= 1000000) { |
||||
text = '${value ~/ 1000000}M'; |
||||
} else if (value >= 1000) { |
||||
text = '${value ~/ 1000}K'; |
||||
} else { |
||||
text = value.toInt().toString(); |
||||
} |
||||
return Text(text, |
||||
style: const TextStyle( |
||||
fontWeight: MyFontWeight.light, |
||||
fontSize: 10, |
||||
color: Color(0xFF999999)), |
||||
textAlign: TextAlign.left); |
||||
} |
||||
|
||||
LineChartData mainData() { |
||||
return LineChartData( |
||||
gridData: FlGridData( |
||||
show: false, |
||||
), |
||||
titlesData: FlTitlesData( |
||||
show: true, |
||||
rightTitles: AxisTitles( |
||||
sideTitles: SideTitles(showTitles: false), |
||||
), |
||||
topTitles: AxisTitles( |
||||
sideTitles: SideTitles(showTitles: false), |
||||
), |
||||
bottomTitles: AxisTitles( |
||||
sideTitles: SideTitles( |
||||
showTitles: true, |
||||
getTitlesWidget: bottomTitleWidgets, |
||||
), |
||||
), |
||||
leftTitles: AxisTitles( |
||||
sideTitles: SideTitles( |
||||
showTitles: true, |
||||
getTitlesWidget: leftTitleWidgets, |
||||
), |
||||
), |
||||
), |
||||
borderData: FlBorderData( |
||||
show: true, |
||||
border: Border( |
||||
bottom: BorderSide( |
||||
color: Color(0xFFCBCBCB), |
||||
width: 1, |
||||
), |
||||
left: BorderSide( |
||||
color: Color(0xFFCBCBCB), |
||||
width: 1, |
||||
), |
||||
), |
||||
), |
||||
minY: 0, |
||||
maxY: processDouble(widget.lineChartSample2Data |
||||
.map((e) => e.price ?? 0) |
||||
.reduce((value, element) => value > element ? value : element)), |
||||
lineTouchData: LineTouchData( |
||||
enabled: true, |
||||
getTouchedSpotIndicator: (barData, spotIndexes) { |
||||
return spotIndexes.map((spotIndex) { |
||||
return TouchedSpotIndicatorData( |
||||
FlLine( |
||||
color: Color(0xFF0D0D0D), |
||||
strokeWidth: 1, |
||||
dashArray: [5, 5], |
||||
), |
||||
FlDotData( |
||||
show: true, |
||||
getDotPainter: (spot, percent, barData, index) { |
||||
return FlDotCirclePainter( |
||||
radius: 3, |
||||
color: Colors.white, |
||||
strokeWidth: 2, |
||||
strokeColor: Color(0xFF0D0D0D), |
||||
); |
||||
}, |
||||
), |
||||
); |
||||
}).toList(); |
||||
}, |
||||
touchTooltipData: LineTouchTooltipData( |
||||
tooltipBgColor: Colors.transparent, |
||||
tooltipPadding: const EdgeInsets.all(0), |
||||
tooltipMargin: 5, |
||||
tooltipRoundedRadius: 0, |
||||
getTooltipItems: (touchedSpots) { |
||||
return touchedSpots.map((LineBarSpot touchedSpot) { |
||||
return LineTooltipItem( |
||||
'¥${touchedSpot.y.toInt()}', |
||||
const TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontWeight: MyFontWeight.light, |
||||
fontSize: 15), |
||||
); |
||||
}).toList(); |
||||
}, |
||||
), |
||||
), |
||||
lineBarsData: [ |
||||
LineChartBarData( |
||||
spots: widget.lineChartSample2Data |
||||
.map((e) => FlSpot(e.index ?? 0, e.price ?? 0)) |
||||
.toList(), |
||||
isCurved: true, |
||||
color: Color(0xFF0D0D0D), |
||||
barWidth: 1, |
||||
dotData: FlDotData( |
||||
show: true, |
||||
getDotPainter: (spot, percent, barData, index) { |
||||
return FlDotCirclePainter( |
||||
radius: 3, |
||||
color: Color(0xFF165DFF), |
||||
strokeWidth: 0, |
||||
); |
||||
}, |
||||
), |
||||
belowBarData: BarAreaData( |
||||
show: true, |
||||
gradient: LinearGradient( |
||||
colors: [Color(0x33165DFF), Color(0x00165DFF)], |
||||
begin: Alignment.topCenter, |
||||
end: Alignment.bottomCenter, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
); |
||||
} |
||||
} |
||||
|
||||
class LineChartSample2Data { |
||||
double _index; |
||||
double _price; |
||||
String _time; |
||||
|
||||
LineChartSample2Data(this._index, this._price, this._time); |
||||
|
||||
double get index => _index; |
||||
|
||||
set index(double value) { |
||||
_index = value; |
||||
} |
||||
|
||||
double get price => _price; |
||||
|
||||
set price(double value) { |
||||
_price = value; |
||||
} |
||||
|
||||
String get time => _time; |
||||
|
||||
set time(String value) { |
||||
_time = value; |
||||
} |
||||
} |
@ -0,0 +1,290 @@
|
||||
import 'dart:io'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/gestures.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
import '../../retrofit/retrofit_api.dart'; |
||||
import '../../utils/font_weight.dart'; |
||||
|
||||
class BusinessLoginPage extends StatefulWidget { |
||||
final Map<String, dynamic> arguments; |
||||
|
||||
BusinessLoginPage({this.arguments}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessLoginPage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessLoginPage extends State<BusinessLoginPage> { |
||||
TextEditingController _userPhoneController = TextEditingController(); |
||||
TextEditingController _passwordController = TextEditingController(); |
||||
bool _isShowPassword = false; |
||||
bool _isShowUserNameDel = false; |
||||
bool _agree = false; |
||||
bool _canClick = true; |
||||
ApiService apiService; |
||||
DateTime _lastQuitTime; |
||||
String _phoneInputTips, _pwdInputTips; |
||||
final TapGestureRecognizer tapGestureRecognizer = TapGestureRecognizer(); |
||||
var checkStatus = false; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
void dispose() { |
||||
super.dispose(); |
||||
_userPhoneController.removeListener(() {}); |
||||
_userPhoneController.dispose(); |
||||
_passwordController.dispose(); |
||||
} |
||||
|
||||
void refresh() { |
||||
if (!mounted) return; |
||||
setState(() {}); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.white, |
||||
resizeToAvoidBottomInset: false, |
||||
body: SingleChildScrollView( |
||||
physics: BouncingScrollPhysics(), |
||||
child: Container( |
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top), |
||||
child: Stack( |
||||
children: [ |
||||
Container( |
||||
padding: EdgeInsets.only(top: 54.h, left: 16.w, right: 17.w), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 5.w), |
||||
child: Text("您好!", |
||||
style: TextStyle( |
||||
fontSize: 26.sp, |
||||
color: Color(0xFF30415B), |
||||
fontWeight: MyFontWeight.bold)), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 5.w, top: 15.h), |
||||
child: Text("欢迎使用回乡收银商家APP", |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Color(0xFF30415B), |
||||
fontWeight: MyFontWeight.medium)), |
||||
), |
||||
SizedBox(height: 160.h), |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/business_phone.webp", |
||||
width:10.w, |
||||
height:15.h, |
||||
), |
||||
SizedBox(width:4.w), |
||||
Text("手机号码", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xD9000000), |
||||
fontWeight: MyFontWeight.bold)) |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(top: 13.h, bottom: 24.h), |
||||
child: TextField( |
||||
controller: _userPhoneController, |
||||
keyboardType: TextInputType.phone, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF000000), |
||||
fontWeight: MyFontWeight.regular), |
||||
decoration: InputDecoration( |
||||
hintText: "请输入手机号码", |
||||
hintStyle: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF262626), |
||||
fontWeight: MyFontWeight.regular), |
||||
contentPadding: EdgeInsets.only( |
||||
left: 12.w, top: 16.h, bottom: 15.h), |
||||
border: OutlineInputBorder( |
||||
borderRadius: BorderRadius.circular(4), |
||||
borderSide: BorderSide.none), |
||||
filled: true, |
||||
fillColor: Color(0xFFF8F9FA), |
||||
), |
||||
onChanged: (value) { |
||||
if (value.isEmpty) { |
||||
_phoneInputTips = "请输入手机号码"; |
||||
} else { |
||||
_phoneInputTips = null; |
||||
} |
||||
refresh(); |
||||
}, |
||||
), |
||||
), |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/business_code.webp", |
||||
width:12.w, |
||||
height:15.h, |
||||
), |
||||
SizedBox(width:4.w), |
||||
Text("密码", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xD9000000), |
||||
fontWeight: MyFontWeight.bold)) |
||||
], |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(top: 12.h, bottom: 75.h), |
||||
child: TextField( |
||||
controller: _passwordController, |
||||
keyboardType: TextInputType.phone, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF000000), |
||||
fontWeight: MyFontWeight.regular), |
||||
decoration: InputDecoration( |
||||
hintText: "请输入密码", |
||||
hintStyle: TextStyle( |
||||
fontSize: 14.sp, |
||||
color: Color(0xFF262626), |
||||
fontWeight: MyFontWeight.regular), |
||||
contentPadding: EdgeInsets.only( |
||||
left: 12.w, top: 16.h, bottom: 15.h), |
||||
border: OutlineInputBorder( |
||||
borderRadius: BorderRadius.circular(4), |
||||
borderSide: BorderSide.none), |
||||
filled: true, |
||||
fillColor: Color(0xFFF8F9FA), |
||||
), |
||||
onChanged: (value) { |
||||
if (value.isEmpty) { |
||||
_pwdInputTips = "请输入密码"; |
||||
} else { |
||||
_pwdInputTips = null; |
||||
} |
||||
refresh(); |
||||
}, |
||||
), |
||||
), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.opaque, |
||||
onTap: () { |
||||
Navigator.of(context).popAndPushNamed('/router/business_page'); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.symmetric(vertical: 15.h), |
||||
margin: EdgeInsets.only(bottom: 22.h), |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(4), |
||||
), |
||||
child: Text(S.of(context).login, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
color: Colors.white, |
||||
fontWeight: MyFontWeight.bold)), |
||||
), |
||||
), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Checkbox( |
||||
value: checkStatus, |
||||
onChanged: (a) { |
||||
setState(() { |
||||
checkStatus = !checkStatus; |
||||
}); |
||||
}, |
||||
checkColor: Color(0xFFFFFFFF), |
||||
fillColor: |
||||
MaterialStateProperty.all(Color(0xFF30415B)), |
||||
), |
||||
Expanded( |
||||
child: Text.rich( |
||||
TextSpan(children: [ |
||||
TextSpan( |
||||
text: S.of(context).privacy_policy1, |
||||
style: TextStyle( |
||||
fontSize: 11.sp, |
||||
color: Color(0xFF010101), |
||||
), |
||||
), |
||||
TextSpan( |
||||
// text: S.of(context).privacy_policy2, |
||||
text: "《一心回乡用户协议》", |
||||
recognizer: TapGestureRecognizer() |
||||
..onTap = () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/user_service_page'); |
||||
}, |
||||
style: TextStyle( |
||||
fontSize: 11.sp, |
||||
color: Color(0xFF010101), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "、", |
||||
style: TextStyle( |
||||
fontSize: 11.sp, |
||||
color: Colors.black, |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: S.of(context).privacy_policy3, |
||||
recognizer: tapGestureRecognizer, |
||||
style: TextStyle( |
||||
fontSize: 11.sp, |
||||
color: Color(0xFF010101), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: S.of(context).privacy_policy4, |
||||
style: TextStyle( |
||||
fontSize: 11.sp, |
||||
height: 1.2, |
||||
color: Color(0xFF010101), |
||||
), |
||||
), |
||||
]), |
||||
)), |
||||
SizedBox( |
||||
width: 30, |
||||
) |
||||
], |
||||
), |
||||
], |
||||
), |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(top: 98.h), |
||||
child: Image.asset( |
||||
"assets/image/business_login.webp", |
||||
fit: BoxFit.cover, |
||||
width: double.infinity, |
||||
height: 199.h, |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,74 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_swiper/flutter_swiper.dart'; |
||||
import 'package:huixiang/retrofit/data/home_recommend_list.dart'; |
||||
import 'package:huixiang/retrofit/data/shopping_home_config.dart'; |
||||
import 'package:huixiang/retrofit/min_api.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'; |
||||
|
||||
class BusinessMinePage extends StatefulWidget { |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessMinePage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessMinePage extends State<BusinessMinePage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Column( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
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: [ |
||||
Text("我的") |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 76.h, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |
@ -0,0 +1,70 @@
|
||||
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'; |
||||
|
||||
class BusinessOrderPage extends StatefulWidget { |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _BusinessOrderPage(); |
||||
} |
||||
} |
||||
|
||||
class _BusinessOrderPage extends State<BusinessOrderPage> |
||||
with AutomaticKeepAliveClientMixin { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
final ScrollController scrollController = ScrollController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
super.build(context); |
||||
return Column( |
||||
children: [ |
||||
Expanded( |
||||
child: Container( |
||||
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: [ |
||||
Text("订单列表") |
||||
], |
||||
)), |
||||
), |
||||
), |
||||
), |
||||
SizedBox( |
||||
height: 76.h, |
||||
), |
||||
], |
||||
); |
||||
} |
||||
|
||||
@override |
||||
bool get wantKeepAlive => true; |
||||
} |