|
...
|
...
|
@@ -22,11 +22,10 @@ import 'package:provider/provider.dart'; |
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
|
|
|
|
class HandleOnlinePage extends StatefulWidget {
|
|
|
|
|
|
|
|
final String rid;
|
|
|
|
final String mid;
|
|
|
|
final bool fromNotify;
|
|
|
|
HandleOnlinePage(this.rid, this.mid, {this.fromNotify=false});
|
|
|
|
HandleOnlinePage(this.rid, this.mid, {this.fromNotify = false});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
...
|
...
|
@@ -61,8 +60,8 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
if (detailEntity.status != "0") {
|
|
|
|
//已处理
|
|
|
|
Future.delayed(Duration(milliseconds: 200), () {
|
|
|
|
NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,fromNotify: widget.fromNotify,
|
|
|
|
replace: true);
|
|
|
|
NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
|
|
|
|
fromNotify: widget.fromNotify, replace: true);
|
|
|
|
});
|
|
|
|
setMessageStatus();
|
|
|
|
} else {
|
|
...
|
...
|
@@ -132,7 +131,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
}
|
|
|
|
|
|
|
|
//处理在线预订
|
|
|
|
setReserveStatus(String status, {String tid = ""}) {
|
|
|
|
setReserveStatus(String status, {String tid = ""}) async {
|
|
|
|
bus.emit("remove_untreated_message", widget.mid);
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
Map<String, String> causeMap = {
|
|
...
|
...
|
@@ -147,7 +146,11 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
"mid": widget.mid,
|
|
|
|
"cause": json.encode(causeMap)
|
|
|
|
};
|
|
|
|
detailModel.setReserveStatus(context, params,showLoading: true);
|
|
|
|
bool success =
|
|
|
|
await detailModel.setReserveStatus(context, params, showLoading: true);
|
|
|
|
if (success) {
|
|
|
|
bus.emit("refresh_book_list");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//处理在线预订
|
|
...
|
...
|
@@ -165,241 +168,246 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// TODO: implement build
|
|
|
|
return SafeArea(
|
|
|
|
child: WillPopScope(
|
|
|
|
child: detailEntity == null
|
|
|
|
? Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: double.infinity,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
)
|
|
|
|
: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
MyAppBar(
|
|
|
|
"在线预订详情",
|
|
|
|
showBack: true,
|
|
|
|
callback: (){
|
|
|
|
if(widget.fromNotify){
|
|
|
|
NavigatorUtil.goHomePage(context,initialIndex: 0);
|
|
|
|
}else{
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: DefaultTextStyle(
|
|
|
|
style: TextStyle(decoration: TextDecoration.none),
|
|
|
|
child: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(43)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
RowMultiText(
|
|
|
|
"用餐时段", detailEntity.ddateMd),
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: WillPopScope(
|
|
|
|
child: detailEntity == null
|
|
|
|
? Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: double.infinity,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
)
|
|
|
|
: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
MyAppBar(
|
|
|
|
"在线预订详情",
|
|
|
|
showBack: true,
|
|
|
|
callback: () {
|
|
|
|
if (widget.fromNotify) {
|
|
|
|
NavigatorUtil.goHomePage(context, initialIndex: 0);
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: DefaultTextStyle(
|
|
|
|
style: TextStyle(decoration: TextDecoration.none),
|
|
|
|
child: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(43)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Column(
|
|
|
|
RowMultiText(
|
|
|
|
"用餐时段", detailEntity.ddateMd),
|
|
|
|
Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
RowMultiText("用餐时间",
|
|
|
|
detailEntity.ddateHm),
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
|
|
detailEntity.type == "0"
|
|
|
|
? false
|
|
|
|
: true,
|
|
|
|
child: RowMultiText("用餐人数",
|
|
|
|
detailEntity.pnum),
|
|
|
|
Column(
|
|
|
|
children: <Widget>[
|
|
|
|
RowMultiText("用餐时间",
|
|
|
|
detailEntity.ddateHm),
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
|
|
detailEntity.type == "0"
|
|
|
|
? false
|
|
|
|
: true,
|
|
|
|
child: RowMultiText("用餐人数",
|
|
|
|
detailEntity.pnum),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Image.asset(
|
|
|
|
detailEntity.statuImgAssets,
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(100),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(30),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Image.asset(
|
|
|
|
detailEntity.statuImgAssets,
|
|
|
|
width: ScreenUtil().setWidth(100),
|
|
|
|
height: ScreenUtil().setWidth(30),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
RowMultiText(
|
|
|
|
"包间需求",
|
|
|
|
(detailEntity.demands.length
|
|
|
|
.toString() +
|
|
|
|
"个") ??
|
|
|
|
""),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Offstage(
|
|
|
|
offstage:
|
|
|
|
detailEntity.demands.length >
|
|
|
|
0
|
|
|
|
? false
|
|
|
|
: true,
|
|
|
|
child: Container(
|
|
|
|
height:
|
|
|
|
ScreenUtil().setHeight(210),
|
|
|
|
child: ListView.builder(
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt,
|
|
|
|
int index) {
|
|
|
|
return NeedItem(detailEntity
|
|
|
|
.demands[index]);
|
|
|
|
},
|
|
|
|
itemCount: detailEntity
|
|
|
|
.demands.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection:
|
|
|
|
Axis.horizontal,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
RowMultiText(
|
|
|
|
"客户姓名", detailEntity.rnameStr),
|
|
|
|
RowMultiText(
|
|
|
|
"客户电话", detailEntity.phone),
|
|
|
|
RowMultiText(
|
|
|
|
"备注信息", detailEntity.cusdem ?? ""),
|
|
|
|
MyDivider(double.infinity,
|
|
|
|
ScreenUtil().setHeight(1)),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setHeight(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Positioned(
|
|
|
|
left: 0,
|
|
|
|
child: Text(
|
|
|
|
"客户经理",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_828282,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(30)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
right: 0,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
List<String> list = [];
|
|
|
|
for (Manager manager
|
|
|
|
in managers) {
|
|
|
|
list.add(
|
|
|
|
manager.roleUserName);
|
|
|
|
}
|
|
|
|
DialogUtil
|
|
|
|
.showSelectCusmanDialog(
|
|
|
|
context, list,(value){
|
|
|
|
if(value!=null){
|
|
|
|
setState(() {
|
|
|
|
cusmanText = managers[
|
|
|
|
value.first]
|
|
|
|
.userName;
|
|
|
|
});
|
|
|
|
_setCurrManager();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
cusmanText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_353535,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(30),
|
|
|
|
decoration: TextDecoration
|
|
|
|
.underline,
|
|
|
|
RowMultiText(
|
|
|
|
"包间需求",
|
|
|
|
(detailEntity.demands.length
|
|
|
|
.toString() +
|
|
|
|
"个") ??
|
|
|
|
""),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Offstage(
|
|
|
|
offstage: detailEntity
|
|
|
|
.demands.length >
|
|
|
|
0
|
|
|
|
? false
|
|
|
|
: true,
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setHeight(210),
|
|
|
|
child: ListView.builder(
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt,
|
|
|
|
int index) {
|
|
|
|
return NeedItem(
|
|
|
|
detailEntity
|
|
|
|
.demands[index]);
|
|
|
|
},
|
|
|
|
itemCount: detailEntity
|
|
|
|
.demands.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection:
|
|
|
|
Axis.horizontal,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setHeight(30),
|
|
|
|
bottom: ScreenUtil().setHeight(30)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
CommonButton(
|
|
|
|
content: "安排包间",
|
|
|
|
width: 669,
|
|
|
|
height: 76,
|
|
|
|
fontSize: 34,
|
|
|
|
onPress: () async {
|
|
|
|
Map map = await NavigatorUtil
|
|
|
|
.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(detailEntity.ddate) *
|
|
|
|
1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (map['tid'] != null) {
|
|
|
|
setReserveStatus("5", tid: map['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
RowMultiText(
|
|
|
|
"客户姓名", detailEntity.rnameStr),
|
|
|
|
RowMultiText(
|
|
|
|
"客户电话", detailEntity.phone),
|
|
|
|
RowMultiText("备注信息",
|
|
|
|
detailEntity.cusdem ?? ""),
|
|
|
|
MyDivider(double.infinity,
|
|
|
|
ScreenUtil().setHeight(1)),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setHeight(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Positioned(
|
|
|
|
left: 0,
|
|
|
|
child: Text(
|
|
|
|
"客户经理",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_828282,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(30)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
right: 0,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
List<String> list = [];
|
|
|
|
for (Manager manager
|
|
|
|
in managers) {
|
|
|
|
list.add(manager
|
|
|
|
.roleUserName);
|
|
|
|
}
|
|
|
|
DialogUtil
|
|
|
|
.showSelectCusmanDialog(
|
|
|
|
context, list,
|
|
|
|
(value) {
|
|
|
|
if (value != null) {
|
|
|
|
setState(() {
|
|
|
|
cusmanText =
|
|
|
|
managers[value
|
|
|
|
.first]
|
|
|
|
.userName;
|
|
|
|
});
|
|
|
|
_setCurrManager();
|
|
|
|
}
|
|
|
|
}).then((value) {});
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
cusmanText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_353535,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(30),
|
|
|
|
decoration:
|
|
|
|
TextDecoration
|
|
|
|
.underline,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(669),
|
|
|
|
height: ScreenUtil().setHeight(76),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(5)),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setHeight(30),
|
|
|
|
bottom: ScreenUtil().setHeight(30)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
CommonButton(
|
|
|
|
content: "安排包间",
|
|
|
|
width: 669,
|
|
|
|
height: 76,
|
|
|
|
fontSize: 34,
|
|
|
|
onPress: () async {
|
|
|
|
Map map = await NavigatorUtil
|
|
|
|
.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(detailEntity.ddate) *
|
|
|
|
1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (map['tid'] != null) {
|
|
|
|
setReserveStatus("5",
|
|
|
|
tid: map['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(669),
|
|
|
|
height: ScreenUtil().setHeight(76),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(5)),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"拒绝订单",
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_199095,
|
|
|
|
MyColours.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(34)),
|
|
|
|
ScreenUtil().setSp(34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
_showRefuseDialog();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setHeight(52),
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setHeight(52),
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"联系顾客",
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_199095,
|
|
|
|
MyColours.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(34)),
|
|
|
|
ScreenUtil().setSp(34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
...
|
...
|
@@ -413,26 +421,25 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
onWillPop: ()async{
|
|
|
|
if(widget.fromNotify){
|
|
|
|
NavigatorUtil.goHomePage(context,initialIndex: 0);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
onWillPop: () async {
|
|
|
|
if (widget.fromNotify) {
|
|
|
|
NavigatorUtil.goHomePage(context, initialIndex: 0);
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|