|
|
@ -51,7 +51,6 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
List<OrderTrend> orderTrend = []; |
|
|
|
List<OrderTrend> orderTrend = []; |
|
|
|
VipCountsInfo vipCountsInfo; |
|
|
|
VipCountsInfo vipCountsInfo; |
|
|
|
int daySelectIndex = 0; |
|
|
|
int daySelectIndex = 0; |
|
|
|
String offsetDay; |
|
|
|
|
|
|
|
List<DayFlowList> dayFlowList = []; |
|
|
|
List<DayFlowList> dayFlowList = []; |
|
|
|
List<LineChartSample2Data> lineChartSample2Data = [ |
|
|
|
List<LineChartSample2Data> lineChartSample2Data = [ |
|
|
|
LineChartSample2Data(0, 0, "2023-03-09"), |
|
|
|
LineChartSample2Data(0, 0, "2023-03-09"), |
|
|
@ -88,7 +87,7 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
? "0" |
|
|
|
? "0" |
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id); |
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id); |
|
|
|
queryDayAmount(); |
|
|
|
queryDayAmount(); |
|
|
|
queryPopularList(offsetDay); |
|
|
|
queryPopularList(isSing: false); |
|
|
|
queryOrderTrend(); |
|
|
|
queryOrderTrend(); |
|
|
|
queryVipCounts(); |
|
|
|
queryVipCounts(); |
|
|
|
queryDayFlow(); |
|
|
|
queryDayFlow(); |
|
|
@ -123,16 +122,25 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///热销榜单 |
|
|
|
///热销榜单 |
|
|
|
queryPopularList(offsetDay) async { |
|
|
|
queryPopularList({isSing = true}) async { |
|
|
|
try { |
|
|
|
try { |
|
|
|
BaseData<PopularSalesList> baseData = |
|
|
|
if (isSing) |
|
|
|
await businessService.popularList(offsetDay).catchError((error) {}); |
|
|
|
EasyLoading.show( |
|
|
|
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
|
|
|
BaseData<PopularSalesList> baseData = await businessService |
|
|
|
|
|
|
|
.popularList(daySelectIndex.toString()) |
|
|
|
|
|
|
|
.catchError((error) {}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
popularSalesList = baseData.data; |
|
|
|
popularSalesList = baseData.data; |
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
addLoadCount(); |
|
|
|
if (isSing) { |
|
|
|
|
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
addLoadCount(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -144,7 +152,7 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
double index = 0; |
|
|
|
double index = 0; |
|
|
|
if (baseData.data.isNotEmpty) { |
|
|
|
if (baseData.data.isNotEmpty) { |
|
|
|
orderTrend.clear(); |
|
|
|
lineChartSample2Data.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
orderTrend = baseData.data; |
|
|
|
orderTrend = baseData.data; |
|
|
|
orderTrend.forEach((element) { |
|
|
|
orderTrend.forEach((element) { |
|
|
@ -176,14 +184,10 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
queryDayFlow() async { |
|
|
|
queryDayFlow() async { |
|
|
|
try { |
|
|
|
try { |
|
|
|
BaseData<List<DayFlowList>> baseData = await businessService |
|
|
|
BaseData<List<DayFlowList>> baseData = await businessService |
|
|
|
.dayFlow( |
|
|
|
.dayFlow(DateFormat("yyyy-MM-dd").format(DateTime.now()), "1") |
|
|
|
// "${DateFormat("yyyy-MM-dd").format(DateTime.now())}", |
|
|
|
|
|
|
|
"2023-09-04", |
|
|
|
|
|
|
|
"1") |
|
|
|
|
|
|
|
.catchError((error) {}); |
|
|
|
.catchError((error) {}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
dayFlowList = baseData.data; |
|
|
|
dayFlowList = baseData.data; |
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
addLoadCount(); |
|
|
|
addLoadCount(); |
|
|
@ -559,16 +563,17 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
height: 18.h, |
|
|
|
height: 18.h, |
|
|
|
), |
|
|
|
), |
|
|
|
// if (lineChartSample2Data.isNotEmpty) |
|
|
|
if (lineChartSample2Data.isNotEmpty) |
|
|
|
(lineChartSample2Data.isNotEmpty) |
|
|
|
// (lineChartSample2Data.isNotEmpty) |
|
|
|
? NoDataView( |
|
|
|
// ? NoDataView( |
|
|
|
src: "assets/image/xiao_fei.webp", |
|
|
|
// src: "assets/image/xiao_fei.webp", |
|
|
|
isShowBtn: false, |
|
|
|
// isShowBtn: false, |
|
|
|
text: "暂无数据", |
|
|
|
// text: "暂无数据", |
|
|
|
fontSize: 16.sp, |
|
|
|
// fontSize: 16.sp, |
|
|
|
margin: EdgeInsets.all(20.h), |
|
|
|
// margin: EdgeInsets.all(20.h), |
|
|
|
) |
|
|
|
// ) |
|
|
|
: LineChartSample2(lineChartSample2Data, "销售量"), |
|
|
|
// : |
|
|
|
|
|
|
|
LineChartSample2(lineChartSample2Data, "销售量"), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
@ -868,10 +873,8 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
GestureDetector( |
|
|
|
GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
daySelectIndex = 0; |
|
|
|
daySelectIndex = 0; |
|
|
|
queryPopularList(); |
|
|
|
queryPopularList("0"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
|
padding: |
|
|
|
padding: |
|
|
@ -905,7 +908,7 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
daySelectIndex = 1; |
|
|
|
daySelectIndex = 1; |
|
|
|
queryPopularList("1"); |
|
|
|
queryPopularList(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
@ -939,7 +942,7 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
daySelectIndex = 2; |
|
|
|
daySelectIndex = 2; |
|
|
|
queryPopularList("7"); |
|
|
|
queryPopularList(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
@ -973,7 +976,7 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
daySelectIndex = 3; |
|
|
|
daySelectIndex = 3; |
|
|
|
queryPopularList("30"); |
|
|
|
queryPopularList(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Container( |
|
|
|
child: Container( |
|
|
@ -1130,18 +1133,18 @@ class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
GestureDetector( |
|
|
|
GestureDetector( |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
Navigator.of(context).pushNamed('/router/flow_page', |
|
|
|
Navigator.of(context) |
|
|
|
arguments: { |
|
|
|
.pushNamed('/router/flow_page', arguments: { |
|
|
|
"storeName": widget?.businessLoginInfo |
|
|
|
"storeName": widget?.businessLoginInfo |
|
|
|
?.storeList[widget.selectStoreIndex].name ?? |
|
|
|
?.storeList[widget.selectStoreIndex].name ?? |
|
|
|
"", |
|
|
|
"", |
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
"所有门店" |
|
|
|
"所有门店" |
|
|
|
? "0" |
|
|
|
? "0" |
|
|
|
: widget.businessLoginInfo |
|
|
|
: widget.businessLoginInfo |
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Row( |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|