Browse Source

管理端app

登录页(ok),
首页,首页今日流水跳转,门店切换(待修改未完结)(ok),首页细节跳转页面为完结,统计图ui待修改;
底部按钮(ok);
wr_2023_business
wurong 2 years ago
parent
commit
2ddc581621
  1. BIN
      assets/image/2x/bs_home_bill.webp
  2. BIN
      assets/image/2x/bs_more.webp
  3. BIN
      assets/image/2x/bs_query_logo.webp
  4. BIN
      assets/image/2x/bs_refund.webp
  5. BIN
      assets/image/2x/bs_refund_num.webp
  6. BIN
      assets/image/2x/bs_right.webp
  7. BIN
      assets/image/2x/bs_switch_shop.webp
  8. BIN
      assets/image/2x/bs_trade_num.webp
  9. BIN
      assets/image/2x/bs_trophy_one.webp
  10. BIN
      assets/image/2x/bs_trophy_three.webp
  11. BIN
      assets/image/2x/bs_trophy_two.webp
  12. BIN
      assets/image/2x/business.webp
  13. BIN
      assets/image/2x/business_ home_h.webp
  14. BIN
      assets/image/2x/business_code.webp
  15. BIN
      assets/image/2x/business_goods.webp
  16. BIN
      assets/image/2x/business_goods_h.webp
  17. BIN
      assets/image/2x/business_home.webp
  18. BIN
      assets/image/2x/business_login.webp
  19. BIN
      assets/image/2x/business_mine.webp
  20. BIN
      assets/image/2x/business_mine_h.webp
  21. BIN
      assets/image/2x/business_order.webp
  22. BIN
      assets/image/2x/business_order_h.webp
  23. BIN
      assets/image/2x/business_phone.webp
  24. BIN
      assets/image/2x/business_scan_code.webp
  25. BIN
      assets/image/3x/bs_home_bill.webp
  26. BIN
      assets/image/3x/bs_more.webp
  27. BIN
      assets/image/3x/bs_query_logo.webp
  28. BIN
      assets/image/3x/bs_refund.webp
  29. BIN
      assets/image/3x/bs_refund_num.webp
  30. BIN
      assets/image/3x/bs_right.webp
  31. BIN
      assets/image/3x/bs_switch_shop.webp
  32. BIN
      assets/image/3x/bs_trade_num.webp
  33. BIN
      assets/image/3x/bs_trophy_one.webp
  34. BIN
      assets/image/3x/bs_trophy_three.webp
  35. BIN
      assets/image/3x/bs_trophy_two.webp
  36. BIN
      assets/image/3x/business.webp
  37. BIN
      assets/image/3x/business_ home_h.webp
  38. BIN
      assets/image/3x/business_code.webp
  39. BIN
      assets/image/3x/business_goods.webp
  40. BIN
      assets/image/3x/business_goods_h.webp
  41. BIN
      assets/image/3x/business_home.webp
  42. BIN
      assets/image/3x/business_login.webp
  43. BIN
      assets/image/3x/business_mine.webp
  44. BIN
      assets/image/3x/business_mine_h.webp
  45. BIN
      assets/image/3x/business_order.webp
  46. BIN
      assets/image/3x/business_order_h.webp
  47. BIN
      assets/image/3x/business_phone.webp
  48. BIN
      assets/image/3x/business_scan_code.webp
  49. BIN
      assets/image/bs_home_bill.webp
  50. BIN
      assets/image/bs_more.webp
  51. BIN
      assets/image/bs_query_logo.webp
  52. BIN
      assets/image/bs_refund.webp
  53. BIN
      assets/image/bs_refund_num.webp
  54. BIN
      assets/image/bs_right.webp
  55. BIN
      assets/image/bs_switch_shop.webp
  56. BIN
      assets/image/bs_trade_num.webp
  57. BIN
      assets/image/bs_trophy_one.webp
  58. BIN
      assets/image/bs_trophy_three.webp
  59. BIN
      assets/image/bs_trophy_two.webp
  60. BIN
      assets/image/business.webp
  61. BIN
      assets/image/business_ home_h.webp
  62. BIN
      assets/image/business_code.webp
  63. BIN
      assets/image/business_goods.webp
  64. BIN
      assets/image/business_goods_h.webp
  65. BIN
      assets/image/business_home.webp
  66. BIN
      assets/image/business_login.webp
  67. BIN
      assets/image/business_mine.webp
  68. BIN
      assets/image/business_mine_h.webp
  69. BIN
      assets/image/business_order.webp
  70. BIN
      assets/image/business_order_h.webp
  71. BIN
      assets/image/business_phone.webp
  72. BIN
      assets/image/business_scan_code.webp
  73. 224
      lib/business_system/business_page.dart
  74. 70
      lib/business_system/goods/business_goods_page.dart
  75. 932
      lib/business_system/home/business_home_page.dart
  76. 236
      lib/business_system/home/flow_page.dart
  77. 222
      lib/business_system/home/my_line_chart.dart
  78. 290
      lib/business_system/login/business_login_page.dart
  79. 74
      lib/business_system/mine/business_mine_page.dart
  80. 70
      lib/business_system/order/business_order_page.dart
  81. 30
      lib/generated/intl/messages_all.dart
  82. 1615
      lib/generated/intl/messages_en.dart
  83. 1893
      lib/generated/intl/messages_en_US.dart
  84. 1615
      lib/generated/intl/messages_zh_CN.dart
  85. 1615
      lib/generated/intl/messages_zh_Hans_CN.dart
  86. 1604
      lib/generated/intl/messages_zh_Hant_CN.dart
  87. 1610
      lib/generated/intl/messages_zh_TW.dart
  88. 55
      lib/generated/l10n.dart
  89. 10
      lib/main.dart
  90. 11
      lib/mine/mine_view/mine_item.dart
  91. 14
      pubspec.lock
  92. 1
      pubspec.yaml

