Commit 1f4f6fc01c2b109a4e7f524b048f2bd2d811627a

Authored by weixin_45529955
1 parent 6ce237bc

预定安排页返回拦截,接口成功后在调用pop返回前一页

@@ -912,12 +912,14 @@ class InvicationPageState extends State<InvicationPage> @@ -912,12 +912,14 @@ class InvicationPageState extends State<InvicationPage>
912 if (needWechat) { 912 if (needWechat) {
913 needWechat = false; 913 needWechat = false;
914 await _updateReserve(); 914 await _updateReserve();
915 - callback!();  
916 - } else {  
917 - if (needBack) {  
918 - needBack = false;  
919 - Navigator.of(context).pop(); 915 + if (callback != null) {
  916 + callback();
920 } 917 }
  918 + } else {
  919 + // if (needBack) {
  920 + // needBack = false;
  921 + // Navigator.of(context).pop();
  922 + // }
921 // if (needSex) { 923 // if (needSex) {
922 // needSex = false; 924 // needSex = false;
923 // } 925 // }
@@ -960,7 +962,7 @@ class InvicationPageState extends State<InvicationPage> @@ -960,7 +962,7 @@ class InvicationPageState extends State<InvicationPage>
960 needBlack = false; 962 needBlack = false;
961 } 963 }
962 964
963 - _updateReserve(needSex: needSex); 965 + await _updateReserve(needSex: needSex);
964 } 966 }
965 // DialogUtil.cupertinoAlertDialog(context, 967 // DialogUtil.cupertinoAlertDialog(context,
966 // title: "客户信息", 968 // title: "客户信息",
@@ -1070,13 +1072,15 @@ class InvicationPageState extends State<InvicationPage> @@ -1070,13 +1072,15 @@ class InvicationPageState extends State<InvicationPage>
1070 // } 1072 // }
1071 // }); 1073 // });
1072 } else { 1074 } else {
1073 - if (needBack) {  
1074 - needBack = false;  
1075 - Navigator.of(context).pop();  
1076 - } 1075 + // if (needBack) {
  1076 + // needBack = false;
  1077 + // Navigator.of(context).pop();
  1078 + // }
1077 if (needWechat) { 1079 if (needWechat) {
1078 needWechat = false; 1080 needWechat = false;
1079 - callback!(); 1081 + if (callback != null) {
  1082 + callback();
  1083 + }
1080 } 1084 }
1081 } 1085 }
1082 } 1086 }
@@ -1653,9 +1657,9 @@ class InvicationPageState extends State<InvicationPage> @@ -1653,9 +1657,9 @@ class InvicationPageState extends State<InvicationPage>
1653 } 1657 }
1654 } 1658 }
1655 1659
1656 - _getReserveTypeField() async {  
1657 - await detailModel.getReserveTypeField(context, isShowLoading: false);  
1658 - } 1660 + // _getReserveTypeField() async {
  1661 + // await detailModel.getReserveTypeField(context, isShowLoading: false);
  1662 + // }
