Browse Source

我的页面待改;

首页,订单,商品页面基本ok;
wr_2023_business
wurong 2 years ago
parent
commit
17dcc7bca0
  1. BIN
      assets/image/2x/bs_calendar_logo.webp
  2. BIN
      assets/image/2x/bs_check.webp
  3. BIN
      assets/image/2x/bs_edit.webp
  4. BIN
      assets/image/2x/bs_goods_search.webp
  5. BIN
      assets/image/2x/bs_mine_bg.webp
  6. BIN
      assets/image/2x/bs_mine_heading.webp
  7. BIN
      assets/image/2x/bs_no data_logo.webp
  8. BIN
      assets/image/2x/bs_px.webp
  9. BIN
      assets/image/2x/bs_secure.webp
  10. BIN
      assets/image/2x/bs_shop_logo.webp
  11. BIN
      assets/image/2x/bs_store_info_logo.webp
  12. BIN
      assets/image/2x/bs_uncheck.webp
  13. BIN
      assets/image/2x/bs_user.webp
  14. BIN
      assets/image/2x/bs_xj.webp
  15. BIN
      assets/image/3x/bs_calendar_logo.webp
  16. BIN
      assets/image/3x/bs_check.webp
  17. BIN
      assets/image/3x/bs_edit.webp
  18. BIN
      assets/image/3x/bs_goods_search.webp
  19. BIN
      assets/image/3x/bs_mine_bg.webp
  20. BIN
      assets/image/3x/bs_mine_heading.webp
  21. BIN
      assets/image/3x/bs_no data_logo.webp
  22. BIN
      assets/image/3x/bs_px.webp
  23. BIN
      assets/image/3x/bs_secure.webp
  24. BIN
      assets/image/3x/bs_shop_logo.webp
  25. BIN
      assets/image/3x/bs_store_info_logo.webp
  26. BIN
      assets/image/3x/bs_uncheck.webp
  27. BIN
      assets/image/3x/bs_user.webp
  28. BIN
      assets/image/3x/bs_xj.webp
  29. BIN
      assets/image/bs_calendar_logo.webp
  30. BIN
      assets/image/bs_check.webp
  31. BIN
      assets/image/bs_edit.webp
  32. BIN
      assets/image/bs_goods_search.webp
  33. BIN
      assets/image/bs_mine_bg.webp
  34. BIN
      assets/image/bs_mine_heading.webp
  35. BIN
      assets/image/bs_no data_logo.webp
  36. BIN
      assets/image/bs_px.webp
  37. BIN
      assets/image/bs_secure.webp
  38. BIN
      assets/image/bs_shop_logo.webp
  39. BIN
      assets/image/bs_store_info_logo.webp
  40. BIN
      assets/image/bs_uncheck.webp
  41. BIN
      assets/image/bs_user.webp
  42. BIN
      assets/image/bs_xj.webp
  43. 18
      lib/business_system/business_page.dart
  44. 69
      lib/business_system/goods/business_goods_page.dart
  45. 277
      lib/business_system/goods/goods_search_page.dart
  46. 291
      lib/business_system/goods/off_shelf/off_shelf_page.dart
  47. 194
      lib/business_system/goods/on_sale/add_assort.dart
  48. 261
      lib/business_system/goods/on_sale/batch_shelf.dart
  49. 167
      lib/business_system/goods/on_sale/edit_assort.dart
  50. 138
      lib/business_system/goods/on_sale/goods_assort.dart
  51. 255
      lib/business_system/goods/on_sale/goods_sort.dart
  52. 428
      lib/business_system/goods/on_sale/on_sale_page.dart
  53. 7
      lib/business_system/home/business_home_page.dart
  54. 2
      lib/business_system/home/flow_page.dart
  55. 36
      lib/business_system/home/home_view/donut_auto_label_chart.dart
  56. 12
      lib/business_system/home/home_view/home_sideslip_dialog.dart
  57. 477
      lib/business_system/home/home_view/my_arc_label_decorator.dart
  58. 12
      lib/business_system/home/home_view/my_line_chart.dart
  59. 499
      lib/business_system/home/overview/trade_goods.dart
  60. 283
      lib/business_system/home/overview/trade_order.dart
  61. 20
      lib/business_system/home/overview/trade_overview_page.dart
  62. 449
      lib/business_system/home/overview/trade_summary.dart
  63. 2
      lib/business_system/home/select_shop.dart
  64. 162
      lib/business_system/home/trade_summary.dart
  65. 3
      lib/business_system/login/business_login_page.dart
  66. 123
      lib/business_system/mine/account_information.dart
  67. 218
      lib/business_system/mine/business_mine_page.dart
  68. 197
      lib/business_system/mine/merchant_info.dart
  69. 67
      lib/business_system/mine/security_setting.dart
  70. 311
      lib/business_system/order/business_order_detail.dart
  71. 206
      lib/business_system/order/business_order_page.dart
  72. 275
      lib/business_system/order/order_list.dart
  73. 299
      lib/business_system/order/order_write_off.dart
  74. 105
      lib/business_system/order/request_refund.dart
  75. 39
      lib/main.dart
  76. 1
      lib/order/order_history_page.dart
  77. 21
      pubspec.lock
  78. 1
      pubspec.yaml

