Browse Source

生意总览:

总览(待更改);
wr_2023_business
wurong 2 years ago
parent
commit
ee3660cc1f
  1. 187
      lib/business_system/home/business_home_page.dart
  2. 178
      lib/business_system/home/home_view/home_sideslip_dialog.dart
  3. 2
      lib/business_system/home/home_view/my_line_chart.dart
  4. 79
      lib/business_system/home/trade_overview_page.dart
  5. 162
      lib/business_system/home/trade_summary.dart
  6. 4
      lib/main.dart

187
lib/business_system/home/business_home_page.dart

@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/business_system/home/home_view/home_sideslip_dialog.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
@ -7,7 +8,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../utils/font_weight.dart'; import '../../utils/font_weight.dart';
import 'my_line_chart.dart'; import 'home_view/my_line_chart.dart';
class BusinessHomePage extends StatefulWidget { class BusinessHomePage extends StatefulWidget {
@override @override
@ -17,7 +18,7 @@ class BusinessHomePage extends StatefulWidget {
} }
class _BusinessHomePage extends State<BusinessHomePage> class _BusinessHomePage extends State<BusinessHomePage>
with AutomaticKeepAliveClientMixin { with AutomaticKeepAliveClientMixin{
ApiService apiService; ApiService apiService;
final RefreshController refreshController = RefreshController(); final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
@ -35,6 +36,11 @@ class _BusinessHomePage extends State<BusinessHomePage>
super.initState(); super.initState();
} }
@override
void dispose() {
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
@ -62,7 +68,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
child: Column( child: Column(
children: [ children: [
homeTop(), homeTop(),
businessOverview(), tradeOverview(),
userOverview(), userOverview(),
hotSellHotCharts(), hotSellHotCharts(),
todayFlow(), todayFlow(),
@ -288,146 +294,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
/// ///
showAlertDialog() { showAlertDialog() {
showCupertinoModalPopup( showCupertinoModalPopup(
builder: (BuildContext context) { builder: (context) {
return StatefulBuilder(builder: ( return HomeSideslipDialog();},
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: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)
),),
],
),),
Expanded(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); 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() { Widget tradeOverview() {
return Container( return Container(
padding: padding:
EdgeInsets.only(left: 16.w, right: 21.w, top: 12.h, bottom: 16.h), EdgeInsets.only(left: 16.w, right: 21.w, top: 12.h, bottom: 16.h),
@ -457,20 +330,30 @@ class _BusinessHomePage extends State<BusinessHomePage>
color: Color(0x99000000), color: Color(0x99000000),
), ),
)), )),
Text( GestureDetector(
"更多数据", behavior: HitTestBehavior.opaque,
style: TextStyle( onTap: (){
fontSize: 14.sp, Navigator.of(context).pushNamed('/router/trade_overview_page');
fontWeight: MyFontWeight.regular, },
color: Color(0xFF252626), 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(width: 5.w,),
Image.asset(
"assets/image/bs_right.webp",
width: 8.w,
height: 12.h,
),
], ],
), ),
SizedBox( SizedBox(

178
lib/business_system/home/home_view/home_sideslip_dialog.dart

@ -0,0 +1,178 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/store.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
class HomeSideslipDialog extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HomeSideslipDialog();
}
}
class _HomeSideslipDialog extends State<HomeSideslipDialog> with SingleTickerProviderStateMixin{
AnimationController _animationController;
Animation<Offset> _animation;
@override
void initState() {
super.initState();
_animationController = AnimationController(
duration: Duration(milliseconds: 500),
vsync: this,
);
_animation = Tween<Offset>(
begin: Offset(1.0, 0.0),
end: Offset.zero,
).animate(CurvedAnimation(
parent: _animationController,
curve: Curves.easeInOut,
));
_animationController.forward();
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return SlideTransition(position: _animation,
child: 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: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)
),),
],
),),
Expanded(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
),),),
],
),
),
),),);
}
///
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),)
],
),
);
}
}

2
lib/business_system/home/my_line_chart.dart → lib/business_system/home/home_view/my_line_chart.dart

@ -2,7 +2,7 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../utils/font_weight.dart'; import '../../../utils/font_weight.dart';
class LineChartSample2 extends StatefulWidget { class LineChartSample2 extends StatefulWidget {
final List<LineChartSample2Data> lineChartSample2Data; final List<LineChartSample2Data> lineChartSample2Data;

79
lib/business_system/home/trade_overview_page.dart

@ -0,0 +1,79 @@
import 'package:flutter/material.dart';
import 'package:huixiang/business_system/home/trade_summary.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 '../../generated/l10n.dart';
import '../../mine/coupons_page.dart';
import '../../mine/vip_card_page.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
import '../../view_widget/my_tab.dart';
class TradeOverviewPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _TradeOverviewPage();
}
}
class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProviderStateMixin{
ApiService apiService;
final RefreshController refreshController = RefreshController();
var isShowMore = false;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: MyAppBar(
title:"",
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
bottom: TabBar(
// isScrollable: true, //
indicatorColor: Color(0xFF30415B),
labelColor: Colors.black,
labelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)
),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text:"总览"),
MyTab(text: "订单"),
MyTab(text: "商品"),
],
),
),
body: TabBarView(
children: [
TradeSummary(),
CouponsPage(),
VipCardPage(),],
),
),
);
}
}

162
lib/business_system/home/trade_summary.dart

@ -0,0 +1,162 @@
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),
),
),
),),
],
),
)
],
)),
),)
],
),
);
}
}

4
lib/main.dart

@ -88,6 +88,7 @@ import 'business_system/business_page.dart';
import 'business_system/home/business_home_page.dart'; import 'business_system/home/business_home_page.dart';
import 'business_system/home/flow_page.dart'; import 'business_system/home/flow_page.dart';
import 'business_system/home/select_shop.dart'; import 'business_system/home/select_shop.dart';
import 'business_system/home/trade_overview_page.dart';
import 'business_system/login/business_login_page.dart'; import 'business_system/login/business_login_page.dart';
import 'community/community_view/class_details.dart'; import 'community/community_view/class_details.dart';
import 'community/headlines/headlines_column_details.dart'; import 'community/headlines/headlines_column_details.dart';
@ -453,4 +454,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
FlowPage(), FlowPage(),
'/router/select_shop': (context, {arguments}) => '/router/select_shop': (context, {arguments}) =>
SelectShop(), SelectShop(),
'/router/trade_overview_page': (context, {arguments}) =>
TradeOverviewPage(),
}; };

Loading…
Cancel
Save