From 0c12bc9b731c46774248a1fa4667b7df94e3182e Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Thu, 29 Jun 2023 14:27:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AFapp=EF=BC=9A=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=95=B0=E6=8D=AE=E6=8A=A5=E8=A1=A8=EF=BC=88?= =?UTF-8?q?ok=EF=BC=89=20=E9=97=A8=E5=BA=97=E9=80=89=E6=8B=A9(ok)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/image/2x/bs_shop.webp | Bin 0 -> 794 bytes assets/image/3x/bs_shop.webp | Bin 0 -> 1040 bytes assets/image/bs_shop.webp | Bin 0 -> 642 bytes .../home/business_home_page.dart | 194 +++++++++--------- lib/business_system/home/my_line_chart.dart | 78 +++++-- lib/business_system/home/select_shop.dart | 154 ++++++++++++++ lib/main.dart | 3 + 7 files changed, 307 insertions(+), 122 deletions(-) create mode 100644 assets/image/2x/bs_shop.webp create mode 100644 assets/image/3x/bs_shop.webp create mode 100644 assets/image/bs_shop.webp create mode 100644 lib/business_system/home/select_shop.dart diff --git a/assets/image/2x/bs_shop.webp b/assets/image/2x/bs_shop.webp new file mode 100644 index 0000000000000000000000000000000000000000..5308f65d3163f2f464f02c91848fc1e15ab3f95b GIT binary patch literal 794 zcmWIYbaNA8W?%?+bqWXzu!!JdU|=u+Vs$X`baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktl79h!#md3#FX*mM}ZzKbQ@C612u4u3vkig+K1)!7+&|UdJ zn9h*HkjkLI;K`83kj$V5WElY?)sVpq7{flwj0_C=>IXOl&M#Ooamfk`UWFEMj|2M^ zjm$*0_CE3XCe^g~Vtx6a!rrD6+g29KF?D>L?(tuw=a$=~TVL$%rM1|(OmPs{Q+WRS zWET4yo}K%2D>~h5mNgyVSoqFfWPt)}_ zV78B8d^ZK3zMkRvE@l3lwRQRP1Iv_WS13N5^nd5)p#Rh3_J>!ATR)sGT)*$JQpWb8 Z$lcqvJ-f{PHp>0T{3jdkx2$Gj004Uc(YgQt literal 0 HcmV?d00001 diff --git a/assets/image/3x/bs_shop.webp b/assets/image/3x/bs_shop.webp new file mode 100644 index 0000000000000000000000000000000000000000..e2e0745ea3b8dcb4bcd02bfcb6e935744595c8d6 GIT binary patch literal 1040 zcmWIYbaUfiVPFV%bqWXzu!!JdU|=u+Vrww+baoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktlU~DijrKK@2d|J-Hz#GZHAbf#=fh!s;2PAN~O#vt+19VqD z5T-NaFr+dlFnBWLF(fnS0a-@CNHt_I1IDnABohOJzV!hQc>Sr{{4xJjDpDI6P10A%AQ@trGL((JY;6r zQ}~4Y^6k><>rz&)W94{DpT76q|9^Sl*Yk3V`qxfAv}OZy)uioRn6JU^> zz~QL4i$mb#Vw+-3B)Nt0KzxNwFlU_4;kiUBf>8 z;Ec}2s#zLNf(|_?x3_Gyo1a_z`liiK_HXB{^Nkxj{#h5?J~ol1VtvNxDLHbCumD1# zZA4-(mo2#=XHh55!`63g;*5^@dmp9Bc6t_WGT#y5p2T6J)4I1*rR~@qBZ+ADq=+2d z{-vcVZcPhC6Vqfn1(Q;j-T<|NWkY|M$jSExkg% z+Z5;23%z-JTdU=<%HP{Z<(4lN5x17S8}lrwQ(E)w={MOL8(F-p?PdS5Ok3r-G`6Kc zu3y5tZ`Jym3%{)*Wo}JcoW&`3B=?k6%i|eazAVUk)2woI!U^fqy(`a5TeM`7(9fAs zc^;LKnqE)dW!*F}F44@&`jPeXV~AYty}4g3-(*;|TJN&foOR~Y59>$lmn$x92`-)g z`q_!HthsS7=VdK_Hvek+saebCm2SDJlX~`jn9-IRThpTNWz%XIwOapI8Er1<&b)f+ L=NaYDqYMlHn*>0Y literal 0 HcmV?d00001 diff --git a/assets/image/bs_shop.webp b/assets/image/bs_shop.webp new file mode 100644 index 0000000000000000000000000000000000000000..cc55983a33dbeb8ef8cb8ac1f7ab60d3214a8664 GIT binary patch literal 642 zcmWIYbaSg>Vqge&bqWXzu!!JdU|=u+Vqq}ybaoCn!3g9sFrEOBEI_H;ypp0IcPE92 z$S4K&2Mmlr2nLDC#RU)+RuZV{+ck*V%eq)q;1}dfNi9wWD)|7!Dn&rcfo>83vPIG% zYz+`Q3BtAkvCB&eN`PttK=2?(*InG6iuTNxN6ZXv`}7BDdI zw=ghlJC6`Ugh@eSQ6ktl79h!#md3#FX*mM}ZzM1xE-)}~MT6yl1P-?;0HtJr?#c(k zbcP&;R0ahGPlh~(WClGT%Lo{$h74xF820G~D%2M~z#?GpAeJC?M_rC;ke final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); List 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")]; + [LineChartSample2Data(0,100,"2023-03-09"), + LineChartSample2Data(1,200,"2023-03-10"), + LineChartSample2Data(2,400,"2023-03-11"), + LineChartSample2Data(3,10,"2023-03-12"), + LineChartSample2Data(4,250,"2023-03-13"), + LineChartSample2Data(5,175,"2023-03-14"), + LineChartSample2Data(6,500,"2023-03-15")]; @override void initState() { @@ -93,6 +93,7 @@ class _BusinessHomePage extends State GestureDetector( onTap: (){ showAlertDialog(); + // Navigator.of(context).pushNamed('/router/select_shop'); }, child: Row( children: [ @@ -303,101 +304,94 @@ class _BusinessHomePage extends State 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) - ),), - ], - )) - ], - ), + 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(), - ); + ), + 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: () { }, - ), - ) - , - 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 - ),),), - ], - ), + 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 + ),),), + ], ), ), ),); diff --git a/lib/business_system/home/my_line_chart.dart b/lib/business_system/home/my_line_chart.dart index 635116e3..851b22da 100644 --- a/lib/business_system/home/my_line_chart.dart +++ b/lib/business_system/home/my_line_chart.dart @@ -1,5 +1,6 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../utils/font_weight.dart'; @@ -26,11 +27,12 @@ class _LineChartSample2State extends State { } Widget bottomTitleWidgets(double value, TitleMeta meta) { + if(value%1 != 0) + return Text(""); 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, @@ -70,18 +72,31 @@ class _LineChartSample2State extends State { } else { text = value.toInt().toString(); } - return Text(text, + return Padding(padding:EdgeInsets.only(right:2.w), + child: Text(text, style: const TextStyle( fontWeight: MyFontWeight.light, fontSize: 10, color: Color(0xFF999999)), - textAlign: TextAlign.left); + textAlign: TextAlign.right),); } LineChartData mainData() { return LineChartData( gridData: FlGridData( - show: false, + show: true, + getDrawingHorizontalLine: (value) { + return FlLine( + color: Color(0xFFEBEBEB), + strokeWidth: 1, + ); + }, + getDrawingVerticalLine: (value) { + return FlLine( + color: Colors.transparent, + strokeWidth: 1, + ); + }, ), titlesData: FlTitlesData( show: true, @@ -111,10 +126,11 @@ class _LineChartSample2State extends State { color: Color(0xFFCBCBCB), width: 1, ), - left: BorderSide( - color: Color(0xFFCBCBCB), - width: 1, - ), + //表格左边线 + // left: BorderSide( + // color: Color(0xFFCBCBCB), + // width: 1, + // ), ), ), minY: 0, @@ -127,9 +143,9 @@ class _LineChartSample2State extends State { return spotIndexes.map((spotIndex) { return TouchedSpotIndicatorData( FlLine( - color: Color(0xFF0D0D0D), + color: Color(0xFF165DFF), strokeWidth: 1, - dashArray: [5, 5], + dashArray: [2, 4], ), FlDotData( show: true, @@ -137,8 +153,8 @@ class _LineChartSample2State extends State { return FlDotCirclePainter( radius: 3, color: Colors.white, - strokeWidth: 2, - strokeColor: Color(0xFF0D0D0D), + strokeWidth: 2.w, + strokeColor: Color(0xFF165DFF), ); }, ), @@ -146,18 +162,36 @@ class _LineChartSample2State extends State { }).toList(); }, touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.transparent, - tooltipPadding: const EdgeInsets.all(0), + tooltipBgColor: Color(0xFF3D3D3D), + tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6), tooltipMargin: 5, - tooltipRoundedRadius: 0, + tooltipRoundedRadius: 2, + // tooltipHorizontalAlignment: FLHorizontalAlignment.center, getTooltipItems: (touchedSpots) { return touchedSpots.map((LineBarSpot touchedSpot) { return LineTooltipItem( - '¥${touchedSpot.y.toInt()}', + '${(widget.lineChartSample2Data[touchedSpot.x.toInt()].time ?? "").substring(5,10)}', const TextStyle( - color: Color(0xFF0D0D0D), + color: Colors.white, fontWeight: MyFontWeight.light, - fontSize: 15), + fontSize: 10), + textAlign: TextAlign.start, + children: [ + TextSpan( + text: '\n订单量: ', + style: const TextStyle( + color: Colors.white, + fontWeight: MyFontWeight.medium, + fontSize: 10), + ), + TextSpan( + text: '${touchedSpot.y.toInt()}', + style: const TextStyle( + color: Color(0xFFFFC163), + fontWeight: MyFontWeight.light, + fontSize: 10), + ), + ], ); }).toList(); }, @@ -168,11 +202,11 @@ class _LineChartSample2State extends State { spots: widget.lineChartSample2Data .map((e) => FlSpot(e.index ?? 0, e.price ?? 0)) .toList(), - isCurved: true, - color: Color(0xFF0D0D0D), - barWidth: 1, + isCurved: false, + color: Color(0xFF165DFF), + barWidth:2.5, dotData: FlDotData( - show: true, + show: false, getDotPainter: (spot, percent, barData, index) { return FlDotCirclePainter( radius: 3, diff --git a/lib/business_system/home/select_shop.dart b/lib/business_system/home/select_shop.dart new file mode 100644 index 00000000..92845cc0 --- /dev/null +++ b/lib/business_system/home/select_shop.dart @@ -0,0 +1,154 @@ +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 '../../generated/l10n.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; + +class SelectShop extends StatefulWidget { + @override + State createState() { + return _SelectShop(); + } +} + +class _SelectShop extends State { + ApiService apiService; + final RefreshController refreshController = RefreshController(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return + Scaffold( + backgroundColor: Colors.white, + appBar: MyAppBar( + title: "选择门店", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader( + color: Colors.white, + ), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + }, + physics: BouncingScrollPhysics(), + scrollController: ScrollController(), + child: Container( + height: double.infinity, + padding: EdgeInsets.only(top: 13.h,left:16.w,right:16.w), + child:Column( + children: [ + 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) + ),), + ], + ), + SizedBox(height:20.h,), + Expanded(child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:20, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: shopsItem(), + ); + }, + )), + Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical:16.h), + margin: EdgeInsets.only(bottom:34.h,top: 10.h), + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(27.w), + ), + child:Text( + S.of(context).queding, + style: TextStyle( + fontWeight: MyFontWeight.bold, + fontSize: 16.sp, + color: Colors.white, + ), + ), + ), + ], + ), + ), + ), + ); + } + + Widget shopsItem(){ + return Container( + height: 52.h, + margin: EdgeInsets.only(bottom: 12), + child: Stack( + alignment: Alignment.bottomRight, + children: [ + Container( + height: 52.h, + width: double.infinity, + decoration: BoxDecoration( + color: Color(0xFFEFF5FF), + borderRadius: BorderRadius.circular(4.w), + border: Border.all( + color: Color(0xFF30415B), + width: 1.w, + ), + ), + padding: EdgeInsets.only(top:16.h,bottom:16.h,left: 16.w,right: 17.w), + child: Text("前进麦味烘焙*海峡姐妹茶(哈乐城店)", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B) + ),), + ), + Image.asset( + "assets/image/bs_shop.webp", + width: 20, + height: 20, + fit: BoxFit.fill, + ), + ], + ), + ); + } + +} diff --git a/lib/main.dart b/lib/main.dart index 47db611f..a055da2d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -87,6 +87,7 @@ 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/home/select_shop.dart'; import 'business_system/login/business_login_page.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; @@ -450,4 +451,6 @@ Map routers = { BusinessPage(arguments: arguments), '/router/flow_page': (context, {arguments}) => FlowPage(), + '/router/select_shop': (context, {arguments}) => + SelectShop(), };