Browse Source

生意总览-商品更改

首页流水更改;
热销榜单更改;
流水详情更改;
用户概览更改;
用户概览新增弹窗说明;
wr_2023_business
wurong 1 year ago
parent
commit
08c09b18c7
  1. 0
      assets/image/2x/icon_vip_recharge.webp
  2. 0
      assets/image/3x/icon_vip_recharge.webp
  3. 0
      assets/image/icon_vip_recharge.webp
  4. 3
      lib/business_system/date_select/custom_page.dart
  5. 1
      lib/business_system/date_select/day_report_page.dart
  6. 1
      lib/business_system/date_select/monthly_report_page.dart
  7. 3
      lib/business_system/date_select/week_report_page.dart
  8. 731
      lib/business_system/home/business_home_page.dart
  9. 348
      lib/business_system/home/flow_page.dart
  10. 1107
      lib/business_system/home/overview/trade_goods.dart
  11. 2
      lib/business_system/home/overview/trade_order.dart
  12. 11
      lib/business_system/home/overview/trade_overview_page.dart
  13. 2
      lib/business_system/order/request_refund.dart
  14. 4
      lib/main.dart
  15. 17
      lib/retrofit/business_api.dart
  16. 75
      lib/retrofit/business_api.g.dart
  17. 93
      lib/retrofit/data/day_flow_list.dart
  18. 51
      lib/retrofit/data/goods_type_sales_list.dart
  19. 6
      lib/retrofit/data/order_trend.dart
  20. 141
      lib/retrofit/data/single_sales_list.dart
  21. 2
      lib/retrofit/min_api.dart
  22. 2
      lib/retrofit/retrofit_api.dart
  23. 18
      pubspec.lock

0
assets/image/2x/ion_vip_recharge.webp → assets/image/2x/icon_vip_recharge.webp

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
assets/image/3x/ion_vip_recharge.webp → assets/image/3x/icon_vip_recharge.webp

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

0
assets/image/ion_vip_recharge.webp → assets/image/icon_vip_recharge.webp

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

3
lib/business_system/date_select/custom_page.dart

