Commit 8a3632f197d338548bb41ccdb82dd0a96ad9d84b

Authored by wdn127929
1 parent a1c1303e

电话输入后,姓名不进行搜索历史

... ... @@ -503,5 +503,7 @@ class HttpUrl {
static const String get_sai_you_yun_list =
"?service=App.SaiYouYun.GetSaiYouYunList"; // 获取赛邮云短信模板列表
static const String sort_by_region =
"?service=App.Tables.SortByRegion"; // 区域排序
}
... ...
... ... @@ -410,20 +410,29 @@ class _EditReserverPageState extends State<EditReserverPage> {
} else {
nameStr = value;
}
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
detailModel.getUserHistorys(
context, params));
if (detailModel.phoneController.text
.length ==
0 &&
value.length > 0) {
detailModel.userHistorys = [];
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() => detailModel
.getUserHistorys(context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
print('fff');
... ... @@ -518,27 +527,36 @@ class _EditReserverPageState extends State<EditReserverPage> {
});
return;
}
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
detailModel.getUserHistorys(
context, params));
if (value.isEmpty || value.length > 0) {
detailModel.userHistorys = [];
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
detailModel.getUserHistorys(
context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
_phoneNode.unfocus();
},
onTap: () {
setState(() {
showPhoneHistory = true;
});
// setState(() {
// showPhoneHistory = true;
// });
// Future.delayed(Duration(milliseconds: 300), () {
// _controller.jumpTo(_controller.position.maxScrollExtent);
// });
... ...
... ... @@ -1737,23 +1737,38 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
} else {
nameStr = value;
}
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
_notebookDetailChangeModel
.getUserHistorys(
context, params));
if (_notebookDetailChangeModel
.phoneController
.text
.length ==
0 &&
value.length > 0) {
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
_notebookDetailChangeModel
.getUserHistorys(
context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onTap: () {
setState(() {
showPhoneHistory = true;
});
// setState(() {
// showPhoneHistory = true;
// });
// Future.delayed(Duration(milliseconds: 300), () {
// _controller.jumpTo(_controller.position.maxScrollExtent);
// });
... ... @@ -1869,28 +1884,38 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
});
return;
}
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
_notebookDetailChangeModel
.getUserHistorys(
context, params));
if (value.isEmpty ||
value.length > 0) {
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(
context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
_notebookDetailChangeModel
.getUserHistorys(
context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
_phoneNode.unfocus();
},
onTap: () {
setState(() {
showPhoneHistory = true;
});
// setState(() {
// showPhoneHistory = true;
// });
// Future.delayed(Duration(milliseconds: 300), () {
// _controller.jumpTo(_controller.position.maxScrollExtent);
// });
... ...
... ... @@ -139,7 +139,7 @@ class InvicationPageState extends State<InvicationPage>
bool needWechat = false;
String youhui = '选择优惠';
final GlobalKey botGlobalKey = GlobalKey();
static final GlobalKey botGlobalKey = GlobalKey();
int sexSelectIndex = 0;
String sexStr = '先生';
List sexList = [];
... ... @@ -232,7 +232,7 @@ class InvicationPageState extends State<InvicationPage>
if (_phoneNode.hasFocus) {
showOverlay(context);
setState(() {});
Scrollable.ensureVisible(botGlobalKey.currentContext);
// Scrollable.ensureVisible(botGlobalKey.currentContext);
} else {
if (!needBack &&
!needBlack &&
... ... @@ -251,7 +251,7 @@ class InvicationPageState extends State<InvicationPage>
if (_pnumNode.hasFocus) {
showOverlay(context);
setState(() {});
Scrollable.ensureVisible(botGlobalKey.currentContext);
// Scrollable.ensureVisible(botGlobalKey.currentContext);
} else {
if (!needBack &&
!needBlack &&
... ... @@ -429,6 +429,8 @@ class InvicationPageState extends State<InvicationPage>
_timer.cancel();
}
_baseIndoProvider.nameController.dispose();
super.dispose();
}
... ... @@ -2146,15 +2148,24 @@ class InvicationPageState extends State<InvicationPage>
setState(() {});
}
JhCommonUtils.debounce(() => _searchMethod(value));
if (value.isEmpty || value.length > 0) {
setState(() {
showPhoneHistory = true;
});
JhCommonUtils.debounce(() => _searchMethod(value));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
_phoneNode.unfocus();
_phoneNode.nextFocus();
},
onTap: () {
setState(() {
showPhoneHistory = true;
});
// setState(() {
// showPhoneHistory = true;
// });
// Future.delayed(Duration(milliseconds: 300), () {
// _controller.jumpTo(_controller.position.maxScrollExtent);
// });
... ... @@ -2267,21 +2278,34 @@ class InvicationPageState extends State<InvicationPage>
print('ggg');
nameStr = value;
Map<String, String> params = {
"keywords": value.trim(),
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() => _baseIndoProvider
.getUserHistorys(context, params));
if (_baseIndoProvider
.phoneController.text.length ==
0 &&
value.length > 0) {
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value.trim(),
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() => _baseIndoProvider
.getUserHistorys(context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onTap: () {
setState(() {
showPhoneHistory = true;
});
// setState(() {
// showPhoneHistory = true;
// });
// Future.delayed(Duration(milliseconds: 300), () {
// _controller.jumpTo(_controller.position.maxScrollExtent);
// });
... ... @@ -2464,8 +2488,8 @@ class InvicationPageState extends State<InvicationPage>
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_353535),
controller: _baseIndoProvider.nameController,
focusNode: _nameNode,
// controller: _baseIndoProvider.nameController,
// focusNode: _nameNode,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: "用餐类型",
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/area.dart';
import 'package:one_key/provider/my_table_manage_home_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
... ... @@ -75,140 +76,273 @@ class _MyAreaManagePageState extends State<MyAreaManagePage> {
emptyImg: "table_manage_empty",
showMsg: "加载中,请稍后...",
)
: ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32),
vertical: ScreenUtil().setWidth(54)),
itemCount: tableManagerModel.areas.length,
shrinkWrap: true,
// scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext contxt, int index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(30)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: InkWell(
onTap: () async {
//修改区域弹框
await DialogUtil
.openTableManageCreateAreaDialog(
context,
title: '修改区域',
content: tableManagerModel
.areas[index]
.name, onTap: (value) async {
print(value);
//添加区域
bool success = await tableManagerModel
.setTableRegionById(
: ReorderableListView(
children: <Widget>[
for (Area item in tableManagerModel.areas)
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(30)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_E7E7E7))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: InkWell(
onTap: () async {
//修改区域弹框
await DialogUtil
.openTableManageCreateAreaDialog(
context,
value,
tableManagerModel
.areas[index].rid);
print(success);
if (success) {
Utils.showToast('修改成功!');
tableManagerModel.currentArea = value;
// TableManagerModel tableManagerModel1 =
// Provider.of<TableManagerModel>(
// context,
// listen: false);
// tableManagerModel1.getTableList(
// context,
// needLoading: false,
// );
await tableManagerModel
.refreshTable(context);
EventBus().emit("refresh_table_area");
// await tableManagerModel
// .getTableList(context,
// needLoading: false);
// tableManagerModel.initData();
// setState(() {
// updateMenu();
// });
// _scrollToIndex(widget
// .tableManagerModel
// .areas
// .length);
}
});
},
child: Text(
tableManagerModel.areas[index].name,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(32))))),
InkWell(
onTap: () {
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除该区域",
lTitle: "取消",
rTitle: "确认删除",
isBold: true,
isBoldContent: true,
rColor: MyColours.color_E34D59,
lCallback: () {
print("取消");
}, rCallback: () async {
bool success =
await tableManagerModel.delTableRegion(
context,
tableManagerModel.areas[index].rid);
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();
// TableManagerModel tableManagerModel =
// Provider.of<TableManagerModel>(context,
// listen: false);
// tableManagerModel.getTableList(
// context,
// needLoading: false,
// );
await tableManagerModel
.refreshTable(context);
EventBus().emit("refresh_table_area");
}
});
},
child: Text('删除',
style: TextStyle(
color: MyColours.color_438E93,
decoration: TextDecoration.underline,
fontSize: ScreenUtil().setSp(32))))
],
),
);
});
title: '修改区域',
content: item.name,
onTap: (value) async {
print(value);
//添加区域
bool success = await tableManagerModel
.setTableRegionById(
context, value, item.rid);
print(success);
if (success) {
Utils.showToast('修改成功!');
tableManagerModel.currentArea = value;
// TableManagerModel tableManagerModel1 =
// Provider.of<TableManagerModel>(
// context,
// listen: false);
// tableManagerModel1.getTableList(
// context,
// needLoading: false,
// );
await tableManagerModel
.refreshTable(context);
EventBus().emit("refresh_table_area");
// await tableManagerModel
// .getTableList(context,
// needLoading: false);
// tableManagerModel.initData();
// setState(() {
// updateMenu();
// });
// _scrollToIndex(widget
// .tableManagerModel
// .areas
// .length);
}
});
},
child: Text(item.name,
style: TextStyle(
color: MyColours.color_000000,
fontSize:
ScreenUtil().setSp(32))))),
InkWell(
onTap: () {
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除该区域",
lTitle: "取消",
rTitle: "确认删除",
isBold: true,
isBoldContent: true,
rColor: MyColours.color_E34D59,
lCallback: () {
print("取消");
}, rCallback: () async {
bool success = await tableManagerModel
.delTableRegion(context, item.rid);
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();
// TableManagerModel tableManagerModel =
// Provider.of<TableManagerModel>(context,
// listen: false);
// tableManagerModel.getTableList(
// context,
// needLoading: false,
// );
await tableManagerModel
.refreshTable(context);
EventBus().emit("refresh_table_area");
}
});
},
child: Text('删除',
style: TextStyle(
color: MyColours.color_438E93,
decoration: TextDecoration.underline,
fontSize: ScreenUtil().setSp(32))))
],
),
)
],
onReorder: (int oldIndex, int newIndex) {
if (oldIndex < newIndex) {
newIndex -= 1;
}
var child = tableManagerModel.areas.removeAt(oldIndex);
tableManagerModel.areas.insert(newIndex, child);
setState(() {});
},
);
// ListView.builder(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(32),
// vertical: ScreenUtil().setWidth(54)),
// itemCount: tableManagerModel.areas.length,
// shrinkWrap: true,
// // scrollDirection: Axis.horizontal,
// itemBuilder: (BuildContext contxt, int index) {
// return Container(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(16),
// vertical: ScreenUtil().setWidth(30)),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// width: ScreenUtil().setWidth(2),
// color: MyColours.color_E7E7E7))),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: InkWell(
// onTap: () async {
// //修改区域弹框
// await DialogUtil
// .openTableManageCreateAreaDialog(
// context,
// title: '修改区域',
// content: tableManagerModel
// .areas[index]
// .name, onTap: (value) async {
// print(value);
// //添加区域
// bool success = await tableManagerModel
// .setTableRegionById(
// context,
// value,
// tableManagerModel
// .areas[index].rid);
// print(success);
// if (success) {
// Utils.showToast('修改成功!');
// tableManagerModel.currentArea = value;
// // TableManagerModel tableManagerModel1 =
// // Provider.of<TableManagerModel>(
// // context,
// // listen: false);
// // tableManagerModel1.getTableList(
// // context,
// // needLoading: false,
// // );
// await tableManagerModel
// .refreshTable(context);
// EventBus().emit("refresh_table_area");
// // await tableManagerModel
// // .getTableList(context,
// // needLoading: false);
// // tableManagerModel.initData();
// // setState(() {
// // updateMenu();
// // });
// // _scrollToIndex(widget
// // .tableManagerModel
// // .areas
// // .length);
// }
// });
// },
// child: Text(
// tableManagerModel.areas[index].name,
// style: TextStyle(
// color: MyColours.color_000000,
// fontSize: ScreenUtil().setSp(32))))),
// InkWell(
// onTap: () {
// DialogUtil.cupertinoAlertDialog(context,
// title: "",
// content: "是否确定删除该区域",
// lTitle: "取消",
// rTitle: "确认删除",
// isBold: true,
// isBoldContent: true,
// rColor: MyColours.color_E34D59,
// lCallback: () {
// print("取消");
// }, rCallback: () async {
// bool success =
// await tableManagerModel.delTableRegion(
// context,
// tableManagerModel.areas[index].rid);
// 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();
// // TableManagerModel tableManagerModel =
// // Provider.of<TableManagerModel>(context,
// // listen: false);
// // tableManagerModel.getTableList(
// // context,
// // needLoading: false,
// // );
// await tableManagerModel
// .refreshTable(context);
// EventBus().emit("refresh_table_area");
// }
// });
// },
// child: Text('删除',
// style: TextStyle(
// color: MyColours.color_438E93,
// decoration: TextDecoration.underline,
// fontSize: ScreenUtil().setSp(32))))
// ],
// ),
// );
// });
})));
}
}
... ...
... ... @@ -1056,18 +1056,26 @@ class TableManagerPageState extends State<TableManagerPage> {
});
return;
}
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() =>
_baseIndoProvider.getUserHistorys(context, params));
// _baseIndoProvider.getUserHistorys(context, params);
if (value.isEmpty || value.length > 0) {
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid":
Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
};
JhCommonUtils.debounce(() => _baseIndoProvider
.getUserHistorys(context, params));
// _baseIndoProvider.getUserHistorys(context, params);
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
_phoneNode.unfocus();
... ... @@ -1178,20 +1186,32 @@ class TableManagerPageState extends State<TableManagerPage> {
print('ggg');
nameStr = value;
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
// _baseIndoProvider.getUserHistorys(
// context, params);
JhCommonUtils.debounce(() => _baseIndoProvider
.getUserHistorys(context, params));
if (_baseIndoProvider
.phoneController.text.length ==
0 &&
value.length > 0) {
_baseIndoProvider.userHistorys = [];
setState(() {
showPhoneHistory = true;
});
Map<String, String> params = {
"keywords": value,
"sid": Provider.of<UserModel>(context,
listen: false)
.user
.sellerid,
};
// _baseIndoProvider.getUserHistorys(
// context, params);
JhCommonUtils.debounce(() =>
_baseIndoProvider.getUserHistorys(
context, params));
} else {
setState(() {
showPhoneHistory = false;
});
}
},
onEditingComplete: () {
print('fff');
... ...
... ... @@ -224,6 +224,23 @@ class MyTableManageHomeModel with ChangeNotifier {
}
}
// 区域排序
Future<dynamic> sortByRegion(
BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.sort_by_region,
data: params, showLoading: true)
.catchError((error) {
print(error.toString());
});
if (baseResp == null) return null;
if (baseResp.code == Constant.status_success) {
return baseResp.data;
} else {
Utils.showToast(baseResp.msg);
}
}
//添加商家桌位区域
Future<bool> addTableAreas(BuildContext context, String name) async {
Map<String, String> params = {
... ...