Commit a99e91c80d93f8c28dd9f5c7fc163419ae128c0d

Authored by wdn127929
1 parent f5678a55

隐藏已停用的桌子、修复订座详情页面的灰色bug expaned

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "311"
def flutterVersionCode = "312"
if (flutterVersionCode == null) {
flutterVersionCode = '311'
flutterVersionCode = '312'
}
def flutterVersionName = "3.1.1"
def flutterVersionName = "3.1.2"
if (flutterVersionName == null) {
flutterVersionName = '3.1.1'
flutterVersionName = '3.1.2'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -16,7 +16,7 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) {
..room_demand = json['room_demand'] as String
..tid = json['tid'] as String
..pnum = json['pnum'] as String
..pnum = json['actual_pnum'] as String
..actual_pnum = json['actual_pum'] as String
..pnum_str = json['pnum_str'] as String
..rname = json['rname'] as String
..sex = json['sex'] as String
... ...
... ... @@ -89,7 +89,7 @@ class Table {
// pnum.setText(item.getNoteName());
return "已预订";
case "2": //用餐中
return "用餐中";
return "已预订";
default:
return "";
}
... ...
... ... @@ -155,7 +155,7 @@ class TableList extends Object {
case "5": //已安排包间
return "已预订";
case "2": //用餐中
return "用餐中";
return "已预订";
default:
return "";
}
... ...
... ... @@ -764,7 +764,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
color: MyColours.color_e5e5e5,
blurRadius: ScreenUtil().setWidth(20))
]),
width: ScreenUtil().setWidth(440),
// width: ScreenUtil().setWidth(440),
height: _notebookDetailChangeModel.userHistorys.length > 1
? ScreenUtil().setWidth(208)
: ScreenUtil().setWidth(104),
... ... @@ -1933,7 +1933,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
fontSize: ScreenUtil()
.setSp(32)),
),
Text(
Expanded(
child: Text(
_notebookDetailChangeModel
.userHistorys[index]
.rname,
... ... @@ -1942,7 +1943,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
.color_333333,
fontSize: ScreenUtil()
.setSp(32)),
)
))
],
),
),
... ...
... ... @@ -1429,6 +1429,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
.selectNum);
if (sucess) {
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
await _getReserveDetail(
showCicle:
false);
... ... @@ -2192,6 +2194,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
sex: sex,
phone: detailModel.phoneController.text);
if (sucess) {
EventBus().emit("refresh_tablemanager"); //刷新桌位
await _getReserveDetail(showCicle: true);
setState(() {
setTop = false;
... ... @@ -2273,10 +2276,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailModel.userHistorys[index].phone,
style: TextStyle(color: MyColours.color_333333, fontSize: ScreenUtil().setSp(32)),
),
Text(
Expanded(
child: Text(
detailModel.userHistorys[index].rname,
style: TextStyle(color: MyColours.color_333333, fontSize: ScreenUtil().setSp(32)),
)
))
],
),
),
... ... @@ -2486,7 +2490,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailEntity.status == "4" ||
detailEntity.status == "6"),
child: Container(
width: double.infinity,
// width: double.infinity,
height: ScreenUtil().setWidth(84),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
... ... @@ -2498,9 +2502,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
ScreenUtil().setHeight(20),
horizontal:
ScreenUtil().setHeight(40)),
child: Offstage(
offstage: ((detailEntity.orderInfo !=
null &&
child:
((detailEntity.orderInfo != null &&
detailEntity.orderInfo
.status ==
"3") ||
... ... @@ -2509,413 +2512,410 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailEntity.status ==
"4" ||
detailEntity.status == "6")
? true
: false,
child: Row(
children: [
Expanded(
flex: 2,
child: InkWell(
onTap: () {
String _tid = '';
for (int i = 0;
i <
detailEntity
.tables
.length;
i++) {
_tid +=
'${detailEntity.tables[i].id},';
}
if (_tid
.endsWith(',')) {
_tid = _tid.substring(
0,
_tid.length - 1);
}
NavigatorUtil
.goInvicationPage(
context,
detailEntity.id,
detailEntity
.tableinfoStr,
detailEntity
.ddate,
detailEntity
.ddateStr,
detailEntity
.phone,
detailEntity
.ddate_solt,
tid: _tid);
},
child: Container(
decoration:
BoxDecoration(
color: MyColours
.color_199095,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(
10)),
),
child: Align(
alignment:
Alignment.center,
child: Text('微信通知',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil()
.setSp(
34))),
),
),
)),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
if (detailEntity
.phone ==
null ||
detailEntity.phone
.isEmpty) {
Utils.showToast(
"短信通知需填写顾客手机号");
return;
}
if (!Utils.phoneRegExp(
detailEntity
.phone)) {
Utils.showToast(
'手机号错误,请修改正确');
return;
}
NavigatorUtil.goSmsPage(
context,
detailEntity.id,
);
},
child: Container(
margin: EdgeInsets.only(
left: ScreenUtil()
.setWidth(20)),
decoration:
BoxDecoration(
color: detailEntity
? SizedBox()
: Row(
children: [
Expanded(
flex: 2,
child: InkWell(
onTap: () {
String _tid = '';
for (int i = 0;
i <
detailEntity
.tables
.length;
i++) {
_tid +=
'${detailEntity.tables[i].id},';
}
if (_tid.endsWith(
',')) {
_tid = _tid
.substring(
0,
_tid.length -
1);
}
NavigatorUtil.goInvicationPage(
context,
detailEntity
.id,
detailEntity
.tableinfoStr,
detailEntity
.ddate,
detailEntity
.ddateStr,
detailEntity
.phone,
detailEntity
.ddate_solt,
tid: _tid);
},
child: Container(
decoration:
BoxDecoration(
color: MyColours
.color_199095,
borderRadius: BorderRadius.circular(
ScreenUtil()
.setWidth(
10)),
),
child: Align(
alignment:
Alignment
.center,
child: Text(
'微信通知',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil().setSp(34))),
),
),
)),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
if (detailEntity
.phone ==
null ||
detailEntity
.phone
.isEmpty
? Color.fromRGBO(
154,
154,
154,
1)
: MyColours
.color_199095,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(
10)),
),
child: Align(
alignment:
Alignment.center,
child: Text('短信通知',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil()
.setSp(
34))),
),
),
)),
Offstage(
offstage: detailEntity
.order
.cookbooklist
.length ==
0
? true
: false,
child: Expanded(
flex: 1,
child: InkWell(
onTap: () {
NavigatorUtil
.goHasOrderFoodPage(
context,
rid: detailEntity
.id);
},
child: Container(
margin: EdgeInsets.only(
left: ScreenUtil()
.setWidth(
20)),
decoration:
BoxDecoration(
color: MyColours
.color_199095,
borderRadius: BorderRadius
.circular(ScreenUtil()
.isEmpty) {
Utils.showToast(
"短信通知需填写顾客手机号");
return;
}
if (!Utils.phoneRegExp(
detailEntity
.phone)) {
Utils.showToast(
'手机号错误,请修改正确');
return;
}
NavigatorUtil
.goSmsPage(
context,
detailEntity.id,
);
},
child: Container(
margin: EdgeInsets.only(
left: ScreenUtil()
.setWidth(
10)),
),
child: Align(
alignment:
Alignment
.center,
child: Text(
'查看菜品',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil()
.setSp(34))),
20)),
decoration:
BoxDecoration(
color: detailEntity.phone ==
null ||
detailEntity
.phone
.isEmpty
? Color
.fromRGBO(
154,
154,
154,
1)
: MyColours
.color_199095,
borderRadius: BorderRadius.circular(
ScreenUtil()
.setWidth(
10)),
),
child: Align(
alignment:
Alignment
.center,
child: Text(
'短信通知',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil().setSp(34))),
),
),
),
))),
// _cancelAndChangeBtn(() {
// DialogUtil
// .showShareDialog(
// context)
// ?.then((value) {
// switch (value) {
// case 1: //微信
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables
// .length;
// i++) {
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(
// ',')) {
// _tid = _tid
// .substring(
// 0,
// _tid.length -
// 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// detailEntity
// .id,
// detailEntity
// .tableinfoStr,
// detailEntity
// .ddate,
// detailEntity
// .ddateStr,
// detailEntity
// .phone,
// detailEntity
// .ddate_solt,
// tid: _tid);
// break;
// case 2: //短信
// if (detailEntity
// .phone ==
// null ||
// detailEntity
// .phone
// .isEmpty) {
// Utils.showToast(
// "没有预订人电话信息");
// return;
// }
// NavigatorUtil
// .goSmsPage(
// context,
// detailEntity.id,
// );
// break;
// case 3: //电话
// if (detailEntity
// .phone !=
// null &&
// detailEntity
// .phone
// .isNotEmpty) {
// if (userModel
// .user
// .role_name !=
// '管理员' &&
// userModel
// .user
// .role_name !=
// '店长' &&
// widget.uid !=
// "null" &&
// widget.uid !=
// userModel
// .user
// .openid) {
// Utils.showToast(
// "您无权拨打该电话");
// } else {
// Utils.goPhone(
// detailEntity
// .phone);
// }
// } else {
// Utils.showToast(
// "没有预订人电话信息");
// }
// break;
// }
// });
// }, "通知客户",
// bgColor: MyColours
// .color_199095,
// width: detailEntity
// .order
// .cookbooklist
// .length ==
// 0
// ? ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 100)
// : (ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 91)) /
// 2,
// fontColor: MyColours
// .color_ffffff),
// _cancelAndChangeBtn(() {
// DialogUtil
// .showShareDialog(
// context)
// ?.then((value) {
// switch (value) {
// case 1: //微信
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables
// .length;
// i++) {
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(
// ',')) {
// _tid = _tid
// .substring(
// 0,
// _tid.length -
// 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// detailEntity
// .id,
// detailEntity
// .tableinfoStr,
// detailEntity
// .ddate,
// detailEntity
// .ddateStr,
// detailEntity
// .phone,
// detailEntity
// .ddate_solt,
// tid: _tid);
// break;
// case 2: //短信
// if (detailEntity
// .phone ==
// null ||
// detailEntity
// .phone
// .isEmpty) {
// Utils.showToast(
// "没有预订人电话信息");
// return;
// }
// NavigatorUtil
// .goSmsPage(
// context,
// detailEntity.id,
// );
// break;
// case 3: //电话
// if (detailEntity
// .phone !=
// null &&
// detailEntity
// .phone
// .isNotEmpty) {
// if (userModel
// .user
// .role_name !=
// '管理员' &&
// userModel
// .user
// .role_name !=
// '店长' &&
// widget.uid !=
// "null" &&
// widget.uid !=
// userModel
// .user
// .openid) {
// Utils.showToast(
// "您无权拨打该电话");
// } else {
// Utils.goPhone(
// detailEntity
// .phone);
// }
// } else {
// Utils.showToast(
// "没有预订人电话信息");
// }
// break;
// }
// });
// }, "通知客户",
// bgColor: MyColours
// .color_199095,
// width: detailEntity
// .order
// .cookbooklist
// .length ==
// 0
// ? ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 100)
// : (ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 91)) /
// 2,
// fontColor: MyColours
// .color_ffffff)
],
)),
)),
detailEntity
.order
.cookbooklist
.length ==
0
? SizedBox()
: Expanded(
flex: 1,
child: InkWell(
onTap: () {
NavigatorUtil.goHasOrderFoodPage(
context,
rid: detailEntity
.id);
},
child:
Container(
margin: EdgeInsets.only(
left: ScreenUtil()
.setWidth(
20)),
decoration:
BoxDecoration(
color: MyColours
.color_199095,
borderRadius:
BorderRadius.circular(
ScreenUtil().setWidth(10)),
),
child: Align(
alignment:
Alignment
.center,
child: Text(
'查看菜品',
style: TextStyle(
color:
MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(34))),
),
),
)),
// _cancelAndChangeBtn(() {
// DialogUtil
// .showShareDialog(
// context)
// ?.then((value) {
// switch (value) {
// case 1: //微信
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables
// .length;
// i++) {
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(
// ',')) {
// _tid = _tid
// .substring(
// 0,
// _tid.length -
// 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// detailEntity
// .id,
// detailEntity
// .tableinfoStr,
// detailEntity
// .ddate,
// detailEntity
// .ddateStr,
// detailEntity
// .phone,
// detailEntity
// .ddate_solt,
// tid: _tid);
// break;
// case 2: //短信
// if (detailEntity
// .phone ==
// null ||
// detailEntity
// .phone
// .isEmpty) {
// Utils.showToast(
// "没有预订人电话信息");
// return;
// }
// NavigatorUtil
// .goSmsPage(
// context,
// detailEntity.id,
// );
// break;
// case 3: //电话
// if (detailEntity
// .phone !=
// null &&
// detailEntity
// .phone
// .isNotEmpty) {
// if (userModel
// .user
// .role_name !=
// '管理员' &&
// userModel
// .user
// .role_name !=
// '店长' &&
// widget.uid !=
// "null" &&
// widget.uid !=
// userModel
// .user
// .openid) {
// Utils.showToast(
// "您无权拨打该电话");
// } else {
// Utils.goPhone(
// detailEntity
// .phone);
// }
// } else {
// Utils.showToast(
// "没有预订人电话信息");
// }
// break;
// }
// });
// }, "通知客户",
// bgColor: MyColours
// .color_199095,
// width: detailEntity
// .order
// .cookbooklist
// .length ==
// 0
// ? ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 100)
// : (ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 91)) /
// 2,
// fontColor: MyColours
// .color_ffffff),
// _cancelAndChangeBtn(() {
// DialogUtil
// .showShareDialog(
// context)
// ?.then((value) {
// switch (value) {
// case 1: //微信
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables
// .length;
// i++) {
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(
// ',')) {
// _tid = _tid
// .substring(
// 0,
// _tid.length -
// 1);
// }
// NavigatorUtil.goInvicationPage(
// context,
// detailEntity
// .id,
// detailEntity
// .tableinfoStr,
// detailEntity
// .ddate,
// detailEntity
// .ddateStr,
// detailEntity
// .phone,
// detailEntity
// .ddate_solt,
// tid: _tid);
// break;
// case 2: //短信
// if (detailEntity
// .phone ==
// null ||
// detailEntity
// .phone
// .isEmpty) {
// Utils.showToast(
// "没有预订人电话信息");
// return;
// }
// NavigatorUtil
// .goSmsPage(
// context,
// detailEntity.id,
// );
// break;
// case 3: //电话
// if (detailEntity
// .phone !=
// null &&
// detailEntity
// .phone
// .isNotEmpty) {
// if (userModel
// .user
// .role_name !=
// '管理员' &&
// userModel
// .user
// .role_name !=
// '店长' &&
// widget.uid !=
// "null" &&
// widget.uid !=
// userModel
// .user
// .openid) {
// Utils.showToast(
// "您无权拨打该电话");
// } else {
// Utils.goPhone(
// detailEntity
// .phone);
// }
// } else {
// Utils.showToast(
// "没有预订人电话信息");
// }
// break;
// }
// });
// }, "通知客户",
// bgColor: MyColours
// .color_199095,
// width: detailEntity
// .order
// .cookbooklist
// .length ==
// 0
// ? ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 100)
// : (ScreenUtil
// .screenWidthDp -
// ScreenUtil()
// .setWidth(
// 91)) /
// 2,
// fontColor: MyColours
// .color_ffffff)
],
),
// Offstage(
// offstage: !(detailEntity
// .order
... ...
... ... @@ -217,7 +217,7 @@ class SelectTableFPageState extends State<SelectTableFPage> {
_chooseTableModel.areaTableMapCanNote["${outer.name}"] = tempList;
Area area = Area();
area.name = outer.name;
area.count = count;
area.count = outer.list.length == 0 ? -1 : count;
area.rid = outer.list.length == 0 ? outer.rid : outer.list[0].rid;
areas.add(area);
}
... ...
... ... @@ -64,10 +64,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// TODO: implement initState
super.initState();
LogUtil.v("home_initState");
AzhonAppUpdate.listener((map) {
needUpdate = false;
print(map['type']);
});
AzhonAppUpdate.listener(
// () {
// needUpdate = false;
// // print(map['type']);
// }
);
WidgetsBinding.instance.addObserver(this);
_currIndex = widget.initialIndex;
_pageController = PageController(initialPage: _currIndex);
... ...
... ... @@ -7,7 +7,6 @@ import 'package:one_key/models/statics_model.dart';
import 'package:one_key/provider/statistics_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
... ...
... ... @@ -65,7 +65,7 @@ class AreaItemTableState extends State<AreaItemTable> {
fontWeight: FontWeight.normal),
),
),
area.count == -1
area.count == -1
? Container()
: Positioned(
right: ScreenUtil().setWidth(12),
... ... @@ -87,7 +87,7 @@ class AreaItemTableState extends State<AreaItemTable> {
// bottomRight:
// Radius.circular(ScreenUtil().setWidth(15)))
),
child: Text(area.count == 0 ? "满座" : "${area.count}",
child: Text(area.count <= 0 ? "满座" : "${area.count}",
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(26),
... ...
... ... @@ -68,14 +68,21 @@ class ChooseTableModel with ChangeNotifier {
notifyListeners();
return [];
}
tableOuterList = (baseResp.data[0] as List).map((value) {
TableOuter tableOuter = TableOuter();
tableOuter.name = value["name"];
tableOuter.list = (value["list"] as List).map((table) {
List tableOuterList = value["list"] as List;
List enableList = []; //删除已停用的桌子,剩余可用的桌子
tableOuterList.forEach((element) {
if (element['enable'] != '0') {
enableList.add(element);
}
});
tableOuter.list = enableList.map((table) {
return t.Table.fromJson(table as Map<String, dynamic>);
}).toList();
return tableOuter;
}).toList();
}
... ...
... ... @@ -389,7 +389,14 @@ class TableManagerModel with ChangeNotifier {
tableOuterList = (baseResp.data[0] as List).map((value) {
TableOuter tableOuter = TableOuter();
tableOuter.name = value["name"];
tableOuter.list = (value["list"] as List).map((table) {
List tableOuterList = value["list"] as List;
List enableList = []; //删除已停用的桌子,剩余可用的桌子
tableOuterList.forEach((element) {
if (element['enable'] != '0') {
enableList.add(element);
}
});
tableOuter.list = enableList.map((table) {
return t.Table.fromJson(table as Map<String, dynamic>);
}).toList();
tablesAll.addAll(tableOuter.list);
... ...
... ... @@ -35,10 +35,10 @@ class UpdateModelMy {
url,
"yjd.apk",
"ic_launcher",
"1.支持Android M N O P Q\n2.支持自定义下载过程\n3.支持 设备>=Android M 动态权限的申请\n4.支持通知栏进度条展示\n5.支持文字国际化",
iOSUrl:
'itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490',
showiOSDialog: showiOSDialog,
// "1.支持Android M N O P Q\n2.支持自定义下载过程\n3.支持 设备>=Android M 动态权限的申请\n4.支持通知栏进度条展示\n5.支持文字国际化",
// iOSUrl:
// 'itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=1510697490',
// showiOSDialog: showiOSDialog,
);
AzhonAppUpdate.update(model).then((value) => print(value));
}
... ...
... ... @@ -39,7 +39,7 @@ class NavigatorUtil {
}
/// 首页
static void goHomePage(BuildContext context, {int initialIndex = 2}) {
static void goHomePage(BuildContext context, {int initialIndex = 1}) {
_navigateTo(context, "${Routes.home}?initialIndex=$initialIndex",
clearStack: true);
}
... ...
... ... @@ -216,7 +216,9 @@ class FTableItemState extends State<FTableItem> {
bottom: ScreenUtil().setWidth(10),
),
child: Text(
'${table.nickName}订',
table.nickName != null && table.nickName != ''
? '${table.nickName}订'
: '',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(22),
... ...
... ... @@ -362,7 +362,7 @@ packages:
name: flutter_app_update
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
version: "0.0.2"
flutter_blurhash:
dependency: transitive
description:
... ...
... ... @@ -133,7 +133,8 @@ dependencies:
#图片压缩
flutter_native_image: ^0.0.6+1
#更新apk
flutter_app_update: ^1.0.2
flutter_app_update: ^0.0.2
# flutter_app_update: ^1.0.0
flutter_staggered_grid_view: ^0.4.1
# webview
# webview_flutter: ^2.0.13
... ...