Commit 8f363ca9fc3eb55c3aa768c5fec1b35d0794c955

Authored by wdn127929
2 parents 3613c028 b85d4654

合并4.3.0修改的周到安排商家和预订安排页面就餐人数选择变输入框

@@ -12,6 +12,7 @@ if (flutterRoot == null) { @@ -12,6 +12,7 @@ if (flutterRoot == null) {
12 } 12 }
13 13
14 14
  15 +
15 def flutterVersionCode = "450" 16 def flutterVersionCode = "450"
16 if (flutterVersionCode == null) { 17 if (flutterVersionCode == null) {
17 flutterVersionCode = '450' 18 flutterVersionCode = '450'
@@ -20,6 +21,7 @@ if (flutterVersionCode == null) { @@ -20,6 +21,7 @@ if (flutterVersionCode == null) {
20 def flutterVersionName = "4.5.0" 21 def flutterVersionName = "4.5.0"
21 if (flutterVersionName == null) { 22 if (flutterVersionName == null) {
22 flutterVersionName = '4.5.0' 23 flutterVersionName = '4.5.0'
  24 +
23 } 25 }
24 apply plugin: 'com.android.application' 26 apply plugin: 'com.android.application'
25 apply plugin: 'kotlin-android' 27 apply plugin: 'kotlin-android'
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 21
22 <application 22 <application
23 23
24 - android:label="一键订" 24 + android:label="周到安排商家"
25 tools:replace="android:label" 25 tools:replace="android:label"
26 android:icon="@mipmap/ic_launcher"> 26 android:icon="@mipmap/ic_launcher">
27 <activity 27 <activity
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <key>CFBundleDevelopmentRegion</key> 7 <key>CFBundleDevelopmentRegion</key>
8 <string>$(DEVELOPMENT_LANGUAGE)</string> 8 <string>$(DEVELOPMENT_LANGUAGE)</string>
9 <key>CFBundleDisplayName</key> 9 <key>CFBundleDisplayName</key>
10 - <string>一键订</string> 10 + <string>周到安排商家</string>
11 <key>CFBundleExecutable</key> 11 <key>CFBundleExecutable</key>
12 <string>$(EXECUTABLE_NAME)</string> 12 <string>$(EXECUTABLE_NAME)</string>
13 <key>CFBundleIdentifier</key> 13 <key>CFBundleIdentifier</key>
@@ -243,7 +243,7 @@ class MyAppState extends State<MyApp> { @@ -243,7 +243,7 @@ class MyAppState extends State<MyApp> {
243 builder: (context, child) { 243 builder: (context, child) {
244 return MaterialApp( 244 return MaterialApp(
245 debugShowCheckedModeBanner: false, 245 debugShowCheckedModeBanner: false,
246 - title: '一键订', 246 + title: '周到安排商家',
247 // navigatorKey: App.getIt<NavigateService>().key, 247 // navigatorKey: App.getIt<NavigateService>().key,
248 //国际化 248 //国际化
249 localizationsDelegates: const [ 249 localizationsDelegates: const [
@@ -1032,7 +1032,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -1032,7 +1032,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
1032 return true; 1032 return true;
1033 } 1033 }
1034 lastBack = DateTime.now(); 1034 lastBack = DateTime.now();
1035 - Utils.showToast("再次返回退出一键订"); 1035 + Utils.showToast("再次返回退出周到安排商家");
1036 return false; 1036 return false;
1037 }, 1037 },
1038 ); 1038 );
@@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage> @@ -89,6 +89,7 @@ class InvicationPageState extends State<InvicationPage>
89 String nameStr; 89 String nameStr;
90 FocusNode _nameNode = FocusNode(); 90 FocusNode _nameNode = FocusNode();
91 FocusNode _phoneNode = FocusNode(); 91 FocusNode _phoneNode = FocusNode();
  92 + FocusNode _pnumNode = FocusNode();
92 bool showPhoneHistory = false; //显示客户历史记录 93 bool showPhoneHistory = false; //显示客户历史记录
93 EasyContactPicker _contactPicker = EasyContactPicker(); 94 EasyContactPicker _contactPicker = EasyContactPicker();
94 95
@@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage> @@ -144,6 +145,9 @@ class InvicationPageState extends State<InvicationPage>
144 MyTextSelectionControls _myExtendedMaterialTextSelectionControls = 145 MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
145 MyTextSelectionControls(); 146 MyTextSelectionControls();
146 147
  148 + MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
  149 + MyTextSelectionControls();
  150 +
147 @override 151 @override
148 void initState() { 152 void initState() {
149 super.initState(); 153 super.initState();
@@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage> @@ -205,6 +209,25 @@ class InvicationPageState extends State<InvicationPage>
205 } 209 }
206 }); 210 });
207 211
  212 + _pnumNode.addListener(() {
  213 + if (_pnumNode.hasFocus) {
  214 + showOverlay(context);
  215 + setState(() {});
  216 + Scrollable.ensureVisible(botGlobalKey.currentContext);
  217 + } else {
  218 + if (!needBack &&
  219 + !needBlack &&
  220 + !needHistory &&
  221 + !_nameNode.hasFocus &&
  222 + !_cusdemNode.hasFocus &&
  223 + !needWechat) {
  224 + _showConfirmWidget();
  225 + }
  226 +
  227 + removeOverlay();
  228 + }
  229 + });
  230 +
208 WidgetsBinding.instance.addPostFrameCallback((_) async { 231 WidgetsBinding.instance.addPostFrameCallback((_) async {
209 _myExtendedMaterialTextSelectionControls = 232 _myExtendedMaterialTextSelectionControls =
210 MyTextSelectionControls(callback: (value) { 233 MyTextSelectionControls(callback: (value) {
@@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage> @@ -214,6 +237,14 @@ class InvicationPageState extends State<InvicationPage>
214 affinity: TextAffinity.downstream, 237 affinity: TextAffinity.downstream,
215 offset: value.toString().length))); 238 offset: value.toString().length)));
216 }); 239 });
  240 + _myExtendedMaterialTextSelectionControlsNum =
  241 + MyTextSelectionControls(callback: (value) {
  242 + _baseIndoProvider.pnumController.value = TextEditingValue(
  243 + text: value,
  244 + selection: TextSelection.fromPosition(TextPosition(
  245 + affinity: TextAffinity.downstream,
  246 + offset: value.toString().length)));
  247 + });
