Commit 718ad81f91801abd8f3a305ce75d564142e2a294

Authored by “gaiyaguang”
1 parent 665052e5

推

83b3ddec6f4d9a6ed2f11de1a0a1915e
\ No newline at end of file
7babc7873f8d177769b987ba4c6c2911
\ No newline at end of file
... ...
///桌位区域
class SetTime {
String start;
String end;
SetTime();
factory SetTime.fromJson(Map<String, dynamic> json) => SetTime()
..start = json["start"]
..end = json["end"];
Map<String, dynamic> toJson() =>
<String, dynamic>{"start": start, "end": end};
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/models/settime.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/app_bar.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
typedef BookTimeSetCallback = void Function(bool needChange);
class BookTimeSetPage extends StatefulWidget {
BookTimeSetPage({Key key}) : super(key: key);
@override
_BookTimeSetPageState createState() => _BookTimeSetPageState();
}
class _BookTimeSetPageState extends State<BookTimeSetPage> {
List swichState;
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
List dateData;
SetTime morning = SetTime();
SetTime noon = SetTime();
SetTime night = SetTime();
@override
void initState() {
super.initState();
morning.start = '07:00';
morning.end = '10:00';
noon.start = '11:00';
noon.end = '14:30';
night.start = '16:00';
night.end = '21:00';
swichState = [
{
'on': false,
},
{
'on': true,
},
{
'on': true,
}
];
dateData = [
{
'深夜00时': [00, 30]
},
{
'深夜01时': [00, 30]
},
{
'深夜02时': [00, 30]
},
{
'深夜03时': [00, 30]
},
{
'深夜04时': [00, 30]
},
{
'深夜05时': [00, 30]
},
{
'早上06时': [00, 30]
},
{
'早上07时': [00, 30]
},
{
'早上08时': [00, 30]
},
{
'早上09时': [00, 30]
},
{
'中午10时': [00, 30]
},
{
'中午11时': [00, 30]
},
{
'中午12时': [00, 30]
},
{
'中午13时': [00, 30]
},
{
'中午14时': [00, 30]
},
{
'下午15时': [00, 30]
},
{
'下午16时': [00, 30]
},
{
'下午17时': [00, 30]
},
{
'下午18时': [00, 30]
},
{
'晚上19时': [00, 30]
},
{
'晚上20时': [00, 30]
},
{
'晚上21时': [00, 30]
},
{
'晚上22时': [00, 30]
},
{
'晚上23时': [00, 30]
}
];
}
///item
Widget _itemWidget(String title, String startTime, String endTime, int tag) {
return Container(
color: MyColours.color_ffffff,
child: Column(
children: [
Padding(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: Container(
height: ScreenUtil().setWidth(124),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(title,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold)),
InkWell(
onTap: () {
setState(() {
swichState[tag]["on"] = !swichState[tag]["on"];
});
},
child: Image.asset(
swichState[tag]["on"]
? Utils.getImgPath('swich_on')
: Utils.getImgPath('swich_off'),
width: ScreenUtil().setWidth(122),
height: ScreenUtil().setWidth(82),
),
)
],
),
)),
MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3,
),
_timeWidget('开始时间', startTime, highted: swichState[tag]["on"],
onTap: () {
if (swichState[tag]["on"]) {
List data = dateData;
if (tag == 0) {
//早市
data = dateData;
} else if (tag == 1) {
//午市
data = _getPickerData(morning.end);
} else if (tag == 2) {
//晚市
data = _getPickerData(noon.end);
}
DialogUtil.showSelectCusmanDialog(context, data, (value) {
if (value != null) {
String temp;
if (value[1] == 0) {
temp = '00';
} else {
temp = '30';
}
print(data[value[0]].keys.first);
String time = _getTimeString(
_getHourFromTitle(data[value[0]].keys.first), temp);
setState(() {
if (tag == 0) {
//早市
morning.start = time;
} else if (tag == 1) {
//午市
noon.start = time;
} else if (tag == 2) {
//晚市
night.start = time;
}
});
print(value);
_compare(time);
}
}, selecteds: [
_getFirSelected(startTime, data),
_getSecSelected(startTime)
]).then((value) {
print(value);
});
}
}),
Padding(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3,
)),
_timeWidget('结束时间', endTime, highted: swichState[tag]["on"],
onTap: () {
if (swichState[tag]["on"]) {
List data = dateData;
if (tag == 0) {
//早市
data = _getPickerData(morning.start);
} else if (tag == 1) {
//午市
data = _getPickerData(noon.start);
} else if (tag == 2) {
//晚市
data = _getPickerData(night.start);
}
DialogUtil.showSelectCusmanDialog(context, data, (value) {
if (value != null) {
String temp;
if (value[1] == 0) {
temp = '00';
} else {
temp = '30';
}
String time = _getTimeString(
_getHourFromTitle(data[value[0]].keys.first), temp);
setState(() {
if (tag == 0) {
//早市
morning.end = time;
} else if (tag == 1) {
//午市
noon.end = time;
} else if (tag == 2) {
//晚市
night.end = time;
}
});
print(value);
_compare(time);
}
}, selecteds: [
_getFirSelected(endTime, data),
_getSecSelected(endTime)
]).then((value) {
print(value);
});
}
})
],
));
}
/// 开始时间和结束时间widget
_timeWidget(String title, String time,
{bool highted = true, GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
child: Container(
height: ScreenUtil().setWidth(124),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(title,
style: TextStyle(
color: highted
? MyColours.color_353535
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
)),
Spacer(),
Text(time,
style: TextStyle(
color: highted
? MyColours.color_353535
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
)),
HEmptyView(20),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(16),
height: ScreenUtil().setWidth(28),
)
],
),
)));
}
///工具
/// 组装成07:00
_getTimeString(dynamic hour, String minute) {
return '${hour}:${minute}';
}
/// 从07:00中获取07
_getHourFromhourAndMinute(String hourAndMinute) {
return hourAndMinute.substring(0, 2);
}
///从深夜00时中获取00
_getHourFromTitle(String title) {
return title.substring(2, 4);
}
// 第一列当前选中第几个
_getFirSelected(String hourAndMinute, List data) {
String hour = _getHourFromhourAndMinute(hourAndMinute);
for (int i = 0; i < data.length; i++) {
Map map = data[i];
String key = map.keys.first;
if (key.contains(hour)) {
return i;
}
}
return 0;
}
// 第二列当前选中第几个
_getSecSelected(String hourAndMinute) {
String minute = _getMinuteFromhourAndMinute(hourAndMinute);
if (minute == '00') {
return 0;
}
return 1;
}
/// 0 还是 30
/// 从07:00中获取0 或者 30
_getMinuteFromhourAndMinute(String hourAndMinute) {
return hourAndMinute.substring(3, 5);
}
///获取选择器数据
_getPickerData(String lastTime) {
String hour = _getHourFromhourAndMinute(lastTime);
String minute = _getMinuteFromhourAndMinute(lastTime);
if (minute == '30') {
hour = '${int.parse(hour) + 1}';
}
List tempList = List();
tempList.addAll(dateData);
tempList.removeRange(0, int.parse(hour));
return tempList;
}
///判断时间大小
/// a > b
_compareDateTime(String a, String b, BookTimeSetCallback callback) {
String tempa = '${DateUtil.getNowDateStr().substring(0, 10)} ${a}:00';
String tempb = '${DateUtil.getNowDateStr().substring(0, 10)} ${b}:00';
int aMs = DateUtil.getDateMsByTimeStr(tempa);
int bMs = DateUtil.getDateMsByTimeStr(tempb);
if (aMs < bMs) {
a = b;
callback(true);
} else {
callback(false);
}
}
_compare(String time) {
setState(() {
_compareDateTime(morning.start, time, (needChange) {
if (needChange) {
morning.start = time;
}
});
_compareDateTime(morning.end, time, (needChange) {
if (needChange) {
morning.end = time;
}
});
_compareDateTime(noon.start, time, (needChange) {
if (needChange) {
noon.start = time;
}
});
_compareDateTime(noon.end, time, (needChange) {
if (needChange) {
noon.end = time;
}
});
_compareDateTime(night.start, time, (needChange) {
if (needChange) {
night.start = time;
}
});
_compareDateTime(night.end, time, (needChange) {
if (needChange) {
night.end = time;
}
});
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
key: _scaffoldKey,
body: SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
MyAppBar(
"可订时段",
showBack: true,
),
_itemWidget('早市', morning.start, morning.end, 0),
VEmptyView(20),
_itemWidget('午市', noon.start, noon.end, 1),
VEmptyView(20),
_itemWidget('晚市', night.start, night.end, 2),
],
),
)),
);
}
}
... ...
... ... @@ -6,6 +6,7 @@ import 'package:one_key/provider/my_model.dart';
import 'package:one_key/provider/update_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/app_bar.dart';
... ... @@ -28,11 +29,13 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
String cur_version = "";
bool newVersion = false;
MyModel myModel;
ScrollController controller;
@override
void initState() {
// TODO: implement initState
super.initState();
controller = ScrollController(initialScrollOffset: 0.0);
WidgetsBinding.instance.addObserver(this);
Utils.getCurrVersion().then((version) {
setState(() {
... ... @@ -87,357 +90,240 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
myModel = Provider.of<MyModel>(context, listen: true);
return Stack(
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(242 + 121)),
child: Column(
children: <Widget>[
VEmptyView(40),
MyItem(
title: "短信管理",
content:
myModel.smsInfo.isNotEmpty ? '剩余${myModel.smsInfo}条' : '',
callback: () {
Utils.goMiniProgramZm(context, "setting/sms");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "包间类型置满管理",
content: "",
callback: () {
Utils.goMiniProgramZm(context, "roomtype/roomtype");
},
),
VEmptyView(40),
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),
))
],
),
),
),
);
},
)
],
return Scaffold(
appBar: AppBar(
backgroundColor: MyColours.color_199095, //把appbar的背景色改成透明
elevation: 0, //appbar的阴影
centerTitle: true, // 标题居中
title: Text(
'我的',
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none),
)),
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)),
body: NestedScrollView(
controller: controller,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: false,
floating: true,
expandedHeight: ScreenUtil().setWidth(242),
flexibleSpace: FlexibleSpaceBar(
collapseMode: CollapseMode.pin,
background: Container(
//头部整个背景颜色
// height: ScreenUtil().getAdapterSize(800),
child: Consumer<UserModel>(builder:
(BuildContext context, UserModel model,
Widget child) {
return Stack(
children: [
Container(
width: double.infinity,
height: ScreenUtil().setHeight(242 + 121),
alignment: Alignment.centerLeft,
color: MyColours.color_199095,
),
Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(40)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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_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_199095,
child: Consumer<UserModel>(
);
}))),
)
];
},
body: Consumer<UserModel>(
builder: (BuildContext context, UserModel model, Widget child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
return SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Column(
children: <Widget>[
VEmptyView(38),
Text(
model.user.sellername,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(36)),
VEmptyView(40),
MyItem(
title: "短信管理",
content: myModel.smsInfo.isNotEmpty
? '剩余${myModel.smsInfo}条'
: '',
callback: () {
Utils.goMiniProgramZm(context, "setting/sms");
},
),
VEmptyView(38),
Text(
model.user.account + " | " + model.user.role_name,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(30)),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
],
);
},
)),
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),
),
MyItem(
title: "包间类型置满管理",
content: "",
callback: () {
Utils.goMiniProgramZm(context, "roomtype/roomtype");
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "可订时段管理",
content: "",
callback: () {
NavigatorUtil.goBookTimeSetPage(context);
},
),
MyDivider(
double.infinity,
ScreenUtil().setHeight(1),
color: MyColours.color_f3f3f3,
),
MyItem(
title: "接单时间管理",
content: "",
callback: () {},
),
VEmptyView(40),
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),
)
],
),
)
: 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),
))
],
),
),
),
);
},
)
],
),
);
*/
),
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),
))
],
),
),
),
);
},
)
],
));
})));
}
}
... ...
... ... @@ -12,6 +12,7 @@ import 'package:one_key/pages/login/login_page.dart';
import 'package:one_key/pages/detail/handle_online_page.dart';
import 'package:one_key/pages/detail/notebook_detail_page.dart';
import 'package:one_key/pages/login/web_page.dart';
import 'package:one_key/pages/my/book_time_set.dart';
import 'package:one_key/pages/sms/sms_page.dart';
import 'package:one_key/pages/table/select_table_page.dart';
import 'package:one_key/pages/webview/webview_page.dart';
... ... @@ -97,8 +98,8 @@ var handleInvicationHandler = new Handler(
String ddate = params["ddate"].first;
String ddateStr =
FluroConvertUtils.fluroCnParamsDecode(params["ddateStr"].first);
String phone=params["phone"].first;
return InvicationPage(rid, tableInfo, ddate, ddateStr,phone);
String phone = params["phone"].first;
return InvicationPage(rid, tableInfo, ddate, ddateStr, phone);
});
// 发短信
... ... @@ -134,3 +135,9 @@ var handleChangeDetailHandler = new Handler(
create: (_) => NotebookDetailChangeModel(detailEntity),
child: NoteBookChangePage(detailEntity: detailEntity, rid: rid));
});
// 跳转可订时段管理页面
var handleBookTimeSetHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
return BookTimeSetPage();
});
... ...
... ... @@ -5,17 +5,17 @@ import 'package:one_key/pages/login/login_page.dart';
import 'route_handles.dart';
class Routes {
static String login = "/";//登录页
static String home = "/home";//主页
static String handle_online_page="/handle_online_page";//处理在线预订
static String reserve_detail="/reserve_detail";//预订详情
static String select_table="/select_table";//选择桌位
static String invication="/invication";//邀请函
static String sms="/sms";//发短信
static String webview="/webview";//网页
static String login = "/"; //登录页
static String home = "/home"; //主页
static String handle_online_page = "/handle_online_page"; //处理在线预订
static String reserve_detail = "/reserve_detail"; //预订详情
static String select_table = "/select_table"; //选择桌位
static String invication = "/invication"; //邀请函
static String sms = "/sms"; //发短信
static String webview = "/webview"; //网页
static String web_page = '/web_page'; //隐私协议
static String change_detail="/change_detail";//变更预订
static String change_detail = "/change_detail"; //变更预订
static String book_time_set = "/book_time_set"; //可订时段管理
static void configureRoutes(Router router) {
router.notFoundHandler = new Handler(
... ... @@ -33,5 +33,6 @@ class Routes {
router.define(webview, handler: handleWebviewHandler);
router.define(web_page, handler: webPageHandler);
router.define(change_detail, handler: handleChangeDetailHandler);
router.define(book_time_set, handler: handleBookTimeSetHandler);
}
}
... ...
... ... @@ -654,15 +654,18 @@ class DialogUtil {
//显示选择客户经理弹框
static Future<List<int>> showSelectCusmanDialog(
BuildContext context, List<String> data, ValueChanged valueChanged) {
BuildContext context, List<dynamic> data, ValueChanged valueChanged,
{List<int> selecteds}) {
return Picker(
selecteds: selecteds,
adapter: PickerDataAdapter<String>(pickerdata: data),
height: ScreenUtil().setWidth(480),
hideHeader: false,
cancelText: "取消",
cancelTextStyle: TextStyle(
color: MyColours.color_828282, fontSize: ScreenUtil().setSp(36)),
confirmText: "确定",
itemExtent: ScreenUtil().setWidth(80),
itemExtent: ScreenUtil().setWidth(90),
confirmTextStyle: TextStyle(
color: MyColours.color_2bb5b7, fontSize: ScreenUtil().setSp(36)),
selectedTextStyle: TextStyle(
... ...
... ... @@ -38,14 +38,17 @@ class NavigatorUtil {
/// 订单详情
static void goNotebookDetailPage(BuildContext context, String rid,
{String mid="",bool fromNotify=false,replace = false}) {
_navigateTo(context, "${Routes.reserve_detail}?rid=$rid&mid=$mid&fromNotify=$fromNotify", replace: replace);
{String mid = "", bool fromNotify = false, replace = false}) {
_navigateTo(context,
"${Routes.reserve_detail}?rid=$rid&mid=$mid&fromNotify=$fromNotify",
replace: replace);
}
/// 处理在线预订
static void goHandleOnlinePage(BuildContext context, String rid, String mid,
{fromNotify=false,replace = false}) {
_navigateTo(context, "${Routes.handle_online_page}?rid=$rid&mid=$mid&fromNotify=$fromNotify",
{fromNotify = false, replace = false}) {
_navigateTo(context,
"${Routes.handle_online_page}?rid=$rid&mid=$mid&fromNotify=$fromNotify",
replace: replace);
}
... ... @@ -64,7 +67,7 @@ class NavigatorUtil {
/// 邀请函
static void goInvicationPage(BuildContext context, String rid,
String tableInfo, String ddate, String ddateStr,String phone,
String tableInfo, String ddate, String ddateStr, String phone,
{bool replace = false}) {
_navigateTo(context,
"${Routes.invication}?rid=$rid&tableInfo=${FluroConvertUtils.fluroCnParamsEncode(tableInfo)}&ddate=$ddate&ddateStr=${FluroConvertUtils.fluroCnParamsEncode(ddateStr)}&phone=$phone",
... ... @@ -94,19 +97,17 @@ class NavigatorUtil {
static void goNoteBookChangePage(
BuildContext context, NotebookDetail detailEntity, String rid,
{replace = false}) {
if(detailEntity.type=="0"){//内部预订
detailEntity.is_set_ddate="1";
if (detailEntity.type == "0") {
//内部预订
detailEntity.is_set_ddate = "1";
}
_navigateTo(context,
"${Routes.change_detail}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid",
replace: replace);
}
// /// 变更预订
// static void goNoteBookChangePage(
// BuildContext context, NotebookDetail detailEntity, String rid,
// {replace = false}) {
// _navigateTo(context,
// "${Routes.change_detail}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid",
// replace: replace);
// }
/// 可订时段管理
static void goBookTimeSetPage(BuildContext context) {
_navigateTo(context, "${Routes.book_time_set}");
}
}
... ...