Commit bb653f4f20498f3e7a1dc0fc068642b4ac646b1b

Authored by gaiyaguang
2 parents 0da93336 0d9e1994

桌位管理

@@ -11,12 +11,12 @@ if (flutterRoot == null) { @@ -11,12 +11,12 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 14 +def flutterVersionCode = "121"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 flutterVersionCode = '131' 16 flutterVersionCode = '131'
17 } 17 }
18 18
19 -def flutterVersionName = localProperties.getProperty('flutter.versionName') 19 +def flutterVersionName = "1.2.1"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 flutterVersionName = '1.3.1' 21 flutterVersionName = '1.3.1'
22 } 22 }
@@ -43,8 +43,8 @@ android { @@ -43,8 +43,8 @@ android {
43 applicationId "com.naji.one_key" 43 applicationId "com.naji.one_key"
44 minSdkVersion 21 44 minSdkVersion 21
45 targetSdkVersion 28 45 targetSdkVersion 28
46 - versionCode 118  
47 - versionName "1.1.8" 46 + versionCode flutterVersionCode.toInteger()
  47 + versionName flutterVersionName
48 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 48 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
49 49
50 ndk { 50 ndk {
@@ -179,6 +179,7 @@ class DioUtil { @@ -179,6 +179,7 @@ class DioUtil {
179 } 179 }
180 if (showLoading) Loading.showLoading(context); 180 if (showLoading) Loading.showLoading(context);
181 try { 181 try {
  182 + print('--------' + path + '---------');
182 Response response = await _dio.request(path, 183 Response response = await _dio.request(path,
183 data: data, 184 data: data,
184 options: _checkOptions(method, options), 185 options: _checkOptions(method, options),
@@ -412,8 +413,8 @@ class DioUtil { @@ -412,8 +413,8 @@ class DioUtil {
412 Options options = new Options(); 413 Options options = new Options();
413 options.contentType = 414 options.contentType =
414 ContentType.parse("application/x-www-form-urlencoded"); 415 ContentType.parse("application/x-www-form-urlencoded");
415 - options.connectTimeout = 1000 * 10;//默认10s  
416 - options.receiveTimeout = 1000 * 10;//默认10s 416 + options.connectTimeout = 1000 * 10; //默认10s
  417 + options.receiveTimeout = 1000 * 10; //默认10s
417 return options; 418 return options;
418 } 419 }
419 } 420 }
@@ -2,6 +2,7 @@ import 'dart:convert'; @@ -2,6 +2,7 @@ import 'dart:convert';
2 2
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/constant/state.dart';
5 import 'package:one_key/models/manager.dart'; 6 import 'package:one_key/models/manager.dart';
6 import 'package:one_key/models/notebook_detail.dart'; 7 import 'package:one_key/models/notebook_detail.dart';
7 import 'package:one_key/provider/notebook_detail_model.dart'; 8 import 'package:one_key/provider/notebook_detail_model.dart';
@@ -14,6 +15,7 @@ import 'package:one_key/widgets/MyDivider.dart'; @@ -14,6 +15,7 @@ import 'package:one_key/widgets/MyDivider.dart';
14 import 'package:one_key/widgets/app_bar.dart'; 15 import 'package:one_key/widgets/app_bar.dart';
15 import 'package:one_key/widgets/common_button.dart'; 16 import 'package:one_key/widgets/common_button.dart';
16 import 'package:one_key/widgets/need_item.dart'; 17 import 'package:one_key/widgets/need_item.dart';
  18 +import 'package:one_key/widgets/page_exception.dart';
17 import 'package:one_key/widgets/row_multi_text.dart'; 19 import 'package:one_key/widgets/row_multi_text.dart';
18 import 'package:one_key/widgets/table_item.dart'; 20 import 'package:one_key/widgets/table_item.dart';
19 import 'package:one_key/models/table.dart' as t; 21 import 'package:one_key/models/table.dart' as t;
@@ -38,7 +40,7 @@ class HandleOnlinePage extends StatefulWidget { @@ -38,7 +40,7 @@ class HandleOnlinePage extends StatefulWidget {
38 } 40 }
39 41
40 class HandleOnlinePageState extends State<HandleOnlinePage> { 42 class HandleOnlinePageState extends State<HandleOnlinePage> {
41 - NotebookDetailModel detailModel = NotebookDetailModel(); 43 + NotebookDetailModel detailModel;
42 44
43 NotebookDetail detailEntity; 45 NotebookDetail detailEntity;
44 46
@@ -48,43 +50,52 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -48,43 +50,52 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
48 50
49 Manager manager = Manager(); 51 Manager manager = Manager();
50 52
51 - bool isCallTel=false; 53 + bool isCallTel = false;
52 54
53 - String formatPhone="";//格式客户号码 55 + String formatPhone = ""; //格式客户号码
54 56
55 @override 57 @override
56 void initState() { 58 void initState() {
57 // TODO: implement initState 59 // TODO: implement initState
58 super.initState(); 60 super.initState();
59 - WidgetsBinding.instance.addPostFrameCallback((_) async {  
60 - detailEntity = await detailModel.getReserveDetail(context, {  
61 - "rid": widget.rid,  
62 - });  
63 - setState(() {  
64 - //未处理  
65 - cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman;  
66 - formatPhone=detailEntity.phone;  
67 - if(App.sp.getString("is_call_tel")!=null&&App.sp.getString("is_call_tel")=="1"){  
68 - isCallTel=true;  
69 - }else{  
70 - isCallTel=false;  
71 - if(detailEntity.phone.isNotEmpty&&detailEntity.phone.length==11&&(detailEntity.status=="0"||detailEntity.status=="6")){  
72 - formatPhone=detailEntity.phone.substring(0,3)+"****"+detailEntity.phone.substring(7);  
73 - }  
74 - }  
75 - });  
76 - if (detailEntity.status != "0") {  
77 - //已处理  
78 - Future.delayed(Duration(milliseconds: 200), () {  
79 - NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,  
80 - fromNotify: widget.fromNotify, replace: true);  
81 - });  
82 - setMessageStatus(); 61 + WidgetsBinding.instance.addPostFrameCallback((_) {
  62 + _getOrderListData();
  63 + });
  64 + }
  65 +
  66 + /// 获取当前预订订单详情
  67 + _getOrderListData() async {
  68 + detailEntity = await detailModel.getReserveDetail(context, {
  69 + "rid": widget.rid,
  70 + });
  71 + setState(() {
  72 + //未处理
  73 + cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman;
  74 + formatPhone = detailEntity.phone;
  75 + if (App.sp.getString("is_call_tel") != null &&
  76 + App.sp.getString("is_call_tel") == "1") {
  77 + isCallTel = true;
83 } else { 78 } else {
84 - managers = await detailModel.getManagers(context); 79 + isCallTel = false;
  80 + if (detailEntity.phone.isNotEmpty &&
  81 + detailEntity.phone.length == 11 &&
  82 + (detailEntity.status == "0" || detailEntity.status == "6")) {
  83 + formatPhone = detailEntity.phone.substring(0, 3) +
  84 + "****" +
  85 + detailEntity.phone.substring(7);
  86 + }
85 } 87 }
86 }); 88 });
87 - 89 + if (detailEntity.status != "0") {
  90 + //已处理
  91 + Future.delayed(Duration(milliseconds: 200), () {
  92 + NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
  93 + fromNotify: widget.fromNotify, replace: true);
  94 + });
  95 + setMessageStatus();
  96 + } else {
  97 + managers = await detailModel.getManagers(context);
  98 + }
88 } 99 }
89 100
90 //设置当前客户经理 101 //设置当前客户经理
@@ -137,7 +148,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -137,7 +148,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
137 widget.rid, 148 widget.rid,
138 int.parse(detailEntity.ddate) * 1000, 149 int.parse(detailEntity.ddate) * 1000,
139 detailEntity.ddate_solt); 150 detailEntity.ddate_solt);
140 - if (temp['tid'] != null) { 151 + if (temp != null && temp['tid'] != null) {
141 setReserveStatus("5", tid: temp['tid']); 152 setReserveStatus("5", tid: temp['tid']);
142 } 153 }
143 }, 154 },
@@ -165,7 +176,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -165,7 +176,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
165 }; 176 };
166 bool success = 177 bool success =
167 await detailModel.setReserveStatus(context, params, showLoading: true); 178 await detailModel.setReserveStatus(context, params, showLoading: true);
168 - if (success!=null&&success) { 179 + if (success != null && success) {
169 bus.emit("refresh_book_list"); 180 bus.emit("refresh_book_list");
170 } 181 }
171 } 182 }
@@ -181,34 +192,39 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -181,34 +192,39 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
181 detailModel.setMessageStatus(context, params); 192 detailModel.setMessageStatus(context, params);
182 } 193 }
183 194
184 -  
185 -  
186 @override 195 @override
187 Widget build(BuildContext context) { 196 Widget build(BuildContext context) {
188 - // TODO: implement build  
189 -  
190 - return SafeArea(  
191 - child: WillPopScope(  
192 - child: detailEntity == null  
193 - ? Container(  
194 - width: double.infinity,  
195 - height: double.infinity,  
196 - color: MyColours.color_ffffff,  
197 - )  
198 - : Column(  
199 - children: <Widget>[  
200 - MyAppBar(  
201 - "在线预订详情",  
202 - showBack: true, 197 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
  198 + return Scaffold(
  199 + body: SafeArea(
  200 + child: WillPopScope(
  201 + child: Column(
  202 + children: <Widget>[
  203 + MyAppBar(
  204 + "在线预订详情",
  205 + showBack: true,
  206 + callback: () {
  207 + if (widget.fromNotify) {
  208 + NavigatorUtil.goHomePage(context, initialIndex: 0);
  209 + } else {
  210 + Navigator.of(context).pop();
  211 + }
  212 + },
  213 + ),
  214 + Expanded(child: Consumer<NotebookDetailModel>(
  215 + builder: (context, model, _) {
  216 + if (model.pageState != PageState.Success) {
  217 + return ExceptionPage(
  218 + pageState: model.pageState,
203 callback: () { 219 callback: () {
204 - if (widget.fromNotify) {  
205 - NavigatorUtil.goHomePage(context, initialIndex: 0);  
206 - } else {  
207 - Navigator.of(context).pop();  
208 - } 220 + _getOrderListData();
209 }, 221 },
210 - ),  
211 - Expanded( 222 + emptyMsg: "暂时没有预订列表信息哦",
  223 + emptyImg: "empty_search",
  224 + showMsg: "加载中,请稍后...",
  225 + );
  226 + } else {
  227 + return Expanded(
212 child: DefaultTextStyle( 228 child: DefaultTextStyle(
213 style: TextStyle(decoration: TextDecoration.none), 229 style: TextStyle(decoration: TextDecoration.none),
214 child: Container( 230 child: Container(
@@ -287,8 +303,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -287,8 +303,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
287 )), 303 )),
288 RowMultiText( 304 RowMultiText(
289 "客户姓名", detailEntity.rnameStr), 305 "客户姓名", detailEntity.rnameStr),
290 - RowMultiText(  
291 - "客户电话", formatPhone), 306 + RowMultiText("客户电话", formatPhone),
292 RowMultiText("备注信息", 307 RowMultiText("备注信息",
293 detailEntity.cusdem ?? ""), 308 detailEntity.cusdem ?? ""),
294 MyDivider(double.infinity, 309 MyDivider(double.infinity,
@@ -377,7 +392,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -377,7 +392,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
377 int.parse(detailEntity.ddate) * 392 int.parse(detailEntity.ddate) *
378 1000, 393 1000,
379 detailEntity.ddate_solt); 394 detailEntity.ddate_solt);
380 - if (map!=null&&map['tid'] != null) { 395 + if (map != null && map['tid'] != null) {
381 setReserveStatus("5", 396 setReserveStatus("5",
382 tid: map['tid']); 397 tid: map['tid']);
383 } 398 }
@@ -413,7 +428,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -413,7 +428,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
413 _showRefuseDialog(); 428 _showRefuseDialog();
414 }, 429 },
415 )), 430 )),
416 -  
417 Offstage( 431 Offstage(
418 offstage: !isCallTel, 432 offstage: !isCallTel,
419 child: SizedBox( 433 child: SizedBox(
@@ -424,31 +438,35 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -424,31 +438,35 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
424 MyDivider( 438 MyDivider(
425 ScreenUtil().setWidth(2), 439 ScreenUtil().setWidth(2),
426 ScreenUtil().setHeight(52), 440 ScreenUtil().setHeight(52),
427 - color: MyColours.color_199095, 441 + color:
  442 + MyColours.color_199095,
428 ), 443 ),
429 Expanded( 444 Expanded(
430 child: GestureDetector( 445 child: GestureDetector(
431 - child: Center(  
432 - child: Text(  
433 - "联系顾客",  
434 - style: TextStyle(  
435 - color:  
436 - MyColours.color_199095,  
437 - fontSize:  
438 - ScreenUtil().setSp(34)),  
439 - ),  
440 - ),  
441 - onTap: () {  
442 - if (detailEntity.phone != null &&  
443 - detailEntity  
444 - .phone.isNotEmpty) {  
445 - Utils.goPhone(  
446 - detailEntity.phone);  
447 - } else {  
448 - Utils.showToast("没有客户电话!");  
449 - }  
450 - },  
451 - )), 446 + child: Center(
  447 + child: Text(
  448 + "联系顾客",
  449 + style: TextStyle(
  450 + color: MyColours
  451 + .color_199095,
  452 + fontSize:
  453 + ScreenUtil()
  454 + .setSp(34)),
  455 + ),
  456 + ),
  457 + onTap: () {
  458 + if (detailEntity.phone !=
  459 + null &&
  460 + detailEntity.phone
  461 + .isNotEmpty) {
  462 + Utils.goPhone(
  463 + detailEntity.phone);
  464 + } else {
  465 + Utils.showToast(
  466 + "没有客户电话!");
  467 + }
  468 + },
  469 + )),
452 ], 470 ],
453 ), 471 ),
454 ), 472 ),
@@ -461,9 +479,12 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -461,9 +479,12 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
461 ) 479 )
462 ], 480 ],
463 ))), 481 ))),
464 - )  
465 - ],  
466 - ), 482 + );
  483 + }
  484 + },
  485 + ))
  486 + ],
  487 + ),
