Showing
6 changed files
with
71 additions
and
13 deletions
| @@ -18,19 +18,19 @@ if (flutterRoot == null) { | @@ -18,19 +18,19 @@ if (flutterRoot == null) { | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -def flutterVersionCode = "526" | 21 | +def flutterVersionCode = "527" |
| 22 | if (flutterVersionCode == null) { | 22 | if (flutterVersionCode == null) { |
| 23 | - flutterVersionCode = '526' | 23 | + flutterVersionCode = '527' |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | -def flutterVersionName = "5.2.6" | 30 | +def flutterVersionName = "5.2.7" |
| 31 | 31 | ||
| 32 | if (flutterVersionName == null) { | 32 | if (flutterVersionName == null) { |
| 33 | - flutterVersionName = '5.2.6' | 33 | + flutterVersionName = '5.2.7' |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | } | 36 | } |
| @@ -416,9 +416,9 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -416,9 +416,9 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 416 | body: SafeArea( | 416 | body: SafeArea( |
| 417 | child: WillPopScope( | 417 | child: WillPopScope( |
| 418 | child: Consumer<NotebookDetailModel>(builder: (context, model, _) { | 418 | child: Consumer<NotebookDetailModel>(builder: (context, model, _) { |
| 419 | - if (model.pageState != PageState.Success) { | 419 | + if (model.pageStateChange!= PageState.Success) { |
| 420 | return ExceptionPage( | 420 | return ExceptionPage( |
| 421 | - pageState: model.pageState, | 421 | + pageState: model.pageStateChange, |
| 422 | callback: () { | 422 | callback: () { |
| 423 | _getOrderListData(); | 423 | _getOrderListData(); |
| 424 | }, | 424 | }, |
| @@ -151,7 +151,12 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | @@ -151,7 +151,12 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { | ||
| 151 | }, | 151 | }, |
| 152 | showCircle: showCicle, | 152 | showCircle: showCicle, |
| 153 | isShowLoading: isShowLoading); | 153 | isShowLoading: isShowLoading); |
| 154 | + if (detailEntity.type == "0") { | ||
| 155 | + //内部预订 | ||
| 156 | + detailEntity.is_set_ddate = "1"; | ||
| 157 | + } | ||
| 154 | _notebookDetailChangeModel.detailEntity = detailEntity; | 158 | _notebookDetailChangeModel.detailEntity = detailEntity; |
| 159 | + | ||
| 155 | print(detailEntity); | 160 | print(detailEntity); |
| 156 | if (detailEntity.phone != '0') { | 161 | if (detailEntity.phone != '0') { |
| 157 | _notebookDetailChangeModel.phoneController.text = detailEntity.phone; | 162 | _notebookDetailChangeModel.phoneController.text = detailEntity.phone; |
| @@ -74,7 +74,7 @@ class HandleOnlinePageSimState extends State<HandleOnlinePageSim> { | @@ -74,7 +74,7 @@ class HandleOnlinePageSimState extends State<HandleOnlinePageSim> { | ||
| 74 | 74 | ||
| 75 | /// 获取当前预订订单详情 | 75 | /// 获取当前预订订单详情 |
| 76 | _getOrderListData() async { | 76 | _getOrderListData() async { |
| 77 | - detailEntity = await detailModel.getReserveDetail(context, { | 77 | + detailEntity = await detailModel.getReserveDetailSim(context, { |
| 78 | "rid": widget.rid, | 78 | "rid": widget.rid, |
| 79 | }); | 79 | }); |
| 80 | setState(() { | 80 | setState(() { |
| @@ -417,9 +417,9 @@ class HandleOnlinePageSimState extends State<HandleOnlinePageSim> { | @@ -417,9 +417,9 @@ class HandleOnlinePageSimState extends State<HandleOnlinePageSim> { | ||
| 417 | body: SafeArea( | 417 | body: SafeArea( |
| 418 | child: WillPopScope( | 418 | child: WillPopScope( |
| 419 | child: Consumer<NotebookDetailModel>(builder: (context, model, _) { | 419 | child: Consumer<NotebookDetailModel>(builder: (context, model, _) { |
| 420 | - if (model.pageState != PageState.Success) { | 420 | + if (model.pageStateSim != PageState.Success) { |
| 421 | return ExceptionPage( | 421 | return ExceptionPage( |
| 422 | - pageState: model.pageState, | 422 | + pageState: model.pageStateSim, |
| 423 | callback: () { | 423 | callback: () { |
| 424 | _getOrderListData(); | 424 | _getOrderListData(); |
| 425 | }, | 425 | }, |
| @@ -237,6 +237,7 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | @@ -237,6 +237,7 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | ||
| 237 | 'rid': widget.rid, | 237 | 'rid': widget.rid, |
| 238 | }; | 238 | }; |
| 239 | await detailModel.getReserveDepositByRid(context, params); | 239 | await detailModel.getReserveDepositByRid(context, params); |
| 240 | + setState((){}); | ||
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | ///获取核餐记录 | 243 | ///获取核餐记录 |
| @@ -245,6 +246,9 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | @@ -245,6 +246,9 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | ||
| 245 | 'rid': widget.rid, | 246 | 'rid': widget.rid, |
| 246 | }; | 247 | }; |
| 247 | await detailModel.getReserveRecheckByRid(context, params); | 248 | await detailModel.getReserveRecheckByRid(context, params); |
| 249 | + setState(() { | ||
| 250 | + | ||
| 251 | + }); | ||
| 248 | } | 252 | } |
| 249 | 253 | ||
| 250 | ///删除订金 | 254 | ///删除订金 |
| @@ -499,7 +503,7 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | @@ -499,7 +503,7 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | ||
| 499 | 503 | ||
| 500 | ///订座详情 | 504 | ///订座详情 |
| 501 | _getReserveDetail({bool showCicle = false, bool isShowLoading = true}) async { | 505 | _getReserveDetail({bool showCicle = false, bool isShowLoading = true}) async { |
| 502 | - detailEntity = await detailModel.getReserveDetail( | 506 | + detailEntity = await detailModel.getReserveDetailSim( |
| 503 | context, | 507 | context, |
| 504 | { | 508 | { |
| 505 | "rid": widget.rid, | 509 | "rid": widget.rid, |
| @@ -2298,9 +2302,9 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | @@ -2298,9 +2302,9 @@ class NotebookDetailPageSimState extends State<NotebookDetailPageSim> { | ||
| 2298 | ), | 2302 | ), |
| 2299 | body: Consumer<NotebookDetailModel>( | 2303 | body: Consumer<NotebookDetailModel>( |
| 2300 | builder: (context1, model, _) { | 2304 | builder: (context1, model, _) { |
| 2301 | - if (model.pageState != PageState.Success) { | 2305 | + if (model.pageStateSim != PageState.Success) { |
| 2302 | return ExceptionPage( | 2306 | return ExceptionPage( |
| 2303 | - pageState: model.pageState, | 2307 | + pageState: model.pageStateSim, |
| 2304 | callback: () async { | 2308 | callback: () async { |
| 2305 | // _getOrderListData(); | 2309 | // _getOrderListData(); |
| 2306 | _initCancel(); | 2310 | _initCancel(); |
| @@ -36,6 +36,8 @@ import 'dart:convert' as convert; | @@ -36,6 +36,8 @@ import 'dart:convert' as convert; | ||
| 36 | class NotebookDetailModel extends ChangeNotifier { | 36 | class NotebookDetailModel extends ChangeNotifier { |
| 37 | PageState pageState = PageState.Loading; | 37 | PageState pageState = PageState.Loading; |
| 38 | PageState pageStateChange = PageState.Loading; | 38 | PageState pageStateChange = PageState.Loading; |
| 39 | + PageState pageStateSim = PageState.Loading; | ||
| 40 | + | ||
| 39 | 41 | ||
| 40 | String selectNum; | 42 | String selectNum; |
| 41 | int selectIndex; | 43 | int selectIndex; |
| @@ -403,7 +405,9 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -403,7 +405,9 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 403 | return null; | 405 | return null; |
| 404 | }); | 406 | }); |
| 405 | if (baseResp.code == Constant.status_success) { | 407 | if (baseResp.code == Constant.status_success) { |
| 406 | - return GetReserveTypeFieldModel.fromJson(baseResp.responseData).data; | 408 | + reserveTypes = |
| 409 | + GetReserveTypeFieldModel.fromJson(baseResp.responseData).data; | ||
| 410 | + return reserveTypes; | ||
| 407 | } else { | 411 | } else { |
| 408 | pageState = PageState.ConnectivityError; | 412 | pageState = PageState.ConnectivityError; |
| 409 | if (baseResp != null) { | 413 | if (baseResp != null) { |
| @@ -413,6 +417,51 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -413,6 +417,51 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 413 | return null; | 417 | return null; |
| 414 | } | 418 | } |
| 415 | 419 | ||
| 420 | + ///获取已预订订单 | ||
| 421 | + Future<NotebookDetail> getReserveDetailSim( | ||
| 422 | + BuildContext context, Map<String, String> params, | ||
| 423 | + {isShowLoading = true, bool showCircle = false}) async { | ||
| 424 | + if (isShowLoading) { | ||
| 425 | + pageStateSim = PageState.Loading; | ||
| 426 | + notifyListeners(); | ||
| 427 | + } | ||
| 428 | + BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 429 | + .request<Map<String, dynamic>>( | ||
| 430 | + context, Method.post, HttpUrl.reserve_detail, | ||
| 431 | + data: params, showLoading: isShowLoading ? false : showCircle) | ||
| 432 | + .catchError((error) { | ||
| 433 | + print(error.toString()); | ||
| 434 | + if (error is MyError) { | ||
| 435 | + switch (error.type) { | ||
| 436 | + case 1: | ||
| 437 | + pageStateSim = PageState.ConnectivityError; | ||
| 438 | + break; | ||
| 439 | + case 2: | ||
| 440 | + pageStateSim = PageState.ConnectivityTimeOut; | ||
| 441 | + break; | ||
| 442 | + default: | ||
| 443 | + pageStateSim = PageState.ConnectivityError; | ||
| 444 | + break; | ||
| 445 | + } | ||
| 446 | + } | ||
| 447 | + notifyListeners(); | ||
| 448 | + }); | ||
| 449 | + if (baseResp.code == Constant.status_success) { | ||
| 450 | + if (baseResp.data.isEmpty) { | ||
| 451 | + pageStateSim = PageState.Empty; | ||
| 452 | + } else { | ||
| 453 | + pageStateSim = PageState.Success; | ||
| 454 | + } | ||
| 455 | + notifyListeners(); | ||
| 456 | + return NotebookDetail.fromJson(baseResp.data); | ||
| 457 | + } else { | ||
| 458 | + pageStateSim = PageState.ConnectivityError; | ||
| 459 | + if (baseResp != null) { | ||
| 460 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 461 | + } | ||
| 462 | + } | ||
| 463 | + } | ||
| 464 | + | ||
| 416 | ///获取已预订订单 | 465 | ///获取已预订订单 |
| 417 | Future<NotebookDetail> getReserveDetail( | 466 | Future<NotebookDetail> getReserveDetail( |
| 418 | BuildContext context, Map<String, String> params, | 467 | BuildContext context, Map<String, String> params, |
-
Please register or login to post a comment