Commit 52d79c65b1881272d144ba97adb171856492840a

Authored by wdn127929
1 parent 3e9c602e

经理拍菜桌位信息结构修复,华为上线版本

@@ -3300,8 +3300,15 @@ class _OrderAdvanceEidtPageState extends State<OrderAdvanceEidtPage> { @@ -3300,8 +3300,15 @@ class _OrderAdvanceEidtPageState extends State<OrderAdvanceEidtPage> {
3300 isCar = false; 3300 isCar = false;
3301 bool success = await setPlanCookByReserve(); 3301 bool success = await setPlanCookByReserve();
3302 if (success) { 3302 if (success) {
3303 - Navigator.pop(context);  
3304 - Navigator.pop(context); 3303 +
  3304 + if (Navigator.canPop(context)) {
  3305 + Navigator.pop(context);
  3306 + if (Navigator.canPop(context)) {
  3307 + Navigator.pop(context);
  3308 + }
  3309 + }
  3310 + // Navigator.pop(context);
  3311 + // Navigator.pop(context);
3305 } 3312 }
3306 // Navigator.pop(context); 3313 // Navigator.pop(context);
3307 // NavigatorUtil.goFinalPlanDishPage(context); 3314 // NavigatorUtil.goFinalPlanDishPage(context);
@@ -147,7 +147,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -147,7 +147,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
147 Provider.of<UserModel>(context, listen: false).user.sellerAddr; 147 Provider.of<UserModel>(context, listen: false).user.sellerAddr;
148 String tables = ''; 148 String tables = '';
149 widget.detailEntity.tables.forEach((element) { 149 widget.detailEntity.tables.forEach((element) {
150 - tables += '${element.name}、'; 150 + tables += '${element}、';
151 }); 151 });
152 if (tables.endsWith('、')) { 152 if (tables.endsWith('、')) {
153 tables = tables.substring(0, tables.length - 1); 153 tables = tables.substring(0, tables.length - 1);
@@ -5,11 +5,13 @@ import 'package:flutter/material.dart'; @@ -5,11 +5,13 @@ import 'package:flutter/material.dart';
5 import 'package:one_key/utils/dialog_util.dart'; 5 import 'package:one_key/utils/dialog_util.dart';
6 import 'package:permission_handler/permission_handler.dart'; 6 import 'package:permission_handler/permission_handler.dart';
7 7
  8 +import '../app.dart';
8 import 'misc.dart'; 9 import 'misc.dart';
9 10
10 class CallLogUtils { 11 class CallLogUtils {
11 static Future<Iterable<CallLogEntry>> getCallLog(context) async { 12 static Future<Iterable<CallLogEntry>> getCallLog(context) async {
12 try { 13 try {
  14 +
13 if (!(await checkPermission(Permission.phone))) { 15 if (!(await checkPermission(Permission.phone))) {
14 String title = '通话记录和电话'; 16 String title = '通话记录和电话';
15 PermissionStatus status = await permissionStatus(Permission.phone); 17 PermissionStatus status = await permissionStatus(Permission.phone);
@@ -17,7 +19,8 @@ class CallLogUtils { @@ -17,7 +19,8 @@ class CallLogUtils {
17 //用户选择不在弹出权限提示框 19 //用户选择不在弹出权限提示框
18 print('never'); 20 print('never');
19 // Navigator.pop(context); 21 // Navigator.pop(context);
20 - DialogUtil.openAlertDialog(context, '未获得${title}权限', 22 + BuildContext context1 = App.navigatorKey.currentState.overlay.context;
  23 + DialogUtil.openAlertDialog(context1, '未获得${title}权限',
21 "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () { 24 "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () {
22 openSetting(); 25 openSetting();
23 Navigator.pop(context, ''); 26 Navigator.pop(context, '');
@@ -29,7 +32,8 @@ class CallLogUtils { @@ -29,7 +32,8 @@ class CallLogUtils {
29 try { 32 try {
30 //全局提示权限使用目的 33 //全局提示权限使用目的
31 if (Platform.isAndroid) { 34 if (Platform.isAndroid) {
32 - DialogUtil.showAuthorityDestination(context, 'h_call', 35 + BuildContext context1 = App.navigatorKey.currentState.overlay.context;
  36 + DialogUtil.showAuthorityDestination(context1, 'h_call',
33 '通话记录和电话权限使用说明', '直接从通话记录中获得客户电话号码,快速录入预订信息。'); 37 '通话记录和电话权限使用说明', '直接从通话记录中获得客户电话号码,快速录入预订信息。');
34 } 38 }
35 39
@@ -41,7 +45,8 @@ class CallLogUtils { @@ -41,7 +45,8 @@ class CallLogUtils {
41 } else { 45 } else {
42 // Navigator.pop(context); 46 // Navigator.pop(context);
43 //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处 47 //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处
44 - DialogUtil.openAlertDialog(context, '未获得${title}权限', 48 + BuildContext context1 = App.navigatorKey.currentState.overlay.context;
  49 + DialogUtil.openAlertDialog(context1, '未获得${title}权限',
45 "请在手机的权限管理里,将${title}权限开启。", '去设置', 340.0, onTap: () { 50 "请在手机的权限管理里,将${title}权限开启。", '去设置', 340.0, onTap: () {
46 openSetting(); 51 openSetting();
47 Navigator.pop(context, ''); 52 Navigator.pop(context, '');
@@ -727,11 +727,11 @@ class DialogUtil { @@ -727,11 +727,11 @@ class DialogUtil {
727 727
728 static showAuthorityDestination( 728 static showAuthorityDestination(
729 BuildContext context, String name, String title, String subTitle) async { 729 BuildContext context, String name, String title, String subTitle) async {
730 - Timer _timer = Timer(const Duration(seconds: 1), () {  
731 - // if(!TickerMode.of(context)){  
732 - Navigator.of(context).pop(true);  
733 - // }  
734 - }); 730 + // Timer _timer = Timer(const Duration(seconds: 1), () {
  731 + // // if(!TickerMode.of(context)){
  732 + // Navigator.of(context).pop(true);
  733 + // // }
  734 + // });
735 final action = await showDialog( 735 final action = await showDialog(
736 context: context, 736 context: context,
737 barrierDismissible: true, 737 barrierDismissible: true,
@@ -741,48 +741,53 @@ class DialogUtil { @@ -741,48 +741,53 @@ class DialogUtil {
741 // locationState = state; 741 // locationState = state;
742 return Material( 742 return Material(
743 color: Colors.transparent, 743 color: Colors.transparent,
744 - child: Column(mainAxisSize: MainAxisSize.min, children: [  
745 - VEmptyView(40),  
746 - Container(  
747 - // width: double.infinity, 744 + child: InkWell(
  745 + onTap: () {
  746 + Navigator.of(context).pop(true);
  747 + },
  748 + child: Column(mainAxisSize: MainAxisSize.min, children: [
  749 + VEmptyView(40),
  750 + Container(
  751 + // width: double.infinity,
748 752
749 - margin: EdgeInsets.symmetric(horizontal: w(10)),  
750 - padding: EdgeInsets.symmetric(  
751 - horizontal: w(20), vertical: w(12)),  
752 - decoration: BoxDecoration(  
753 - color: MyColours.color_ffffff,  
754 - borderRadius: BorderRadius.circular(  
755 - r(5),  
756 - )),  
757 - child: Row(children: <Widget>[  
758 - Image.asset(  
759 - Utils.getImgPath(  
760 - '$name',  
761 - ),  
762 - width: w(30)),  
763 - HEmptyView(68),  
764 - Expanded(  
765 - child: Column(  
766 - crossAxisAlignment: CrossAxisAlignment.start,  
767 - children: [  
768 - Text('$title',  
769 - style: TextStyle(  
770 - fontSize: font(16),  
771 - fontWeight: FontWeight.bold,  
772 - color: MyColours.color_E6000000)),  
773 - VEmptyView(20),  
774 - Text('$subTitle',  
775 - style: TextStyle(  
776 - fontSize: font(16),  
777 - color: MyColours.color_26000000))  
778 - ])),  
779 - ]))  
780 - ])); 753 + margin: EdgeInsets.symmetric(horizontal: w(10)),
  754 + padding: EdgeInsets.symmetric(
  755 + horizontal: w(20), vertical: w(12)),
  756 + decoration: BoxDecoration(
  757 + color: MyColours.color_ffffff,
  758 + borderRadius: BorderRadius.circular(
  759 + r(5),
  760 + )),
  761 + child: Row(children: <Widget>[
  762 + Image.asset(
  763 + Utils.getImgPath(
  764 + '$name',
  765 + ),
  766 + width: w(30)),
  767 + HEmptyView(68),
  768 + Expanded(
  769 + child: Column(
  770 + crossAxisAlignment:
  771 + CrossAxisAlignment.start,
  772 + children: [
  773 + Text('$title',
  774 + style: TextStyle(
  775 + fontSize: font(16),
  776 + fontWeight: FontWeight.bold,
  777 + color: MyColours.color_E6000000)),
  778 + VEmptyView(20),
  779 + Text('$subTitle',
  780 + style: TextStyle(
  781 + fontSize: font(16),
  782 + color: MyColours.color_26000000))
  783 + ])),
  784 + ]))
  785 + ])));
781 }); 786 });
782 }); 787 });
783 788
784 print(action); 789 print(action);
785 - _timer.cancel(); 790 + // _timer.cancel();
786 791
787 return action; 792 return action;
788 } 793 }
@@ -6977,103 +6982,112 @@ class DialogUtil { @@ -6977,103 +6982,112 @@ class DialogUtil {
6977 }); 6982 });
6978 6983
6979 if (online > 0) { 6984 if (online > 0) {
6980 - widgetData.add(Padding(  
6981 - padding: EdgeInsets.only(bottom: w(10)),  
6982 - child: Text(  
6983 - '在线预订 ${online}个',  
6984 - style: TextStyle(  
6985 - color: MyColours.color_515151,  
6986 - fontSize: font(16)),  
6987 - ))); 6985 + widgetData.add(Padding(
  6986 + padding: EdgeInsets.only(bottom: w(10)),
  6987 + child: Text(
  6988 + '在线预订 ${online}个',
  6989 + style: TextStyle(
  6990 + color: MyColours.color_515151,
  6991 + fontSize: font(16)),
  6992 + )));
6988 } 6993 }
6989 if (cancel > 0) { 6994 if (cancel > 0) {
6990 - widgetData.add(Padding(  
6991 - padding: EdgeInsets.only(bottom: w(10)),  
6992 - child: Text(  
6993 - '取消预订 ${cancel}个',  
6994 - style: TextStyle(  
6995 - color: MyColours.color_515151, fontSize: font(16)),  
6996 - ))); 6995 + widgetData.add(Padding(
  6996 + padding: EdgeInsets.only(bottom: w(10)),
  6997 + child: Text(
  6998 + '取消预订 ${cancel}个',
  6999 + style: TextStyle(
  7000 + color: MyColours.color_515151,
  7001 + fontSize: font(16)),
  7002 + )));
6997 } 7003 }
6998 if (order > 0) { 7004 if (order > 0) {
6999 - widgetData.add(Padding(  
7000 - padding: EdgeInsets.only(bottom: w(10)),  
7001 - child: Text(  
7002 - '提前点餐 ${order}个',  
7003 - style: TextStyle(  
7004 - color: MyColours.color_515151, fontSize: font(16)),  
7005 - ))); 7005 + widgetData.add(Padding(
  7006 + padding: EdgeInsets.only(bottom: w(10)),
  7007 + child: Text(
  7008 + '提前点餐 ${order}个',
  7009 + style: TextStyle(
  7010 + color: MyColours.color_515151,
  7011 + fontSize: font(16)),
  7012 + )));
7006 } 7013 }
7007 if (pay > 0) { 7014 if (pay > 0) {
7008 - widgetData.add(Padding(  
7009 - padding: EdgeInsets.only(bottom: w(10)),  
7010 - child: Text(  
7011 - '在线买单 ${pay}个',  
7012 - style: TextStyle(  
7013 - color: MyColours.color_515151, fontSize: font(16)),  
7014 - ))); 7015 + widgetData.add(Padding(
  7016 + padding: EdgeInsets.only(bottom: w(10)),
  7017 + child: Text(
  7018 + '在线买单 ${pay}个',
  7019 + style: TextStyle(
  7020 + color: MyColours.color_515151,
  7021 + fontSize: font(16)),
  7022 + )));
7015 } 7023 }
7016 if (payFinish > 0) { 7024 if (payFinish > 0) {
7017 - widgetData.add(Padding(  
7018 - padding: EdgeInsets.only(bottom: w(10)),  
7019 - child: Text(  
7020 - '买单通知 ${payFinish}个',  
7021 - style: TextStyle(  
7022 - color: MyColours.color_515151, fontSize: font(16)),  
7023 - ))); 7025 + widgetData.add(Padding(
  7026 + padding: EdgeInsets.only(bottom: w(10)),
  7027 + child: Text(
  7028 + '买单通知 ${payFinish}个',
  7029 + style: TextStyle(
  7030 + color: MyColours.color_515151,
  7031 + fontSize: font(16)),
  7032 + )));
7024 } 7033 }
7025 if (invoice > 0) { 7034 if (invoice > 0) {
7026 - widgetData.add(Padding(  
7027 - padding: EdgeInsets.only(bottom: w(10)),  
7028 - child: Text(  
7029 - '发票申请 ${invoice}个',  
7030 - style: TextStyle(  
7031 - color: MyColours.color_515151, fontSize: font(16)),  
7032 - ))); 7035 + widgetData.add(Padding(
  7036 + padding: EdgeInsets.only(bottom: w(10)),
  7037 + child: Text(
  7038 + '发票申请 ${invoice}个',
  7039 + style: TextStyle(
  7040 + color: MyColours.color_515151,
  7041 + fontSize: font(16)),
  7042 + )));
7033 } 7043 }
7034 if (instore > 0) { 7044 if (instore > 0) {
7035 - widgetData.add(Padding(  
7036 - padding: EdgeInsets.only(bottom: w(10)),  
7037 - child: Text(  
7038 - '店内消息 ${instore}个',  
7039 - style: TextStyle(  
7040 - color: MyColours.color_515151, fontSize: font(16)),  
7041 - ))); 7045 + widgetData.add(Padding(
  7046 + padding: EdgeInsets.only(bottom: w(10)),
  7047 + child: Text(
  7048 + '店内消息 ${instore}个',
  7049 + style: TextStyle(
  7050 + color: MyColours.color_515151,
  7051 + fontSize: font(16)),
  7052 + )));
7042 } 7053 }
7043 if (recharge > 0) { 7054 if (recharge > 0) {
7044 - widgetData.add(Padding(  
7045 - padding: EdgeInsets.only(bottom: w(10)),  
7046 - child: Text(  
7047 - '会员充值 ${recharge}个',  
7048 - style: TextStyle(  
7049 - color: MyColours.color_515151, fontSize: font(16)),  
7050 - ))); 7055 + widgetData.add(Padding(
  7056 + padding: EdgeInsets.only(bottom: w(10)),
  7057 + child: Text(
  7058 + '会员充值 ${recharge}个',
  7059 + style: TextStyle(
  7060 + color: MyColours.color_515151,
  7061 + fontSize: font(16)),
  7062 + )));
7051 } 7063 }
7052 7064
7053 if (wine > 0) { 7065 if (wine > 0) {
7054 - widgetData.add(Padding(  
7055 - padding: EdgeInsets.only(bottom: w(10)),  
7056 - child: Text(  
7057 - '存酒超期 ${wine}个',  
7058 - style: TextStyle(  
7059 - color: MyColours.color_515151, fontSize: font(16)),  
7060 - ))); 7066 + widgetData.add(Padding(
  7067 + padding: EdgeInsets.only(bottom: w(10)),
  7068 + child: Text(
  7069 + '存酒超期 ${wine}个',
  7070 + style: TextStyle(
  7071 + color: MyColours.color_515151,
  7072 + fontSize: font(16)),
  7073 + )));
7061 } 7074 }
7062 if (commemoration > 0) { 7075 if (commemoration > 0) {
7063 - widgetData.add(Padding(  
7064 - padding: EdgeInsets.only(bottom: w(10)),  
7065 - child: Text(  
7066 - '纪念日提醒 ${commemoration}个',  
7067 - style: TextStyle(  
7068 - color: MyColours.color_515151, fontSize: font(16)),  
7069 - ))); 7076 + widgetData.add(Padding(
  7077 + padding: EdgeInsets.only(bottom: w(10)),
  7078 + child: Text(
  7079 + '纪念日提醒 ${commemoration}个',
  7080 + style: TextStyle(
  7081 + color: MyColours.color_515151,
  7082 + fontSize: font(16)),
  7083 + )));
7070 } 7084 }
7071 widgetData.add(Row( 7085 widgetData.add(Row(
7072 crossAxisAlignment: CrossAxisAlignment.center, 7086 crossAxisAlignment: CrossAxisAlignment.center,
7073 children: <Widget>[ 7087 children: <Widget>[
7074 Spacer(), 7088 Spacer(),
7075 RoundButton( 7089 RoundButton(
7076 - text:"立即处理", 7090 + text: "立即处理",
7077 width: w(100), 7091 width: w(100),
7078 height: w(43), 7092 height: w(43),
7079 fontSize: 28, 7093 fontSize: 28,
@@ -7081,7 +7095,7 @@ class DialogUtil { @@ -7081,7 +7095,7 @@ class DialogUtil {
7081 gradientEnd: MyColours.color_ffffff, 7095 gradientEnd: MyColours.color_ffffff,
7082 borderColor: MyColours.color_438E93, 7096 borderColor: MyColours.color_438E93,
7083 radius: r(5), 7097 radius: r(5),
7084 - textColor:MyColours.color_438E93, 7098 + textColor: MyColours.color_438E93,
7085 onPressed: () { 7099 onPressed: () {
7086 NavigatorUtil.goHomePage(context, initialIndex: 0); 7100 NavigatorUtil.goHomePage(context, initialIndex: 0);
7087 }, 7101 },
@@ -7107,7 +7121,9 @@ class DialogUtil { @@ -7107,7 +7121,9 @@ class DialogUtil {
7107 child: Text( 7121 child: Text(
7108 "您有${messageModel.messages.length}条新的消息", 7122 "您有${messageModel.messages.length}条新的消息",
7109 style: TextStyle( 7123 style: TextStyle(
7110 - color:model.messages.length > 3? MyColours.color_ffffff: MyColours.color_333333, 7124 + color: model.messages.length > 3
  7125 + ? MyColours.color_ffffff
  7126 + : MyColours.color_333333,
7111 fontSize: ScreenUtil().setSp(32)), 7127 fontSize: ScreenUtil().setSp(32)),
7112 )), 7128 )),
7113 Align( 7129 Align(
@@ -7127,7 +7143,9 @@ class DialogUtil { @@ -7127,7 +7143,9 @@ class DialogUtil {
7127 bottom: ScreenUtil().setWidth(38), 7143 bottom: ScreenUtil().setWidth(38),
7128 ), 7144 ),
7129 child: Image.asset( 7145 child: Image.asset(
7130 - messageModel.messages.length > 3? "assets/dialog_close.png": "assets/close.png", 7146 + messageModel.messages.length > 3
  7147 + ? "assets/dialog_close.png"
  7148 + : "assets/close.png",
7131 width: ScreenUtil().setWidth(28), 7149 width: ScreenUtil().setWidth(28),
7132 height: ScreenUtil().setWidth(28), 7150 height: ScreenUtil().setWidth(28),
7133 ), 7151 ),