467 onWillPop: () async { 488 onWillPop: () async {
468 if (widget.fromNotify) { 489 if (widget.fromNotify) {
469 NavigatorUtil.goHomePage(context, initialIndex: 0); 490 NavigatorUtil.goHomePage(context, initialIndex: 0);
@@ -472,6 +493,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { @@ -472,6 +493,6 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
472 Navigator.of(context).pop(); 493 Navigator.of(context).pop();
473 return true; 494 return true;
474 }, 495 },
475 - )); 496 + )));
476 } 497 }
477 } 498 }
@@ -3,6 +3,7 @@ import 'dart:convert'; @@ -3,6 +3,7 @@ import 'dart:convert';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_picker/flutter_picker.dart'; 4 import 'package:flutter_picker/flutter_picker.dart';
5 import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 import 'package:flutter_screenutil/flutter_screenutil.dart';
  6 +import 'package:one_key/constant/state.dart';
6 import 'package:one_key/models/manager.dart'; 7 import 'package:one_key/models/manager.dart';
7 import 'package:one_key/models/notebook_detail.dart'; 8 import 'package:one_key/models/notebook_detail.dart';
8 import 'package:one_key/provider/message_dialog_model.dart'; 9 import 'package:one_key/provider/message_dialog_model.dart';
@@ -20,6 +21,7 @@ import 'package:one_key/widgets/dialog.dart'; @@ -20,6 +21,7 @@ import 'package:one_key/widgets/dialog.dart';
20 import 'package:one_key/widgets/h_empty_view.dart'; 21 import 'package:one_key/widgets/h_empty_view.dart';
21 import 'package:one_key/widgets/loading.dart'; 22 import 'package:one_key/widgets/loading.dart';
22 import 'package:one_key/widgets/need_item.dart'; 23 import 'package:one_key/widgets/need_item.dart';
  24 +import 'package:one_key/widgets/page_exception.dart';
