|
...
|
...
|
@@ -9,9 +9,11 @@ import '../../../models/recharge_list_model.dart'; |
|
|
|
import '../../../provider/marketing_center_provider.dart';
|
|
|
|
import '../../../provider/user_model.dart';
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../utils/dialog_util.dart';
|
|
|
|
import '../../../utils/screen_util.dart';
|
|
|
|
import '../../../utils/utils.dart';
|
|
|
|
import '../../../widgets/MyDivider.dart';
|
|
|
|
import '../../../widgets/h_empty_view.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
import '../../../widgets/v_empty_view.dart';
|
|
|
|
|
|
...
|
...
|
@@ -44,15 +46,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> { |
|
|
|
|
|
|
|
List<CouponSunModel> couponDataList = [];
|
|
|
|
bool isComments = false; //启用评价设置
|
|
|
|
bool isCommentsCoupon = false; //启用评价送券
|
|
|
|
bool isCommentsCoupon = false; //启用评价送券
|
|
|
|
List<CouponSunModel> couponDataListComments = [];
|
|
|
|
|
|
|
|
int indexSelect = 0;
|
|
|
|
|
|
|
|
List<String> timesData = [];
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
timesData = ['不允许修改', '开餐1小时之前', '开餐2小时之前', '预订日期1天之前', '预订日期2天之前'];
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
getSellerTemplateConf();
|
|
|
|
_getDzSellerConf();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -113,6 +122,22 @@ class _OrderSettingPageState extends State<OrderSettingPage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_getDzSellerConf() async {
|
|
|
|
await marketingCenterProvider.getDzSellerConf(context);
|
|
|
|
|
|
|
|
if (marketingCenterProvider.dzSellerConfModel != null) {
|
|
|
|
indexSelect =
|
|
|
|
int.parse(marketingCenterProvider.dzSellerConfModel.isAllowUpdate) -
|
|
|
|
1;
|
|
|
|
if (indexSelect < 0 || indexSelect > 4) {
|
|
|
|
indexSelect = 0;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///向客人开放提前点餐功能
|
|
|
|
|
|
|
|
_setOrderBtnShow() async {
|
|
...
|
...
|
@@ -147,6 +172,58 @@ class _OrderSettingPageState extends State<OrderSettingPage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _itemWidget(String title, {GestureTapCallback onTap}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16), top: w(12), bottom: w(12), right: w(12)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151, fontSize: font(16)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(isOrder ? 'swich_on' : 'swich_off'),
|
|
|
|
width: w(44),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// RoundButton(
|
|
|
|
// text: '预览',
|
|
|
|
// gradientStart: MyColours.color_ffffff,
|
|
|
|
// gradientEnd: MyColours.color_ffffff,
|
|
|
|
// borderColor: MyColours.color_438E93,
|
|
|
|
// textColor: MyColours.color_438E93,
|
|
|
|
// radius: ScreenUtil().setWidth(22),
|
|
|
|
// fontSize: 24,
|
|
|
|
// width: w(72),
|
|
|
|
// height: ScreenUtil().setWidth(44),
|
|
|
|
// isBold: true,
|
|
|
|
// onPressed: () {
|
|
|
|
// NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
|
|
|
|
_setConfing() async {
|
|
|
|
await marketingCenterProvider.setConfing(
|
|
|
|
context,
|
|
|
|
{
|
|
|
|
'sid': Provider.of<UserModel>(context,listen: false).user.sellerid,
|
|
|
|
'key': 'is_allow_update',
|
|
|
|
'value': '${indexSelect + 1}'
|
|
|
|
},
|
|
|
|
needToast: false);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
marketingCenterProvider =
|
|
...
|
...
|
@@ -160,52 +237,61 @@ class _OrderSettingPageState extends State<OrderSettingPage> { |
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
_itemWidget('向客人开放提前点餐功能', onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isOrder = !isOrder;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: MyDivider(double.infinity, w(0.5),
|
|
|
|
color: MyColours.color_E7E7E7)),
|
|
|
|
VEmptyView(20),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isOrder = !isOrder;
|
|
|
|
});
|
|
|
|
DialogUtil.showSelectCusmanDialog(context, timesData,
|
|
|
|
(value) {
|
|
|
|
if (value != null) {
|
|
|
|
setState(() {
|
|
|
|
indexSelect = value.first;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, selecteds: indexSelect == null ? [] : [indexSelect])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16),
|
|
|
|
top: w(12),
|
|
|
|
bottom: w(12),
|
|
|
|
top: w(14),
|
|
|
|
bottom: w(10),
|
|
|
|
right: w(12)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'向客人开放提前点餐功能',
|
|
|
|
'是否允许客人修改菜品',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(16)),
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
timesData[indexSelect],
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(7), vertical: w(4)),
|
|
|
|
horizontal: w(11), vertical: w(4)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
isOrder ? 'swich_on' : 'swich_off'),
|
|
|
|
width: w(44),
|
|
|
|
"assets/arrow_right_new.png",
|
|
|
|
width: w(9),
|
|
|
|
height: w(16),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
// RoundButton(
|
|
|
|
// text: '预览',
|
|
|
|
// gradientStart: MyColours.color_ffffff,
|
|
|
|
// gradientEnd: MyColours.color_ffffff,
|
|
|
|
// borderColor: MyColours.color_438E93,
|
|
|
|
// textColor: MyColours.color_438E93,
|
|
|
|
// radius: ScreenUtil().setWidth(22),
|
|
|
|
// fontSize: 24,
|
|
|
|
// width: w(72),
|
|
|
|
// height: ScreenUtil().setWidth(44),
|
|
|
|
// isBold: true,
|
|
|
|
// onPressed: () {
|
|
|
|
// NavigatorUtil.goMarkingPreviewPage(context);
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
]))),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
...
|
...
|
@@ -228,6 +314,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> { |
|
|
|
isBold: true,
|
|
|
|
onPressed: () async {
|
|
|
|
//调用接口
|
|
|
|
_setConfing();
|
|
|
|
_setOrderBtnShow();
|
|
|
|
})
|
|
|
|
],
|
...
|
...
|
|