Commit 3cc32cb76f377e9e2eeeff24383470d9fb58d620

Authored by wdn127929
2 parents 6787e287 b85d4654

周到安排商家修改+预订安排页面就餐人数选择改为输入框

... ... @@ -12,6 +12,7 @@ if (flutterRoot == null) {
}
def flutterVersionCode = "460"
if (flutterVersionCode == null) {
flutterVersionCode = '460'
... ... @@ -21,6 +22,7 @@ def flutterVersionName = "4.6.0"
if (flutterVersionName == null) {
flutterVersionName = '4.6.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
... ...
... ... @@ -21,7 +21,7 @@
<application
android:label="一键订"
android:label="周到安排商家"
tools:replace="android:label"
android:icon="@mipmap/ic_launcher">
<activity
... ...
... ... @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>一键订</string>
<string>周到安排商家</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
... ...
... ... @@ -243,7 +243,7 @@ class MyAppState extends State<MyApp> {
builder: (context, child) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: '一键订',
title: '周到安排商家',
// navigatorKey: App.getIt<NavigateService>().key,
//国际化
localizationsDelegates: const [
... ...
... ... @@ -1032,7 +1032,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
return true;
}
lastBack = DateTime.now();
Utils.showToast("再次返回退出一键订");
Utils.showToast("再次返回退出周到安排商家");
return false;
},
);
... ...
... ... @@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage>
String nameStr;
FocusNode _nameNode = FocusNode();
FocusNode _phoneNode = FocusNode();
FocusNode _pnumNode = FocusNode();
bool showPhoneHistory = false; //显示客户历史记录
EasyContactPicker _contactPicker = EasyContactPicker();
... ... @@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage>
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
MyTextSelectionControls();
MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
MyTextSelectionControls();
@override
void initState() {
super.initState();
... ... @@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage>
}
});
_pnumNode.addListener(() {
if (_pnumNode.hasFocus) {
showOverlay(context);
setState(() {});
Scrollable.ensureVisible(botGlobalKey.currentContext);
} else {
if (!needBack &&
!needBlack &&
!needHistory &&
!_nameNode.hasFocus &&
!_cusdemNode.hasFocus &&
!needWechat) {
_showConfirmWidget();
}
removeOverlay();
}
});
WidgetsBinding.instance.addPostFrameCallback((_) async {
_myExtendedMaterialTextSelectionControls =
MyTextSelectionControls(callback: (value) {
... ... @@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage>
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
_myExtendedMaterialTextSelectionControlsNum =
MyTextSelectionControls(callback: (value) {
_baseIndoProvider.pnumController.value = TextEditingValue(
text: value,
selection: TextSelection.fromPosition(TextPosition(
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
couponProvider.sendSMS = 0;
await _couponNetworkData(isShowLoading: false);
await _getCustomerActivityBaseinfo();
... ... @@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage>
// weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}";
weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
detailModel.selectNum = detailEntity.actual_pum;
detailModel.selectIndex = detailEntity.actual_pum != null
? personNumList.indexOf(detailEntity.actual_pum)
: null;
_baseIndoProvider.pnumController.text = detailEntity.actual_pum ?? '';
// detailModel.selectIndex = detailEntity.actual_pum != null
// ? personNumList.indexOf(detailEntity.actual_pum)
// : null;
setState(() {});
}
... ... @@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage>
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, personNumList,
(value) async {
if (value != null) {
detailModel.selectIndex =
value.first;
detailModel.selectNum =
personNumList[value.first];
// detailModel
// .notifyListeners();
// setState(() {
// selectPnum = value.first;
// pnum = pnumlist[value.first];
// });
bool sucess =
await detailModel.upReserveInfo(
context, widget.rid,
actualPum:
detailModel.selectNum,
needToast: false);
if (sucess) {
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
bus.emit(
"refresh_book_list"); //刷新已预订列表
bus.emit("refresh_detail");
await _getReserveDetail(
showCicle: false);
}
}
},
selecteds: detailModel
.selectIndex ==
null
? []
: [detailModel.selectIndex])
.then((value) {});
},
child: Container(
alignment: Alignment.center,
child: Text(
detailEntity.actual_pum == null ||
detailEntity.actual_pum ==
''
? '选填'
: detailEntity.actual_pum,
style: TextStyle(
fontSize:
ScreenUtil().setSp(28),
color: detailEntity
.actual_pum ==
null ||
detailEntity
.actual_pum ==
''
? MyColours.color_999999
: MyColours
.color_515151))),
child: TextField(
textAlign: TextAlign.center,
selectionControls:
_myExtendedMaterialTextSelectionControlsNum,
maxLines: 1,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
controller:
_baseIndoProvider.pnumController,
focusNode: _pnumNode,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: "选填",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
),
onChanged: (value) async {
//操作
_baseIndoProvider.pnumController.text =
value;
//添加的代码:光标一直在文本框后面
_baseIndoProvider.pnumController.value =
TextEditingValue(
text: _baseIndoProvider
.pnumController.text,
selection:
TextSelection.fromPosition(
TextPosition(
affinity:
TextAffinity.downstream,
offset: _baseIndoProvider
.pnumController.text.length,
)));
print(value);
// if (value.trim().isEmpty) {
// //内容为空,或 超过11位
// setState(() {
// _baseIndoProvider.userHistorys
// .clear();
// });
// return;
// }
if (value != null) {
detailModel.selectNum = value;
// detailModel
// .notifyListeners();
// setState(() {
// selectPnum = value.first;
// pnum = pnumlist[value.first];
// });
bool sucess = await detailModel
.upReserveInfo(context, widget.rid,
actualPum:
detailModel.selectNum,
needToast: false);
if (sucess) {
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
bus.emit(
"refresh_book_list"); //刷新已预订列表
bus.emit("refresh_detail");
// await _getReserveDetail(
// showCicle: false);
}
}
},
onEditingComplete: () {
_pnumNode.unfocus();
},
onTap: () {
// setState(() {
// showPhoneHistory = true;
// });
// // Future.delayed(Duration(milliseconds: 300), () {
// // _controller.jumpTo(_controller.position.maxScrollExtent);
// // });
},
keyboardType: TextInputType.number,
)),
// Expanded(
// child: InkWell(
// onTap: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context, personNumList,
// (value) async {
// if (value != null) {
// detailModel.selectIndex =
// value.first;
// detailModel.selectNum =
// personNumList[value.first];
// // detailModel
// // .notifyListeners();
// // setState(() {
// // selectPnum = value.first;
// // pnum = pnumlist[value.first];
// // });
// bool sucess =
// await detailModel.upReserveInfo(
// context, widget.rid,
// actualPum:
// detailModel.selectNum,
// needToast: false);
// if (sucess) {
// EventBus().emit(
// "refresh_tablemanager"); //刷新桌位
// bus.emit(
// "refresh_book_list"); //刷新已预订列表
// bus.emit("refresh_detail");
// await _getReserveDetail(
// showCicle: false);
// }
// }
// },
// selecteds: detailModel
// .selectIndex ==
// null
// ? []
// : [detailModel.selectIndex])
// .then((value) {});
// },
// child: Container(
// alignment: Alignment.center,
// child: Text(
// detailEntity.actual_pum == null ||
// detailEntity.actual_pum ==
// ''
// ? '选填'
// : detailEntity.actual_pum,
// style: TextStyle(
// fontSize:
// ScreenUtil().setSp(28),
// color: detailEntity
// .actual_pum ==
// null ||
// detailEntity
// .actual_pum ==
// ''
// ? MyColours.color_999999
// : MyColours
// .color_515151))),
// ),
// // HEmptyView(6),
// // Image.asset(
// // Utils.getImgPath(
// // false ? 'c_arrow_up' : 'c_arrow_down'),
// // width: ScreenUtil().setWidth(28),
// // // height: ScreenUtil().setWidth(10),
// // ),
// ),
]))),
MyDivider(
ScreenUtil().setWidth(2), ScreenUtil().setWidth(46),
... ...
... ... @@ -134,7 +134,7 @@ class _FirstPageState extends State<FirstPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'亲爱的用户,感谢您信任并使用一键订!',
'亲爱的用户,感谢您信任并使用周到安排商家!',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(28),
... ... @@ -254,7 +254,7 @@ class _FirstPageState extends State<FirstPage> {
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "您需要同意《一键订隐私政策》,才能继续使用我们的服务哦。",
content: "您需要同意《周到安排商家隐私政策》,才能继续使用我们的服务哦。",
lTitle: "暂不",
rTitle: "去同意", lCallback: () {
print("取消");
... ...
... ... @@ -820,7 +820,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('一键订账号登录',
Text('周到安排商家账号登录',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(28),
... ...
... ... @@ -166,7 +166,7 @@ class _ReceiveOrdersTimeSetPageState extends State<ReceiveOrdersTimeSetPage> {
///弹出提示框
///
DialogUtil.openAlertDialog(context, '接单时间已修改',
'如果您在使用一键订电话机,需要将电话机重新启动后,电话机上才能生效。', '知道了', 372,
'如果您在使用周到安排商家电话机,需要将电话机重新启动后,电话机上才能生效。', '知道了', 372,
fontSize: 30, onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
... ...
... ... @@ -30,7 +30,7 @@ class _WebViewPageState extends State<WebViewPage> {
// We're using a Builder here so we have a context that is below the Scaffold
// to allow calling Scaffold.of(context) so we can show a snackbar.
appBar: SystemAppBar(
'一键订',
'周到安排商家',
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
... ...
... ... @@ -21,6 +21,9 @@ class BaseIndoProvider with ChangeNotifier {
TextEditingController phoneController = TextEditingController();
TextEditingController nameController = TextEditingController();
TextEditingController pnumController = TextEditingController();
List sexList;
List<UserHistoryEntity> userHistorys = []; //历史录入
BaseIndoProvider() {
... ...
... ... @@ -5182,7 +5182,7 @@ class DialogUtil {
Container(
height: ScreenUtil().setWidth(48),
alignment: Alignment.center,
child: Text('欢迎使用一键订',
child: Text('欢迎使用周到安排商家',
style: TextStyle(
fontSize: ScreenUtil().setSp(fontSize),
fontWeight: FontWeight.bold,
... ... @@ -5202,7 +5202,7 @@ class DialogUtil {
ScreenUtil()
.setWidth(2)), //1为 StrutStyle 的 leading的值
child: Text(
'登录一键订前,请先阅读并同意',
'登录周到安排商家前,请先阅读并同意',
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(30),
... ...