Commit eddf4bf6a2f7c5c43260fd1bcbab0ce317835292

Authored by wdn127929
1 parent 8a925cd5

核餐和订单订金

  1 +import 'package:common_utils/common_utils.dart';
  2 +
  3 +class ReserveDepositModel {
  4 + int ret;
  5 + List<ReserveDepositSunModel> data;
  6 + String msg;
  7 +
  8 + ReserveDepositModel({this.ret, this.data, this.msg});
  9 +
  10 + ReserveDepositModel.fromJson(Map<String, dynamic> json) {
  11 + ret = json['ret'];
  12 + if (json['data'] != null) {
  13 + data = <ReserveDepositSunModel>[];
  14 + json['data'].forEach((v) {
  15 + data.add(new ReserveDepositSunModel.fromJson(v));
  16 + });
  17 + }
  18 + msg = json['msg'];
  19 + }
  20 +
  21 + Map<String, dynamic> toJson() {
  22 + final Map<String, dynamic> data = new Map<String, dynamic>();
  23 + data['ret'] = this.ret;
  24 + if (this.data != null) {
  25 + data['data'] = this.data.map((v) => v.toJson()).toList();
  26 + }
  27 + data['msg'] = this.msg;
  28 + return data;
  29 + }
  30 +}
  31 +
  32 +class ReserveDepositSunModel {
  33 + String id;
  34 + String sid;
  35 + String rid;
  36 + String price;
  37 + String uid;
  38 + String payTime;
  39 + String payType;
  40 + String payNo;
  41 + String cdate;
  42 + String nickName;
  43 +
  44 + String get payTimeStr {
  45 + if (payTime.toString() == '0') {
  46 + return '';
  47 + }
  48 + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
  49 + int.parse(payTime.toString()) * 1000);
  50 + return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d);
  51 + }
  52 +
  53 + ReserveDepositSunModel(
  54 + {this.id,
  55 + this.sid,
  56 + this.rid,
  57 + this.price,
  58 + this.uid,
  59 + this.payTime,
  60 + this.payType,
  61 + this.payNo,
  62 + this.cdate,
  63 + this.nickName});
  64 +
  65 + ReserveDepositSunModel.fromJson(Map<String, dynamic> json) {
  66 + id = json['id'];
  67 + sid = json['sid'];
  68 + rid = json['rid'];
  69 + price = json['price'];
  70 + uid = json['uid'];
  71 + payTime = json['pay_time'];
  72 + payType = json['pay_type'];
  73 + payNo = json['pay_no'];
  74 + cdate = json['cdate'];
  75 + nickName = json['nick_name'] ?? '';
  76 + }
  77 +
  78 + Map<String, dynamic> toJson() {
  79 + final Map<String, dynamic> data = new Map<String, dynamic>();
  80 + data['id'] = this.id;
  81 + data['sid'] = this.sid;
  82 + data['rid'] = this.rid;
  83 + data['price'] = this.price;
  84 + data['uid'] = this.uid;
  85 + data['pay_time'] = this.payTime;
  86 + data['pay_type'] = this.payType;
  87 + data['pay_no'] = this.payNo;
  88 + data['cdate'] = this.cdate;
  89 + data['nick_name'] = this.nickName;
  90 + return data;
  91 + }
  92 +}
  1 +import 'package:common_utils/common_utils.dart';
  2 +
  3 +class ReserveRecheckModel {
  4 + int ret;
  5 + List<ReserveRecheckSunModel> data;
  6 + String msg;
  7 +
  8 + ReserveRecheckModel({this.ret, this.data, this.msg});
  9 +
  10 + ReserveRecheckModel.fromJson(Map<String, dynamic> json) {
  11 + ret = json['ret'];
  12 + if (json['data'] != null) {
  13 + data = <ReserveRecheckSunModel>[];
  14 + json['data'].forEach((v) {
  15 + data.add(new ReserveRecheckSunModel.fromJson(v));
  16 + });
  17 + }
  18 + msg = json['msg'];
  19 + }
  20 +
  21 + Map<String, dynamic> toJson() {
  22 + final Map<String, dynamic> data = new Map<String, dynamic>();
  23 + data['ret'] = this.ret;
  24 + if (this.data != null) {
  25 + data['data'] = this.data.map((v) => v.toJson()).toList();
  26 + }
  27 + data['msg'] = this.msg;
  28 + return data;
  29 + }
  30 +}
  31 +
  32 +class ReserveRecheckSunModel {
  33 + String id;
  34 + String rid;
  35 + String uid;
  36 + String type;
  37 + String desc;
  38 + String cdate;
  39 + String nickName;
  40 +
  41 + String get typeShow {
  42 + return type == '1'
  43 + ? '已确认'
  44 + : type == '2'
  45 + ? '未接通'
  46 + : '待定';
  47 + }
  48 +
  49 + String get cdateStr {
  50 + if (cdate.toString() == '0') {
  51 + return '';
  52 + }
  53 + DateTime dateTime =
  54 + DateTime.fromMillisecondsSinceEpoch(int.parse(cdate.toString()) * 1000);
  55 + return DateUtil.formatDate(dateTime, format: DateFormats.full);
  56 + }
  57 +
  58 + ReserveRecheckSunModel(
  59 + {this.id,
  60 + this.rid,
  61 + this.uid,
  62 + this.type,
  63 + this.desc,
  64 + this.cdate,
  65 + this.nickName});
  66 +
  67 + ReserveRecheckSunModel.fromJson(Map<String, dynamic> json) {
  68 + id = json['id'];
  69 + rid = json['rid'];
  70 + uid = json['uid'];
  71 + type = json['type'];
  72 + desc = json['desc'];
  73 + cdate = json['cdate'];
  74 + nickName = json['nick_name'] ?? '';
  75 + }
  76 +
  77 + Map<String, dynamic> toJson() {
  78 + final Map<String, dynamic> data = new Map<String, dynamic>();
  79 + data['id'] = this.id;
  80 + data['rid'] = this.rid;
  81 + data['uid'] = this.uid;
  82 + data['type'] = this.type;
  83 + data['desc'] = this.desc;
  84 + data['cdate'] = this.cdate;
  85 + data['nick_name'] = this.nickName;
  86 + return data;
  87 + }
  88 +}