@ -62,10 +62,11 @@ class _CustomPage extends State<CustomPage>{
bottom: 0,
child: SfDateRangePicker(
onSelectionChanged: _onSelectionChanged,
maxDate: DateTime.now(),
selectionMode: DateRangePickerSelectionMode.range,
initialSelectedRange: PickerDateRange(
DateTime.now().subtract(const Duration(days: 4)),
DateTime.now().add(const Duration(days: 3))),
DateTime.now().add(const Duration(days: 3)),),
startRangeSelectionColor: Color(0xFF30415B),
endRangeSelectionColor: Color(0xFF30415B),
todayHighlightColor: Color(0xFF30415B),

1
lib/business_system/date_select/day_report_page.dart

@ -69,6 +69,7 @@ class _DayReportPage extends State<DayReportPage>{
bottom: 0,
child: SfDateRangePicker(
onSelectionChanged: _onSelectionChanged,
maxDate: DateTime.now(),
selectionMode: DateRangePickerSelectionMode.single,
selectionColor: Color(0xFF30415B),
initialSelectedRange: PickerDateRange(

1
lib/business_system/date_select/monthly_report_page.dart

@ -55,6 +55,7 @@ class _MonthlyReportPage extends State<MonthlyReportPage>{
bottom: 0,
child: SfDateRangePicker(
onSelectionChanged: _onSelectionChanged,
maxDate: DateTime.now(),
selectionMode: DateRangePickerSelectionMode.single,
view: DateRangePickerView.year,
controller: _controller,

3
lib/business_system/date_select/week_report_page.dart

@ -78,7 +78,8 @@ class _WeekReportPage extends State<WeekReportPage>{
onSelectionChanged: _onSelectionChanged,
minDate: DateTime.now().subtract(const Duration(days: 361)),
controller: _controller, //
maxDate: DateTime.now().add(Duration(days: 365)),
// maxDate: DateTime.now().add(Duration(days: 365)),
maxDate: DateTime.now(),
selectionMode: DateRangePickerSelectionMode.range,
startRangeSelectionColor: Color(0xFF30415B),
endRangeSelectionColor: Color(0xFF30415B),

731
lib/business_system/home/business_home_page.dart

@ -2,7 +2,9 @@ import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/business_system/home/home_view/home_sideslip_dialog.dart';
import 'package:huixiang/retrofit/data/day_flow_list.dart';
import 'package:huixiang/utils/business_instance.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
@ -18,7 +20,10 @@ import '../../retrofit/data/business_login_info.dart';
import '../../retrofit/data/day_count.dart';
import '../../retrofit/data/order_trend.dart';
import '../../retrofit/data/popular_sales_list.dart';
import '../../retrofit/data/vip_counts_info.dart';
import '../../utils/flutter_utils.dart';
import '../../utils/font_weight.dart';
import '../../view_widget/no_data_view.dart';
import 'home_view/my_line_chart.dart';
class BusinessHomePage extends StatefulWidget {
@ -44,6 +49,10 @@ class _BusinessHomePage extends State<BusinessHomePage>
int _loadCount = 0;
PopularSalesList popularSalesList;
List<OrderTrend> orderTrend = [];
VipCountsInfo vipCountsInfo;
int daySelectIndex = 0;
String offsetDay;
List<DayFlowList> dayFlowList = [];
List<LineChartSample2Data> lineChartSample2Data = [
LineChartSample2Data(0, 0, "2023-03-09"),
LineChartSample2Data(1, 0, "2023-03-10"),
@ -79,14 +88,16 @@ class _BusinessHomePage extends State<BusinessHomePage>
? "0"
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id);
queryDayAmount();
queryPopularList();
queryPopularList(offsetDay);
queryOrderTrend();
queryVipCounts();
queryDayFlow();
});
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 3) {
if (_loadCount == 5) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
@ -99,7 +110,10 @@ class _BusinessHomePage extends State<BusinessHomePage>
try {
BaseData<DayCount> baseData = await businessService.getDayCounts({
"summaryDate": "${DateFormat("yyyy-MM-dd").format(DateTime.now())}"
}).catchError((error) {});
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
dayCount = baseData.data;
}
@ -109,12 +123,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
}
///
queryPopularList() async {
queryPopularList(offsetDay) async {
try {
BaseData<PopularSalesList> baseData =
await businessService.popularList("30").catchError((error) {});
await businessService.popularList(offsetDay).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
popularSalesList = baseData.data;
setState(() {});
}
} finally {
addLoadCount();
@ -128,12 +143,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
await businessService.orderTrend().catchError((error) {});
if (baseData != null && baseData.isSuccess) {
double index = 0;
if(baseData.data.isNotEmpty){
if (baseData.data.isNotEmpty) {
orderTrend.clear();
}
orderTrend = baseData.data;
orderTrend.forEach((element) {
lineChartSample2Data.add(LineChartSample2Data(index,element.number,element.date));
lineChartSample2Data.add(LineChartSample2Data(
index, double.tryParse(element.number.toString()), element.date));
index += 1;
});
}
@ -142,6 +158,38 @@ class _BusinessHomePage extends State<BusinessHomePage>
}
}
////
queryVipCounts() async {
try {
BaseData<VipCountsInfo> baseData = await businessService
.vipCounts("${DateFormat("yyyy-MM-dd").format(DateTime.now())}")
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
vipCountsInfo = baseData.data;
}
} finally {
addLoadCount();
}
}
////isMonth=0()isMonth=1()
queryDayFlow() async {
try {
BaseData<List<DayFlowList>> baseData = await businessService
.dayFlow(
// "${DateFormat("yyyy-MM-dd").format(DateTime.now())}",
"2023-09-04",
"1")
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
dayFlowList = baseData.data;
setState(() {});
}
} finally {
addLoadCount();
}
}
@override
Widget build(BuildContext context) {
super.build(context);
@ -437,6 +485,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
return;
}
widget.changeIndex(index);
_onRefresh();
}
}
@ -475,7 +524,14 @@ class _BusinessHomePage extends State<BusinessHomePage>
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context)
.pushNamed('/router/trade_overview_page');
.pushNamed('/router/trade_overview_page', arguments: {
"storeId": widget.businessLoginInfo
.storeList[widget.selectStoreIndex].name ==
"所有门店"
? "0"
: widget.businessLoginInfo
.storeList[widget.selectStoreIndex].id,
});
},
child: Row(
children: [
@ -503,8 +559,16 @@ class _BusinessHomePage extends State<BusinessHomePage>
SizedBox(
height: 18.h,
),
if(lineChartSample2Data.isNotEmpty)
LineChartSample2(lineChartSample2Data, "销售量"),
// if (lineChartSample2Data.isNotEmpty)
(lineChartSample2Data.isNotEmpty)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: LineChartSample2(lineChartSample2Data, "销售量"),
],
),
);
@ -543,155 +607,173 @@ class _BusinessHomePage extends State<BusinessHomePage>
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFFC5A58), Color(0xFFFF716F)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(1);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFFC5A58), Color(0xFFFF716F)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(6.w),
),
borderRadius: BorderRadius.circular(6.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"今日会员充值",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"今日会员充值",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
),
],
),
SizedBox(
height: 7.h,
),
Text(
vipCountsInfo?.rechargeMoney ?? "0",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
),
],
),
SizedBox(
height: 7.h,
),
Text(
"108088",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
],
),
),
)),
SizedBox(
width: 9.w,
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFFFA238), Color(0xFFFFBA6D)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(6.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"今日新增会员",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(2);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFFFA238), Color(0xFFFFBA6D)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(6.w),
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"今日新增会员",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
),
],
),
SizedBox(
height: 7.h,
),
Text(
(vipCountsInfo?.newMemberNum ?? 0).toString(),
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
],
),
SizedBox(
height: 7.h,
),
Text(
"666",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
)),
))),
SizedBox(
width: 9.w,
),
Expanded(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF4B77FC), Color(0xFF7091FF)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(6.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"总会员数",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(3);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF4B77FC), Color(0xFF7091FF)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(6.w),
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 6.w),
child: Text(
"总会员数",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
),
Image.asset(
"assets/image/bs_query_logo.webp",
width: 14,
height: 14,
),
],
),
SizedBox(
height: 7.h,
),
Text(
(vipCountsInfo?.memberNum ?? 0).toString(),
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
],
),
SizedBox(
height: 7.h,
),
Text(
"23455",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
],
),
)),
))),
],
)
],
@ -699,6 +781,58 @@ class _BusinessHomePage extends State<BusinessHomePage>
);
}
///
showVipTipDialog(index) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
index == 1
? "assets/image/icon_vip_recharge.webp"
: (index == 2
? "assets/image/icon_new_vip.webp"
: "assets/image/icon_vip_total.webp"),
width: 20.h,
height: 20.h,
),
SizedBox(
height: 6.h,
),
Text(
index == 1 ? "今日会员充值" : (index == 2 ? "今日新增会员" : "总会员数"),
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
SizedBox(
height: 13.h,
),
Text(
index == 1
? "今日会员充值指今天所选门店会员充值额度"
: (index == 2 ? "今日新增会员指今天所选门店新增会员" : "总会员数指所选门店会员总会员人数"),
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xFF666666),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
);
},
);
}
///
Widget hotSellHotCharts() {
return Container(
@ -729,91 +863,213 @@ class _BusinessHomePage extends State<BusinessHomePage>
SizedBox(
height: 14.h,
),
Container(
height: 25.h,
margin: EdgeInsets.only(bottom: 26.h),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemCount: 4,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: dayItem(),
);
},
),
Row(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 0;
queryPopularList("0");
});
},
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 19.w, vertical: 5.h),
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 0
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
child: Text(
"今天",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 0
? Colors.white
: Color(0XFF30415B),
),
),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 1;
queryPopularList("1");
});
},
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 19.w, vertical: 5.h),
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 1
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
child: Text(
"昨天",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 1
? Colors.white
: Color(0XFF30415B),
),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 2;
queryPopularList("7");
});
},
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 2
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
child: Text(
"最近7天",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 2
? Colors.white
: Color(0XFF30415B),
),
),
)),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 3;
queryPopularList("30");
});
},
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 3
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
child: Text(
"最近30天",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 3
? Colors.white
: Color(0XFF30415B),
),
),
)),
],
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: salesVolumeItem(),
);
},
Container(
height: 310.h,
child: (popularSalesList == null ||
popularSalesList.saleProductList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: popularSalesList?.saleProductList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: salesVolumeItem(
popularSalesList.saleProductList[position],
position),
);
},
),
),
],
),
);
}
///item
Widget dayItem() {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 19.w,
),
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
// color: Color(0xFF30415B),
border: Border.all(
color: Color(0xFF30415B),
width: 1.w,
),
),
child: Text(
"今天",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0XFF30415B),
),
),
);
}
///item
Widget salesVolumeItem() {
Widget salesVolumeItem(SaleProductList saleProductList, index) {
return Container(
padding: EdgeInsets.only(bottom: 12.h),
child: Row(
children: [
Image.asset(
"assets/image/bs_trophy_one.webp",
width: 26,
height: 26,
),
// Text(
// "1",
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Color(0xFF0D0D0D),
// ),
// ),
if (index == 0 || index == 1 || index == 2)
Image.asset(
index == 0
? "assets/image/bs_trophy_one.webp"
: (index == 1
? "assets/image/bs_trophy_two.webp"
: "assets/image/bs_trophy_three.webp"),
width: 26.h,
height: 26.h,
),
if (index != 0 && index != 1 && index != 2)
Padding(
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Text(
(index + 1).toString(),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF0D0D0D),
),
),
),
SizedBox(
width: 8.w,
),
Expanded(
child: Text(
"满杯花青素",
saleProductList?.productName ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -832,7 +1088,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
Padding(
padding: EdgeInsets.only(left: 7.w),
child: Text(
"1888",
"${(saleProductList?.saleNum ?? 0).toString()}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -874,7 +1130,18 @@ class _BusinessHomePage extends State<BusinessHomePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed('/router/flow_page');
Navigator.of(context).pushNamed('/router/flow_page',
arguments: {
"storeName": widget?.businessLoginInfo
?.storeList[widget.selectStoreIndex].name ??
"",
"storeId": widget.businessLoginInfo
.storeList[widget.selectStoreIndex].name ==
"所有门店"
? "0"
: widget.businessLoginInfo
.storeList[widget.selectStoreIndex].id,
});
},
child: Row(
children: [
@ -902,26 +1169,36 @@ class _BusinessHomePage extends State<BusinessHomePage>
SizedBox(
height: 20.h,
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: flowItem(),
);
},
)
Container(
height: 360.h,
child: (dayFlowList.length == null || dayFlowList?.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: flowItem(dayFlowList[position]),
);
},
))
],
),
);
}
///item
Widget flowItem() {
Widget flowItem(DayFlowList dayFlowList) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0.w),
@ -936,7 +1213,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"2023-06-04 9:00:05",
dayFlowList?.localDateTime ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
@ -947,7 +1224,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 7.h,
),
Text(
"海峽姐妹茶 郑州新田360店",
dayFlowList?.storeName ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -960,7 +1237,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
TextSpan(
children: [
TextSpan(
text: "+",
text: (dayFlowList?.amount != "0.00") ? "+" : "-",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
@ -968,7 +1245,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
),
),
TextSpan(
text: "34.00",
text: (dayFlowList?.amount != "0.00")
? (dayFlowList?.amount ?? "")
: (dayFlowList?.refundAmount ?? ""),
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,

348
lib/business_system/home/flow_page.dart

@ -1,13 +1,26 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_easyloading/flutter_easyloading.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 'package:shared_preferences/shared_preferences.dart';
import '../../generated/l10n.dart';
import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/day_flow_list.dart';
import '../../utils/business_instance.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
class FlowPage extends StatefulWidget {
final arguments;
FlowPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _FlowPage();
@ -16,48 +29,88 @@ class FlowPage extends StatefulWidget {
class _FlowPage extends State<FlowPage> {
final RefreshController refreshController = RefreshController();
var isShowMore = false;
String storeId;
BusinessApiService businessService;
List<DayFlowList> dayFlowList = [];
@override
void initState() {
super.initState();
storeId = widget.arguments["storeId"];
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: storeId);
queryDayFlow("2023-09-04", "0");
});
}
////isMonth=0()isMonth=1()
queryDayFlow(yearMonth, isMonth) async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
try {
BaseData<List<DayFlowList>> baseData = await businessService
.dayFlow(
// "${DateFormat("yyyy-MM-dd").format(DateTime.now())}",
yearMonth,
isMonth)
.catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if (isMonth == "0") {
dayFlowList = baseData.data;
} else {
dayFlowList
.firstWhere((element) => element.localDate == yearMonth)
.detailList = baseData.data.first.detailList;
}
setState(() {});
}
} finally {
EasyLoading.dismiss();
}
}
@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,
return Scaffold(
backgroundColor: Color(0xFFF8F8FA),
appBar: MyAppBar(
title: widget.arguments["storeName"],
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,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
color: Colors.white,
),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:Container(
margin: EdgeInsets.only(top: 24.h,left: 16.w,right: 16.w),
child:Column(
children: [
Row(
child: Container(
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
child: Column(
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showDateSelector();
},
child: Row(
children: [
Text(
"2023年6月",
@ -74,50 +127,57 @@ class _FlowPage extends State<FlowPage> {
),
],
),
SizedBox(height: 16.h,),
ListView.builder(
padding: EdgeInsets.zero,
itemCount:5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: billItem(),
);
},
)
],
),
),
SizedBox(
height: 16.h,
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: billItem(dayFlowList[position]),
);
},
)
],
),
),
),
);
),
);
}
///
Widget billItem(){
Widget billItem(DayFlowList dayFlowList) {
return Container(
padding: EdgeInsets.all(12.h),
margin: EdgeInsets.only(bottom:12.h),
margin: EdgeInsets.only(bottom: 12.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child:Column(
child: Column(
children: [
GestureDetector(
onTap: (){
setState((){
isShowMore = !isShowMore;
});
onTap: () {
if(dayFlowList.detailList != null){
setState((){
dayFlowList.detailList = null;
});
}else{
queryDayFlow("2023-09-04", "1");
}
},
child: Row(
children: [
Expanded(child: Text(
"06/10",
Expanded(
child: Text(
dayFlowList?.localDate ?? "",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
@ -125,18 +185,23 @@ class _FlowPage extends State<FlowPage> {
),
)),
Icon(
isShowMore ? Icons.keyboard_arrow_up :Icons.keyboard_arrow_down,
dayFlowList.detailList == null
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Color(0xFF0D0D0D),
size: 24,
),
],
),
),
SizedBox(height:15.h,),
SizedBox(
height: 15.h,
),
Row(
children: [
Expanded(child: Text(
"交易金额 76555.22元",
Expanded(
child: Text(
"交易金额 ${dayFlowList?.amount ?? ""}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -144,7 +209,7 @@ class _FlowPage extends State<FlowPage> {
),
)),
Text(
"76",
"${(dayFlowList?.count ?? 0).toString()}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -153,82 +218,111 @@ class _FlowPage extends State<FlowPage> {
)
],
),
SizedBox(height:20.h,),
if(isShowMore)
ListView.builder(
padding: EdgeInsets.zero,
itemCount:5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: billIDetailsItem(),
);
},
)
SizedBox(
height: 20.h,
),
if(dayFlowList.detailList != null)
Column(
children:dayFlowList.detailList.map((e) {
return billIDetailsItem(e);
}).toList(),
)
// if (isShowMore)
// ListView.builder(
// padding: EdgeInsets.zero,
// itemCount: 5,
// scrollDirection: Axis.vertical,
// shrinkWrap: true,
// physics: BouncingScrollPhysics(),
// itemBuilder: (context, position) {
// return GestureDetector(
// onTap: () {},
// child: billIDetailsItem(),
// );
// },
// )
],
),
);
}
///
Widget billIDetailsItem(){
Widget billIDetailsItem(DayFlowList detailList) {
return Container(
margin: EdgeInsets.only(bottom:20.h),
child: Row(
children: [
Expanded(child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(bottom:15.h),
child:Text(
"11:20:12",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
margin: EdgeInsets.only(bottom: 20.h),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 15.h),
child: Text(
detailList?.localDateTime ??"",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
),
),),
Text(
"JJJJ",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
Text(
detailList?.phone ?? "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),
],
),
],
),),
Text.rich(
TextSpan(
children: [
TextSpan(
text:"+",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF0D0D0D),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "+",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF0D0D0D),
),
),
),
TextSpan(
text: "22.33",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF0D0D0D),
TextSpan(
text: detailList?.amount ?? "",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF0D0D0D),
),
),
),
],
],
),
),
),
],
)
);
],
));
}
showDateSelector() {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime.now(),
maxTime: DateTime.now(),
theme: DatePickerTheme(
headerColor: Colors.white,
backgroundColor: Colors.white,
itemStyle: TextStyle(
color: Colors.black,
fontWeight: MyFontWeight.bold,
fontSize: 18),
doneStyle: TextStyle(color: Color(0xFF32A060), fontSize: 16.sp)),
onChanged: (date) {
print('change $date in time zone ' +
date.timeZoneOffset.inHours.toString());
}, onConfirm: (date) {
// "2023-09-04";
setState(() {});
}, currentTime: DateTime.now(), locale: LocaleType.zh);
}
}