BIN
assets/image/2x/bs_home_bill.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/bs_more.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

BIN
assets/image/2x/bs_query_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

BIN
assets/image/2x/bs_refund.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

BIN
assets/image/2x/bs_refund_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

BIN
assets/image/2x/bs_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

BIN
assets/image/2x/bs_switch_shop.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/bs_trade_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

BIN
assets/image/2x/bs_trophy_one.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/2x/bs_trophy_three.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/2x/bs_trophy_two.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/2x/business.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/2x/business_ home_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

BIN
assets/image/2x/business_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

BIN
assets/image/2x/business_goods.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

BIN
assets/image/2x/business_goods_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

BIN
assets/image/2x/business_home.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

BIN
assets/image/2x/business_login.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

BIN
assets/image/2x/business_mine.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

BIN
assets/image/2x/business_mine_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

BIN
assets/image/2x/business_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/business_order_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/image/2x/business_phone.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

BIN
assets/image/2x/business_scan_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/image/3x/bs_home_bill.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/bs_more.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

BIN
assets/image/3x/bs_query_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/bs_refund.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/bs_refund_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/bs_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/bs_switch_shop.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/3x/bs_trade_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

BIN
assets/image/3x/bs_trophy_one.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/3x/bs_trophy_three.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
assets/image/3x/bs_trophy_two.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
assets/image/3x/business.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
assets/image/3x/business_ home_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/business_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/business_goods.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/business_goods_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/business_home.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/business_login.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

BIN
assets/image/3x/business_mine.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/business_mine_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/3x/business_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/business_order_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/business_phone.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

BIN
assets/image/3x/business_scan_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
assets/image/bs_home_bill.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

BIN
assets/image/bs_more.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

BIN
assets/image/bs_query_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

BIN
assets/image/bs_refund.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

BIN
assets/image/bs_refund_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

BIN
assets/image/bs_right.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

BIN
assets/image/bs_switch_shop.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

BIN
assets/image/bs_trade_num.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

BIN
assets/image/bs_trophy_one.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

BIN
assets/image/bs_trophy_three.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

BIN
assets/image/bs_trophy_two.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

BIN
assets/image/business.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/business_ home_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

BIN
assets/image/business_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
assets/image/business_goods.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
assets/image/business_goods_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

BIN
assets/image/business_home.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

BIN
assets/image/business_login.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
assets/image/business_mine.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
assets/image/business_mine_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

BIN
assets/image/business_order.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

BIN
assets/image/business_order_h.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

BIN
assets/image/business_phone.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

BIN
assets/image/business_scan_code.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

224
lib/business_system/business_page.dart

@ -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;
}

70
lib/business_system/goods/business_goods_page.dart

@ -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;
}

932
lib/business_system/home/business_home_page.dart

@ -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;
}

236
lib/business_system/home/flow_page.dart

@ -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),
),
),
],
),
),
],
)
);
}
}

222
lib/business_system/home/my_line_chart.dart

@ -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;
}
}

290
lib/business_system/login/business_login_page.dart

@ -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,
),
)
],
),
),
),
);
}
}

74
lib/business_system/mine/business_mine_page.dart

@ -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;
}

70
lib/business_system/order/business_order_page.dart

@ -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;
}

30
lib/generated/intl/messages_all.dart