BIN
assets/image/2x/bs_calendar_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

BIN
assets/image/2x/bs_check.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 B

BIN
assets/image/2x/bs_edit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

BIN
assets/image/2x/bs_goods_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/2x/bs_mine_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
assets/image/2x/bs_mine_heading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
assets/image/2x/bs_no data_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
assets/image/2x/bs_px.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
assets/image/2x/bs_secure.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

BIN
assets/image/2x/bs_shop_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

BIN
assets/image/2x/bs_store_info_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

BIN
assets/image/2x/bs_uncheck.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
assets/image/2x/bs_user.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

BIN
assets/image/2x/bs_xj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

BIN
assets/image/3x/bs_calendar_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

BIN
assets/image/3x/bs_check.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/3x/bs_edit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

BIN
assets/image/3x/bs_goods_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/image/3x/bs_mine_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
assets/image/3x/bs_mine_heading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
assets/image/3x/bs_no data_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/image/3x/bs_px.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/image/3x/bs_secure.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
assets/image/3x/bs_shop_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

BIN
assets/image/3x/bs_store_info_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

BIN
assets/image/3x/bs_uncheck.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

BIN
assets/image/3x/bs_user.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/3x/bs_xj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

BIN
assets/image/bs_calendar_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

BIN
assets/image/bs_check.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

BIN
assets/image/bs_edit.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

BIN
assets/image/bs_goods_search.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
assets/image/bs_mine_bg.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
assets/image/bs_mine_heading.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/image/bs_no data_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
assets/image/bs_px.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

BIN
assets/image/bs_secure.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

BIN
assets/image/bs_shop_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

BIN
assets/image/bs_store_info_logo.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

BIN
assets/image/bs_uncheck.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

BIN
assets/image/bs_user.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

BIN
assets/image/bs_xj.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

18
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<BusinessPage>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
MinApiService minService;
int choiceIndex = 0;
@override
@ -78,6 +65,7 @@ class _BusinessPage extends State<BusinessPage>
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 0;
@ -108,6 +96,7 @@ class _BusinessPage extends State<BusinessPage>
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 1;
@ -138,6 +127,7 @@ class _BusinessPage extends State<BusinessPage>
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 2;
@ -151,6 +141,7 @@ class _BusinessPage extends State<BusinessPage>
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 3;
@ -181,6 +172,7 @@ class _BusinessPage extends State<BusinessPage>
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
choiceIndex = 4;

69
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<BusinessGoodsPage>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
@ -30,34 +31,48 @@ class _BusinessGoodsPage extends State<BusinessGoodsPage>
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,
),
onRefresh: () {
setState(() {
});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: [
Text("商品管理")
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
color: Color(0xFF666666)
),
// controller: tabController,
//
unselectedLabelColor: Color(0xffA29E9E),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text:"在售中(19)"),
MyTab(text: "已下架(2)"),
],
)),
),
),
body: TabBarView(
children: [
OnSalePage(),
OffShelfPage(),],
),
),
),),
SizedBox(
height: 76.h,
),

277
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<String, dynamic> arguments;
GoodsSearchPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _GoodsSearchPage();
}
}
class _GoodsSearchPage extends State<GoodsSearchPage>
with WidgetsBindingObserver {
final TextEditingController editingController = TextEditingController();
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
int optionIndex = 0;
bool isKeyBoardShow = false;
List<ProductListBean> productListBeans = [];
List<String> hotSearch = [];
List<String> 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),
),
),
)
],
)
],
)),
],
),
);
}
}

291
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<StatefulWidget> createState() {
return _OffShelfPage();
}
}
class _OffShelfPage extends State<OffShelfPage> {
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),
),
),
],
),
)
],
)),
],
),
);
}
}

194
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<StatefulWidget> createState() {
return _AddAssort();
}
}
class _AddAssort extends State<AddAssort> {
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,
),
),
),
),
],
),
),
),
);
}
}