@@ -471,4 +471,18 @@ class HttpUrl { @@ -471,4 +471,18 @@ class HttpUrl {
471 static const String get_seller_template_color_list = 471 static const String get_seller_template_color_list =
472 "?service=App.Seller.GetSellerTemplateColorList"; // 模板/颜色配置信息 472 "?service=App.Seller.GetSellerTemplateColorList"; // 模板/颜色配置信息
473 473
  474 + static const String create_reserve_deposit =
  475 + "?service=App.Reserve.CreateReserveDeposit"; // 订单创建收定金
  476 + static const String get_reserve_deposit_by_rid =
  477 + "?service=App.Reserve.GetReserveDepositByRid"; // 通过预订ID查收定金详情
  478 + static const String del_reserve_deposit_by_id =
  479 + "?service=App.Reserve.DelReserveDepositByid"; // 删除定金
  480 +
  481 + static const String create_reserve_recheck =
  482 + "?service=App.Reserve.CreateReserveRecheck"; // 创建核餐
  483 +
  484 + static const String get_reserve_recheck_by_rid =
  485 + "?service=App.Reserve.GetReserveRecheckByRid"; // 获取核餐记录
  486 +
  487 +
474 } 488 }
@@ -13,6 +13,7 @@ import 'package:provider/provider.dart'; @@ -13,6 +13,7 @@ import 'package:provider/provider.dart';
13 import '../../models/book_deposit_model.dart'; 13 import '../../models/book_deposit_model.dart';
14 import '../../models/get_banquet_deposit_model.dart'; 14 import '../../models/get_banquet_deposit_model.dart';
15 import '../../provider/feast_model.dart'; 15 import '../../provider/feast_model.dart';
  16 +import '../../provider/notebook_detail_model.dart';
16 import '../../provider/user_model.dart'; 17 import '../../provider/user_model.dart';
17 import '../../res/colors.dart'; 18 import '../../res/colors.dart';
18 import '../../utils/dialog_util.dart'; 19 import '../../utils/dialog_util.dart';
@@ -53,6 +54,8 @@ class _BookDepositPageState extends State<BookDepositPage> { @@ -53,6 +54,8 @@ class _BookDepositPageState extends State<BookDepositPage> {
53 bool showDateSelWidget = false; 54 bool showDateSelWidget = false;
54 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); 55 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
55 56
  57 + NotebookDetailModel detailModel;
  58 +
56 FeastModel feastModel; 59 FeastModel feastModel;
57 60
58 @override 61 @override
@@ -138,38 +141,50 @@ class _BookDepositPageState extends State<BookDepositPage> { @@ -138,38 +141,50 @@ class _BookDepositPageState extends State<BookDepositPage> {
138 } 141 }
139 } 142 }
140 143
141 - _setBanquetDeposit() async {  
142 - // if (moneyC.text.trim().length == 0) {  
143 - // Utils.showToast('请输入金额');  
144 - // return;  
145 - // }  
146 - // Map<String, String> pramas = {  
147 - // 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,  
148 - // 'rid': widget.rid,  
149 - // 'price': moneyC.text,  
150 - // 'rname': paymentC.text,  
151 - // 'collection_uid': collectionPIndex == null  
152 - // ? null  
153 - // : feastModel.sellerManageList[collectionPIndex].id,  
154 - // 'rtime': paymentTime == '请选择'  
155 - // ? null  
156 - // : (DateUtil.getDateTime(paymentTime).millisecondsSinceEpoch / 1000)  
157 - // .floor()  
158 - // .toString(),  
159 - // 'pay': payTypeIndex == null ? null : payType[payTypeIndex],  
160 - // 'deposit_id': depositTypeIndex == null  
161 - // ? null  
162 - // : feastModel.depositData[depositTypeIndex].id,  
163 - // 'no': receiptNumberC.text  
164 - // };  
165 - // if (widget.depositSunModel != null) {  
166 - // pramas['id'] = widget.depositSunModel.id;  
167 - // }  
168 - // bool success = await feastModel.setBanquetDeposit(context, pramas);  
169 - // if (success) {  
170 - // Navigator.pop(context);  
171 - // bus.emit('feast_deposit_list');  
172 - // } 144 + _createReserveDeposit() async {
  145 + if (moneyC.text.trim().length == 0) {
  146 + Utils.showToast('请输入金额');
  147 + return;
  148 + }
  149 + if (collectionP == '请选择' || collectionPIndex == null) {
  150 + Utils.showToast('请选择收款人');
  151 + return;
  152 + }
  153 + if (paymentTime == '请选择') {
  154 + Utils.showToast('请选择付款时间');
  155 + return;
  156 + }
  157 + if (paymentType == '请选择' || payTypeIndex == null) {
  158 + Utils.showToast('请选择支付方式');
  159 + return;
  160 + }
  161 + if (receiptNumberC.text.trim().length == 0) {
  162 + Utils.showToast('请输入收据编号');
  163 + return;
  164 + }
  165 + Map<String, String> pramas = {
  166 + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
  167 + 'rid': widget.rid,
  168 + 'price': moneyC.text,
  169 + // 'rname': paymentC.text,
  170 + 'uid': collectionPIndex == null
  171 + ? null
  172 + : feastModel.sellerManageList[collectionPIndex].id,
  173 + 'pay_time': paymentTime == '请选择'
  174 + ? null
  175 + : (DateUtil.getDateTime(paymentTime).millisecondsSinceEpoch / 1000)
  176 + .floor()
  177 + .toString(),
  178 + 'pay_type': payTypeIndex == null ? null : payType[payTypeIndex],
  179 +
  180 + 'pay_no': receiptNumberC.text
  181 + };
  182 + print(feastModel.sellerManageList[collectionPIndex].title);
  183 + bool success = await detailModel.createReserveDeposit(context, pramas);
  184 + if (success) {
  185 + Navigator.pop(context);
  186 + bus.emit('refresh_detail_deposit');
  187 + }
173 } 188 }
174 189
175 ///请输入 190 ///请输入
@@ -386,6 +401,8 @@ class _BookDepositPageState extends State<BookDepositPage> { @@ -386,6 +401,8 @@ class _BookDepositPageState extends State<BookDepositPage> {
386 @override 401 @override
387 Widget build(BuildContext context) { 402 Widget build(BuildContext context) {
388 feastModel = Provider.of<FeastModel>(context, listen: true); 403 feastModel = Provider.of<FeastModel>(context, listen: true);
  404 +
  405 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
389 return Scaffold( 406 return Scaffold(
390 backgroundColor: MyColours.color_ffffff, 407 backgroundColor: MyColours.color_ffffff,
391 key: scaffoldKey, 408 key: scaffoldKey,
@@ -545,7 +562,7 @@ class _BookDepositPageState extends State<BookDepositPage> { @@ -545,7 +562,7 @@ class _BookDepositPageState extends State<BookDepositPage> {
545 textColor: MyColours.color_ffffff, 562 textColor: MyColours.color_ffffff,
546 borderColor: MyColours.color_438E93, 563 borderColor: MyColours.color_438E93,
547 onPressed: () { 564 onPressed: () {
548 - _setBanquetDeposit(); 565 + _createReserveDeposit();
549 }, 566 },
550 )), 567 )),
551 ], 568 ],
@@ -13,6 +13,7 @@ import 'package:one_key/constant/state.dart'; @@ -13,6 +13,7 @@ import 'package:one_key/constant/state.dart';
13 import 'package:one_key/models/manager.dart'; 13 import 'package:one_key/models/manager.dart';
14 import 'package:one_key/models/notebook_detail.dart'; 14 import 'package:one_key/models/notebook_detail.dart';
15 import 'package:one_key/models/remark.dart'; 15 import 'package:one_key/models/remark.dart';
  16 +import 'package:one_key/models/reserve_recheck_model.dart';
16 import 'package:one_key/pages/detail/notebook_detail_change_page.dart'; 17 import 'package:one_key/pages/detail/notebook_detail_change_page.dart';
17 import 'package:one_key/pages/detail/notebook_detail_change_page_f.dart'; 18 import 'package:one_key/pages/detail/notebook_detail_change_page_f.dart';
18 import 'package:one_key/provider/marketing_center_provider.dart'; 19 import 'package:one_key/provider/marketing_center_provider.dart';
@@ -50,6 +51,7 @@ import 'package:one_key/models/table.dart' as t; @@ -50,6 +51,7 @@ import 'package:one_key/models/table.dart' as t;
50 51
51 import '../../app.dart'; 52 import '../../app.dart';
52 53
  54 +import '../../models/reserve_deposit_model.dart';
53 import '../../provider/collect_store_provider.dart'; 55 import '../../provider/collect_store_provider.dart';
54 import '../../utils/screen_util.dart'; 56 import '../../utils/screen_util.dart';
55 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 57 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
@@ -132,6 +134,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -132,6 +134,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
132 _initCancel(); 134 _initCancel();
133 _getReserveDetail(); 135 _getReserveDetail();
134 _getOrderInfo(); 136 _getOrderInfo();
  137 + _getReserveDepositByRid();
  138 + _getReserveRecheckByRid(); //获取核餐记录
135 // _initPersonNumList(); 139 // _initPersonNumList();
136 Map<String, String> params = { 140 Map<String, String> params = {
137 "uid": Provider.of<UserModel>(context, listen: false).user.openid 141 "uid": Provider.of<UserModel>(context, listen: false).user.openid
@@ -155,9 +159,44 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -155,9 +159,44 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
155 bus.on("refresh_detail", (args) { 159 bus.on("refresh_detail", (args) {
156 _getReserveDetail(); 160 _getReserveDetail();
157 }); 161 });
  162 + bus.on("refresh_detail_deposit", (args) {
  163 + _getReserveDepositByRid(); //刷新订金数据
  164 + });
  165 + bus.on("refresh_detail_reserve_recheck", (args) {
  166 + _getReserveRecheckByRid(); //获取核餐记录
  167 + });
158 }); 168 });
159 } 169 }
160 170
  171 + /// 通过预订ID查收定金详情
  172 + _getReserveDepositByRid() async {
  173 + Map<String, String> params = {
  174 + 'rid': widget.rid,
  175 + };
  176 + await detailModel.getReserveDepositByRid(context, params);
  177 + }
  178 +
  179 + ///获取核餐记录
  180 + _getReserveRecheckByRid() async {
  181 + Map<String, String> params = {
  182 + 'rid': widget.rid,
  183 + };
  184 + await detailModel.getReserveRecheckByRid(context, params);
  185 + }
  186 +
  187 + ///删除定金
  188 + _delReserveDepositByid(String id) async {
  189 + Map<String, String> params = {
  190 + 'id': id,
  191 + };
  192 + bool success = await detailModel.delReserveDepositByid(context, params);
  193 + if (success) {
  194 + Utils.showToast('删除成功');
  195 + detailModel.reserveDepositList.removeWhere((element) => element.id == id);
  196 + setState(() {});
  197 + }
  198 + }
  199 +
