Showing
5 changed files
with
264 additions
and
135 deletions
| @@ -508,8 +508,7 @@ | @@ -508,8 +508,7 @@ | ||
| 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 509 | CLANG_ENABLE_MODULES = YES; | 509 | CLANG_ENABLE_MODULES = YES; |
| 510 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 510 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 511 | - CODE_SIGN_IDENTITY = "iPhone Developer"; | ||
| 512 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | 511 | + CODE_SIGN_IDENTITY = "Apple Development"; |
| 513 | CODE_SIGN_STYLE = Automatic; | 512 | CODE_SIGN_STYLE = Automatic; |
| 514 | CURRENT_PROJECT_VERSION = 466; | 513 | CURRENT_PROJECT_VERSION = 466; |
| 515 | DEVELOPMENT_TEAM = 8J59HM8B82; | 514 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| @@ -655,12 +654,12 @@ | @@ -655,12 +654,12 @@ | ||
| 655 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 654 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 656 | CLANG_ENABLE_MODULES = YES; | 655 | CLANG_ENABLE_MODULES = YES; |
| 657 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; | 656 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; |
| 658 | - CODE_SIGN_IDENTITY = "iPhone Developer"; | 657 | + CODE_SIGN_IDENTITY = "Apple Development"; |
| 659 | CODE_SIGN_STYLE = Automatic; | 658 | CODE_SIGN_STYLE = Automatic; |
| 660 | CURRENT_PROJECT_VERSION = 466; | 659 | CURRENT_PROJECT_VERSION = 466; |
| 661 | DEVELOPMENT_TEAM = 8J59HM8B82; | 660 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 662 | ENABLE_BITCODE = NO; | 661 | ENABLE_BITCODE = NO; |
| 663 | - FLUTTER_BUILD_MODE = debug; | 662 | + FLUTTER_BUILD_MODE = release; |
| 664 | FRAMEWORK_SEARCH_PATHS = ( | 663 | FRAMEWORK_SEARCH_PATHS = ( |
| 665 | "$(inherited)", | 664 | "$(inherited)", |
| 666 | "$(PROJECT_DIR)/Flutter", | 665 | "$(PROJECT_DIR)/Flutter", |
| @@ -691,7 +690,7 @@ | @@ -691,7 +690,7 @@ | ||
| 691 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 690 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 692 | CLANG_ENABLE_MODULES = YES; | 691 | CLANG_ENABLE_MODULES = YES; |
| 693 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 692 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 694 | - CODE_SIGN_IDENTITY = "iPhone Developer"; | 693 | + CODE_SIGN_IDENTITY = "Apple Development"; |
| 695 | CODE_SIGN_STYLE = Automatic; | 694 | CODE_SIGN_STYLE = Automatic; |
| 696 | CURRENT_PROJECT_VERSION = 466; | 695 | CURRENT_PROJECT_VERSION = 466; |
| 697 | DEVELOPMENT_TEAM = 8J59HM8B82; | 696 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| @@ -71,6 +71,7 @@ class _CouponSunPageState extends State<CouponSunPage> { | @@ -71,6 +71,7 @@ class _CouponSunPageState extends State<CouponSunPage> { | ||
| 71 | Map<String, String> params = { | 71 | Map<String, String> params = { |
| 72 | "id": couponProvider.couponList[index].id, | 72 | "id": couponProvider.couponList[index].id, |
| 73 | "status": couponProvider.couponList[index].isOpenBool ? '1' : '0', | 73 | "status": couponProvider.couponList[index].isOpenBool ? '1' : '0', |
| 74 | + 'is_open': couponProvider.couponList[index].isOpenBool ? '1' : '0', | ||
| 74 | }; | 75 | }; |
| 75 | bool isSuccess = await couponProvider.setCustomerActivity(context, params, | 76 | bool isSuccess = await couponProvider.setCustomerActivity(context, params, |
| 76 | isShowLoading: false); | 77 | isShowLoading: false); |
| @@ -104,6 +104,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -104,6 +104,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 104 | MyTextSelectionControls _myExtendedMaterialTextSelectionControls = | 104 | MyTextSelectionControls _myExtendedMaterialTextSelectionControls = |
| 105 | MyTextSelectionControls(); | 105 | MyTextSelectionControls(); |
| 106 | 106 | ||
| 107 | + TextEditingController pnumC = TextEditingController(); | ||
| 108 | + FocusNode pnumF = FocusNode(); | ||
| 109 | + FocusNode priceF = FocusNode(); | ||
| 110 | + | ||
| 107 | @override | 111 | @override |
| 108 | void initState() { | 112 | void initState() { |
| 109 | // TODO: implement initState | 113 | // TODO: implement initState |
| @@ -120,7 +124,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -120,7 +124,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 120 | _initCancel(); | 124 | _initCancel(); |
| 121 | _getReserveDetail(); | 125 | _getReserveDetail(); |
| 122 | _getOrderInfo(); | 126 | _getOrderInfo(); |
| 123 | - _initPersonNumList(); | 127 | + // _initPersonNumList(); |
| 124 | Map<String, String> params = { | 128 | Map<String, String> params = { |
| 125 | "uid": Provider.of<UserModel>(context, listen: false).user.openid | 129 | "uid": Provider.of<UserModel>(context, listen: false).user.openid |
| 126 | }; | 130 | }; |
| @@ -345,10 +349,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -345,10 +349,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 345 | showCircle: showCicle); | 349 | showCircle: showCicle); |
| 346 | _initTime(int.parse(detailEntity.ddate_solt)); | 350 | _initTime(int.parse(detailEntity.ddate_solt)); |
| 347 | setState(() { | 351 | setState(() { |
| 348 | - detailModel.selectNum = detailEntity.actual_pum; | ||
| 349 | - detailModel.selectIndex = detailEntity.actual_pum != null | ||
| 350 | - ? personNumList.indexOf(detailEntity.actual_pum) | ||
| 351 | - : null; | 352 | + // detailModel.selectNum = detailEntity.actual_pum; |
| 353 | + // detailModel.selectIndex = detailEntity.actual_pum != null | ||
| 354 | + // ? personNumList.indexOf(detailEntity.actual_pum) | ||
| 355 | + // : null; | ||
| 356 | + pnumC.text = detailEntity.actual_pum; | ||
| 352 | if (detailEntity.con_amount != null) { | 357 | if (detailEntity.con_amount != null) { |
| 353 | detailModel.prestrTF = detailEntity.con_amount; | 358 | detailModel.prestrTF = detailEntity.con_amount; |
| 354 | detailModel.numController.text = detailEntity.con_amount; | 359 | detailModel.numController.text = detailEntity.con_amount; |
| @@ -1407,57 +1412,80 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1407,57 +1412,80 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1407 | // ? false | 1412 | // ? false |
| 1408 | // : true, | 1413 | // : true, |
| 1409 | // child: | 1414 | // child: |
| 1410 | - TitleAndBtn( | 1415 | + // TitleAndBtn( |
| 1416 | + // title: "人数", | ||
| 1417 | + // content: | ||
| 1418 | + // detailEntity.actual_pum, | ||
| 1419 | + // list: personNumList, | ||
| 1420 | + // detailModel: model, | ||
| 1421 | + // callback: () { | ||
| 1422 | + // FocusScope.of(context) | ||
| 1423 | + // .requestFocus( | ||
| 1424 | + // FocusNode()); //隐藏键盘 | ||
| 1425 | + // DialogUtil.showSelectCusmanDialog( | ||
| 1426 | + // context, | ||
| 1427 | + // personNumList, | ||
| 1428 | + // (value) async { | ||
| 1429 | + // if (value != null) { | ||
| 1430 | + // detailModel.selectIndex = | ||
| 1431 | + // value.first; | ||
| 1432 | + // detailModel.selectNum = | ||
| 1433 | + // personNumList[ | ||
| 1434 | + // value.first]; | ||
| 1435 | + // // detailModel | ||
| 1436 | + // // .notifyListeners(); | ||
| 1437 | + // // setState(() { | ||
| 1438 | + // // selectPnum = value.first; | ||
| 1439 | + // // pnum = pnumlist[value.first]; | ||
| 1440 | + // // }); | ||
| 1441 | + // bool sucess = await detailModel | ||
| 1442 | + // .upReserveInfo( | ||
| 1443 | + // context, | ||
| 1444 | + // widget.rid, | ||
| 1445 | + // actualPum: | ||
| 1446 | + // detailModel | ||
| 1447 | + // .selectNum); | ||
| 1448 | + | ||
| 1449 | + // if (sucess) { | ||
| 1450 | + // EventBus().emit( | ||
| 1451 | + // "refresh_tablemanager"); //刷新桌位 | ||
| 1452 | + // await _getReserveDetail( | ||
| 1453 | + // showCicle: false); | ||
| 1454 | + // } | ||
| 1455 | + // } | ||
| 1456 | + // }, | ||
| 1457 | + // selecteds: detailModel | ||
| 1458 | + // .selectIndex == | ||
| 1459 | + // null | ||
| 1460 | + // ? [] | ||
| 1461 | + // : [ | ||
| 1462 | + // detailModel | ||
| 1463 | + // .selectIndex | ||
| 1464 | + // ]) | ||
| 1465 | + // .then((value) {}); | ||
| 1466 | + // }), | ||
| 1467 | + TitleAndTextfield( | ||
| 1411 | title: "人数", | 1468 | title: "人数", |
| 1412 | - content: | ||
| 1413 | - detailEntity.actual_pum, | ||
| 1414 | - list: personNumList, | ||
| 1415 | - detailModel: model, | ||
| 1416 | - callback: () { | ||
| 1417 | - FocusScope.of(context) | ||
| 1418 | - .requestFocus( | ||
| 1419 | - FocusNode()); //隐藏键盘 | ||
| 1420 | - DialogUtil.showSelectCusmanDialog( | ||
| 1421 | - context, | ||
| 1422 | - personNumList, | ||
| 1423 | - (value) async { | ||
| 1424 | - if (value != null) { | ||
| 1425 | - detailModel.selectIndex = | ||
| 1426 | - value.first; | ||
| 1427 | - detailModel.selectNum = | ||
| 1428 | - personNumList[ | ||
| 1429 | - value.first]; | ||
| 1430 | - // detailModel | ||
| 1431 | - // .notifyListeners(); | ||
| 1432 | - // setState(() { | ||
| 1433 | - // selectPnum = value.first; | ||
| 1434 | - // pnum = pnumlist[value.first]; | ||
| 1435 | - // }); | ||
| 1436 | - bool sucess = await detailModel | 1469 | + detailModel: detailModel, |
| 1470 | + rid: widget.rid, | ||
| 1471 | + isPrice: false, | ||
| 1472 | + controller: pnumC, | ||
| 1473 | + focusNode: pnumF, | ||
| 1474 | + callback: () async { | ||
| 1475 | + bool sucess = | ||
| 1476 | + await detailModel | ||
| 1437 | .upReserveInfo( | 1477 | .upReserveInfo( |
| 1438 | context, | 1478 | context, |
| 1439 | widget.rid, | 1479 | widget.rid, |
| 1440 | actualPum: | 1480 | actualPum: |
| 1441 | - detailModel | ||
| 1442 | - .selectNum); | ||
| 1443 | - | ||
| 1444 | - if (sucess) { | ||
| 1445 | - EventBus().emit( | ||
| 1446 | - "refresh_tablemanager"); //刷新桌位 | ||
| 1447 | - await _getReserveDetail( | ||
| 1448 | - showCicle: false); | ||
| 1449 | - } | ||
| 1450 | - } | ||
| 1451 | - }, | ||
| 1452 | - selecteds: detailModel | ||
| 1453 | - .selectIndex == | ||
| 1454 | - null | ||
| 1455 | - ? [] | ||
| 1456 | - : [ | ||
| 1457 | - detailModel | ||
| 1458 | - .selectIndex | ||
| 1459 | - ]) | ||
| 1460 | - .then((value) {}); | 1481 | + pnumC.text); |
| 1482 | + | ||
| 1483 | + if (sucess) { | ||
| 1484 | + EventBus().emit( | ||
| 1485 | + "refresh_tablemanager"); //刷新桌位 | ||
| 1486 | + await _getReserveDetail( | ||
| 1487 | + showCicle: false); | ||
| 1488 | + } | ||
| 1461 | }), | 1489 | }), |
| 1462 | // ), | 1490 | // ), |
| 1463 | // Offstage( | 1491 | // Offstage( |
| @@ -1516,6 +1544,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1516,6 +1544,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1516 | title: "消费金额", | 1544 | title: "消费金额", |
| 1517 | detailModel: detailModel, | 1545 | detailModel: detailModel, |
| 1518 | rid: widget.rid, | 1546 | rid: widget.rid, |
| 1547 | + isPrice: true, | ||
| 1548 | + controller: | ||
| 1549 | + detailModel.numController, | ||
| 1550 | + focusNode: priceF, | ||
| 1519 | ), | 1551 | ), |
| 1520 | Offstage( | 1552 | Offstage( |
| 1521 | offstage: | 1553 | offstage: |
| @@ -3323,6 +3355,11 @@ class TitleAndTextfield extends StatefulWidget { | @@ -3323,6 +3355,11 @@ class TitleAndTextfield extends StatefulWidget { | ||
| 3323 | final List<String> pnumlist; | 3355 | final List<String> pnumlist; |
| 3324 | final NotebookDetailModel detailModel; | 3356 | final NotebookDetailModel detailModel; |
| 3325 | final String rid; | 3357 | final String rid; |
| 3358 | + final TextEditingController controller; | ||
| 3359 | + final FocusNode focusNode; | ||
| 3360 | + final bool isPrice; | ||
| 3361 | + | ||
| 3362 | + final VoidCallback callback; | ||
| 3326 | 3363 | ||
| 3327 | const TitleAndTextfield( | 3364 | const TitleAndTextfield( |
| 3328 | {Key key, | 3365 | {Key key, |
| @@ -3330,7 +3367,11 @@ class TitleAndTextfield extends StatefulWidget { | @@ -3330,7 +3367,11 @@ class TitleAndTextfield extends StatefulWidget { | ||
| 3330 | this.bookNum, | 3367 | this.bookNum, |
| 3331 | this.pnumlist, | 3368 | this.pnumlist, |
| 3332 | this.detailModel, | 3369 | this.detailModel, |
| 3333 | - this.rid}) | 3370 | + this.rid, |
| 3371 | + this.controller, | ||
| 3372 | + this.focusNode, | ||
| 3373 | + this.isPrice = true, | ||
| 3374 | + this.callback}) | ||
| 3334 | : super(key: key); | 3375 | : super(key: key); |
| 3335 | 3376 | ||
| 3336 | @override | 3377 | @override |
| @@ -3338,18 +3379,24 @@ class TitleAndTextfield extends StatefulWidget { | @@ -3338,18 +3379,24 @@ class TitleAndTextfield extends StatefulWidget { | ||
| 3338 | } | 3379 | } |
| 3339 | 3380 | ||
| 3340 | class _TitleAndTextfieldState extends State<TitleAndTextfield> { | 3381 | class _TitleAndTextfieldState extends State<TitleAndTextfield> { |
| 3341 | - FocusNode numberFocusNode = new FocusNode(); | 3382 | + // FocusNode numberFocusNode = new FocusNode(); |
| 3342 | OverlayEntry overlayEntry; | 3383 | OverlayEntry overlayEntry; |
| 3343 | @override | 3384 | @override |
| 3344 | void initState() { | 3385 | void initState() { |
| 3345 | super.initState(); | 3386 | super.initState(); |
| 3346 | 3387 | ||
| 3347 | // if (Platform.isIOS) { | 3388 | // if (Platform.isIOS) { |
| 3348 | - numberFocusNode.addListener(() { | ||
| 3349 | - if (numberFocusNode.hasFocus) { | 3389 | + widget.focusNode.addListener(() { |
| 3390 | + if (widget.focusNode.hasFocus) { | ||
| 3350 | showOverlay(context); | 3391 | showOverlay(context); |
| 3351 | } else { | 3392 | } else { |
| 3352 | - _updateMoney(); | 3393 | + if (widget.isPrice) { |
| 3394 | + _updateMoney(); | ||
| 3395 | + } else { | ||
| 3396 | + //人数 | ||
| 3397 | + widget.callback(); | ||
| 3398 | + } | ||
| 3399 | + | ||
| 3353 | removeOverlay(); | 3400 | removeOverlay(); |
| 3354 | } | 3401 | } |
| 3355 | }); | 3402 | }); |
| @@ -3457,18 +3504,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | @@ -3457,18 +3504,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | ||
| 3457 | color: MyColours.color_199095))), | 3504 | color: MyColours.color_199095))), |
| 3458 | child: IntrinsicWidth( | 3505 | child: IntrinsicWidth( |
| 3459 | child: TextField( | 3506 | child: TextField( |
| 3460 | - controller: widget.detailModel.numController, | 3507 | + controller: widget.controller, |
| 3461 | maxLines: 1, | 3508 | maxLines: 1, |
| 3462 | // inputFormatters: [ | 3509 | // inputFormatters: [ |
| 3463 | // LengthLimitingTextInputFormatter(9), | 3510 | // LengthLimitingTextInputFormatter(9), |
| 3464 | // FilteringTextInputFormatter.digitsOnly | 3511 | // FilteringTextInputFormatter.digitsOnly |
| 3465 | // ], | 3512 | // ], |
| 3466 | 3513 | ||
| 3467 | - inputFormatters: [ | ||
| 3468 | - NumLengthInputFormatter( | ||
| 3469 | - decimalLength: 2, integerLength: 6), | ||
| 3470 | - ], | ||
| 3471 | - focusNode: numberFocusNode, | 3514 | + inputFormatters: widget.isPrice |
| 3515 | + ? [ | ||
| 3516 | + NumLengthInputFormatter( | ||
| 3517 | + decimalLength: 2, integerLength: 6), | ||
| 3518 | + ] | ||
| 3519 | + : [], | ||
| 3520 | + focusNode: widget.focusNode, | ||
| 3472 | 3521 | ||
| 3473 | //光标颜色 | 3522 | //光标颜色 |
| 3474 | cursorColor: MyColours.color_199095, | 3523 | cursorColor: MyColours.color_199095, |
| @@ -3485,7 +3534,8 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | @@ -3485,7 +3534,8 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | ||
| 3485 | fontSize: ScreenUtil().setSp(30), | 3534 | fontSize: ScreenUtil().setSp(30), |
| 3486 | ), | 3535 | ), |
| 3487 | prefix: widget.detailModel.strTF != null && | 3536 | prefix: widget.detailModel.strTF != null && |
| 3488 | - widget.detailModel.strTF.trim().length > 0 | 3537 | + widget.detailModel.strTF.trim().length > 0 && |
| 3538 | + widget.isPrice | ||
| 3489 | ? Text("¥", | 3539 | ? Text("¥", |
| 3490 | style: TextStyle(color: MyColours.color_199095)) | 3540 | style: TextStyle(color: MyColours.color_199095)) |
| 3491 | : SizedBox(), | 3541 | : SizedBox(), |
| @@ -3504,17 +3554,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | @@ -3504,17 +3554,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> { | ||
| 3504 | border: OutlineInputBorder(borderSide: BorderSide.none), | 3554 | border: OutlineInputBorder(borderSide: BorderSide.none), |
| 3505 | ), | 3555 | ), |
| 3506 | onChanged: (value) { | 3556 | onChanged: (value) { |
| 3507 | - widget.detailModel.strTF = value; | 3557 | + if (widget.isPrice) { |
| 3558 | + widget.detailModel.strTF = value; | ||
| 3508 | 3559 | ||
| 3509 | - print(widget.detailModel.numController.text); | ||
| 3510 | - widget.detailModel.notifyListeners(); | 3560 | + print(widget.detailModel.numController.text); |
| 3561 | + widget.detailModel.notifyListeners(); | ||
| 3562 | + } | ||
| 3511 | }, | 3563 | }, |
| 3512 | onEditingComplete: () { | 3564 | onEditingComplete: () { |
| 3513 | FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘 | 3565 | FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘 |
| 3514 | // _updateMoney(); | 3566 | // _updateMoney(); |
| 3515 | }, | 3567 | }, |
| 3516 | - keyboardType: | ||
| 3517 | - TextInputType.numberWithOptions(decimal: true), | 3568 | + keyboardType: widget.isPrice |
| 3569 | + ? TextInputType.numberWithOptions(decimal: true) | ||
| 3570 | + : TextInputType.number, | ||
| 3518 | ))), | 3571 | ))), |
| 3519 | ])); | 3572 | ])); |
| 3520 | } | 3573 | } |
| @@ -420,18 +420,21 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -420,18 +420,21 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 420 | child: Row( | 420 | child: Row( |
| 421 | mainAxisAlignment: MainAxisAlignment.spaceBetween, | 421 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 422 | children: [ | 422 | children: [ |
| 423 | - Column( | 423 | + Expanded( |
| 424 | + child: Column( | ||
| 424 | crossAxisAlignment: CrossAxisAlignment.start, | 425 | crossAxisAlignment: CrossAxisAlignment.start, |
| 425 | children: [ | 426 | children: [ |
| 426 | Row( | 427 | Row( |
| 427 | children: [ | 428 | children: [ |
| 428 | - Text( | ||
| 429 | - title, | ||
| 430 | - style: TextStyle( | ||
| 431 | - fontSize: font(14), | ||
| 432 | - fontWeight: FontWeight.bold, | ||
| 433 | - color: MyColours.color_515151), | ||
| 434 | - ), | 429 | + Container( |
| 430 | + constraints: BoxConstraints(maxWidth: w(150)), | ||
| 431 | + child: Text( | ||
| 432 | + title, | ||
| 433 | + style: TextStyle( | ||
| 434 | + fontSize: font(14), | ||
| 435 | + fontWeight: FontWeight.bold, | ||
| 436 | + color: MyColours.color_515151), | ||
| 437 | + )), | ||
| 435 | HEmptyView(20), | 438 | HEmptyView(20), |
| 436 | subtile != '' | 439 | subtile != '' |
| 437 | ? Text( | 440 | ? Text( |
| @@ -472,7 +475,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -472,7 +475,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 472 | color: MyColours.color_515151), | 475 | color: MyColours.color_515151), |
| 473 | ) | 476 | ) |
| 474 | ], | 477 | ], |
| 475 | - ), | 478 | + )), |
| 476 | RoundButton( | 479 | RoundButton( |
| 477 | text: '切换活动', | 480 | text: '切换活动', |
| 478 | width: w(72), | 481 | width: w(72), |
| @@ -758,6 +761,22 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -758,6 +761,22 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 758 | marketingCenterProvider = | 761 | marketingCenterProvider = |
| 759 | Provider.of<MarketingCenterProvider>(context, listen: true); | 762 | Provider.of<MarketingCenterProvider>(context, listen: true); |
| 760 | 763 | ||
| 764 | + String couponsDesc = ''; | ||
| 765 | + if (couponData != null) { | ||
| 766 | + if (couponData.expDate == null) { | ||
| 767 | + couponsDesc = couponData.desc; | ||
| 768 | + } else { | ||
| 769 | + if (couponData.expDate.isNone) { | ||
| 770 | + couponsDesc = '无限制,' + couponData.desc ?? ''; | ||
| 771 | + } else if (couponData.expDate.isBirthday) { | ||
| 772 | + couponsDesc = '会员生日当天可用,' + couponData.desc ?? ''; | ||
| 773 | + } else if (couponData.expDate.isWeek) { | ||
| 774 | + couponsDesc = | ||
| 775 | + '${couponData.expDate.weekShow},' + couponData.desc ?? ''; | ||
| 776 | + } | ||
| 777 | + } | ||
| 778 | + } | ||
| 779 | + | ||
| 761 | return Scaffold( | 780 | return Scaffold( |
| 762 | backgroundColor: MyColours.color_ffffff, | 781 | backgroundColor: MyColours.color_ffffff, |
| 763 | appBar: SystemAppBar( | 782 | appBar: SystemAppBar( |
| @@ -805,9 +824,15 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -805,9 +824,15 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 805 | _headItem('预订安排中附带的营销推广'), | 824 | _headItem('预订安排中附带的营销推广'), |
| 806 | VEmptyView(24), | 825 | VEmptyView(24), |
| 807 | couponData != null | 826 | couponData != null |
| 808 | - ? _markingItem('推荐店内代金券优惠', couponData.aname, | ||
| 809 | - couponData.desc, '100', '5折', select: isCoupon, | ||
| 810 | - onPressedSelect: () { | 827 | + ? _markingItem( |
| 828 | + '推荐店内代金券优惠', | ||
| 829 | + couponData.aname, | ||
| 830 | + couponsDesc, | ||
| 831 | + couponData.price ?? '', | ||
| 832 | + couponData.use != null && couponData.use.isCash | ||
| 833 | + ? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折' | ||
| 834 | + : '', | ||
| 835 | + select: isCoupon, onPressedSelect: () { | ||
| 811 | setState(() { | 836 | setState(() { |
| 812 | isCoupon = !isCoupon; | 837 | isCoupon = !isCoupon; |
| 813 | }); | 838 | }); |
| @@ -80,7 +80,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -80,7 +80,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 80 | BaseIndoProvider _baseIndoProvider; | 80 | BaseIndoProvider _baseIndoProvider; |
| 81 | int sexSelectIndex = 0; | 81 | int sexSelectIndex = 0; |
| 82 | String sexStr = '先生'; | 82 | String sexStr = '先生'; |
| 83 | - String actualPnum = '选填'; | 83 | + // String actualPnum = '选填'; |
| 84 | String ddateHm = '选填'; | 84 | String ddateHm = '选填'; |
| 85 | int actualPnumIndex; | 85 | int actualPnumIndex; |
| 86 | int ddateIndex; | 86 | int ddateIndex; |
| @@ -104,6 +104,12 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -104,6 +104,12 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 104 | // final MySpecialTextSpanBuilder _mySpecialTextSpanBuilder = | 104 | // final MySpecialTextSpanBuilder _mySpecialTextSpanBuilder = |
| 105 | // MySpecialTextSpanBuilder(); | 105 | // MySpecialTextSpanBuilder(); |
| 106 | TextEditingController controller = TextEditingController()..text = 'nnn'; | 106 | TextEditingController controller = TextEditingController()..text = 'nnn'; |
| 107 | + MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum = | ||
| 108 | + MyTextSelectionControls(); | ||
| 109 | + | ||
| 110 | + FocusNode _pnumNode = FocusNode(); | ||
| 111 | + | ||
| 112 | + TextEditingController pnumController = TextEditingController(); | ||
| 107 | 113 | ||
| 108 | @override | 114 | @override |
| 109 | void initState() { | 115 | void initState() { |
| @@ -968,53 +974,98 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -968,53 +974,98 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 968 | fontSize: ScreenUtil().setSp(28)), | 974 | fontSize: ScreenUtil().setSp(28)), |
| 969 | ), | 975 | ), |
| 970 | Expanded( | 976 | Expanded( |
| 971 | - child: InkWell( | ||
| 972 | - onTap: () { | ||
| 973 | - FocusScope.of(context) | ||
| 974 | - .requestFocus( | ||
| 975 | - FocusNode()); //隐藏键盘 | ||
| 976 | - DialogUtil.showSelectCusmanDialog( | ||
| 977 | - context, personNumList, | ||
| 978 | - (value) async { | ||
| 979 | - if (value != null) { | ||
| 980 | - actualPnumIndex = value.first; | ||
| 981 | - actualPnum = personNumList[ | ||
| 982 | - value.first]; | ||
| 983 | - setState(() {}); | ||
| 984 | - } | ||
| 985 | - }, | ||
| 986 | - title: '人数', | ||
| 987 | - selecteds: | ||
| 988 | - actualPnumIndex == | ||
| 989 | - null | ||
| 990 | - ? [] | ||
| 991 | - : [ | ||
| 992 | - actualPnumIndex | ||
| 993 | - ]) | ||
| 994 | - .then((value) {}); | ||
| 995 | - }, | ||
| 996 | - child: Container( | ||
| 997 | - alignment: Alignment.center, | ||
| 998 | - child: Text(actualPnum, | ||
| 999 | - style: TextStyle( | ||
| 1000 | - fontSize: ScreenUtil() | ||
| 1001 | - .setSp(28), | ||
| 1002 | - color: actualPnum == | ||
| 1003 | - '选填' | ||
| 1004 | - ? MyColours | ||
| 1005 | - .color_999999 | ||
| 1006 | - : MyColours | ||
| 1007 | - .color_515151))), | 977 | + child: TextField( |
| 978 | + textAlign: TextAlign.center, | ||
| 979 | + selectionControls: | ||
| 980 | + _myExtendedMaterialTextSelectionControlsNum, | ||
| 981 | + maxLines: 1, | ||
| 982 | + //输入文本的样式 | ||
| 983 | + style: TextStyle( | ||
| 984 | + fontSize: ScreenUtil().setSp(28), | ||
| 985 | + color: MyColours.color_515151), | ||
| 986 | + controller: pnumController, | ||
| 987 | + focusNode: _pnumNode, | ||
| 988 | + // textAlignVertical: TextAlignVertical.top, | ||
| 989 | + decoration: InputDecoration( | ||
| 990 | + hintText: "选填", | ||
| 991 | + hintStyle: TextStyle( | ||
| 992 | + color: MyColours.color_999999, | ||
| 993 | + fontSize: ScreenUtil().setSp(28), | ||
| 994 | + ), | ||
| 995 | + contentPadding: EdgeInsets.zero, | ||
| 996 | + border: OutlineInputBorder( | ||
| 997 | + borderSide: BorderSide.none), | ||
| 1008 | ), | 998 | ), |
| 1009 | - | ||
| 1010 | - // HEmptyView(6), | ||
| 1011 | - // Image.asset( | ||
| 1012 | - // Utils.getImgPath( | ||
| 1013 | - // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 1014 | - // width: ScreenUtil().setWidth(28), | ||
| 1015 | - // // height: ScreenUtil().setWidth(10), | ||
| 1016 | - // ), | ||
| 1017 | - ), | 999 | + onChanged: (value) async { |
| 1000 | + //操作 | ||
| 1001 | + pnumController.text = value; | ||
| 1002 | + //添加的代码:光标一直在文本框后面 | ||
| 1003 | + pnumController.value = | ||
| 1004 | + TextEditingValue( | ||
| 1005 | + text: pnumController.text, | ||
| 1006 | + selection: TextSelection | ||
| 1007 | + .fromPosition( | ||
| 1008 | + TextPosition( | ||
| 1009 | + affinity: TextAffinity | ||
| 1010 | + .downstream, | ||
| 1011 | + offset: pnumController | ||
| 1012 | + .text.length, | ||
| 1013 | + ))); | ||
| 1014 | + }, | ||
| 1015 | + onEditingComplete: () { | ||
| 1016 | + _pnumNode.unfocus(); | ||
| 1017 | + }, | ||
| 1018 | + onTap: () {}, | ||
| 1019 | + keyboardType: TextInputType.number, | ||
| 1020 | + )), | ||
| 1021 | + // Expanded( | ||
| 1022 | + // child: InkWell( | ||
| 1023 | + // onTap: () { | ||
| 1024 | + // FocusScope.of(context) | ||
| 1025 | + // .requestFocus( | ||
| 1026 | + // FocusNode()); //隐藏键盘 | ||
| 1027 | + // DialogUtil.showSelectCusmanDialog( | ||
| 1028 | + // context, personNumList, | ||
| 1029 | + // (value) async { | ||
| 1030 | + // if (value != null) { | ||
| 1031 | + // actualPnumIndex = value.first; | ||
| 1032 | + // actualPnum = personNumList[ | ||
| 1033 | + // value.first]; | ||
| 1034 | + // setState(() {}); | ||
| 1035 | + // } | ||
| 1036 | + // }, | ||
| 1037 | + // title: '人数', | ||
| 1038 | + // selecteds: | ||
| 1039 | + // actualPnumIndex == | ||
| 1040 | + // null | ||
| 1041 | + // ? [] | ||
| 1042 | + // : [ | ||
| 1043 | + // actualPnumIndex | ||
| 1044 | + // ]) | ||
| 1045 | + // .then((value) {}); | ||
| 1046 | + // }, | ||
| 1047 | + // child: Container( | ||
| 1048 | + // alignment: Alignment.center, | ||
| 1049 | + // child: Text(actualPnum, | ||
| 1050 | + // style: TextStyle( | ||
| 1051 | + // fontSize: ScreenUtil() | ||
| 1052 | + // .setSp(28), | ||
| 1053 | + // color: actualPnum == | ||
| 1054 | + // '选填' | ||
| 1055 | + // ? MyColours | ||
| 1056 | + // .color_999999 | ||
| 1057 | + // : MyColours | ||
| 1058 | + // .color_515151))), | ||
| 1059 | + // ), | ||
| 1060 | + | ||
| 1061 | + // // HEmptyView(6), | ||
| 1062 | + // // Image.asset( | ||
| 1063 | + // // Utils.getImgPath( | ||
| 1064 | + // // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 1065 | + // // width: ScreenUtil().setWidth(28), | ||
| 1066 | + // // // height: ScreenUtil().setWidth(10), | ||
| 1067 | + // // ), | ||
| 1068 | + // ), | ||
| 1018 | ]))), | 1069 | ]))), |
| 1019 | MyDivider(ScreenUtil().setWidth(2), | 1070 | MyDivider(ScreenUtil().setWidth(2), |
| 1020 | ScreenUtil().setWidth(46), | 1071 | ScreenUtil().setWidth(46), |
| @@ -1752,7 +1803,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1752,7 +1803,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1752 | _baseIndoProvider.phoneController.text = ''; | 1803 | _baseIndoProvider.phoneController.text = ''; |
| 1753 | sexSelectIndex = 0; | 1804 | sexSelectIndex = 0; |
| 1754 | sexStr = '先生'; | 1805 | sexStr = '先生'; |
| 1755 | - actualPnum = '选填'; | 1806 | + pnumController.text = ''; |
| 1756 | ddateHm = '选填'; | 1807 | ddateHm = '选填'; |
| 1757 | actualPnumIndex = null; | 1808 | actualPnumIndex = null; |
| 1758 | ddateIndex = null; | 1809 | ddateIndex = null; |
| @@ -2048,8 +2099,8 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -2048,8 +2099,8 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 2048 | } | 2099 | } |
| 2049 | } | 2100 | } |
| 2050 | String pnum; | 2101 | String pnum; |
| 2051 | - if (actualPnum != '选填') { | ||
| 2052 | - pnum = actualPnum; | 2102 | + if (pnumController.text != '') { |
| 2103 | + pnum = pnumController.text; | ||
| 2053 | } | 2104 | } |
| 2054 | SunReserveInfoModel _model = | 2105 | SunReserveInfoModel _model = |
| 2055 | await tableManagerModel.setReserveInfo(context, | 2106 | await tableManagerModel.setReserveInfo(context, |
-
Please register or login to post a comment