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. 435
      lib/business_system/home/business_home_page.dart
  9. 190
      lib/business_system/home/flow_page.dart
  10. 577
      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),

435
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();
@ -133,7 +148,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
}
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,6 +607,11 @@ class _BusinessHomePage extends State<BusinessHomePage>
Row(
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(1);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
@ -580,7 +649,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 7.h,
),
Text(
"108088",
vipCountsInfo?.rechargeMoney ?? "0",
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
@ -589,13 +658,20 @@ class _BusinessHomePage extends State<BusinessHomePage>
),
],
),
),
)),
SizedBox(
width: 9.w,
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(2);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFFFFA238), Color(0xFFFFBA6D)],
@ -631,7 +707,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 7.h,
),
Text(
"666",
(vipCountsInfo?.newMemberNum ?? 0).toString(),
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
@ -640,13 +716,19 @@ class _BusinessHomePage extends State<BusinessHomePage>
),
],
),
)),
))),
SizedBox(
width: 9.w,
),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showVipTipDialog(3);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 6.h),
padding: EdgeInsets.symmetric(
horizontal: 8.w, vertical: 6.h),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xFF4B77FC), Color(0xFF7091FF)],
@ -682,7 +764,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 7.h,
),
Text(
"23455",
(vipCountsInfo?.memberNum ?? 0).toString(),
style: TextStyle(
fontSize: 24.sp,
fontWeight: MyFontWeight.medium,
@ -691,7 +773,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
),
],
),
)),
))),
],
)
],
@ -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,
),
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: 5,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: salesVolumeItem(),
);
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,
),
],
),
);
}
///item
Widget dayItem() {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 19.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),
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
// color: Color(0xFF30415B),
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.medium,
color: Color(0XFF30415B),
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),
),
),
)),
],
),
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 salesVolumeItem() {
Widget salesVolumeItem(SaleProductList saleProductList, index) {
return Container(
padding: EdgeInsets.only(bottom: 12.h),
child: Row(
children: [
if (index == 0 || index == 1 || index == 2)
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),
// ),
// ),
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(
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: 5,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: flowItem(),
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,

190
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,20 +29,56 @@ 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(
return Scaffold(
backgroundColor: Color(0xFFF8F8FA),
appBar: MyAppBar(
title: "海峡姐妹茶",
title: widget.arguments["storeName"],
titleColor: Colors.black,
background: Colors.white,
leadingColor: Colors.black,
@ -47,8 +96,7 @@ class _FlowPage extends State<FlowPage> {
return MyFooter(mode);
},
),
onRefresh: () {
},
onRefresh: () {},
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
@ -57,7 +105,12 @@ class _FlowPage extends State<FlowPage> {
margin: EdgeInsets.only(top: 24.h, left: 16.w, right: 16.w),
child: Column(
children: [
Row(
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
showDateSelector();
},
child: Row(
children: [
Text(
"2023年6月",
@ -74,18 +127,20 @@ class _FlowPage extends State<FlowPage> {
),
],
),
SizedBox(height: 16.h,),
),
SizedBox(
height: 16.h,
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount:5,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: billItem(),
onTap: () {},
child: billItem(dayFlowList[position]),
);
},
)
@ -98,7 +153,7 @@ class _FlowPage extends State<FlowPage> {
}
///
Widget billItem(){
Widget billItem(DayFlowList dayFlowList) {
return Container(
padding: EdgeInsets.all(12.h),
margin: EdgeInsets.only(bottom: 12.h),
@ -110,14 +165,19 @@ class _FlowPage extends State<FlowPage> {
children: [
GestureDetector(
onTap: () {
if(dayFlowList.detailList != null){
setState((){
isShowMore = !isShowMore;
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,49 +218,57 @@ 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(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.only(bottom:15.h),
Padding(
padding: EdgeInsets.only(bottom: 15.h),
child: Text(
"11:20:12",
detailList?.localDateTime ??"",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF1A1A1A),
),
),),
),
),
Text(
"JJJJ",
detailList?.phone ?? "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
@ -203,7 +276,8 @@ class _FlowPage extends State<FlowPage> {
),
),
],
),),
),
),
Text.rich(
TextSpan(
children: [
@ -216,7 +290,7 @@ class _FlowPage extends State<FlowPage> {
),
),
TextSpan(
text: "22.33",
text: detailList?.amount ?? "",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
@ -227,8 +301,28 @@ class _FlowPage extends State<FlowPage> {
),
),
],
)
);
));
}
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);
}
}

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

@ -1,14 +1,30 @@
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/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:intl/intl.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/goods_type_sales_list.dart';
import '../../../retrofit/data/single_sales_list.dart';
import '../../../utils/business_instance.dart';
import '../../../utils/flutter_utils.dart';
import '../../../utils/font_weight.dart';
import '../../../view_widget/no_data_view.dart';
class TradeGoods extends StatefulWidget {
final storeId;
TradeGoods(this.storeId);
@override
State<StatefulWidget> createState() {
return _TradeGoods();
@ -22,12 +38,17 @@ class _TradeGoods extends State<TradeGoods> {
String selectedDate = "";
String dayDate = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
String weekDate = "";
String weekDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days:6)))}"
String weekDateNum =
"${DateFormat("yyyy年MM月dd日").format(DateTime.now().subtract(Duration(days: 6)))}"
"${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
String monthlyDate = "";
String monthlyDateNum = "${DateFormat("yyyy年MM月").format(DateTime.now())}";
String monthlyDateNum = "${DateFormat("yyyy年MM月dd").format(DateTime.now())}";
String customDate = "";
String customDateNum = "${DateFormat("yyyy年MM月dd日").format(DateTime.now())}";
int _loadCount = 0;
BusinessApiService businessService;
List<SingleSalesList> singleSalesList = [];
List<GoodsTypeSalesList> goodsTypeSalesList = [];
@override
void dispose() {
@ -38,9 +59,87 @@ class _TradeGoods extends State<TradeGoods> {
@override
void initState() {
super.initState();
_onRefresh();
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: widget.storeId);
querySingleSales(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", ""));
queryGoodsSalesList(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", ""));
});
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 2) {
_loadCount = 0;
EasyLoading.dismiss();
if (_refreshController.isRefresh) _refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
///
queryGoodsSalesList(date, endDat) async {
try {
BaseData<List<GoodsTypeSalesList>> baseData =
await businessService.goodsSalesList({
"date": date,
"endDate": endDat,
"groupId": 0,
"orderBy": 1,
"searchType": 2,
"type": 1
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
goodsTypeSalesList = baseData.data;
}
} finally {
addLoadCount();
}
}
///
querySingleSales(date, endDate) async {
try {
BaseData<List<SingleSalesList>> baseData =
await businessService.singleSales({
"date": date,
"endDate": endDate,
"groupId": 0,
"orderBy": 1,
"searchType": 2,
"type": 1
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
singleSalesList = baseData.data;
}
} finally {
addLoadCount();
}
}
@override
@ -54,7 +153,8 @@ class _TradeGoods extends State<TradeGoods> {
width: double.infinity,
height: 1.h,
),
Expanded(child: SmartRefresher(
Expanded(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
@ -66,11 +166,7 @@ class _TradeGoods extends State<TradeGoods> {
return MyFooter(mode);
},
),
onRefresh: () {
setState(() {
_onRefresh();
});
},
onRefresh: _onRefresh,
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
@ -80,25 +176,50 @@ class _TradeGoods extends State<TradeGoods> {
decoration: BoxDecoration(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Color(0xFFCFD0D1),
width: 1.w),
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: GestureDetector(
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 0;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 0 ? Color(0xFF30415B):Colors.transparent,
color: dateIndex == 0
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
@ -106,22 +227,50 @@ class _TradeGoods extends State<TradeGoods> {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 0 ? Colors.white:Color(0xFF30415B),
color: dateIndex == 0
? Colors.white
: Color(0xFF30415B),
),
),
),
)),
Expanded(child: GestureDetector(
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 1;
});},
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 1 ? Color(0xFF30415B):Colors.transparent,
color: dateIndex == 1
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
@ -129,22 +278,42 @@ class _TradeGoods extends State<TradeGoods> {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 1 ? Colors.white:Color(0xFF30415B),
color: dateIndex == 1
? Colors.white
: Color(0xFF30415B),
),
),
),
),)),
Expanded(child: GestureDetector(
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 2;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 2 ? Color(0xFF30415B):Colors.transparent,
color: dateIndex == 2
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
@ -152,22 +321,50 @@ class _TradeGoods extends State<TradeGoods> {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 2 ? Colors.white:Color(0xFF30415B),
color: dateIndex == 2
? Colors.white
: Color(0xFF30415B),
),
),
),
),)),
Expanded(child: GestureDetector(
)),
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 3;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: dateIndex == 3 ? Color(0xFF30415B):Colors.transparent,
color: dateIndex == 3
? Color(0xFF30415B)
: Colors.transparent,
),
padding: EdgeInsets.symmetric(vertical: 9.h),
child: Text(
@ -175,42 +372,139 @@ class _TradeGoods extends State<TradeGoods> {
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: dateIndex == 3 ? Colors.white:Color(0xFF30415B),
color: dateIndex == 3
? Colors.white
: Color(0xFF30415B),
),
),
),
),)),
)),
],
),
),
Align(alignment: Alignment.center,
Align(
alignment: Alignment.center,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
if (dateIndex == 0) {
Navigator.of(context).pushNamed('/router/day_report_page').then((value) {
Navigator.of(context)
.pushNamed('/router/day_report_page')
.then((value) {
setState(() {
selectedDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
});
}
else if(dateIndex == 1){
Navigator.of(context).pushNamed('/router/week_report_page').then((value) {
} else if (dateIndex == 1) {
Navigator.of(context)
.pushNamed('/router/week_report_page')
.then((value) {
setState(() {
weekDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
});
}
else if(dateIndex == 2){
Navigator.of(context).pushNamed('/router/monthly_report_page').then((value) {
} else if (dateIndex == 2) {
Navigator.of(context)
.pushNamed('/router/monthly_report_page')
.then((value) {
setState(() {
monthlyDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
});
}
else if(dateIndex == 3){
Navigator.of(context).pushNamed('/router/custom_page').then((value){
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.then((value) {
setState(() {
customDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
});
}
@ -226,10 +520,16 @@ class _TradeGoods extends State<TradeGoods> {
margin: EdgeInsets.only(bottom: 16.h),
child: Row(
children: [
Expanded(child:Container(
Expanded(
child: Container(
alignment: Alignment.center,
child: Text(
timeDate(),
dateIndex == 2
? ((monthlyDateNum.substring(0, 8) ==
timeDate().substring(0, 8))
? "${timeDate().substring(0, 8)}(当月)"
: timeDate().substring(0, 8))
: timeDate(),
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
@ -245,8 +545,10 @@ class _TradeGoods extends State<TradeGoods> {
],
),
),
),),
Padding(padding:EdgeInsets.only(left:16.w,bottom:15.h),
),
),
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 15.h),
child: Text(
"商品分析",
style: TextStyle(
@ -257,7 +559,8 @@ class _TradeGoods extends State<TradeGoods> {
)),
goodsTypeRecord(),
Container(
margin: EdgeInsets.only(top: 14.h,left:16.w,right: 16.w),
margin:
EdgeInsets.only(top: 14.h, left: 16.w, right: 16.w),
color: Color(0xFFECECEC),
height: 1.h,
width: double.infinity,
@ -265,7 +568,8 @@ class _TradeGoods extends State<TradeGoods> {
singleSalesStatement(),
],
)),
),)
),
)
],
),
);
@ -273,26 +577,35 @@ class _TradeGoods extends State<TradeGoods> {
String timeDate() {
if (dateIndex == 0) {
return (selectedDate == "" || selectedDate == null) ? "${dayDate ?? ""}(今日)":(dayDate == DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))
?"${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)":DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate)));
return (selectedDate == "" || selectedDate == null)
? "${dayDate ?? ""}(今日)"
: (dayDate ==
DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))
? "${DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate))}(今日)"
: DateFormat("yyyy年MM月dd日").format(DateTime.parse(selectedDate)));
} else if (dateIndex == 1) {
return (weekDate == "" || weekDate == null) ? weekDateNum : weekDate;
} else if (dateIndex == 2) {
return (monthlyDate == "" || monthlyDate == null)
? "${monthlyDateNum ?? ""}"
: (monthlyDateNum ==
(DateFormat("yyyy年MM月dd日")
.format(DateTime.parse(monthlyDate)))
? "${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)))}"
: DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)));
} else if (dateIndex == 3) {
return (customDate == "" || customDate == null)
? "${customDateNum ?? ""}(今日)"
: customDate;
}
else if(dateIndex == 1){
return (weekDate == "" || weekDate == null) ? weekDateNum : weekDate;}
else if(dateIndex == 2){
return (monthlyDate == "" || monthlyDate == null) ? "${monthlyDateNum ?? ""}(当月)":
(monthlyDateNum == (DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))?
"${(DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8))}(当月)"
:DateFormat("yyyy年MM月dd日").format(DateTime.parse(monthlyDate)).substring(0,8));
}
else if(dateIndex == 3){
return (customDate == "" || customDate == null) ? "${customDateNum??""}(今日)" : customDate;}
}
///
Widget goodsTypeRecord() {
return Column(
children: [
Padding(padding:EdgeInsets.only(left:16.w,bottom: 19.h),
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 19.h),
child: Row(
children: [
Container(
@ -309,7 +622,9 @@ class _TradeGoods extends State<TradeGoods> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(width:8.w,),
SizedBox(
width: 8.w,
),
Text(
"比上周一同时段",
style: TextStyle(
@ -334,17 +649,20 @@ class _TradeGoods extends State<TradeGoods> {
children: [
Container(
color: Color(0xFFF3F7FF),
padding: EdgeInsets.only(top: 7.h,left: 11.w,right:24.w,bottom: 8.h),
padding: EdgeInsets.only(
top: 7.h, left: 11.w, right: 24.w, bottom: 8.h),
child: Row(
children: [
Expanded(child:Text(
Expanded(
child: Text(
"分类",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),),
),
),
Text(
"销售额",
style: TextStyle(
@ -356,19 +674,27 @@ class _TradeGoods extends State<TradeGoods> {
],
),
),
Container(
height: 183.h,
(goodsTypeSalesList == null || goodsTypeSalesList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Container(
height: 220.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:1,
itemCount: goodsTypeSalesList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: goodsTypeItem(),
onTap: () {},
child: goodsTypeItem(
goodsTypeSalesList[position], position),
);
},
),
@ -380,22 +706,24 @@ class _TradeGoods extends State<TradeGoods> {
);
}
Widget goodsTypeItem(){
Widget goodsTypeItem(GoodsTypeSalesList goodsTypeSalesList, int index) {
return Container(
color: Color(0xFFF9FAF8),
color: index % 2 == 0 ? Color(0xFFF9FAF8) : Colors.white,
padding: EdgeInsets.only(top: 8.h, left: 11.w, right: 24.w, bottom: 7.h),
child: Row(
children: [
Expanded(child:Text(
"招牌奶",
Expanded(
child: Text(
goodsTypeSalesList?.name ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),),
),
),
Text(
"3423",
goodsTypeSalesList?.value ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
@ -413,7 +741,8 @@ class _TradeGoods extends State<TradeGoods> {
padding: EdgeInsets.only(top: 23.h, bottom: 45.h),
child: Column(
children: [
Padding(padding:EdgeInsets.only(left:16.w,bottom: 15.h),
Padding(
padding: EdgeInsets.only(left: 16.w, bottom: 15.h),
child: Row(
children: [
Container(
@ -430,7 +759,9 @@ class _TradeGoods extends State<TradeGoods> {
color: Color(0xFF0D0D0D),
),
),
SizedBox(width:8.w,),
SizedBox(
width: 8.w,
),
Text(
"比上周一同时段",
style: TextStyle(
@ -459,23 +790,30 @@ class _TradeGoods extends State<TradeGoods> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child:Text(
Expanded(
child: Text(
"分类",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),flex: 2,),
Expanded(child:Text(
),
flex: 2,
),
Expanded(
child: Text(
"名称",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),flex: 2,),
Expanded(child:Text(
),
flex: 2,
),
Expanded(
child: Text(
"销售额",
textAlign: TextAlign.center,
style: TextStyle(
@ -483,8 +821,10 @@ class _TradeGoods extends State<TradeGoods> {
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),),
Expanded(child:Text(
),
),
Expanded(
child: Text(
"单价",
textAlign: TextAlign.center,
style: TextStyle(
@ -492,8 +832,10 @@ class _TradeGoods extends State<TradeGoods> {
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),),
Expanded(child:Text(
),
),
Expanded(
child: Text(
"销量",
textAlign: TextAlign.center,
style: TextStyle(
@ -501,23 +843,32 @@ class _TradeGoods extends State<TradeGoods> {
fontWeight: MyFontWeight.medium,
color: Color(0xFF969799),
),
),),
),
),
],
),
),
Container(
height: 203.h,
(singleSalesList == null || singleSalesList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: Container(
height: 243.h,
child: ListView.builder(
padding: EdgeInsets.zero,
itemCount:5,
itemCount: singleSalesList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
},
child: singleSalesItem(),
onTap: () {},
child: singleSalesItem(
singleSalesList[position], position),
);
},
),
@ -530,14 +881,15 @@ class _TradeGoods extends State<TradeGoods> {
);
}
Widget singleSalesItem(){
Widget singleSalesItem(SingleSalesList singleSalesList, int index) {
return Container(
color: Color(0xFFF9FAF8),
color: index % 2 == 0 ? Color(0xFFF9FAF8) : Colors.white,
padding: EdgeInsets.only(top: 8.h, left: 16.w, bottom: 7.h),
child: Row(
children: [
Expanded(child:Text(
"金贵牛肉面",
Expanded(
child: Text(
singleSalesList?.productGroupName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -545,9 +897,12 @@ class _TradeGoods extends State<TradeGoods> {
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),flex: 2,),
Expanded(child:Text(
"番茄牛肉面",
),
flex: 2,
),
Expanded(
child: Text(
singleSalesList?.productName ?? "",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@ -555,34 +910,42 @@ class _TradeGoods extends State<TradeGoods> {
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),flex: 2,),
Expanded(child:Text(
"3423",
),
flex: 2,
),
Expanded(
child: Text(
singleSalesList?.sumPrice ?? "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),),
Expanded(child:Text(
"113",
),
),
Expanded(
child: Text(
singleSalesList?.sellPrict ?? "",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),),
Expanded(child:Text(
"3423",
),
),
Expanded(
child: Text(
(singleSalesList?.saleNum ?? 0).toString(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF000000),
),
),),
),
),
],
),
);

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