|
|
|
@ -3,7 +3,6 @@ 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/utils/business_instance.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_footer.dart'; |
|
|
|
@ -19,7 +18,6 @@ import '../../retrofit/data/business_login_info.dart';
|
|
|
|
|
import '../../retrofit/data/day_count.dart'; |
|
|
|
|
import '../../utils/flutter_utils.dart'; |
|
|
|
|
import '../../utils/font_weight.dart'; |
|
|
|
|
import '../../view_widget/settlement_tips_dialog.dart'; |
|
|
|
|
|
|
|
|
|
class BusinessHomePage extends StatefulWidget { |
|
|
|
|
final BusinessLoginInfo businessLoginInfo; |
|
|
|
@ -27,8 +25,8 @@ class BusinessHomePage extends StatefulWidget {
|
|
|
|
|
final Function changeIndex; |
|
|
|
|
final Function changeTab; |
|
|
|
|
|
|
|
|
|
BusinessHomePage( |
|
|
|
|
this.businessLoginInfo, this.selectStoreIndex, this.changeIndex,this.changeTab); |
|
|
|
|
BusinessHomePage(Key key,this.businessLoginInfo, this.selectStoreIndex, |
|
|
|
|
this.changeIndex, this.changeTab): super(key: key); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
State<StatefulWidget> createState() { |
|
|
|
@ -36,8 +34,7 @@ class BusinessHomePage extends StatefulWidget {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class _BusinessHomePage extends State<BusinessHomePage> |
|
|
|
|
with AutomaticKeepAliveClientMixin { |
|
|
|
|
class _BusinessHomePage extends State<BusinessHomePage> { |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
final ScrollController scrollController = ScrollController(); |
|
|
|
|
BusinessApiService businessService; |
|
|
|
@ -48,30 +45,32 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
_onRefresh(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void dispose() { |
|
|
|
|
super.dispose(); |
|
|
|
|
refreshController.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_onRefresh({int index, isLoading = true}) async { |
|
|
|
|
if (isLoading) |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
SharedPreferences.getInstance().then((value) { |
|
|
|
|
if (!mounted) return; |
|
|
|
|
businessService = BusinessApiService(Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: BusinessInstance.instance.businessToken, |
|
|
|
|
tenant: BusinessInstance.instance.businessTenant, |
|
|
|
|
storeId: widget.businessLoginInfo |
|
|
|
|
.storeList[index ?? widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
.storeList[index ?? widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[index ?? widget.selectStoreIndex].id); |
|
|
|
|
queryDayAmount(); |
|
|
|
|
.storeList[index ?? widget.selectStoreIndex].id); |
|
|
|
|
queryDayAmount(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -106,7 +105,6 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
super.build(context); |
|
|
|
|
return Column( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
@ -140,6 +138,68 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/service_subscription_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget |
|
|
|
|
.businessLoginInfo.storeList[widget.selectStoreIndex].id |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: Container( |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
top: 20.h, bottom: 28.h, left: 20.w, right: 23.w), |
|
|
|
|
color: Color(0xFFDCE8FC), |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text.rich( |
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: "试用期到期时间:", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF252626), |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: "2024-01-02", |
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFFFF8F1F), |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 2.w), |
|
|
|
|
child: Text( |
|
|
|
|
"去购买服务", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
fontWeight: MyFontWeight.regular), |
|
|
|
|
)), |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_right_z.webp", |
|
|
|
|
width: 14.h, |
|
|
|
|
height: 14.h, |
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
)), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 76.h, |
|
|
|
|
), |
|
|
|
@ -165,10 +225,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
child: GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
showAlertDialog( |
|
|
|
|
widget.selectStoreIndex, |
|
|
|
|
widget.businessLoginInfo, |
|
|
|
|
); |
|
|
|
|
widget.changeIndex(); |
|
|
|
|
//改变导航栏状态栏颜色 |
|
|
|
|
// SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle(statusBarColor: Colors.white), ); |
|
|
|
|
// Navigator.of(context).pushNamed('/router/select_shop'); |
|
|
|
@ -407,26 +464,6 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///侧面弹窗 |
|
|
|
|
showAlertDialog( |
|
|
|
|
selectStoreIndex, |
|
|
|
|
businessLoginInfo, |
|
|
|
|
) async { |
|
|
|
|
int index = await showCupertinoModalPopup( |
|
|
|
|
builder: (context) { |
|
|
|
|
return HomeSideslipDialog(selectStoreIndex, businessLoginInfo); |
|
|
|
|
}, |
|
|
|
|
context: context); |
|
|
|
|
if (index != null) { |
|
|
|
|
if (index == -1) { |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
widget.changeIndex(index); |
|
|
|
|
_onRefresh(index: index); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///用户身份切换 |
|
|
|
|
showIdentitySwitchDialog() async { |
|
|
|
|
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); |
|
|
|
@ -488,8 +525,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
Widget commonFunctions() { |
|
|
|
|
return Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
margin: EdgeInsets.only(bottom:16.h), |
|
|
|
|
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), |
|
|
|
|
margin: EdgeInsets.only(bottom: 16.h), |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
@ -511,13 +549,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
GridView.builder( |
|
|
|
|
itemCount:commonFunctionsList.length ?? 0, |
|
|
|
|
padding: EdgeInsets.only(top:24.h), |
|
|
|
|
itemCount: commonFunctionsList.length ?? 0, |
|
|
|
|
padding: EdgeInsets.only(top: 24.h), |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
|
crossAxisCount: 4, |
|
|
|
|
crossAxisSpacing:15.w, |
|
|
|
|
crossAxisSpacing: 15.w, |
|
|
|
|
mainAxisSpacing: 12.w, |
|
|
|
|
), |
|
|
|
|
itemBuilder: (context, index) { |
|
|
|
@ -538,119 +576,144 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
commonFunctionsIndex(index) async { |
|
|
|
|
switch (index) { |
|
|
|
|
case 0: |
|
|
|
|
if ((widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id) == "0") { |
|
|
|
|
SmartDialog.show( |
|
|
|
|
widget: SettlementTips( |
|
|
|
|
() {}, |
|
|
|
|
text: "请选择门店进行收银操作", |
|
|
|
|
color: Color(0xFF30415B), |
|
|
|
|
)); |
|
|
|
|
}else{ |
|
|
|
|
if ((widget.businessLoginInfo.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget |
|
|
|
|
.businessLoginInfo.storeList[widget.selectStoreIndex].id) == |
|
|
|
|
"0") { |
|
|
|
|
widget.changeIndex(); |
|
|
|
|
} else { |
|
|
|
|
Navigator.of(context).pushNamed('/router/cashier_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget |
|
|
|
|
.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/vip_recharge_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/add_vip', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
Navigator.of(context).pushNamed('/router/add_vip', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/trade_overview_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/business_vip_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/hot_selling_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
Navigator.of(context).pushNamed('/router/hot_selling_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/flow_page', arguments: { |
|
|
|
|
Navigator.of(context).pushNamed('/router/flow_page', arguments: { |
|
|
|
|
"storeName": widget?.businessLoginInfo |
|
|
|
|
?.storeList[widget.selectStoreIndex].name ?? |
|
|
|
|
?.storeList[widget.selectStoreIndex].name ?? |
|
|
|
|
"", |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 7: |
|
|
|
|
widget.changeTab(3); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///常用功能板块 |
|
|
|
|
List<Map<String,String>> commonFunctionsList = [ |
|
|
|
|
{"image":"assets/image/bus_home_syt.webp","commonName":"收银台","imageWidth":"26","imageHeight":"23"}, |
|
|
|
|
{"image":"assets/image/bus_home_cz.webp","commonName":"充值","imageWidth":"22","imageHeight":"19"}, |
|
|
|
|
{"image":"assets/image/bus_home_bhy.webp","commonName":"办会员","imageWidth":"24","imageHeight":"21"}, |
|
|
|
|
{"image":"assets/image/bus_home_syzl.webp","commonName":"生意总览","imageWidth":"22","imageHeight":"23"}, |
|
|
|
|
{"image":"assets/image/bus_home_hygl.webp","commonName":"会员管理","imageWidth":"23","imageHeight":"25"}, |
|
|
|
|
{"image":"assets/image/bus_home_rxbd.webp","commonName":"热销榜单","imageWidth":"20","imageHeight":"26"}, |
|
|
|
|
{"image":"assets/image/bus_home_jrls.webp","commonName":"今日流水","imageWidth":"22","imageHeight":"23"}, |
|
|
|
|
{"image":"assets/image/bus_home_goods.webp","commonName":"商品","imageWidth":"21","imageHeight":"23"}, |
|
|
|
|
List<Map<String, String>> commonFunctionsList = [ |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_syt.webp", |
|
|
|
|
"commonName": "收银台", |
|
|
|
|
"imageWidth": "26", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_cz.webp", |
|
|
|
|
"commonName": "充值", |
|
|
|
|
"imageWidth": "22", |
|
|
|
|
"imageHeight": "19" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_bhy.webp", |
|
|
|
|
"commonName": "办会员", |
|
|
|
|
"imageWidth": "24", |
|
|
|
|
"imageHeight": "21" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_syzl.webp", |
|
|
|
|
"commonName": "生意总览", |
|
|
|
|
"imageWidth": "22", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_hygl.webp", |
|
|
|
|
"commonName": "会员管理", |
|
|
|
|
"imageWidth": "23", |
|
|
|
|
"imageHeight": "25" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_rxbd.webp", |
|
|
|
|
"commonName": "热销榜单", |
|
|
|
|
"imageWidth": "20", |
|
|
|
|
"imageHeight": "26" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_jrls.webp", |
|
|
|
|
"commonName": "今日流水", |
|
|
|
|
"imageWidth": "22", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_goods.webp", |
|
|
|
|
"commonName": "商品", |
|
|
|
|
"imageWidth": "21", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
///常用功能Item |
|
|
|
|
Widget commonFunctionsItem(index){ |
|
|
|
|
Widget commonFunctionsItem(index) { |
|
|
|
|
return Column( |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
@ -659,7 +722,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
height: double.tryParse(commonFunctionsList[index]["imageHeight"]).h, |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
), |
|
|
|
|
Padding(padding: EdgeInsets.only(top: 12.h), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 12.h), |
|
|
|
|
child: Text( |
|
|
|
|
commonFunctionsList[index]["commonName"], |
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
@ -677,8 +741,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
Widget homeStatistics() { |
|
|
|
|
return Container( |
|
|
|
|
color: Colors.white, |
|
|
|
|
margin: EdgeInsets.only(bottom:16.h), |
|
|
|
|
padding: EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), |
|
|
|
|
margin: EdgeInsets.only(bottom: 16.h), |
|
|
|
|
padding: |
|
|
|
|
EdgeInsets.only(left: 16.w, right: 15.w, top: 12.h, bottom: 16.h), |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
@ -700,13 +765,13 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
GridView.builder( |
|
|
|
|
itemCount:homeStatisticsList.length ?? 0, |
|
|
|
|
padding: EdgeInsets.only(top:24.h), |
|
|
|
|
itemCount: homeStatisticsList.length ?? 0, |
|
|
|
|
padding: EdgeInsets.only(top: 24.h), |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
|
crossAxisCount: 4, |
|
|
|
|
crossAxisSpacing:15.w, |
|
|
|
|
crossAxisSpacing: 15.w, |
|
|
|
|
mainAxisSpacing: 12.w, |
|
|
|
|
), |
|
|
|
|
itemBuilder: (context, index) { |
|
|
|
@ -729,89 +794,113 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
case 0: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/trade_overview_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 1: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/business_vip_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index":2 |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index": 2 |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/business_vip_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index":1 |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index": 1 |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/consumer_ranking_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"titleName":"会员余额统计" |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"titleName": "会员余额统计" |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/consumer_ranking_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"titleName":"消费排名" |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"titleName": "消费排名" |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/trade_overview_page', arguments: { |
|
|
|
|
"storeId": widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].name == |
|
|
|
|
"所有门店" |
|
|
|
|
"storeId": widget.businessLoginInfo.storeList[widget.selectStoreIndex] |
|
|
|
|
.name == |
|
|
|
|
"所有门店" |
|
|
|
|
? "0" |
|
|
|
|
: widget.businessLoginInfo |
|
|
|
|
.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index":2 |
|
|
|
|
: widget.businessLoginInfo.storeList[widget.selectStoreIndex].id, |
|
|
|
|
"index": 2 |
|
|
|
|
}); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///统计板块 |
|
|
|
|
List<Map<String,String>> homeStatisticsList = [ |
|
|
|
|
{"image":"assets/image/bus_home_yytj.webp","commonName":"营业统计","imageWidth":"21","imageHeight":"20"}, |
|
|
|
|
{"image":"assets/image/bus_home_xfjl.webp","commonName":"消费记录","imageWidth":"22","imageHeight":"21"}, |
|
|
|
|
{"image":"assets/image/bus_home_czjl.webp","commonName":"充值记录","imageWidth":"19","imageHeight":"22"}, |
|
|
|
|
{"image":"assets/image/bus_home_hyyetj.webp","commonName":"会员余额统计","imageWidth":"23","imageHeight":"23"}, |
|
|
|
|
{"image":"assets/image/bus_home_xfpm.webp","commonName":"消费排名","imageWidth":"26","imageHeight":"22"}, |
|
|
|
|
{"image":"assets/image/bus_home_goods_ssfx.webp","commonName":"商品销售分析","imageWidth":"26","imageHeight":"23"}, |
|
|
|
|
List<Map<String, String>> homeStatisticsList = [ |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_yytj.webp", |
|
|
|
|
"commonName": "营业统计", |
|
|
|
|
"imageWidth": "21", |
|
|
|
|
"imageHeight": "20" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_xfjl.webp", |
|
|
|
|
"commonName": "消费记录", |
|
|
|
|
"imageWidth": "22", |
|
|
|
|
"imageHeight": "21" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_czjl.webp", |
|
|
|
|
"commonName": "充值记录", |
|
|
|
|
"imageWidth": "19", |
|
|
|
|
"imageHeight": "22" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_hyyetj.webp", |
|
|
|
|
"commonName": "会员余额统计", |
|
|
|
|
"imageWidth": "23", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_xfpm.webp", |
|
|
|
|
"commonName": "消费排名", |
|
|
|
|
"imageWidth": "26", |
|
|
|
|
"imageHeight": "22" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"image": "assets/image/bus_home_goods_ssfx.webp", |
|
|
|
|
"commonName": "商品销售分析", |
|
|
|
|
"imageWidth": "26", |
|
|
|
|
"imageHeight": "23" |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
///统计Item |
|
|
|
|
Widget homeStatisticsItem(index){ |
|
|
|
|
Widget homeStatisticsItem(index) { |
|
|
|
|
return Column( |
|
|
|
|
children: [ |
|
|
|
|
Image.asset( |
|
|
|
@ -820,7 +909,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
height: double.tryParse(homeStatisticsList[index]["imageHeight"]).h, |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
), |
|
|
|
|
Padding(padding: EdgeInsets.only(top: 12.h), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 12.h), |
|
|
|
|
child: Text( |
|
|
|
|
homeStatisticsList[index]["commonName"], |
|
|
|
|
textAlign: TextAlign.center, |
|
|
|
@ -833,7 +923,4 @@ class _BusinessHomePage extends State<BusinessHomePage>
|
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
bool get wantKeepAlive => true; |
|
|
|
|
} |
|
|
|
|