261
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<StatefulWidget> createState() {
return _BatchShelf();
}
}
class _BatchShelf extends State<BatchShelf> {
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),
),
),
],
),
)),
],
)
],
)),
],
),
);
}
}

167
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<StatefulWidget> createState() {
return _EditAssort();
}
}
class _EditAssort extends State<EditAssort> {
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,
),
),
),
),
],
),
),
);
}
}

138
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<StatefulWidget> createState() {
return _GoodsAssort();
}
}
class _GoodsAssort extends State<GoodsAssort> {
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,
)
],
),
);
}
}

255
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<StatefulWidget> createState() {
return _GoodsSort();
}
}
class _GoodsSort extends State<GoodsSort> {
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),
),
),
],
),
)),
],
)
],
)),
],
),
);
}
}

428
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<StatefulWidget> createState() {
return _OnSalePage();
}
}
class _OnSalePage extends State<OnSalePage> {
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),
),
),
)
],
)
],
)),
],
),
);
}
}

7
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<BusinessHomePage>
with AutomaticKeepAliveClientMixin{
ApiService apiService;
final RefreshController refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
List<LineChartSample2Data> lineChartSample2Data =
@ -97,6 +95,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
child: Column(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
showAlertDialog();
// Navigator.of(context).pushNamed('/router/select_shop');
@ -293,7 +292,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
///
showAlertDialog() {
showCupertinoModalPopup(
showDialog(
builder: (context) {
return HomeSideslipDialog();},
context: context);
@ -359,7 +358,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
SizedBox(
height: 18.h,
),
LineChartSample2(lineChartSample2Data),
LineChartSample2(lineChartSample2Data,"销售量"),
],
),
);

2
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<FlowPage> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
var isShowMore = false;

36
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<charts.Series> 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);
}

12
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<HomeSideslipDialog> with SingleTickerPro
vsync: this,
);
_animation = Tween<Offset>(
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();
}

477
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<D> extends ArcRendererDecorator<D> {
// 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<ArcRendererElementList<D>> 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<double>(
arcElements.center.x + arcElements.radius * cos(centerAngle),
arcElements.center.y + arcElements.radius * sin(centerAngle));
final bounds =
Rectangle<double>.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<TextStyleSpec> 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<D> 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<Object> params) {
// List destructuring.
_previousLabelLeftOfChart = params[0] as bool;
_previousOutsideLabelY = params[1] as int;
}
double getLabelRadius(ArcRendererElementList<D> arcElements) =>
arcElements.radius + leaderLineStyleSpec.length / 2;
/// Draws a label outside of an arc.
List<Object> _drawOutsideLabel(
ChartCanvas canvas,
Rectangle drawBounds,
ArcRendererElementList<D> arcElements,
TextElement labelElement,
TextElement labelTextElement,
double centerAngle,
Color color) {
final labelRadius = getLabelRadius(arcElements);
final labelPoint = Point<double>(
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<double> labelPoint,
double radius,
Point<double> arcCenterPoint,
double centerAngle,
Color color) {
final tailX = (labelLeftOfChart ? -1 : 1) * leaderLineStyleSpec.length;
final leaderLineTailPoint =
Point<double>(labelPoint.x + tailX, labelPoint.y);
final centerRadius = radius - leaderLineStyleSpec.length / 2;
final leaderLineStartPoint = Point<double>(
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;
}
}

12
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> lineChartSample2Data;
final String tipName;
LineChartSample2(this.lineChartSample2Data, {Key key}) : super(key: key);
LineChartSample2(this.lineChartSample2Data,this.tipName, {Key key}) : super(key: key);
@override
State<LineChartSample2> createState() => _LineChartSample2State();
@ -123,7 +124,11 @@ class _LineChartSample2State extends State<LineChartSample2> {
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<LineChartSample2> {
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<LineChartSample2> {
textAlign: TextAlign.start,
children: [
TextSpan(
text: '\n订单量: ',
text: '\n${widget?.tipName??""}: ',
style: const TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.medium,

499
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<StatefulWidget> createState() {
return _TradeGoods();
}
}
class _TradeGoods extends State<TradeGoods> {
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),
),
),),
],
),
);
}
}

283
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<StatefulWidget> createState() {
return _TradeOrder();
}
}
class _TradeOrder extends State<TradeOrder> {
final RefreshController _refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
List<LineChartSample2Data> 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<LineChartSample2Data> 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,),
],
),
);
}
}