@ -11,7 +11,6 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';
@ -25,12 +24,12 @@ import 'messages_zh_TW.dart' as messages_zh_tw;
typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new SynchronousFuture(null),
'en_US': () => new SynchronousFuture(null),
'zh_CN': () => new SynchronousFuture(null),
'zh_Hans_CN': () => new SynchronousFuture(null),
'zh_Hant_CN': () => new SynchronousFuture(null),
'zh_TW': () => new SynchronousFuture(null),
'en': () => new Future.value(null),
'en_US': () => new Future.value(null),
'zh_CN': () => new Future.value(null),
'zh_Hans_CN': () => new Future.value(null),
'zh_Hant_CN': () => new Future.value(null),
'zh_TW': () => new Future.value(null),
};
MessageLookupByLibrary _findExact(String localeName) {
@ -53,18 +52,19 @@ MessageLookupByLibrary _findExact(String localeName) {
}
/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
Future<bool> initializeMessages(String localeName) async {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
localeName,
(locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new SynchronousFuture(false);
return new Future.value(false);
}
var lib = _deferredLibraries[availableLocale];
lib == null ? new SynchronousFuture(false) : lib();
await (lib == null ? new Future.value(false) : lib());
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new SynchronousFuture(true);
return new Future.value(true);
}
bool _messagesExistFor(String locale) {
@ -76,8 +76,8 @@ bool _messagesExistFor(String locale) {
}
MessageLookupByLibrary _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor,
onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}

1615
lib/generated/intl/messages_en.dart

File diff suppressed because it is too large Load Diff

1893
lib/generated/intl/messages_en_US.dart

File diff suppressed because it is too large Load Diff

1615
lib/generated/intl/messages_zh_CN.dart

File diff suppressed because it is too large Load Diff

1615
lib/generated/intl/messages_zh_Hans_CN.dart

File diff suppressed because it is too large Load Diff

1604
lib/generated/intl/messages_zh_Hant_CN.dart

File diff suppressed because it is too large Load Diff

1610
lib/generated/intl/messages_zh_TW.dart

File diff suppressed because it is too large Load Diff

55
lib/generated/l10n.dart

@ -10,43 +10,28 @@ import 'intl/messages_all.dart';
// ignore_for_file: non_constant_identifier_names, lines_longer_than_80_chars
// ignore_for_file: join_return_with_assignment, prefer_final_in_for_each
// ignore_for_file: avoid_redundant_argument_values, avoid_escaping_inner_quotes
// ignore_for_file: avoid_redundant_argument_values
class S {
S();
static S _current;
static S get current {
assert(_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
return _current;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static S current;
static const AppLocalizationDelegate delegate =
AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = (locale.countryCode?.isEmpty ?? false)
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
final name = (locale.countryCode?.isEmpty ?? false) ? locale.languageCode : locale.toString();
final localeName = Intl.canonicalizedLocale(name);
return initializeMessages(localeName).then((_) {
Intl.defaultLocale = localeName;
final instance = S();
S._current = instance;
return instance;
S.current = S();
return S.current;
});
}
}
static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
return instance;
}
static S maybeOf(BuildContext context) {
return Localizations.of<S>(context, S);
}
@ -7179,10 +7164,8 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
Locale.fromSubtags(languageCode: 'en'),
Locale.fromSubtags(languageCode: 'en', countryCode: 'US'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'CN'),
Locale.fromSubtags(
languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'),
Locale.fromSubtags(
languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: 'CN'),
Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'),
];
}
@ -7195,11 +7178,13 @@ class AppLocalizationDelegate extends LocalizationsDelegate<S> {
bool shouldReload(AppLocalizationDelegate old) => false;
bool _isSupported(Locale locale) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
if (locale != null) {
for (var supportedLocale in supportedLocales) {
if (supportedLocale.languageCode == locale.languageCode) {
return true;
}
}
}
return false;
}
}
}

10
lib/main.dart

@ -84,6 +84,10 @@ import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/web/web_turntable_activity.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'business_system/business_page.dart';
import 'business_system/home/business_home_page.dart';
import 'business_system/home/flow_page.dart';
import 'business_system/login/business_login_page.dart';
import 'community/community_view/class_details.dart';
import 'community/headlines/headlines_column_details.dart';
import 'community/new_community_details.dart';
@ -440,4 +444,10 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
BindingPhonePage(arguments:arguments),
'/router/trading_card_page': (context, {arguments}) =>
TradingCardPage(),
'/router/business_login_page': (context, {arguments}) =>
BusinessLoginPage(arguments: arguments),
'/router/business_page': (context, {arguments}) =>
BusinessPage(arguments: arguments),
'/router/flow_page': (context, {arguments}) =>
FlowPage(),
};

11
lib/mine/mine_view/mine_item.dart

@ -282,7 +282,16 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_mine_online_service.webp",
),
),),
Expanded(child:Container(),),
///
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/business_login_page');
},
child: mineItem(
"商家管理",
"assets/image/business.webp",
),
),),
Expanded(child:Container(),),
// ///
// Expanded(child: InkWell(

14
pubspec.lock

@ -127,6 +127,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.1"
equatable:
dependency: transitive
description:
name: equatable
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
event_bus:
dependency: "direct main"
description:
@ -155,6 +162,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.1.4"
fl_chart:
dependency: "direct main"
description:
name: fl_chart
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.62.0"
flare_flutter:
dependency: "direct main"
description:

1
pubspec.yaml

@ -28,6 +28,7 @@ dependencies:
ref: V1.1.6
umeng_common_sdk: ^1.2.3
fl_chart: ^0.62.0
like_button: ^2.0.2
cupertino_icons: ^1.0.2
flutter_swiper: ^1.1.6

Loading…
Cancel
Save