161 getSellerVersion() async { 200 getSellerVersion() async {
162 await collectStoreProvider.getSellerVersion(context); 201 await collectStoreProvider.getSellerVersion(context);
163 202
@@ -370,6 +409,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -370,6 +409,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
370 super.dispose(); 409 super.dispose();
371 410
372 bus.off("refresh_detail"); 411 bus.off("refresh_detail");
  412 + bus.off("refresh_detail_deposit");
  413 + bus.off("refresh_detail_reserve_recheck");
373 } 414 }
374 415
375 ///获取订单详情 416 ///获取订单详情
@@ -1358,12 +1399,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1358,12 +1399,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1358 ), 1399 ),
1359 ListView.builder( 1400 ListView.builder(
1360 padding: EdgeInsets.only(left: w(13), top: w(20)), 1401 padding: EdgeInsets.only(left: w(13), top: w(20)),
1361 - itemCount: 2, 1402 + itemCount: detailModel.reserveDepositList.length,
1362 shrinkWrap: true, 1403 shrinkWrap: true,
1363 controller: controller, 1404 controller: controller,
1364 itemBuilder: (BuildContext context, int index) { 1405 itemBuilder: (BuildContext context, int index) {
1365 - // GetBanquetDepositSunModel data =  
1366 - // feastModel.banquetDepositData[index]; 1406 + ReserveDepositSunModel data = detailModel.reserveDepositList[index];
1367 return InkWell( 1407 return InkWell(
1368 onTap: () { 1408 onTap: () {
1369 // NavigatorUtil.goFeastDepositPage(context, feastModel.rid, 1409 // NavigatorUtil.goFeastDepositPage(context, feastModel.rid,
@@ -1393,7 +1433,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1393,7 +1433,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1393 mainAxisAlignment: MainAxisAlignment.spaceBetween, 1433 mainAxisAlignment: MainAxisAlignment.spaceBetween,
1394 children: [ 1434 children: [
1395 Text( 1435 Text(
1396 - '收据编号 SJ000001', 1436 + '收据编号 ${data.payNo}',
1397 // '收据编号 ${data.no == '0' ? '' : data.no}', 1437 // '收据编号 ${data.no == '0' ? '' : data.no}',
1398 overflow: TextOverflow.ellipsis, 1438 overflow: TextOverflow.ellipsis,
1399 style: TextStyle( 1439 style: TextStyle(
@@ -1409,7 +1449,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1409,7 +1449,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1409 isBoldContent: true, 1449 isBoldContent: true,
1410 contentColor: MyColours.color_E6000000, 1450 contentColor: MyColours.color_E6000000,
1411 rTitle: "删除", rCallback: () { 1451 rTitle: "删除", rCallback: () {
1412 - // _delBanquetDeposit(data.id); 1452 + _delReserveDepositByid(data.id);
1413 }); 1453 });
1414 }, 1454 },
1415 child: Image.asset( 1455 child: Image.asset(
@@ -1428,8 +1468,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1428,8 +1468,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1428 crossAxisAlignment: CrossAxisAlignment.start, 1468 crossAxisAlignment: CrossAxisAlignment.start,
1429 mainAxisAlignment: MainAxisAlignment.spaceEvenly, 1469 mainAxisAlignment: MainAxisAlignment.spaceEvenly,
1430 children: [ 1470 children: [
1431 - djTextType1('定金金额 ', '200', ' 元'),  
1432 - djText('支付方式 ', '现金'), 1471 + djTextType1('定金金额 ', '${data.price}', ' 元'),
  1472 + djText('支付方式 ', '${data.payType}'),
1433 ], 1473 ],
1434 ), 1474 ),
1435 HEmptyView(140), 1475 HEmptyView(140),
@@ -1437,8 +1477,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1437,8 +1477,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1437 crossAxisAlignment: CrossAxisAlignment.start, 1477 crossAxisAlignment: CrossAxisAlignment.start,
1438 mainAxisAlignment: MainAxisAlignment.spaceEvenly, 1478 mainAxisAlignment: MainAxisAlignment.spaceEvenly,
1439 children: [ 1479 children: [
1440 - djText('付款时间 ', '2023-10-01'),  
1441 - djText('收款人 ', 'cccc经理'), 1480 + djText('付款时间 ', '${data.payTimeStr}'),
  1481 + djText('收款人 ', '${data.nickName}'),
1442 // djText('收款人 ', 1482 // djText('收款人 ',
1443 // '${data.nickName == null ? '' : data.nickName}'), 1483 // '${data.nickName == null ? '' : data.nickName}'),
1444 ], 1484 ],
@@ -1447,8 +1487,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1447,8 +1487,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1447 )) 1487 ))
1448 ]))); 1488 ])));
1449 }), 1489 }),
1450 - VEmptyView(20),  
1451 - MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4), 1490 + // VEmptyView(20),
  1491 + // MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