217 couponProvider.sendSMS = 0; 248 couponProvider.sendSMS = 0;
218 await _couponNetworkData(isShowLoading: false); 249 await _couponNetworkData(isShowLoading: false);
219 await _getCustomerActivityBaseinfo(); 250 await _getCustomerActivityBaseinfo();
@@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage> @@ -896,9 +927,10 @@ class InvicationPageState extends State<InvicationPage>
896 // weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}"; 927 // weekInfoAndLunarCalendar = "星期${Utils.formatWeekDayNum(dateTime.weekday)}";
897 weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context); 928 weekInfoAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
898 detailModel.selectNum = detailEntity.actual_pum; 929 detailModel.selectNum = detailEntity.actual_pum;
899 - detailModel.selectIndex = detailEntity.actual_pum != null  
900 - ? personNumList.indexOf(detailEntity.actual_pum)  
901 - : null; 930 + _baseIndoProvider.pnumController.text = detailEntity.actual_pum ?? '';
  931 + // detailModel.selectIndex = detailEntity.actual_pum != null
  932 + // ? personNumList.indexOf(detailEntity.actual_pum)
  933 + // : null;
902 setState(() {}); 934 setState(() {});
903 } 935 }
904 936
@@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage> @@ -1462,79 +1494,168 @@ class InvicationPageState extends State<InvicationPage>
1462 fontSize: ScreenUtil().setSp(28)), 1494 fontSize: ScreenUtil().setSp(28)),
1463 ), 1495 ),
1464 Expanded( 1496 Expanded(
1465 - child: InkWell(  
1466 - onTap: () {  
1467 - FocusScope.of(context)  
1468 - .requestFocus(FocusNode()); //隐藏键盘  
1469 - DialogUtil.showSelectCusmanDialog(  
1470 - context, personNumList,  
1471 - (value) async {  
1472 - if (value != null) {  
1473 - detailModel.selectIndex =  
1474 - value.first;  
1475 - detailModel.selectNum =  
1476 - personNumList[value.first];  
1477 - // detailModel  
1478 - // .notifyListeners();  
1479 - // setState(() {  
1480 - // selectPnum = value.first;  
1481 - // pnum = pnumlist[value.first];  
1482 - // });  
1483 - bool sucess =  
1484 - await detailModel.upReserveInfo(  
1485 - context, widget.rid,  
1486 - actualPum:  
1487 - detailModel.selectNum,  
1488 - needToast: false);  
1489 -  
1490 - if (sucess) {  
1491 - EventBus().emit(  
1492 - "refresh_tablemanager"); //刷新桌位  
1493 - bus.emit(  
1494 - "refresh_book_list"); //刷新已预订列表  
1495 - bus.emit("refresh_detail");  
1496 - await _getReserveDetail(  
1497 - showCicle: false);  
1498 - }  
1499 - }  
1500 - },  
1501 - selecteds: detailModel  
1502 - .selectIndex ==  
1503 - null  
1504 - ? []  
1505 - : [detailModel.selectIndex])  
1506 - .then((value) {});  
1507 - },  
1508 - child: Container(  
1509 - alignment: Alignment.center,  
1510 - child: Text(  
1511 - detailEntity.actual_pum == null ||  
1512 - detailEntity.actual_pum ==  
1513 - ''  
1514 - ? '选填'  
1515 - : detailEntity.actual_pum,  
1516 - style: TextStyle(  
1517 - fontSize:  
1518 - ScreenUtil().setSp(28),  
1519 - color: detailEntity  
1520 - .actual_pum ==  
1521 - null ||  
1522 - detailEntity  
1523 - .actual_pum ==  
1524 - ''  
1525 - ? MyColours.color_999999  
1526 - : MyColours  
1527 - .color_515151))), 1497 + child: TextField(
  1498 + textAlign: TextAlign.center,
  1499 + selectionControls:
  1500 + _myExtendedMaterialTextSelectionControlsNum,
  1501 + maxLines: 1,
  1502 + //输入文本的样式
  1503 + style: TextStyle(
  1504 + fontSize: ScreenUtil().setSp(28),
  1505 + color: MyColours.color_515151),
  1506 + controller:
  1507 + _baseIndoProvider.pnumController,
  1508 + focusNode: _pnumNode,
  1509 + // textAlignVertical: TextAlignVertical.top,
  1510 + decoration: InputDecoration(
  1511 + hintText: "选填",
  1512 + hintStyle: TextStyle(
  1513 + color: MyColours.color_999999,
  1514 + fontSize: ScreenUtil().setSp(28),
  1515 + ),
  1516 + contentPadding: EdgeInsets.zero,
  1517 + border: OutlineInputBorder(
  1518 + borderSide: BorderSide.none),
1528 ), 1519 ),
1529 -  
1530 - // HEmptyView(6),  
1531 - // Image.asset(  
1532 - // Utils.getImgPath(  
1533 - // false ? 'c_arrow_up' : 'c_arrow_down'),  
1534 - // width: ScreenUtil().setWidth(28),  
1535 - // // height: ScreenUtil().setWidth(10),  
1536 - // ),  
1537 - ), 1520 + onChanged: (value) async {
  1521 + //操作
  1522 + _baseIndoProvider.pnumController.text =
  1523 + value;
  1524 + //添加的代码:光标一直在文本框后面
  1525 + _baseIndoProvider.pnumController.value =
  1526 + TextEditingValue(
  1527 + text: _baseIndoProvider
  1528 + .pnumController.text,
  1529 + selection:
  1530 + TextSelection.fromPosition(
  1531 + TextPosition(
  1532 + affinity:
  1533 + TextAffinity.downstream,
  1534 + offset: _baseIndoProvider
  1535 + .pnumController.text.length,
  1536 + )));
  1537 +
  1538 + print(value);
  1539 + // if (value.trim().isEmpty) {
  1540 + // //内容为空,或 超过11位
  1541 + // setState(() {
  1542 + // _baseIndoProvider.userHistorys
  1543 + // .clear();
  1544 + // });
  1545 + // return;
  1546 + // }
  1547 + if (value != null) {
  1548 + detailModel.selectNum = value;
  1549 + // detailModel
  1550 + // .notifyListeners();
  1551 + // setState(() {
  1552 + // selectPnum = value.first;
  1553 + // pnum = pnumlist[value.first];
  1554 + // });
  1555 + bool sucess = await detailModel
  1556 + .upReserveInfo(context, widget.rid,
  1557 + actualPum:
  1558 + detailModel.selectNum,
  1559 + needToast: false);
  1560 +
  1561 + if (sucess) {
  1562 + EventBus().emit(
  1563 + "refresh_tablemanager"); //刷新桌位
  1564 + bus.emit(
  1565 + "refresh_book_list"); //刷新已预订列表
  1566 + bus.emit("refresh_detail");
  1567 + // await _getReserveDetail(
  1568 + // showCicle: false);
  1569 + }
  1570 + }
  1571 + },
  1572 + onEditingComplete: () {
  1573 + _pnumNode.unfocus();
  1574 + },
  1575 + onTap: () {
  1576 + // setState(() {
  1577 + // showPhoneHistory = true;
  1578 + // });
  1579 + // // Future.delayed(Duration(milliseconds: 300), () {
  1580 + // // _controller.jumpTo(_controller.position.maxScrollExtent);
  1581 + // // });
  1582 + },
  1583 + keyboardType: TextInputType.number,
  1584 + )),
  1585 + // Expanded(
  1586 + // child: InkWell(
  1587 + // onTap: () {
  1588 + // FocusScope.of(context)
  1589 + // .requestFocus(FocusNode()); //隐藏键盘
  1590 + // DialogUtil.showSelectCusmanDialog(
  1591 + // context, personNumList,
  1592 + // (value) async {
  1593 + // if (value != null) {
  1594 + // detailModel.selectIndex =
  1595 + // value.first;
  1596 + // detailModel.selectNum =
  1597 + // personNumList[value.first];
  1598 + // // detailModel
  1599 + // // .notifyListeners();
  1600 + // // setState(() {
  1601 + // // selectPnum = value.first;
  1602 + // // pnum = pnumlist[value.first];
  1603 + // // });
  1604 + // bool sucess =
  1605 + // await detailModel.upReserveInfo(
  1606 + // context, widget.rid,
  1607 + // actualPum:
  1608 + // detailModel.selectNum,
  1609 + // needToast: false);
  1610 +
  1611 + // if (sucess) {
  1612 + // EventBus().emit(
  1613 + // "refresh_tablemanager"); //刷新桌位
  1614 + // bus.emit(
  1615 + // "refresh_book_list"); //刷新已预订列表
  1616 + // bus.emit("refresh_detail");
  1617 + // await _getReserveDetail(
  1618 + // showCicle: false);
  1619 + // }
  1620 + // }
  1621 + // },
  1622 + // selecteds: detailModel
  1623 + // .selectIndex ==
  1624 + // null
  1625 + // ? []
  1626 + // : [detailModel.selectIndex])
  1627 + // .then((value) {});
  1628 + // },
  1629 + // child: Container(
  1630 + // alignment: Alignment.center,
  1631 + // child: Text(
  1632 + // detailEntity.actual_pum == null ||
  1633 + // detailEntity.actual_pum ==
  1634 + // ''
  1635 + // ? '选填'
  1636 + // : detailEntity.actual_pum,
  1637 + // style: TextStyle(
  1638 + // fontSize:
  1639 + // ScreenUtil().setSp(28),
  1640 + // color: detailEntity
  1641 + // .actual_pum ==
  1642 + // null ||
  1643 + // detailEntity
  1644 + // .actual_pum ==
  1645 + // ''
  1646 + // ? MyColours.color_999999
  1647 + // : MyColours
  1648 + // .color_515151))),
  1649 + // ),
  1650 +
  1651 + // // HEmptyView(6),
  1652 + // // Image.asset(
  1653 + // // Utils.getImgPath(
  1654 + // // false ? 'c_arrow_up' : 'c_arrow_down'),
  1655 + // // width: ScreenUtil().setWidth(28),
  1656 + // // // height: ScreenUtil().setWidth(10),
  1657 + // // ),
  1658 + // ),
