Showing
13 changed files
with
120 additions
and
99 deletions
| @@ -12,14 +12,14 @@ if (flutterRoot == null) { | @@ -12,14 +12,14 @@ if (flutterRoot == null) { | ||
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -def flutterVersionCode = "389" | 15 | +def flutterVersionCode = "391" |
| 16 | if (flutterVersionCode == null) { | 16 | if (flutterVersionCode == null) { |
| 17 | - flutterVersionCode = '389' | 17 | + flutterVersionCode = '391' |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | -def flutterVersionName = "3.8.9" | 20 | +def flutterVersionName = "3.9.1" |
| 21 | if (flutterVersionName == null) { | 21 | if (flutterVersionName == null) { |
| 22 | - flutterVersionName = '3.8.9' | 22 | + flutterVersionName = '3.9.1' |
| 23 | } | 23 | } |
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| 25 | apply plugin: 'kotlin-android' | 25 | apply plugin: 'kotlin-android' |
| @@ -502,7 +502,7 @@ | @@ -502,7 +502,7 @@ | ||
| 502 | "$(inherited)", | 502 | "$(inherited)", |
| 503 | "$(PROJECT_DIR)/Flutter", | 503 | "$(PROJECT_DIR)/Flutter", |
| 504 | ); | 504 | ); |
| 505 | - MARKETING_VERSION = 3.8.8; | 505 | + MARKETING_VERSION = 3.9.1; |
| 506 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 506 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 507 | PRODUCT_NAME = Runner; | 507 | PRODUCT_NAME = Runner; |
| 508 | PROVISIONING_PROFILE_SPECIFIER = ""; | 508 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -636,7 +636,7 @@ | @@ -636,7 +636,7 @@ | ||
| 636 | CURRENT_PROJECT_VERSION = 380; | 636 | CURRENT_PROJECT_VERSION = 380; |
| 637 | DEVELOPMENT_TEAM = 8J59HM8B82; | 637 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 638 | ENABLE_BITCODE = NO; | 638 | ENABLE_BITCODE = NO; |
| 639 | - FLUTTER_BUILD_MODE = debug; | 639 | + FLUTTER_BUILD_MODE = release; |
| 640 | FRAMEWORK_SEARCH_PATHS = ( | 640 | FRAMEWORK_SEARCH_PATHS = ( |
| 641 | "$(inherited)", | 641 | "$(inherited)", |
| 642 | "$(PROJECT_DIR)/Flutter", | 642 | "$(PROJECT_DIR)/Flutter", |
| @@ -648,7 +648,7 @@ | @@ -648,7 +648,7 @@ | ||
| 648 | "$(inherited)", | 648 | "$(inherited)", |
| 649 | "$(PROJECT_DIR)/Flutter", | 649 | "$(PROJECT_DIR)/Flutter", |
| 650 | ); | 650 | ); |
| 651 | - MARKETING_VERSION = 3.8.8; | 651 | + MARKETING_VERSION = 3.9.1; |
| 652 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 652 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 653 | PRODUCT_NAME = Runner; | 653 | PRODUCT_NAME = Runner; |
| 654 | PROVISIONING_PROFILE_SPECIFIER = ""; | 654 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -684,7 +684,7 @@ | @@ -684,7 +684,7 @@ | ||
| 684 | "$(inherited)", | 684 | "$(inherited)", |
| 685 | "$(PROJECT_DIR)/Flutter", | 685 | "$(PROJECT_DIR)/Flutter", |
| 686 | ); | 686 | ); |
| 687 | - MARKETING_VERSION = 3.8.8; | 687 | + MARKETING_VERSION = 3.9.1; |
| 688 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 688 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 689 | PRODUCT_NAME = Runner; | 689 | PRODUCT_NAME = Runner; |
| 690 | PROVISIONING_PROFILE_SPECIFIER = ""; | 690 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -104,6 +104,9 @@ class NewUnmessage extends Object { | @@ -104,6 +104,9 @@ class NewUnmessage extends Object { | ||
| 104 | @JsonKey(name: 'uname') | 104 | @JsonKey(name: 'uname') |
| 105 | String uname; | 105 | String uname; |
| 106 | 106 | ||
| 107 | + @JsonKey(name: 'nick_name') | ||
| 108 | + String nickName; | ||
| 109 | + | ||
| 107 | NewUnmessage( | 110 | NewUnmessage( |
| 108 | this.id, | 111 | this.id, |
| 109 | this.uid, | 112 | this.uid, |
| @@ -123,7 +126,8 @@ class NewUnmessage extends Object { | @@ -123,7 +126,8 @@ class NewUnmessage extends Object { | ||
| 123 | this.cancelName, | 126 | this.cancelName, |
| 124 | this.status, | 127 | this.status, |
| 125 | this.room_info, | 128 | this.room_info, |
| 126 | - this.uname); | 129 | + this.uname, |
| 130 | + this.nickName); | ||
| 127 | 131 | ||
| 128 | String get rnameStr { | 132 | String get rnameStr { |
| 129 | if (rname == null || rname == '') return ""; | 133 | if (rname == null || rname == '') return ""; |
| @@ -61,6 +61,7 @@ NewUnmessage _$NewUnmessageFromJson(Map<String, dynamic> json) { | @@ -61,6 +61,7 @@ NewUnmessage _$NewUnmessageFromJson(Map<String, dynamic> json) { | ||
| 61 | json['status'] as dynamic, | 61 | json['status'] as dynamic, |
| 62 | json['room_info'] as dynamic, | 62 | json['room_info'] as dynamic, |
| 63 | json['uname'] as String, | 63 | json['uname'] as String, |
| 64 | + json['nick_name'] as String, | ||
| 64 | ); | 65 | ); |
| 65 | } | 66 | } |
| 66 | 67 | ||
| @@ -84,5 +85,6 @@ Map<String, dynamic> _$NewUnmessageToJson(NewUnmessage instance) => | @@ -84,5 +85,6 @@ Map<String, dynamic> _$NewUnmessageToJson(NewUnmessage instance) => | ||
| 84 | 'cancel_name': instance.cancelName, | 85 | 'cancel_name': instance.cancelName, |
| 85 | 'status': instance.status, | 86 | 'status': instance.status, |
| 86 | 'room_info': instance.room_info, | 87 | 'room_info': instance.room_info, |
| 87 | - 'uname': instance.uname | 88 | + 'uname': instance.uname, |
| 89 | + 'nick_name':instance.nickName | ||
| 88 | }; | 90 | }; |
| @@ -353,7 +353,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -353,7 +353,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 353 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 353 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 354 | Map<String, String> causeMap = { | 354 | Map<String, String> causeMap = { |
| 355 | "uid": userModel.user.openid, | 355 | "uid": userModel.user.openid, |
| 356 | - "uname": userModel.user.account, | 356 | + "uname": userModel.user.nickName, |
| 357 | "desc": "", | 357 | "desc": "", |
| 358 | }; | 358 | }; |
| 359 | Map<String, String> params = { | 359 | Map<String, String> params = { |
| @@ -381,7 +381,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -381,7 +381,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 381 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 381 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 382 | Map<String, String> causeMap = { | 382 | Map<String, String> causeMap = { |
| 383 | "uid": userModel.user.openid, | 383 | "uid": userModel.user.openid, |
| 384 | - "uname": userModel.user.account, | 384 | + "uname": userModel.user.nickName, |
| 385 | "desc": desc, | 385 | "desc": desc, |
| 386 | }; | 386 | }; |
| 387 | Map<String, String> params = { | 387 | Map<String, String> params = { |
| @@ -41,6 +41,8 @@ import 'package:provider/provider.dart'; | @@ -41,6 +41,8 @@ import 'package:provider/provider.dart'; | ||
| 41 | import 'package:one_key/models/table_list.dart' as t; | 41 | import 'package:one_key/models/table_list.dart' as t; |
| 42 | import 'dart:ui' as ui; | 42 | import 'dart:ui' as ui; |
| 43 | 43 | ||
| 44 | +import '../../app.dart'; | ||
| 45 | + | ||
| 44 | class InvicationPage extends StatefulWidget { | 46 | class InvicationPage extends StatefulWidget { |
| 45 | final String rid; //预订订单id | 47 | final String rid; //预订订单id |
| 46 | // final String tableInfo; //桌位信息 | 48 | // final String tableInfo; //桌位信息 |
| @@ -142,6 +144,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -142,6 +144,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 142 | super.initState(); | 144 | super.initState(); |
| 143 | 145 | ||
| 144 | WidgetsBinding.instance.addObserver(this); | 146 | WidgetsBinding.instance.addObserver(this); |
| 147 | + enterMore = App.sp.getBool("enterMore") ?? false; | ||
| 145 | 148 | ||
| 146 | personNumList = Utils.getPersonNumList(); | 149 | personNumList = Utils.getPersonNumList(); |
| 147 | sexList = ['先生', '女士', '公司']; | 150 | sexList = ['先生', '女士', '公司']; |
| @@ -725,7 +728,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -725,7 +728,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 725 | bool sucess = await detailModel.upReserveInfo( | 728 | bool sucess = await detailModel.upReserveInfo( |
| 726 | context, widget.rid, | 729 | context, widget.rid, |
| 727 | dateStr: ddateHm, | 730 | dateStr: ddateHm, |
| 728 | - ymd: detailEntity.ddateYMD); | 731 | + ymd: detailEntity.ddateYMD,needToast: false); |
| 729 | 732 | ||
| 730 | if (sucess) { | 733 | if (sucess) { |
| 731 | EventBus() | 734 | EventBus() |
| @@ -772,7 +775,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -772,7 +775,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 772 | 775 | ||
| 773 | sex = '${sexList.indexOf(sexStr) + 1}'; | 776 | sex = '${sexList.indexOf(sexStr) + 1}'; |
| 774 | bool sucess = await detailModel.upReserveInfo(context, widget.rid, | 777 | bool sucess = await detailModel.upReserveInfo(context, widget.rid, |
| 775 | - name: name, sex: sex, phone: phone, cusdem: remark); | 778 | + name: name, sex: sex, phone: phone, cusdem: remark,needToast: false); |
| 776 | if (sucess) { | 779 | if (sucess) { |
| 777 | reserverPhone = phone; | 780 | reserverPhone = phone; |
| 778 | oldPhone = phone; | 781 | oldPhone = phone; |
| @@ -1304,7 +1307,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -1304,7 +1307,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1304 | child: _buttonChoose(youhui, (value) { | 1307 | child: _buttonChoose(youhui, (value) { |
| 1305 | if (couponsCan == null || couponsCan.length == 0) { | 1308 | if (couponsCan == null || couponsCan.length == 0) { |
| 1306 | Utils.showToast('暂无优惠券,请创建新优惠'); | 1309 | Utils.showToast('暂无优惠券,请创建新优惠'); |
| 1307 | - return; | 1310 | + // return; |
| 1308 | } | 1311 | } |
| 1309 | FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘 | 1312 | FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘 |
| 1310 | DialogUtil.showSelectCusmanDialog( | 1313 | DialogUtil.showSelectCusmanDialog( |
| @@ -1456,7 +1459,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -1456,7 +1459,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1456 | await detailModel.upReserveInfo( | 1459 | await detailModel.upReserveInfo( |
| 1457 | context, widget.rid, | 1460 | context, widget.rid, |
| 1458 | actualPum: | 1461 | actualPum: |
| 1459 | - detailModel.selectNum); | 1462 | + detailModel.selectNum,needToast: false); |
| 1460 | 1463 | ||
| 1461 | if (sucess) { | 1464 | if (sucess) { |
| 1462 | EventBus().emit( | 1465 | EventBus().emit( |
| @@ -1542,7 +1545,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -1542,7 +1545,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1542 | await detailModel.upReserveInfo( | 1545 | await detailModel.upReserveInfo( |
| 1543 | context, widget.rid, | 1546 | context, widget.rid, |
| 1544 | dateStr: ddateHm, | 1547 | dateStr: ddateHm, |
| 1545 | - ymd: detailEntity.ddateYMD); | 1548 | + ymd: detailEntity.ddateYMD,needToast: false); |
| 1546 | 1549 | ||
| 1547 | if (sucess) { | 1550 | if (sucess) { |
| 1548 | EventBus().emit( | 1551 | EventBus().emit( |
| @@ -2059,6 +2062,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -2059,6 +2062,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 2059 | setState(() { | 2062 | setState(() { |
| 2060 | enterMore = !enterMore; | 2063 | enterMore = !enterMore; |
| 2061 | }); | 2064 | }); |
| 2065 | + App.sp.setBool("enterMore", enterMore); | ||
| 2062 | }, | 2066 | }, |
| 2063 | child: Row( | 2067 | child: Row( |
| 2064 | children: [ | 2068 | children: [ |
| @@ -2793,7 +2797,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -2793,7 +2797,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 2793 | // }); | 2797 | // }); |
| 2794 | bool sucess = await detailModel.upReserveInfo( | 2798 | bool sucess = await detailModel.upReserveInfo( |
| 2795 | context, widget.rid, | 2799 | context, widget.rid, |
| 2796 | - actualPum: detailModel.selectNum); | 2800 | + actualPum: detailModel.selectNum,needToast: false); |
| 2797 | 2801 | ||
| 2798 | if (sucess) { | 2802 | if (sucess) { |
| 2799 | EventBus().emit("refresh_tablemanager"); //刷新桌位 | 2803 | EventBus().emit("refresh_tablemanager"); //刷新桌位 |
| @@ -3306,13 +3310,13 @@ class InvicationPageState extends State<InvicationPage> | @@ -3306,13 +3310,13 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3306 | 3310 | ||
| 3307 | _getContactData() async { | 3311 | _getContactData() async { |
| 3308 | Contact contact = await _contactPicker.selectContactWithNative(); | 3312 | Contact contact = await _contactPicker.selectContactWithNative(); |
| 3309 | - DialogUtil.cupertinoAlertDialog(context, | ||
| 3310 | - title: "客户信息", | ||
| 3311 | - content: "客户信息已修改,是否确定修改", | ||
| 3312 | - lTitle: "取消", | ||
| 3313 | - rTitle: "确定修改", lCallback: () { | ||
| 3314 | - print("取消"); | ||
| 3315 | - }, rCallback: () { | 3313 | + // DialogUtil.cupertinoAlertDialog(context, |
| 3314 | + // title: "客户信息", | ||
| 3315 | + // content: "客户信息已修改,是否确定修改", | ||
| 3316 | + // lTitle: "取消", | ||
| 3317 | + // rTitle: "确定修改", lCallback: () { | ||
| 3318 | + // print("取消"); | ||
| 3319 | + // }, rCallback: () { | ||
| 3316 | setState(() { | 3320 | setState(() { |
| 3317 | String fullName = | 3321 | String fullName = |
| 3318 | contact.fullName.replaceAll(new RegExp(r"\s+\b|\b\s"), ""); | 3322 | contact.fullName.replaceAll(new RegExp(r"\s+\b|\b\s"), ""); |
| @@ -3330,7 +3334,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -3330,7 +3334,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3330 | _addNameSuffix(fullName, sexStr); | 3334 | _addNameSuffix(fullName, sexStr); |
| 3331 | }); | 3335 | }); |
| 3332 | _updateReserve(); | 3336 | _updateReserve(); |
| 3333 | - }); | 3337 | + // }); |
| 3334 | } | 3338 | } |
| 3335 | 3339 | ||
| 3336 | _addNameSuffix(String name, String suffix) { | 3340 | _addNameSuffix(String name, String suffix) { |
| @@ -420,7 +420,7 @@ class MessageDialogItemF extends StatelessWidget { | @@ -420,7 +420,7 @@ class MessageDialogItemF extends StatelessWidget { | ||
| 420 | : Text( | 420 | : Text( |
| 421 | message.message_type == "11" | 421 | message.message_type == "11" |
| 422 | ? '取消操作人:顾客在线取消' | 422 | ? '取消操作人:顾客在线取消' |
| 423 | - : '取消操作人:${message.uname}', | 423 | + : '取消操作人:${message.nickName}', |
| 424 | style: TextStyle( | 424 | style: TextStyle( |
| 425 | color: isTreated | 425 | color: isTreated |
| 426 | ? MyColours.color_BFC4D4 | 426 | ? MyColours.color_BFC4D4 |
| @@ -461,7 +461,7 @@ class MessageItemF extends StatelessWidget { | @@ -461,7 +461,7 @@ class MessageItemF extends StatelessWidget { | ||
| 461 | : Text( | 461 | : Text( |
| 462 | message.message_type == "11" | 462 | message.message_type == "11" |
| 463 | ? '取消操作人:顾客在线取消' | 463 | ? '取消操作人:顾客在线取消' |
| 464 | - : '取消操作人:${message.uname}', | 464 | + : '取消操作人:${message.nickName}', |
| 465 | style: TextStyle( | 465 | style: TextStyle( |
| 466 | color: isTreated | 466 | color: isTreated |
| 467 | ? MyColours.color_BFC4D4 | 467 | ? MyColours.color_BFC4D4 |
| @@ -126,7 +126,7 @@ class NoteBookItemFState extends State<NoteBookItemF> | @@ -126,7 +126,7 @@ class NoteBookItemFState extends State<NoteBookItemF> | ||
| 126 | if (status == '4') { | 126 | if (status == '4') { |
| 127 | Map<String, String> causeMap = { | 127 | Map<String, String> causeMap = { |
| 128 | "uid": userModel.user.openid, | 128 | "uid": userModel.user.openid, |
| 129 | - "uname": userModel.user.account, | 129 | + "uname": userModel.user.nickName, |
| 130 | "desc": desc, | 130 | "desc": desc, |
| 131 | }; | 131 | }; |
| 132 | params["cause"] = json.encode(causeMap); | 132 | params["cause"] = json.encode(causeMap); |
| @@ -138,7 +138,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | @@ -138,7 +138,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | ||
| 138 | if (status == '4') { | 138 | if (status == '4') { |
| 139 | Map<String, String> causeMap = { | 139 | Map<String, String> causeMap = { |
| 140 | "uid": userModel.user.openid, | 140 | "uid": userModel.user.openid, |
| 141 | - "uname": userModel.user.account, | 141 | + "uname": userModel.user.nickName, |
| 142 | "desc": desc, | 142 | "desc": desc, |
| 143 | }; | 143 | }; |
| 144 | params["cause"] = json.encode(causeMap); | 144 | params["cause"] = json.encode(causeMap); |
| @@ -388,6 +388,10 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -388,6 +388,10 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 388 | tableManagerModel.selectTables | 388 | tableManagerModel.selectTables |
| 389 | .removeWhere((t) => t.id == table.id); | 389 | .removeWhere((t) => t.id == table.id); |
| 390 | } | 390 | } |
| 391 | + if (tableManagerModel.selectTables.length == 0) { | ||
| 392 | + // wechatNotification = true; | ||
| 393 | + _clearData(); | ||
| 394 | + } | ||
| 391 | // if (tableManagerModel.selectTables.length > 1) { | 395 | // if (tableManagerModel.selectTables.length > 1) { |
| 392 | // _scrollCrl.position | 396 | // _scrollCrl.position |
| 393 | // .didUpdateScrollPositionBy(0); //这里触发更新滚动条 | 397 | // .didUpdateScrollPositionBy(0); //这里触发更新滚动条 |
| @@ -1394,32 +1398,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1394,32 +1398,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1394 | right: ScreenUtil().setWidth(40), | 1398 | right: ScreenUtil().setWidth(40), |
| 1395 | child: InkWell( | 1399 | child: InkWell( |
| 1396 | onTap: () { | 1400 | onTap: () { |
| 1397 | - nameStr = ''; | ||
| 1398 | - _baseIndoProvider.nameController.text = ''; | ||
| 1399 | - _baseIndoProvider.phoneController.text = ''; | ||
| 1400 | - sexSelectIndex = 0; | ||
| 1401 | - sexStr = '先生'; | ||
| 1402 | - actualPnum = '选填'; | ||
| 1403 | - ddateHm = '选填'; | ||
| 1404 | - actualPnumIndex = null; | ||
| 1405 | - ddateIndex = null; | ||
| 1406 | - youhui = '选择优惠'; | ||
| 1407 | - couponSelectIndex = 0; | ||
| 1408 | - tableManagerModel.selectTables = []; | ||
| 1409 | - if (showErro != '短信余额不足,请充值短信条数') { | ||
| 1410 | - showErro = ''; | ||
| 1411 | - } | ||
| 1412 | - for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1413 | - item.selected = false; | ||
| 1414 | - } | ||
| 1415 | - tableManagerModel.areaTableMapShow | ||
| 1416 | - .forEach((key, value) { | ||
| 1417 | - value.forEach((element) { | ||
| 1418 | - element.selected = false; | ||
| 1419 | - }); | ||
| 1420 | - }); | ||
| 1421 | - | ||
| 1422 | - tableManagerModel.notifyListeners(); | 1401 | + _clearData(); |
| 1423 | }, | 1402 | }, |
| 1424 | child: Text( | 1403 | child: Text( |
| 1425 | '清空', | 1404 | '清空', |
| @@ -1468,6 +1447,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1468,6 +1447,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1468 | //删除已经选择的桌位 | 1447 | //删除已经选择的桌位 |
| 1469 | tableManagerModel.selectTables | 1448 | tableManagerModel.selectTables |
| 1470 | .removeWhere((t) => t.id == table.id); | 1449 | .removeWhere((t) => t.id == table.id); |
| 1450 | + if (tableManagerModel.selectTables.length == | ||
| 1451 | + 0) { | ||
| 1452 | + // wechatNotification = true; | ||
| 1453 | + _clearData(); | ||
| 1454 | + } | ||
| 1471 | 1455 | ||
| 1472 | for (t.Table item | 1456 | for (t.Table item |
| 1473 | in tableManagerModel.tablesShow) { | 1457 | in tableManagerModel.tablesShow) { |
| @@ -1476,14 +1460,17 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1476,14 +1460,17 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1476 | setState(() {}); | 1460 | setState(() {}); |
| 1477 | } | 1461 | } |
| 1478 | } | 1462 | } |
| 1479 | - for (t.Table item in tableManagerModel | ||
| 1480 | - .areaTableMapShow[ | ||
| 1481 | - tableManagerModel | ||
| 1482 | - .areas[tableManagerModel.selectNumber] | ||
| 1483 | - .name]) { | ||
| 1484 | - if (item.id == table.id) { | ||
| 1485 | - item.selected = false; | ||
| 1486 | - setState(() {}); | 1463 | + if (tableManagerModel.selectNumber != null) { |
| 1464 | + for (t.Table item in tableManagerModel | ||
| 1465 | + .areaTableMapShow[ | ||
| 1466 | + tableManagerModel | ||
| 1467 | + .areas[ | ||
| 1468 | + tableManagerModel.selectNumber] | ||
| 1469 | + .name]) { | ||
| 1470 | + if (item.id == table.id) { | ||
| 1471 | + item.selected = false; | ||
| 1472 | + setState(() {}); | ||
| 1473 | + } | ||
| 1487 | } | 1474 | } |
| 1488 | } | 1475 | } |
| 1489 | }, | 1476 | }, |
| @@ -1526,7 +1513,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1526,7 +1513,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1526 | ObjectUtil.isNotEmpty(_model.row) && | 1513 | ObjectUtil.isNotEmpty(_model.row) && |
| 1527 | ObjectUtil.isNotEmpty(_model.row.id)) { | 1514 | ObjectUtil.isNotEmpty(_model.row.id)) { |
| 1528 | print('成功'); | 1515 | print('成功'); |
| 1529 | - tableManagerModel.selectTables = []; | 1516 | + // tableManagerModel.selectTables = []; |
| 1517 | + | ||
| 1518 | + // wechatNotification = true; | ||
| 1519 | + _clearData(); | ||
| 1520 | + | ||
| 1530 | // _homeEnterModel.clearData(); | 1521 | // _homeEnterModel.clearData(); |
| 1531 | bus.emit("refresh_tablemanager"); //刷新当前页面 | 1522 | bus.emit("refresh_tablemanager"); //刷新当前页面 |
| 1532 | bus.emit("refresh_book_list"); //刷新已预订列表 | 1523 | bus.emit("refresh_book_list"); //刷新已预订列表 |
| @@ -1645,7 +1636,9 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1645,7 +1636,9 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1645 | ObjectUtil.isNotEmpty(_model.row) && | 1636 | ObjectUtil.isNotEmpty(_model.row) && |
| 1646 | ObjectUtil.isNotEmpty(_model.row.id)) { | 1637 | ObjectUtil.isNotEmpty(_model.row.id)) { |
| 1647 | print('成功'); | 1638 | print('成功'); |
| 1648 | - tableManagerModel.selectTables = []; | 1639 | + // tableManagerModel.selectTables = []; |
| 1640 | + // wechatNotification = true; | ||
| 1641 | + _clearData(); | ||
| 1649 | // _homeEnterModel.clearData(); | 1642 | // _homeEnterModel.clearData(); |
| 1650 | bus.emit("refresh_tablemanager"); //刷新当前页面 | 1643 | bus.emit("refresh_tablemanager"); //刷新当前页面 |
| 1651 | bus.emit("refresh_book_list"); //刷新已预订列表 | 1644 | bus.emit("refresh_book_list"); //刷新已预订列表 |
| @@ -1703,6 +1696,37 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1703,6 +1696,37 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1703 | )); | 1696 | )); |
| 1704 | } | 1697 | } |
| 1705 | 1698 | ||
| 1699 | + ///清空数据 | ||
| 1700 | + _clearData() { | ||
| 1701 | + nameStr = ''; | ||
| 1702 | + _baseIndoProvider.nameController.text = ''; | ||
| 1703 | + _baseIndoProvider.phoneController.text = ''; | ||
| 1704 | + sexSelectIndex = 0; | ||
| 1705 | + sexStr = '先生'; | ||
| 1706 | + actualPnum = '选填'; | ||
| 1707 | + ddateHm = '选填'; | ||
| 1708 | + actualPnumIndex = null; | ||
| 1709 | + ddateIndex = null; | ||
| 1710 | + youhui = '选择优惠'; | ||
| 1711 | + couponSelectIndex = 0; | ||
| 1712 | + tableManagerModel.selectTables = []; | ||
| 1713 | + wechatNotification = true; | ||
| 1714 | + | ||
| 1715 | + if (showErro != '短信余额不足,请充值短信条数') { | ||
| 1716 | + showErro = ''; | ||
| 1717 | + } | ||
| 1718 | + for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1719 | + item.selected = false; | ||
| 1720 | + } | ||
| 1721 | + tableManagerModel.areaTableMapShow.forEach((key, value) { | ||
| 1722 | + value.forEach((element) { | ||
| 1723 | + element.selected = false; | ||
| 1724 | + }); | ||
| 1725 | + }); | ||
| 1726 | + | ||
| 1727 | + tableManagerModel.notifyListeners(); | ||
| 1728 | + } | ||
| 1729 | + | ||
| 1706 | ///选中的桌子widget | 1730 | ///选中的桌子widget |
| 1707 | Widget _selectTableWidgetSms() { | 1731 | Widget _selectTableWidgetSms() { |
| 1708 | return Container( | 1732 | return Container( |
| @@ -1764,32 +1788,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1764,32 +1788,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1764 | right: ScreenUtil().setWidth(40), | 1788 | right: ScreenUtil().setWidth(40), |
| 1765 | child: InkWell( | 1789 | child: InkWell( |
| 1766 | onTap: () { | 1790 | onTap: () { |
| 1767 | - nameStr = ''; | ||
| 1768 | - _baseIndoProvider.nameController.text = ''; | ||
| 1769 | - _baseIndoProvider.phoneController.text = ''; | ||
| 1770 | - sexSelectIndex = 0; | ||
| 1771 | - sexStr = '先生'; | ||
| 1772 | - actualPnum = '选填'; | ||
| 1773 | - ddateHm = '选填'; | ||
| 1774 | - actualPnumIndex = null; | ||
| 1775 | - ddateIndex = null; | ||
| 1776 | - youhui = '选择优惠'; | ||
| 1777 | - couponSelectIndex = 0; | ||
| 1778 | - tableManagerModel.selectTables = []; | ||
| 1779 | - if (showErro != '短信余额不足,请充值短信条数') { | ||
| 1780 | - showErro = ''; | ||
| 1781 | - } | ||
| 1782 | - for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1783 | - item.selected = false; | ||
| 1784 | - } | ||
| 1785 | - tableManagerModel.areaTableMapShow | ||
| 1786 | - .forEach((key, value) { | ||
| 1787 | - value.forEach((element) { | ||
| 1788 | - element.selected = false; | ||
| 1789 | - }); | ||
| 1790 | - }); | ||
| 1791 | - | ||
| 1792 | - tableManagerModel.notifyListeners(); | 1791 | + _clearData(); |
| 1793 | }, | 1792 | }, |
| 1794 | child: Text( | 1793 | child: Text( |
| 1795 | '清空', | 1794 | '清空', |
| @@ -1838,6 +1837,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1838,6 +1837,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1838 | //删除已经选择的桌位 | 1837 | //删除已经选择的桌位 |
| 1839 | tableManagerModel.selectTables | 1838 | tableManagerModel.selectTables |
| 1840 | .removeWhere((t) => t.id == table.id); | 1839 | .removeWhere((t) => t.id == table.id); |
| 1840 | + if (tableManagerModel.selectTables.length == | ||
| 1841 | + 0) { | ||
| 1842 | + // wechatNotification = true; | ||
| 1843 | + _clearData(); | ||
| 1844 | + } | ||
| 1841 | 1845 | ||
| 1842 | for (t.Table item | 1846 | for (t.Table item |
| 1843 | in tableManagerModel.tablesShow) { | 1847 | in tableManagerModel.tablesShow) { |
| @@ -2008,7 +2012,10 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -2008,7 +2012,10 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 2008 | ObjectUtil.isNotEmpty(_model.row) && | 2012 | ObjectUtil.isNotEmpty(_model.row) && |
| 2009 | ObjectUtil.isNotEmpty(_model.row.id)) { | 2013 | ObjectUtil.isNotEmpty(_model.row.id)) { |
| 2010 | print('成功'); | 2014 | print('成功'); |
| 2011 | - tableManagerModel.selectTables = []; | 2015 | + // tableManagerModel.selectTables = []; |
| 2016 | + // wechatNotification = true; | ||
| 2017 | + _clearData(); | ||
| 2018 | + | ||
| 2012 | // _homeEnterModel.clearData(); | 2019 | // _homeEnterModel.clearData(); |
| 2013 | bus.emit("refresh_tablemanager"); //刷新当前页面 | 2020 | bus.emit("refresh_tablemanager"); //刷新当前页面 |
| 2014 | bus.emit("refresh_book_list"); //刷新已预订列表 | 2021 | bus.emit("refresh_book_list"); //刷新已预订列表 |
| @@ -200,7 +200,8 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -200,7 +200,8 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 200 | String name, | 200 | String name, |
| 201 | String phone, | 201 | String phone, |
| 202 | String ymd, | 202 | String ymd, |
| 203 | - bool showLoading = false}) async { | 203 | + bool showLoading = false, |
| 204 | + bool needToast = true}) async { | ||
| 204 | Map<String, dynamic> params = { | 205 | Map<String, dynamic> params = { |
| 205 | "rid": rid, | 206 | "rid": rid, |
| 206 | }; | 207 | }; |
| @@ -227,10 +228,10 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -227,10 +228,10 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 227 | if (phone != null && phone != '') { | 228 | if (phone != null && phone != '') { |
| 228 | params['phone'] = phone; | 229 | params['phone'] = phone; |
| 229 | } | 230 | } |
| 230 | - bool sucess = | ||
| 231 | - await _upReserveInfo(context, params, showLoading: showLoading); | 231 | + bool sucess = await _upReserveInfo(context, params, |
| 232 | + showLoading: showLoading, needToast: needToast); | ||
| 232 | if (sucess) { | 233 | if (sucess) { |
| 233 | - if (!showLoading) { | 234 | + if (!showLoading && needToast) { |
| 234 | Utils.showToast("修改成功!"); | 235 | Utils.showToast("修改成功!"); |
| 235 | } | 236 | } |
| 236 | 237 | ||
| @@ -240,7 +241,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -240,7 +241,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params, | 243 | Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params, |
| 243 | - {ifPush = true, showLoading = false}) async { | 244 | + {ifPush = true, showLoading = false, bool needToast = true}) async { |
| 244 | BaseResp<dynamic> baseResp = await DioUtil() | 245 | BaseResp<dynamic> baseResp = await DioUtil() |
| 245 | .request<dynamic>(context, Method.get, HttpUrl.up_reserve_info, | 246 | .request<dynamic>(context, Method.get, HttpUrl.up_reserve_info, |
| 246 | data: params, showLoading: showLoading) | 247 | data: params, showLoading: showLoading) |
| @@ -251,7 +252,10 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -251,7 +252,10 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 251 | if (baseResp.code == Constant.status_success && baseResp.data != null) { | 252 | if (baseResp.code == Constant.status_success && baseResp.data != null) { |
| 252 | return true; | 253 | return true; |
| 253 | } else { | 254 | } else { |
| 254 | - Utils.showToast(baseResp.msg); | 255 | + if (needToast) { |
| 256 | + Utils.showToast(baseResp.msg); | ||
| 257 | + } | ||
| 258 | + | ||
| 255 | return false; | 259 | return false; |
| 256 | } | 260 | } |
| 257 | } | 261 | } |
-
Please register or login to post a comment