Commit ea4333ccb4beec42936ce9948239d3eb6211a3b3

Authored by “gaiyaguang”
1 parent 9907a8c2

ui

... ... @@ -400,7 +400,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
child: Container(
// color: Colors.red,
// height: ScreenUtil().setHeight(178),
height: ScreenUtil().setHeight(170),
height: ScreenUtil().setHeight(180),
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext contxt, int index) {
... ...
... ... @@ -287,7 +287,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// TODO: implement build
return new Scaffold(
bottomNavigationBar: BottomNavigationBar(
iconSize: ScreenUtil().setWidth(40),
iconSize: ScreenUtil().setWidth(48),
unselectedFontSize: ScreenUtil().setSp(22),
selectedFontSize: ScreenUtil().setSp(22),
backgroundColor: MyColours.color_ffffff,
... ... @@ -295,13 +295,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/message_default.png"),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(46),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/message_selected.png"),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(46),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"消息中心",
... ... @@ -313,13 +313,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/notebook_default.png"),
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(44),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/notebook_selected.png"),
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(44),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"已预订",
... ... @@ -331,13 +331,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/my_default.png"),
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(44),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/my_selected.png"),
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(44),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"我的",
... ...
... ... @@ -45,7 +45,7 @@ class MyPageState extends State<MyPage> {
return Stack(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(242+121)),
padding: EdgeInsets.only(top: ScreenUtil().setHeight(242 + 121)),
child: Column(
children: <Widget>[
VEmptyView(44),
... ... @@ -166,7 +166,7 @@ class MyPageState extends State<MyPage> {
)),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(242+121),
height: ScreenUtil().setHeight(242 + 121),
alignment: Alignment.centerLeft,
color: MyColours.color_199095,
child: Scaffold(
... ... @@ -174,14 +174,14 @@ class MyPageState extends State<MyPage> {
appBar: AppBar(
backgroundColor: Colors.transparent, //把appbar的背景色改成透明
elevation: 0, //appbar的阴影
centerTitle: true, // 标题居中
title: Text(
'我的',
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none
),
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
)),
body: Consumer<UserModel>(
builder:
... ... @@ -215,6 +215,7 @@ class MyPageState extends State<MyPage> {
],
);
// TODO: implement build
/* 原来的
return Container(
width: double.infinity,
height: double.infinity,
... ... @@ -371,5 +372,6 @@ class MyPageState extends State<MyPage> {
],
),
);
*/
}
}
... ...
... ... @@ -194,7 +194,7 @@ class SelectTablePageState extends State<SelectTablePage> {
child: Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(189),
width: ScreenUtil().setWidth(170),
height: double.infinity,
color: MyColours.color_f1f1f1,
child: ListView.builder(
... ... @@ -212,87 +212,102 @@ class SelectTablePageState extends State<SelectTablePage> {
),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(10),
horizontal: ScreenUtil().setWidth(9)),
child: GridView.builder(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, childAspectRatio: 0.8),
itemBuilder: (context, index) {
return TableItem(
areaTableMap[currentArea][index],
onSelected: (table) {
if ((table as t.Table).selected) {
selectTables.add(table);
widget.tableList
.add(tableToTableList(table));
} else {
widget.tableList
.removeWhere((t) => t.id == table.id);
selectTables
.removeWhere((t) => t.id == table.id);
}
},
canSelected: true,
canChoose: widget.canChoose,
tableMap: tableMap,
rid: widget.rid);
},
itemCount: areaTableMap[currentArea].length,
),
),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(10),
horizontal: ScreenUtil().setWidth(9)),
child: Column(
children: [
Expanded(
child: GridView.builder(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 8 / 9),
itemBuilder: (context, index) {
return TableItem(
areaTableMap[currentArea][index],
onSelected: (table) {
if ((table as t.Table).selected) {
selectTables.add(table);
widget.tableList
.add(tableToTableList(table));
} else {
widget.tableList.removeWhere(
(t) => t.id == table.id);
selectTables.removeWhere(
(t) => t.id == table.id);
}
},
canSelected: true,
canChoose: widget.canChoose,
tableMap: tableMap,
rid: widget.rid);
},
itemCount: areaTableMap[currentArea].length,
)),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(84),
margin: EdgeInsets.only(
bottom: ScreenUtil().setWidth(50)),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(31)),
alignment: Alignment.center,
color: MyColours.color_ffffff,
child: CommonButton(
content: "确定",
width: 500,
height: 84,
fontSize: 34,
state: 1,
onPress: () {
if (widget.canChoose) {
// if (widget.tableList.length > 0) {
String tid = "";
for (TableList table
in widget.tableList) {
tid += table.id + ",";
}
if (widget.tableList.length > 0) {
tid = tid.substring(
0, tid.length - 1);
}
Map temp = {
'object': widget.tableList,
'tid': tid
};
Navigator.of(context).pop(temp);
// }
} else {
if (selectTables.length > 0) {
String tid = "";
for (t.Table table
in selectTables) {
tid += table.id + ",";
}
if (selectTables.length > 0) {
tid = tid.substring(
0, tid.length - 1);
}
Map temp = {
'object': widget.tableList,
'tid': tid
};
Navigator.of(context).pop(temp);
}
}
},
)),
],
)),
)
],
),
),
),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(100),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border(
top: BorderSide(
color: MyColours.color_bfbfbf,
width: ScreenUtil().setHeight(1)))),
child: CommonButton(
content: "确定",
width: 600,
height: 84,
fontSize: 34,
state: 1,
onPress: () {
if (widget.canChoose) {
// if (widget.tableList.length > 0) {
String tid = "";
for (TableList table in widget.tableList) {
tid += table.id + ",";
}
if (widget.tableList.length > 0) {
tid = tid.substring(0, tid.length - 1);
}
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
// }
} else {
if (selectTables.length > 0) {
String tid = "";
for (t.Table table in selectTables) {
tid += table.id + ",";
}
if (selectTables.length > 0) {
tid = tid.substring(0, tid.length - 1);
}
Map temp = {'object': widget.tableList, 'tid': tid};
Navigator.of(context).pop(temp);
}
}
},
))
],
),
);
... ...
... ... @@ -44,4 +44,6 @@ class MyColours {
static const Color color_6AB6B9 = Color(0xff6AB6B9);
static const Color color_74BBBE = Color(0xff74BBBE);
static const Color color_E0E0E0 = Color(0xffE0E0E0);
static const Color color_E95750 = Color(0xffE95750);
static const Color color_A9E3E6 = Color(0xffA9E3E6);
}
... ...
... ... @@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/pages/message/message_dialog_item.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:one_key/res/colors.dart';
... ... @@ -224,7 +225,8 @@ class DialogUtil {
color: Colors.white),
),
calendarStyle: CalendarStyle(
contentPadding: const EdgeInsets.only(bottom: 4.0),
contentPadding:
EdgeInsets.only(bottom: ScreenUtil().setWidth(8)),
weekdayStyle: TextStyle(
color: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(32)),
... ... @@ -239,7 +241,8 @@ class DialogUtil {
return Container(
color: MyColours.color_2bb5b7,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 20),
margin: EdgeInsets.only(
bottom: ScreenUtil().setWidth(40)),
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(25)),
child: Text(
... ... @@ -252,15 +255,22 @@ class DialogUtil {
},
dayBuilder: (context, date, _) {
return Container(
height: 100,
height: ScreenUtil().setWidth(200),
decoration: BoxDecoration(
shape: BoxShape.circle,
// color: Colors.blue,
),
alignment: Alignment.center,
margin: const EdgeInsets.fromLTRB(6, 6, 6, 16),
padding: const EdgeInsets.only(
bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(32)),
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(8),
left: ScreenUtil().setWidth(16),
right: ScreenUtil().setWidth(16),
top: ScreenUtil().setWidth(8)),
child: Text(
// "${_parseDateDay(date)}",
'${date.day}',
... ... @@ -276,9 +286,16 @@ class DialogUtil {
shape: BoxShape.circle,
color: MyColours.color_2bb5b7),
alignment: Alignment.center,
margin: const EdgeInsets.fromLTRB(6, 6, 6, 16),
padding: const EdgeInsets.only(
bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(32)),
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(8),
left: ScreenUtil().setWidth(16),
right: ScreenUtil().setWidth(16),
top: ScreenUtil().setWidth(8)),
child: Text(
// "${_parseDateDay(date)}",
'${date.day}',
... ... @@ -293,11 +310,19 @@ class DialogUtil {
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: MyColours.color_2bb5b7, width: 1)),
color: MyColours.color_2bb5b7,
width: ScreenUtil().setWidth(2))),
alignment: Alignment.center,
margin: const EdgeInsets.fromLTRB(6, 6, 6, 16),
padding: const EdgeInsets.only(
bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12),
ScreenUtil().setWidth(32)),
padding: EdgeInsets.only(
bottom: ScreenUtil().setWidth(8),
left: ScreenUtil().setWidth(16),
right: ScreenUtil().setWidth(16),
top: ScreenUtil().setWidth(8)),
child: Text(
// '今',
'${date.day}',
... ... @@ -325,7 +350,7 @@ class DialogUtil {
Positioned(
right: ScreenUtil().setWidth(27),
bottom: 0,
top: 5,
top: ScreenUtil().setWidth(30),
child: buildMarker(date)),
// Align(
// alignment: Alignment.bottomCenter,
... ... @@ -398,8 +423,9 @@ class DialogUtil {
// decoration:
// BoxDecoration(shape: BoxShape.circle, color: MyColours.color_2bb5b7),
alignment: Alignment.bottomCenter,
margin: const EdgeInsets.fromLTRB(6, 6, 6, 0),
padding: const EdgeInsets.only(top: 10.0),
margin: EdgeInsets.fromLTRB(ScreenUtil().setWidth(12),
ScreenUtil().setWidth(12), ScreenUtil().setWidth(12), 0),
padding: EdgeInsets.only(top: ScreenUtil().setWidth(34)),
child: Text(
"${_parseDateDay(date)}",
style: TextStyle().copyWith(
... ... @@ -505,11 +531,16 @@ class DialogUtil {
adapter: PickerDataAdapter<String>(pickerdata: data),
hideHeader: false,
cancelText: "取消",
cancelTextStyle: TextStyle(color: MyColours.color_828282, fontSize: 20),
cancelTextStyle: TextStyle(
color: MyColours.color_828282, fontSize: ScreenUtil().setSp(36)),
confirmText: "确定",
confirmTextStyle:
TextStyle(color: MyColours.color_2bb5b7, fontSize: 20),
selectedTextStyle: TextStyle(color: Colors.blue),
itemExtent: ScreenUtil().setWidth(80),
confirmTextStyle: TextStyle(
color: MyColours.color_2bb5b7, fontSize: ScreenUtil().setSp(36)),
selectedTextStyle: TextStyle(
color: MyColours.color_199095, fontSize: ScreenUtil().setSp(32)),
textStyle: TextStyle(
color: MyColours.color_353535, fontSize: ScreenUtil().setSp(32)),
onConfirm: (Picker picker, List value) {
print(value.toString());
if (valueChanged != null) {
... ...
... ... @@ -84,18 +84,18 @@ class Utils {
//获取当前构建版本号
static Future<int> getCurrBuildNum() async {
PackageInfo packageInfo=await PackageInfo.fromPlatform();
PackageInfo packageInfo = await PackageInfo.fromPlatform();
return int.parse(packageInfo.buildNumber);
}
//获取唯一标识
static Future<String> getUUID() async {
DeviceInfoPlugin deviceInfoPlugin=DeviceInfoPlugin();
if(Platform.isAndroid){
AndroidDeviceInfo androidDeviceInfo=await deviceInfoPlugin.androidInfo;
DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
if (Platform.isAndroid) {
AndroidDeviceInfo androidDeviceInfo = await deviceInfoPlugin.androidInfo;
return androidDeviceInfo.androidId;
}else{
IosDeviceInfo iosDeviceInfo=await deviceInfoPlugin.iosInfo;
} else {
IosDeviceInfo iosDeviceInfo = await deviceInfoPlugin.iosInfo;
return iosDeviceInfo.identifierForVendor;
}
}
... ...
... ... @@ -16,7 +16,7 @@ class NewTableItem extends StatefulWidget {
NewTableItem(this.table,
{this.onSelected,
this.canSelected = false,
this.height = 183,
this.height = 180,
this.isRegionName = false});
@override
... ... @@ -45,7 +45,7 @@ class NewTableItemState extends State<NewTableItem> {
child: Stack(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(150),
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(widget.height),
margin: EdgeInsets.only(left:ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
... ... @@ -82,23 +82,27 @@ class NewTableItemState extends State<NewTableItem> {
),
),
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
VEmptyView(20),
VEmptyView(38),
Text(
table.name,
maxLines: 2,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(12),
Text(
(table.reserver == null || table.reserver.isEmpty)
? '${table.tablePnum}人'
... ... @@ -106,7 +110,7 @@ class NewTableItemState extends State<NewTableItem> {
style: TextStyle(
color: (table.reserver == null ||
table.reserver.isEmpty)
? MyColours.color_777777
? MyColours.color_353535
: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
... ... @@ -144,6 +148,7 @@ class NewTableItemState extends State<NewTableItem> {
ScreenUtil().setWidth(8)))),
child: Text(
table.regionName,
maxLines: 2,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24),
... ...
... ... @@ -19,7 +19,7 @@ class TableItem extends StatefulWidget {
TableItem(this.table,
{this.onSelected,
this.canSelected = false,
this.height = 183,
this.height = 180,
this.canChoose = false,
this.rid,
this.tableMap});
... ... @@ -77,11 +77,13 @@ class TableItemState extends State<TableItem> {
child: Stack(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(150),
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(widget.height),
margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: MyColours.color_a8e2e4,
color: table.signStr == '已停用'
? MyColours.color_E0E0E0
: MyColours.color_A9E3E6,
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(8)))),
child: Stack(
... ... @@ -114,38 +116,46 @@ class TableItemState extends State<TableItem> {
),
),
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
// margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
VEmptyView(20),
VEmptyView(38),
Text(
table.name,
maxLines: 2,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(30),
color: table.signStr == '已停用'
? MyColours.color_999999
: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(12),
Text(
(table.reserver == null || table.reserver.isEmpty)
? table.tableNum
: table.reserver,
style: TextStyle(
color: (table.reserver == null ||
table.reserver.isEmpty)
? MyColours.color_777777
: MyColours.color_2bb5b7,
color: table.signStr == '已停用'
? MyColours.color_999999
: (table.reserver == null ||
table.reserver.isEmpty)
? MyColours.color_353535
: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(6),
Text(
table.lowStr,
style: TextStyle(
... ... @@ -165,11 +175,13 @@ class TableItemState extends State<TableItem> {
child: table.signStr.isEmpty
? Container()
: Container(
width: ScreenUtil().setWidth(150),
height: ScreenUtil().setHeight(40),
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setHeight(36),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_89c0b7,
color: table.signStr == '已停用'
? MyColours.color_777777
: MyColours.color_E95750,
borderRadius: BorderRadius.only(
bottomLeft:
Radius.circular(ScreenUtil().setWidth(8)),
... ...