1538 ]))), 1659 ]))),
1539 MyDivider( 1660 MyDivider(
1540 ScreenUtil().setWidth(2), ScreenUtil().setWidth(46), 1661 ScreenUtil().setWidth(2), ScreenUtil().setWidth(46),
@@ -134,7 +134,7 @@ class _FirstPageState extends State<FirstPage> { @@ -134,7 +134,7 @@ class _FirstPageState extends State<FirstPage> {
134 crossAxisAlignment: CrossAxisAlignment.start, 134 crossAxisAlignment: CrossAxisAlignment.start,
135 children: [ 135 children: [
136 Text( 136 Text(
137 - '亲爱的用户,感谢您信任并使用一键订!', 137 + '亲爱的用户,感谢您信任并使用周到安排商家!',
138 style: TextStyle( 138 style: TextStyle(
139 color: MyColours.color_333333, 139 color: MyColours.color_333333,
140 fontSize: ScreenUtil().setSp(28), 140 fontSize: ScreenUtil().setSp(28),
@@ -254,7 +254,7 @@ class _FirstPageState extends State<FirstPage> { @@ -254,7 +254,7 @@ class _FirstPageState extends State<FirstPage> {
254 //修改之前有内容,则弹框 254 //修改之前有内容,则弹框
255 DialogUtil.cupertinoAlertDialog(context, 255 DialogUtil.cupertinoAlertDialog(context,
256 title: "", 256 title: "",
257 - content: "您需要同意《一键订隐私政策》,才能继续使用我们的服务哦。", 257 + content: "您需要同意《周到安排商家隐私政策》,才能继续使用我们的服务哦。",
258 lTitle: "暂不", 258 lTitle: "暂不",
259 rTitle: "去同意", lCallback: () { 259 rTitle: "去同意", lCallback: () {
260 print("取消"); 260 print("取消");
@@ -820,7 +820,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -820,7 +820,7 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
820 child: Row( 820 child: Row(
821 mainAxisAlignment: MainAxisAlignment.center, 821 mainAxisAlignment: MainAxisAlignment.center,
822 children: [ 822 children: [
823 - Text('一键订账号登录', 823 + Text('周到安排商家账号登录',
824 style: TextStyle( 824 style: TextStyle(
825 color: MyColours.color_ffffff, 825 color: MyColours.color_ffffff,
826 fontSize: ScreenUtil().setSp(28), 826 fontSize: ScreenUtil().setSp(28),
@@ -166,7 +166,7 @@ class _ReceiveOrdersTimeSetPageState extends State<ReceiveOrdersTimeSetPage> { @@ -166,7 +166,7 @@ class _ReceiveOrdersTimeSetPageState extends State<ReceiveOrdersTimeSetPage> {
166 ///弹出提示框 166 ///弹出提示框
167 /// 167 ///
168 DialogUtil.openAlertDialog(context, '接单时间已修改', 168 DialogUtil.openAlertDialog(context, '接单时间已修改',
169 - '如果您在使用一键订电话机,需要将电话机重新启动后,电话机上才能生效。', '知道了', 372, 169 + '如果您在使用周到安排商家电话机,需要将电话机重新启动后,电话机上才能生效。', '知道了', 372,
170 fontSize: 30, onTap: () { 170 fontSize: 30, onTap: () {
171 EventBus().emit('changeStatusColor'); 171 EventBus().emit('changeStatusColor');
172 Navigator.of(context).pop(); 172 Navigator.of(context).pop();
@@ -30,7 +30,7 @@ class _WebViewPageState extends State<WebViewPage> { @@ -30,7 +30,7 @@ class _WebViewPageState extends State<WebViewPage> {
30 // We're using a Builder here so we have a context that is below the Scaffold 30 // We're using a Builder here so we have a context that is below the Scaffold
31 // to allow calling Scaffold.of(context) so we can show a snackbar. 31 // to allow calling Scaffold.of(context) so we can show a snackbar.
32 appBar: SystemAppBar( 32 appBar: SystemAppBar(
33 - '一键订', 33 + '周到安排商家',
34 onTap: () { 34 onTap: () {
35 EventBus().emit('changeStatusColor'); 35 EventBus().emit('changeStatusColor');
36 Navigator.of(context).pop(); 36 Navigator.of(context).pop();
@@ -21,6 +21,9 @@ class BaseIndoProvider with ChangeNotifier { @@ -21,6 +21,9 @@ class BaseIndoProvider with ChangeNotifier {
21 21
22 TextEditingController phoneController = TextEditingController(); 22 TextEditingController phoneController = TextEditingController();
23 TextEditingController nameController = TextEditingController(); 23 TextEditingController nameController = TextEditingController();
  24 + TextEditingController pnumController = TextEditingController();
  25 +
  26 +
24 List sexList; 27 List sexList;
25 List<UserHistoryEntity> userHistorys = []; //历史录入 28 List<UserHistoryEntity> userHistorys = []; //历史录入
26 BaseIndoProvider() { 29 BaseIndoProvider() {
@@ -5182,7 +5182,7 @@ class DialogUtil { @@ -5182,7 +5182,7 @@ class DialogUtil {
5182 Container( 5182 Container(
5183 height: ScreenUtil().setWidth(48), 5183 height: ScreenUtil().setWidth(48),
5184 alignment: Alignment.center, 5184 alignment: Alignment.center,
5185 - child: Text('欢迎使用一键订', 5185 + child: Text('欢迎使用周到安排商家',
5186 style: TextStyle( 5186 style: TextStyle(
5187 fontSize: ScreenUtil().setSp(fontSize), 5187 fontSize: ScreenUtil().setSp(fontSize),
5188 fontWeight: FontWeight.bold, 5188 fontWeight: FontWeight.bold,
@@ -5202,7 +5202,7 @@ class DialogUtil { @@ -5202,7 +5202,7 @@ class DialogUtil {
5202 ScreenUtil() 5202 ScreenUtil()
5203 .setWidth(2)), //1为 StrutStyle 的 leading的值 5203 .setWidth(2)), //1为 StrutStyle 的 leading的值
5204 child: Text( 5204 child: Text(
5205 - '登录一键订前,请先阅读并同意', 5205 + '登录周到安排商家前,请先阅读并同意',
5206 style: TextStyle( 5206 style: TextStyle(
5207 color: MyColours.color_333333, 5207 color: MyColours.color_333333,
5208 fontSize: ScreenUtil().setSp(30), 5208 fontSize: ScreenUtil().setSp(30),