台桌列表页面
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:cashier_reserve/common/base/ui.dart';
|
||||
import 'package:cashier_reserve/common/base/ui_model.dart';
|
||||
import 'package:cashier_reserve/common/print/print.dart';
|
||||
import 'package:cashier_reserve/home/reserve_left_content_view.dart';
|
||||
import 'package:cashier_reserve/home/reserve_right_content_view.dart';
|
||||
import 'package:cashier_reserve/home/reserve_view_model.dart';
|
||||
@@ -177,35 +176,44 @@ class ReserveView extends BaseUI with TickerProviderStateMixin {
|
||||
BuildContext context, ReserveViewModel provider) {
|
||||
return Row(
|
||||
children: [
|
||||
_buildDateSelectItem(context,
|
||||
day: provider.getOffsetDay(0),
|
||||
week: provider.getOffsetWeekday(0),
|
||||
isToday: true),
|
||||
_buildDateSelectItem(context,
|
||||
day: provider.getOffsetDay(1), week: provider.getOffsetWeekday(1)),
|
||||
_buildDateSelectItem(context,
|
||||
day: provider.getOffsetDay(2), week: provider.getOffsetWeekday(2)),
|
||||
_buildDateSelectItem(
|
||||
context,
|
||||
provider,
|
||||
),
|
||||
_buildDateSelectItem(
|
||||
context,
|
||||
provider,
|
||||
offset: 1,
|
||||
),
|
||||
_buildDateSelectItem(
|
||||
context,
|
||||
provider,
|
||||
offset: 2,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDateSelectItem(
|
||||
BuildContext context, {
|
||||
String day = "",
|
||||
String week = "",
|
||||
isToday = false,
|
||||
BuildContext context,
|
||||
ReserveViewModel provider, {
|
||||
int offset = 0,
|
||||
}) {
|
||||
bool isSelect = provider.selectedDateIndex ~/ 2 == offset;
|
||||
bool firstBtnSelect = provider.selectedDateIndex == (offset * 2);
|
||||
bool secondBtnSelect = provider.selectedDateIndex == (offset * 2 + 1);
|
||||
|
||||
const double itemHeight = 45;
|
||||
const double btnWidth = 60;
|
||||
return Container(
|
||||
height: itemHeight,
|
||||
margin: const EdgeInsets.only(left: 15),
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 6, 0),
|
||||
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(
|
||||
color:
|
||||
isToday ? const Color(0xff318AFE) : const Color(0xffafafaf),
|
||||
isSelect ? const Color(0xff318AFE) : const Color(0xffafafaf),
|
||||
width: 1),
|
||||
),
|
||||
child: Row(
|
||||
@@ -214,18 +222,18 @@ class ReserveView extends BaseUI with TickerProviderStateMixin {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
day,
|
||||
provider.getOffsetDay(offset),
|
||||
style: TextStyle(
|
||||
color: isToday
|
||||
color: isSelect
|
||||
? const Color(0xff6A8DC6)
|
||||
: const Color(0xff333333),
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
week,
|
||||
provider.getOffsetWeekday(offset),
|
||||
style: TextStyle(
|
||||
color: isToday
|
||||
color: isSelect
|
||||
? const Color(0xff6A8DC6)
|
||||
: const Color(0xff333333),
|
||||
fontSize: 13,
|
||||
@@ -240,13 +248,23 @@ class ReserveView extends BaseUI with TickerProviderStateMixin {
|
||||
color: const Color(0xffafafaf),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: const SizedBox(
|
||||
onTap: () {
|
||||
provider.setSelectedDateIndex(offset * 2);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
firstBtnSelect ? const Color(0xff318AFE) : Colors.white,
|
||||
),
|
||||
width: btnWidth,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"午餐",
|
||||
style: TextStyle(fontSize: 16, color: Color(0xff333333)),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: firstBtnSelect
|
||||
? Colors.white
|
||||
: const Color(0xff333333)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -257,13 +275,23 @@ class ReserveView extends BaseUI with TickerProviderStateMixin {
|
||||
color: const Color(0xffafafaf),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: const SizedBox(
|
||||
onTap: () {
|
||||
provider.setSelectedDateIndex(offset * 2 + 1);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
secondBtnSelect ? const Color(0xff318AFE) : Colors.white,
|
||||
),
|
||||
width: btnWidth,
|
||||
child: Center(
|
||||
child: Text(
|
||||
"晚餐",
|
||||
style: TextStyle(fontSize: 16, color: Color(0xff333333)),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: secondBtnSelect
|
||||
? Colors.white
|
||||
: const Color(0xff333333)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user