Commit b67b20830625596aa528ef8ec574cf84e6e9b842

Authored by wdn127929
1 parent 19bc57e5

月度订单UI OK

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.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 '../../../../constant/state.dart';
import '../../../../provider/customer_provider.dart';
import '../../../../utils/screen_util.dart';
import '../../../../utils/utils.dart';
import '../../../../widgets/MyDivider.dart';
import '../../../../widgets/h_empty_view.dart';
import '../../../../widgets/page_exception.dart';
/**
* 月度订单
*/
class MonthOrderPage extends StatefulWidget {
MonthOrderPage({Key key}) : super(key: key);
@override
_MonthOrderPageState createState() => _MonthOrderPageState();
}
class _MonthOrderPageState extends State<MonthOrderPage> {
CustomerProvider customerProvider;
ScrollController _controller = ScrollController();
int month;
@override
void initState() {
// TODO: implement initState
super.initState();
month = 1;
WidgetsBinding.instance.addPostFrameCallback((_) {
customerProvider.pageStateStoreHome = PageState.Success;
setState(() {});
});
}
Widget _monthWidget() {
return Container(
// margin: EdgeInsets.symmetric(horizontal: w(10)),
// padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(10)),
decoration: BoxDecoration(color: MyColours.color_33438E93),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: w(150),
height: w(96),
padding: EdgeInsets.symmetric(horizontal: w(12)),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
if (month == 1) {
month = 12;
setState(() {});
} else {
setState(() {
month--;
});
}
// _getGuestReserve(showLoading: true);
},
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(20)),
child: Image.asset(
Utils.getImgPath('c_arrow_left'),
width: ScreenUtil().setWidth(24),
))),
Row(
children: [
Text(
'${month}',
style: TextStyle(
fontSize: font(48),
color: MyColours.color_515151),
),
Padding(
padding: EdgeInsets.only(top: w(15)),
child: Text(
'月',
style: TextStyle(
fontSize: font(18),
color: MyColours.color_515151),
),
),
],
),
InkWell(
onTap: () {
if (month == 12) {
month = 1;
setState(() {});
} else {
setState(() {
month++;
});
}
// _getGuestReserve(showLoading: true);
},
child: Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(20),
),
child: Image.asset(
Utils.getImgPath('c_arrow_right'),
width: ScreenUtil().setWidth(24),
)))
],
),
VEmptyView(20),
Text(
'2023年',
style: TextStyle(
fontSize: font(14), color: MyColours.color_515151),
)
],
)),
MyDivider(
w(1),
w(96),
color: MyColours.color_DBDBDB,
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: w(15), vertical: w(8)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
// crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'预订',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: font(
(18),
)),
),
HEmptyView(10),
Text(
'1089单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
],
),
VEmptyView(20),
Wrap(
runSpacing: w(10),
children: [
Text(
'到店',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
fontSize: font(
(18),
)),
),
HEmptyView(10),
Text(
'1089单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190人',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'1190取消',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(15),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'到客97.2%',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(
(14),
)),
),
],
),
],
)))
],
),
// VEmptyView(15),
MyDivider(
double.infinity,
w(1),
color: MyColours.color_DBDBDB,
),
// VEmptyView(15),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(8)),
child: Wrap(
// crossAxisAlignment: WrapCrossAlignment.start,
// runAlignment: WrapAlignment.center,
// alignment: WrapAlignment.center,
runSpacing: w(5),
children: [
Text(
'有金额订单 6000',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'消费 9585800.00元',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'人均 8885.58元',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'桌均 95888.58元',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'存酒 8位',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'提前点餐 9位',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
HEmptyView(10),
MyDivider(
w(1),
w(12),
color: MyColours.color_DBDBDB,
),
HEmptyView(10),
Text(
'安排菜 9位',
style: TextStyle(
color: MyColours.color_999999,
decoration: TextDecoration.underline,
fontSize: font(
(10),
)),
),
],
)),
],
),
);
}
@override
Widget build(BuildContext context) {
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar('月度订单'),
body: Consumer<CustomerProvider>(builder: (context, model, _) {
if (model.pageStateStoreHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateStoreHome,
callback: () {
// getTableList();
// _getSellerGuestManage();
},
emptyMsg: "暂时没有月度订单信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return SingleChildScrollView(
controller: _controller,
child: Column(
children: [
VEmptyView(10),
_monthWidget(),
VEmptyView(20),
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.circular(r(8)),
),
child: Row(
children: [
Container(
width: w(75),
padding: EdgeInsets.symmetric(vertical: w(5)),
decoration: BoxDecoration(
border: Border(
right: BorderSide(
color: MyColours.color_f3f3f3,
width: w(1)))),
child: Column(
children: [
VEmptyView(32),
Text(
'30日',
style: TextStyle(
fontSize: font(16),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
),
VEmptyView(40),
Text(
'十二月廿四',
style: TextStyle(
fontSize: font(10),
color: MyColours.color_999999),
),
VEmptyView(10),
Text(
'星期日',
style: TextStyle(
fontSize: font(10),
color: MyColours.color_999999),
),
VEmptyView(20),
],
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
top: w(5), bottom: w(5), left: w(10)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: 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),
Wrap(
runSpacing: w(5),
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),
)),
),
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),
)),
),
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),
)
],
),
))
],
),
);
}),
],
));
}
}));
}
}
... ...
... ... @@ -992,7 +992,11 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
controller: _controller,
padding: EdgeInsets.symmetric(horizontal: w(10)),
itemBuilder: (context, index) {
return MonthItem();
return InkWell(
onTap: () {
NavigatorUtil.goMonthOrderPage(context);
},
child: MonthItem());
}),
/**
ListView.builder(
... ...
... ... @@ -1700,7 +1700,7 @@ class NavigatorUtil {
}
/// 消息中心---会员充值
static void goMessageRechargeInfoPage(BuildContext context,String idStr,
static void goMessageRechargeInfoPage(BuildContext context, String idStr,
{replace = false}) {
_navigateTo(context, "${Routes.message_recharge_info_page}?idStr=$idStr",
replace: replace);
... ... @@ -1728,9 +1728,18 @@ class NavigatorUtil {
/// 存酒设置页
static Future<dynamic> goWineSettingPage(
BuildContext context,
{replace = false, }) {
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.wine_setting_page}",
replace: replace);
}
/// 月度订单
static Future<dynamic> goMonthOrderPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.month_order_page}", replace: replace);
}
}
... ...
... ... @@ -181,6 +181,7 @@ import '../pages/feast/feast_setmeal_page.dart';
import '../pages/feast/feast_wine_page.dart';
import '../pages/message/message_recharge_info_page.dart';
import '../pages/my/customer_type/my_customer/my_customer_home_page.dart';
import '../pages/my/customer_type/store_customer/month_order_page.dart';
import '../pages/my/customer_type/store_customer/store_customer_home_page.dart';
import '../pages/my/customer_type/store_customer/store_customer_home_left_page.dart';
import '../pages/my/feast_manage/feast_deposit_type_page.dart';
... ... @@ -2815,3 +2816,16 @@ var wineSettingPageHandle = new Handler(
return ChangeNotifierProvider<MenuManageProvider>(
create: (_) => MenuManageProvider(), child: WineSettingPage());
});
//月度订单
var monthOrderPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String idStr = params["idStr"].first;
// IsExamineSunModel isExamineSunModel = IsExamineSunModel.fromJson(json.decode(
// FluroConvertUtils.fluroCnParamsDecode(
// params["isExamineSunModel"].first)));
// }
return ChangeNotifierProvider<CustomerProvider>(
create: (_) => CustomerProvider(), child: MonthOrderPage());
});
... ...
... ... @@ -274,6 +274,10 @@ class Routes {
*/
static String wine_setting_page = "/wine_setting_page"; // 存酒设置
static String month_order_page = "/month_order_page"; // 月度订单
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -508,5 +512,9 @@ class Routes {
handler: couponVerificationDetailPageHandle);
router.define(wine_setting_page, handler: wineSettingPageHandle);
router.define(month_order_page, handler: monthOrderPageHandle);
}
}
... ...