Commit 3092868fd847dd81cebc2b0fac7e8a3fcf650b9d

Authored by weixin_45529955
1 parent 53563bd3

部分UI

... ... @@ -199,6 +199,11 @@ class Constant {
'管理员',
'店长',
],
'生成二维码': [
'管理员',
'店长',
],
'删除排菜': [
'管理员',
'店长',
... ...
... ... @@ -57,7 +57,7 @@ class _CustomerHomePageState extends State<CustomerHomePage> {
return Scaffold(
backgroundColor: Colors.white,
appBar: SystemAppBar(
'菜单管理',
'客户管理',
),
body: Column(
children: [
... ... @@ -75,12 +75,12 @@ class _CustomerHomePageState extends State<CustomerHomePage> {
if (widget.sellerPreserve ||
widget.sellerMarketing) {
NavigatorUtil.goStoreCustomerPage(context);
NavigatorUtil.goCustomerStatisticsPage(context);
} else {
NavigatorUtil.goCustomerListPageSim(context);
}
} else {
NavigatorUtil.goStoreCustomerPage(context);
NavigatorUtil.goCustomerStatisticsPage(context);
}
}
} else {
... ... @@ -132,7 +132,7 @@ class _CustomerHomePageState extends State<CustomerHomePage> {
VEmptyView(24),
InkWell(
onTap: () {
if (userModel.user?.role_name == '管理员' ||
if (userModel.user?.role_name == '管理员' ||
userModel.user?.role_name == '店长') {
if (Utils.getAuthority(context, '全店客情')) {
if (widget.sellerNormalSpecial) {
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/provider/customer_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../provider/collect_store_provider.dart';
/**
*
* 客户汇总/全店页面
*
*/
class CustomerStatisticsLeftPage extends StatefulWidget {
final CustomerProvider? customerProvider;
const CustomerStatisticsLeftPage({super.key, this.customerProvider});
@override
State<CustomerStatisticsLeftPage> createState() =>
_CustomerStatisticsLeftPageState();
}
class _CustomerStatisticsLeftPageState
extends State<CustomerStatisticsLeftPage> {
ScrollController _controller = ScrollController();
late CollectStoreProvider collectStoreProvider;
Widget _columnItem(
String btnTitle,
String sum,
String currunt,
) {
Color btnColor = btnTitle == '活跃'
? MyColours.color_00715F
: btnTitle == '沉睡'
? MyColours.color_E89243
: MyColours.color_C80010;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RoundButton(
text: btnTitle,
gradientStart: btnColor,
gradientEnd: btnColor,
width: w(30),
height: w(18),
radius: r(5),
fontSize: 20,
),
VEmptyView(20),
Text(
'${sum}位',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
fontWeight: FontWeight.bold),
),
VEmptyView(20),
Row(
children: [
Text(
'本月新增',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
fontWeight: FontWeight.bold),
),
Text(
'${currunt}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(14),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
fontWeight: FontWeight.bold),
)
],
)
],
);
}
Widget _item(String title, String titleSum) {
return Container(
padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(13)),
color: MyColours.color_ffffff,
child: Column(
children: [
Row(
children: [
Text(title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16),
fontWeight: FontWeight.bold)),
Spacer(),
Text(titleSum,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(24),
fontWeight: FontWeight.bold)),
Text('位',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
)),
],
),
VEmptyView(26),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_columnItem('活跃', '1600', '500'),
_columnItem('沉睡', '2000', '50'),
_columnItem('流失', '160', '30')
],
),
VEmptyView(10),
],
),
);
}
@override
Widget build(BuildContext context) {
collectStoreProvider =
Provider.of<CollectStoreProvider>(context, listen: true);
return Scaffold(
body: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateStoreHome != PageState.Success) {
if (model.pageStateStoreHome == PageState.Loading) {
return SingleChildScrollView(
controller: _controller,
child: Stack(alignment: Alignment.center, children: [
Column(children: [
VEmptyView(10),
// Stack(
// children: [
Container(
height: w(80),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'累计',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
),
Text(
'',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位客户',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
),
VEmptyView(10),
// Row(
// children: [
// _percentWidget('', '活跃', '', tap: false),
// HEmptyView(10),
// _percentWidget('', '60天未预订', '', tap: false),
// HEmptyView(10),
// _percentWidget('', '120天未预订', '', tap: false),
// ],
// ),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 6,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1.05,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// return _managerWidget('', '', null, '',
// uid: '', onTap: () {});
// })
]),
Align(
alignment: Alignment.center,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Container(
width: 200,
height: 200,
color: Colors.transparent,
child: CupertinoActivityIndicator(
color: MyColours.color_000000,
radius: 30,
),
))
// VEmptyView(30),
// Text(
// '加载中,请稍候...',
// style: TextStyle(
// color: MyColours.color_666666,
// fontSize: ScreenUtil().setSp(24)),
// )
],
),
))
]));
}
return ExceptionPage(
pageState: model.pageStateStoreHome,
callback: () {
// getTableList();
// _getSellerGuestManage();
// _getSellerCountsList();
},
emptyMsg: "暂时没有全店客情哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍候...",
);
} else {
return Column(children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
children: [
if (widget.customerProvider!.storeSunmodel != null)
Column(
children: [
// VEmptyView(10),
// Stack(
// children: [
InkWell(
onTap: () {
NavigatorUtil.goCustomerListPage(
context,
FromPage.FromPageHome,
'',
{
'object': widget
.customerProvider!.storeSunmodel!.sellerUser
},
);
},
child: Container(
height: w(105),
color: MyColours.color_ffffff,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${widget.customerProvider!.storeSunmodel!.myCustomer}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(64),
fontWeight: FontWeight.bold),
),
Text(
'位',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
)
],
),
)),
// Positioned(
// top: ScreenUtil().setWidth(30),
// right: ScreenUtil().setWidth(40),
// child: InkWell(
// onTap: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
// child: Image.asset(Utils.getImgPath('c_set'),
// width: ScreenUtil().setWidth(40))))
// ],
// ),
VEmptyView(10),
_item('预订客户', '2000'),
VEmptyView(10),
_item('支付客户', '1800'),
VEmptyView(10),
_item('充值客户', '3000'),
VEmptyView(10),
_item('充值客户', '5000'),
// Row(
// children: [
// _percentWidget(
// '${widget.customerProvider!.storeSunmodel!.active!.count}',
// '活跃',
// '${widget.customerProvider!.storeSunmodel!.active!.scale}'),
// HEmptyView(10),
// _percentWidget(
// '${widget.customerProvider!.storeSunmodel!.sleep!.count}',
// '60天未预订',
// '${widget.customerProvider!.storeSunmodel!.sleep!.scale}'),
// HEmptyView(10),
// _percentWidget(
// '${widget.customerProvider!.storeSunmodel!.drain!.count}',
// '120天未预订',
// '${widget.customerProvider!.storeSunmodel!.drain!.scale}'),
// ],
// ),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: 3,
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// return _percentWidget('1999', '活跃客户', '39.20');
// }),
// Row(
// children: [
// _percentWidget('19992', '活跃客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '沉睡客户', '90.90'),
// HEmptyView(10),
// _percentWidget('19992', '流失客户', '5.90'),
// ],
// ),
// Padding(
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(30)),
// child: Text(
// '客户经理',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_333333),
// ),
// ),
VEmptyView(10),
// GridView.builder(
// controller: _controller,
// shrinkWrap: true,
// cacheExtent: ScreenUtil().setWidth(0),
// itemCount: widget.customerProvider!.storeSunmodel!
// .sellerUser!.length +
// 1,
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: 1.05,
// mainAxisSpacing: ScreenUtil().setWidth(10),
// crossAxisSpacing: ScreenUtil().setWidth(10)),
// itemBuilder: (BuildContext context, int index) {
// // locationState = state;
// if (index == 0) {
// return _managerWidget(
// '${widget.customerProvider!.storeSunmodel!.distribution}',
// '未分配经理',
// null,
// '${widget.customerProvider!.storeSunmodel!.distributionStr}',
// onTap: () {
// NavigatorUtil.goCustomerListPage(
// context,
// FromPage.FromPageHome,
// '',
// {
// 'object': widget.customerProvider!
// .storeSunmodel!.sellerUser
// },
// index: '0',
// distribution: true);
// });
// }
// return _managerWidget(
// '${widget.customerProvider!.storeSunmodel!.sellerUser![index - 1]!.count}',
// widget.customerProvider!.storeSunmodel!
// .sellerUser![index - 1]!.account ==
// null
// ? ''
// : '${widget.customerProvider!.storeSunmodel!.sellerUser![index - 1]!.nickName ?? widget.customerProvider!.storeSunmodel!.sellerUser![index - 1]!.account}',
// null,
// '${widget.customerProvider!.storeSunmodel!.sellerUser![index - 1]!.detailStr}',
// uid: widget.customerProvider!.storeSunmodel!
// .sellerUser![index - 1]!.uid, onTap: () {
// NavigatorUtil.goCustomerListPage(
// context,
// FromPage.FromPageHome,
// widget.customerProvider!.storeSunmodel!
// .sellerUser![index - 1]!.uid,
// {
// 'object': widget.customerProvider!
// .storeSunmodel!.sellerUser
// },
// index: '0',
// );
// });
// }),
],
),
VEmptyView(10),
// ListView.builder(
// shrinkWrap: true,
// controller: _controller,
// itemCount: 2,
// itemBuilder: (context, index) {
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: w(12), horizontal: w(16)),
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// border: Border(
// bottom: BorderSide(
// color: index == 2 - 1
// ? MyColours.color_ffffff
// : MyColours.color_E7E7E7,
// width: w(1)))),
// child: Row(
// children: [
// Expanded(
// child: Text(
// '7天内存酒超期:5位/7天内纪念日提醒:3位',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_515151),
// )),
// Text(
// '创建营销计划',
// style: TextStyle(
// fontSize: font(16),
// color: MyColours.color_999999),
// ),
// HEmptyView(20),
// Image.asset(
// Utils.getImgPath('arrow_right_new'),
// width: w(12),
// )
// ],
// ),
// );
// }),
// if (widget.customerProvider!.homeStatisticsList != null &&
// widget.customerProvider!.homeStatisticsList!.length > 0)
// Column(
// children: [
// _chart(),
// // _monthWidget(),
// ListView.builder(
// itemCount: widget
// .customerProvider!.homeStatisticsList!.length,
// shrinkWrap: true,
// controller: _controller,
// padding: EdgeInsets.symmetric(horizontal: w(10)),
// itemBuilder: (context, index) {
// SellerCountsListSunModel countsListSunModel = widget
// .customerProvider!.homeStatisticsList![index];
// return InkWell(
// onTap: () {
// NavigatorUtil.goMonthOrderPage(
// context,
// year.toString(),
// countsListSunModel.monthss.toString());
// },
// child: MonthItem(
// countsListSunModel: countsListSunModel));
// }),
// ],
// )
/**
ListView.builder(
itemCount: 10,
controller: _controller,
shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(bottom: w(10)),
padding: EdgeInsets.symmetric(horizontal: w(10)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topRight: Radius.circular(r(8)),
bottomRight: Radius.circular(r(8))),
),
child: Row(
children: [
Container(
width: w(122),
padding: EdgeInsets.symmetric(vertical: w(5)),
decoration: BoxDecoration(
border: Border(
right: BorderSide(
color: MyColours.color_f3f3f3,
width: w(1)))),
child: Column(
children: [
VEmptyView(24),
Align(
alignment: Alignment.centerLeft,
child: Container(
padding: EdgeInsets.symmetric(
vertical: w(4), horizontal: w(5)),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(r(3)),
border: Border.all(
color: MyColours.color_999999,
width: w(1))),
child: Text(
'张珊珊',
style: TextStyle(
fontSize: font(12),
fontWeight: FontWeight.bold,
color: MyColours.color_999999),
),
),
),
VEmptyView(10),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
'34',
style: TextStyle(
fontSize: font(24),
fontWeight: FontWeight.bold,
color: MyColours.color_438E93),
),
Text(
'位',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_000000),
),
],
),
VEmptyView(10),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
'23',
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_438E93),
),
MyDivider(
w(4),
w(1),
color: MyColours.color_999999,
),
Text(
'9',
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_E89243),
),
MyDivider(
w(4),
w(1),
color: MyColours.color_999999,
),
Text(
'2',
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_E34D59),
),
],
),
VEmptyView(24),
],
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
top: w(5), bottom: w(5), left: w(10)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'预订',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: font(
(12),
)),
),
HEmptyView(10),
Text(
'1089单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
],
),
VEmptyView(10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'到店',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: font(
(12),
)),
),
HEmptyView(10),
Text(
'1089单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
],
),
VEmptyView(10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'1089人',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190取消',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'到客90.1%',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(10),
)),
),
],
),
VEmptyView(10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'有金额订单数 25',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'总消费 25800元',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
],
),
VEmptyView(10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'人均 103.2元',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'桌均 860元',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
],
),
VEmptyView(10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'存酒 1位',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'提前点餐 9位',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'安排菜 9位',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(
(10),
)),
),
],
),
],
),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: w(12),
)
],
),
))
],
),
);
})
*/
],
),
)),
if (widget.customerProvider!.storeSunmodel != null)
Container(
color: MyColours.color_FAFAFA,
padding: EdgeInsets.only(
top: w(13), bottom: w(26), left: w(19), right: (19)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: RoundButton(
onPressed: () {
if (!collectStoreProvider.sellerPreserve) {
//没有购买客情维护模块
//提示购买
DialogUtil.showSellerVersionBuyDialog(
context, '客情维护', (v) {});
return;
}
NavigatorUtil.goExportBookDataPage(
context,
);
},
text: '预订数据导出',
fontSize: 32,
isBold: true,
// margin: EdgeInsets.only(
// top: w(13),
// bottom: w(26),
// left: w(45),
// right: (45)),
textColor: MyColours.color_199095,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_199095,
height: ScreenUtil().setWidth(86),
width: ScreenUtil().setWidth(333),
radius: ScreenUtil().setWidth(10),
)),
],
))
]);
}
}));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/my/customer_type/customer_statistics_left_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/store_customer_home_left_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/store_customer_home_right_page.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import '../../../../models/store_customer_home_model.dart';
import '../../../../provider/collect_store_provider.dart';
import '../../../../provider/customer_provider.dart';
import '../../../../res/colors.dart';
import '../../../../route/navigator_util.dart';
import '../../../../utils/event_bus.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/v_empty_view.dart';
/***
* 全店客户汇总首页
*/
class CustomerStatisticsPage extends StatefulWidget {
CustomerStatisticsPage({Key? key}) : super(key: key);
@override
_CustomerStatisticsPageState createState() => _CustomerStatisticsPageState();
}
class _CustomerStatisticsPageState extends State<CustomerStatisticsPage>
with TickerProviderStateMixin {
TabController? tabController;
Color selectedColor = MyColours.color_ffffff;
Color unSelectedColor = MyColours.color_BFC4D4;
CustomerProvider? customerProvider;
@override
void initState() {
// TODO: implement initState
super.initState();
tabController = TabController(length: 2, vsync: this);
tabController!.addListener(() {
//点击tab时或滑动tab回调一次
// if (tabController.index.toDouble() == tabController.animation.value) {
// getMessage(index: tabController.index);
// selectIndex = tabController.index;
// setState(() {});
// }
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_getSellerGuestManage();
});
}
@override
void dispose() {
EventBus().emit('changeStatusColor');
super.dispose();
}
///全店客情首页
_getSellerGuestManage() async {
StoreCustomerHomeSunModel? model =
await customerProvider!.getSellerGuestManage(context);
// setState(() {});
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: false);
return Scaffold(
appBar: SystemAppBar(
'客户汇总',
// rightImgName: 'c_set.png',
// onTapRight: () {
// NavigatorUtil.goCustomerSetPage(context);
// },
),
body: Column(
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
color: MyColours.color_ffffff,
padding: EdgeInsets.only(bottom: w(9), top: w(9)),
child: TabBar(
onTap: (index) {
print(index);
},
controller: tabController,
isScrollable: true,
indicatorColor: MyColours.color_438E93,
indicatorSize: TabBarIndicatorSize.tab,
indicatorWeight: w(2),
unselectedLabelColor: MyColours.color_999999,
labelColor: MyColours.color_438E93,
labelStyle: TextStyle(
fontSize: w(14),
color: MyColours.color_438E93,
fontWeight: FontWeight.bold),
unselectedLabelStyle:
TextStyle(fontSize: w(12), color: MyColours.color_999999),
indicatorPadding: EdgeInsets.only(left: w(24), right: w(24)),
// labelPadding:
// EdgeInsets.symmetric(horizontal: w(32)), //tabs控件之间的间距
tabs: [
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'全店',
),
)),
Tab(
height: w(30),
child: Container(
width: w(100),
alignment: Alignment.center,
child: Text(
'分经理',
)),
),
],
// indicatorPadding: EdgeInsets.only(
// left: ScreenUtil().setWidth(16),
// right: ScreenUtil().setWidth(32)),
// indicatorWeight: ScreenUtil().setWidth(6.0),
)),
Expanded(
child: TabBarView(controller: tabController, children: [
ChangeNotifierProvider<CollectStoreProvider>(
create: (_) => CollectStoreProvider(),
child: CustomerStatisticsLeftPage(
customerProvider: customerProvider,
)),
StoreCustomerHomeRightPage(customerProvider: customerProvider)
]),
),
],
));
}
}
... ...
import 'package:flutter/material.dart';
/**
* 余额明细页面
*/
class BalanceDetailsPage extends StatefulWidget {
const BalanceDetailsPage({super.key});
@override
State<BalanceDetailsPage> createState() => _BalanceDetailsPageState();
}
class _BalanceDetailsPageState extends State<BalanceDetailsPage> {
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}
... ...
... ... @@ -316,268 +316,270 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
left: w(20), right: w(20 + 72), bottom: w(12), top: w(12)),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(
children: [
Container(
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(260)),
child: Text(
customerProvider.guestInfoSunModel!.guest!.rnameStr!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(36)),
)),
HEmptyView(10),
Container(
child: Text(
customerProvider.guestInfoSunModel!.guest!.sexStr != ''
? '${customerProvider.guestInfoSunModel!.guest!.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
)),
HEmptyView(6),
Text(
customerProvider.guestInfoSunModel!.guest!.phone!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
)
],
),
VEmptyView(20),
Wrap(
runSpacing: w(10),
spacing: w(10),
children: labelsWidget(),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// if (customerProvider.guestInfoSunModel.guest.attr != null &&
// customerProvider.guestInfoSunModel.guest.attr != '')
// Container(
// width: w(30),
// height: w(16),
// alignment: Alignment.center,
// // padding: EdgeInsets.symmetric(
// // horizontal: ScreenUtil().setWidth(10),
// // vertical: ScreenUtil().setWidth(2),
// // ),
// decoration: BoxDecoration(
// color: customerProvider
// .guestInfoSunModel.guest.attr !=
// null &&
// customerProvider
// .guestInfoSunModel.guest.attr !=
// ''
// ? customerProvider
// .guestInfoSunModel.guest.attr ==
// '沉睡'
// ? MyColours.color_999999
// : customerProvider
// .guestInfoSunModel.guest.attr ==
// '活跃'
// ? MyColours.color_00715F
// : customerProvider.guestInfoSunModel
// .guest.attr ==
// '流失'
// ? MyColours.color_E34D59
// : Color.fromRGBO(239, 143, 49, 1)
// : Colors.transparent,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10),
// ),
// ),
// child: Text(
// customerProvider.guestInfoSunModel.guest.attr,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(20)))),
// if (customerProvider.guestInfoSunModel.guest.label != null)
// flatBtn(customerProvider.guestInfoSunModel.guest.label,
// MyColours.color_B39437),
// if (customerProvider.guestInfoSunModel.guest.isMember ==
// '1' ||
// customerProvider.guestInfoSunModel.guest.isMember ==
// '0')
// flatBtn(
// customerProvider.guestInfoSunModel.guest.isMember ==
// '1'
// ? '会员'
// : '非会员',
// MyColours.color_438E93),
// if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
// '0')
// flatBtn(
// '存酒${customerProvider.guestInfoSunModel.store.storeDay}天',
// MyColours.color_438E93)
// ],
// ),
VEmptyView(20),
Text(
customerProvider.guestInfoSunModel!.guest!.nickName == null
? '经理:未指派'
: '经理:${customerProvider.guestInfoSunModel!.guest!.nickName}',
style: TextStyle(
Row(
children: [
Container(
constraints:
BoxConstraints(maxWidth: ScreenUtil().setWidth(260)),
child: Text(
customerProvider.guestInfoSunModel!.guest!.rnameStr!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(36)),
)),
HEmptyView(10),
Container(
child: Text(
customerProvider.guestInfoSunModel!.guest!.sexStr != ''
? '${customerProvider.guestInfoSunModel!.guest!.sexStr}'
: '',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
VEmptyView(20),
Row(
children: [
Text(
'已创建 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.createTime}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 天 | 累计 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.leiji}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 单 | 取消 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.quxiao}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 单',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
],
),
VEmptyView(20),
Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text(
customerProvider.guestInfoSunModel!.last?.ddate == null
? ''
: Utils.formatFromMill(
customerProvider.guestInfoSunModel!.last?.ddate ??
''),
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_E34D59),
),
Text(
customerProvider.guestInfoSunModel!.last?.ddateSoltStr ??
'',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
Text(
' 桌位',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel!.last!.tableinfoName,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
),
Text(
' 人数',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel!.last!.actualPum ==
null
? '未记录'
: customerProvider
.guestInfoSunModel!.last!.actualPum!,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
)),
HEmptyView(6),
Text(
customerProvider.guestInfoSunModel!.guest!.phone!,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(20),
),
Text(
' 消费',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
)
],
),
VEmptyView(20),
Wrap(
runSpacing: w(10),
spacing: w(10),
children: labelsWidgetNew(),
),
VEmptyView(20),
Wrap(
runSpacing: w(10),
spacing: w(10),
children: labelsWidget(),
),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// if (customerProvider.guestInfoSunModel.guest.attr != null &&
// customerProvider.guestInfoSunModel.guest.attr != '')
// Container(
// width: w(30),
// height: w(16),
// alignment: Alignment.center,
// // padding: EdgeInsets.symmetric(
// // horizontal: ScreenUtil().setWidth(10),
// // vertical: ScreenUtil().setWidth(2),
// // ),
// decoration: BoxDecoration(
// color: customerProvider
// .guestInfoSunModel.guest.attr !=
// null &&
// customerProvider
// .guestInfoSunModel.guest.attr !=
// ''
// ? customerProvider
// .guestInfoSunModel.guest.attr ==
// '沉睡'
// ? MyColours.color_999999
// : customerProvider
// .guestInfoSunModel.guest.attr ==
// '活跃'
// ? MyColours.color_00715F
// : customerProvider.guestInfoSunModel
// .guest.attr ==
// '流失'
// ? MyColours.color_E34D59
// : Color.fromRGBO(239, 143, 49, 1)
// : Colors.transparent,
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10),
// ),
// ),
// child: Text(
// customerProvider.guestInfoSunModel.guest.attr,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(20)))),
// if (customerProvider.guestInfoSunModel.guest.label != null)
// flatBtn(customerProvider.guestInfoSunModel.guest.label,
// MyColours.color_B39437),
// if (customerProvider.guestInfoSunModel.guest.isMember ==
// '1' ||
// customerProvider.guestInfoSunModel.guest.isMember ==
// '0')
// flatBtn(
// customerProvider.guestInfoSunModel.guest.isMember ==
// '1'
// ? '会员'
// : '非会员',
// MyColours.color_438E93),
// if ('${customerProvider.guestInfoSunModel.store.storeDay}' !=
// '0')
// flatBtn(
// '存酒${customerProvider.guestInfoSunModel.store.storeDay}天',
// MyColours.color_438E93)
// ],
// ),
VEmptyView(20),
Text(
customerProvider.guestInfoSunModel!.guest!.nickName == null
? '经理:未指派'
: '经理:${customerProvider.guestInfoSunModel!.guest!.nickName}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
VEmptyView(20),
Row(
children: [
Text(
'已创建 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.createTime}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
Text(
customerProvider.guestInfoSunModel!.last!.conAmount ==
null ||
customerProvider
.guestInfoSunModel!.last!.conAmount ==
0
? '未记录'
: '${customerProvider.guestInfoSunModel!.last!.conAmount}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 天 | 累计 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.leiji}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
Text(
' 预订',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 单 | 取消 ',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
Text(
'${customerProvider.guestInfoSunModel!.count!.quxiao}',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(24),
),
Text(
'${customerProvider.guestInfoSunModel!.last!.sellerUserNickName ?? ''} ${customerProvider.guestInfoSunModel!.last!.sellerUserPhone ?? ''}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
)
],
),
]),
strutStyle: StrutStyle(
forceStrutHeight: true, height: 1, leading: 0.3),
),
Text(
' 单',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
),
],
),
VEmptyView(20),
Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text(
customerProvider.guestInfoSunModel!.last?.ddate == null
? ''
: Utils.formatFromMill(
customerProvider.guestInfoSunModel!.last?.ddate ??
''),
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_E34D59),
),
Text(
customerProvider.guestInfoSunModel!.last?.ddateSoltStr ??
'',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
),
Text(
' 桌位',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel!.last!.tableinfoName,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
),
Text(
' 人数',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel!.last!.actualPum == null
? '未记录'
: customerProvider.guestInfoSunModel!.last!.actualPum!,
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
),
Text(
' 消费',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
customerProvider.guestInfoSunModel!.last!.conAmount ==
null ||
customerProvider
.guestInfoSunModel!.last!.conAmount ==
0
? '未记录'
: '${customerProvider.guestInfoSunModel!.last!.conAmount}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
),
Text(
' 预订',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_515151),
),
Text(
'${customerProvider.guestInfoSunModel!.last!.sellerUserNickName ?? ''} ${customerProvider.guestInfoSunModel!.last!.sellerUserPhone ?? ''}',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: MyColours.color_438E93),
)
],
),
],
),
),
... ... @@ -586,6 +588,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
child: Column(
children: [
RoundButton(
text: '消费记录',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
width: w(72),
radius: r(11),
fontSize: 24,
isBold: true,
height: w(22),
onPressed: () {
// NavigatorUtil.goCustomerDetailEditPage(
// context,
// customerProvider.guestInfoSunModel!.guest,
// widget.fromPage);
},
),
VEmptyView(20),
RoundButton(
text: '编辑',
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
... ... @@ -683,6 +704,64 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
);
}
List<Widget> labelsWidgetNew() {
List<Widget> data = [];
data.add(InkWell(
onTap: () {
NavigatorUtil.goBalanceDetailsPage(context);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4),
),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text('余额¥5200',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))))));
data.add(Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4),
),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text('消费金¥3000',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20)))));
data.add(Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10),
vertical: ScreenUtil().setWidth(4),
),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10),
),
),
child: Text('积分900',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20)))));
return data;
}
List<Widget> labelsWidget() {
List<Widget> data = [];
... ...
... ... @@ -277,11 +277,11 @@ class _MyPlanDishHomePageState extends State<MyPlanDishHomePage>
height: ScreenUtil().setWidth(80),
radius: ScreenUtil().setWidth(14),
gradientStart: tabController?.index == 1 &&
!Utils.getAuthority(context, '创建新排菜')
!Utils.getAuthority(context, '生成二维码')
? MyColours.color_ffffff
: MyColours.color_ffffff,
gradientEnd: tabController?.index == 1 &&
!Utils.getAuthority(context, '创建新排菜')
!Utils.getAuthority(context, '生成二维码')
? MyColours.color_ffffff
: MyColours.color_ffffff,
fontSize: 28,
... ... @@ -291,13 +291,17 @@ class _MyPlanDishHomePageState extends State<MyPlanDishHomePage>
// UserModel userModel =
// Provider.of<UserModel>(context, listen: false);
if (!(tabController?.index == 1 &&
!Utils.getAuthority(context, '创建新排菜'))) {
if (Utils.getAuthority(context, '创建新排菜')) {
NavigatorUtil.goPlanDishCreateSelectTypePage(context);
!Utils.getAuthority(context, '生成二维码'))) {
if (Utils.getAuthority(context, '生成二维码')) {
bool? needRefresh =
await NavigatorUtil.goPlanDishQrcodePage(
context,
);
} else {
bool? needRefresh =
await NavigatorUtil.goPlanDishEditPage(context,
isMine: true, isEdit: true);
await NavigatorUtil.goPlanDishQrcodePage(
context,
);
print(needRefresh);
if (needRefresh != null && needRefresh) {
// bus.emit('refresh_coupon_list_f');
... ...
import 'dart:io';
import 'dart:typed_data';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:image_gallery_saver/image_gallery_saver.dart';
import 'package:one_key/provider/plan_dish_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/loading.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'dart:ui' as ui;
/**
*
*
* 套餐排菜分享二维码
*
*
*/
class PlanDishQrcodePage extends StatefulWidget {
final String qrcode;
const PlanDishQrcodePage({super.key, required this.qrcode});
@override
State<PlanDishQrcodePage> createState() => _PlanDishQrcodePageState();
}
class _PlanDishQrcodePageState extends State<PlanDishQrcodePage> {
final GlobalKey globalKey = GlobalKey();
late PlanDishProvider planDishProvider;
// _createPayQrcode() {
// financeProvider!.createPayQrcode(context);
// }
/// 截图
Future<Uint8List?> _capturePng(
GlobalKey globalKey,
// {
// double pixelRatio = 2.0, //截屏的图片与原图的比例
// }
) async {
try {
RenderRepaintBoundary boundary =
globalKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
double dpr = ui.window.devicePixelRatio; // 获取当前设备的像素比
var image = await boundary.toImage(pixelRatio: dpr);
ByteData? byteData =
await image.toByteData(format: ui.ImageByteFormat.png);
Uint8List? pngBytes = byteData?.buffer.asUint8List();
return pngBytes;
} catch (e) {
print(e);
}
return null;
}
@override
Widget build(BuildContext context) {
planDishProvider = Provider.of<PlanDishProvider>(context, listen: true);
return Scaffold(
appBar: SystemAppBar('店铺套餐分享'),
backgroundColor: MyColours.color_ffffff,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(100),
//二维码图片
//
RepaintBoundary(
key: globalKey,
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: w(57)),
padding: EdgeInsets.symmetric(
horizontal: w(25), vertical: w(35)),
color: MyColours.color_438E93,
child: Column(
children: [
Text(
'微信扫码查看店铺套餐',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: font(16),
fontWeight: FontWeight.bold),
),
VEmptyView(20),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(21), vertical: w(16)),
color: MyColours.color_ffffff,
child: Column(
children: [
CachedNetworkImage(
imageUrl:
widget.qrcode ?? ''),
// VEmptyView(28),
Text(
'${Provider.of<UserModel>(context).user!.sellername}',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(14)),
),
// VEmptyView(28),
// Text(
// '消费金:¥${widget.data.amount}',
// maxLines: 3,
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: MyColours.color_000000,
// fontSize: font(14)),
// ),
],
))
],
),
),
// Container(
// margin: EdgeInsets.symmetric(horizontal: w(57)),
// padding: EdgeInsets.symmetric(
// horizontal: w(25), vertical: w(11)),
// decoration: BoxDecoration(
// color: MyColours.color_ffffff,
// border: Border.all(
// color: MyColours.color_09BB07,
// width: w(2))),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// Utils.getImgPath('vector'),
// width: w(37),
// ),
// HEmptyView(12),
// Text(
// '微信支付',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(28)),
// )
// ],
// )),
],
)),
VEmptyView(160),
// Padding(
// padding: EdgeInsets.symmetric(horizontal: w(16)),
// child: Text(
// '提示:',
// textAlign: TextAlign.left,
// style: TextStyle(
// fontSize: w(16),
// height: 1.5,
// fontWeight: FontWeight.bold,
// color: MyColours.color_000000),
// )),
// Padding(
// padding: EdgeInsets.symmetric(horizontal: w(16)),
// child: Text(
// '请将收款码出示给顾客,顾客扫码支付时可以自动识别拥有的代金券,并自动在餐厅设定的规则下使用。',
// textAlign: TextAlign.left,
// style: TextStyle(
// fontSize: w(14),
// height: 1.5,
// color: MyColours.color_000000),
// ))
],
),
),
),
Container(
padding: EdgeInsets.symmetric(vertical: w(13), horizontal: w(79)),
child: RoundButton(
text: '保存二维码图片',
height: w(43),
radius: r(5),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
fontSize: 32,
onPressed: () {
Utils.getPickPermission(context, () async {
//获取截屏图像
//添加到图片数组中
Loading.showLoading(
context,
);
Uint8List? value = await _capturePng(globalKey);
if (value != null) {
print(value);
final result = await ImageGallerySaver.saveImage(value,
quality: 100);
if (result != null) {
Utils.showToast("保存成功");
} else {
print('error');
Utils.showToast("保存失败");
// toast("");
}
Loading.hideLoading(context);
// setState(() {});
}
}, Platform.isIOS ? Permission.photos : Permission.storage);
},
),
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_EFEFF0 = Color(0xFFEFEFF0);
static const Color color_C80010 = Color(0xFFC80010);
static const Color color_EFEFF0 = Color(0xFFEFEFF0);
static const Color color_FFEFC5 = Color(0xFFFFEFC5);
static const Color color_E4461D = Color(0xFFE4461D);
static const Color color_F8F7F3 = Color(0xFFF8F7F3);
... ... @@ -29,7 +30,7 @@ class MyColours {
static const Color color_80438E93 = Color(0x80438E93);
static const Color color_303030 = Color(0xff303030);
static const Color color_CFB53B = Color(0xffCFB53B);
static const Color color_66515151 = Color(0x66515151);
static const Color color_66515151 = Color(0x66515151);
static const Color color_99515151 = Color(0x99515151);
static const Color color_F7C797 = Color(0xffF7C797);
static const Color color_FEF3E6 = Color(0xffFEF3E6);
... ...
... ... @@ -2591,9 +2591,6 @@ class NavigatorUtil {
replace: replace);
}
//临餐取消预订设置页
static Future<dynamic> goOrderCancelSetPage(
BuildContext context, {
... ... @@ -2603,11 +2600,7 @@ class NavigatorUtil {
replace: replace);
}
//会员充值首页列表
//会员充值首页列表
static Future<dynamic> goRechargeFirstHomePage(
BuildContext context, {
replace = false,
... ... @@ -2616,4 +2609,31 @@ class NavigatorUtil {
replace: replace);
}
//套餐排菜二维码页面
static Future<dynamic> goPlanDishQrcodePage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.plan_dish_qrcode_page}",
replace: replace);
}
//全店客户汇总
static Future<dynamic> goCustomerStatisticsPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.customer_statistics_page}",
replace: replace);
}
//余额明细页面
static Future<dynamic> goBalanceDetailsPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.balance_details_page}",
replace: replace);
}
}
... ...
... ... @@ -68,6 +68,7 @@ import 'package:one_key/pages/my/consume/grant_wechat_image_page.dart';
import 'package:one_key/pages/my/consume/return_money_page.dart';
import 'package:one_key/pages/my/customer_type/custom_label_page.dart';
import 'package:one_key/pages/my/customer_type/customer_home_page.dart';
import 'package:one_key/pages/my/customer_type/customer_statistics_page.dart';
import 'package:one_key/pages/my/customer_type/my_customer/my_customer_detail_edit_page.dart';
import 'package:one_key/pages/my/customer_type/my_customer/my_customer_detail_page.dart';
... ... @@ -81,6 +82,7 @@ import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_
import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_detail_page_seller.dart';
import 'package:one_key/pages/my/customer_type/my_customer/my_marketing_records_page.dart';
import 'package:one_key/pages/my/customer_type/my_customer/my_show_customer_list_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/balance_details_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/set_birthday_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/show_customer_list_page.dart';
... ... @@ -120,6 +122,7 @@ import 'package:one_key/pages/my/menu_type/menu_category_page.dart';
// import 'package:one_key/pages/my/menu_type/menu_manage_page_old.dart';
import 'package:one_key/pages/my/my_integral_page.dart';
import 'package:one_key/pages/my/photo_type/photo_manager_page.dart';
import 'package:one_key/pages/my/plan_dish/plan_dish_qrcode_page.dart';
import 'package:one_key/pages/my/receive_orders_time_set.dart';
import 'package:one_key/pages/my/remark_manager_page.dart';
import 'package:one_key/pages/my/room_type/room_type_create_page.dart';
... ... @@ -4509,6 +4512,27 @@ var rechargeFirstHomePageHandle = new Handler(
return RechargeFirstHomePage();
});
var planDishQrcodePageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<PlanDishProvider>(
create: (_) => PlanDishProvider(),
child: PlanDishQrcodePage(
qrcode: '',
));
});
var customerStatisticsPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: CustomerStatisticsPage());
});
var balanceDetailsPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: BalanceDetailsPage());
});
var customLabelPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider<CustomerProvider>(
... ...
... ... @@ -464,6 +464,13 @@ class Routes {
static String order_cancel_set_page = "/order_cancel_set_page"; // 预订取消设置
static String recharge_f_home_page = "/recharge_f_home_page"; // 会员充值首页
static String plan_dish_qrcode_page = "/plan_dish_qrcode_page"; // 套餐排菜二维码
static String customer_statistics_page =
"/customer_statistics_page "; // 全店客户汇总页面
static String balance_details_page = "/balance_details_page"; // 余额明细页面
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
... ... @@ -881,9 +888,17 @@ class Routes {
router.define(order_cancel_set_page, handler: orderCancelSetPageHandle);
router.define(recharge_f_home_page, handler: rechargeFirstHomePageHandle);
router.define(plan_dish_qrcode_page, handler: planDishQrcodePageHandle);
router.define(customer_statistics_page,
handler: customerStatisticsPageHandle);
router.define(balance_details_page,
handler: balanceDetailsPageHandle);
}
}
... ...