1107
lib/business_system/home/overview/trade_goods.dart

File diff suppressed because it is too large Load Diff

2
lib/business_system/home/overview/trade_order.dart

@ -354,7 +354,7 @@ class _TradeOrder extends State<TradeOrder> {
margin: EdgeInsets.only(right:12.w),
),
Text(
"订单趋势",
"订单趋势",
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,

11
lib/business_system/home/overview/trade_overview_page.dart

@ -6,9 +6,14 @@ import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../generated/l10n.dart';
import '../../../view_widget/my_tab.dart';
class TradeOverviewPage extends StatefulWidget {
final arguments;
TradeOverviewPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _TradeOverviewPage();
@ -17,10 +22,12 @@ class TradeOverviewPage extends StatefulWidget {
class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProviderStateMixin{
final RefreshController refreshController = RefreshController();
String storeId;
@override
void initState() {
super.initState();
storeId = widget?.arguments["storeId"] ??"";
}
@override
@ -55,7 +62,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProvi
//
tabs: <Widget>[
MyTab(text:"总览"),
MyTab(text: "订单"),
MyTab(text: S.of(context).dingdan),
MyTab(text: "商品"),
],
),
@ -64,7 +71,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProvi
children: [
TradeSummary(),
TradeOrder(),
TradeGoods(),],
TradeGoods(storeId),],
),
),
);

