Commit 7211c2c92df94d79cd45fb876f1187e148e6e8c8

Authored by wdn127929
1 parent 7490aaee

桌位页面展示宴会---点击详情未做

... ... @@ -36,7 +36,7 @@ class Notebook {
String is_set_ddate;
String topic;
String ddate_solt;
String status; //订单状态 0:待确认,1:已定座,2:确认到店,3:用餐完成,4:取消预订,5:安排包间,6拒绝订单
String status; //订单状态 0:待确认,1:已定座,2:确认到店,3:用餐完成,4:取消预订,5:安排包间,6拒绝订单,10表示宴会
String cause;
String abolition;
String action;
... ... @@ -53,6 +53,8 @@ class Notebook {
String nick_name;
bool issimple;
String className; //宴会类型
// String get tableinfoStr {
// return name +
// "\n" +
... ... @@ -86,6 +88,8 @@ class Notebook {
case "3": //公司
return rname + "公司";
break;
default:
return rname;
}
return rname;
... ...
... ... @@ -33,6 +33,8 @@ class Table {
String isMerge; //是否打开桌位合并开关
String tids; //被合并桌位tids
String lockTname; //被谁合并了
String lockTid; //被合并桌位id
String label; //底部标签 (新客,婚宴)
//获取桌位类型
String get tidStr {
... ... @@ -95,6 +97,8 @@ class Table {
return "已预订";
case "2": //用餐中
return "已预订";
case "10": //婚宴
return "已预订";
default:
return "";
}
... ... @@ -108,6 +112,6 @@ class Table {
@override
String toString() {
return 'Table{id: $id,isPhoto:$isPhoto rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, isExitsClass:$isExitsClass,max: $max, low: $low, is_lock: $isLock, is_merge: $isMerge,tids:$tids,lock_tname:$lockTname}';
return 'Table{id: $id,isPhoto:$isPhoto rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, isExitsClass:$isExitsClass,max: $max, low: $low, is_lock: $isLock, is_merge: $isMerge,tids:$tids,lock_tname:$lockTname,lock_tid:$lockTid}';
}
}
... ...
... ... @@ -31,7 +31,8 @@ Table _$TableFromJson(Map<String, dynamic> json) {
..isLock = json['is_lock'] as String
..isMerge = json['is_merge'] as String
..tids = json['tids'] as String
..lockTname = json['lock_tname'] as String;
..lockTname = json['lock_tname'] as String
..lockTid = json['lock_tid'] as String;
}
Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{
... ... @@ -58,5 +59,6 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{
'is_lock': instance.isLock,
'is_merge': instance.isMerge,
'tids': instance.tids,
'lock_tname': instance.lockTname
'lock_tname': instance.lockTname,
'lock_tid': instance.lockTid
};
... ...
... ... @@ -145,7 +145,8 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
Map<String, String> params = {
'tid': table.id,
'is_merge': isMerge,
'tids': tids
'tids':tids
// 'tids': isMerge == '0' ? '' : tids
};
bool success = await tableManagerModel.mergeTables(context, params);
... ... @@ -410,7 +411,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
isLock: table.isLock ?? '0',
isMerge: table.isMerge ?? '0',
tableid: table.id,
table:table,
table: table,
selectTables: selectTables,
onTapDel: (Map<String, dynamic> value) async {
Map<String, String> params = {
... ...
... ... @@ -55,6 +55,7 @@ class NoteBookModel extends ChangeNotifier {
notebooks = baseResp.data.map<Notebook>((value) {
return Notebook.fromJson(value);
}).toList();
// notebooks.removeWhere((element) => element.id == null);
if (notebooks.isEmpty) {
pageState = PageState.Empty;
} else {
... ... @@ -83,7 +84,6 @@ class NoteBookModel extends ChangeNotifier {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
// total = "已订" + (morning + noon + night).toString();
if (userModel.user.morning.isNotEmpty) {
totalmorning = "($morning)";
}
if (userModel.user.noon.isNotEmpty) {
... ...
... ... @@ -20,6 +20,7 @@ import 'package:one_key/utils/lunar_calendar.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import '../models/get_board_model.dart';
import 'notebook_model.dart';
class TableManagerModel with ChangeNotifier {
... ... @@ -64,6 +65,43 @@ class TableManagerModel with ChangeNotifier {
DateTime dateTimeSelect;
int selectNumber;
List dailyList = []; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
List<FeastBoardModel> banquetByDateData = []; //宴会看板数据/宴会预订的数据
List<Notebook> noteBooks;
//指定日期、时段宴会预定
Future<bool> getBanquetByDate(
BuildContext context, Map<String, String> params,
{showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_banquet_by_date,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
return false;
});
if (baseResp == null) return false;
if (baseResp.code == Constant.status_success) {
if (baseResp.data is List) {
banquetByDateData = [];
notifyListeners();
return true;
}
banquetByDateData = [];
baseResp.data.forEach((key, value) {
FeastBoardModel boardModel = FeastBoardModel();
boardModel.title = key;
boardModel.data = FeastBoardModel.fromJson(value).data;
banquetByDateData.add(boardModel);
});
notifyListeners();
return true;
} else {
Utils.showToast(baseResp.msg ?? "");
}
return false;
}
//初始化时间
initTime(BuildContext context) async {
... ... @@ -487,6 +525,59 @@ class TableManagerModel with ChangeNotifier {
return tableOuterList;
}
//获取预订(原来普通预订和宴会预订)
_getReserveListAndFeastData(context, params, showloading) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
String timeStrStart = dateTime.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
" 00:00:00";
String timeStrEnd = dateTime.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
" 23:59:59";
String start =
(DateUtil.getDateMsByTimeStr(timeStrStart) / 1000).floor().toString();
String end =
(DateUtil.getDateMsByTimeStr(timeStrEnd) / 1000).floor().toString();
Map<String, String> banquetmap = {
'sid': userModel.user.sellerid,
'rdate': '${start}',
'edate': '${end}',
'ddate_interval': currTimeIndex.toString()
};
return await Future.wait<bool>([
_getOldReserve(context, params, showloading),
getBanquetByDate(context, banquetmap, showLoading: showloading)
]).then((results) {
if (results[0] && results[1]) {
//成功
return true;
} else {
if (!results[0]) {
// Utils.showToast('');
} else {
// Utils.showToast('');
}
return false;
}
}).catchError((e) {
print(e);
return false;
});
}
Future<bool> _getOldReserve(context, params, showloading) async {
List<Notebook> noteBooks =
await newGetReserveList(context, params, showLoading: showloading);
return true;
}
//获取已预订列表
getReserveList(BuildContext context,
{bool needLoading = true,
... ... @@ -509,57 +600,96 @@ class TableManagerModel with ChangeNotifier {
notifyListeners();
}
List<Notebook> noteBooks =
await newGetReserveList(context, params, showLoading: showloading);
List<t.Table> tempSelectTables = [];
tempSelectTables.addAll(selectTables);
String msg = '';
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
//已预订,用餐中,已安排
List<String> tids = notebook.tid.split(",");
for (String tid in tids) {
if (notebook.status == "1" ||
notebook.status == "2" ||
notebook.status == "5") {
tableMap["$tid"] = notebook;
///预订按钮点击的时候提醒已经被预订的桌子
///
if (showMsg && selectTables.length > 0) {
for (t.Table item in selectTables) {
if (item.id == tid) {
msg += '${item.name},';
tempSelectTables.remove(item);
bool success =
await _getReserveListAndFeastData(context, params, showloading);
if (success) {
List<FeastBoardModel> banquetByDateDataTemp = []; //转换为桌子id为key,data为value
banquetByDateData.forEach((element) {
tablesAll.forEach((table) {
if (table.name == element.title) {
FeastBoardModel feastBoardModel = FeastBoardModel();
feastBoardModel.title = table.id;
feastBoardModel.data = element.data;
banquetByDateDataTemp.add(feastBoardModel);
}
});
});
// banquetByDateData.map((e) => null)
String banquetKey = '';
if (currTimeIndex == 1) {
banquetKey = '早餐';
} else if (currTimeIndex == 2) {
banquetKey = '午餐';
} else if (currTimeIndex == 3) {
banquetKey = '晚餐';
}
banquetByDateDataTemp.forEach((element) {
FeastBoardSunModel feastBoardSunModel = element.data[banquetKey][0];
Notebook notebook = Notebook();
notebook.tid = element.title;
notebook.status = '10'; //宴会类型
notebook.className = feastBoardSunModel.className;
notebook.id = feastBoardSunModel.rid;
notebook.rname = feastBoardSunModel.rname;
notebook.nick_name =
feastBoardSunModel.nickName ?? feastBoardSunModel.account;
noteBooks.add(notebook);
});
// List<Notebook> noteBooks =
// await newGetReserveList(context, params, showLoading: showloading);
List<t.Table> tempSelectTables = [];
tempSelectTables.addAll(selectTables);
String msg = '';
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
//已预订,用餐中,已安排
List<String> tids = notebook.tid.split(",");
for (String tid in tids) {
if (notebook.status == "1" ||
notebook.status == "2" ||
notebook.status == "5" ||
notebook.status == "10") {
tableMap["$tid"] = notebook;
///预订按钮点击的时候提醒已经被预订的桌子
///
if (showMsg && selectTables.length > 0) {
for (t.Table item in selectTables) {
if (item.id == tid) {
msg += '${item.name},';
tempSelectTables.remove(item);
}
}
}
}
}
}
}
if (showMsg && msg != '' && selectTables.length > 0) {
if (msg.endsWith(',')) {
msg = msg.substring(0, msg.length - 1);
if (showMsg && msg != '' && selectTables.length > 0) {
if (msg.endsWith(',')) {
msg = msg.substring(0, msg.length - 1);
}
selectTables = tempSelectTables;
Utils.showToast('${msg}已被预订,请选择其他桌位!');
print(tableMap);
initData(needKeep: needKeep);
// notifyListeners();
return false;
}
selectTables = tempSelectTables;
Utils.showToast('${msg}已被预订,请选择其他桌位!');
print(tableMap);
initData(needKeep: needKeep);
// notifyListeners();
return false;
return true;
}
print(tableMap);
initData(needKeep: needKeep);
return true;
return false;
}
//获取已预订订单
Future<List<Notebook>> newGetReserveList(
BuildContext context, Map<String, String> params,
{showLoading = false}) async {
List<Notebook> notebooks = [];
noteBooks = [];
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.get_reserve_list,
data: params, showLoading: false)
... ... @@ -581,13 +711,13 @@ class TableManagerModel with ChangeNotifier {
});
if (baseResp == null) return [];
if (baseResp.code == Constant.status_success) {
notebooks = baseResp.data.map<Notebook>((value) {
noteBooks = baseResp.data.map<Notebook>((value) {
return Notebook.fromJson(value);
}).toList();
} else {
Utils.showToast(baseResp.msg ?? "");
}
return notebooks;
return noteBooks;
}
//获取一天开始-结束时间字符串
... ... @@ -662,6 +792,7 @@ class TableManagerModel with ChangeNotifier {
table.reserver = notebook.rnameStr;
table.pnum = notebook.actual_pnum;
table.nickName = notebook.nick_name;
table.label = notebook.className;
//剔除已经预订的桌子,剩下空桌子(仅看空座)
tempList.remove(table);
... ...
import 'package:flutter/material.dart';
class MyColours {
static const Color color_F7C797 = Color(0xffF7C797);
static const Color color_FEF3E6 = Color(0xffFEF3E6);
static const Color color_66000000 = Color(0x66000000);
static const Color color_00A870 = Color(0xff00A870);
static const Color color_F6F6F6 = Color(0xffF6F6F6);
... ...
... ... @@ -1108,7 +1108,7 @@ class NavigatorUtil {
{replace = false,
bool canChoose = true,
Map object,
String fromPage = 'table_manage',
String fromPage = 'merge_table',
String tableidNow,
String tid = '',
String tids}) {
... ...
... ... @@ -2419,6 +2419,9 @@ class DialogUtil {
VEmptyView(32),
InkWell(
onTap: () async {
if (isMerge != '1') {
return;
}
//跳转到被合并桌位展示页面
Map object;
if (selectTables.length > 0) {
... ... @@ -2476,13 +2479,18 @@ class DialogUtil {
style: TextStyle(
fontSize: ScreenUtil()
.setSp(32),
color: MyColours
.color_000000),
color: isMerge == '1'
? MyColours
.color_000000
: MyColours
.color_BFC4D4),
),
HEmptyView(40),
Expanded(
child: Text(
tableNames ?? "",
isMerge == '1'
? tableNames ?? ""
: '添加',
maxLines: 1,
textAlign: TextAlign.right,
overflow:
... ... @@ -2490,12 +2498,15 @@ class DialogUtil {
style: TextStyle(
fontSize: ScreenUtil()
.setSp(32),
color: MyColours
.color_66000000),
color: isMerge == '1'
? MyColours
.color_66000000
: MyColours
.color_BFC4D4),
)),
Image.asset(
Utils.getImgPath(
'base_arrow_r'),
'merge_arrow'),
width: w(24)),
HEmptyView(22),
],
... ...
... ... @@ -4,8 +4,11 @@ import 'package:one_key/models/notebook.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/models/table.dart' as t;
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../utils/screen_util.dart';
class FTableItem extends StatefulWidget {
final t.Table table;
final bool canSelected; //是否能选中
... ... @@ -59,6 +62,9 @@ class FTableItemState extends State<FTableItem> {
return GestureDetector(
onTap: () {
if (widget.canSelected && widget.fromPage == 'change') {
if (table.isLock == '1' && signStr != '已预订') {
return;
}
//从变更页面进来 canChoose = true
if (widget.canSelected && signStr.isEmpty) {
setState(() {
... ... @@ -88,6 +94,9 @@ class FTableItemState extends State<FTableItem> {
} else if (widget.fromPage == 'new' &&
widget.canSelected &&
signStr.isEmpty) {
if (table.isLock == '1' && signStr != '已预订') {
return;
}
//从安排桌位进来
setState(() {
table.selected = !(table.selected ?? false);
... ... @@ -95,6 +104,9 @@ class FTableItemState extends State<FTableItem> {
widget.onSelected(table);
} else if (widget.fromPage == 'table_manage' ||
widget.fromPage == 'room_manage') {
if (table.isLock == '1' && signStr != '已预订') {
return;
}
setState(() {
table.selected = !(table.selected ?? false);
});
... ... @@ -113,296 +125,382 @@ class FTableItemState extends State<FTableItem> {
widget.onSelected(table);
}
},
child: Stack(
children: <Widget>[
Container(
// width: ScreenUtil().setWidth(160),
// height: ScreenUtil().setWidth(widget.height),
// margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: widget.need && signStr == '已预订' && !isSelf
? MyColours.color_afbcc4
: widget.canSelected && table.selected
? MyColours.color_199095
: MyColours.color_ffffff,
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_E0E0E0),
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(20)))),
child: Stack(
// alignment: Alignment.center,
children: <Widget>[
child: table.isLock == '1' &&
signStr != '已预订' &&
widget.fromPage != 'tablePhoto'
? Stack(
children: [
Container(
// alignment: Alignment.center,
// color: Colors.blueAccent,
// height: ScreenUtil().setWidth(widget.height),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20)),
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Column(
// mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
widget.need && signStr == '已预订' && !isSelf
? SizedBox()
: VEmptyView(10),
Container(
// color: Colors.red,
alignment: Alignment.center,
child: Text(
table.name,
maxLines: 1,
style: TextStyle(
color:
(widget.need && signStr == '已预订' && !isSelf)
? MyColours.color_333333
: (widget.canSelected && table.selected)
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(34),
decoration: TextDecoration.none,
fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis,
)
// Text(
// table.name,
// // textAlign: TextAlign.center,
// maxLines: 2,
// style: TextStyle(
// color: table.signStr == '已停用'
// ? MyColours.color_999999
// : MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// ),
),
((table.reserver != null && table.reserver != '') ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? VEmptyView(8)
: SizedBox(),
signStr == '已预订' && !isSelf
? SizedBox()
: Text(
table.tableNum,
// width: ScreenUtil().setWidth(160),
// height: ScreenUtil().setWidth(widget.height),
// margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: MyColours.color_DBDBDB,
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_BFC4D4),
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(20)))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
widget.need && signStr == '已预订' && !isSelf
? SizedBox()
: VEmptyView(10),
Container(
// color: Colors.red,
alignment: Alignment.center,
child: Text(
table.name,
maxLines: 1,
style: TextStyle(
color: signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected && table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(36),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis,
),
signStr == '已预订' &&
!isSelf &&
((table.reserver != null &&
!table.reserver.isEmpty) ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? Text(
(table.reserver == null || table.reserver.isEmpty)
? (table.pnum != '' &&
table.pnum != null &&
table.pnum != '0')
? '(${table.pnum}人)'
: ''
: '${table.reserver}' +
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'
? '(${table.pnum}人)'
: ''),
)),
VEmptyView(10),
Image.asset(
Utils.getImgPath('lock'),
width: w(16),
)
],
)),
Positioned(
left: 0,
top: 0,
child: table.tidStr == null
? Container()
: Container(
// width: ScreenUtil().setWidth(60),
// height: ScreenUtil().setWidth(42),
padding: EdgeInsets.all(ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
// color: widget.canSelected && table.selected
// ? MyColours.color_199095
// : Color.fromRGBO(239, 239, 239, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(20)),
// topRight:
// Radius.circular(ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8))
)),
child: Text(table.tidStr,
style: TextStyle(
color: signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected && table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
: SizedBox(),
fontWeight: FontWeight.normal)),
),
),
],
)
: Stack(
children: <Widget>[
Container(
// width: ScreenUtil().setWidth(160),
// height: ScreenUtil().setWidth(widget.height),
// margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: widget.need && signStr == '已预订' && !isSelf
? table.sign == '10'
? MyColours.color_FEF3E6
: MyColours.color_afbcc4
: widget.canSelected && table.selected
? MyColours.color_199095
: MyColours.color_ffffff,
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_E0E0E0),
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(20)))),
child: Stack(
// alignment: Alignment.center,
children: <Widget>[
Container(
// alignment: Alignment.center,
// color: Colors.blueAccent,
// height: ScreenUtil().setWidth(widget.height),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(20)),
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Column(
// mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
widget.need && signStr == '已预订' && !isSelf
? SizedBox()
: VEmptyView(10),
Container(
// color: Colors.red,
alignment: Alignment.center,
child: Text(
table.name,
maxLines: 1,
style: TextStyle(
color: (widget.need &&
signStr == '已预订' &&
!isSelf)
? MyColours.color_333333
: (widget.canSelected &&
table.selected)
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(34),
decoration: TextDecoration.none,
fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis,
)
// Text(
// table.name,
// // textAlign: TextAlign.center,
// maxLines: 2,
// style: TextStyle(
// color: table.signStr == '已停用'
// ? MyColours.color_999999
// : MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// ),
),
((table.reserver != null && table.reserver != '') ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? VEmptyView(8)
: SizedBox(),
signStr == '已预订' && !isSelf
? SizedBox()
: Text(
table.tableNum,
style: TextStyle(
color: signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected &&
table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
signStr == '已预订' &&
!isSelf &&
((table.reserver != null &&
!table.reserver.isEmpty) ||
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'))
? Text(
(table.reserver == null ||
table.reserver.isEmpty)
? (table.pnum != '' &&
table.pnum != null &&
table.pnum != '0')
? '(${table.pnum}人)'
: ''
: '${table.reserver}' +
(table.pnum != '' &&
table.pnum != null &&
table.pnum != '0'
? '(${table.pnum}人)'
: ''),
style: TextStyle(
color: signStr == '已预订' && !isSelf
? MyColours.color_353535
: (widget.canSelected &&
table.selected)
? MyColours.color_ffffff
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
: SizedBox(),
widget.need &&
signStr == '已预订' &&
!isSelf &&
table.nickName != null &&
table.nickName != ''
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(6),
bottom: ScreenUtil().setWidth(8),
),
child: Text(
table.nickName != null &&
table.nickName != ''
? '${table.nickName}订'
: '',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
)
: SizedBox(),
// VEmptyView(6),
// Text(
// table.lowStr,
// style: TextStyle(
// color: MyColours.color_777777,
// fontSize: ScreenUtil().setSp(26),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// )
signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
)
: SizedBox()
],
),
),
widget.need &&
signStr == '已预订' &&
!isSelf &&
table.nickName != null &&
table.nickName != ''
? Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(6),
bottom: ScreenUtil().setWidth(8),
),
child: Text(
table.nickName != null && table.nickName != ''
? '${table.nickName}订'
: '',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(22),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
)
: SizedBox(),
// VEmptyView(6),
// Text(
// table.lowStr,
// style: TextStyle(
// color: MyColours.color_777777,
// fontSize: ScreenUtil().setSp(26),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// )
signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
)
: SizedBox()
? SizedBox()
: Positioned(
left: 0,
top: 0,
child: table.tidStr == null
? Container()
: Container(
// width: ScreenUtil().setWidth(60),
// height: ScreenUtil().setWidth(42),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
color: widget.canSelected &&
table.selected
? MyColours.color_199095
: Color.fromRGBO(
239, 239, 239, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
// topRight:
// Radius.circular(ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8))
)),
child: Text(table.tidStr,
style: TextStyle(
color: widget.canSelected &&
table.selected
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(20),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal)),
),
),
// widget.need && signStr == '已预订'
// ? Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: signStr.isEmpty
// ? Container()
// : Container(
// width: ScreenUtil().setWidth(160),
// height: ScreenUtil().setWidth(40),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: signStr == '已停用'
// ? MyColours.color_777777
// : signStr == '已买单'
// ? MyColours.color_F59A23
// : MyColours.color_E95750,
// borderRadius: BorderRadius.only(
// bottomLeft: Radius.circular(
// ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8)))),
// child: Text(
// signStr,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(24),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// ),
// ),
// )
// : SizedBox(),
],
),
),
signStr == '已预订' && !isSelf
// Positioned(
// top: 3,
// right: 5,
// child: widget.canSelected && (table.selected ?? false)
// ? Image.asset(
// "assets/icon_selected.png",
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// )
// : Container()),
widget.need && signStr == '已预订' && !isSelf
? SizedBox()
: Positioned(
left: 0,
top: 0,
child: table.tidStr == null
? Container()
: Container(
// width: ScreenUtil().setWidth(60),
// height: ScreenUtil().setWidth(42),
padding:
EdgeInsets.all(ScreenUtil().setWidth(4)),
alignment: Alignment.center,
decoration: BoxDecoration(
color: widget.canSelected && table.selected
? MyColours.color_199095
: Color.fromRGBO(239, 239, 239, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
ScreenUtil().setWidth(20)),
// topRight:
// Radius.circular(ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8))
)),
child: Text(table.tidStr,
style: TextStyle(
color:
widget.canSelected && table.selected
? MyColours.color_ffffff
: MyColours.color_333333,
fontSize: ScreenUtil().setSp(20),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal)),
),
),
// widget.need && signStr == '已预订'
// ? Positioned(
// bottom: 0,
// left: 0,
// right: 0,
// child: signStr.isEmpty
// ? Container()
// : Container(
// width: ScreenUtil().setWidth(160),
// height: ScreenUtil().setWidth(40),
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: signStr == '已停用'
// ? MyColours.color_777777
// : signStr == '已买单'
// ? MyColours.color_F59A23
// : MyColours.color_E95750,
// borderRadius: BorderRadius.only(
// bottomLeft: Radius.circular(
// ScreenUtil().setWidth(8)),
// bottomRight: Radius.circular(
// ScreenUtil().setWidth(8)))),
// child: Text(
// signStr,
// style: TextStyle(
// color: MyColours.color_ffffff,
// fontSize: ScreenUtil().setSp(24),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// ),
// ),
// )
// : SizedBox(),
left: ScreenUtil().setWidth(18),
bottom: ScreenUtil().setWidth(12),
child: table.isPhoto != 1
? Image.asset(
widget.canSelected && table.selected
? 'assets/f_camera_white.png'
: "assets/f_camera.png",
width: ScreenUtil().setWidth(22),
height: ScreenUtil().setWidth(22),
)
: Container()),
Positioned(
bottom: 0,
right: 0,
left: 0,
child: signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
color: table.sign == '10'
? MyColours.color_F7C797
: MyColours.color_d7d7d7,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Text(
table.sign == '10' ? table.label : '新客',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
)
: SizedBox())
],
),
),
// Positioned(
// top: 3,
// right: 5,
// child: widget.canSelected && (table.selected ?? false)
// ? Image.asset(
// "assets/icon_selected.png",
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// )
// : Container()),
widget.need && signStr == '已预订' && !isSelf
? SizedBox()
: Positioned(
left: ScreenUtil().setWidth(18),
bottom: ScreenUtil().setWidth(12),
child: table.isPhoto != 1
? Image.asset(
widget.canSelected && table.selected
? 'assets/f_camera_white.png'
: "assets/f_camera.png",
width: ScreenUtil().setWidth(22),
height: ScreenUtil().setWidth(22),
)
: Container()),
Positioned(
bottom: 0,
right: 0,
left: 0,
child: signStr == '已预订' && !isSelf
? Container(
// width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(34),
alignment: Alignment.centerLeft,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
decoration: BoxDecoration(
color: MyColours.color_d7d7d7,
borderRadius: BorderRadius.only(
bottomLeft:
Radius.circular(ScreenUtil().setWidth(20)),
bottomRight:
Radius.circular(ScreenUtil().setWidth(20)))),
child: Text(
'新客',
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
)
: SizedBox())
],
),
);
}
}
... ...