20
lib/business_system/home/trade_overview_page.dart → 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<TradeOverviewPage> with SingleTickerProviderStateMixin{
ApiService apiService;
final RefreshController refreshController = RefreshController();
var isShowMore = false;
@override
void initState() {
@ -43,6 +36,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> 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<TradeOverviewPage> with SingleTickerProvi
body: TabBarView(
children: [
TradeSummary(),
CouponsPage(),
VipCardPage(),],
TradeOrder(),
TradeGoods(),],
),
),
);

449
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<StatefulWidget> createState() {
return _TradeSummary();
}
}
class _TradeSummary extends State<TradeSummary> {
final RefreshController _refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
int operateSelect = 0;
int expensesSelect = 0;
List<LineChartSample2Data> 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<LineChartSample2Data> 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<LinearSales, int>(
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<LinearSales, int>(
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)}',
),
]),
),
],
),
);
}
}

2
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<SelectShop> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
@override

162
lib/business_system/home/trade_summary.dart

@ -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<StatefulWidget> createState() {
return _TradeSummary();
}
}
class _TradeSummary extends State<TradeSummary> {
ApiService apiService;
final RefreshController _refreshController = RefreshController();
final ScrollController scrollController = ScrollController();
@override
void dispose() {
super.dispose();
_refreshController.dispose();
}
@override
void initState() {
super.initState();
}
_onRefresh() async {
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Container(
color: Color(0xFFD8D8D8),
width:double.infinity,
height: 1.h,
),
Expanded(child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Color(0xFFCFD0D1), width: 1.w),
),
margin: EdgeInsets.only(top: 16.h,right: 20.w,left: 20.w,bottom:12.h),
child: Row(
children: [
Expanded(child:Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: Color(0xFF30415B),
),
padding: EdgeInsets.symmetric(vertical:9.h),
child: Text(
"日报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),),
Expanded(child:Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
// color: Color(0xFF30415B),
),
padding: EdgeInsets.symmetric(vertical:9.h),
child: Text(
"周报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),),
Expanded(child:Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
// color: Color(0xFF30415B),
),
padding: EdgeInsets.symmetric(vertical:9.h),
child: Text(
"月报",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),),
Expanded(child:Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
// color: Color(0xFF30415B),
),
padding: EdgeInsets.symmetric(vertical:9.h),
child: Text(
"自定义",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF30415B),
),
),
),),
],
),
)
],
)),
),)
],
),
);
}
}

3
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<BusinessLoginPage> {
bool _isShowUserNameDel = false;
bool _agree = false;
bool _canClick = true;
ApiService apiService;
DateTime _lastQuitTime;
String _phoneInputTips, _pwdInputTips;
final TapGestureRecognizer tapGestureRecognizer = TapGestureRecognizer();

123
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<StatefulWidget> createState() {
return _AccountInformation();
}
}
class _AccountInformation extends State<AccountInformation> {
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),),
],
)
);
}
}

218
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<StatefulWidget> createState() {
return _BusinessMinePage();
@ -20,15 +16,18 @@ class BusinessMinePage extends StatefulWidget {
class _BusinessMinePage extends State<BusinessMinePage>
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<BusinessMinePage>
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
});
setState(() {});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
child: Column(
children: [
Text("我的")
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<BusinessMinePage>
);
}
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;
}

197
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<StatefulWidget> createState() {
return _MerchantInfo();
}
}
class _MerchantInfo extends State<MerchantInfo> {
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,),
],
)
);
}
}

67
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<StatefulWidget> createState() {
return _SecuritySetting();
}
}
class _SecuritySetting extends State<SecuritySetting> {
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: [
],
),
),
),
),
);
}
}

311
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<StatefulWidget> createState() {
return _BusinessOrderDetail();
}
}
class _BusinessOrderDetail extends State<BusinessOrderDetail> {
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,
),
],
),
);
}
}

206
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<BusinessOrderPage>
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());
},
),
onRefresh: () {
setState(() {
});
},
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: [
Text("订单列表")
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: <Widget>[
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
),
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),
),
],
),
),
),
);
}

275
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<StatefulWidget> createState() {
return _OrderList();
}
}
class _OrderList extends State<OrderList> {
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
),
)
],
),
);
}
}

299
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<StatefulWidget> createState() {
return _OrderWriteOff();
}
}
class _OrderWriteOff extends State<OrderWriteOff> {
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),
)
],
),
);
}
}

105
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<StatefulWidget> createState() {
return _RequestRefund();
}
}
class _RequestRefund extends State<RequestRefund> {
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,),
],
),
),
],
),
),
),
),
);
}
}

39
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<String, WidgetBuilder> routers = <String, WidgetBuilder>{
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(),
};

1
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';

21
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:

1
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

Loading…
Cancel
Save