23 import 'package:one_key/widgets/round_button.dart'; 25 import 'package:one_key/widgets/round_button.dart';
24 import 'package:one_key/widgets/row_multi_text.dart'; 26 import 'package:one_key/widgets/row_multi_text.dart';
25 import 'package:one_key/widgets/table_item.dart'; 27 import 'package:one_key/widgets/table_item.dart';
@@ -44,7 +46,7 @@ class NotebookDetailPage extends StatefulWidget { @@ -44,7 +46,7 @@ class NotebookDetailPage extends StatefulWidget {
44 } 46 }
45 47
46 class NotebookDetailPageState extends State<NotebookDetailPage> { 48 class NotebookDetailPageState extends State<NotebookDetailPage> {
47 - NotebookDetailModel detailModel = NotebookDetailModel(); 49 + NotebookDetailModel detailModel;
48 50
49 NotebookDetail detailEntity; 51 NotebookDetail detailEntity;
50 52
@@ -63,7 +65,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -63,7 +65,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
63 65
64 ScrollController _scrollController; 66 ScrollController _scrollController;
65 67
66 - String formatPhone=""; 68 + String formatPhone = "";
67 69
68 @override 70 @override
69 void initState() { 71 void initState() {
@@ -118,11 +120,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -118,11 +120,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
118 }); 120 });
119 setState(() { 121 setState(() {
120 cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman; 122 cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman;
121 - formatPhone=detailEntity.phone;  
122 - if(App.sp.getString("is_call_tel")!=null&&App.sp.getString("is_call_tel")=="1"){  
123 - }else{  
124 - if(detailEntity.phone.isNotEmpty&&detailEntity.phone.length==11&&(detailEntity.status=="0"||detailEntity.status=="6")){  
125 - formatPhone=detailEntity.phone.substring(0,3)+"****"+detailEntity.phone.substring(7); 123 + formatPhone = detailEntity.phone;
  124 + if (App.sp.getString("is_call_tel") != null &&
  125 + App.sp.getString("is_call_tel") == "1") {
  126 + } else {
  127 + if (detailEntity.phone.isNotEmpty &&
  128 + detailEntity.phone.length == 11 &&
  129 + (detailEntity.status == "0" || detailEntity.status == "6")) {
  130 + formatPhone = detailEntity.phone.substring(0, 3) +
  131 + "****" +
  132 + detailEntity.phone.substring(7);
126 } 133 }
127 } 134 }
128 }); 135 });
@@ -408,346 +415,383 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -408,346 +415,383 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
408 if (MediaQuery.of(context).viewInsets.bottom == 0) { 415 if (MediaQuery.of(context).viewInsets.bottom == 0) {
409 _cancelNode.unfocus(); 416 _cancelNode.unfocus();
410 } 417 }
411 - return WillPopScope(  
412 - child: detailEntity == null  
413 - ? Container(  
414 - width: double.infinity,  
415 - height: double.infinity,  
416 - color: MyColours.color_ffffff,  
417 - )  
418 - : Container(  
419 - color: MyColours.color_ffffff,  
420 - child: Column(  
421 - children: <Widget>[  
422 - SizedBox(height: ScreenUtil.statusBarHeight),  
423 - MyAppBar(  
424 - "订座详情",  
425 - showBack: true, 418 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
  419 + return Scaffold(
  420 + body: SafeArea(
  421 + child: WillPopScope(
  422 + child: Container(
  423 + color: MyColours.color_ffffff,
  424 + child: Column(
  425 + children: <Widget>[
  426 + MyAppBar(
  427 + "订座详情",
  428 + showBack: true,
  429 + callback: () {
  430 + if (widget.fromNotify) {
  431 + NavigatorUtil.goHomePage(context, initialIndex: 0);
  432 + } else {
  433 + Navigator.of(context).pop();
  434 + }
  435 + },
  436 + ),
  437 + Expanded(child:
  438 + Consumer<NotebookDetailModel>(builder: (context, model, _) {
  439 + if (model.pageState != PageState.Success) {
  440 + return ExceptionPage(
  441 + pageState: model.pageState,
426 callback: () { 442 callback: () {
427 - if (widget.fromNotify) {  
428 - NavigatorUtil.goHomePage(context, initialIndex: 0);  
429 - } else {  
430 - Navigator.of(context).pop();  
431 - } 443 + // _getOrderListData();
432 }, 444 },
433 - ),  
434 - Expanded(  
435 - child: DefaultTextStyle(  
436 - style: TextStyle(decoration: TextDecoration.none),  
437 - child: Container(  
438 - color: MyColours.color_ffffff,  
439 - child: SingleChildScrollView( 445 + emptyMsg: "暂时没有预订列表信息哦",
  446 + emptyImg: "empty_search",
  447 + showMsg: "加载中,请稍后...",
  448 + );
  449 + } else {
  450 + return Column(
  451 + children: [
  452 + Expanded(
  453 + child: DefaultTextStyle(
  454 + style: TextStyle(decoration: TextDecoration.none),
440 child: Container( 455 child: Container(
441 - color: MyColours.color_ffffff,  
442 - padding: EdgeInsets.symmetric(  
443 - horizontal: ScreenUtil().setWidth(43)),  
444 - child: Column(  
445 - children: <Widget>[  
446 - RowMultiText("用餐时段", detailEntity.ddateMd),  
447 - Stack(  
448 - alignment: Alignment.center, 456 + color: MyColours.color_ffffff,
  457 + child: SingleChildScrollView(
  458 + child: Container(
  459 + color: MyColours.color_ffffff,
  460 + padding: EdgeInsets.symmetric(
  461 + horizontal: ScreenUtil().setWidth(43)),
  462 + child: Column(
449 children: <Widget>[ 463 children: <Widget>[
450 - Column( 464 + RowMultiText(
  465 + "用餐时段", detailEntity.ddateMd),
  466 + Stack(
  467 + alignment: Alignment.center,
451 children: <Widget>[ 468 children: <Widget>[
452 - RowMultiText(  
453 - "用餐时间", detailEntity.ddateHm),  
454 - Offstage(  
455 - offstage: detailEntity.type == "0"  
456 - ? false  
457 - : true,  
458 - child: RowMultiText(  
459 - "用餐人数", detailEntity.pnum), 469 + Column(
  470 + children: <Widget>[
  471 + RowMultiText("用餐时间",
  472 + detailEntity.ddateHm),
  473 + Offstage(
  474 + offstage:
  475 + detailEntity.type == "0"
  476 + ? false
  477 + : true,
  478 + child: RowMultiText("用餐人数",
  479 + detailEntity.pnum),
  480 + )
  481 + ],
  482 + ),
  483 + Image.asset(
  484 + detailEntity.statuImgAssets,
  485 + width: ScreenUtil().setWidth(100),
  486 + height: ScreenUtil().setWidth(30),
460 ) 487 )
461 ], 488 ],
462 ), 489 ),
463 - Image.asset(  
464 - detailEntity.statuImgAssets,  
465 - width: ScreenUtil().setWidth(100),  
466 - height: ScreenUtil().setWidth(30),  
467 - )  
468 - ],  
469 - ),  
470 - Offstage(  
471 - offstage: detailEntity.demands.length <= 0  
472 - ? true  
473 - : false,  
474 - child: Column(  
475 - children: <Widget>[  
476 - RowMultiText(  
477 - "包间需求",  
478 - (detailEntity.demands.length  
479 - .toString() +  
480 - "个") ??  
481 - ""),  
482 - Align(  
483 - alignment: Alignment.centerRight,  
484 - child: Offstage(  
485 - offstage: detailEntity  
486 - .demands.length >  
487 - 0  
488 - ? false  
489 - : true,  
490 - child: Container(  
491 - height: ScreenUtil()  
492 - .setHeight(210),  
493 - child: ListView.builder(  
494 - itemBuilder:  
495 - (BuildContext contxt,  
496 - int index) {  
497 - return NeedItem(  
498 - detailEntity  
499 - .demands[index]);  
500 - },  
501 - itemCount: detailEntity  
502 - .demands.length,  
503 - shrinkWrap: true,  
504 - scrollDirection:  
505 - Axis.horizontal,  
506 - ),  
507 - ),  
508 - ))  
509 - ],  
510 - ),  
511 - ),  
512 - RowMultiText(  
513 - "预订桌位",  
514 - (detailEntity.tables.length.toString() +  
515 - "个")),  
516 - Align(  
517 - alignment: Alignment.centerRight,  
518 - child: Offstage( 490 + Offstage(
519 offstage: 491 offstage:
520 - detailEntity.tables.length > 0  
521 - ? false  
522 - : true,  
523 - child: Container(  
524 - height: ScreenUtil().setHeight(210),  
525 - child: ListView.builder(  
526 - itemBuilder: (BuildContext contxt,  
527 - int index) {  
528 - return TableItem(  
529 - detailEntity.tables[index]);  
530 - },  
531 - itemCount:  
532 - detailEntity.tables.length,  
533 - shrinkWrap: true,  
534 - scrollDirection: Axis.horizontal,  
535 - ),  
536 - ),  
537 - )),  
538 - RowMultiText("客户姓名", detailEntity.rnameStr),  
539 - RowMultiText(  
540 - "客户电话", formatPhone),  
541 - Offstage(  
542 - offstage: detailEntity.cusdem == '' ||  
543 - detailEntity.cusdem == null,  
544 - child: RowMultiText(  
545 - "备注信息", detailEntity.cusdem ?? ""),  
546 - ),  
547 - MyDivider(double.infinity,  
548 - ScreenUtil().setHeight(1)),  
549 - Container(  
550 - color: MyColours.color_ffffff,  
551 - width: double.infinity,  
552 - height: ScreenUtil().setHeight(80),  
553 - alignment: Alignment.center,  
554 - child: Stack(  
555 - alignment: Alignment.center,  
556 - children: <Widget>[  
557 - Positioned(  
558 - left: 0,  
559 - child: Text(  
560 - "客户经理",  
561 - style: TextStyle(  
562 - color: MyColours.color_828282,  
563 - fontSize:  
564 - ScreenUtil().setSp(30)),  
565 - ), 492 + detailEntity.demands.length <= 0
  493 + ? true
  494 + : false,
  495 + child: Column(
  496 + children: <Widget>[
  497 + RowMultiText(
  498 + "包间需求",
  499 + (detailEntity.demands.length
  500 + .toString() +
  501 + "个") ??
  502 + ""),
  503 + Align(
  504 + alignment:
  505 + Alignment.centerRight,
  506 + child: Offstage(
  507 + offstage: detailEntity
  508 + .demands
  509 + .length >
  510 + 0
  511 + ? false
  512 + : true,
  513 + child: Container(
  514 + height: ScreenUtil()
  515 + .setHeight(210),
  516 + child: ListView.builder(
  517 + itemBuilder:
  518 + (BuildContext
  519 + contxt,
  520 + int index) {
  521 + return NeedItem(
  522 + detailEntity
  523 + .demands[
  524 + index]);
  525 + },
  526 + itemCount: detailEntity
  527 + .demands.length,
  528 + shrinkWrap: true,
  529 + scrollDirection:
  530 + Axis.horizontal,
  531 + ),
  532 + ),
  533 + ))
  534 + ],
566 ), 535 ),
567 - Positioned(  
568 - right: 0,  
569 - child: GestureDetector(  
570 - onTap: () async {  
571 - List<String> list = [];  
572 - for (Manager manager  
573 - in managers) {  
574 - list.add(  
575 - manager.roleUserName);  
576 - }  
577 - DialogUtil  
578 - .showSelectCusmanDialog(  
579 - context, list, (value) {  
580 - if (value != null) {  
581 - setState(() {  
582 - cusmanText =  
583 - managers[value.first]  
584 - .userName;  
585 - });  
586 - _setCurrManager();  
587 - }  
588 - }).then((value) {});  
589 - },  
590 - child: Text(  
591 - cusmanText,  
592 - style: TextStyle(  
593 - color: MyColours.color_353535,  
594 - fontSize:  
595 - ScreenUtil().setSp(30),  
596 - decoration:  
597 - TextDecoration.underline, 536 + ),
  537 + RowMultiText(
  538 + "预订桌位",
  539 + (detailEntity.tables.length
  540 + .toString() +
  541 + "个")),
  542 + Align(
  543 + alignment: Alignment.centerRight,
  544 + child: Offstage(
  545 + offstage:
  546 + detailEntity.tables.length > 0
  547 + ? false
  548 + : true,
  549 + child: Container(
  550 + height:
  551 + ScreenUtil().setHeight(210),
  552 + child: ListView.builder(
  553 + itemBuilder:
  554 + (BuildContext contxt,
  555 + int index) {
  556 + return TableItem(
  557 + detailEntity
  558 + .tables[index]);
  559 + },
  560 + itemCount: detailEntity
  561 + .tables.length,
  562 + shrinkWrap: true,
  563 + scrollDirection:
  564 + Axis.horizontal,
598 ), 565 ),
599 ), 566 ),
600 - ),  
601 - )  
602 - ],  
603 - ),  
604 - ),  
605 - Offstage(  
606 - offstage: detailEntity.note_name == '' ||  
607 - detailEntity.note_name == null,  
608 - child: RowMultiText(  
609 - "记录人", detailEntity.note_name ?? ""),  
610 - ),  
611 - Offstage(  
612 - offstage: (detailEntity.status == "4" &&  
613 - detailEntity.cancel != null)  
614 - ? false  
615 - : true,  
616 - child: Column(  
617 - children: <Widget>[  
618 - MyDivider(double.infinity,  
619 - ScreenUtil().setHeight(2)),  
620 - RowMultiText("取消原因",  
621 - detailEntity.cancel?.desc ?? "",  
622 - textAlign: TextAlign.left),  
623 - RowMultiText(  
624 - "取消时间",  
625 - detailEntity.cancel?.cdateStr ??  
626 - ""),  
627 - RowMultiText(  
628 - "操作人",  
629 - detailEntity.abolition == '2'  
630 - ? '顾客在线取消'  
631 - : detailEntity  
632 - .cancel?.uname ?? 567 + )),
  568 + RowMultiText(
  569 + "客户姓名", detailEntity.rnameStr),
  570 + RowMultiText("客户电话", formatPhone),
  571 + Offstage(
  572 + offstage: detailEntity.cusdem == '' ||
  573 + detailEntity.cusdem == null,
  574 + child: RowMultiText("备注信息",
  575 + detailEntity.cusdem ?? ""),
  576 + ),
  577 + MyDivider(double.infinity,
  578 + ScreenUtil().setHeight(1)),
  579 + Container(
  580 + color: MyColours.color_ffffff,
  581 + width: double.infinity,
  582 + height: ScreenUtil().setHeight(80),
  583 + alignment: Alignment.center,
  584 + child: Stack(
  585 + alignment: Alignment.center,
  586 + children: <Widget>[
  587 + Positioned(
  588 + left: 0,
  589 + child: Text(
  590 + "客户经理",
  591 + style: TextStyle(
  592 + color: MyColours
  593 + .color_828282,
  594 + fontSize: ScreenUtil()
  595 + .setSp(30)),
  596 + ),
  597 + ),
  598 + Positioned(
  599 + right: 0,
  600 + child: GestureDetector(
  601 + onTap: () async {
  602 + List<String> list = [];
  603 + for (Manager manager
  604 + in managers) {
  605 + list.add(
  606 + manager.roleUserName);
  607 + }
  608 + DialogUtil
  609 + .showSelectCusmanDialog(
  610 + context, list,
  611 + (value) {
  612 + if (value != null) {
  613 + setState(() {
  614 + cusmanText = managers[
  615 + value.first]
  616 + .userName;
  617 + });
  618 + _setCurrManager();
  619 + }
  620 + }).then((value) {});
  621 + },
  622 + child: Text(
  623 + cusmanText,
  624 + style: TextStyle(
  625 + color: MyColours
  626 + .color_353535,
  627 + fontSize: ScreenUtil()
  628 + .setSp(30),
  629 + decoration: TextDecoration
  630 + .underline,
  631 + ),
  632 + ),
  633 + ),
  634 + )
  635 + ],
  636 + ),
  637 + ),
  638 + Offstage(
  639 + offstage: detailEntity.note_name ==
  640 + '' ||
  641 + detailEntity.note_name == null,
  642 + child: RowMultiText("记录人",
  643 + detailEntity.note_name ?? ""),
  644 + ),
  645 + Offstage(
  646 + offstage: (detailEntity.status ==
  647 + "4" &&
  648 + detailEntity.cancel != null)
  649 + ? false
  650 + : true,
  651 + child: Column(
  652 + children: <Widget>[
  653 + MyDivider(double.infinity,
  654 + ScreenUtil().setHeight(2)),
  655 + RowMultiText(
  656 + "取消原因",
  657 + detailEntity.cancel?.desc ??
  658 + "",
  659 + textAlign: TextAlign.left),
  660 + RowMultiText(
  661 + "取消时间",
  662 + detailEntity
  663 + .cancel?.cdateStr ??
633 ""), 664 ""),
634 - ],  
635 - ),  
636 - ),  
637 - ],  
638 - )),  
639 - ),  
640 - )),  
641 - ),  
642 - Offstage(  
643 - offstage: (detailEntity.status == "3" ||  
644 - detailEntity.status == "4" ||  
645 - detailEntity.status == "6")  
646 - ? true  
647 - : false,  
648 - child: Container(  
649 - width: double.infinity,  
650 - decoration: BoxDecoration(  
651 - color: MyColours.color_ffffff,  
652 - border: Border(  
653 - top: BorderSide(  
654 - color: MyColours.color_dbe3e3,  
655 - width: ScreenUtil().setWidth(1)))),  
656 - padding: EdgeInsets.fromLTRB(  
657 - ScreenUtil().setHeight(40),  
658 - ScreenUtil().setHeight(40),  
659 - ScreenUtil().setHeight(40),  
660 - ScreenUtil().setHeight(0)),  
661 - margin: EdgeInsets.symmetric(  
662 - vertical: ScreenUtil().setHeight(20)),  
663 - child: CommonButton(  
664 - content: "通知客户",  
665 - width: 669,  
666 - height: 84,  
667 - fontSize: 34,  
668 - onPress: () {  
669 - DialogUtil.showShareDialog(context)?.then((value) {  
670 - switch (value) {  
671 - case 1: //微信  
672 - NavigatorUtil.goInvicationPage(  
673 - context,  
674 - detailEntity.id,  
675 - detailEntity.tableinfoStr,  
676 - detailEntity.ddate,  
677 - detailEntity.ddateStr);  
678 - break;  
679 - case 2: //短信  
680 - NavigatorUtil.goSmsPage(  
681 - context, detailEntity.id);  
682 - break;  
683 - case 3: //电话  
684 - if (detailEntity.phone != null &&  
685 - detailEntity.phone.isNotEmpty) {  
686 - Utils.goPhone(detailEntity.phone);  
687 - } else {  
688 - Utils.showToast("没有客户电话!");  
689 - }  
690 - break;  
691 - }  
692 - });  
693 - }, 665 + RowMultiText(
  666 + "操作人",
  667 + detailEntity.abolition == '2'
  668 + ? '顾客在线取消'
  669 + : detailEntity
  670 + .cancel?.uname ??
  671 + ""),
  672 + ],
  673 + ),
  674 + ),
  675 + ],
  676 + )),
  677 + ),
  678 + )),
694 ), 679 ),
695 - ),  
696 - ),  
697 - Offstage(  
698 - offstage: (detailEntity.status == "3" ||  
699 - detailEntity.status == "4" ||  
700 - detailEntity.status == "6")  
701 - ? true  
702 - : false,  
703 - child: Container(  
704 - width: double.infinity,  
705 - height: ScreenUtil().setWidth(84),  
706 - margin: EdgeInsets.symmetric(  
707 - horizontal: ScreenUtil().setHeight(40)),  
708 - decoration: BoxDecoration(  
709 - border: Border.all(  
710 - color: MyColours.color_199095,  
711 - width: ScreenUtil().setWidth(2)),  
712 - borderRadius:  
713 - BorderRadius.circular(ScreenUtil().setWidth(10)), 680 + Offstage(
  681 + offstage: (detailEntity.status == "3" ||
  682 + detailEntity.status == "4" ||
  683 + detailEntity.status == "6")
  684 + ? true
  685 + : false,
  686 + child: Container(
  687 + width: double.infinity,
  688 + decoration: BoxDecoration(
  689 + color: MyColours.color_ffffff,
  690 + border: Border(
  691 + top: BorderSide(
  692 + color: MyColours.color_dbe3e3,
  693 + width: ScreenUtil().setWidth(1)))),
  694 + padding: EdgeInsets.fromLTRB(
  695 + ScreenUtil().setHeight(40),
  696 + ScreenUtil().setHeight(40),
  697 + ScreenUtil().setHeight(40),
  698 + ScreenUtil().setHeight(0)),
  699 + margin: EdgeInsets.symmetric(
  700 + vertical: ScreenUtil().setHeight(20)),
  701 + child: CommonButton(
  702 + content: "通知客户",
  703 + width: 669,
  704 + height: 84,
  705 + fontSize: 34,
  706 + onPress: () {
  707 + DialogUtil.showShareDialog(context)
  708 + ?.then((value) {
  709 + switch (value) {
  710 + case 1: //微信
  711 + NavigatorUtil.goInvicationPage(
  712 + context,
  713 + detailEntity.id,
  714 + detailEntity.tableinfoStr,
  715 + detailEntity.ddate,
  716 + detailEntity.ddateStr);
  717 + break;
  718 + case 2: //短信
  719 + NavigatorUtil.goSmsPage(
  720 + context, detailEntity.id);
  721 + break;
  722 + case 3: //电话
  723 + if (detailEntity.phone != null &&
  724 + detailEntity.phone.isNotEmpty) {
  725 + Utils.goPhone(detailEntity.phone);
  726 + } else {
  727 + Utils.showToast("没有客户电话!");
  728 + }
  729 + break;
  730 + }
  731 + });
  732 + },
  733 + ),
  734 + ),
714 ), 735 ),
715 - // child: Text('fff'),  
716 - child: Material(  
717 - color: Colors.transparent,  
718 - child: Row(  
719 - children: [  
720 - Expanded(  
721 - child: _cancelAndChangeBtn(() {  
722 - print('点击变更预订');  
723 - NavigatorUtil.goNoteBookChangePage(  
724 - context, detailEntity, widget.rid);  
725 - }, '变更预订')),  
726 - MyDivider(  
727 - ScreenUtil().setWidth(2),  
728 - ScreenUtil().setWidth(50), 736 + Offstage(
  737 + offstage: (detailEntity.status == "3" ||
  738 + detailEntity.status == "4" ||
  739 + detailEntity.status == "6")
  740 + ? true
  741 + : false,
  742 + child: Container(
  743 + width: double.infinity,
  744 + height: ScreenUtil().setWidth(84),
  745 + margin: EdgeInsets.symmetric(
  746 + horizontal: ScreenUtil().setHeight(40)),
  747 + decoration: BoxDecoration(
  748 + border: Border.all(
729 color: MyColours.color_199095, 749 color: MyColours.color_199095,
730 - ),  
731 - Expanded(  
732 - child: _cancelAndChangeBtn(() {  
733 - _showCancelWidget(context);  
734 - }, '取消预订')),  
735 - ],  
736 - )),  
737 - ),  
738 - ),  
739 - VEmptyView(ScreenUtil().setWidth(60))  
740 - ],  
741 - ),  
742 - ),  
743 - onWillPop: () async {  
744 - if (widget.fromNotify) {  
745 - NavigatorUtil.goHomePage(context, initialIndex: 0); 750 + width: ScreenUtil().setWidth(2)),
  751 + borderRadius: BorderRadius.circular(
  752 + ScreenUtil().setWidth(10)),
  753 + ),
  754 + // child: Text('fff'),
  755 + child: Material(
  756 + color: Colors.transparent,
  757 + child: Row(
  758 + children: [
  759 + Expanded(
  760 + child: _cancelAndChangeBtn(() {
  761 + print('点击变更预订');
  762 + NavigatorUtil.goNoteBookChangePage(
  763 + context, detailEntity, widget.rid);
  764 + }, '变更预订')),
  765 + MyDivider(
  766 + ScreenUtil().setWidth(2),
  767 + ScreenUtil().setWidth(50),
  768 + color: MyColours.color_199095,
  769 + ),
  770 + Expanded(
  771 + child: _cancelAndChangeBtn(() {
  772 + _showCancelWidget(context);
  773 + }, '取消预订')),
  774 + ],
  775 + )),
  776 + ),
  777 + ),
  778 + VEmptyView(ScreenUtil().setWidth(60))
  779 + ],
  780 + );
  781 + }
  782 + })),
  783 + ],
  784 + ),
  785 + ),
  786 + onWillPop: () async {
  787 + if (widget.fromNotify) {
  788 + NavigatorUtil.goHomePage(context, initialIndex: 0);
  789 + return true;
  790 + }
  791 + Navigator.of(context).pop();
746 return true; 792 return true;
747 - }  
748 - Navigator.of(context).pop();  
749 - return true;  
750 - }, 793 + },
  794 + )),
751 ); 795 );
752 } 796 }
753 } 797 }
@@ -59,9 +59,13 @@ class NotebookItemState extends State<NoteBookItem> { @@ -59,9 +59,13 @@ class NotebookItemState extends State<NoteBookItem> {
59 children: <Widget>[ 59 children: <Widget>[
60 Container( 60 Container(
61 width: ScreenUtil().setWidth(171), 61 width: ScreenUtil().setWidth(171),
  62 + padding: EdgeInsets.symmetric(
  63 + horizontal: ScreenUtil().setWidth(24)),
62 alignment: Alignment.center, 64 alignment: Alignment.center,
63 child: Text( 65 child: Text(
64 notebook.tableinfoStr?.trim(), 66 notebook.tableinfoStr?.trim(),
  67 + maxLines: 2,
  68 + overflow: TextOverflow.ellipsis,
65 style: TextStyle( 69 style: TextStyle(
66 color: textColor, 70 color: textColor,
67 // fontWeight: FontWeight.bold, 71 // fontWeight: FontWeight.bold,
@@ -81,6 +85,9 @@ class NotebookItemState extends State<NoteBookItem> { @@ -81,6 +85,9 @@ class NotebookItemState extends State<NoteBookItem> {
81 children: <Widget>[ 85 children: <Widget>[
82 Text( 86 Text(
83 notebook.rnameStr, 87 notebook.rnameStr,
  88 + // 'nnnnnnnnnnnnnn',
  89 + maxLines: 1,
  90 + overflow: TextOverflow.ellipsis,
84 style: TextStyle( 91 style: TextStyle(
85 color: textColor, 92 color: textColor,
86 // fontWeight: FontWeight.bold, 93 // fontWeight: FontWeight.bold,
@@ -89,6 +96,8 @@ class NotebookItemState extends State<NoteBookItem> { @@ -89,6 +96,8 @@ class NotebookItemState extends State<NoteBookItem> {
89 VEmptyView(10), 96 VEmptyView(10),
90 Text( 97 Text(
91 notebook.phoneStr, 98 notebook.phoneStr,
  99 + maxLines: 1,
  100 + overflow: TextOverflow.ellipsis,
92 style: TextStyle( 101 style: TextStyle(
93 color: textColor, 102 color: textColor,
94 // fontWeight: FontWeight.bold, 103 // fontWeight: FontWeight.bold,
@@ -436,7 +436,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -436,7 +436,7 @@ class NoteBookPageState extends State<NoteBookPage> {
436 (BuildContext context, int index) { 436 (BuildContext context, int index) {
437 return NoteBookItem(model.notebooks[index], index); 437 return NoteBookItem(model.notebooks[index], index);
438 }, childCount: model.notebooks.length), 438 }, childCount: model.notebooks.length),
439 - itemExtent: ScreenUtil().setHeight(112), 439 + itemExtent: ScreenUtil().setWidth(112),
440 ) 440 )
441 ], 441 ],
442 onRefresh: () async { 442 onRefresh: () async {
@@ -2,6 +2,7 @@ import 'dart:ffi'; @@ -2,6 +2,7 @@ import 'dart:ffi';
2 2
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/constant/state.dart';
5 import 'package:one_key/models/area.dart'; 6 import 'package:one_key/models/area.dart';
6 import 'package:one_key/models/notebook.dart'; 7 import 'package:one_key/models/notebook.dart';
7 import 'package:one_key/models/tableOuter.dart'; 8 import 'package:one_key/models/tableOuter.dart';
@@ -9,13 +10,13 @@ import 'package:one_key/models/table_list.dart'; @@ -9,13 +10,13 @@ import 'package:one_key/models/table_list.dart';
9 import 'package:one_key/provider/choose_table_model.dart'; 10 import 'package:one_key/provider/choose_table_model.dart';
10 import 'package:one_key/provider/notebook_detail_change_model.dart'; 11 import 'package:one_key/provider/notebook_detail_change_model.dart';
11 import 'package:one_key/provider/notebook_model.dart'; 12 import 'package:one_key/provider/notebook_model.dart';
12 -import 'package:one_key/provider/select_table_model.dart';  
13 import 'package:one_key/provider/user_model.dart'; 13 import 'package:one_key/provider/user_model.dart';
14 import 'package:one_key/res/colors.dart'; 14 import 'package:one_key/res/colors.dart';
15 import 'package:one_key/utils/utils.dart'; 15 import 'package:one_key/utils/utils.dart';
16 import 'package:one_key/widgets/app_bar.dart'; 16 import 'package:one_key/widgets/app_bar.dart';
17 import 'package:one_key/widgets/area_item.dart'; 17 import 'package:one_key/widgets/area_item.dart';
18 import 'package:one_key/widgets/common_button.dart'; 18 import 'package:one_key/widgets/common_button.dart';
  19 +import 'package:one_key/widgets/page_exception.dart';
19 import 'package:one_key/widgets/table_item.dart'; 20 import 'package:one_key/widgets/table_item.dart';
20 import 'package:one_key/models/table.dart' as t; 21 import 'package:one_key/models/table.dart' as t;
21 import 'package:provider/provider.dart'; 22 import 'package:provider/provider.dart';
@@ -46,8 +47,6 @@ class SelectTablePageState extends State<SelectTablePage> { @@ -46,8 +47,6 @@ class SelectTablePageState extends State<SelectTablePage> {
46 47
47 Map<String, List<t.Table>> areaTableMap = {}; //区域-桌位Map 48 Map<String, List<t.Table>> areaTableMap = {}; //区域-桌位Map
48 49
49 - SelectTableModel selectTableModel = new SelectTableModel();  
50 -  
51 ChooseTableModel _chooseTableModel; 50 ChooseTableModel _chooseTableModel;
52 51
53 Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单 52 Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
@@ -67,7 +66,10 @@ class SelectTablePageState extends State<SelectTablePage> { @@ -67,7 +66,10 @@ class SelectTablePageState extends State<SelectTablePage> {
67 getTableList() async { 66 getTableList() async {
68 UserModel userModel = Provider.of<UserModel>(context, listen: false); 67 UserModel userModel = Provider.of<UserModel>(context, listen: false);
69 Map<String, String> params = {"sellerid": userModel.user.sellerid}; 68 Map<String, String> params = {"sellerid": userModel.user.sellerid};
70 - tableOuterList = await selectTableModel.getTableList(context, params); 69 + tableOuterList = await _chooseTableModel.getTableList(
  70 + context,
  71 + params,
  72 + );
71 for (TableOuter item in tableOuterList) { 73 for (TableOuter item in tableOuterList) {
72 // if (item.name == "推荐") { 74 // if (item.name == "推荐") {
73 // itemModelList.remove(item); 75 // itemModelList.remove(item);
@@ -83,7 +85,9 @@ class SelectTablePageState extends State<SelectTablePage> { @@ -83,7 +85,9 @@ class SelectTablePageState extends State<SelectTablePage> {
83 } 85 }
84 } 86 }
85 } 87 }
86 - _getReserveList(userModel.user.sellerid); 88 + if (_chooseTableModel.pageState == PageState.Success) {
  89 + _getReserveList(userModel.user.sellerid);
  90 + }
87 } 91 }
88 92
89 //获取已预订列表 93 //获取已预订列表
@@ -175,101 +179,124 @@ class SelectTablePageState extends State<SelectTablePage> { @@ -175,101 +179,124 @@ class SelectTablePageState extends State<SelectTablePage> {
175 @override 179 @override
176 Widget build(BuildContext context) { 180 Widget build(BuildContext context) {
177 _chooseTableModel = Provider.of<ChooseTableModel>(context); 181 _chooseTableModel = Provider.of<ChooseTableModel>(context);
178 - return SafeArea(  
179 - child: areaTableMap.isEmpty  
180 - ? Container(  
181 - width: double.infinity,  
182 - height: double.infinity,  
183 - color: MyColours.color_ffffff,  
184 - )  
185 - : Column(  
186 - children: <Widget>[  
187 - MyAppBar(  
188 - "选择桌位",  
189 - showBack: true,  
190 - ),  
191 - Expanded(  
192 - child: Container(  
193 - color: MyColours.color_ffffff,  
194 - child: Row(  
195 - children: <Widget>[  
196 - Container(  
197 - width: ScreenUtil().setWidth(170),  
198 - height: double.infinity,  
199 - color: MyColours.color_f1f1f1,  
200 - child: ListView.builder(  
201 - itemBuilder: (context, index) {  
202 - return AreaItem(areas[index], currentArea,  
203 - (area) {  
204 - setState(() {  
205 - currentArea = (area as Area).name;  
206 - }); 182 + return Scaffold(
  183 + body: SafeArea(
  184 + child: Column(
  185 + children: <Widget>[
  186 + MyAppBar(
  187 + "选择桌位",
  188 + showBack: true,
  189 + ),
  190 + Expanded(
  191 + child: Consumer<ChooseTableModel>(builder: (context, model, _) {
  192 + if (model.pageState != PageState.Success) {
  193 + return ExceptionPage(
  194 + pageState: model.pageState,
  195 + callback: () {
  196 + getTableList();
  197 + },
  198 + emptyMsg: "暂时没有预订哦",
  199 + emptyImg: "empty_search",
  200 + showMsg: "加载中,请稍后...",
  201 + );
  202 + } else {
  203 + return Container(
  204 + color: MyColours.color_ffffff,
  205 + child: Row(
  206 + children: <Widget>[
  207 + Container(
  208 + width: ScreenUtil().setWidth(170),
  209 + height: double.infinity,
  210 + color: MyColours.color_f1f1f1,
  211 + child: ListView.builder(
  212 + itemBuilder: (context, index) {
  213 + return AreaItem(areas[index], currentArea, (area) {
  214 + setState(() {
  215 + currentArea = (area as Area).name;
207 }); 216 });
208 - },  
209 - itemExtent: ScreenUtil().setHeight(207),  
210 - itemCount: areas.length,  
211 - ), 217 + });
  218 + },
  219 + itemExtent: ScreenUtil().setHeight(207),
  220 + itemCount: areas.length,
212 ), 221 ),
213 - Expanded(  
214 - child: Padding(  
215 - padding: EdgeInsets.symmetric(  
216 - vertical: ScreenUtil().setHeight(10),  
217 - horizontal: ScreenUtil().setWidth(9)),  
218 - child: Column(  
219 - children: [  
220 - Expanded(  
221 - child: GridView.builder(  
222 - gridDelegate:  
223 - SliverGridDelegateWithFixedCrossAxisCount(  
224 - crossAxisCount: 3,  
225 - childAspectRatio: 8 / 9),  
226 - itemBuilder: (context, index) {  
227 - return TableItem(  
228 - areaTableMap[currentArea][index],  
229 - onSelected: (table) {  
230 - if ((table as t.Table).selected) {  
231 - selectTables.add(table);  
232 - widget.tableList  
233 - .add(tableToTableList(table));  
234 - } else {  
235 - widget.tableList.removeWhere(  
236 - (t) => t.id == table.id);  
237 - selectTables.removeWhere(  
238 - (t) => t.id == table.id);  
239 - }  
240 - },  
241 - canSelected: true,  
242 - canChoose: widget.canChoose,  
243 - tableMap: tableMap,  
244 - rid: widget.rid); 222 + ),
  223 + Expanded(
  224 + child: Padding(
  225 + padding: EdgeInsets.symmetric(
  226 + vertical: ScreenUtil().setHeight(10),
  227 + horizontal: ScreenUtil().setWidth(9)),
  228 + child: Column(
  229 + children: [
  230 + Expanded(
  231 + child: GridView.builder(
  232 + gridDelegate:
  233 + SliverGridDelegateWithFixedCrossAxisCount(
  234 + crossAxisCount: 3,
  235 + childAspectRatio: 8 / 9),
  236 + itemBuilder: (context, index) {
  237 + return TableItem(
  238 + areaTableMap[currentArea][index],
  239 + onSelected: (table) {
  240 + if ((table as t.Table).selected) {
  241 + selectTables.add(table);
  242 + widget.tableList
  243 + .add(tableToTableList(table));
  244 + } else {
  245 + widget.tableList.removeWhere(
  246 + (t) => t.id == table.id);
  247 + selectTables.removeWhere(
  248 + (t) => t.id == table.id);
  249 + }
245 }, 250 },
246 - itemCount: areaTableMap[currentArea].length,  
247 - )),  
248 - Container(  
249 - width: double.infinity,  
250 - height: ScreenUtil().setHeight(84),  
251 - margin: EdgeInsets.only(  
252 - bottom: ScreenUtil().setWidth(50)),  
253 - padding: EdgeInsets.symmetric(  
254 - horizontal:  
255 - ScreenUtil().setWidth(31)),  
256 - alignment: Alignment.center,  
257 - color: MyColours.color_ffffff,  
258 - child: CommonButton(  
259 - content: "确定",  
260 - width: 500,  
261 - height: 84,  
262 - fontSize: 34,  
263 - state: 1,  
264 - onPress: () {  
265 - if (widget.canChoose) {  
266 - // if (widget.tableList.length > 0) { 251 + canSelected: true,
  252 + canChoose: widget.canChoose,
  253 + tableMap: tableMap,
  254 + rid: widget.rid);
  255 + },
  256 + itemCount: areaTableMap[currentArea].length,
  257 + )),
  258 + Container(
  259 + width: double.infinity,
  260 + height: ScreenUtil().setHeight(84),
  261 + margin: EdgeInsets.only(
  262 + bottom: ScreenUtil().setWidth(50)),
  263 + padding: EdgeInsets.symmetric(
  264 + horizontal: ScreenUtil().setWidth(31)),
  265 + alignment: Alignment.center,
  266 + color: MyColours.color_ffffff,
  267 + child: CommonButton(
  268 + content: "确定",
  269 + width: 500,
  270 + height: 84,
  271 + fontSize: 34,
  272 + state: 1,
  273 + onPress: () {
  274 + if (widget.canChoose) {
  275 + // if (widget.tableList.length > 0) {
  276 + String tid = "";
  277 + for (TableList table
  278 + in widget.tableList) {
  279 + tid += table.id + ",";
  280 + }
  281 + if (widget.tableList.length > 0) {
  282 + tid = tid.substring(
  283 + 0, tid.length - 1);
  284 + }
  285 +
  286 + Map temp = {
  287 + 'object': widget.tableList,
  288 + 'tid': tid
  289 + };
  290 + Navigator.of(context).pop(temp);
  291 + // }
  292 + } else {
  293 + if (selectTables.length > 0) {
267 String tid = ""; 294 String tid = "";
268 - for (TableList table  
269 - in widget.tableList) { 295 + for (t.Table table
  296 + in selectTables) {
270 tid += table.id + ","; 297 tid += table.id + ",";
271 } 298 }
272 - if (widget.tableList.length > 0) { 299 + if (selectTables.length > 0) {
273 tid = tid.substring( 300 tid = tid.substring(
274 0, tid.length - 1); 301 0, tid.length - 1);
275 } 302 }
@@ -279,38 +306,22 @@ class SelectTablePageState extends State<SelectTablePage> { @@ -279,38 +306,22 @@ class SelectTablePageState extends State<SelectTablePage> {
279 'tid': tid 306 'tid': tid
280 }; 307 };
281 Navigator.of(context).pop(temp); 308 Navigator.of(context).pop(temp);
282 - // }  
283 - } else {  
284 - if (selectTables.length > 0) {  
285 - String tid = "";  
286 - for (t.Table table  
287 - in selectTables) {  
288 - tid += table.id + ",";  
289 - }  
290 - if (selectTables.length > 0) {  
291 - tid = tid.substring(  
292 - 0, tid.length - 1);  
293 - }  
294 -  
295 - Map temp = {  
296 - 'object': widget.tableList,  
297 - 'tid': tid  
298 - };  
299 - Navigator.of(context).pop(temp);  
300 - }  
301 } 309 }
302 - },  
303 - )),  
304 - ],  
305 - )),  
306 - )  
307 - ],  
308 - ), 310 + }
  311 + },
  312 + )),
  313 + ],
  314 + )),
  315 + )
  316 + ],
309 ), 317 ),
310 - ),  
311 - ],  
312 - ),  
313 - ); 318 + );
  319 + }
  320 + }),
  321 + ),
  322 + ],
  323 + ),
  324 + ));
314 } 325 }
315 326
316 tableToTableList(t.Table table) { 327 tableToTableList(t.Table table) {
@@ -11,7 +11,6 @@ import 'package:one_key/models/table_list.dart'; @@ -11,7 +11,6 @@ import 'package:one_key/models/table_list.dart';
11 import 'package:one_key/provider/choose_table_model.dart'; 11 import 'package:one_key/provider/choose_table_model.dart';
12 import 'package:one_key/provider/notebook_detail_change_model.dart'; 12 import 'package:one_key/provider/notebook_detail_change_model.dart';
13 import 'package:one_key/provider/notebook_model.dart'; 13 import 'package:one_key/provider/notebook_model.dart';
14 -import 'package:one_key/provider/select_table_model.dart';  
15 import 'package:one_key/provider/table_manager_model.dart'; 14 import 'package:one_key/provider/table_manager_model.dart';
16 import 'package:one_key/provider/user_model.dart'; 15 import 'package:one_key/provider/user_model.dart';
17 import 'package:one_key/res/colors.dart'; 16 import 'package:one_key/res/colors.dart';
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/constant/constant.dart';
  3 +import 'package:one_key/constant/error.dart';
  4 +import 'package:one_key/constant/state.dart';
  5 +import 'package:one_key/models/tableOuter.dart';
2 import 'package:one_key/models/table_list.dart'; 6 import 'package:one_key/models/table_list.dart';
  7 +import 'package:one_key/net/base_resp.dart';
  8 +import 'package:one_key/net/dio_util.dart';
  9 +import 'package:one_key/net/http_url.dart';
  10 +import 'package:one_key/models/table.dart' as t;
3 11
4 class ChooseTableModel with ChangeNotifier { 12 class ChooseTableModel with ChangeNotifier {
5 List<TableList> tableList = []; 13 List<TableList> tableList = [];
  14 + PageState pageState = PageState.Loading;
  15 +
  16 + //获取桌位数据
  17 + Future<List<TableOuter>> getTableList(
  18 + BuildContext context, Map<String, String> params,
  19 + {isShowLoading = true}) async {
  20 + if (isShowLoading) {
  21 + pageState = PageState.Loading;
  22 + notifyListeners();
  23 + }
  24 + BaseResp<List> baseResp = await DioUtil()
  25 + .request<List>(context, Method.get, HttpUrl.table_list,
  26 + data: params, showLoading: false)
  27 + .catchError((error) {
  28 + print(error.toString());
  29 + if (error is MyError) {
  30 + switch (error.type) {
  31 + case 1:
  32 + pageState = PageState.ConnectivityError;
  33 + break;
  34 + case 2:
  35 + pageState = PageState.ConnectivityTimeOut;
  36 + break;
  37 + default:
  38 + pageState = PageState.ConnectivityError;
  39 + break;
  40 + }
  41 + }
  42 + notifyListeners();
  43 + });
  44 + if (baseResp.code == Constant.status_success) {
  45 + if ((baseResp.data[0] as List).isEmpty) {
  46 + pageState = PageState.Empty;
  47 + notifyListeners();
  48 + } else {
  49 + pageState = PageState.Success;
  50 + }
  51 +
  52 + return (baseResp.data[0] as List).map((value) {
  53 + TableOuter tableOuter = TableOuter();
  54 + tableOuter.name = value["name"];
  55 + tableOuter.list = (value["list"] as List).map((table) {
  56 + return t.Table.fromJson(table as Map<String, dynamic>);
  57 + }).toList();
  58 + return tableOuter;
  59 + }).toList();
  60 + } else {
  61 + pageState = PageState.ConnectivityError;
  62 + notifyListeners();
  63 + }
  64 + return [];
  65 + }
6 } 66 }
@@ -120,4 +120,4 @@ class MessageModel extends ChangeNotifier{ @@ -120,4 +120,4 @@ class MessageModel extends ChangeNotifier{
120 untreatedMsgs.removeWhere((message)=>message.id==mid); 120 untreatedMsgs.removeWhere((message)=>message.id==mid);
121 notifyListeners(); 121 notifyListeners();
122 } 122 }
123 -}  
  123 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:one_key/constant/constant.dart'; 2 import 'package:one_key/constant/constant.dart';
  3 +import 'package:one_key/constant/error.dart';
  4 +import 'package:one_key/constant/state.dart';
3 import 'package:one_key/models/manager.dart'; 5 import 'package:one_key/models/manager.dart';
4 import 'package:one_key/models/notebook_detail.dart'; 6 import 'package:one_key/models/notebook_detail.dart';
5 import 'package:one_key/net/base_resp.dart'; 7 import 'package:one_key/net/base_resp.dart';
@@ -11,18 +13,50 @@ import 'package:one_key/utils/utils.dart'; @@ -11,18 +13,50 @@ import 'package:one_key/utils/utils.dart';
11 import 'package:provider/provider.dart'; 13 import 'package:provider/provider.dart';
12 14
13 class NotebookDetailModel extends ChangeNotifier { 15 class NotebookDetailModel extends ChangeNotifier {
  16 + PageState pageState = PageState.Loading;
  17 +
14 ///获取已预订订单 18 ///获取已预订订单
15 Future<NotebookDetail> getReserveDetail( 19 Future<NotebookDetail> getReserveDetail(
16 - BuildContext context, Map<String, String> params) async { 20 + BuildContext context, Map<String, String> params,
  21 + {isShowLoading = true}) async {
  22 + if (isShowLoading) {
  23 + pageState = PageState.Loading;
  24 + notifyListeners();
  25 + }
17 BaseResp<Map<String, dynamic>> baseResp = await DioUtil() 26 BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
18 .request<Map<String, dynamic>>( 27 .request<Map<String, dynamic>>(
19 context, Method.get, HttpUrl.reserve_detail, 28 context, Method.get, HttpUrl.reserve_detail,
20 - data: params) 29 + data: params, showLoading: false)
21 .catchError((error) { 30 .catchError((error) {
22 print(error.toString()); 31 print(error.toString());
  32 + if (error is MyError) {
  33 + switch (error.type) {
  34 + case 1:
  35 + pageState = PageState.ConnectivityError;
  36 + break;
  37 + case 2:
  38 + pageState = PageState.ConnectivityTimeOut;
  39 + break;
  40 + default:
  41 + pageState = PageState.ConnectivityError;
  42 + break;
  43 + }
  44 + }
  45 + notifyListeners();
23 }); 46 });
24 if (baseResp.code == Constant.status_success) { 47 if (baseResp.code == Constant.status_success) {
  48 + if (baseResp.data.isEmpty) {
  49 + pageState = PageState.ConnectivityError;
  50 + } else {
  51 + pageState = PageState.Success;
  52 + }
  53 + notifyListeners();
25 return NotebookDetail.fromJson(baseResp.data); 54 return NotebookDetail.fromJson(baseResp.data);
  55 + } else {
  56 + pageState = PageState.ConnectivityError;
  57 + if (baseResp != null) {
  58 + Utils.showToast(baseResp.msg ?? "");
  59 + }
26 } 60 }
27 } 61 }
28 62
@@ -35,7 +69,7 @@ class NotebookDetailModel extends ChangeNotifier { @@ -35,7 +69,7 @@ class NotebookDetailModel extends ChangeNotifier {
35 }; 69 };
36 BaseResp<Map<String, dynamic>> baseResp = await DioUtil() 70 BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
37 .request<Map<String, dynamic>>(context, Method.get, HttpUrl.sellerinfo, 71 .request<Map<String, dynamic>>(context, Method.get, HttpUrl.sellerinfo,
38 - data: params) 72 + data: params, showLoading: false)
39 .catchError((error) { 73 .catchError((error) {
40 print(error.toString()); 74 print(error.toString());
41 }); 75 });
@@ -61,7 +95,8 @@ class NotebookDetailModel extends ChangeNotifier { @@ -61,7 +95,8 @@ class NotebookDetailModel extends ChangeNotifier {
61 } 95 }
62 96
63 //安排在线预订 97 //安排在线预订
64 - Future<bool> setReserveStatus(BuildContext context, Map<String, String> params, 98 + Future<bool> setReserveStatus(
  99 + BuildContext context, Map<String, String> params,
65 {ifPush = true, showLoading = false}) async { 100 {ifPush = true, showLoading = false}) async {
66 BaseResp<Map<String, dynamic>> baseResp = await DioUtil() 101 BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
67 .request<Map<String, dynamic>>( 102 .request<Map<String, dynamic>>(
@@ -70,7 +105,7 @@ class NotebookDetailModel extends ChangeNotifier { @@ -70,7 +105,7 @@ class NotebookDetailModel extends ChangeNotifier {
70 .catchError((error) { 105 .catchError((error) {
71 print(error.toString()); 106 print(error.toString());
72 }); 107 });
73 - if(baseResp==null) return false; 108 + if (baseResp == null) return false;
74 if (baseResp.code == Constant.status_success) { 109 if (baseResp.code == Constant.status_success) {
75 if (ifPush) { 110 if (ifPush) {
76 NavigatorUtil.goNotebookDetailPage(context, params["rid"], 111 NavigatorUtil.goNotebookDetailPage(context, params["rid"],
1 -import 'package:flutter/material.dart';  
2 -import 'package:one_key/constant/constant.dart';  
3 -import 'package:one_key/models/tableOuter.dart';  
4 -import 'package:one_key/net/base_resp.dart';  
5 -import 'package:one_key/net/dio_util.dart';  
6 -import 'package:one_key/net/http_url.dart';  
7 -import 'package:one_key/models/table.dart' as t;  
8 -import 'package:one_key/utils/navigator_util.dart';  
9 -import 'package:one_key/utils/utils.dart';  
10 -  
11 -class SelectTableModel{  
12 -  
13 - //获取桌位数据  
14 - Future<List<TableOuter>> getTableList(BuildContext context,Map<String,String> params) async {  
15 - BaseResp<List> baseResp = await DioUtil()  
16 - .request<List>(context, Method.get, HttpUrl.table_list,  
17 - data: params,showLoading: true)  
18 - .catchError((error) {  
19 - print(error.toString());  
20 - });  
21 - if(baseResp.code==Constant.status_success){  
22 - return (baseResp.data[0] as List).map((value){  
23 - TableOuter tableOuter=TableOuter();  
24 - tableOuter.name=value["name"];  
25 - tableOuter.list=(value["list"] as List).map((table){  
26 - return t.Table.fromJson(table as Map<String,dynamic>);  
27 - }).toList();  
28 - return tableOuter;  
29 - }).toList();  
30 - }  
31 - return [];  
32 - }  
33 -}  
@@ -17,6 +17,7 @@ import 'package:one_key/pages/table/select_table_page.dart'; @@ -17,6 +17,7 @@ import 'package:one_key/pages/table/select_table_page.dart';
17 import 'package:one_key/pages/webview/webview_page.dart'; 17 import 'package:one_key/pages/webview/webview_page.dart';
18 import 'package:one_key/provider/choose_table_model.dart'; 18 import 'package:one_key/provider/choose_table_model.dart';
19 import 'package:one_key/provider/notebook_detail_change_model.dart'; 19 import 'package:one_key/provider/notebook_detail_change_model.dart';
  20 +import 'package:one_key/provider/notebook_detail_model.dart';
20 import 'package:one_key/utils/fluro_convert_utils.dart'; 21 import 'package:one_key/utils/fluro_convert_utils.dart';
21 import 'package:provider/provider.dart'; 22 import 'package:provider/provider.dart';
22 23
@@ -39,9 +40,15 @@ var homeHandler = new Handler( @@ -39,9 +40,15 @@ var homeHandler = new Handler(
39 var reserveDetailHandler = new Handler( 40 var reserveDetailHandler = new Handler(
40 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 41 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
41 String rid = params['rid'].first; 42 String rid = params['rid'].first;
42 - String mid=params['mid'].first;  
43 - bool fromNotify=FluroConvertUtils.string2bool(params["fromNotify"].first);  
44 - return NotebookDetailPage(rid,mid:mid,fromNotify: fromNotify,); 43 + String mid = params['mid'].first;
  44 + bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
  45 + return ChangeNotifierProvider<NotebookDetailModel>(
  46 + create: (_) => NotebookDetailModel(),
  47 + child: NotebookDetailPage(
  48 + rid,
  49 + mid: mid,
  50 + fromNotify: fromNotify,
  51 + ));
45 }); 52 });
46 53
47 // 跳转到处理在线预订 54 // 跳转到处理在线预订
@@ -49,8 +56,11 @@ var handleOnlineHandler = new Handler( @@ -49,8 +56,11 @@ var handleOnlineHandler = new Handler(
49 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 56 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
50 String rid = params['rid'].first; 57 String rid = params['rid'].first;
51 String mid = params["mid"].first; 58 String mid = params["mid"].first;
52 - bool fromNotify=FluroConvertUtils.string2bool(params["fromNotify"].first);  
53 - return HandleOnlinePage(rid, mid,fromNotify: fromNotify,); 59 + bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
  60 + return ChangeNotifierProvider<NotebookDetailModel>(
  61 + create: (_) => NotebookDetailModel(),
  62 + child: HandleOnlinePage(rid, mid, fromNotify: fromNotify));
  63 + // return HandleOnlinePage(rid, mid,fromNotify: fromNotify);
54 }); 64 });
55 65
56 // 跳转到选择桌位 66 // 跳转到选择桌位
@@ -107,13 +107,12 @@ class NewTableItemState extends State<NewTableItem> { @@ -107,13 +107,12 @@ class NewTableItemState extends State<NewTableItem> {
107 fontWeight: FontWeight.normal), 107 fontWeight: FontWeight.normal),
108 overflow: TextOverflow.ellipsis, 108 overflow: TextOverflow.ellipsis,
109 strutStyle: StrutStyle( 109 strutStyle: StrutStyle(
110 - forceStrutHeight: true,  
111 - height: 1,  
112 - leading: 0.2), 110 + forceStrutHeight: true,
  111 + height: ScreenUtil().setWidth(2),
  112 + // leading: ScreenUtil().setWidth(0.4)
  113 + ),
113 ), 114 ),
114 - )  
115 -  
116 - ), 115 + )),
117 // Text( 116 // Text(
118 // table.name, 117 // table.name,
119 // maxLines: 2, 118 // maxLines: 2,
@@ -66,7 +66,7 @@ class ExceptionPageState extends State<ExceptionPage> { @@ -66,7 +66,7 @@ class ExceptionPageState extends State<ExceptionPage> {
66 page = Container( 66 page = Container(
67 width: 0, 67 width: 0,
68 height: 10, 68 height: 10,
69 - color: Colors.blue, 69 + color: Colors.white,
70 ); 70 );
71 break; 71 break;
72 default: 72 default:
@@ -144,8 +144,9 @@ class TableItemState extends State<TableItem> { @@ -144,8 +144,9 @@ class TableItemState extends State<TableItem> {
144 overflow: TextOverflow.ellipsis, 144 overflow: TextOverflow.ellipsis,
145 strutStyle: StrutStyle( 145 strutStyle: StrutStyle(
146 forceStrutHeight: true, 146 forceStrutHeight: true,
147 - height: 1,  
148 - leading: 0.2), 147 + height: ScreenUtil().setWidth(2),
  148 + // leading: ScreenUtil().setWidth(0.4)
  149 + ),
149 ), 150 ),
150 ) 151 )
151 // Text( 152 // Text(