Commit 9ffa252ce06b136fdbbe514c34a3c881e827e1ac

Authored by gaiyaguang
2 parents 23810e6e 5bd34801

根据商家配置显示联系客户

1.2 KB | W: | H:

1.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.73 KB | W: | H:

1.93 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.58 KB | W: | H:

2.23 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.92 KB | W: | H:

2.17 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.22 KB | W: | H:

2.65 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.81 KB | W: | H:

1.11 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.92 KB | W: | H:

1.21 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
c8424a7225c7d158c8fb32a172a5bf4c
\ No newline at end of file
7babc7873f8d177769b987ba4c6c2911
\ No newline at end of file
... ...
... ... @@ -140,4 +140,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
... ...
... ... @@ -366,7 +366,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
CommonButton(
content: "安排包间",
width: 669,
height: 76,
height: 84,
fontSize: 34,
onPress: () async {
Map map = await NavigatorUtil
... ... @@ -385,12 +385,12 @@ class HandleOnlinePageState extends State<HandleOnlinePage> {
VEmptyView(20),
Container(
width: ScreenUtil().setWidth(669),
height: ScreenUtil().setHeight(76),
height: ScreenUtil().setWidth(84),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_199095),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(5)),
ScreenUtil().setWidth(10)),
),
child: Row(
crossAxisAlignment:
... ...
... ... @@ -400,7 +400,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
child: Container(
// color: Colors.red,
// height: ScreenUtil().setHeight(178),
height: ScreenUtil().setHeight(170),
height: ScreenUtil().setWidth(185),
child: ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext contxt, int index) {
... ... @@ -719,7 +719,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_6AB6B9,
width: ScreenUtil().setWidth(1)),
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_6AB6B9,
... ...
... ... @@ -35,7 +35,7 @@ class NotebookDetailPage extends StatefulWidget {
final String mid;
final bool fromNotify;
NotebookDetailPage(this.rid, {this.fromNotify=false, this.mid});
NotebookDetailPage(this.rid, {this.fromNotify = false, this.mid});
@override
State<StatefulWidget> createState() {
... ... @@ -94,16 +94,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
}
//设置消息状态
setMessageStatus(){
if(widget.mid==null||widget.mid.isEmpty)return;
setMessageStatus() {
if (widget.mid == null || widget.mid.isEmpty) return;
bus.emit("remove_untreated_message", widget.mid);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"id": widget.mid,
"status": "is_handle"
};
MessageDialogModel messageDialogModel=Provider.of<MessageDialogModel>(context,listen: false);
messageDialogModel.setMessageStatus(context,params);
MessageDialogModel messageDialogModel =
Provider.of<MessageDialogModel>(context, listen: false);
messageDialogModel.setMessageStatus(context, params);
}
@override
... ... @@ -126,7 +127,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
}
}
});
if(detailEntity.status == "4"){
if (detailEntity.status == "4") {
setMessageStatus();
}
}
... ... @@ -653,14 +654,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
top: BorderSide(
color: MyColours.color_dbe3e3,
width: ScreenUtil().setWidth(1)))),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setHeight(40),
ScreenUtil().setHeight(40),
ScreenUtil().setHeight(40),
ScreenUtil().setHeight(0)),
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(20)),
child: CommonButton(
content: "通知客户",
width: 669,
height: 80,
height: 84,
fontSize: 34,
onPress: () {
DialogUtil.showShareDialog(context)?.then((value) {
... ... @@ -699,7 +703,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
: false,
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(80),
height: ScreenUtil().setWidth(84),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
... ... @@ -707,29 +711,30 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
color: MyColours.color_199095,
width: ScreenUtil().setWidth(2)),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(5)),
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
// child: Text('fff'),
child: Material(
color: Colors.transparent,
child: Row(
children: [
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
NavigatorUtil.goNoteBookChangePage(
context, detailEntity, widget.rid);
}, '变更预订')),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
_showCancelWidget(context);
}, '取消预订')),
],
)),
children: [
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
NavigatorUtil.goNoteBookChangePage(
context, detailEntity, widget.rid);
}, '变更预订')),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
_showCancelWidget(context);
}, '取消预订')),
],
)),
),
),
VEmptyView(ScreenUtil().setWidth(60))
... ...
... ... @@ -41,8 +41,8 @@ class HomePage extends StatefulWidget {
class HomePageState extends State<HomePage> with WidgetsBindingObserver {
List<Widget> pages = List<Widget>();
int _currIndex = 1;
Color _activeColor = MyColours.color_2bb5b7;
Color _defaultColor = MyColours.color_bfbfbf;
Color _activeColor = MyColours.color_199095;
Color _defaultColor = MyColours.color_999999;
Timer timer;
... ... @@ -58,19 +58,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
pages
..add(ChangeNotifierProvider<MessageModel>(
create: (_) => MessageModel(),
child: MessagePage(),
child: SafeArea(child: MessagePage()),
))
..add(ChangeNotifierProvider<NoteBookModel>(
create: (_) => NoteBookModel(),
child: NoteBookPage(),
child: SafeArea(child: NoteBookPage()),
))
..add(ChangeNotifierProvider<MyModel>(
create: (_) => MyModel(),
child: MyPage(),
));
WidgetsBinding.instance.addPostFrameCallback((_){
WidgetsBinding.instance.addPostFrameCallback((_) {
initPlatformState();
if(widget.initialIndex==0)return;
if (widget.initialIndex == 0) return;
_getIntent();
Future.delayed(Duration(milliseconds: 30000), () {
ContactModel.getInstance().uploadLocalContact(context);
... ... @@ -86,9 +86,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
//获取点击通知栏的自定义参数
_getIntent() async {
Map param = await Tools().getIntent();
Map notifyParam=param;
if(Platform.isIOS&&param!=null){
notifyParam=json.decode(param['custom'].toString());
Map notifyParam = param;
if (Platform.isIOS && param != null) {
notifyParam = json.decode(param['custom'].toString());
}
LogUtil.v(param.toString());
if (notifyParam != null && notifyParam.isNotEmpty) {
... ... @@ -99,11 +99,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
fromNotify: true);
break;
case "11":
NavigatorUtil.goNotebookDetailPage(context, notifyParam['rid'],mid:notifyParam['mid'],
fromNotify: true);
NavigatorUtil.goNotebookDetailPage(context, notifyParam['rid'],
mid: notifyParam['mid'], fromNotify: true);
break;
}
}else{
} else {
getUntreatedMessage();
}
}
... ... @@ -148,6 +148,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
},
xgPushDidSetBadge: (String msg) async {
print("flutter xgPushDidSetBadge: $msg");
/// 在此可设置应用角标
XgFlutterPlugin().setAppBadge(0);
},
... ... @@ -164,9 +165,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
print("flutter xgPushDidClearAllIdentifiers: $msg");
},
xgPushClickAction: (Map<String, dynamic> msg) async {
if(Platform.isIOS&&msg!=null&&msg['custom']!=null){
Map custom=json.decode(msg['custom'].toString());
switch(custom["messageType"].toString()){
if (Platform.isIOS && msg != null && msg['custom'] != null) {
Map custom = json.decode(msg['custom'].toString());
switch (custom["messageType"].toString()) {
case "10":
NavigatorUtil.goHandleOnlinePage(
context, custom["rid"].toString(), custom['mid'].toString(),
... ... @@ -174,8 +175,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
break;
case "11":
NavigatorUtil.goNotebookDetailPage(
context, custom['rid'].toString(),mid:custom['mid'].toString(),
fromNotify: true);
context, custom['rid'].toString(),
mid: custom['mid'].toString(), fromNotify: true);
break;
}
}
... ... @@ -253,7 +254,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
print('inactive');
break;
case AppLifecycleState.paused:
print('paused');
print('paused');
break;
case AppLifecycleState.detached:
print('detached');
... ... @@ -287,7 +288,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// TODO: implement build
return new Scaffold(
bottomNavigationBar: BottomNavigationBar(
iconSize: ScreenUtil().setWidth(70),
iconSize: ScreenUtil().setWidth(48),
unselectedFontSize: ScreenUtil().setSp(22),
selectedFontSize: ScreenUtil().setSp(22),
backgroundColor: MyColours.color_ffffff,
... ... @@ -295,13 +296,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/message_default.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/message_selected.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"消息中心",
... ... @@ -313,16 +314,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/notebook_default.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/notebook_selected.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"预定本",
"已预订",
style: TextStyle(
color: _currIndex == 1 ? _activeColor : _defaultColor,
fontSize: ScreenUtil().setSp(22)),
... ... @@ -331,13 +332,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
BottomNavigationBarItem(
icon: Image(
image: AssetImage("assets/my_default.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
activeIcon: Image(
image: AssetImage("assets/my_selected.png"),
width: ScreenUtil().setWidth(70),
height: ScreenUtil().setWidth(70),
width: ScreenUtil().setWidth(48),
height: ScreenUtil().setWidth(48),
),
title: Text(
"我的",
... ... @@ -355,14 +356,87 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
_currIndex = index;
});
if (_currIndex == 2) {
Utils.changeStatusColor(color: MyColours.color_2bb5b7);
Utils.changeStatusColor(color: MyColours.color_199095);
} else {
Utils.changeStatusColor(color: MyColours.color_ffffff);
}
}
},
),
body: SafeArea(child: pages[_currIndex]),
// bottomNavigationBar: BottomAppBar(
// shape: CircularNotchedRectangle(),
// child: Container(
// height: ScreenUtil().setWidth(98),
// // padding: EdgeInsets.fromLTRB(0, 12, 0, 8),
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// GestureDetector(
// onTap: () {
// // onTap(0);
// },
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Image(
// image: AssetImage("assets/my_selected.png"),
// width: ScreenUtil().setWidth(44),
// height: ScreenUtil().setWidth(44),
// ),
// Text(
// "我的",
// style: TextStyle(
// color: _currIndex == 2
// ? _activeColor
// : _defaultColor,
// fontSize: ScreenUtil().setSp(22)),
// )
// ],
// )),
// GestureDetector(
// onTap: () {
// // onTap(1);
// },
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Image(
// image: AssetImage("assets/my_selected.png"),
// width: ScreenUtil().setWidth(44),
// height: ScreenUtil().setWidth(44),
// ),
// Text(
// "我的",
// style: TextStyle(
// color: _currIndex == 2
// ? _activeColor
// : _defaultColor,
// fontSize: ScreenUtil().setSp(22)),
// )
// ],
// )),
// Column(
// mainAxisSize: MainAxisSize.min,
// children: <Widget>[
// Image(
// image: AssetImage("assets/my_selected.png"),
// width: ScreenUtil().setWidth(44),
// height: ScreenUtil().setWidth(44),
// ),
// Text(
// "我的",
// style: TextStyle(
// color:
// _currIndex == 2 ? _activeColor : _defaultColor,
// fontSize: ScreenUtil().setSp(22)),
// )
// ],
// )
// ])),
// ),
body: pages[_currIndex],
);
}
... ...
... ... @@ -37,11 +37,11 @@ class MessagePageState extends State<MessagePage>{
Tab(text: "未处理",),
Tab(text: "已处理",)
],
indicatorColor: MyColours.color_2bb5b7,
indicatorColor: MyColours.color_199095,
indicatorSize: TabBarIndicatorSize.label,
indicatorWeight: ScreenUtil().setHeight(4.0),
labelColor: MyColours.color_2bb5b7,
unselectedLabelColor: MyColours.color_353535,
labelColor: MyColours.color_199095,
unselectedLabelColor: MyColours.color_999999,
labelStyle: TextStyle(fontSize: ScreenUtil().setSp(32),fontWeight: FontWeight.bold),
),
),
... ... @@ -61,4 +61,4 @@ class MessagePageState extends State<MessagePage>{
),
);
}
}
\ No newline at end of file
}
... ...
... ... @@ -108,9 +108,9 @@ class MessageItem extends StatelessWidget {
child:Offstage(
offstage: isTreated?true:false,
child: CommonButton(
width: 160,
height: 48,
fontSize: 28,
width: 152,
height: 50,
fontSize: 30,
content:message.message_type=="10"?"立即处理":"立即查看",
state: 1,
onPress: () {
... ...
... ... @@ -11,7 +11,7 @@ import 'package:one_key/widgets/my_item.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class MyPage extends StatefulWidget{
class MyPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
// TODO: implement createState
... ... @@ -19,121 +19,359 @@ class MyPage extends StatefulWidget{
}
}
class MyPageState extends State<MyPage>{
String cur_version="";
bool newVersion=false;
class MyPageState extends State<MyPage> {
String cur_version = "";
bool newVersion = false;
@override
void initState() {
// TODO: implement initState
super.initState();
Utils.getCurrVersion().then((version){
Utils.getCurrVersion().then((version) {
setState(() {
cur_version="v"+version;
cur_version = "v" + version;
});
});
}
//检查版本更新
checkUpdate(){
UpdateModel updateModel=new UpdateModel();
checkUpdate() {
UpdateModel updateModel = new UpdateModel();
updateModel.checkUpdate(context);
}
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(242 + 121)),
child: Column(
children: <Widget>[
VEmptyView(44),
MyItem(
title: "联系客服",
content: "09:00~21:00",
callback: () {
Utils.goPhone("400-000-9690");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "帮助与反馈",
content: "",
callback: () {
Utils.goHelp(context);
},
),
MyDivider(double.infinity, ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3),
GestureDetector(
onTap: checkUpdate,
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Row(
children: <Widget>[
Text(
"版本更新",
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
Spacer(),
newVersion
? Container(
width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil().setWidth(6))),
),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
),
)
: Text(
cur_version,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_666666),
),
HEmptyView(20),
Image.asset(
"assets/arr_right_gray.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
),
),
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
VEmptyView(40),
Consumer<UserModel>(
builder:
(BuildContext context, UserModel model, Widget child) {
return GestureDetector(
onTap: () {
model.showLoginOutDialog(context);
},
child: Container(
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/icon_exist.png",
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
HEmptyView(18),
Text("退出登录",
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(34),
))
],
),
),
),
);
},
)
],
)),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(242 + 121),
alignment: Alignment.centerLeft,
color: MyColours.color_199095,
child: Scaffold(
backgroundColor: Colors.transparent, //把scaffold的背景色改成透明
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),
)),
body: Consumer<UserModel>(
builder:
(BuildContext context, UserModel model, Widget child) {
return Padding(
padding:
EdgeInsets.only(left: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
VEmptyView(38),
Text(
model.user.sellername,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36)),
),
VEmptyView(38),
Text(
model.user.account +
" | " +
model.user.role_name,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(30)),
),
],
));
},
)))
],
);
// TODO: implement build
/* 原来的
return Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_f5f5f5,
child: Column(
children: <Widget>[
MyAppBar("我的",showBack: false,backgroundColor: MyColours.color_2bb5b7,fontColor: MyColours.color_fefefe,),
MyAppBar(
"我的",
showBack: false,
backgroundColor: MyColours.color_199095,
fontColor: MyColours.color_fefefe,
),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(242),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
color: MyColours.color_2bb5b7,
child: Consumer<UserModel>(builder: (BuildContext context,UserModel model,Widget child){
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
VEmptyView(38),
Text(model.user.sellername,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(36)),),
VEmptyView(38),
Text(model.user.account+" | "+model.user.role_name,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(30)),),
],
);
},)
),
width: double.infinity,
height: ScreenUtil().setHeight(242),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
color: MyColours.color_199095,
child: Consumer<UserModel>(
builder: (BuildContext context, UserModel model, Widget child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
VEmptyView(38),
Text(
model.user.sellername,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36)),
),
VEmptyView(38),
Text(
model.user.account + " | " + model.user.role_name,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(30)),
),
],
);
},
)),
VEmptyView(44),
MyItem(title:"联系客服",content:"09:00~21:00",callback: (){
Utils.goPhone("400-000-9690");
},),
MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3,),
MyItem(title:"帮助与反馈",content:"",callback: (){
Utils.goHelp(context);
},),
MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3),
MyItem(
title: "联系客服",
content: "09:00~21:00",
callback: () {
Utils.goPhone("400-000-9690");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "帮助与反馈",
content: "",
callback: () {
Utils.goHelp(context);
},
),
MyDivider(double.infinity, ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3),
GestureDetector(
onTap: checkUpdate,
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Row(
children: <Widget>[
Text("版本更新",style: TextStyle(fontSize: ScreenUtil().setSp(30),color: MyColours.color_353535),),
Text(
"版本更新",
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
Spacer(),
newVersion?Container(
width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(6))),
),
child: Center(
child: Text("发现新版本",style: TextStyle(fontSize: ScreenUtil().setSp(24),color: MyColours.color_ffffff),),
),
):
Text(cur_version,style: TextStyle(fontSize: ScreenUtil().setSp(28),color: MyColours.color_666666),),
newVersion
? Container(
width: ScreenUtil().setWidth(120),
height: ScreenUtil().setWidth(34),
decoration: BoxDecoration(
color: MyColours.color_E14553,
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(6))),
),
child: Center(
child: Text(
"发现新版本",
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff),
),
),
)
: Text(
cur_version,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_666666),
),
HEmptyView(20),
Image.asset("assets/arr_right_gray.png",width: ScreenUtil().setWidth(14),height: ScreenUtil().setWidth(22),)
Image.asset(
"assets/arr_right_gray.png",
width: ScreenUtil().setWidth(14),
height: ScreenUtil().setWidth(22),
)
],
),
),
),
MyDivider(double.infinity,ScreenUtil().setHeight(1),color: MyColours.color_f3f3f3,),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
VEmptyView(40),
Consumer<UserModel>(builder: (BuildContext context,UserModel model,Widget child){
return GestureDetector(
onTap: (){
model.showLoginOutDialog(context);
},
child: Container(
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset("assets/icon_exist.png",width: ScreenUtil().setWidth(30),height: ScreenUtil().setWidth(30),),
HEmptyView(18),
Text("退出登录",style: TextStyle(color: MyColours.color_2bb5b7,fontSize: ScreenUtil().setSp(34),))
],
Consumer<UserModel>(
builder: (BuildContext context, UserModel model, Widget child) {
return GestureDetector(
onTap: () {
model.showLoginOutDialog(context);
},
child: Container(
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/icon_exist.png",
width: ScreenUtil().setWidth(30),
height: ScreenUtil().setWidth(30),
),
HEmptyView(18),
Text("退出登录",
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(34),
))
],
),
),
),
),
);
},)
);
},
)
],
),
);
*/
}
}
\ No newline at end of file
}
... ...
... ... @@ -44,7 +44,7 @@ class NotebookItemState extends State<NoteBookItem> {
return Container(
width: double.infinity,
height: ScreenUtil().setHeight(110),
height: ScreenUtil().setWidth(120),
color: (widget.index % 2 == 0)
? MyColours.color_f7fdfd
: MyColours.color_ffffff,
... ... @@ -61,9 +61,11 @@ class NotebookItemState extends State<NoteBookItem> {
width: ScreenUtil().setWidth(171),
alignment: Alignment.center,
child: Text(
notebook.tableinfoStr,
notebook.tableinfoStr?.trim(),
style: TextStyle(
color: textColor, fontSize: ScreenUtil().setSp(28)),
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
MyDivider(
... ... @@ -80,13 +82,17 @@ class NotebookItemState extends State<NoteBookItem> {
Text(
notebook.rnameStr,
style: TextStyle(
color: textColor, fontSize: ScreenUtil().setSp(28)),
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
VEmptyView(10),
Text(
notebook.phoneStr,
style: TextStyle(
color: textColor, fontSize: ScreenUtil().setSp(22)),
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(26)),
)
],
),
... ... @@ -102,7 +108,9 @@ class NotebookItemState extends State<NoteBookItem> {
child: Text(
notebook.ddateStr,
style: TextStyle(
color: textColor, fontSize: ScreenUtil().setSp(28)),
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
],
... ... @@ -126,7 +134,8 @@ class NotebookItemState extends State<NoteBookItem> {
notebook.status == "6")
? MyColours.color_bfbfbf
: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(28)),
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
),
... ...
... ... @@ -67,8 +67,9 @@ class NoteBookPageState extends State<NoteBookPage> {
_initTime() {
dateTime = DateTime.now();
dateText = Utils.addZeroNumber(dateTime.month) +
"-" +
"月" +
Utils.addZeroNumber(dateTime.day) +
"日" +
" 今天";
morning =
userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
... ... @@ -195,7 +196,7 @@ class NoteBookPageState extends State<NoteBookPage> {
"桌号",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
fontSize: ScreenUtil().setSp(28)),
),
),
MyDivider(
... ... @@ -210,7 +211,7 @@ class NoteBookPageState extends State<NoteBookPage> {
"用户姓名",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
fontSize: ScreenUtil().setSp(28)),
),
),
MyDivider(
... ... @@ -225,7 +226,7 @@ class NoteBookPageState extends State<NoteBookPage> {
"时间",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
fontSize: ScreenUtil().setSp(28)),
),
),
MyDivider(
... ... @@ -240,7 +241,7 @@ class NoteBookPageState extends State<NoteBookPage> {
"操作",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
fontSize: ScreenUtil().setSp(28)),
),
),
],
... ... @@ -253,8 +254,10 @@ class NoteBookPageState extends State<NoteBookPage> {
if (Utils.isOneDay(day, dateTime)) return; //日期没变
setState(() {
DateTime dateNow = DateTime.now();
dateText =
Utils.addZeroNumber(day.month) + "-" + Utils.addZeroNumber(day.day);
dateText = Utils.addZeroNumber(day.month) +
"月" +
Utils.addZeroNumber(day.day) +
"日";
if (Utils.isOneDay(day, dateNow)) {
dateText += " 今天";
} else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
... ... @@ -286,7 +289,7 @@ class NoteBookPageState extends State<NoteBookPage> {
Container(
color: MyColours.color_ffffff,
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(11)),
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(16)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
... ... @@ -301,84 +304,90 @@ class NoteBookPageState extends State<NoteBookPage> {
}
});
},
child: Text(
dateText,
style: TextStyle(
color: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(32)),
child: Container(
child: Text(
dateText,
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(34)),
),
),
),
),
),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setHeight(72),
color: MyColours.color_ededed,
ScreenUtil().setHeight(68),
color: MyColours.color_E0E0E0,
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Offstage(
offstage: morning == "00:00-00:00" ? true : false,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
child: CommonButton(
content: "早市",
state: currTimeIndex == 1 ? 1 : 0,
width: ScreenUtil().setWidth(180),
height: ScreenUtil().setHeight(100),
fontSize: 32,
onPress: () {
if (currTimeIndex == 1) return;
setState(() {
currTimeIndex = 1;
});
_getReserveList();
},
))),
Offstage(
offstage: noon == "00:00-00:00" ? true : false,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Offstage(
offstage: morning == "00:00-00:00" ? true : false,
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(18)),
child: CommonButton(
content: "早市",
state: currTimeIndex == 1 ? 1 : 0,
width: 92,
height: 48,
fontSize: 32,
onPress: () {
if (currTimeIndex == 1) return;
setState(() {
currTimeIndex = 1;
});
_getReserveList();
},
))),
Offstage(
offstage: noon == "00:00-00:00" ? true : false,
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(18)),
child: CommonButton(
content: "午市",
state: currTimeIndex == 2 ? 1 : 0,
width: 92,
height: 48,
fontSize: 32,
onPress: () {
if (currTimeIndex == 2) return;
setState(() {
currTimeIndex = 2;
});
_getReserveList();
},
))),
Offstage(
offstage: night == "00:00-00:00" ? true : false,
child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(10)),
child: CommonButton(
content: "午市",
state: currTimeIndex == 2 ? 1 : 0,
width: ScreenUtil().setWidth(180),
height: ScreenUtil().setHeight(100),
fontSize: 32,
onPress: () {
if (currTimeIndex == 2) return;
setState(() {
currTimeIndex = 2;
});
_getReserveList();
},
))),
Offstage(
offstage: night == "00:00-00:00" ? true : false,
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(10)),
child: CommonButton(
content: "晚市",
state: currTimeIndex == 3 ? 1 : 0,
width: ScreenUtil().setWidth(180),
height: ScreenUtil().setHeight(100),
fontSize: 32,
onPress: () {
if (currTimeIndex == 3) return;
setState(() {
currTimeIndex = 3;
});
_getReserveList();
},
)),
),
],
content: "晚市",
state: currTimeIndex == 3 ? 1 : 0,
width: 92,
height: 48,
fontSize: 32,
onPress: () {
if (currTimeIndex == 3) return;
setState(() {
currTimeIndex = 3;
});
_getReserveList();
},
)),
),
],
),
),
)
],
... ... @@ -396,8 +405,8 @@ class NoteBookPageState extends State<NoteBookPage> {
child: Text(
total,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(24)),
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(26)),
),
);
},
... ...
... ... @@ -98,7 +98,7 @@ class SmsPageState extends State<SmsPage>{
children: <Widget>[
CommonButton(
width: 672,
height: 76,
height: 84,
fontSize: 34,
content: "直接发送",
state: 1,
... ... @@ -109,7 +109,7 @@ class SmsPageState extends State<SmsPage>{
VEmptyView(20),
CommonButton(
width: 672,
height: 76,
height: 84,
fontSize: 34,
content: "复制短信",
state: 0,
... ... @@ -127,4 +127,4 @@ class SmsPageState extends State<SmsPage>{
);
}
}
\ No newline at end of file
}
... ...
... ... @@ -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: 76,
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);
}
}
},
))
],
),
);
... ...
... ... @@ -43,4 +43,7 @@ class MyColours {
static const Color color_F1F0F4 = Color(0xffF1F0F4);
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) {
... ...
... ... @@ -89,18 +89,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;
}
}
... ...
... ... @@ -9,15 +9,16 @@ class CommonButton extends StatelessWidget {
final double height;
final double fontSize;
final int state; //-1 不可用 0 默认 1 选中
final FontWeight fontWeight;
CommonButton({
@required this.onPress,
@required this.content,
this.state = 0,
this.width = 250,
this.height = 50,
this.fontSize = 18,
});
CommonButton(
{@required this.onPress,
@required this.content,
this.state = 0,
this.width = 250,
this.height = 50,
this.fontSize = 18,
this.fontWeight = FontWeight.normal});
@override
Widget build(BuildContext context) {
... ... @@ -27,7 +28,7 @@ class CommonButton extends StatelessWidget {
case -1:
boxDecoration = BoxDecoration(
color: MyColours.color_d8d8d8,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_ffffff;
break;
... ... @@ -35,38 +36,39 @@ class CommonButton extends StatelessWidget {
boxDecoration = BoxDecoration(
border: Border.all(
color: MyColours.color_199095, width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_199095;
break;
case 1:
boxDecoration = BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xff199095), Color(0xff36C3C7)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
color: MyColours.color_199095,
// gradient: LinearGradient(
// colors: [Color(0xff199095), Color(0xff36C3C7)],
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_fefefe;
break;
case 2:
boxDecoration = BoxDecoration(
color: MyColours.color_199095,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_fefefe;
break;
case -2:
boxDecoration = BoxDecoration(
color: MyColours.color_74BBBE,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_fefefe;
break;
default:
boxDecoration = BoxDecoration(
border: Border.all(color: MyColours.color_199095),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(5)),
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
);
fontColor = MyColours.color_fefefe;
break;
... ... @@ -78,14 +80,16 @@ class CommonButton extends StatelessWidget {
onTap: onPress,
child: Container(
width: ScreenUtil().setWidth(width),
height: ScreenUtil().setHeight(height),
height: ScreenUtil().setWidth(height),
decoration: boxDecoration,
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color: fontColor, fontSize: ScreenUtil().setSp(fontSize)),
color: fontColor,
fontWeight: fontWeight,
fontSize: ScreenUtil().setSp(fontSize)),
),
),
),
... ...
... ... @@ -5,15 +5,15 @@ import 'package:one_key/res/colors.dart';
import 'package:one_key/models/table.dart' as t;
import 'package:one_key/widgets/v_empty_view.dart';
class NeedItem extends StatefulWidget{
class NeedItem extends StatefulWidget {
final t.Table table;
final bool canSelected;//是否能选中
final bool canSelected; //是否能选中
final ValueChanged onSelected;
final int height;//高度
final int height; //高度
NeedItem(this.table,{this.onSelected,this.canSelected=false,this.height=183});
NeedItem(this.table,
{this.onSelected, this.canSelected = false, this.height = 183});
@override
State<StatefulWidget> createState() {
... ... @@ -22,19 +22,18 @@ class NeedItem extends StatefulWidget{
}
}
class NeedItemState extends State<NeedItem>{
class NeedItemState extends State<NeedItem> {
@override
Widget build(BuildContext context) {
// TODO: implement build
t.Table table=widget.table;
t.Table table = widget.table;
return GestureDetector(
onTap: (){
if(widget.canSelected&&table.signStr.isEmpty){
onTap: () {
if (widget.canSelected && table.signStr.isEmpty) {
setState(() {
table.selected=!(table.selected??false);
table.selected = !(table.selected ?? false);
});
widget.onSelected(table);
}
... ... @@ -42,44 +41,68 @@ class NeedItemState extends State<NeedItem>{
child: Stack(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(190),
height: ScreenUtil().setWidth(widget.height),
alignment: Alignment.center,
margin:EdgeInsets.all( ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: MyColours.color_a8e2e4,
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(8)))
),
child:Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(table.name,style: TextStyle(color: MyColours.color_131313,fontSize: ScreenUtil().setSp(30),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,),
Offstage(
offstage: table.maxText.isEmpty?true:false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(5),
Text(table.maxText,style: TextStyle(color: MyColours.color_777777,fontSize: ScreenUtil().setSp(26),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,),
],
width: ScreenUtil().setWidth(190),
height: ScreenUtil().setWidth(widget.height),
alignment: Alignment.center,
margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
decoration: BoxDecoration(
color: MyColours.color_a8e2e4,
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(8)))),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
table.name,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(30),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
),
Offstage(
offstage: table.lowStr.isEmpty?true:false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(5),
Text(table.lowStr,style: TextStyle(color: MyColours.color_2bb5b7,fontSize: ScreenUtil().setSp(24),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,)
],
Offstage(
offstage: table.maxText.isEmpty ? true : false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(5),
Text(
table.maxText,
style: TextStyle(
color: MyColours.color_777777,
fontSize: ScreenUtil().setSp(26),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
],
),
),
)
],
)
),
Offstage(
offstage: table.lowStr.isEmpty ? true : false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(5),
Text(
table.lowStr,
textAlign: TextAlign.center,
style: TextStyle(
color: MyColours.color_2bb5b7,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
)
],
),
)
],
)),
],
),
);
}
}
\ No newline at end of file
}
... ...
... ... @@ -16,7 +16,7 @@ class NewTableItem extends StatefulWidget {
NewTableItem(this.table,
{this.onSelected,
this.canSelected = false,
this.height = 183,
this.height = 185,
this.isRegionName = false});
@override
... ... @@ -45,9 +45,9 @@ 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)),
margin: EdgeInsets.only(left: ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: MyColours.color_a8e2e4,
borderRadius: BorderRadius.all(
... ... @@ -82,23 +82,49 @@ 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(20)),
// 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),
Text(
table.name,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(30),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(38),
Container(
alignment: Alignment.center,
child: Transform.translate(
offset:
Offset(0, 1 / 2), //1为 StrutStyle 的 leading的值
child: Text(
table.name,
maxLines: 2,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(28),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(
forceStrutHeight: true,
height: 1,
leading: 0.2),
),
)
),
// Text(
// table.name,
// maxLines: 2,
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(28),
// decoration: TextDecoration.none,
// fontWeight: FontWeight.normal),
// overflow: TextOverflow.ellipsis,
// ),
VEmptyView(6),
Text(
(table.reserver == null || table.reserver.isEmpty)
? '${table.tablePnum}人'
... ... @@ -106,14 +132,14 @@ 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,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(6),
Text(
table.lowStr,
style: TextStyle(
... ... @@ -144,6 +170,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 = 185,
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,70 @@ 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(20)),
// 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),
Text(
table.name,
style: TextStyle(
color: MyColours.color_131313,
fontSize: ScreenUtil().setSp(30),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
),
VEmptyView(5),
VEmptyView(38),
Container(
alignment: Alignment.center,
child: Transform.translate(
offset:
Offset(0, 1 / 2), //1为 StrutStyle 的 leading的值
child: Text(
table.name,
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,
strutStyle: StrutStyle(
forceStrutHeight: true,
height: 1,
leading: 0.2),
),
)
// 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,
// ),
),
VEmptyView(6),
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 +199,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)),
... ...