diff --git a/assets/image/2x/bs_calendar_logo.webp b/assets/image/2x/bs_calendar_logo.webp new file mode 100644 index 00000000..50ed712e Binary files /dev/null and b/assets/image/2x/bs_calendar_logo.webp differ diff --git a/assets/image/2x/bs_check.webp b/assets/image/2x/bs_check.webp new file mode 100644 index 00000000..4df45529 Binary files /dev/null and b/assets/image/2x/bs_check.webp differ diff --git a/assets/image/2x/bs_edit.webp b/assets/image/2x/bs_edit.webp new file mode 100644 index 00000000..8c48144b Binary files /dev/null and b/assets/image/2x/bs_edit.webp differ diff --git a/assets/image/2x/bs_goods_search.webp b/assets/image/2x/bs_goods_search.webp new file mode 100644 index 00000000..8d0d485b Binary files /dev/null and b/assets/image/2x/bs_goods_search.webp differ diff --git a/assets/image/2x/bs_mine_bg.webp b/assets/image/2x/bs_mine_bg.webp new file mode 100644 index 00000000..9a50c64e Binary files /dev/null and b/assets/image/2x/bs_mine_bg.webp differ diff --git a/assets/image/2x/bs_mine_heading.webp b/assets/image/2x/bs_mine_heading.webp new file mode 100644 index 00000000..f6d94166 Binary files /dev/null and b/assets/image/2x/bs_mine_heading.webp differ diff --git a/assets/image/2x/bs_no data_logo.webp b/assets/image/2x/bs_no data_logo.webp new file mode 100644 index 00000000..317c4647 Binary files /dev/null and b/assets/image/2x/bs_no data_logo.webp differ diff --git a/assets/image/2x/bs_px.webp b/assets/image/2x/bs_px.webp new file mode 100644 index 00000000..e20e8753 Binary files /dev/null and b/assets/image/2x/bs_px.webp differ diff --git a/assets/image/2x/bs_secure.webp b/assets/image/2x/bs_secure.webp new file mode 100644 index 00000000..d8f3eb12 Binary files /dev/null and b/assets/image/2x/bs_secure.webp differ diff --git a/assets/image/2x/bs_shop_logo.webp b/assets/image/2x/bs_shop_logo.webp new file mode 100644 index 00000000..2a8819bb Binary files /dev/null and b/assets/image/2x/bs_shop_logo.webp differ diff --git a/assets/image/2x/bs_store_info_logo.webp b/assets/image/2x/bs_store_info_logo.webp new file mode 100644 index 00000000..b8aae3f9 Binary files /dev/null and b/assets/image/2x/bs_store_info_logo.webp differ diff --git a/assets/image/2x/bs_uncheck.webp b/assets/image/2x/bs_uncheck.webp new file mode 100644 index 00000000..e10c73ac Binary files /dev/null and b/assets/image/2x/bs_uncheck.webp differ diff --git a/assets/image/2x/bs_user.webp b/assets/image/2x/bs_user.webp new file mode 100644 index 00000000..2080e2b4 Binary files /dev/null and b/assets/image/2x/bs_user.webp differ diff --git a/assets/image/2x/bs_xj.webp b/assets/image/2x/bs_xj.webp new file mode 100644 index 00000000..18017641 Binary files /dev/null and b/assets/image/2x/bs_xj.webp differ diff --git a/assets/image/3x/bs_calendar_logo.webp b/assets/image/3x/bs_calendar_logo.webp new file mode 100644 index 00000000..fb1a2aa3 Binary files /dev/null and b/assets/image/3x/bs_calendar_logo.webp differ diff --git a/assets/image/3x/bs_check.webp b/assets/image/3x/bs_check.webp new file mode 100644 index 00000000..a8060aa0 Binary files /dev/null and b/assets/image/3x/bs_check.webp differ diff --git a/assets/image/3x/bs_edit.webp b/assets/image/3x/bs_edit.webp new file mode 100644 index 00000000..38814125 Binary files /dev/null and b/assets/image/3x/bs_edit.webp differ diff --git a/assets/image/3x/bs_goods_search.webp b/assets/image/3x/bs_goods_search.webp new file mode 100644 index 00000000..d1a500e8 Binary files /dev/null and b/assets/image/3x/bs_goods_search.webp differ diff --git a/assets/image/3x/bs_mine_bg.webp b/assets/image/3x/bs_mine_bg.webp new file mode 100644 index 00000000..bd719f6c Binary files /dev/null and b/assets/image/3x/bs_mine_bg.webp differ diff --git a/assets/image/3x/bs_mine_heading.webp b/assets/image/3x/bs_mine_heading.webp new file mode 100644 index 00000000..f20d28af Binary files /dev/null and b/assets/image/3x/bs_mine_heading.webp differ diff --git a/assets/image/3x/bs_no data_logo.webp b/assets/image/3x/bs_no data_logo.webp new file mode 100644 index 00000000..67e31eee Binary files /dev/null and b/assets/image/3x/bs_no data_logo.webp differ diff --git a/assets/image/3x/bs_px.webp b/assets/image/3x/bs_px.webp new file mode 100644 index 00000000..8d24301a Binary files /dev/null and b/assets/image/3x/bs_px.webp differ diff --git a/assets/image/3x/bs_secure.webp b/assets/image/3x/bs_secure.webp new file mode 100644 index 00000000..1f3b4306 Binary files /dev/null and b/assets/image/3x/bs_secure.webp differ diff --git a/assets/image/3x/bs_shop_logo.webp b/assets/image/3x/bs_shop_logo.webp new file mode 100644 index 00000000..d362c0fa Binary files /dev/null and b/assets/image/3x/bs_shop_logo.webp differ diff --git a/assets/image/3x/bs_store_info_logo.webp b/assets/image/3x/bs_store_info_logo.webp new file mode 100644 index 00000000..698b649d Binary files /dev/null and b/assets/image/3x/bs_store_info_logo.webp differ diff --git a/assets/image/3x/bs_uncheck.webp b/assets/image/3x/bs_uncheck.webp new file mode 100644 index 00000000..1e91c7b2 Binary files /dev/null and b/assets/image/3x/bs_uncheck.webp differ diff --git a/assets/image/3x/bs_user.webp b/assets/image/3x/bs_user.webp new file mode 100644 index 00000000..6bc8a12b Binary files /dev/null and b/assets/image/3x/bs_user.webp differ diff --git a/assets/image/3x/bs_xj.webp b/assets/image/3x/bs_xj.webp new file mode 100644 index 00000000..e6d8499f Binary files /dev/null and b/assets/image/3x/bs_xj.webp differ diff --git a/assets/image/bs_calendar_logo.webp b/assets/image/bs_calendar_logo.webp new file mode 100644 index 00000000..9fa521b2 Binary files /dev/null and b/assets/image/bs_calendar_logo.webp differ diff --git a/assets/image/bs_check.webp b/assets/image/bs_check.webp new file mode 100644 index 00000000..6745d790 Binary files /dev/null and b/assets/image/bs_check.webp differ diff --git a/assets/image/bs_edit.webp b/assets/image/bs_edit.webp new file mode 100644 index 00000000..8a2cb78f Binary files /dev/null and b/assets/image/bs_edit.webp differ diff --git a/assets/image/bs_goods_search.webp b/assets/image/bs_goods_search.webp new file mode 100644 index 00000000..31be2b40 Binary files /dev/null and b/assets/image/bs_goods_search.webp differ diff --git a/assets/image/bs_mine_bg.webp b/assets/image/bs_mine_bg.webp new file mode 100644 index 00000000..55367673 Binary files /dev/null and b/assets/image/bs_mine_bg.webp differ diff --git a/assets/image/bs_mine_heading.webp b/assets/image/bs_mine_heading.webp new file mode 100644 index 00000000..4a71dd0c Binary files /dev/null and b/assets/image/bs_mine_heading.webp differ diff --git a/assets/image/bs_no data_logo.webp b/assets/image/bs_no data_logo.webp new file mode 100644 index 00000000..47dfb809 Binary files /dev/null and b/assets/image/bs_no data_logo.webp differ diff --git a/assets/image/bs_px.webp b/assets/image/bs_px.webp new file mode 100644 index 00000000..7e38a213 Binary files /dev/null and b/assets/image/bs_px.webp differ diff --git a/assets/image/bs_secure.webp b/assets/image/bs_secure.webp new file mode 100644 index 00000000..39203e2e Binary files /dev/null and b/assets/image/bs_secure.webp differ diff --git a/assets/image/bs_shop_logo.webp b/assets/image/bs_shop_logo.webp new file mode 100644 index 00000000..912e96cd Binary files /dev/null and b/assets/image/bs_shop_logo.webp differ diff --git a/assets/image/bs_store_info_logo.webp b/assets/image/bs_store_info_logo.webp new file mode 100644 index 00000000..83f8609b Binary files /dev/null and b/assets/image/bs_store_info_logo.webp differ diff --git a/assets/image/bs_uncheck.webp b/assets/image/bs_uncheck.webp new file mode 100644 index 00000000..81842e3e Binary files /dev/null and b/assets/image/bs_uncheck.webp differ diff --git a/assets/image/bs_user.webp b/assets/image/bs_user.webp new file mode 100644 index 00000000..5668ba59 Binary files /dev/null and b/assets/image/bs_user.webp differ diff --git a/assets/image/bs_xj.webp b/assets/image/bs_xj.webp new file mode 100644 index 00000000..2a19fde2 Binary files /dev/null and b/assets/image/bs_xj.webp differ diff --git a/lib/business_system/business_page.dart b/lib/business_system/business_page.dart index 641f53ca..b015c79a 100644 --- a/lib/business_system/business_page.dart +++ b/lib/business_system/business_page.dart @@ -1,21 +1,10 @@ -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'; @@ -32,8 +21,6 @@ class BusinessPage extends StatefulWidget { class _BusinessPage extends State with AutomaticKeepAliveClientMixin { - ApiService apiService; - MinApiService minService; int choiceIndex = 0; @override @@ -78,6 +65,7 @@ class _BusinessPage extends State children: [ Expanded( child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { choiceIndex = 0; @@ -108,6 +96,7 @@ class _BusinessPage extends State ), Expanded( child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { choiceIndex = 1; @@ -138,6 +127,7 @@ class _BusinessPage extends State )), Expanded( child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { choiceIndex = 2; @@ -151,6 +141,7 @@ class _BusinessPage extends State )), Expanded( child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { choiceIndex = 3; @@ -181,6 +172,7 @@ class _BusinessPage extends State )), Expanded( child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { setState(() { choiceIndex = 4; diff --git a/lib/business_system/goods/business_goods_page.dart b/lib/business_system/goods/business_goods_page.dart index 3415ba7c..28ce619f 100644 --- a/lib/business_system/goods/business_goods_page.dart +++ b/lib/business_system/goods/business_goods_page.dart @@ -1,11 +1,13 @@ 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:huixiang/business_system/goods/off_shelf/off_shelf_page.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_tab.dart'; +import 'on_sale/on_sale_page.dart'; + class BusinessGoodsPage extends StatefulWidget { @override @@ -16,7 +18,6 @@ class BusinessGoodsPage extends StatefulWidget { class _BusinessGoodsPage extends State with AutomaticKeepAliveClientMixin { - ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); @@ -30,34 +31,48 @@ class _BusinessGoodsPage extends State 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); - }, + Expanded(child: + DefaultTabController( + length: 2, + child: Scaffold( + appBar: MyAppBar( + title:"", + leading: false, + background: Colors.white, + toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, + bottom: TabBar( + // isScrollable: true, //可滚动 + //去掉按钮阴影 + overlayColor: MaterialStateProperty.all(Colors.white), + 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: [ + MyTab(text:"在售中(19)"), + MyTab(text: "已下架(2)"), + ], ), - onRefresh: () { - setState(() { - }); - }, - child: SingleChildScrollView( - physics: NeverScrollableScrollPhysics(), - child: Column( - children: [ - Text("商品管理") - ], - )), + ), + body: TabBarView( + children: [ + OnSalePage(), + OffShelfPage(),], ), ), - ), + ),), SizedBox( height: 76.h, ), diff --git a/lib/business_system/goods/goods_search_page.dart b/lib/business_system/goods/goods_search_page.dart new file mode 100644 index 00000000..6c510f2e --- /dev/null +++ b/lib/business_system/goods/goods_search_page.dart @@ -0,0 +1,277 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import '../../view_widget/my_appbar.dart'; + +class GoodsSearchPage extends StatefulWidget { + final Map arguments; + + GoodsSearchPage({this.arguments}); + + @override + State createState() { + return _GoodsSearchPage(); + } +} + +class _GoodsSearchPage extends State + with WidgetsBindingObserver { + final TextEditingController editingController = TextEditingController(); + final RefreshController refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + int optionIndex = 0; + bool isKeyBoardShow = false; + List productListBeans = []; + List hotSearch = []; + List historySearch = []; + FocusNode _focusNode = FocusNode(); + bool hasFocus = true; + int priceOrder = 0; + + @override + void didChangeMetrics() { + super.didChangeMetrics(); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + _focusNode.unfocus(); + super.dispose(); + } + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + hasFocus = _focusNode.hasFocus; + }); + }); + } + + _onRefresh() { + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: (){ + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Scaffold( + appBar: MyAppBar( + title: "搜索", + titleColor: Colors.black, + leadingColor: Colors.black, + background: Colors.white, + ), + body: Column( + children: [ + Container( + color: Colors.white, + margin: EdgeInsets.only(bottom:16.h), + child: Container( + height: 40.h, + margin: EdgeInsets.only(left: 18.w,right: 18.w,top:17.h,bottom: 10.h), + padding: EdgeInsets.fromLTRB(0, 6.h, 0, 6.h), + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + child: TextField( + focusNode: _focusNode, + textInputAction: TextInputAction.search, + onEditingComplete: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + controller: editingController, + decoration: InputDecoration( + hintText: "请输入搜索内容", + hintStyle: TextStyle( + color: Color(0xFF808080), + fontSize: 15.sp, + fontWeight: MyFontWeight.regular + ), + contentPadding: EdgeInsets.symmetric( + vertical: 12.h, + ), + prefixIcon: Image.asset( + "assets/image/bs_goods_search.webp", + width: 20, + height: 20, + ), + border: InputBorder.none, + ), + ), + ),), + Expanded(child: Container( + child: SmartRefresher( + controller:refreshController, + enablePullUp: false, + enablePullDown: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + onRefresh:(){ + _onRefresh(); + }, + child:ListView.builder( + padding: EdgeInsets.zero, + itemCount:5, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: searchGoodsItem(), + ); + }, + ), + ), + ),) + + ], + ), + ), + ); + } + + Widget searchGoodsItem(){ + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + margin: EdgeInsets.only(bottom:12.h,left: 16.w,right: 16.w), + padding: EdgeInsets.only(left: 12.w,top: 12.h,bottom: 12.h,right:24.w), + child: Row( + children: [ + Image.asset( + "assets/image/hot_list.webp", + width: 70, + height: 70, + fit: BoxFit.fill, + ), + SizedBox(width:12.w,), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), + child: Text( + "台湾甄选手抓饺子三生", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF000000), + ), + ),), + Row( + children: [ + Text( + "库存4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ), + SizedBox(width: 8.w,), + Text( + "销量4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), + ), + ], + ), + SizedBox(height:7.h,), + Row( + children: [ + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: "19", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + )), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(33), + border: Border.all( + color: Color(0xFF30415B), + width: 1, + ), + ), + padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:12.w), + child: Text( + "下架", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF30415B), + ), + ), + ) + ], + ) + ], + )), + ], + ), + ); + } + +} diff --git a/lib/business_system/goods/off_shelf/off_shelf_page.dart b/lib/business_system/goods/off_shelf/off_shelf_page.dart new file mode 100644 index 00000000..a5a0d360 --- /dev/null +++ b/lib/business_system/goods/off_shelf/off_shelf_page.dart @@ -0,0 +1,291 @@ +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'; + +class OffShelfPage extends StatefulWidget { + @override + State createState() { + return _OffShelfPage(); + } +} + +class _OffShelfPage extends State { + final RefreshController _refreshController = RefreshController(); + var checkStatus = false; + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async {} + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Stack( + alignment: Alignment.bottomCenter, + children: [ + Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + goodsSearch(), + ], + ), + Expanded( + child: Container( + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(left:5.w), + child: Row(children: [ + Checkbox( + value: checkStatus, + onChanged: (a) { + setState(() { + checkStatus = !checkStatus; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor: + MaterialStateProperty.all(Color(0xFF30415B)), + ), + Text( + "全选", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF000000), + ), + ), + ],),), + ListView.builder( + itemCount:15, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: shelfGoodsItem(), + ); + }, + ), + SizedBox(height:70.h,) + ], + ), + )), + ), + )) + ], + ), + Container( + color: Color(0xFFEDEDED), + padding: EdgeInsets.only( + left: 44.w, + right: 44.w, + top: 21.h, + bottom: 24.h, + ), + child: Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Text( + "批量上架", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF30415B), + ), + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: Text( + "批量删除", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF30415B), + ), + )) + ], + ), + ), + ], + ), + ); + } + + /// 搜索框 + Widget goodsSearch() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed('/router/goods_search_page'); + }, + child: Container( + height: 40.h, + margin: EdgeInsets.fromLTRB(18.w, 16.h, 18.w, 10.h), + padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h), + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + child: Row( + children: [ + Image.asset( + "assets/image/bs_goods_search.webp", + width: 20, + height: 20, + ), + SizedBox( + width: 3.w, + ), + Text( + "请输入搜索内容", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + ], + ), + ), + ); + } + + Widget shelfGoodsItem(){ + return Container( + margin: EdgeInsets.only(bottom: 22.h), + padding: EdgeInsets.only(left: 5.w,), + child: Row( + children: [ + Checkbox( + value: checkStatus, + onChanged: (a) { + setState(() { + checkStatus = !checkStatus; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + Image.asset( + "assets/image/hot_list.webp", + width: 70, + height: 70, + fit: BoxFit.fill, + ), + SizedBox(width:12.w,), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), + child: Text( + "台湾甄选手抓饺子三生", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF000000), + ), + ),), + Row( + children: [ + Text( + "库存4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ), + SizedBox(width: 8.w,), + Text( + "销量4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), + ), + ], + ), + SizedBox(height:7.h,), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: "19", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + ) + ], + )), + ], + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/add_assort.dart b/lib/business_system/goods/on_sale/add_assort.dart new file mode 100644 index 00000000..301abe58 --- /dev/null +++ b/lib/business_system/goods/on_sale/add_assort.dart @@ -0,0 +1,194 @@ +import 'package:flutter/material.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../generated/l10n.dart'; + +class AddAssort extends StatefulWidget { + @override + State createState() { + return _AddAssort(); + } +} + +class _AddAssort extends State { + final TextEditingController editingSortController = TextEditingController(); + final TextEditingController editingNameController = TextEditingController(); + bool isKeyBoardShow = false; + FocusNode _focusNode = FocusNode(); + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + _focusNode.unfocus(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: (){ + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Colors.white, + appBar: MyAppBar( + title: "添加分类", + titleColor: Colors.black, + background: Colors.white, + leadingColor: Colors.black, + brightness: Brightness.dark, + ), + body: Container( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Row( + children: [ + Expanded(child: + Text( + "分组排序", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ),), + Expanded( + child: TextField( + controller: editingSortController, + decoration: InputDecoration( + hintText: "数字越大排名越靠前", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + ), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left:16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB) , + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFE02020), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "分类名称", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ),), + Expanded( + child: TextField( + controller: editingNameController, + decoration: InputDecoration( + hintText: "请输入分类名称", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB) , + margin: EdgeInsets.only(bottom: 16.h), + ), + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.pop(context); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B), + ), + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical:16.h), + margin: EdgeInsets.only(bottom:34.h), + child:Text( + S.of(context).baocun, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/batch_shelf.dart b/lib/business_system/goods/on_sale/batch_shelf.dart new file mode 100644 index 00000000..63ff2b67 --- /dev/null +++ b/lib/business_system/goods/on_sale/batch_shelf.dart @@ -0,0 +1,261 @@ +import 'package:flutter/material.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 '../../../utils/font_weight.dart'; +import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/my_footer.dart'; + +class BatchShelf extends StatefulWidget { + @override + State createState() { + return _BatchShelf(); + } +} + +class _BatchShelf extends State { + final RefreshController refreshController = RefreshController(); + ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final ScrollController controller = ScrollController(); + var checkStatus = false; + + @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( + margin: EdgeInsets.only(top: 24.h,), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.w, + color: Color(0xFFFAFAFA), + height: double.infinity, + child: ListView.builder( + itemCount:5, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: shelfLeftItem(), + ); + }, + ), + ), + Expanded(child: Container( + width: MediaQuery.of(context).size.width - 100.w, + child: ListView.builder( + itemCount: 6, + controller: controller, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return shelfRightItem(); + }, + ), + )), + ], + ), + ), + ), + ); + } + + + + ///左边list + Widget shelfLeftItem(){ + return Container( + width: 100.w, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + // controller.jumpTo(appletProducts[index].goodsIndex); + }); + }, + child: + Container( + // color: Color(0xFFFAFAFA), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), + // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + "人气必点榜", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight:MyFontWeight.semi_bold, + ), + )), + ], + ), + ), + ), + ); + } + + ///右边List + Widget shelfRightItem(){ + return Container( + margin: EdgeInsets.only(left:16.w,right:14.w), + width: double.infinity, + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.symmetric(vertical: 16.h), + child: Text("人气必点榜",style: TextStyle( + color: Color(0xFF30415B), + fontSize: 12.sp, + fontWeight:MyFontWeight.regular, + ),)), + ListView.builder( + itemCount: 3, + controller: controller, + physics: scrollPhysics, + shrinkWrap: true, + itemBuilder: (context, position) { + return shelfGoodsItem(); + }, + ) + ], + ), + ); + } + + Widget shelfGoodsItem(){ + return Container( + margin: EdgeInsets.only(bottom: 21.h), + child: Row( + children: [ + Image.asset( + "assets/image/hot_list.webp", + width: 77, + height: 77, + fit: BoxFit.fill, + ), + SizedBox(width:12.w,), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(top: 2.h), + child:Text( + "台湾甄选手抓饺子三生", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF000000), + ), + )), + Row( + children: [ + Text( + "库存4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ), + SizedBox(width: 8.w,), + Expanded(child: Text( + "销量4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), + )), + Checkbox( + visualDensity: VisualDensity.compact, + value: checkStatus, + onChanged: (a) { + setState(() { + checkStatus = !checkStatus; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor: + MaterialStateProperty.all(Color(0xFF30415B)), + ), + ], + ), + SizedBox(height:7.h,), + Row( + children: [ + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: "19", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + )), + ], + ) + ], + )), + ], + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/edit_assort.dart b/lib/business_system/goods/on_sale/edit_assort.dart new file mode 100644 index 00000000..c8f75a1a --- /dev/null +++ b/lib/business_system/goods/on_sale/edit_assort.dart @@ -0,0 +1,167 @@ +import 'package:flutter/material.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'; + +class EditAssort extends StatefulWidget { + @override + State createState() { + return _EditAssort(); + } +} + +class _EditAssort extends State { + final RefreshController refreshController = RefreshController(); + final TextEditingController editingSortController = TextEditingController(); + final TextEditingController editingNameController = TextEditingController(); + + @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:Container( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Row( + children: [ + Expanded(child: + Text( + "分组排序", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ),), + Expanded( + child: TextField( + controller: editingSortController, + decoration: InputDecoration( + hintText: "数字越大排名越靠前", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + ), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left:16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB) , + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: "*", + style: TextStyle( + color: Color(0xFFE02020), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + TextSpan( + text: "分类名称", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 16.sp, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ),), + Expanded( + child: TextField( + controller: editingNameController, + decoration: InputDecoration( + hintText: "请输入分类名称", + hintTextDirection: TextDirection.rtl, + hintStyle: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + border: InputBorder.none, + contentPadding: EdgeInsets.only(left: 16.w), + ), + textAlign: TextAlign.right, + style: TextStyle( + color: Color(0xFF7A797F), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold + ), + ), + ), + ], + ), + Container( + height: 1.h, + width: double.infinity, + color: Color(0xFFEBEBEB) , + margin: EdgeInsets.only(bottom: 16.h), + ), + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.pop(context); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B), + ), + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical:16.h), + margin: EdgeInsets.only(bottom:34.h), + child:Text( + S.of(context).baocun, + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/goods_assort.dart b/lib/business_system/goods/on_sale/goods_assort.dart new file mode 100644 index 00000000..4aa5dc4c --- /dev/null +++ b/lib/business_system/goods/on_sale/goods_assort.dart @@ -0,0 +1,138 @@ +import 'package:flutter/material.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 GoodsAssort extends StatefulWidget { + @override + State createState() { + return _GoodsAssort(); + } +} + +class _GoodsAssort extends State { + 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( + margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w), + child: Column( + children: [ + Expanded(child: ListView.builder( + itemCount: 5, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: assortItem(), + ); + }, + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/add_assort'); + }, + child:Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B), + ), + width: double.infinity, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical:16.h), + margin: EdgeInsets.only(bottom:34.h), + child:Text( + "添加分类", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.bold, + ), + ), + )), + ], + ), + ), + ), + ); + } + + Widget assortItem() { + return Container( + child: Column( + children: [ + Row( + children: [ + Expanded(child: Text( + "台湾甄选手抓饺子", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + )), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap:(){ + Navigator.of(context).pushNamed('/router/edit_assort'); + }, + child: Padding(padding: EdgeInsets.only(right: 16.w), + child: + Text( + "编辑", + style: TextStyle( + color: Color(0xFF30415B), + fontSize: 14.sp, + fontWeight: FontWeight.bold, + ), + ),),), + ], + ), + Container( + margin: EdgeInsets.symmetric(vertical: 16.h), + color: Color(0xFFEBEBEB), + height: 1.h, + width: double.infinity, + ) + ], + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/goods_sort.dart b/lib/business_system/goods/on_sale/goods_sort.dart new file mode 100644 index 00000000..a4da7052 --- /dev/null +++ b/lib/business_system/goods/on_sale/goods_sort.dart @@ -0,0 +1,255 @@ +import 'package:flutter/material.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 '../../../utils/font_weight.dart'; +import '../../../view_widget/classic_header.dart'; +import '../../../view_widget/my_footer.dart'; + +class GoodsSort extends StatefulWidget { + @override + State createState() { + return _GoodsSort(); + } +} + +class _GoodsSort extends State { + final RefreshController refreshController = RefreshController(); + ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final ScrollController controller = ScrollController(); + + @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( + margin: EdgeInsets.only(top: 24.h,), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.w, + color: Color(0xFFFAFAFA), + height: double.infinity, + child: ListView.builder( + itemCount:5, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: sortLeftItem(), + ); + }, + ), + ), + Expanded(child: Container( + width: MediaQuery.of(context).size.width - 100.w, + child: ListView.builder( + itemCount: 6, + controller: controller, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return sortRightItem(); + }, + ), + )), + ], + ), + ), + ), + ); + } + + ///左边list + Widget sortLeftItem(){ + return Container( + width: 100.w, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + // controller.jumpTo(appletProducts[index].goodsIndex); + }); + }, + child: + Container( + // color: Color(0xFFFAFAFA), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), + // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + "人气必点榜", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight:MyFontWeight.semi_bold, + ), + )), + ], + ), + ), + ), + ); + } + + ///右边List + Widget sortRightItem(){ + return Container( + margin: EdgeInsets.only(left:16.w,right: 14.w), + width: double.infinity, + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.symmetric(vertical: 16.h), + child: Text("人气必点榜",style: TextStyle( + color: Color(0xFF30415B), + fontSize: 12.sp, + fontWeight:MyFontWeight.regular, + ),)), + ListView.builder( + itemCount: 3, + controller: controller, + physics: scrollPhysics, + shrinkWrap: true, + itemBuilder: (context, position) { + return sortGoodsItem(); + }, + ) + ], + ), + ); + } + + Widget sortGoodsItem(){ + return Container( + margin: EdgeInsets.only(bottom: 21.h), + child: Row( + children: [ + Image.asset( + "assets/image/hot_list.webp", + width: 77, + height: 77, + fit: BoxFit.fill, + ), + SizedBox(width:12.w,), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), + child: Row( + children: [ + Expanded(child: Text( + "台湾甄选手抓饺子三生", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF000000), + ), + )), + Text( + "置顶", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ) + ], + ),), + Row( + children: [ + Text( + "库存4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ), + SizedBox(width: 8.w,), + Text( + "销量4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), + ), + ], + ), + SizedBox(height:7.h,), + Row( + children: [ + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: "19", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + )), + ], + ) + ], + )), + ], + ), + ); + } +} diff --git a/lib/business_system/goods/on_sale/on_sale_page.dart b/lib/business_system/goods/on_sale/on_sale_page.dart new file mode 100644 index 00000000..6c2ce485 --- /dev/null +++ b/lib/business_system/goods/on_sale/on_sale_page.dart @@ -0,0 +1,428 @@ +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'; + +class OnSalePage extends StatefulWidget { + @override + State createState() { + return _OnSalePage(); + } +} + +class _OnSalePage extends State { + final RefreshController _refreshController = RefreshController(); + ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final ScrollController controller = ScrollController(); + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async {} + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Stack( + alignment: Alignment.bottomCenter, + children: [ + Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + goodsSearch(), + Container( + color: Color(0xFFEBEBEB), + height: 1.h, + width: double.infinity, + ), + ], + ), + Expanded(child:Container( + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Container( + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: 100.w, + child: ListView.builder( + itemCount:5, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () {}, + child: leftItem(), + ); + }, + ), + ), + Container( + width: MediaQuery.of(context).size.width - 100.w, + child: ListView.builder( + itemCount: 6, + controller: controller, + physics: scrollPhysics, + shrinkWrap: true, + itemBuilder: (context, position) { + return rightItem(); + }, + ), + ), + ], + ), + SizedBox(height:70.h,) + ], + ), + )), + ), + )) + ], + ), + Container( + color: Color(0xFFEDEDED), + padding: EdgeInsets.only( + left: 16.w, + right: 16.w, + top:21.h, + bottom:24.h, + ), + child: Row( + children: [ + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/goods_assort'); + }, + child: Row( + children: [ + Text( + "分类管理", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF30415B), + ), + ), + SizedBox( + width: 2.w, + ), + Image.asset( + "assets/image/business.webp", + width: 18, + height: 18, + ), + ], + ), + ), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/goods_sort'); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "商品排序", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF30415B), + ), + ), + SizedBox( + width: 2.w, + ), + Image.asset( + "assets/image/bs_px.webp", + width: 18, + height: 18, + ), + ], + )), + ), + Expanded( + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/batch_shelf');}, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + "批量下架", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF30415B), + ), + ), + SizedBox( + width: 2.w, + ), + Image.asset( + "assets/image/bs_xj.webp", + width: 18, + height: 18, + ), + ], + )), + ), + ], + ), + ), + ], + ), + ); + } + + /// 搜索框 + Widget goodsSearch() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed('/router/goods_search_page'); + }, + child: Container( + height: 40.h, + margin: EdgeInsets.fromLTRB(18.w, 16.h, 18.w, 10.h), + padding: EdgeInsets.fromLTRB(12.w, 6.h, 0, 6.h), + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + child: Row( + children: [ + Image.asset( + "assets/image/bs_goods_search.webp", + width: 20, + height: 20, + ), + SizedBox( + width: 3.w, + ), + Text( + "请输入搜索内容", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + ), + ], + ), + ), + ); + } + + ///左边list + Widget leftItem(){ + return Container( + width: 100.w, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + setState(() { + // controller.jumpTo(appletProducts[index].goodsIndex); + }); + }, + child: + Container( + color: Color(0xFFFAFAFA), + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 16.h, horizontal:14.w), + // margin: EdgeInsets.only(bottom: (index==appletProducts.length - 1)?35.h:0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + "人气必点榜", + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF000000), + fontSize: 12.sp, + fontWeight:MyFontWeight.semi_bold, + ), + )), + ], + ), + ), + ), + ); + } + + ///右边List + Widget rightItem(){ + return Container( + margin: EdgeInsets.symmetric(horizontal:16.w), + width: double.infinity, + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.symmetric(vertical: 16.h), + child: Text("人气必点榜",style: TextStyle( + color: Color(0xFF30415B), + fontSize: 12.sp, + fontWeight:MyFontWeight.regular, + ),)), + ListView.builder( + itemCount: 8, + controller: controller, + physics: scrollPhysics, + shrinkWrap: true, + itemBuilder: (context, position) { + return rightGoodsItem(); + }, + ) + ], + ), + ); + } + + Widget rightGoodsItem(){ + return Container( + margin: EdgeInsets.only(bottom: 21.h), + child: Row( + children: [ + Image.asset( + "assets/image/hot_list.webp", + width: 70, + height: 70, + fit: BoxFit.fill, + ), + SizedBox(width:12.w,), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.only(bottom:11.h,top: 2.h), + child: Text( + "台湾甄选手抓饺子三生", + maxLines:1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF000000), + ), + ),), + Row( + children: [ + Text( + "库存4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFFA29E9E), + ), + ), + SizedBox(width: 8.w,), + Text( + "销量4321", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF999999), + ), + ), + ], + ), + SizedBox(height:7.h,), + Row( + children: [ + Expanded(child:Text.rich( + TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + TextSpan( + text: "19", + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFFF4524D), + ), + ), + ], + ), + )), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(33), + border: Border.all( + color: Color(0xFF30415B), + width: 1, + ), + ), + padding: EdgeInsets.symmetric(vertical: 2.h,horizontal:12.w), + child: Text( + "下架", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF30415B), + ), + ), + ) + ], + ) + ], + )), + ], + ), + ); + } + +} diff --git a/lib/business_system/home/business_home_page.dart b/lib/business_system/home/business_home_page.dart index 59cd3117..72afe46c 100644 --- a/lib/business_system/home/business_home_page.dart +++ b/lib/business_system/home/business_home_page.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.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/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -19,7 +18,6 @@ class BusinessHomePage extends StatefulWidget { class _BusinessHomePage extends State with AutomaticKeepAliveClientMixin{ - ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); List lineChartSample2Data = @@ -97,6 +95,7 @@ class _BusinessHomePage extends State child: Column( children: [ GestureDetector( + behavior: HitTestBehavior.opaque, onTap: (){ showAlertDialog(); // Navigator.of(context).pushNamed('/router/select_shop'); @@ -293,7 +292,7 @@ class _BusinessHomePage extends State ///侧面弹窗 showAlertDialog() { - showCupertinoModalPopup( + showDialog( builder: (context) { return HomeSideslipDialog();}, context: context); @@ -359,7 +358,7 @@ class _BusinessHomePage extends State SizedBox( height: 18.h, ), - LineChartSample2(lineChartSample2Data), + LineChartSample2(lineChartSample2Data,"销售量"), ], ), ); diff --git a/lib/business_system/home/flow_page.dart b/lib/business_system/home/flow_page.dart index eba7ad3a..20dbb697 100644 --- a/lib/business_system/home/flow_page.dart +++ b/lib/business_system/home/flow_page.dart @@ -1,5 +1,4 @@ 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'; @@ -16,7 +15,6 @@ class FlowPage extends StatefulWidget { } class _FlowPage extends State { - ApiService apiService; final RefreshController refreshController = RefreshController(); var isShowMore = false; diff --git a/lib/business_system/home/home_view/donut_auto_label_chart.dart b/lib/business_system/home/home_view/donut_auto_label_chart.dart new file mode 100644 index 00000000..a7d7612a --- /dev/null +++ b/lib/business_system/home/home_view/donut_auto_label_chart.dart @@ -0,0 +1,36 @@ +/// Donut chart with labels example. This is a simple pie chart with a hole in +/// the middle. +import 'package:charts_common/src/common/color.dart' show Color; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:charts_flutter/flutter.dart'; +import 'package:flutter/material.dart'; + +import 'my_arc_label_decorator.dart'; + +class DonutAutoLabelChart extends StatelessWidget { + final List seriesList; + final bool animate; + + DonutAutoLabelChart(this.seriesList, {this.animate = false}); + + @override + Widget build(BuildContext context) { + return new charts.PieChart(seriesList, + animate: animate, + defaultRenderer: new charts.ArcRendererConfig( + arcWidth: 15, + strokeWidthPx: 0, + arcRendererDecorators: [ + new MyArcLabelDecorator(MediaQuery.of(context).size.width) + ])); + } +} + +/// Sample linear data type. +class LinearSales { + final int year; + final int sales; + final Color color; + + LinearSales(this.year, this.sales, this.color); +} diff --git a/lib/business_system/home/home_view/home_sideslip_dialog.dart b/lib/business_system/home/home_view/home_sideslip_dialog.dart index ff1e3337..a39ac14e 100644 --- a/lib/business_system/home/home_view/home_sideslip_dialog.dart +++ b/lib/business_system/home/home_view/home_sideslip_dialog.dart @@ -1,12 +1,6 @@ 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 { @@ -28,11 +22,11 @@ class _HomeSideslipDialog extends State with SingleTickerPro vsync: this, ); _animation = Tween( - begin: Offset(1.0, 0.0), - end: Offset.zero, + begin: Offset(-1, 0), + end: Offset(0, 0), ).animate(CurvedAnimation( parent: _animationController, - curve: Curves.easeInOut, + curve: Curves.fastOutSlowIn, )); _animationController.forward(); } diff --git a/lib/business_system/home/home_view/my_arc_label_decorator.dart b/lib/business_system/home/home_view/my_arc_label_decorator.dart new file mode 100644 index 00000000..61f32e87 --- /dev/null +++ b/lib/business_system/home/home_view/my_arc_label_decorator.dart @@ -0,0 +1,477 @@ +// Copyright 2018 the Charts project authors. Please see the AUTHORS file +// for details. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import 'dart:math' show cos, min, sin, pi, Point, Rectangle; + +import 'package:charts_common/src/chart/cartesian/axis/spec/axis_spec.dart' + show TextStyleSpec; +import 'package:charts_common/src/chart/common/chart_canvas.dart' + show ChartCanvas; +import 'package:charts_common/src/chart/pie/arc_renderer_decorator.dart' + show ArcRendererDecorator; +import 'package:charts_common/src/chart/pie/arc_renderer_element.dart' + show ArcRendererElement, ArcRendererElementList; +import 'package:charts_common/src/common/color.dart' show Color; +import 'package:charts_common/src/common/graphics_factory.dart' + show GraphicsFactory; +import 'package:charts_common/src/common/style/style_factory.dart' + show StyleFactory; +import 'package:charts_common/src/common/text_element.dart' + show MaxWidthStrategy, TextDirection, TextElement; +import 'package:charts_common/src/common/text_style.dart' show TextStyle; +import 'package:charts_common/src/data/series.dart' show AccessorFn; +import 'package:meta/meta.dart' show immutable, protected; + +/// Renders labels for arc renderers. +/// +/// This decorator performs very basic label collision detection. If the y +/// position of a label positioned outside collides with the previously drawn +/// label (on the same side of the chart), then that label will be skipped. +class MyArcLabelDecorator extends ArcRendererDecorator { + // Default configuration + static const _defaultLabelPosition = ArcLabelPosition.auto; + static const _defaultLabelPadding = 5; + static final _defaultInsideLabelStyle = + TextStyleSpec(fontSize: 12, color: Color.white); + static final _defaultLineColors = [ + Color.fromHex(code: "#21CCFF"), + Color.fromHex(code: "#313CA9") + ]; + static final _defaultLabelText = ["收款(0.00%)", "退款(0.00%)"]; + static final _defaultOutsideLabelStyle = + TextStyleSpec(fontSize: 14, color: Color.fromHex(code: "#333333"),); + static final _defaultTextLabelStyle = + TextStyleSpec(fontSize: 10, color: Color.fromHex(code: "#999999")); + static final _defaultLeaderLineStyle = ArcLabelLeaderLineStyleSpec( + length: 15.0, + thickness: 1.0, + color: StyleFactory.style.arcLabelOutsideLeaderLine); + static const _defaultShowLeaderLines = true; + + /// Configures [TextStyleSpec] for labels placed inside the arcs. + final TextStyleSpec insideLabelStyleSpec; + + /// Configures [TextStyleSpec] for labels placed outside the arcs. + final TextStyleSpec outsideLabelStyleSpec; + + /// Configures [ArcLabelLeaderLineStyleSpec] for leader lines for labels + /// placed outside the arcs. + final ArcLabelLeaderLineStyleSpec leaderLineStyleSpec; + + /// Configures where to place the label relative to the arcs. + final ArcLabelPosition labelPosition; + + /// Space before and after the label text. + final int labelPadding; + + /// Whether or not to draw leader lines for labels placed outside the arcs. + final bool showLeaderLines; + + /// Render the labels on top of series data. + @override + final bool renderAbove = true; + + /// fields for collision detection. + num _previousOutsideLabelY; + bool _previousLabelLeftOfChart; + + final double mediaQueryWidth; + + MyArcLabelDecorator(this.mediaQueryWidth, + {TextStyleSpec insideLabelStyleSpec, + TextStyleSpec outsideLabelStyleSpec, + ArcLabelLeaderLineStyleSpec leaderLineStyleSpec, + this.labelPosition = _defaultLabelPosition, + this.labelPadding = _defaultLabelPadding, + this.showLeaderLines = _defaultShowLeaderLines, + Color leaderLineColor}) + : insideLabelStyleSpec = insideLabelStyleSpec ?? _defaultInsideLabelStyle, + outsideLabelStyleSpec = + outsideLabelStyleSpec ?? _defaultOutsideLabelStyle, + leaderLineStyleSpec = leaderLineStyleSpec ?? _defaultLeaderLineStyle; + + @override + void decorate(List> arcElementsList, + ChartCanvas canvas, GraphicsFactory graphicsFactory, + {Rectangle drawBounds, + double animationPercent, + bool rtl = false}) { + // Only decorate the arcs when animation is at 100%. + if (animationPercent != 1.0) { + return; + } + + // Create [TextStyle] from [TextStyleSpec] to be used by all the elements. + // The [GraphicsFactory] is needed so it can't be created earlier. + final insideLabelStyle = + _getTextStyle(graphicsFactory, insideLabelStyleSpec); + final outsideLabelStyle = + _getTextStyle(graphicsFactory, outsideLabelStyleSpec); + final textLabelStyle = + _getTextStyle(graphicsFactory, _defaultTextLabelStyle); + + // Track the Y position of the previous outside label for collision + // detection purposes. + int i = 0; + for (var arcElements in arcElementsList) { + _previousOutsideLabelY = null; + _previousLabelLeftOfChart = null; + + for (var element in arcElements.arcs) { + final labelFn = element.series.labelAccessorFn; + final datumIndex = element.index; + final label = (labelFn != null) ? labelFn(datumIndex) : null; + + // If there are custom styles, use that instead of the default or the + // style defined for the entire decorator. + final datumInsideLabelStyle = _getDatumStyle( + element.series.insideLabelStyleAccessorFn, + datumIndex, + graphicsFactory, + defaultStyle: insideLabelStyle); + final datumOutsideLabelStyle = _getDatumStyle( + element.series.outsideLabelStyleAccessorFn, + datumIndex, + graphicsFactory, + defaultStyle: outsideLabelStyle); + final datumTextLabelStyle = _getDatumStyle( + element.series.outsideLabelStyleAccessorFn, + datumIndex, + graphicsFactory, + defaultStyle: textLabelStyle); + + // Skip calculation and drawing for this element if no label. + if (label == null || label.isEmpty) { + continue; + } + + final arcAngle = element.endAngle - element.startAngle; + + final centerAngle = element.startAngle + (arcAngle / 2); + + final centerRadius = arcElements.innerRadius + + ((arcElements.radius - arcElements.innerRadius) / 2); + + final outerPoint = Point( + arcElements.center.x + arcElements.radius * cos(centerAngle), + arcElements.center.y + arcElements.radius * sin(centerAngle)); + + final bounds = + Rectangle.fromPoints(arcElements.center, outerPoint); + + // Get space available inside and outside the arc. + final totalPadding = labelPadding * 2; + final insideArcWidth = min( + (((arcAngle * 180 / pi) / 360) * (2 * pi * centerRadius)) + .round(), + (arcElements.radius - arcElements.innerRadius) - labelPadding) + .round(); + + final leaderLineLength = + showLeaderLines ? leaderLineStyleSpec.length : 0; + + final outsideArcWidth = ((mediaQueryWidth / 2) - + bounds.width - + totalPadding - + // Half of the leader line is drawn inside the arc + leaderLineLength / 2) + .round(); + + final labelElement = graphicsFactory.createTextElement(label) + ..maxWidthStrategy = MaxWidthStrategy.ellipsize; + + final labelTextElement = graphicsFactory + .createTextElement(_defaultLabelText[i]) + ..maxWidthStrategy = MaxWidthStrategy.ellipsize; + + var calculatedLabelPosition = calculateLabelPosition( + labelElement, + datumInsideLabelStyle, + insideArcWidth, + outsideArcWidth, + element, + labelPosition); + + // Set the max width and text style. + if (calculatedLabelPosition == ArcLabelPosition.inside) { + labelElement.textStyle = datumInsideLabelStyle; + labelElement.maxWidth = insideArcWidth; + } else { + // calculatedLabelPosition == LabelPosition.outside + labelElement.textStyle = datumOutsideLabelStyle; + labelElement.maxWidth = outsideArcWidth; + labelTextElement.maxWidth = outsideArcWidth; + } + labelTextElement.textStyle = datumTextLabelStyle; + + // Only calculate and draw label if there's actually space for the + // label. + if (labelElement.maxWidth > 0) { + // Calculate the start position of label based on [labelAnchor]. + if (calculatedLabelPosition == ArcLabelPosition.inside) { + _drawInsideLabel(canvas, arcElements, labelElement, centerAngle); + } else { + final l = _drawOutsideLabel( + canvas, + drawBounds, + arcElements, + labelElement, + labelTextElement, + centerAngle, + _defaultLineColors[i]); + i += 1; + + if (l != null) { + updateCollisionDetectionParams(l); + } + } + } + } + } + } + + @protected + ArcLabelPosition calculateLabelPosition( + TextElement labelElement, + TextStyle labelStyle, + int insideArcWidth, + int outsideArcWidth, + ArcRendererElement arcRendererelement, + ArcLabelPosition labelPosition) { + if (labelPosition == ArcLabelPosition.auto) { + // For auto, first try to fit the text inside the arc. + labelElement.textStyle = labelStyle; + + // A label fits if the space inside the arc is >= outside arc or if the + // length of the text fits and the space. This is because if the arc has + // more space than the outside, it makes more sense to place the label + // inside the arc, even if the entire label does not fit. + return (insideArcWidth >= outsideArcWidth || + labelElement.measurement.horizontalSliceWidth < insideArcWidth) + ? ArcLabelPosition.inside + : ArcLabelPosition.outside; + } else { + return labelPosition; + } + } + + /// Helper function that converts [TextStyleSpec] to [TextStyle]. + TextStyle _getTextStyle( + GraphicsFactory graphicsFactory, TextStyleSpec labelSpec) { + return graphicsFactory.createTextPaint() + ..color = labelSpec.color ?? Color.black + ..fontFamily = labelSpec.fontFamily + ..fontSize = labelSpec.fontSize ?? 12 + ..lineHeight = labelSpec.lineHeight; + } + + /// Helper function to get datum specific style + TextStyle _getDatumStyle(AccessorFn labelFn, int datumIndex, + GraphicsFactory graphicsFactory, + {TextStyle defaultStyle}) { + final styleSpec = (labelFn != null) ? labelFn(datumIndex) : null; + return (styleSpec != null) + ? _getTextStyle(graphicsFactory, styleSpec) + : defaultStyle; + } + + /// Draws a label inside of an arc. + void _drawInsideLabel( + ChartCanvas canvas, + ArcRendererElementList arcElements, + TextElement labelElement, + double centerAngle) { + // Center the label inside the arc. + final labelRadius = arcElements.innerRadius + + (arcElements.radius - arcElements.innerRadius) / 2; + + final labelX = + (arcElements.center.x + labelRadius * cos(centerAngle)).round(); + + final labelY = (arcElements.center.y + + labelRadius * sin(centerAngle) - + insideLabelStyleSpec.fontSize / 2) + .round(); + + labelElement.textDirection = TextDirection.center; + + canvas.drawText(labelElement, labelX, labelY); + } + + @protected + void updateCollisionDetectionParams(List params) { + // List destructuring. + _previousLabelLeftOfChart = params[0] as bool; + _previousOutsideLabelY = params[1] as int; + } + + double getLabelRadius(ArcRendererElementList arcElements) => + arcElements.radius + leaderLineStyleSpec.length / 2; + + /// Draws a label outside of an arc. + List _drawOutsideLabel( + ChartCanvas canvas, + Rectangle drawBounds, + ArcRendererElementList arcElements, + TextElement labelElement, + TextElement labelTextElement, + double centerAngle, + Color color) { + final labelRadius = getLabelRadius(arcElements); + + final labelPoint = Point( + arcElements.center.x + labelRadius * cos(centerAngle), + arcElements.center.y + labelRadius * sin(centerAngle)); + + // Use the label's chart quandrant to determine whether it's rendered to the + // right or left. + final centerAbs = centerAngle.abs() % (2 * pi); + final labelLeftOfChart = pi / 2 < centerAbs && centerAbs < pi * 3 / 2; + + // Shift the label horizontally away from the center of the chart. + var labelX = labelLeftOfChart + ? (labelPoint.x - labelPadding).round() + : (labelPoint.x + labelPadding).round(); + + // Shift the label up by the size of the font. + final labelY = (labelPoint.y - outsideLabelStyleSpec.fontSize / 2).round(); + + // Outside labels should flow away from the center of the chart + labelElement.textDirection = + labelLeftOfChart ? TextDirection.rtl : TextDirection.ltr; + labelTextElement.textDirection = labelElement.textDirection; + + // Skip this label if it collides with the previously drawn label. + if (detectOutsideLabelCollision(labelY, labelLeftOfChart, + _previousOutsideLabelY, _previousLabelLeftOfChart)) { + return null; + } + + if (showLeaderLines) { + final tailX = _drawLeaderLine(canvas, labelLeftOfChart, labelPoint, + arcElements.radius, arcElements.center, centerAngle, color); + + // Shift the label horizontally by the length of the leader line. + labelX = (labelX + tailX).round(); + + labelElement.maxWidth = (labelElement.maxWidth - tailX.abs()).round(); + } + + canvas.drawText(labelElement, labelX, labelY); + + canvas.drawText(labelTextElement, labelX, labelY + 18); + + // Return a structured list of values. + return [labelLeftOfChart, labelY]; + } + + /// Detects whether the current outside label collides with the previous label. + @protected + bool detectOutsideLabelCollision(num labelY, bool labelLeftOfChart, + num previousOutsideLabelY, bool previousLabelLeftOfChart) { + var collides = false; + + // Given that labels are vertically centered, we can assume they will + // collide if the current label's Y coordinate +/- the font size + // crosses past the Y coordinate of the previous label drawn on the + // same side of the chart. + if (previousOutsideLabelY != null && + labelLeftOfChart == previousLabelLeftOfChart) { + if (labelY > previousOutsideLabelY) { + if (labelY - outsideLabelStyleSpec.fontSize <= previousOutsideLabelY) { + collides = true; + } + } else { + if (labelY + outsideLabelStyleSpec.fontSize >= previousOutsideLabelY) { + collides = true; + } + } + } + + return collides; + } + + /// Draws a leader line for the current arc. + double _drawLeaderLine( + ChartCanvas canvas, + bool labelLeftOfChart, + Point labelPoint, + double radius, + Point arcCenterPoint, + double centerAngle, + Color color) { + final tailX = (labelLeftOfChart ? -1 : 1) * leaderLineStyleSpec.length; + + final leaderLineTailPoint = + Point(labelPoint.x + tailX, labelPoint.y); + + final centerRadius = radius - leaderLineStyleSpec.length / 2; + final leaderLineStartPoint = Point( + arcCenterPoint.x + centerRadius * cos(centerAngle), + arcCenterPoint.y + centerRadius * sin(centerAngle)); + + canvas.drawLine(points: [ + leaderLineStartPoint, + labelPoint, + leaderLineTailPoint, + ], stroke: color, strokeWidthPx: leaderLineStyleSpec.thickness); + + return tailX; + } +} + +/// Configures where to place the label relative to the arcs. +enum ArcLabelPosition { + /// Automatically try to place the label inside the arc first and place it on + /// the outside of the space available outside the arc is greater than space + /// available inside the arc. + auto, + + /// Always place label on the outside. + outside, + + /// Always place label on the inside. + inside +} + +/// Style configuration for leader lines. +@immutable +class ArcLabelLeaderLineStyleSpec { + final Color color; + final double length; + final double thickness; + + ArcLabelLeaderLineStyleSpec({ + this.color, + this.length, + this.thickness, + }); + + @override + bool operator ==(Object other) { + return other is ArcLabelLeaderLineStyleSpec && + color == other.color && + thickness == other.thickness && + length == other.length; + } + + @override + int get hashCode { + var hashcode = color.hashCode; + hashcode = (hashcode * 37) + thickness.hashCode; + hashcode = (hashcode * 37) + length.hashCode; + return hashcode; + } +} diff --git a/lib/business_system/home/home_view/my_line_chart.dart b/lib/business_system/home/home_view/my_line_chart.dart index 53425da3..9772482a 100644 --- a/lib/business_system/home/home_view/my_line_chart.dart +++ b/lib/business_system/home/home_view/my_line_chart.dart @@ -6,8 +6,9 @@ import '../../../utils/font_weight.dart'; class LineChartSample2 extends StatefulWidget { final List lineChartSample2Data; + final String tipName; - LineChartSample2(this.lineChartSample2Data, {Key key}) : super(key: key); + LineChartSample2(this.lineChartSample2Data,this.tipName, {Key key}) : super(key: key); @override State createState() => _LineChartSample2State(); @@ -123,7 +124,11 @@ class _LineChartSample2State extends State { show: true, border: Border( bottom: BorderSide( - color: Color(0xFFCBCBCB), + color: Color(0xFF165DFF), + width: 1, + ), + top: BorderSide( + color: Color(0xFFEBEBEB), width: 1, ), //表格左边线 @@ -166,7 +171,6 @@ class _LineChartSample2State extends State { tooltipPadding: const EdgeInsets.symmetric(vertical:5,horizontal:6), tooltipMargin: 5, tooltipRoundedRadius: 2, - // tooltipHorizontalAlignment: FLHorizontalAlignment.center, getTooltipItems: (touchedSpots) { return touchedSpots.map((LineBarSpot touchedSpot) { return LineTooltipItem( @@ -178,7 +182,7 @@ class _LineChartSample2State extends State { textAlign: TextAlign.start, children: [ TextSpan( - text: '\n订单量: ', + text: '\n${widget?.tipName??""}: ', style: const TextStyle( color: Colors.white, fontWeight: MyFontWeight.medium, diff --git a/lib/business_system/home/overview/trade_goods.dart b/lib/business_system/home/overview/trade_goods.dart new file mode 100644 index 00000000..335a1d39 --- /dev/null +++ b/lib/business_system/home/overview/trade_goods.dart @@ -0,0 +1,499 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../utils/font_weight.dart'; + +class TradeGoods extends StatefulWidget { + @override + State createState() { + return _TradeGoods(); + } +} + +class _TradeGoods extends State { + final RefreshController _refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async { + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Column( + children: [ + Container( + color: Color(0xFFD8D8D8), + width: double.infinity, + height: 1.h, + ), + Expanded(child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + scrollController: scrollController, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Color(0xFFCFD0D1), + width: 1.w), + ), + margin: EdgeInsets.only( + top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), + child: Row( + children: [ + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "日报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "周报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "月报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "自定义", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + ], + ), + ), + Align(alignment: Alignment.center, + child: Container( + width: 154.w, + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + ), + margin: EdgeInsets.only(bottom:16.h), + child: Row( + children: [ + Padding(padding: EdgeInsets.only(right: 20.w), + child: Text( + "2023年06月01日(今日)", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ),), + Image.asset( + "assets/image/bs_calendar_logo.webp", + width:15, + height:15, + ), + ], + ), + ),), + Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), + child:Text( + "商品分析", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + )), + goodsTypeRecord(), + Container( + margin: EdgeInsets.only(top: 14.h,left:16.w,right: 16.w), + color: Color(0xFFECECEC), + height: 1.h, + width: double.infinity, + ), + singleSalesStatement(), + ], + )), + ),) + ], + ), + ); + } + + ///商品种类销售数据 + Widget goodsTypeRecord(){ + return Column( + children: [ + Padding(padding:EdgeInsets.only(left:16.w,bottom: 19.h), + child:Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:12.w), + ), + Text( + "商品种类销售数据", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color:Color(0xFF0D0D0D), + ), + ), + SizedBox(width:8.w,), + Text( + "比上周一同时段", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color:Color(0xFF666666), + ), + ) + ], + )), + Container( + margin: EdgeInsets.symmetric(horizontal: 16.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + border: Border.all( + color: Color(0xFFD6D6D6), + width: 1, + ), + ), + child: Column( + children: [ + Container( + color: Color(0xFFF3F7FF), + padding: EdgeInsets.only(top: 7.h,left: 11.w,right:24.w,bottom: 8.h), + child: Row( + children: [ + Expanded(child:Text( + "分类", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),), + Text( + "销售额", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ), + ], + ), + ), + Container( + height: 183.h, + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:1, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: goodsTypeItem(), + ); + }, + ), + ) + ], + ), + ), + ], + ); + } + + Widget goodsTypeItem(){ + return Container( + color: Color(0xFFF9FAF8), + padding: EdgeInsets.only(top:8.h,left: 11.w,right:24.w,bottom:7.h), + child:Row( + children: [ + Expanded(child:Text( + "招牌奶", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),), + Text( + "3423", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ), + ], + ), + ); + } + + ///单品销量报表 + Widget singleSalesStatement(){ + return Container( + padding: EdgeInsets.only(top:23.h,bottom:45.h), + child: Column( + children: [ + Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), + child:Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:12.w), + ), + Text( + "单品销量报表", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color:Color(0xFF0D0D0D), + ), + ), + SizedBox(width:8.w,), + Text( + "比上周一同时段", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color:Color(0xFF666666), + ), + ) + ], + )), + Container( + margin: EdgeInsets.symmetric(horizontal: 16.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + border: Border.all( + color: Color(0xFFD6D6D6), + width: 1, + ), + ), + child: Column( + children: [ + Container( + color: Color(0xFFF3F7FF), + padding: EdgeInsets.only(top: 7.h,left:17.w,bottom: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child:Text( + "分类", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),flex: 2,), + Expanded(child:Text( + "名称", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),flex: 2,), + Expanded(child:Text( + "销售额", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),), + Expanded(child:Text( + "单价", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),), + Expanded(child:Text( + "销量", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF969799), + ), + ),), + ], + ), + ), + Container( + height: 203.h, + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount:5, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: singleSalesItem(), + ); + }, + ), + ) + ], + ), + ), + ], + ), + ); + } + + Widget singleSalesItem(){ + return Container( + color: Color(0xFFF9FAF8), + padding: EdgeInsets.only(top:8.h,left:16.w,bottom:7.h), + child:Row( + children: [ + Expanded(child:Text( + "金贵牛肉面", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),flex: 2,), + Expanded(child:Text( + "番茄牛肉面", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),flex: 2,), + Expanded(child:Text( + "3423", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),), + Expanded(child:Text( + "113", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),), + Expanded(child:Text( + "3423", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color:Color(0xFF000000), + ), + ),), + ], + ), + ); + } +} diff --git a/lib/business_system/home/overview/trade_order.dart b/lib/business_system/home/overview/trade_order.dart new file mode 100644 index 00000000..de536e08 --- /dev/null +++ b/lib/business_system/home/overview/trade_order.dart @@ -0,0 +1,283 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../utils/font_weight.dart'; +import '../home_view/my_line_chart.dart'; + +class TradeOrder extends StatefulWidget { + @override + State createState() { + return _TradeOrder(); + } +} + +class _TradeOrder extends State { + final RefreshController _refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + List lineChartSample2DataAmount = + [LineChartSample2Data(0,10,"2023-03-09"), + LineChartSample2Data(1,10,"2023-03-10"), + LineChartSample2Data(2,60,"2023-03-11"), + LineChartSample2Data(3,35,"2023-03-12"), + LineChartSample2Data(4,20,"2023-03-13"), + LineChartSample2Data(5,55,"2023-03-14"), + LineChartSample2Data(6,99,"2023-03-15")]; + List lineChartSample2DataNum = + [LineChartSample2Data(0,60,"2023-03-09"), + LineChartSample2Data(1,30,"2023-03-10"), + LineChartSample2Data(2,50,"2023-03-11"), + LineChartSample2Data(3,80,"2023-03-12"), + LineChartSample2Data(4,5,"2023-03-13"), + LineChartSample2Data(5,55,"2023-03-14"), + LineChartSample2Data(6,98,"2023-03-15")]; + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async { + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Column( + children: [ + Container( + color: Color(0xFFD8D8D8), + width: double.infinity, + height: 1.h, + ), + Expanded(child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + scrollController: scrollController, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Color(0xFFCFD0D1), + width: 1.w), + ), + margin: EdgeInsets.only( + top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), + child: Row( + children: [ + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "日报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "周报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "月报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "自定义", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + ], + ), + ), + Align(alignment: Alignment.center, + child: Container( + width: 154.w, + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + ), + margin: EdgeInsets.only(bottom:16.h), + child: Row( + children: [ + Padding(padding: EdgeInsets.only(right: 20.w), + child: Text( + "2023年06月01日(今日)", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ),), + Image.asset( + "assets/image/bs_calendar_logo.webp", + width:15, + height:15, + ), + ], + ), + ),), + Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), + child:Text( + "订单分析", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + )), + orderAmount(), + orderNumTrend(), + ], + )), + ),) + ], + ), + ); + } + + ///订单金额 + Widget orderAmount(){ + return Column( + children: [ + Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), + child:Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:12.w), + ), + Text( + "订单金额", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color:Color(0xFF0D0D0D), + ), + ), + SizedBox(width:8.w,), + Text( + "近12周", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color:Color(0xFF666666), + ), + ) + ], + )), + Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), + child:LineChartSample2(lineChartSample2DataAmount,"金额"),), + SizedBox(height:16.h,), + ], + ); + } + + ///订单量趋势 + Widget orderNumTrend(){ + return Container( + padding: EdgeInsets.only(top:12.h,bottom: 33.h), + child: Column( + children: [ + Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), + child:Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:12.w), + ), + Text( + "订单趋势", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color:Color(0xFF0D0D0D), + ), + ) + ], + )), + Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), + child:LineChartSample2(lineChartSample2DataNum,"订单量"),), + SizedBox(height:16.h,), + + ], + ), + ); + } +} diff --git a/lib/business_system/home/trade_overview_page.dart b/lib/business_system/home/overview/trade_overview_page.dart similarity index 78% rename from lib/business_system/home/trade_overview_page.dart rename to lib/business_system/home/overview/trade_overview_page.dart index 58eee0dd..a63d4808 100644 --- a/lib/business_system/home/trade_overview_page.dart +++ b/lib/business_system/home/overview/trade_overview_page.dart @@ -1,17 +1,12 @@ 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/business_system/home/overview/trade_goods.dart'; +import 'package:huixiang/business_system/home/overview/trade_order.dart'; +import 'package:huixiang/business_system/home/overview/trade_summary.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'; +import '../../../view_widget/my_tab.dart'; class TradeOverviewPage extends StatefulWidget { @override @@ -21,9 +16,7 @@ class TradeOverviewPage extends StatefulWidget { } class _TradeOverviewPage extends State with SingleTickerProviderStateMixin{ - ApiService apiService; final RefreshController refreshController = RefreshController(); - var isShowMore = false; @override void initState() { @@ -43,6 +36,7 @@ class _TradeOverviewPage extends State with SingleTickerProvi toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top, bottom: TabBar( // isScrollable: true, //可滚动 + overlayColor: MaterialStateProperty.all(Colors.white), indicatorColor: Color(0xFF30415B), labelColor: Colors.black, labelStyle: TextStyle( @@ -69,8 +63,8 @@ class _TradeOverviewPage extends State with SingleTickerProvi body: TabBarView( children: [ TradeSummary(), - CouponsPage(), - VipCardPage(),], + TradeOrder(), + TradeGoods(),], ), ), ); diff --git a/lib/business_system/home/overview/trade_summary.dart b/lib/business_system/home/overview/trade_summary.dart new file mode 100644 index 00000000..e7cc7cb1 --- /dev/null +++ b/lib/business_system/home/overview/trade_summary.dart @@ -0,0 +1,449 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../utils/font_weight.dart'; +import '../home_view/donut_auto_label_chart.dart'; +import '../home_view/my_line_chart.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class TradeSummary extends StatefulWidget { + @override + State createState() { + return _TradeSummary(); + } +} + +class _TradeSummary extends State { + final RefreshController _refreshController = RefreshController(); + final ScrollController scrollController = ScrollController(); + int operateSelect = 0; + int expensesSelect = 0; + List lineChartSample2DataAmount = + [LineChartSample2Data(0,40,"2023-03-09"), + LineChartSample2Data(1,10,"2023-03-10"), + LineChartSample2Data(2,50,"2023-03-11"), + LineChartSample2Data(3,35,"2023-03-12"), + LineChartSample2Data(4,20,"2023-03-13"), + LineChartSample2Data(5,55,"2023-03-14"), + LineChartSample2Data(6,100,"2023-03-15")]; + List lineChartSample2DataNum = + [LineChartSample2Data(0,20,"2023-03-09"), + LineChartSample2Data(1,30,"2023-03-10"), + LineChartSample2Data(2,50,"2023-03-11"), + LineChartSample2Data(3,60,"2023-03-12"), + LineChartSample2Data(4,5,"2023-03-13"), + LineChartSample2Data(5,55,"2023-03-14"), + LineChartSample2Data(6,95,"2023-03-15")]; + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async { + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + body: Column( + children: [ + Container( + color: Color(0xFFD8D8D8), + width: double.infinity, + height: 1.h, + ), + Expanded(child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + scrollController: scrollController, + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + border: Border.all(color: Color(0xFFCFD0D1), + width: 1.w), + ), + margin: EdgeInsets.only( + top: 16.h, right: 20.w, left: 20.w, bottom: 12.h), + child: Row( + children: [ + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "日报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Colors.white, + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "周报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "月报", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + Expanded(child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(2), + // color: Color(0xFF30415B), + ), + padding: EdgeInsets.symmetric(vertical: 9.h), + child: Text( + "自定义", + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF30415B), + ), + ), + ),), + ], + ), + ), + Align(alignment: Alignment.center, + child: Container( + width: 154.w, + alignment: Alignment.center, + padding: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Color(0xFFF6F6F6), + borderRadius: BorderRadius.circular(2), + ), + margin: EdgeInsets.only(bottom:16.h), + child: Row( + children: [ + Padding(padding: EdgeInsets.only(right: 20.w), + child: Text( + "2023年06月01日(今日)", + style: TextStyle( + fontSize: 10.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ),), + Image.asset( + "assets/image/bs_calendar_logo.webp", + width:15, + height:15, + ), + ], + ), + ),), + Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h), + child:Text( + "经营分析", + style: TextStyle( + fontSize: 18.sp, + fontWeight: MyFontWeight.semi_bold, + color: Colors.black, + ), + )), + operateAnalysis(), + Container( + color: Color(0xFFF9FAF8), + height: 16.h, + width: double.infinity, + ), + expensesAnalysis(), + ], + )), + ),) + ], + ), + ); + } + + ///经营分析 + Widget operateAnalysis(){ + return Column( + children: [ + Padding(padding: EdgeInsets.only(left:21.w,bottom: 1.h), + child: Row( + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + operateSelect = 0; + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 10.h), + child:Text( + "营业额", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: operateSelect == 0 ? Colors.black:Color(0xFF969696), + ), + )), + if(operateSelect == 0) + Container( + height: 2.h, + width: 44.w, + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(2), + ), + ), + ], + ), + ), + SizedBox(width:47.w,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + operateSelect = 1; + });}, + child:Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 10.h), + child:Text( + "交易笔数", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: operateSelect == 1 ? Colors.black:Color(0xFF969696), + ), + )), + if(operateSelect == 1) + Container( + height: 2.h, + width: 44.w, + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(2), + ), + ), + ], + ), + ), + ], + ),), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFD8D8D8), + margin: EdgeInsets.only(bottom:30.h), + ), + if(operateSelect== 0) + Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), + child:LineChartSample2(lineChartSample2DataAmount,"金额"),), + if(operateSelect == 1) + Padding(padding: EdgeInsets.symmetric(horizontal: 20.w), + child:LineChartSample2(lineChartSample2DataNum,"交易笔数"),), + SizedBox(height:16.h,), + ], + ); + } + + ///收退款分析 + Widget expensesAnalysis(){ + return Container( + padding: EdgeInsets.only(top:12.h,bottom: 33.h), + child: Column( + children: [ + Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h), + child:Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:12.w), + ), + Text( + "收退款分析", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.semi_bold, + color:Color(0xFF0D0D0D), + ), + ) + ], + )), + Padding(padding: EdgeInsets.only(left:21.w,bottom: 1.h), + child: Row( + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + expensesSelect = 0; + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 10.h), + child:Text( + "交易金额", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: expensesSelect == 0 ? Colors.black:Color(0xFF969696), + ), + )), + if(expensesSelect == 0) + Container( + height: 2.h, + width: 44.w, + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(2), + ), + ), + ], + ), + ), + SizedBox(width:37.w,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + setState((){ + expensesSelect = 1; + });}, + child:Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding(padding:EdgeInsets.only(bottom: 10.h), + child:Text( + "交易笔数", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.medium, + color: expensesSelect == 1 ? Colors.black:Color(0xFF969696), + ), + )), + if(expensesSelect == 1) + Container( + height: 2.h, + width: 44.w, + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(2), + ), + ), + ], + ), + ), + ], + ),), + if(expensesSelect == 0) + Container( + height:150.h, + child: DonutAutoLabelChart([ + new charts.Series( + id: 'Sales', + colorFn: (LinearSales sales, __) => + sales.color, + domainFn: (LinearSales sales, _) => + sales.year, + measureFn: (LinearSales sales, _) => + sales.sales, + data: [ + new LinearSales(0, 78100, charts.Color.fromHex(code: "#313CA9")), + new LinearSales(1, 135458, charts.Color.fromHex(code: "#30415B")) + ], + // Set a label accessor to control the text of the arc label. + labelAccessorFn: (LinearSales row, _) => + '${(row.sales / 100)}', + ) + ]), + ), + if(expensesSelect == 1) + Container( + height:150.h, + child: DonutAutoLabelChart([ + new charts.Series( + id: 'Sales', + colorFn: (LinearSales sales, __) => + sales.color, + domainFn: (LinearSales sales, _) => + sales.year, + measureFn: (LinearSales sales, _) => + sales.sales, + data: [ + new LinearSales(0, 66, charts.Color.fromHex(code: "#313CA9")), + new LinearSales(1, 998, charts.Color.fromHex(code: "#30415B")), + new LinearSales(2, 155, charts.Color.fromHex(code: "#30415B")), + ], + // Set a label accessor to control the text of the arc label. + labelAccessorFn: (LinearSales row, _) => + '${(row.sales)} 笔', + ), + ]), + ), + ], + ), + ); + } +} diff --git a/lib/business_system/home/select_shop.dart b/lib/business_system/home/select_shop.dart index 92845cc0..9e8e0057 100644 --- a/lib/business_system/home/select_shop.dart +++ b/lib/business_system/home/select_shop.dart @@ -1,5 +1,4 @@ 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'; @@ -17,7 +16,6 @@ class SelectShop extends StatefulWidget { } class _SelectShop extends State { - ApiService apiService; final RefreshController refreshController = RefreshController(); @override diff --git a/lib/business_system/home/trade_summary.dart b/lib/business_system/home/trade_summary.dart deleted file mode 100644 index 20f1cb3e..00000000 --- a/lib/business_system/home/trade_summary.dart +++ /dev/null @@ -1,162 +0,0 @@ -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 createState() { - return _TradeSummary(); - } -} - -class _TradeSummary extends State { - 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), - ), - ), - ),), - ], - ), - ) - ], - )), - ),) - ], - ), - ); - } -} diff --git a/lib/business_system/login/business_login_page.dart b/lib/business_system/login/business_login_page.dart index c2475035..14305d6a 100644 --- a/lib/business_system/login/business_login_page.dart +++ b/lib/business_system/login/business_login_page.dart @@ -1,9 +1,7 @@ -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'; @@ -27,7 +25,6 @@ class _BusinessLoginPage extends State { bool _isShowUserNameDel = false; bool _agree = false; bool _canClick = true; - ApiService apiService; DateTime _lastQuitTime; String _phoneInputTips, _pwdInputTips; final TapGestureRecognizer tapGestureRecognizer = TapGestureRecognizer(); diff --git a/lib/business_system/mine/account_information.dart b/lib/business_system/mine/account_information.dart new file mode 100644 index 00000000..0fcbc581 --- /dev/null +++ b/lib/business_system/mine/account_information.dart @@ -0,0 +1,123 @@ +import 'package:flutter/material.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 '../../utils/font_weight.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; + +class AccountInformation extends StatefulWidget { + @override + State createState() { + return _AccountInformation(); + } +} + +class _AccountInformation extends State { + final RefreshController refreshController = RefreshController(); + + @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: 16.h,left: 16.w,right: 16.w), + child:Column( + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), + child: Column( + children: [ + textItem("账号名称","134****7777"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("账号","22221ff"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("电话","13466667777"), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget textItem(left,right){ + return Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + Expanded(child:Text( + left, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),)), + Text( + right, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),), + ], + ) + ); + } + +} diff --git a/lib/business_system/mine/business_mine_page.dart b/lib/business_system/mine/business_mine_page.dart index fc3bedad..db7ee797 100644 --- a/lib/business_system/mine/business_mine_page.dart +++ b/lib/business_system/mine/business_mine_page.dart @@ -1,17 +1,13 @@ 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 { +import '../../utils/font_weight.dart'; +class BusinessMinePage extends StatefulWidget { @override State createState() { return _BusinessMinePage(); @@ -20,15 +16,18 @@ class BusinessMinePage extends StatefulWidget { class _BusinessMinePage extends State with AutomaticKeepAliveClientMixin { - ApiService apiService; final RefreshController refreshController = RefreshController(); - final ScrollController scrollController = ScrollController(); @override void initState() { super.initState(); } + @override + void dispose() { + super.dispose(); + } + @override Widget build(BuildContext context) { super.build(context); @@ -42,22 +41,33 @@ class _BusinessMinePage extends State enablePullUp: false, header: MyHeader(), physics: BouncingScrollPhysics(), - scrollController: scrollController, footer: CustomFooter( builder: (context, mode) { return MyFooter(mode); }, ), onRefresh: () { - setState(() { - }); + setState(() {}); }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - child: Column( - children: [ - Text("我的") - ], + child: Container( + child: Column( + children: [ + mineInfo(), + commonFunctions(), + otherFunctions(), + SizedBox( + height:54.h, + ), + Text( + "@回乡信息公司", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.medium),), + ], + ), )), ), ), @@ -69,6 +79,190 @@ class _BusinessMinePage extends State ); } + Widget mineInfo() { + return Container( + child: Stack( + children: [ + Container( + width: double.infinity, + height: 238.h, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/image/bs_mine_bg.webp", + ), + fit: BoxFit.cover, + ), + ), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/account_information'); + }, + child: Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + 50, left: 16.w), + child: Row( + children: [ + Image.asset( + "assets/image/bs_mine_heading.webp", + width: 69, + height: 69, + fit: BoxFit.fill, + ), + SizedBox( + width: 10.w, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text( + '海峡姐妹茶', + style: TextStyle( + fontSize: 18.sp, + color: Color(0xFF374C6C), + fontWeight: MyFontWeight.semi_bold), + ), + Text( + 'ID:gsy2022', + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF374C6C), + fontWeight: MyFontWeight.regular), + ), + ], + ) + ], + ), + ), + ), + ], + ), + ); + } + + ///常用功能 + Widget commonFunctions() { + return Container( + margin: EdgeInsets.only(top:26.h, left: 16.w, right:17.w,bottom: 43.h), + child: Column( + children: [ + Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 12.w), + ), + Text( + '常用功能', + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF262626), + fontWeight: MyFontWeight.semi_bold), + ), + ], + ), + SizedBox(height:20.h,), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/merchant_info'); + }, + child: + commonFunctionsItem("assets/image/bs_store_info_logo.webp", "商户信息", "一心回乡农场"), + ), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(left:32.w,bottom:12.h), + ), + commonFunctionsItem("assets/image/bs_shop_logo.webp", "门店设置", ""), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(left:32.w,bottom:12.h), + ), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/security_setting'); + }, + child: commonFunctionsItem("assets/image/bs_secure.webp", "安全设置", "登录手机号/密码") + ), + ], + ), + ); + } + + Widget commonFunctionsItem(icon,leftText,rightText){ + return Container( + margin: EdgeInsets.only(bottom:14.h), + child: Row( + children: [ + Image.asset( + icon, + width: 24, + height:24, + fit: BoxFit.fill,), + SizedBox(width:8.w,), + Expanded(child: Text( + leftText, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.medium),)), + Text( + rightText, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF353535), + fontWeight: MyFontWeight.medium),), + Image.asset( + "assets/image/icon_right_z.webp", + width: 16, + height:16, + color: Color(0xFF353535), + ), + ], + ), + ); + } + + Widget otherFunctions(){ + return Container( + margin: EdgeInsets.only(left: 16.w, right:17.w,), + child: Column( + children: [ + Row( + children: [ + Container( + width: 4.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 12.w), + ), + Text( + '其他功能', + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF262626), + fontWeight: MyFontWeight.semi_bold), + ), + ], + ), + SizedBox(height:20.h,), + commonFunctionsItem("assets/image/bs_user.webp", "关于我们", ""), + ], + ), + ); + } + @override bool get wantKeepAlive => true; } diff --git a/lib/business_system/mine/merchant_info.dart b/lib/business_system/mine/merchant_info.dart new file mode 100644 index 00000000..253f446a --- /dev/null +++ b/lib/business_system/mine/merchant_info.dart @@ -0,0 +1,197 @@ +import 'package:flutter/material.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 '../../utils/font_weight.dart'; +import '../../view_widget/classic_header.dart'; +import '../../view_widget/my_footer.dart'; + +class MerchantInfo extends StatefulWidget { + @override + State createState() { + return _MerchantInfo(); + } +} + +class _MerchantInfo extends State { + final RefreshController refreshController = RefreshController(); + bool checkState = 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: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), + child: Column( + children: [ + textItem("店铺名称","134****7777"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("经营类目","奶"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("所在地区","湖北省武汉市武昌区"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("详细地址","武汉市武昌区221过道谢谢谢谢谢吾问无为谓无无寻"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + textItem("负责人电话","1122334444"), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + margin: EdgeInsets.only(top:2.h,bottom: 16.h) + ), + Row( + children: [ + Expanded(child:Text( + "是否在平台展示", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF808080), + fontWeight: MyFontWeight.medium),)), + Checkbox( + value: checkState, + onChanged: (a) { + setState(() { + checkState = !checkState; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + Text( + "是", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),), + SizedBox(width: 36.w,), + Checkbox( + value: checkState, + onChanged: (a) { + setState(() { + checkState = !checkState; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + Text( + "否", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),), + ], + ), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget textItem(left,right){ + return Container( + padding: EdgeInsets.only(bottom: 16.h), + child: Row( + children: [ + Expanded(child:Text( + left, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF808080), + fontWeight: MyFontWeight.medium),)), + Expanded(child: + Text( + right, + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.right, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.medium),),flex: 3,), + ], + ) + ); + } + +} diff --git a/lib/business_system/mine/security_setting.dart b/lib/business_system/mine/security_setting.dart new file mode 100644 index 00000000..4ca9735e --- /dev/null +++ b/lib/business_system/mine/security_setting.dart @@ -0,0 +1,67 @@ +import 'package:flutter/material.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 SecuritySetting extends StatefulWidget { + @override + State createState() { + return _SecuritySetting(); + } +} + +class _SecuritySetting extends State { + final RefreshController refreshController = RefreshController(); + + @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: [ + + ], + ), + ), + ), + ), + ); + } + +} diff --git a/lib/business_system/order/business_order_detail.dart b/lib/business_system/order/business_order_detail.dart new file mode 100644 index 00000000..a0cadb92 --- /dev/null +++ b/lib/business_system/order/business_order_detail.dart @@ -0,0 +1,311 @@ +import 'package:flutter/material.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 BusinessOrderDetail extends StatefulWidget { + @override + State createState() { + return _BusinessOrderDetail(); + } +} + +class _BusinessOrderDetail extends State { + final RefreshController refreshController = RefreshController(); + + @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: NeverScrollableScrollPhysics(), + child: Container( + margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), + child: Column( + children: [goodsInfo(), orderInfo()], + ), + ), + ), + ), + ); + } + + ///商品信息 + Widget goodsInfo() { + return Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + children: [ + Row( + children: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 4.w), + ), + Expanded( + child: Text( + "商品信息", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold), + )), + Text( + "已完成", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFFFA5151), + fontWeight: MyFontWeight.semi_bold), + ) + ], + ), + SizedBox( + height: 12.h, + ), + ListView.builder( + padding: EdgeInsets.zero, + itemCount: 5, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: goodsInfoItem(), + ); + }, + ) + ], + ), + ); + } + + Widget goodsInfoItem() { + return Container( + margin: EdgeInsets.only(bottom: 12.h), + height: 77.h, + child: Row( + children: [ + Image.asset( + "assets/image/hot_list.webp", + width: 77, + height: 77, + fit: BoxFit.fill, + ), + SizedBox( + width: 12.w, + ), + Expanded(child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: Text( + "御林古桑园啤酒节大肠包小肠美味...", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold + ), + )), + Row( + children: [ + Expanded(child: Text( + "×1", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold + ), + )), + Text( + "¥12", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold + ), + ) + ], + ) + ], + )) + ], + ), + ); + } + + ///订单信息 + Widget orderInfo() { + return Container( + padding: EdgeInsets.all(12), + margin: EdgeInsets.only(top: 12.h,bottom:30.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + children: [ + Row( + children: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 4.w), + ), + Text( + "订单信息", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold), + ) + ], + ), + SizedBox( + height: 12.h, + ), + Row( + children: [ + Expanded( + child: Text( + "订单号", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF808080), + ), + )), + Text( + "1222222222222222", + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + border: Border.all( + color: Color(0xFF30415B), + width: 1.w, + ), + ), + padding: EdgeInsets.symmetric(horizontal: 7.w, vertical: 2.h), + margin: EdgeInsets.only(left: 4.w), + child: Text( + "复制", + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular), + ), + ), + ], + ), + orderInfoItem("创建时间", "2022-08-09 12:33:12"), + orderInfoItem("门店", "海峡姐妹茶"), + orderInfoItem("用户名", "2233"), + orderInfoItem("手机号", "17671877666"), + orderInfoItem("订单金额", "766"), + orderInfoItem("创建时间", "海峡姐妹茶"), + orderInfoItem("优惠金额", "22.33"), + orderInfoItem("实付金额", "2233.00"), + orderInfoItem("预约时间", "2022-08-09 12:33:12"), + ], + ), + ); + } + + Widget orderInfoItem(leftText, rightText) { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + leftText, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF808080), + ), + ), + SizedBox(width: 10.w), + Expanded( + child: Text( + rightText, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ), + flex: 1, + ), + ], + ), + ); + } +} diff --git a/lib/business_system/order/business_order_page.dart b/lib/business_system/order/business_order_page.dart index 52b58a77..ba1939c3 100644 --- a/lib/business_system/order/business_order_page.dart +++ b/lib/business_system/order/business_order_page.dart @@ -1,11 +1,17 @@ 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 '../../view_widget/my_appbar.dart'; +import '../../view_widget/my_tab.dart'; +import '../goods/off_shelf/off_shelf_page.dart'; +import '../goods/on_sale/on_sale_page.dart'; +import 'order_list.dart'; + class BusinessOrderPage extends StatefulWidget { @override @@ -16,52 +22,202 @@ class BusinessOrderPage extends StatefulWidget { class _BusinessOrderPage extends State with AutomaticKeepAliveClientMixin { - ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); + final TextEditingController editingController = TextEditingController(); + FocusNode _focusNode = FocusNode(); + bool isKeyBoardShow = false; @override void initState() { super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + setState(() { + print("object: ${MediaQuery.of(context).viewInsets.bottom}"); + if (MediaQuery.of(context).viewInsets.bottom == 0) { + if (isKeyBoardShow) { + isKeyBoardShow = false; + //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 + FocusScope.of(context).requestFocus(FocusNode()); + } + } else { + isKeyBoardShow = true; + } + }); + }); + } + + ///离开页面记着销毁和清除 + @override + void dispose() { + _focusNode.unfocus(); + super.dispose(); } @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); - }, + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Column( + children: [ + orderSearch(), + Expanded( + child: + Stack( + children: [ + DefaultTabController( + length:4, + child: Scaffold( + appBar: MyAppBar( + title:"", + leading: false, + background: Colors.white, + toolbarHeight: kToolbarHeight+MediaQuery.of(context).padding.top, + bottom: TabBar( + // isScrollable: true, //可滚动 + //去掉按钮阴影 + overlayColor: MaterialStateProperty.all(Colors.white), + 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: [ + MyTab(text:"全部"), + MyTab(text: "未付款"), + MyTab(text:"已付款"), + MyTab(text: "已退款"), + ], + ), + ), + body: TabBarView( + children: [ + OrderList(0), + OrderList(1), + OrderList(2), + OrderList(3),], + ), + ), + ), + timeSelect(), + ], + ), + ), + SizedBox( + height: 76.h, + ), + ], + ), + ); + } + + /// 搜索框 + Widget orderSearch() { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed('/router/goods_search_page'); + }, + child: Container( + color: Colors.white, + child: Container( + height: 40.h, + margin: EdgeInsets.only(left: 18.w,right: 18.w,top:40.h,), + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + child: TextField( + focusNode: _focusNode, + textInputAction: TextInputAction.search, + onEditingComplete: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF808080), + ), + controller: editingController, + decoration: InputDecoration( + hintText: "请输入订单ID", + hintStyle: TextStyle( + color: Color(0xFF808080), + fontSize: 15.sp, + fontWeight: MyFontWeight.regular ), - onRefresh: () { - setState(() { - }); - }, - child: SingleChildScrollView( - physics: NeverScrollableScrollPhysics(), - child: Column( - children: [ - Text("订单列表") - ], - )), + contentPadding: EdgeInsets.symmetric( + vertical: 12.h, + ), + + prefixIcon: Image.asset( + "assets/image/bs_goods_search.webp", + width: 20, + height: 20, + ), + border: InputBorder.none, ), ), + ),), + ); + } + + Widget timeSelect(){ + return Container( + color: Colors.white, + child: GestureDetector( + onTap: (){}, + child: Container( + decoration: BoxDecoration( + color: Color(0xFFF7F8FA), + borderRadius: BorderRadius.circular(2), + ), + margin: EdgeInsets.only(left: 18.w,right: 18.w,top: 12.h,bottom: 16.h), + padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 12.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '2022-08-24 16:23', + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular), + ), + Padding(padding:EdgeInsets.only(left:22.w,right: 26.w), + child: Text( + '至', + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular), + ),), + Text( + '2022-08-24 16:50', + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular), + ), + ], + ), ), - SizedBox( - height: 76.h, - ), - ], + ), ); } diff --git a/lib/business_system/order/order_list.dart b/lib/business_system/order/order_list.dart new file mode 100644 index 00000000..83619d9e --- /dev/null +++ b/lib/business_system/order/order_list.dart @@ -0,0 +1,275 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../../../utils/font_weight.dart'; + +class OrderList extends StatefulWidget { + final int status; + OrderList(this.status); + + @override + State createState() { + return _OrderList(); + } +} + +class _OrderList extends State { + final RefreshController _refreshController = RefreshController(); + ScrollPhysics scrollPhysics = NeverScrollableScrollPhysics(); + final ScrollController controller = ScrollController(); + + @override + void dispose() { + super.dispose(); + _refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + } + + _onRefresh() async {} + + @override + Widget build(BuildContext context) { + return SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + child:Padding(padding:EdgeInsets.symmetric(vertical: 16.w), + child: ListView.builder( + itemCount: 5, + physics: BouncingScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, position) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Navigator.of(context).pushNamed('/router/business_order_detail'); + }, + child: orderItem(), + ); + }, + ),), + ); + } + + Widget orderItem() { + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + margin: EdgeInsets.only(left: 16.w,right: 16.w,bottom: 16.h), + padding:EdgeInsets.symmetric(vertical: 12.h), + child: Column( + children: [ + Padding(padding:EdgeInsets.only(bottom:12.h,left: 12.w,right: 12.w), + child: Row( + children: [ + Image.asset( + "assets/image/bs_switch_shop.webp", + width:16, + height:16, + ), + SizedBox(width: 3.w,), + Expanded(child: Text( + "海峡姐妹奶茶", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold + ), + )), + Text( + widget.status == 0 ?"全部":widget.status == 1 ? "未付款":widget.status == 2 ? "已付款":"已退款", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFFFA5151), + fontWeight: MyFontWeight.semi_bold + ), + ) + ], + ),), + Container( + width: double.infinity, + height: 1.h, + color: Color(0xFFF4F6F7), + ), + Padding(padding:EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + children: [ + Container( + height:170.h, + margin: EdgeInsets.only(top: 17.h,bottom:13.h), + child: + ListView.builder( + padding: EdgeInsets.zero, + itemCount:6, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () { + }, + child: orderGoodsList(), + ); + }, + ), + ), + Row(children: [ + Text( + "订单编号:", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular + ), + ), + Padding(padding:EdgeInsets.only(left: 14.w), + child: + Text( + "1223211111112333333", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular + ), + ),), + ],), + SizedBox(height: 4.h,), + Row(children: [ + Text( + "支付时间::", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular + ), + ), + SizedBox(width: 14.w,), + Expanded(child: Text( + "2022-08-09 12:33:12", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF7A797F), + fontWeight: MyFontWeight.regular + ), + ),), + Text( + "¥245", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF181818), + fontWeight: MyFontWeight.medium + ), + ), + ],), + SizedBox(height:20.h,), + Row( + children: [ + Spacer(), + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/order_write_off'); + }, + child: Container( + decoration: BoxDecoration( + color: Color(0xFF30415B), + borderRadius: BorderRadius.circular(4), + ), + padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 26.w), + margin: EdgeInsets.only(right:20.h), + child:Text( + "核销", + style: TextStyle( + fontSize: 12.sp, + color: Colors.white, + fontWeight: MyFontWeight.regular + ), + ), + ), + ),GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + Navigator.of(context).pushNamed('/router/request_refund'); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: Color(0xFF30415B), + width: 1, + ), + ), + padding: EdgeInsets.symmetric(vertical: 5.h,horizontal: 14.w), + child:Text( + "申请退款", + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF30415B), + fontWeight: MyFontWeight.regular + ), + ), + ), + ), + ], + ) + + ], + ),), + ], + ), + ); + } + + Widget orderGoodsList(){ + return Container( + margin: EdgeInsets.only(bottom: 13.h), + child: Row( + children: [ + Expanded(child: Text( + "葡萄榨汁饮料", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.medium + ), + )), + Text( + "x1", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF000000), + fontWeight: MyFontWeight.regular + ), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/order/order_write_off.dart b/lib/business_system/order/order_write_off.dart new file mode 100644 index 00000000..73f9d3eb --- /dev/null +++ b/lib/business_system/order/order_write_off.dart @@ -0,0 +1,299 @@ +import 'package:flutter/material.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 OrderWriteOff extends StatefulWidget { + @override + State createState() { + return _OrderWriteOff(); + } +} + +class _OrderWriteOff extends State { + final RefreshController refreshController = RefreshController(); + var writeOffCheck = 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: NeverScrollableScrollPhysics(), + child: Container( + margin: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w), + child: Column( + children: [ + basicInfo(), + writeOffInfo(), + Container( + width: double.infinity, + alignment: Alignment.center, + margin: EdgeInsets.only(bottom:55.h,top: 125.h), + padding: EdgeInsets.symmetric(vertical:16.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(27), + color: Color(0xFF30415B) + ), + child: Text( + "确认核销", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 16.sp, + color: Colors.white, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } + + ///基本信息 + Widget basicInfo() { + return Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + children: [ + Row( + children: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 4.w), + ), + Text( + "基础信息", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold), + ), + ], + ), + SizedBox( + height: 12.h, + ), + basicInfoItem("票券名称:","单人尊享票"), + basicInfoItem("用户名称::","李哈哈"), + basicInfoItem("票券编号::","177777622222223"), + basicInfoItem("订单编号::","7666677777777772233") + ], + ), + ); + } + + Widget basicInfoItem(leftText, rightText) { + return Container( + margin: EdgeInsets.only(top: 8.h, bottom: 8.h), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + leftText, + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF808080), + ), + ), + SizedBox(width: 10.w), + Text( + rightText, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF1A1A1A), + fontWeight: MyFontWeight.regular), + ) + ], + ), + ); + } + + ///待核销信息 + Widget writeOffInfo() { + return Container( + padding: EdgeInsets.all(12), + margin: EdgeInsets.only(top: 12.h,bottom:30.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular( + 2, + ), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Column( + children: [ + Row( + children: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right: 4.w), + ), + Text( + "待核销项", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF0D0D0D), + fontWeight: MyFontWeight.semi_bold), + ) + ], + ), + SizedBox( + height: 17.h, + ), + ListView.builder( + padding: EdgeInsets.zero, + itemCount: 3, + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemBuilder: (context, position) { + return GestureDetector( + onTap: () {}, + child: writeOffInfoItem(), + ); + }, + ) + ], + ), + ); + } + + Widget writeOffInfoItem(){ + return Container( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: Text( + "台湾天然手作牡丹茶*1(牡丹野餐区茶饮车兑换)", + style: TextStyle( + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + color: Color(0xFF0D0D0D), + ), + )), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding(padding: EdgeInsets.only(right:10.w), + child: Text( + "已核销", + style: TextStyle( + fontWeight: MyFontWeight.semi_bold, + fontSize: 12.sp, + color: Color(0xFFACACAC), + ), + ),), + SizedBox(height:25.h,), + Checkbox( + value: writeOffCheck, + onChanged: (a) { + setState(() { + writeOffCheck = !writeOffCheck; + }); + }, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(2.0), + ), + checkColor: Color(0xFFFFFFFF), + fillColor:MaterialStateProperty.all(Color(0xFF30415B)), + ), + ], + )) + ], + ), + // Align( + // alignment: Alignment.centerRight, + // child:Container( + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular( + // 2, + // ), + // border: Border.all( + // color: Color(0xFFCFCFCF), + // width: 1.w, + // ), + // ), + // child: Icon( + // Icons.check, + // color: Color(0xFFCFCFCF), + // size: 14.w, + // ) + // ),), + Container( + margin: EdgeInsets.only(bottom:11.h,top: 13.h), + width: double.infinity, + height: 1.h, + color: Color(0xFFEBECEF), + ) + ], + ), + ); + } +} diff --git a/lib/business_system/order/request_refund.dart b/lib/business_system/order/request_refund.dart new file mode 100644 index 00000000..2018e174 --- /dev/null +++ b/lib/business_system/order/request_refund.dart @@ -0,0 +1,105 @@ +import 'package:flutter/material.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 RequestRefund extends StatefulWidget { + @override + State createState() { + return _RequestRefund(); + } +} + +class _RequestRefund extends State { + final RefreshController refreshController = RefreshController(); + + @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: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.w), + boxShadow: [ + BoxShadow( + color: Color(0x0F06152E).withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ), + ], + ), + padding: EdgeInsets.only(top: 16.h,left: 16.w,right: 16.w,), + child: Column( + children: [ + Row( + children: [ + Container( + width: 2.w, + height: 16.h, + color: Color(0xFF30415B), + margin: EdgeInsets.only(right:6.w), + ), + Text( + "申请金额", + style: TextStyle( + color: Color(0xFF0D0D0D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + SizedBox(height:33.h,), + ], + ), + ), + ], + ), + ), + ), + ), + ); + } + +} diff --git a/lib/main.dart b/lib/main.dart index 9c7e631a..f1a6faae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -85,11 +85,23 @@ import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'business_system/business_page.dart'; +import 'business_system/goods/goods_search_page.dart'; +import 'business_system/goods/on_sale/add_assort.dart'; +import 'business_system/goods/on_sale/batch_shelf.dart'; +import 'business_system/goods/on_sale/edit_assort.dart'; +import 'business_system/goods/on_sale/goods_assort.dart'; +import 'business_system/goods/on_sale/goods_sort.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/home/trade_overview_page.dart'; +import 'business_system/home/overview/trade_overview_page.dart'; import 'business_system/login/business_login_page.dart'; +import 'business_system/mine/account_information.dart'; +import 'business_system/mine/merchant_info.dart'; +import 'business_system/mine/security_setting.dart'; +import 'business_system/order/business_order_detail.dart'; +import 'business_system/order/order_write_off.dart'; +import 'business_system/order/request_refund.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; import 'community/new_community_details.dart'; @@ -456,5 +468,28 @@ Map routers = { SelectShop(), '/router/trade_overview_page': (context, {arguments}) => TradeOverviewPage(), - + '/router/goods_search_page': (context, {arguments}) => + GoodsSearchPage(arguments: arguments), + '/router/goods_assort': (context, {arguments}) => + GoodsAssort(), + '/router/add_assort': (context, {arguments}) => + AddAssort(), + '/router/edit_assort': (context, {arguments}) => + EditAssort(), + '/router/goods_sort': (context, {arguments}) => + GoodsSort(), + '/router/batch_shelf': (context, {arguments}) => + BatchShelf(), + '/router/business_order_detail': (context, {arguments}) => + BusinessOrderDetail(), + '/router/order_write_off': (context, {arguments}) => + OrderWriteOff(), + '/router/security_setting': (context, {arguments}) => + SecuritySetting(), + '/router/merchant_info': (context, {arguments}) => + MerchantInfo(), + '/router/account_information': (context, {arguments}) => + AccountInformation(), + '/router/request_refund': (context, {arguments}) => + RequestRefund(), }; diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 59b7e465..ac5c7392 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -8,7 +8,6 @@ import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_product_vo.dart'; import 'package:huixiang/retrofit/data/page.dart'; -import 'package:huixiang/retrofit/data/product.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/store/scan.dart'; diff --git a/pubspec.lock b/pubspec.lock index 904d9ea1..bd15f754 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -64,6 +64,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.0" chewie: dependency: transitive description: @@ -420,6 +434,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" matcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f353d978..a3724529 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,6 +29,7 @@ dependencies: umeng_common_sdk: ^1.2.3 fl_chart: ^0.62.0 + charts_flutter: ^0.12.0 like_button: ^2.0.2 cupertino_icons: ^1.0.2 flutter_swiper: ^1.1.6