1659 1663
1660 ///订座详情 1664 ///订座详情
1661 // _getReserveDetail({bool showCicle = false}) async { 1665 // _getReserveDetail({bool showCicle = false}) async {
@@ -6109,87 +6113,97 @@ class InvicationPageState extends State<InvicationPage> @@ -6109,87 +6113,97 @@ class InvicationPageState extends State<InvicationPage>
6109 // Provider.of<MarketingCenterProvider>(context, listen: true); 6113 // Provider.of<MarketingCenterProvider>(context, listen: true);
6110 // myModel = Provider.of<MyModel>(context, listen: true); 6114 // myModel = Provider.of<MyModel>(context, listen: true);
6111 return SafeArea( 6115 return SafeArea(
6112 - child: Scaffold(  
6113 - appBar: SystemAppBar(  
6114 - '预订安排',  
6115 - titleColor: MyColours.color_438E93,  
6116 - onTap: () {  
6117 - needBack = true;  
6118 - _showConfirmWidget(needBack: true);  
6119 - },  
6120 - rightImgName: 'set_g.png',  
6121 - onTapRight: () {  
6122 - NavigatorUtil.goInputNamePhoneSettingPage(context);  
6123 - },  
6124 - ),  
6125 - backgroundColor: Colors.white,  
6126 - // resizeToAvoidBottomInset: false,  
6127 - body: InkWell(  
6128 - onTap: () {  
6129 - needBlack = true;  
6130 - _showConfirmWidget();  
6131 - },  
6132 - child: Container(  
6133 - color: MyColours.color_ffffff,  
6134 - child: Consumer<BaseIndoProvider>(builder: (context, model, _) {  
6135 - if (model.pageState != PageState.Success) {  
6136 - return ExceptionPage(  
6137 - pageState: model.pageState,  
6138 - callback: () async {  
6139 - model.pageState = PageState.Loading;  
6140 - // await _couponNetworkData(isShowLoading: false);  
6141 - // await _getCustomerActivityBaseinfo();  
6142 - // await _getTablesPhoto();  
6143 - getReserveDetailDataSet();  
6144 - _getReserveDetailRelationData();  
6145 - model.notifyListeners();  
6146 - },  
6147 - emptyMsg: "稍后加载",  
6148 - emptyImg: "empty_search",  
6149 - showMsg: "加载中,请稍候...",  
6150 - );  
6151 - } else {  
6152 - return Column(children: [  
6153 - Expanded(  
6154 - child: ListView(  
6155 - controller: _scrollController,  
6156 - scrollDirection: Axis.vertical,  
6157 - //true 滑动到底部  
6158 - padding: EdgeInsets.all(0.0),  
6159 - // reverse: _phoneNode.hasFocus ? true : false,  
6160 - children: [  
6161 - VEmptyView(38),  
6162 - _reverseTimeWidget(),  
6163 - VEmptyView(24),  
6164 - _tableInfoWidget(),  
6165 - VEmptyView(34),  
6166 - _enterMoreWidget(),  
6167 - // VEmptyView(40),  
6168 - // _managerWidget(),  
6169 - // VEmptyView(50),  
6170 - // _orderInfoWidget(),  
6171 - // VEmptyView(30),  
6172 - // _couponWidget(),  
6173 - // VEmptyView(20),  
6174 - Container(  
6175 - key: botGlobalKey,  
6176 - height: ScreenUtil().setWidth(20)),  
6177 - ],  
6178 - )),  
6179 - Padding(  
6180 - padding: EdgeInsets.symmetric(  
6181 - horizontal: ScreenUtil().setWidth(48)),  
6182 - child: _btnWidget()),  
6183 - _showOverlay ? VEmptyView(100) : SizedBox()  
6184 - ])  
6185 - // Padding(  
6186 - // padding: EdgeInsets.symmetric(  
6187 - // horizontal: ScreenUtil().setWidth(48)),  
6188 - // child: _btnWidget()),  
6189 - ;  
6190 - }  
6191 - }),  
6192 - ),  
6193 - ))); 6116 + child: WillPopScope(
  6117 + onWillPop: () async {
  6118 + // needBack = true;
  6119 + await _showConfirmWidget();
  6120 + Navigator.of(context).pop();
  6121 +
  6122 + return true;
  6123 + },
  6124 + child: Scaffold(
  6125 + appBar: SystemAppBar(
  6126 + '预订安排',
  6127 + titleColor: MyColours.color_438E93,
  6128 + onTap: () async {
  6129 + // needBack = true;
  6130 + await _showConfirmWidget();
  6131 + Navigator.of(context).pop();
  6132 + },
  6133 + rightImgName: 'set_g.png',
  6134 + onTapRight: () {
  6135 + NavigatorUtil.goInputNamePhoneSettingPage(context);
  6136 + },
  6137 + ),
  6138 + backgroundColor: Colors.white,
  6139 + // resizeToAvoidBottomInset: false,
  6140 + body: InkWell(
  6141 + onTap: () async {
  6142 + needBlack = true;
  6143 + await _showConfirmWidget();
  6144 + },
  6145 + child: Container(
  6146 + color: MyColours.color_ffffff,
  6147 + child: Consumer<BaseIndoProvider>(
  6148 + builder: (context, model, _) {
  6149 + if (model.pageState != PageState.Success) {
  6150 + return ExceptionPage(
  6151 + pageState: model.pageState,
  6152 + callback: () async {
  6153 + model.pageState = PageState.Loading;
  6154 + // await _couponNetworkData(isShowLoading: false);
  6155 + // await _getCustomerActivityBaseinfo();
  6156 + // await _getTablesPhoto();
  6157 + getReserveDetailDataSet();
  6158 + _getReserveDetailRelationData();
  6159 + model.notifyListeners();
  6160 + },
  6161 + emptyMsg: "稍后加载",
  6162 + emptyImg: "empty_search",
  6163 + showMsg: "加载中,请稍候...",
  6164 + );
  6165 + } else {
  6166 + return Column(children: [
  6167 + Expanded(
  6168 + child: ListView(
  6169 + controller: _scrollController,
  6170 + scrollDirection: Axis.vertical,
  6171 + //true 滑动到底部
  6172 + padding: EdgeInsets.all(0.0),
  6173 + // reverse: _phoneNode.hasFocus ? true : false,
  6174 + children: [
  6175 + VEmptyView(38),
  6176 + _reverseTimeWidget(),
  6177 + VEmptyView(24),
  6178 + _tableInfoWidget(),
  6179 + VEmptyView(34),
  6180 + _enterMoreWidget(),
  6181 + // VEmptyView(40),
  6182 + // _managerWidget(),
  6183 + // VEmptyView(50),
  6184 + // _orderInfoWidget(),
  6185 + // VEmptyView(30),
  6186 + // _couponWidget(),
  6187 + // VEmptyView(20),
  6188 + Container(
  6189 + key: botGlobalKey,
  6190 + height: ScreenUtil().setWidth(20)),
  6191 + ],
  6192 + )),
  6193 + Padding(
  6194 + padding: EdgeInsets.symmetric(
  6195 + horizontal: ScreenUtil().setWidth(48)),
  6196 + child: _btnWidget()),
  6197 + _showOverlay ? VEmptyView(100) : SizedBox()
  6198 + ])
  6199 + // Padding(
  6200 + // padding: EdgeInsets.symmetric(
  6201 + // horizontal: ScreenUtil().setWidth(48)),
  6202 + // child: _btnWidget()),
  6203 + ;
  6204 + }
  6205 + }),
  6206 + ),
  6207 + ))));