2
lib/business_system/order/request_refund.dart

@ -58,7 +58,7 @@ class _RequestRefund extends State<RequestRefund> {
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFF8F8FA),
appBar: MyAppBar(
title: "申请退款",
title: S.of(context).shenqingtuikuan,
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,

4
lib/main.dart

@ -473,11 +473,11 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/business_page': (context, {arguments}) =>
BusinessPage(arguments: arguments),
'/router/flow_page': (context, {arguments}) =>
FlowPage(),
FlowPage(arguments: arguments),
'/router/select_shop': (context, {arguments}) =>
SelectShop(arguments:arguments),
'/router/trade_overview_page': (context, {arguments}) =>
TradeOverviewPage(),
TradeOverviewPage(arguments: arguments,),
'/router/goods_search_page': (context, {arguments}) =>
GoodsSearchPage(arguments: arguments),
'/router/goods_assort': (context, {arguments}) =>

17
lib/retrofit/business_api.dart

@ -14,7 +14,10 @@ import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/base_data.dart';
import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/popular_sales_list.dart';
import 'data/single_sales_list.dart';
part 'business_api.g.dart';
@ -147,4 +150,18 @@ abstract class BusinessApiService {
@GET("largeScreenReport/getDayCounts?date={date}")
Future<BaseData<VipCountsInfo>> vipCounts(
@Path("date") String date);
////isMonth=0()isMonth=1()
@GET("dashBoard/order?yearMonth={yearMonth}&isMonth={isMonth}")
Future<BaseData<List<DayFlowList>>> dayFlow(
@Path("yearMonth") String yearMonth, @Path("isMonth") String isMonth);
////
@POST("audit/salesLeaderboard")
Future<BaseData<List<SingleSalesList>>> singleSales(@Body() Map<String, dynamic> param);
////
@POST("audit/allKindsSalesStatistics")
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(@Body() Map<String, dynamic> param);
}

75
lib/retrofit/business_api.g.dart

@ -134,4 +134,79 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData<List<DayFlowList>>> dayFlow(yearMonth,isMonth) async {
ArgumentError.checkNotNull(yearMonth, 'yearMonth');
ArgumentError.checkNotNull(isMonth, 'isMonth');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'dashBoard/order?yearMonth=$yearMonth&isMonth=$isMonth',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<DayFlowList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<DayFlowList>(
(i) => DayFlowList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<SingleSalesList>>> singleSales(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'audit/salesLeaderboard',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<SingleSalesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<SingleSalesList>(
(i) => SingleSalesList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'audit/allKindsSalesStatistics',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<GoodsTypeSalesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<GoodsTypeSalesList>(
(i) => GoodsTypeSalesList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
}

93
lib/retrofit/data/day_flow_list.dart

@ -0,0 +1,93 @@
/// localDate : null
/// localDateTime : "2023-09-04 12:18:20"
/// count : 0
/// amount : "19.00"
/// refundAmount : "0.00"
/// storeName : "屏东剉冰店(烧冷冰)"
/// nickname : null
/// phone : null
class DayFlowList {
DayFlowList({
dynamic localDate,
String localDateTime,
num count,
String amount,
String refundAmount,
String storeName,
dynamic nickname,
dynamic phone,}){
_localDate = localDate;
_localDateTime = localDateTime;
_count = count;
_amount = amount;
_refundAmount = refundAmount;
_storeName = storeName;
_nickname = nickname;
_phone = phone;
}
DayFlowList.fromJson(dynamic json) {
_localDate = json['localDate'];
_localDateTime = json['localDateTime'];
_count = json['count'];
_amount = json['amount'];
_refundAmount = json['refundAmount'];
_storeName = json['storeName'];
_nickname = json['nickname'];
_phone = json['phone'];
}
dynamic _localDate;
String _localDateTime;
num _count;
String _amount;
String _refundAmount;
String _storeName;
dynamic _nickname;
dynamic _phone;
DayFlowList copyWith({ dynamic localDate,
String localDateTime,
num count,
String amount,
String refundAmount,
String storeName,
dynamic nickname,
dynamic phone,
}) => DayFlowList( localDate: localDate ?? _localDate,
localDateTime: localDateTime ?? _localDateTime,
count: count ?? _count,
amount: amount ?? _amount,
refundAmount: refundAmount ?? _refundAmount,
storeName: storeName ?? _storeName,
nickname: nickname ?? _nickname,
phone: phone ?? _phone,
);
dynamic get localDate => _localDate;
String get localDateTime => _localDateTime;
num get count => _count;
String get amount => _amount;
String get refundAmount => _refundAmount;
String get storeName => _storeName;
dynamic get nickname => _nickname;
dynamic get phone => _phone;
List<DayFlowList> detailList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['localDate'] = _localDate;
map['localDateTime'] = _localDateTime;
map['count'] = _count;
map['amount'] = _amount;
map['refundAmount'] = _refundAmount;
map['storeName'] = _storeName;
map['nickname'] = _nickname;
map['phone'] = _phone;
return map;
}
}

51
lib/retrofit/data/goods_type_sales_list.dart

@ -0,0 +1,51 @@
/// name : "筒仔米糕"
/// value : "10.00"
/// sale : "1"
/// percentage : "0.0059"
class GoodsTypeSalesList {
GoodsTypeSalesList({
String name,
String value,
String sale,
String percentage,}){
_name = name;
_value = value;
_sale = sale;
_percentage = percentage;
}
GoodsTypeSalesList.fromJson(dynamic json) {
_name = json['name'];
_value = json['value'];
_sale = json['sale'];
_percentage = json['percentage'];
}
String _name;
String _value;
String _sale;
String _percentage;
GoodsTypeSalesList copyWith({ String name,
String value,
String sale,
String percentage,
}) => GoodsTypeSalesList( name: name ?? _name,
value: value ?? _value,
sale: sale ?? _sale,
percentage: percentage ?? _percentage,
);
String get name => _name;
String get value => _value;
String get sale => _sale;
String get percentage => _percentage;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['name'] = _name;
map['value'] = _value;
map['sale'] = _sale;
map['percentage'] = _percentage;
return map;
}
}

6
lib/retrofit/data/order_trend.dart

@ -4,7 +4,7 @@
class OrderTrend {
OrderTrend({
String date,
num number,}){
dynamic number,}){
_date = date;
_number = number;
}
@ -16,12 +16,12 @@ class OrderTrend {
String _date;
num _number;
OrderTrend copyWith({ String date,
num number,
dynamic number,
}) => OrderTrend( date: date ?? _date,
number: number ?? _number,
);
String get date => _date;
num get number => _number;
dynamic get number => _number;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};

141
lib/retrofit/data/single_sales_list.dart

@ -0,0 +1,141 @@
/// productId : null
/// saleNum : 16
/// productName : "米粉汤"
/// productType : null
/// productGroupName : "米粉汤"
/// sumPrice : "256.00"
/// sellPrict : "16.00"
/// productSkuName : ""
/// productSkuList : null
/// platterLsit : null
/// giveNum : 0
/// refundNum : 0
/// productCountPercent : 0.11
/// productSellPricePercent : 0.11
class SingleSalesList {
SingleSalesList({
dynamic productId,
num saleNum,
String productName,
dynamic productType,
String productGroupName,
String sumPrice,
String sellPrict,
String productSkuName,
dynamic productSkuList,
dynamic platterLsit,
num giveNum,
num refundNum,
num productCountPercent,
num productSellPricePercent,}){
_productId = productId;
_saleNum = saleNum;
_productName = productName;
_productType = productType;
_productGroupName = productGroupName;
_sumPrice = sumPrice;
_sellPrict = sellPrict;
_productSkuName = productSkuName;
_productSkuList = productSkuList;
_platterLsit = platterLsit;
_giveNum = giveNum;
_refundNum = refundNum;
_productCountPercent = productCountPercent;
_productSellPricePercent = productSellPricePercent;
}
SingleSalesList.fromJson(dynamic json) {
_productId = json['productId'];
_saleNum = json['saleNum'];
_productName = json['productName'];
_productType = json['productType'];
_productGroupName = json['productGroupName'];
_sumPrice = json['sumPrice'];
_sellPrict = json['sellPrict'];
_productSkuName = json['productSkuName'];
_productSkuList = json['productSkuList'];
_platterLsit = json['platterLsit'];
_giveNum = json['giveNum'];
_refundNum = json['refundNum'];
_productCountPercent = json['productCountPercent'];
_productSellPricePercent = json['productSellPricePercent'];
}
dynamic _productId;
num _saleNum;
String _productName;
dynamic _productType;
String _productGroupName;
String _sumPrice;
String _sellPrict;
String _productSkuName;
dynamic _productSkuList;
dynamic _platterLsit;
num _giveNum;
num _refundNum;
num _productCountPercent;
num _productSellPricePercent;
SingleSalesList copyWith({ dynamic productId,
num saleNum,
String productName,
dynamic productType,
String productGroupName,
String sumPrice,
String sellPrict,
String productSkuName,
dynamic productSkuList,
dynamic platterLsit,
num giveNum,
num refundNum,
num productCountPercent,
num productSellPricePercent,
}) => SingleSalesList( productId: productId ?? _productId,
saleNum: saleNum ?? _saleNum,
productName: productName ?? _productName,
productType: productType ?? _productType,
productGroupName: productGroupName ?? _productGroupName,
sumPrice: sumPrice ?? _sumPrice,
sellPrict: sellPrict ?? _sellPrict,
productSkuName: productSkuName ?? _productSkuName,
productSkuList: productSkuList ?? _productSkuList,
platterLsit: platterLsit ?? _platterLsit,
giveNum: giveNum ?? _giveNum,
refundNum: refundNum ?? _refundNum,
productCountPercent: productCountPercent ?? _productCountPercent,
productSellPricePercent: productSellPricePercent ?? _productSellPricePercent,
);
dynamic get productId => _productId;
num get saleNum => _saleNum;
String get productName => _productName;
dynamic get productType => _productType;
String get productGroupName => _productGroupName;
String get sumPrice => _sumPrice;
String get sellPrict => _sellPrict;
String get productSkuName => _productSkuName;
dynamic get productSkuList => _productSkuList;
dynamic get platterLsit => _platterLsit;
num get giveNum => _giveNum;
num get refundNum => _refundNum;
num get productCountPercent => _productCountPercent;
num get productSellPricePercent => _productSellPricePercent;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['productId'] = _productId;
map['saleNum'] = _saleNum;
map['productName'] = _productName;
map['productType'] = _productType;
map['productGroupName'] = _productGroupName;
map['sumPrice'] = _sumPrice;
map['sellPrict'] = _sellPrict;
map['productSkuName'] = _productSkuName;
map['productSkuList'] = _productSkuList;
map['platterLsit'] = _platterLsit;
map['giveNum'] = _giveNum;
map['refundNum'] = _refundNum;
map['productCountPercent'] = _productCountPercent;
map['productSellPricePercent'] = _productSellPricePercent;
return map;
}
}

2
lib/retrofit/min_api.dart

@ -27,7 +27,7 @@ import 'data/shopping_home_config.dart';
part 'min_api.g.dart';
const localBaseUrl = "http://app-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://192.168.10.78:8765/app/";///
// const localBaseUrl = "http://pos-test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线

2
lib/retrofit/retrofit_api.dart

@ -66,7 +66,7 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const localBaseUrl = "http://platform-api.test.yixinhuixiang.com/app/";///
const localBaseUrl = "http://192.168.10.78:8766/app/";///
// const localBaseUrl = "http://platform.test.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";

18
pubspec.lock

@ -78,6 +78,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:
@ -419,7 +433,7 @@ packages:
name: image_pickers
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.4+1"
version: "2.0.0"
intl:
dependency: "direct main"
description:
@ -865,7 +879,7 @@ packages:
name: tobias
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.4.2"
version: "2.4.1"
tpns_flutter_plugin:
dependency: "direct main"
description:

Loading…
Cancel
Save