1452 ]); 1492 ]);
1453 } 1493 }
1454 1494
@@ -1478,39 +1518,52 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1478,39 +1518,52 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1478 gradientStart: MyColours.color_ffffff, 1518 gradientStart: MyColours.color_ffffff,
1479 gradientEnd: MyColours.color_ffffff, 1519 gradientEnd: MyColours.color_ffffff,
1480 onPressed: () { 1520 onPressed: () {
1481 - NavigatorUtil.goVerifyFoodPage(  
1482 - context,  
1483 - ); 1521 + NavigatorUtil.goVerifyFoodPage(context, widget.rid);
1484 }, 1522 },
1485 ), 1523 ),
1486 ], 1524 ],
1487 ), 1525 ),
1488 ListView.builder( 1526 ListView.builder(
1489 padding: EdgeInsets.only(left: w(13), top: w(20)), 1527 padding: EdgeInsets.only(left: w(13), top: w(20)),
1490 - itemCount: 3, 1528 + itemCount: detailModel.reserveRecheckList.length,
1491 shrinkWrap: true, 1529 shrinkWrap: true,
1492 controller: controller, 1530 controller: controller,
1493 itemBuilder: (BuildContext context, int index) { 1531 itemBuilder: (BuildContext context, int index) {
1494 - // GetBanquetDepositSunModel data =  
1495 - // feastModel.banquetDepositData[index]; 1532 + ReserveRecheckSunModel data = detailModel.reserveRecheckList[index];
1496 return Container( 1533 return Container(
1497 margin: EdgeInsets.only(bottom: w(10)), 1534 margin: EdgeInsets.only(bottom: w(10)),
1498 - child: Row(  
1499 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
1500 - children: [  
1501 - Text(  
1502 - '未接通、已确认、待定',  
1503 - overflow: TextOverflow.ellipsis,  
1504 - style: TextStyle(  
1505 - color: MyColours.color_515151, fontSize: font(14)),  
1506 - ),  
1507 - Text(  
1508 - '张小娴 2023-12-16 15:23',  
1509 - overflow: TextOverflow.ellipsis, 1535 + child: Column(
  1536 + children: [
  1537 + Row(
  1538 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1539 + children: [
  1540 + Text(
  1541 + '${data.typeShow}',
  1542 + overflow: TextOverflow.ellipsis,
  1543 + style: TextStyle(
  1544 + color: MyColours.color_515151,
  1545 + fontSize: font(14)),
  1546 + ),
  1547 + Text(
  1548 + '${data.nickName} ${data.cdateStr}',
  1549 + overflow: TextOverflow.ellipsis,
  1550 + style: TextStyle(
  1551 + color: MyColours.color_999999,
  1552 + fontSize: font(14)),
  1553 + ),
  1554 + ]),
  1555 + Align(
  1556 + alignment: Alignment.centerRight,
  1557 + child: Text(
  1558 + '${data.desc}',
  1559 + textAlign: TextAlign.right,
  1560 + // overflow: TextOverflow.ellipsis,
1510 style: TextStyle( 1561 style: TextStyle(
1511 color: MyColours.color_999999, fontSize: font(14)), 1562 color: MyColours.color_999999, fontSize: font(14)),
1512 ), 1563 ),
1513 - ])); 1564 + ),
  1565 + ],
  1566 + ));
1514 }), 1567 }),
1515 VEmptyView(20), 1568 VEmptyView(20),
1516 MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4), 1569 MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
@@ -1559,12 +1612,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1559,12 +1612,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1559 Expanded( 1612 Expanded(
1560 child: Text( 1613 child: Text(
1561 '${detailEntity.nick_name ?? ''}' + 1614 '${detailEntity.nick_name ?? ''}' +
1562 - ' ' +  
1563 - '${detailEntity.seller_user_phone ?? ''}' +  
1564 - ( detailEntity.up_date ==  
1565 - null  
1566 - ? ''  
1567 - : ' ${_getDateTime(detailEntity.up_date)}'), 1615 + ' ' +
  1616 + '${detailEntity.seller_user_phone ?? ''}' +
  1617 + (detailEntity.up_date == null
  1618 + ? ''
  1619 + : ' ${_getDateTime(detailEntity.up_date)}'),
1568 // overflow: TextOverflow.ellipsis, 1620 // overflow: TextOverflow.ellipsis,
1569 textAlign: TextAlign.right, 1621 textAlign: TextAlign.right,
1570 style: 1622 style:
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/provider/user_model.dart';
2 import 'package:one_key/widgets/MyDivider.dart'; 3 import 'package:one_key/widgets/MyDivider.dart';
3 import 'package:one_key/widgets/system_app_bar.dart'; 4 import 'package:one_key/widgets/system_app_bar.dart';
  5 +import 'package:provider/provider.dart';
4 6
  7 +import '../../models/reserve_recheck_model.dart';
  8 +import '../../provider/notebook_detail_model.dart';
5 import '../../res/colors.dart'; 9 import '../../res/colors.dart';
  10 +import '../../utils/event_bus.dart';
6 import '../../utils/screen_util.dart'; 11 import '../../utils/screen_util.dart';
7 import '../../utils/utils.dart'; 12 import '../../utils/utils.dart';
8 import '../../widgets/h_empty_view.dart'; 13 import '../../widgets/h_empty_view.dart';
@@ -13,7 +18,8 @@ import '../../widgets/v_empty_view.dart'; @@ -13,7 +18,8 @@ import '../../widgets/v_empty_view.dart';
13 * 核餐页面 18 * 核餐页面
14 * */ 19 * */
15 class VerifyFoodPage extends StatefulWidget { 20 class VerifyFoodPage extends StatefulWidget {
16 - VerifyFoodPage({Key key}) : super(key: key); 21 + final String rid;
  22 + VerifyFoodPage({Key key, this.rid}) : super(key: key);
17 23
18 @override 24 @override
19 _VerifyFoodPageState createState() => _VerifyFoodPageState(); 25 _VerifyFoodPageState createState() => _VerifyFoodPageState();
@@ -26,6 +32,17 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> { @@ -26,6 +32,17 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> {
26 32
27 TextEditingController customController = TextEditingController(); 33 TextEditingController customController = TextEditingController();
28 FocusNode _cusdemNode = FocusNode(); 34 FocusNode _cusdemNode = FocusNode();
  35 + NotebookDetailModel detailModel;
  36 + ScrollController controller = ScrollController();
  37 +
  38 + @override
  39 + void initState() {
  40 + // TODO: implement initState
  41 + super.initState();
  42 + WidgetsBinding.instance.addPostFrameCallback((_) async {
  43 + _getReserveRecheckByRid();
  44 + });
  45 + }
29 46
30 _itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) { 47 _itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
31 return InkWell( 48 return InkWell(
@@ -44,8 +61,38 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> { @@ -44,8 +61,38 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> {
44 ])); 61 ]));
45 } 62 }
46 63
  64 + ///创建核餐
  65 + _createReserveRecheck() async {
  66 + Map<String, String> pramas = {
  67 + 'rid': widget.rid,
  68 + 'uid': Provider.of<UserModel>(context, listen: false).user.openid,
  69 + 'type': confirmed
  70 + ? '1'
  71 + : connected
  72 + ? '2'
  73 + : '3', //1 已确认 2 未接通 3 待定
  74 + 'desc': customController.text
  75 + };
  76 + bool success = await detailModel.createReserveRecheck(context, pramas);
  77 + if (success) {
  78 + Utils.showToast('保存成功');
  79 +
  80 + bus.emit('refresh_detail_reserve_recheck');
  81 + Navigator.pop(context);
  82 + }
  83 + }
  84 +
  85 + ///获取核餐记录
  86 + _getReserveRecheckByRid() async {
  87 + Map<String, String> params = {
  88 + 'rid': widget.rid,
  89 + };
  90 + await detailModel.getReserveRecheckByRid(context, params);
  91 + }
  92 +
47 @override 93 @override
48 Widget build(BuildContext context) { 94 Widget build(BuildContext context) {
  95 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
49 return Scaffold( 96 return Scaffold(
50 backgroundColor: MyColours.color_ffffff, 97 backgroundColor: MyColours.color_ffffff,
51 appBar: SystemAppBar('核餐确认'), 98 appBar: SystemAppBar('核餐确认'),
@@ -53,149 +100,178 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> { @@ -53,149 +100,178 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> {
53 children: [ 100 children: [
54 Expanded( 101 Expanded(
55 child: SingleChildScrollView( 102 child: SingleChildScrollView(
  103 + controller: controller,
56 child: Padding( 104 child: Padding(
57 - padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(24)),  
58 - child: Column(  
59 - crossAxisAlignment: CrossAxisAlignment.start,  
60 - children: [  
61 - Row(  
62 - children: [  
63 - _itemRadioWidget(confirmed, '已确认', onTap: () {  
64 - if (!confirmed) {  
65 - setState(() {  
66 - confirmed = true; 105 + padding: EdgeInsets.symmetric(
  106 + horizontal: w(16), vertical: w(24)),
  107 + child: Column(
  108 + crossAxisAlignment: CrossAxisAlignment.start,
  109 + children: [
  110 + Row(
  111 + children: [
  112 + _itemRadioWidget(confirmed, '已确认', onTap: () {
  113 + if (!confirmed) {
  114 + setState(() {
  115 + confirmed = true;
67 116
68 - connected = false;  
69 - undetermined = false;  
70 - });  
71 - }  
72 - }),  
73 - Spacer(),  
74 - _itemRadioWidget(connected, '未接通', onTap: () {  
75 - if (!connected) {  
76 - setState(() {  
77 - connected = true; 117 + connected = false;
  118 + undetermined = false;
  119 + });
  120 + }
  121 + }),
  122 + Spacer(),
  123 + _itemRadioWidget(connected, '未接通', onTap: () {
  124 + if (!connected) {
  125 + setState(() {
  126 + connected = true;
78 127
79 - confirmed = false;  
80 - undetermined = false;  
81 - });  
82 - }  
83 - }),  
84 - Spacer(),  
85 - _itemRadioWidget(undetermined, '待定', onTap: () {  
86 - if (!undetermined) {  
87 - setState(() {  
88 - undetermined = true;  
89 - connected = false;  
90 - confirmed = false;  
91 - });  
92 - }  
93 - }),  
94 - ],  
95 - ),  
96 - VEmptyView(40), 128 + confirmed = false;
  129 + undetermined = false;
  130 + });
  131 + }
  132 + }),
  133 + Spacer(),
  134 + _itemRadioWidget(undetermined, '待定', onTap: () {
  135 + if (!undetermined) {
  136 + setState(() {
  137 + undetermined = true;
  138 + connected = false;
  139 + confirmed = false;
  140 + });
  141 + }
  142 + }),
  143 + ],
  144 + ),
  145 + VEmptyView(40),
97 146
98 - Text(  
99 - '备注',  
100 - style: TextStyle(  
101 - color: MyColours.color_515151, fontSize: font(15)),  
102 - ), 147 + Text(
  148 + '备注',
  149 + style: TextStyle(
  150 + color: MyColours.color_515151,
  151 + fontSize: font(15)),
  152 + ),
103 153
104 - VEmptyView(30),  
105 - //输入框  
106 - Container(  
107 - width: double.infinity,  
108 - padding:  
109 - EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),  
110 - alignment: Alignment.topLeft,  
111 - decoration: BoxDecoration(  
112 - color: MyColours.color_ffffff,  
113 - border: Border.all(  
114 - color: MyColours.color_DBDBDB, width: w(1)),  
115 - borderRadius: BorderRadius.circular(r(8))),  
116 - child: TextField(  
117 - controller: customController,  
118 - focusNode: _cusdemNode,  
119 - style: TextStyle(  
120 - color: MyColours.color_333333,  
121 - fontSize: font(14),  
122 - textBaseline: TextBaseline.alphabetic),  
123 - textAlignVertical: TextAlignVertical.center,  
124 - maxLines: 5,  
125 - maxLength: 100,  
126 - decoration: InputDecoration(  
127 - hintText: "请输入备注或点击快捷选择标签",  
128 - hintStyle: TextStyle(  
129 - color: MyColours.color_979797,  
130 - fontSize: font(14), 154 + VEmptyView(30),
  155 + //输入框
  156 + Container(
  157 + width: double.infinity,
  158 + padding: EdgeInsets.symmetric(
  159 + horizontal: w(10), vertical: w(10)),
  160 + alignment: Alignment.topLeft,
  161 + decoration: BoxDecoration(
  162 + color: MyColours.color_ffffff,
  163 + border: Border.all(
  164 + color: MyColours.color_DBDBDB, width: w(1)),
  165 + borderRadius: BorderRadius.circular(r(8))),
  166 + child: TextField(
  167 + controller: customController,
  168 + focusNode: _cusdemNode,
  169 + style: TextStyle(
  170 + color: MyColours.color_333333,
  171 + fontSize: font(14),
  172 + textBaseline: TextBaseline.alphabetic),
  173 + textAlignVertical: TextAlignVertical.center,
  174 + maxLines: 5,
  175 + maxLength: 100,
  176 + decoration: InputDecoration(
  177 + hintText: "请输入备注或点击快捷选择标签",
  178 + hintStyle: TextStyle(
  179 + color: MyColours.color_979797,
  180 + fontSize: font(14),
  181 + ),
  182 + contentPadding: EdgeInsets.zero,
  183 + border: OutlineInputBorder(
  184 + borderSide: BorderSide.none),
  185 + ),
  186 + keyboardType: TextInputType.text,
  187 + onChanged: (value) {
  188 + // setState(() {
  189 + // currentRemark = value ?? "";
  190 + // });
  191 + // if (value.length < currRemark.length &&
  192 + // currRemark.substring(value.length) != ',') {
  193 + // setState(() {
  194 + // currRemark = value ?? "";
  195 + // });
  196 + // if (sum == 0) {
  197 + // for (int i = 0; i < remarks.length; i++) {
  198 + // if (remarks[i].isSelect &&
  199 + // remarks[i].remark == selectItem.last) {
  200 + // setState(() {
  201 + // remarks[i].isSelect = false;
  202 + // });
  203 + // }
  204 + // }
  205 + // }
  206 + // sum++;
  207 + // if (sum == selectItem.last.length ||
  208 + // selectItem.length == 1 ||
  209 + // selectItem.length == 0) {
  210 + // selectItem.removeLast();
  211 + // sum = 0;
  212 + // }
  213 + // } else {
  214 + // setState(() {
  215 + // currRemark = value ?? "";
  216 + // });
  217 + // }
  218 + }),
131 ), 219 ),
132 - contentPadding: EdgeInsets.zero,  
133 - border: OutlineInputBorder(borderSide: BorderSide.none),  
134 - ),  
135 - keyboardType: TextInputType.text,  
136 - onChanged: (value) {  
137 - // setState(() {  
138 - // currentRemark = value ?? "";  
139 - // });  
140 - // if (value.length < currRemark.length &&  
141 - // currRemark.substring(value.length) != ',') {  
142 - // setState(() {  
143 - // currRemark = value ?? "";  
144 - // });  
145 - // if (sum == 0) {  
146 - // for (int i = 0; i < remarks.length; i++) {  
147 - // if (remarks[i].isSelect &&  
148 - // remarks[i].remark == selectItem.last) {  
149 - // setState(() {  
150 - // remarks[i].isSelect = false;  
151 - // });  
152 - // }  
153 - // }  
154 - // }  
155 - // sum++;  
156 - // if (sum == selectItem.last.length ||  
157 - // selectItem.length == 1 ||  
158 - // selectItem.length == 0) {  
159 - // selectItem.removeLast();  
160 - // sum = 0;  
161 - // }  
162 - // } else {  
163 - // setState(() {  
164 - // currRemark = value ?? "";  
165 - // });  
166 - // }  
167 - }),  
168 - ),  
169 - VEmptyView(20),  
170 - MyDivider(  
171 - double.infinity,  
172 - w(0.5),  
173 - color: MyColours.color_BFC4D4,  
174 - ),  
175 - VEmptyView(30),  
176 - Container(  
177 - margin: EdgeInsets.only(bottom: w(10)),  
178 - child: Row(  
179 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
180 - children: [  
181 - Text(  
182 - '未接通、已确认、待定',  
183 - overflow: TextOverflow.ellipsis,  
184 - style: TextStyle(  
185 - color: MyColours.color_515151,  
186 - fontSize: font(14)),  
187 - ),  
188 - Text(  
189 - '张小娴 2023-12-16 15:23',  
190 - overflow: TextOverflow.ellipsis,  
191 - style: TextStyle(  
192 - color: MyColours.color_999999,  
193 - fontSize: font(14)),  
194 - ),  
195 - ]))  
196 - ],  
197 - ),  
198 - ))), 220 + VEmptyView(20),
  221 + MyDivider(
  222 + double.infinity,
  223 + w(0.5),
  224 + color: MyColours.color_BFC4D4,
  225 + ),
  226 + VEmptyView(30),
  227 + ListView.builder(
  228 + padding: EdgeInsets.only(left: w(13), top: w(20)),
  229 + itemCount: detailModel.reserveRecheckList.length,
  230 + shrinkWrap: true,
  231 + controller: controller,
  232 + itemBuilder: (BuildContext context, int index) {
  233 + ReserveRecheckSunModel data =
  234 + detailModel.reserveRecheckList[index];
  235 + return Container(
  236 + margin: EdgeInsets.only(bottom: w(10)),
  237 + child: Column(
  238 + children: [
  239 + Row(
  240 + mainAxisAlignment:
  241 + MainAxisAlignment.spaceBetween,
  242 + children: [
  243 + Text(
  244 + '${data.typeShow}',
  245 + overflow: TextOverflow.ellipsis,
  246 + style: TextStyle(
  247 + color: MyColours.color_515151,
  248 + fontSize: font(14)),
  249 + ),
  250 + Text(
  251 + '${data.nickName} ${data.cdateStr}',
  252 + overflow: TextOverflow.ellipsis,
  253 + style: TextStyle(
  254 + color: MyColours.color_999999,
  255 + fontSize: font(14)),
  256 + ),
  257 + ]),
  258 + Align(
  259 + alignment: Alignment.centerRight,
  260 + child: Text(
  261 + '${data.desc}',
  262 + textAlign: TextAlign.right,
  263 + // overflow: TextOverflow.ellipsis,
  264 + style: TextStyle(
  265 + color: MyColours.color_999999,
  266 + fontSize: font(14)),
  267 + ),
  268 + ),
  269 + ],
  270 + ));
  271 + }),
  272 + ],
  273 + ),
  274 + ))),
199 Container( 275 Container(
200 padding: EdgeInsets.symmetric(horizontal: w(24), vertical: w(35)), 276 padding: EdgeInsets.symmetric(horizontal: w(24), vertical: w(35)),
201 child: Row( 277 child: Row(
@@ -228,7 +304,7 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> { @@ -228,7 +304,7 @@ class _VerifyFoodPageState extends State<VerifyFoodPage> {
228 textColor: MyColours.color_ffffff, 304 textColor: MyColours.color_ffffff,
229 borderColor: MyColours.color_438E93, 305 borderColor: MyColours.color_438E93,
230 onPressed: () { 306 onPressed: () {
231 - // _setBanquetDeposit(); 307 + _createReserveRecheck();
232 }, 308 },
233 )), 309 )),
234 ], 310 ],
@@ -14,6 +14,9 @@ import 'package:one_key/route/navigator_util.dart'; @@ -14,6 +14,9 @@ import 'package:one_key/route/navigator_util.dart';
14 import 'package:one_key/utils/utils.dart'; 14 import 'package:one_key/utils/utils.dart';
15 import 'package:provider/provider.dart'; 15 import 'package:provider/provider.dart';
16 16
  17 +import '../models/reserve_deposit_model.dart';
  18 +import '../models/reserve_recheck_model.dart';
  19 +
17 class NotebookDetailModel extends ChangeNotifier { 20 class NotebookDetailModel extends ChangeNotifier {
18 PageState pageState = PageState.Loading; 21 PageState pageState = PageState.Loading;
19 String selectNum; 22 String selectNum;
@@ -25,6 +28,10 @@ class NotebookDetailModel extends ChangeNotifier { @@ -25,6 +28,10 @@ class NotebookDetailModel extends ChangeNotifier {
25 TextEditingController nameController = TextEditingController(); 28 TextEditingController nameController = TextEditingController();
26 List sexList; 29 List sexList;
27 List<UserHistoryEntity> userHistorys = []; //历史录入 30 List<UserHistoryEntity> userHistorys = []; //历史录入
  31 +
  32 + List<ReserveDepositSunModel> reserveDepositList = []; //订单订金数据
  33 + List<ReserveRecheckSunModel> reserveRecheckList = []; //核餐记录数据
  34 +
28 NotebookDetailModel() { 35 NotebookDetailModel() {
29 initSexList(); 36 initSexList();
30 } 37 }
@@ -70,6 +77,48 @@ class NotebookDetailModel extends ChangeNotifier { @@ -70,6 +77,48 @@ class NotebookDetailModel extends ChangeNotifier {
70 } 77 }
71 } 78 }
72 79
  80 + /// 通过预订ID查收定金详情
  81 + getReserveDepositByRid(
  82 + BuildContext context, Map<String, String> params) async {
  83 + BaseResp<dynamic> baseResp = await DioUtil()
  84 + .request<dynamic>(
  85 + context, Method.get, HttpUrl.get_reserve_deposit_by_rid,
  86 + data: params, showLoading: false)
  87 + .catchError((error) {
  88 + print(error.toString());
  89 + });
  90 + if (baseResp.code == Constant.status_success) {
  91 + reserveDepositList =
  92 + ReserveDepositModel.fromJson(baseResp.responseData).data;
  93 + } else {
  94 + if (baseResp != null) {
  95 + Utils.showToast(baseResp.msg ?? "");
  96 + }
  97 + }
  98 + notifyListeners();
  99 + }
  100 +
  101 + /// 获取核餐记录
  102 + getReserveRecheckByRid(
  103 + BuildContext context, Map<String, String> params) async {
  104 + BaseResp<dynamic> baseResp = await DioUtil()
  105 + .request<dynamic>(
  106 + context, Method.get, HttpUrl.get_reserve_recheck_by_rid,
  107 + data: params, showLoading: false)
  108 + .catchError((error) {
  109 + print(error.toString());
  110 + });
  111 + if (baseResp.code == Constant.status_success) {
  112 + reserveRecheckList =
  113 + ReserveRecheckModel.fromJson(baseResp.responseData).data;
  114 + } else {
  115 + if (baseResp != null) {
  116 + Utils.showToast(baseResp.msg ?? "");
  117 + }
  118 + }
  119 + notifyListeners();
  120 + }
  121 +
73 ///获取已预订订单 122 ///获取已预订订单
74 Future<NotebookDetail> getReserveDetail( 123 Future<NotebookDetail> getReserveDetail(
75 BuildContext context, Map<String, String> params, 124 BuildContext context, Map<String, String> params,
@@ -149,6 +198,60 @@ class NotebookDetailModel extends ChangeNotifier { @@ -149,6 +198,60 @@ class NotebookDetailModel extends ChangeNotifier {
149 } 198 }
150 } 199 }
151 200
  201 + ///创建收定金
  202 + createReserveDeposit(BuildContext context, Map<String, String> params) async {
  203 + BaseResp<dynamic> baseResp = await DioUtil()
  204 + .request<dynamic>(context, Method.get, HttpUrl.create_reserve_deposit,
  205 + data: params)
  206 + .catchError((error) {
  207 + print(error.toString());
  208 + return false;
  209 + });
  210 + if (baseResp.code == Constant.status_success) {
  211 + return true;
  212 + } else {
  213 + Utils.showToast(baseResp.msg ?? "");
  214 + return false;
  215 + }
  216 + }
  217 +
  218 + ///创建核餐
  219 + createReserveRecheck(BuildContext context, Map<String, String> params) async {
  220 + BaseResp<dynamic> baseResp = await DioUtil()
  221 + .request<dynamic>(context, Method.get, HttpUrl.create_reserve_recheck,
  222 + data: params)
  223 + .catchError((error) {
  224 + print(error.toString());
  225 + return false;
  226 + });
  227 + if (baseResp.code == Constant.status_success) {
  228 + return true;
  229 + } else {
  230 + Utils.showToast(baseResp.msg ?? "");
  231 + return false;
  232 + }
  233 + }
  234 +
  235 + //删除预订订金
  236 +
  237 + delReserveDepositByid(
  238 + BuildContext context, Map<String, String> params) async {
  239 + BaseResp<dynamic> baseResp = await DioUtil()
  240 + .request<dynamic>(
  241 + context, Method.get, HttpUrl.del_reserve_deposit_by_id,
  242 + data: params)
  243 + .catchError((error) {
  244 + print(error.toString());
  245 + return false;
  246 + });
  247 + if (baseResp.code == Constant.status_success) {
  248 + return true;
  249 + } else {
  250 + Utils.showToast(baseResp.msg ?? "");
  251 + return false;
  252 + }
  253 + }
  254 +
152 //取消预订发送短信 255 //取消预订发送短信
153 wxSendCancelSms(BuildContext context, Map<String, String> params) async { 256 wxSendCancelSms(BuildContext context, Map<String, String> params) async {
154 BaseResp<dynamic> baseResp = await DioUtil() 257 BaseResp<dynamic> baseResp = await DioUtil()
@@ -1864,9 +1864,11 @@ class NavigatorUtil { @@ -1864,9 +1864,11 @@ class NavigatorUtil {
1864 1864
1865 ///预订----核餐确认 1865 ///预订----核餐确认
1866 static Future<dynamic> goVerifyFoodPage( 1866 static Future<dynamic> goVerifyFoodPage(
1867 - BuildContext context, { 1867 + BuildContext context,
  1868 + String rid, {
1868 replace = false, 1869 replace = false,
1869 }) { 1870 }) {
1870 - return _navigateTo(context, "${Routes.verify_food_page}", replace: replace); 1871 + return _navigateTo(context, "${Routes.verify_food_page}?rid=$rid",
  1872 + replace: replace);
1871 } 1873 }
1872 } 1874 }
@@ -3150,18 +3150,24 @@ var bookDepositPageHandle = new Handler( @@ -3150,18 +3150,24 @@ var bookDepositPageHandle = new Handler(
3150 3150
3151 return ChangeNotifierProvider<NotebookDetailModel>( 3151 return ChangeNotifierProvider<NotebookDetailModel>(
3152 create: (_) => NotebookDetailModel(), 3152 create: (_) => NotebookDetailModel(),
3153 - child: BookDepositPage(rid: rid, depositSunModel: depositSunModel)); 3153 + child: ChangeNotifierProvider<FeastModel>(
  3154 + create: (_) => FeastModel(),
  3155 + child:
  3156 + BookDepositPage(rid: rid, depositSunModel: depositSunModel)));
3154 } 3157 }
3155 - return ChangeNotifierProvider<FeastModel>(  
3156 - create: (_) => FeastModel(),  
3157 - child: BookDepositPage(  
3158 - rid: rid,  
3159 - )); 3158 + return ChangeNotifierProvider<NotebookDetailModel>(
  3159 + create: (_) => NotebookDetailModel(),
  3160 + child: ChangeNotifierProvider<FeastModel>(
  3161 + create: (_) => FeastModel(),
  3162 + child: BookDepositPage(
  3163 + rid: rid,
  3164 + )));
3160 }); 3165 });
3161 3166
3162 //核餐确认 3167 //核餐确认
3163 var verifyFoodPageHandle = new Handler( 3168 var verifyFoodPageHandle = new Handler(
3164 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 3169 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  3170 + String rid = params["rid"].first;
3165 return ChangeNotifierProvider<NotebookDetailModel>( 3171 return ChangeNotifierProvider<NotebookDetailModel>(
3166 - create: (_) => NotebookDetailModel(), child: VerifyFoodPage()); 3172 + create: (_) => NotebookDetailModel(), child: VerifyFoodPage(rid:rid));
3167 }); 3173 });