Commit 16ad7e6d352e19189d05512cd12cd4790622cb56

Authored by wdn127929
1 parent b27c8743

批量修改

... ... @@ -446,8 +446,8 @@ class DioUtil {
static BaseOptions getDefOptions() {
BaseOptions options = new BaseOptions();
options.contentType = Headers.formUrlEncodedContentType;
options.connectTimeout = 1000 * 300; //默认30s
options.receiveTimeout = 1000 * 300; //默认30s
options.connectTimeout = 1000 * 50; //默认30s 50s
options.receiveTimeout = 1000 * 50; //默认30s 50s
return options;
}
}
... ...
... ... @@ -232,5 +232,7 @@ class HttpUrl {
"?service=App.Tables.SetTableRegionById"; // 修改商家桌位区域
static const String del_table_region =
"?service=App.Tables.DelTableRegion"; // 删除区域同时删除区域下面的桌位
static const String batch_set_table =
"?service=App.Tables.BatchSetTable"; // 批量修改桌位信息
}
... ...
... ... @@ -60,8 +60,7 @@ class _MyAreaManagePageState extends State<MyAreaManagePage> {
body: SafeArea(child:
Consumer<MyTableManageHomeModel>(builder: (context, model, child) {
return model.pageState != PageState.Success
? Expanded(
child: ExceptionPage(
? ExceptionPage(
pageState: model.pageState,
callback: () {
// if (tableManagerModel.tableOuterList.isEmpty) {
... ... @@ -73,7 +72,7 @@ class _MyAreaManagePageState extends State<MyAreaManagePage> {
emptyMsg: "暂时没有区域数据哦",
emptyImg: "table_manage_empty",
showMsg: "加载中,请稍后...",
))
)
: ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32),
... ...
... ... @@ -480,10 +480,14 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
tableManagerModel.areas.length ==
0) {
return tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect
.tableOuterList
.length >
0 &&
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect
? SizedBox()
: InkWell(
onTap: () async {
... ... @@ -686,7 +690,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
onTap: () async {
//添加区域弹框
await DialogUtil
.openCreateAreaDialog(
.openTableManageCreateAreaDialog(
context, onTap:
(value) async {
print(value);
... ... @@ -766,143 +770,59 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
],
))
: SizedBox(),
Expanded(
// flex: 2,
child: Container(
constraints: BoxConstraints(
minHeight:
ScreenUtil().setWidth(100)),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20),
horizontal:
ScreenUtil().setWidth(48)),
child: Column(
children: [
VEmptyView(26),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list
.length ==
0
? SizedBox()
: Row(children: [
InkWell(
onTap: () {
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect =
!tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect;
if (!tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect &&
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.length >
1) {
for (t.Table item
in tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list) {
item.selected =
false;
}
tableManagerModel
tableManagerModel.tableOuterList.length == 0
? SizedBox()
: Expanded(
// flex: 2,
child: Container(
constraints: BoxConstraints(
minHeight:
ScreenUtil().setWidth(100)),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
vertical:
ScreenUtil().setWidth(20),
horizontal:
ScreenUtil().setWidth(48)),
child: Column(
children: [
VEmptyView(26),
tableManagerModel
.selectNumber !=
null &&
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables = [];
}
setState(() {});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect
? 'base_radio_sel'
: 'base_radio_un'),
width:
ScreenUtil()
.setWidth(
40),
),
HEmptyView(10),
Text(
'批量选择桌位',
style: TextStyle(
fontSize:
ScreenUtil()
.setSp(
32),
color: MyColours
.color_000000),
),
],
)),
Spacer(),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect
? InkWell(
.list
.length ==
0
? SizedBox()
: Row(children: [
InkWell(
onTap: () {
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables = [];
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isAll =
.isSelect =
!tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isAll;
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isAll) {
for (t.Table item
in tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.list) {
item.selected =
true;
tableManagerModel
.isSelect;
if (!tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.add(
item);
}
} else {
.isSelect &&
tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.selectTables
.length >
0) {
for (t.Table item
in tableManagerModel
.tableOuterList[
... ... @@ -911,195 +831,422 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
item.selected =
false;
}
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables = [];
}
setState(() {});
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.center,
children: [
Image.asset(
Utils.getImgPath(tableManagerModel
.tableOuterList[tableManagerModel
.selectNumber]
.isAll
? 'mine_radio_sel'
: 'mine_radio_nor'),
width: ScreenUtil()
.setWidth(
34)),
Utils.getImgPath(tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.isSelect
? 'base_radio_sel'
: 'base_radio_un'),
width: ScreenUtil()
.setWidth(
40),
),
HEmptyView(10),
Text(
'全选',
'批量选择桌位',
style: TextStyle(
fontSize: ScreenUtil()
.setSp(
32),
color: MyColours
.color_515151,
fontSize:
ScreenUtil()
.setSp(32)),
)
.color_000000),
),
],
))
: SizedBox()
]),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list
.length ==
0
? VEmptyView(20)
: VEmptyView(60),
Expanded(
child: item(tableManagerModel
.selectNumber)),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list
.length ==
0
? Padding(
padding: EdgeInsets.only(
left: ScreenUtil()
.setWidth(50)),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
VEmptyView(60),
Row(
)),
Spacer(),
tableManagerModel
.tableOuterList
.length >
0 &&
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isSelect
? InkWell(
onTap: () {
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables = [];
tableManagerModel
.tableOuterList[tableManagerModel
.selectNumber]
.isAll =
!tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.isAll;
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.isAll) {
for (t.Table item in tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.list) {
item.selected =
true;
tableManagerModel
.tableOuterList[tableManagerModel
.selectNumber]
.selectTables
.add(
item);
}
} else {
for (t.Table item in tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.list) {
item.selected =
false;
}
}
setState(
() {});
},
child: Row(
crossAxisAlignment:
CrossAxisAlignment
.center,
children: [
Image.asset(
Utils.getImgPath(tableManagerModel.tableOuterList[tableManagerModel.selectNumber].isAll
? 'mine_radio_sel'
: 'mine_radio_nor'),
width: ScreenUtil()
.setWidth(34)),
Text(
'全选',
style: TextStyle(
color: MyColours
.color_515151,
fontSize:
ScreenUtil().setSp(32)),
)
],
))
: SizedBox()
]),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list
.length ==
0
? VEmptyView(20)
: VEmptyView(60),
Expanded(
child: item(
tableManagerModel
.selectNumber)),
tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.list
.length ==
0
? Padding(
padding: EdgeInsets.only(
left: ScreenUtil()
.setWidth(50)),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Text(
'1、添加区域(如:一楼、二楼、东厅等)',
VEmptyView(60),
Row(
children: [
Text(
'1、添加区域(如:一楼、二楼、东厅等)',
style: TextStyle(
decoration:
TextDecoration
.lineThrough,
fontSize:
ScreenUtil().setSp(
32),
color: MyColours
.color_BFC4D4))
],
),
VEmptyView(40),
Text('2、选择要添加桌位的区域',
style: TextStyle(
decoration:
TextDecoration
.lineThrough,
fontSize: ScreenUtil()
.setSp(
32),
color: MyColours
.color_BFC4D4))
],
),
VEmptyView(40),
Text('2、选择要添加桌位的区域',
style: TextStyle(
fontSize:
ScreenUtil()
.setSp(
32),
color: MyColours
.color_BFC4D4)),
VEmptyView(40),
Text('3、点击“+”号添加桌位',
style: TextStyle(
fontSize:
ScreenUtil()
.color_BFC4D4)),
VEmptyView(40),
Text('3、点击“+”号添加桌位',
style: TextStyle(
fontSize: ScreenUtil()
.setSp(
32),
color: MyColours
.color_BFC4D4)),
VEmptyView(120),
Image.asset(
"assets/empty_search.png",
width: ScreenUtil()
.setWidth(520),
height: ScreenUtil()
.setWidth(384),
),
VEmptyView(40),
],
))
: SizedBox(),
],
))),
color: MyColours
.color_BFC4D4)),
VEmptyView(120),
Image.asset(
"assets/empty_search.png",
width:
ScreenUtil()
.setWidth(
520),
height:
ScreenUtil()
.setWidth(
384),
),
VEmptyView(40),
],
))
: SizedBox(),
],
))),
])),
model.pageState == PageState.Success &&
tableManagerModel
.tableOuterList[tableManagerModel.selectNumber]
.isSelect
? Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(48)),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
tableManagerModel.tableOuterList.length == 0
? SizedBox()
: model.pageState == PageState.Success &&
tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.isSelect
? Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(48)),
child: Column(
children: [
CommonButton(
content: "修改名称",
width: 200,
height: 72,
fontSize: 32,
onPress: () async {
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.length ==
0) {
Utils.showToast('请选择桌位');
return;
}
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
CommonButton(
content: "修改名称",
width: 200,
height: 72,
fontSize: 32,
onPress: () async {
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.length ==
0) {
Utils.showToast('请选择桌位');
return;
}
DialogUtil
.openMyTableManageModifyTableNameDialog(
context,
onTap: (Map<String, String>
value) async {
Map<String, String> params = {
'name': value['name'],
};
DialogUtil
.openMyTableManageModifyTableNameDialog(
context,
onTap: (Map<String, String>
value) async {
String tids = '';
for (t.Table item
in tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables) {
tids += '${item.id},';
}
if (tids.endsWith(',')) {
tids = tids.substring(
0, tids.length - 1);
}
Map<String, String> params = {
'name': value['name'],
'tableids': tids,
'skip_four':
value['skip_four'],
'skip_seven':
value['skip_seven'],
};
// bool success =
// await tableManagerModel
// .setTableById(
// context, params);
// print(success);
// if (success) {
// Utils.showToast('修改成功!');
bool success =
await tableManagerModel
.batchSetTable(
context, params);
print(success);
if (success) {
Utils.showToast('修改成功!');
// await tableManagerModel
// .refreshTable(context);
// }
},
);
}),
CommonButton(
content: "修改人数",
width: 200,
height: 72,
fontSize: 32,
onPress: () async {
await DialogUtil
.openMyTableManageModifyTableNumDialog(
context,
personNumList,
pnumMin: '',
pnumMax: '',
onTap: (Map<String, String>
value) async {
// if (value['pnumMin'] != '') {
// params['table_pnum'] = value['pnumMin'];
// }
// if (value['pnumMax'] != '') {
// params['most_pnum'] = value['pnumMax'];
// }
},
);
}),
await tableManagerModel
.refreshTable(context);
}
},
);
}),
CommonButton(
content: "修改人数",
width: 200,
height: 72,
fontSize: 32,
onPress: () async {
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.length ==
0) {
Utils.showToast('请选择桌位');
return;
}
await DialogUtil
.openMyTableManageModifyTableNumDialog(
context,
personNumList,
pnumMin: '',
pnumMax: '',
onTap: (Map<String, String>
value) async {
String tids = '';
for (t.Table item
in tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables) {
tids += '${item.id},';
}
if (tids.endsWith(',')) {
tids = tids.substring(
0, tids.length - 1);
}
Map<String, String> params = {
'tableids': tids,
};
if (value['pnumMin'] != '') {
params['table_pnum'] =
value['pnumMin'];
}
if (value['pnumMax'] != '') {
params['most_pnum'] =
value['pnumMax'];
}
bool success =
await tableManagerModel
.batchSetTable(
context, params);
print(success);
if (success) {
Utils.showToast('修改成功!');
await tableManagerModel
.refreshTable(context);
}
},
);
}),
CommonButton(
content: "修改类型",
width: 200,
height: 72,
fontSize: 32,
onPress: () async {
if (tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables
.length ==
0) {
Utils.showToast('请选择桌位');
return;
}
List<String> tableTypeS = [];
for (int i = 0;
i <
tableManagerModel
.tableTypeList.length;
i++) {
tableTypeS.add(tableManagerModel
.tableTypeList[i].name);
}
DialogUtil
.openMyTableManageModifyTableTypeDialog(
context,
tableTypeS,
onTap: (Map<String, String>
value) async {
String tid;
String tids = '';
for (t.Table item
in tableManagerModel
.tableOuterList[
tableManagerModel
.selectNumber]
.selectTables) {
tids += '${item.id},';
}
if (tids.endsWith(',')) {
tids = tids.substring(
0, tids.length - 1);
}
for (int i = 0;
i <
tableManagerModel
.tableTypeList
.length;
i++) {
if (value['bjtype'] ==
tableManagerModel
.tableTypeList[i]
.name) {
tid = tableManagerModel
.tableTypeList[i].id;
}
}
Map<String, String> params = {
'tableids': tids,
'tid': tid
};
bool success =
await tableManagerModel
.batchSetTable(
context, params);
print(success);
if (success) {
Utils.showToast('修改成功!');
await tableManagerModel
.refreshTable(context);
}
},
);
},
),
],
),
VEmptyView(44),
CommonButton(
content: "修改类型",
content: "删除桌位",
width: 200,
height: 72,
fontSize: 32,
state: -3,
onPress: () async {
if (tableManagerModel
.tableOuterList[
... ... @@ -1111,135 +1258,70 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
Utils.showToast('请选择桌位');
return;
}
List<String> tableTypeS = [];
for (int i = 0;
i <
tableManagerModel
.tableTypeList.length;
i++) {
tableTypeS.add(tableManagerModel
.tableTypeList[i].name);
}
DialogUtil
.openMyTableManageModifyTableTypeDialog(
context,
tableTypeS,
onTap: (Map<String, String>
value) async {
String tid;
for (int i = 0;
i <
tableManagerModel
.tableTypeList.length;
i++) {
if (value['bjtype'] ==
tableManagerModel
.tableTypeList[i].name) {
tid = tableManagerModel
.tableTypeList[i].id;
}
}
// Map<String, String> params = {
// 'id': table.id,
// 'tid': tid
// };
// bool success =
// await tableManagerModel
// .setTableById(
// context, params);
// print(success);
// if (success) {
// Utils.showToast('修改成功!');
// await tableManagerModel
// .refreshTable(context);
// }
},
);
},
),
],
),
VEmptyView(44),
CommonButton(
content: "删除桌位",
width: 200,
height: 72,
fontSize: 32,
state: -3,
onPress: () async {
if (tableManagerModel
String tids = '';
for (t.Table item in tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.selectTables
.length ==
0) {
Utils.showToast('请选择桌位');
return;
}
String tids = '';
for (t.Table item in tableManagerModel
.tableOuterList[
tableManagerModel.selectNumber]
.selectTables) {
tids += '${item.id},';
}
if (tids.endsWith(',')) {
tids = tids.substring(0, tids.length - 1);
}
.selectTables) {
tids += '${item.id},';
}
if (tids.endsWith(',')) {
tids = tids.substring(
0, tids.length - 1);
}
DialogUtil.cupertinoAlertDialog(context,
title: "",
content:
"是否确定删除${tids.split(',').length}个桌位",
lTitle: "取消",
rTitle: "确认删除",
isBold: true,
isBoldContent: true,
rColor: MyColours.color_E34D59,
lCallback: () {
print("取消");
}, rCallback: () async {
print("确定");
DialogUtil.cupertinoAlertDialog(context,
title: "",
content:
"是否确定删除${tids.split(',').length}个桌位",
lTitle: "取消",
rTitle: "确认删除",
isBold: true,
isBoldContent: true,
rColor: MyColours.color_E34D59,
lCallback: () {
print("取消");
}, rCallback: () async {
print("确定");
Map<String, String> params = {
'sid': Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
'tid': tids
};
Map<String, String> params = {
'sid': Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
'tid': tids
};
bool success = await tableManagerModel
.delSellerTables(context, params);
print(success);
if (success) {
Utils.showToast('删除成功!');
// TableOuter tableOuter = TableOuter();
// tableOuter.name = value;
// tableOuter.list = [];
// tableManagerModel.tableOuterList.add(tableOuter);
// tableManagerModel.initData();
// Timer(
// Duration(milliseconds: 500),
// () => _areaController.jumpTo(
// _areaController.position.maxScrollExtent));
bool success = await tableManagerModel
.delSellerTables(context, params);
print(success);
if (success) {
Utils.showToast('删除成功!');
// TableOuter tableOuter = TableOuter();
// tableOuter.name = value;
// tableOuter.list = [];
// tableManagerModel.tableOuterList.add(tableOuter);
// tableManagerModel.initData();
// Timer(
// Duration(milliseconds: 500),
// () => _areaController.jumpTo(
// _areaController.position.maxScrollExtent));
// await tableManagerModel
// .getTableList(context);
// await tableManagerModel
// .initData();
await tableManagerModel
.refreshTable(context);
}
});
},
),
VEmptyView(32),
],
))
: SizedBox()
// await tableManagerModel
// .getTableList(context);
// await tableManagerModel
// .initData();
await tableManagerModel
.refreshTable(context);
}
});
},
),
VEmptyView(32),
],
))
: SizedBox()
],
);
},
... ...
... ... @@ -178,7 +178,9 @@ class MyTableManageHomeModel with ChangeNotifier {
areas.add(area);
}
if (currentArea != null && currentArea != '') {
if (currentArea != null &&
currentArea != '' &&
tempList.contains(currentArea)) {
// tablesShow = areaTableMapShow[currentArea];
selectNumber = tempList.indexOf(currentArea);
} else {
... ... @@ -322,7 +324,7 @@ class MyTableManageHomeModel with ChangeNotifier {
if (baseResp.code == Constant.status_success) {
if (baseResp.responseData['data'] != null &&
baseResp.responseData['data'] > 0) {
baseResp.responseData['data'] > -1) {
return true;
} else {
Utils.showToast(baseResp.msg ?? '删除区域失败!');
... ... @@ -447,6 +449,44 @@ class MyTableManageHomeModel with ChangeNotifier {
return false;
}
//批量修改桌位信息
Future<bool> batchSetTable(
BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.batch_set_table,
data: params, showLoading: true)
.catchError((error) {
print(error.toString());
// if (error is MyError) {
// switch (error.type) {
// case 1:
// pageState = PageState.ConnectivityError;
// break;
// case 2:
// pageState = PageState.ConnectivityTimeOut;
// break;
// default:
// pageState = PageState.ConnectivityError;
// break;
// }
// }
// notifyListeners();
return false;
});
if (baseResp.code == Constant.status_success) {
if (baseResp.responseData['data'] != null &&
baseResp.responseData['data'] == 1) {
return true;
} else {
Utils.showToast(baseResp.msg ?? '修改桌位失败!');
}
} else {
Utils.showToast(baseResp.msg ?? '修改桌位失败!');
}
return false;
}
//商户端删除桌位
Future<bool> delSellerTables(
BuildContext context, Map<String, String> params) async {
... ...
... ... @@ -1147,6 +1147,21 @@ class DialogUtil {
Utils.showToast('请输入数量!');
return;
}
if (mulCreate &&
!Utils.isNumber(
_norNumController
.text)) {
Utils.showToast('请输入数字!');
return;
}
if (mulCreate &&
int.parse(_norNumController
.text) >
20) {
Utils.showToast(
'最多可创建20个桌位!');
return;
}
if (!mulCreate &&
controller.text.trim() ==
'') {
... ... @@ -1672,8 +1687,7 @@ class DialogUtil {
return Container(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(50)),
height:
ScreenUtil().setWidth(226 * 2),
height: ScreenUtil().setWidth(226 * 2),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10))),
... ... @@ -1785,7 +1799,7 @@ class DialogUtil {
: MyColours.color_438E93,
fontSize: 34,
onPressed: () {
if (pnumMax == '' || pnumMin == '') {
if (pnumMax == '' && pnumMin == '') {
Utils.showToast('请选择人数!');
return;
}
... ... @@ -2094,6 +2108,7 @@ class DialogUtil {
fontSize: ScreenUtil().setSp(32),
),
),
keyboardType: TextInputType.number,
onChanged: (value) {
state(() {});
},
... ... @@ -2101,7 +2116,6 @@ class DialogUtil {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
),
)
],
... ... @@ -2167,9 +2181,9 @@ class DialogUtil {
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(44)),
child: Row(children: [
Image.asset(Utils.getImgPath('mine_radio_nor'),
width: ScreenUtil().setWidth(36)),
HEmptyView(8),
// Image.asset(Utils.getImgPath('mine_radio_nor'),
// width: ScreenUtil().setWidth(36)),
// HEmptyView(8),
Text(
'批量改名累加只适合纯数字桌位,如101',
style: TextStyle(
... ... @@ -2220,6 +2234,10 @@ class DialogUtil {
Utils.showToast('请输入桌位名称!');
return;
}
if (!Utils.isNumber(controller.text)) {
Utils.showToast('请输入纯数字!');
return;
}
// 当前选中区域
// areas[currentAreaIndex]
//最低人数
... ... @@ -2229,6 +2247,8 @@ class DialogUtil {
onTap({
'name': controller.text,
'skip_four': jumpFour ? '1' : '0',
'skip_seven': jumpSeven ? '1' : '0'
});
Navigator.pop(context);
}),
... ...
... ... @@ -30,6 +30,12 @@ import '../app.dart';
typedef BookTimeSetCallback = void Function(bool needChange);
class Utils {
// 验证是否为数字
static bool isNumber(String str) {
final reg = RegExp(r'^-?[0-9]+');
print('$str 是否数字:${reg.hasMatch(str)}');
return reg.hasMatch(str);
}
//
//时间转换
... ...