|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/customer_label_model.dart';
|
|
|
|
import 'package:one_key/provider/customer_provider.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.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/marketing_center_provider.dart';
|
|
|
|
import '../../../../utils/screen_util.dart';
|
|
|
|
import '../../../../widgets/h_empty_view.dart';
|
|
|
|
import '../../../../widgets/round_button.dart';
|
|
|
|
|
|
|
|
class OrderCancelSetPage extends StatefulWidget {
|
|
|
|
OrderCancelSetPage({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_OrderCancelSetPageState createState() => _OrderCancelSetPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _OrderCancelSetPageState extends State<OrderCancelSetPage> {
|
|
|
|
late CustomerProvider customerProvider;
|
|
|
|
bool swichSync = false; //会员系统同步
|
|
|
|
|
|
|
|
String memberShow = '';
|
|
|
|
bool showLabel = false;
|
|
|
|
|
|
|
|
late MarketingCenterProvider marketingCenterProvider;
|
|
|
|
TextEditingController controllerDay = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController controllerDeadline = TextEditingController();
|
|
|
|
TextEditingController controllerConsumptionTimes = TextEditingController();
|
|
|
|
TextEditingController controllerHighValue = TextEditingController();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
// _getContantData();
|
|
|
|
_sellerGuestGet();
|
|
|
|
_getLabelBySellerid();
|
|
|
|
getDzSellerConf();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
getDzSellerConf() async {
|
|
|
|
bool success = await marketingCenterProvider.getDzSellerConf(context);
|
|
|
|
if (success && marketingCenterProvider.dzSellerConfModel != null) {
|
|
|
|
customerProvider.isReservePhoneApp =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.appPhoneSwitch == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.ispcphone =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.pcNotPhone == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.isAddOver =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.isAddOver == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.isSetOver =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.isSetOver == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.isReserveOver =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.isReserveOver == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.isReserveCancel =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.isReserveCancel == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
|
|
|
|
customerProvider.ispcname =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.pcNotName == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
|
|
|
|
controllerDay.text =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.cancelDay!;
|
|
|
|
customerProvider.cancelOrderdayShopowner =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.cancelShopowner == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.cancelOrderdayManager =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.cancelManager == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
customerProvider.cancelOrderdayOther =
|
|
|
|
marketingCenterProvider.dzSellerConfModel!.cancelOther == '1'
|
|
|
|
? true
|
|
|
|
: false;
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
///修改客情配置
|
|
|
|
|
|
|
|
Future<bool> _sellerGuestSet() async {
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
'is_additional': customerProvider.isrepair ? "1" : "0",
|
|
|
|
'is_enter_self': customerProvider.isselfphone ? '1' : '0',
|
|
|
|
'is_high_frequency': customerProvider.isHighFrequency ? '1' : '0',
|
|
|
|
'high_frequency_day': controllerDeadline.text,
|
|
|
|
'high_frequency_reserve': controllerConsumptionTimes.text,
|
|
|
|
'is_high_consumption': customerProvider.isHighConsumption ? '1' : '0',
|
|
|
|
'is_high_money': controllerHighValue.text
|
|
|
|
};
|
|
|
|
bool success = await customerProvider.setSellerGuest(context, params,
|
|
|
|
showLoading: true);
|
|
|
|
if (success) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_saveData() async {
|
|
|
|
(bool, bool) result = await (_setConfings(), _sellerGuestSet()).wait;
|
|
|
|
|
|
|
|
if (result.$1 && result.$2) {
|
|
|
|
// 全部保存成功
|
|
|
|
Utils.showToast('保存成功!');
|
|
|
|
} else {
|
|
|
|
Utils.showToast('保存失败,请重试');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<bool> _setConfings() async {
|
|
|
|
Map<String, dynamic> data = {
|
|
|
|
'app_phone_switch': customerProvider.isReservePhoneApp ? '1' : '0',
|
|
|
|
'pc_not_rname': customerProvider.ispcname ? '1' : '0',
|
|
|
|
"pc_not_phone": customerProvider.ispcphone ? '1' : '0',
|
|
|
|
"is_add_over": customerProvider.isAddOver ? '1' : '0',
|
|
|
|
"is_set_over": customerProvider.isSetOver ? '1' : '0',
|
|
|
|
"is_reserve_over": customerProvider.isReserveOver ? '1' : '0',
|
|
|
|
"is_reserve_cancel": customerProvider.isReserveCancel ? '1' : '0',
|
|
|
|
'temp_cancel_day': controllerDay.text,
|
|
|
|
'temp_for_shopowner':
|
|
|
|
customerProvider.cancelOrderdayShopowner ? '1' : '0',
|
|
|
|
'temp_for_manager': customerProvider.cancelOrderdayManager ? '1' : '0',
|
|
|
|
'temp_for_other': customerProvider.cancelOrderdayOther ? '1' : '0',
|
|
|
|
};
|
|
|
|
Map<String, String?> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
'data': jsonEncode(data),
|
|
|
|
};
|
|
|
|
bool success = await marketingCenterProvider.setConfings(context, params,
|
|
|
|
needToast: false);
|
|
|
|
if (success) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取客情配置
|
|
|
|
_sellerGuestGet() async {
|
|
|
|
bool success = await customerProvider.getSellerGuest(context);
|
|
|
|
if (success) {
|
|
|
|
controllerDeadline.text =
|
|
|
|
customerProvider.sellerGuestData?.highFrequencyDay ?? '';
|
|
|
|
controllerConsumptionTimes.text =
|
|
|
|
customerProvider.sellerGuestData?.highFrequencyReserve ?? '';
|
|
|
|
controllerHighValue.text =
|
|
|
|
customerProvider.sellerGuestData?.isHighMoney ?? '';
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (success) {
|
|
|
|
// customerProvider.isrepair = true;
|
|
|
|
// } else {
|
|
|
|
// customerProvider.isrepair = false;
|
|
|
|
// }
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取商家标签
|
|
|
|
_getLabelBySellerid() async {
|
|
|
|
await customerProvider.getLabelBySellerid(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
///商家创建商家标签
|
|
|
|
_createLabelBySellerid(String? name) async {
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sellerid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
'label': name
|
|
|
|
};
|
|
|
|
bool success =
|
|
|
|
await customerProvider.createLabelBySellerid(context, params);
|
|
|
|
if (success) {
|
|
|
|
//刷新当前标签列表
|
|
|
|
Utils.showToast('标签添加成功');
|
|
|
|
//调用获取标签接口
|
|
|
|
// 。。。。。。
|
|
|
|
_getLabelBySellerid();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///商家修改标签
|
|
|
|
_setLabelBySellerid(String? id, String? name) async {
|
|
|
|
Map<String, String?> params = {"id": id, 'label': name};
|
|
|
|
bool success = await customerProvider.setLabelBySellerid(context, params);
|
|
|
|
if (success) {
|
|
|
|
//刷新当前标签列表
|
|
|
|
Utils.showToast('标签修改成功');
|
|
|
|
//调用获取标签接口
|
|
|
|
// 。。。。。。
|
|
|
|
_getLabelBySellerid();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//构建标签
|
|
|
|
List<Widget> _buildLabelItem(List<CustomerLabelSunModel> data) {
|
|
|
|
List<Widget> items = [];
|
|
|
|
|
|
|
|
for (CustomerLabelSunModel item in data) {
|
|
|
|
items.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.textfeildAlertDialog(context,
|
|
|
|
title: '自定义标签名称',
|
|
|
|
hintText: '例:高频客户',
|
|
|
|
text: item.label!,
|
|
|
|
lenghtLimit: false,
|
|
|
|
toast: '请输入标签名称', rCallback: (name) {
|
|
|
|
print(name);
|
|
|
|
_setLabelBySellerid(item.id, name as String?);
|
|
|
|
// _addCookbookClass(name, showLoading: true);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(6), vertical: w(3)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_A78E44),
|
|
|
|
borderRadius: BorderRadius.circular(r(5))),
|
|
|
|
child: Text(
|
|
|
|
item.label!,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_A78E44,
|
|
|
|
fontSize: ScreenUtil().setSp(22),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
items.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.textfeildAlertDialog(context,
|
|
|
|
title: '自定义标签名称',
|
|
|
|
hintText: '例:高频客户',
|
|
|
|
text: '',
|
|
|
|
lenghtLimit: false,
|
|
|
|
toast: '请输入标签名称',
|
|
|
|
lCallback: () {}, rCallback: (name) {
|
|
|
|
print(name);
|
|
|
|
// _addCookbookClass(name, showLoading: true);
|
|
|
|
_createLabelBySellerid(name as String?);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(90),
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2))),
|
|
|
|
child: Image.asset(Utils.getImgPath('add_area'),
|
|
|
|
width: ScreenUtil().setWidth(14)),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _itemWidget(String title, String hintText,
|
|
|
|
TextEditingController controller, FocusNode node) {
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: w(112),
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
)),
|
|
|
|
HEmptyView(24),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: w(30),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
border:
|
|
|
|
Border.all(color: MyColours.color_E7E7E7, width: w(1)),
|
|
|
|
),
|
|
|
|
child: TextField(
|
|
|
|
controller: controller,
|
|
|
|
focusNode: node,
|
|
|
|
// autofocus: _sellerCodeController.text.isEmpty,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
),
|
|
|
|
textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (_) {
|
|
|
|
// setActivate();
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.numberWithOptions(decimal: true),
|
|
|
|
))),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
marketingCenterProvider =
|
|
|
|
Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
return KeyboardDismissOnTap(
|
|
|
|
child: Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'临餐取消预订限制设置',
|
|
|
|
onTap: () {
|
|
|
|
if (Navigator.canPop(context)) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(0), top: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(8), horizontal: w(14)),
|
|
|
|
child: Text('临餐取消预订限制(前台及管理员除外)',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 10,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28))))),
|
|
|
|
HEmptyView(2),
|
|
|
|
Container(
|
|
|
|
width: w(40),
|
|
|
|
child: TextField(
|
|
|
|
controller: controllerDay,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
inputFormatters: <TextInputFormatter>[
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
RegExp(r'[0-9]')), //设置只允许输入数字
|
|
|
|
],
|
|
|
|
decoration: InputDecoration(
|
|
|
|
isCollapsed: true,
|
|
|
|
border:
|
|
|
|
OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
hintText: '输入',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number),
|
|
|
|
),
|
|
|
|
Text('天',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
HEmptyView(28),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(22),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(14)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
customerProvider.cancelOrderdayShopowner =
|
|
|
|
!customerProvider.cancelOrderdayShopowner;
|
|
|
|
});
|
|
|
|
// _sellerGuestSet();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(8), horizontal: w(14)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text('允许店长临餐取消预订',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
Image.asset(
|
|
|
|
customerProvider.cancelOrderdayShopowner
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(88),
|
|
|
|
// height: ScreenUtil().setWidth(82),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
customerProvider.cancelOrderdayManager =
|
|
|
|
!customerProvider.cancelOrderdayManager;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(8), horizontal: w(14)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text('允许经理临餐取消预订',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
Image.asset(
|
|
|
|
customerProvider.cancelOrderdayManager
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(88),
|
|
|
|
// height: ScreenUtil().setWidth(82),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
customerProvider.cancelOrderdayOther =
|
|
|
|
!customerProvider.cancelOrderdayOther;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(8), horizontal: w(14)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text('允许服务员及其他人员临餐取消预订',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
Image.asset(
|
|
|
|
customerProvider.cancelOrderdayOther
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(88),
|
|
|
|
// height: ScreenUtil().setWidth(82),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
child: MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
)),
|
|
|
|
VEmptyView(48),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: w(8)),
|
|
|
|
// child: Text('优质客户标记',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)))),
|
|
|
|
// VEmptyView(22),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// customerProvider.isHighFrequency =
|
|
|
|
// !customerProvider.isHighFrequency;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// vertical: w(8), horizontal: w(14)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text('高频客户标记',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// Image.asset(
|
|
|
|
// customerProvider.isHighFrequency
|
|
|
|
// ? Utils.getImgPath('swich_on')
|
|
|
|
// : Utils.getImgPath('swich_off'),
|
|
|
|
// width: ScreenUtil().setWidth(88),
|
|
|
|
// // height: ScreenUtil().setWidth(82),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
// child: MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
|
|
|
|
// child: Row(
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: w(8)),
|
|
|
|
// child: Text('指定期限',
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// maxLines: 10,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))))),
|
|
|
|
// HEmptyView(2),
|
|
|
|
// Container(
|
|
|
|
// width: w(40),
|
|
|
|
// child: TextField(
|
|
|
|
// controller: controllerDeadline,
|
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// inputFormatters: <TextInputFormatter>[
|
|
|
|
// FilteringTextInputFormatter.allow(
|
|
|
|
// RegExp(r'[0-9]')), //设置只允许输入数字
|
|
|
|
// ],
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// isCollapsed: true,
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none),
|
|
|
|
// hintText: '输入',
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: TextInputType.number),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(5),
|
|
|
|
// Text('天',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// // HEmptyView(24),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
// child: MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
|
|
|
|
// child: Row(
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: w(8)),
|
|
|
|
// child: Text('消费次数',
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// maxLines: 10,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))))),
|
|
|
|
// HEmptyView(2),
|
|
|
|
// Container(
|
|
|
|
// width: w(40),
|
|
|
|
// child: TextField(
|
|
|
|
// controller: controllerConsumptionTimes,
|
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// inputFormatters: <TextInputFormatter>[
|
|
|
|
// FilteringTextInputFormatter.allow(
|
|
|
|
// RegExp(r'[0-9]')), //设置只允许输入数字
|
|
|
|
// ],
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// isCollapsed: true,
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none),
|
|
|
|
// hintText: '输入',
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: TextInputType.number),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(5),
|
|
|
|
// Text('次',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// // HEmptyView(24),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
// child: MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// customerProvider.isHighConsumption =
|
|
|
|
// !customerProvider.isHighConsumption;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// vertical: w(8), horizontal: w(14)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text('高消费客户标记',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// Image.asset(
|
|
|
|
// customerProvider.isHighConsumption
|
|
|
|
// ? Utils.getImgPath('swich_on')
|
|
|
|
// : Utils.getImgPath('swich_off'),
|
|
|
|
// width: ScreenUtil().setWidth(88),
|
|
|
|
// // height: ScreenUtil().setWidth(82),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
// child: MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),
|
|
|
|
// child: Row(
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: w(8)),
|
|
|
|
// child: Text('客户人均消费到达设置金额标记为高单值',
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// maxLines: 10,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))))),
|
|
|
|
// HEmptyView(2),
|
|
|
|
// Container(
|
|
|
|
// width: w(40),
|
|
|
|
// child: TextField(
|
|
|
|
// controller: controllerHighValue,
|
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// inputFormatters: <TextInputFormatter>[
|
|
|
|
// FilteringTextInputFormatter.allow(
|
|
|
|
// RegExp("[0-9.]")),
|
|
|
|
// ],
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// isCollapsed: true,
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none),
|
|
|
|
// hintText: '输入',
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: TextInputType.number),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(5),
|
|
|
|
// Text('元',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// // HEmptyView(24),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
// child: MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// )),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// VEmptyView(48),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(48)),
|
|
|
|
margin: EdgeInsets.only(bottom: w(35), top: w(25)),
|
|
|
|
child: RoundButton(
|
|
|
|
// content: widget.fromPage == 'tablePhoto'
|
|
|
|
// ? '确定'
|
|
|
|
// : "已选${selectNum}个 确定",
|
|
|
|
text: '保存',
|
|
|
|
// width: w(128),
|
|
|
|
height: w(40),
|
|
|
|
radius: r(4),
|
|
|
|
isBold: false,
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
fontSize: 28,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
onPressed: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
|
|
|
|
//前置条件判断
|
|
|
|
// if (customerProvider.isHighFrequency) {
|
|
|
|
// if (controllerDeadline.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入指定期限');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (controllerConsumptionTimes.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入消费次数');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (customerProvider.isHighConsumption) {
|
|
|
|
// if (controllerHighValue.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请设置客户人均消费到达金额');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
_saveData();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
// VEmptyView(34),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(52),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// swichSync = !swichSync;
|
|
|
|
// });
|
|
|
|
// // _sellerGuestSet();
|
|
|
|
// },
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text('是否与会员系统同步',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32))),
|
|
|
|
// Image.asset(
|
|
|
|
// swichSync
|
|
|
|
// ? Utils.getImgPath('f_swich_on')
|
|
|
|
// : Utils.getImgPath('f_swich_off'),
|
|
|
|
// width: ScreenUtil().setWidth(70),
|
|
|
|
// // height: ScreenUtil().setWidth(82),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(48),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
// // DialogUtil.showSelectCusmanDialog(context, memberList,
|
|
|
|
// // (value) {
|
|
|
|
// // if (value != null) {
|
|
|
|
// // setState(() {
|
|
|
|
// // memberIndex = value.first;
|
|
|
|
// // memberShow = memberList[memberIndex];
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
// // }, selecteds: memberIndex == null ? [] : [memberIndex])
|
|
|
|
// // .then((value) {});
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// // height: ScreenUtil().setWidth(60),
|
|
|
|
// padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// // color: Colors.red,
|
|
|
|
// width: ScreenUtil().setWidth(150),
|
|
|
|
// height: ScreenUtil().setWidth(35),
|
|
|
|
// child: Text(
|
|
|
|
// '会员系统选择',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// color: MyColours.color_515151),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Expanded(
|
|
|
|
// child: Text(
|
|
|
|
// memberShow,
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
// HEmptyView(10),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// showLabel ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
// width: ScreenUtil().setWidth(24),
|
|
|
|
// // height: ScreenUtil().setWidth(10),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
// _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
|
|
|
|
// VEmptyView(50),
|
|
|
|
// _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
|
|
|
|
// VEmptyView(50),
|
|
|
|
// _itemWidget('密码', "点击这里输入管理员密码", null, null),
|
|
|
|
// VEmptyView(40),
|
|
|
|
// Center(
|
|
|
|
// child: Text(
|
|
|
|
// '请与纳极客服400-000-9690 联系对接事宜',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_999999, fontSize: font(12)),
|
|
|
|
// ))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|