6194 } 6208 }
6195 } 6209 }
1 -  
2 import 'package:common_utils/common_utils.dart'; 1 import 'package:common_utils/common_utils.dart';
3 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -39,9 +38,9 @@ class SystemAppBar extends StatelessWidget implements PreferredSizeWidget { @@ -39,9 +38,9 @@ class SystemAppBar extends StatelessWidget implements PreferredSizeWidget {
39 ? InkWell( 38 ? InkWell(
40 onTap: onTap ?? 39 onTap: onTap ??
41 () { 40 () {
42 - if (Navigator.canPop(context)) {  
43 - Navigator.pop(context);  
44 - } 41 + if (Navigator.canPop(context)) {
  42 + Navigator.pop(context);
  43 + }
45 }, 44 },
46 child: Container( 45 child: Container(
47 // color: Colors.red, 46 // color: Colors.red,
1 -sdk.dir=/Users/naji2021/Library/Android/sdk  
2 -flutter.sdk=/Users/naji2021/fvm/versions/3.27.3  
  1 +sdk.dir=/Users/wangdongni/Library/Android/sdk
  2 +flutter.sdk=/Users/wangdongni/fvm/versions/3.27.3
1 // This is a generated file; do not edit or check into version control. 1 // This is a generated file; do not edit or check into version control.
2 -FLUTTER_ROOT=/Users/naji2021/fvm/versions/3.27.3  
3 -FLUTTER_APPLICATION_PATH=/Users/naji2021/Desktop/Flutter-ReserveApp/library/table_calendar-3.1.3/example 2 +FLUTTER_ROOT=/Users/wangdongni/fvm/versions/3.27.3
  3 +FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/table_calendar-3.1.3/example
4 COCOAPODS_PARALLEL_CODE_SIGN=true 4 COCOAPODS_PARALLEL_CODE_SIGN=true
5 FLUTTER_TARGET=lib/main.dart 5 FLUTTER_TARGET=lib/main.dart
6 FLUTTER_BUILD_DIR=build 6 FLUTTER_BUILD_DIR=build
1 #!/bin/sh 1 #!/bin/sh
2 # This is a generated file; do not edit or check into version control. 2 # This is a generated file; do not edit or check into version control.
3 -export "FLUTTER_ROOT=/Users/naji2021/fvm/versions/3.27.3"  
4 -export "FLUTTER_APPLICATION_PATH=/Users/naji2021/Desktop/Flutter-ReserveApp/library/table_calendar-3.1.3/example" 3 +export "FLUTTER_ROOT=/Users/wangdongni/fvm/versions/3.27.3"
  4 +export "FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/table_calendar-3.1.3/example"
5 export "COCOAPODS_PARALLEL_CODE_SIGN=true" 5 export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 export "FLUTTER_TARGET=lib/main.dart" 6 export "FLUTTER_TARGET=lib/main.dart"
7 export "FLUTTER_BUILD_DIR=build" 7 export "FLUTTER_BUILD_DIR=build"
1 -sdk.dir=/Users/naji2021/Library/Android/sdk  
2 -flutter.sdk=/Users/naji2021/fvm/versions/3.27.3 1 +sdk.dir=/Users/wangdongni/Library/Android/sdk
  2 +flutter.sdk=/Users/wangdongni/fvm/versions/3.27.3
3 flutter.buildMode=debug 3 flutter.buildMode=debug
1 // This is a generated file; do not edit or check into version control. 1 // This is a generated file; do not edit or check into version control.
2 -FLUTTER_ROOT=/Users/naji2021/fvm/versions/3.27.3  
3 -FLUTTER_APPLICATION_PATH=/Users/naji2021/Desktop/Flutter-ReserveApp/library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930/example 2 +FLUTTER_ROOT=/Users/wangdongni/fvm/versions/3.27.3
  3 +FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930/example
4 COCOAPODS_PARALLEL_CODE_SIGN=true 4 COCOAPODS_PARALLEL_CODE_SIGN=true
5 FLUTTER_TARGET=lib/main.dart 5 FLUTTER_TARGET=lib/main.dart
6 FLUTTER_BUILD_DIR=build 6 FLUTTER_BUILD_DIR=build
1 #!/bin/sh 1 #!/bin/sh
2 # This is a generated file; do not edit or check into version control. 2 # This is a generated file; do not edit or check into version control.
3 -export "FLUTTER_ROOT=/Users/naji2021/fvm/versions/3.27.3"  
4 -export "FLUTTER_APPLICATION_PATH=/Users/naji2021/Desktop/Flutter-ReserveApp/library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930/example" 3 +export "FLUTTER_ROOT=/Users/wangdongni/fvm/versions/3.27.3"
  4 +export "FLUTTER_APPLICATION_PATH=/Users/wangdongni/Desktop/Flutter-ReserveApp/library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930/example"
5 export "COCOAPODS_PARALLEL_CODE_SIGN=true" 5 export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 export "FLUTTER_TARGET=lib/main.dart" 6 export "FLUTTER_TARGET=lib/main.dart"
7 export "FLUTTER_BUILD_DIR=build" 7 export "FLUTTER_BUILD_DIR=build"