|
...
|
...
|
@@ -57,6 +57,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
TextEditingController _cancelController = TextEditingController();
|
|
|
|
StateSetter _cancelState;
|
|
|
|
|
|
|
|
ScrollController _scrollController;
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
...
|
...
|
@@ -71,6 +72,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
if (_cancelNode.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
paddingTop = 80;
|
|
|
|
_scrollController.jumpTo(_scrollController.position.maxScrollExtent);
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
paddingTop = 138;
|
|
...
|
...
|
@@ -162,6 +164,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
|
|
|
|
///取消预订弹框
|
|
|
|
_showCancelWidget(context) {
|
|
|
|
_scrollController=ScrollController();
|
|
|
|
showGeneralDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
...
|
...
|
@@ -185,170 +188,178 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
ScreenUtil().setWidth(paddingTop * 2),
|
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
ScreenUtil().setWidth(paddingBottom * 2)),
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
'请选择取消原因',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
ScreenUtil().setWidth(0)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
'请选择取消原因',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(8),
|
|
|
|
right: ScreenUtil().setWidth(0),
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
_initCancel();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(left: 20),
|
|
|
|
child: Image.asset(
|
|
|
|
'assets/close.png',
|
|
|
|
width: ScreenUtil().setWidth(32),
|
|
|
|
height: ScreenUtil().setWidth(32),
|
|
|
|
),
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(60),
|
|
|
|
Column(
|
|
|
|
children: cancelReasonList.map((value) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
for (var item in cancelReasonList) {
|
|
|
|
item['select'] = false;
|
|
|
|
isShowTF = false;
|
|
|
|
paddingBottom =
|
|
|
|
ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
138 -
|
|
|
|
340;
|
|
|
|
if (item['title'] == value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
if (item['title'] == '其他原因') {
|
|
|
|
isShowTF = true;
|
|
|
|
// paddingBottom = 130;
|
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(8),
|
|
|
|
right: ScreenUtil().setWidth(0),
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
_initCancel();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(left: 20),
|
|
|
|
child: Image.asset(
|
|
|
|
'assets/close.png',
|
|
|
|
width: ScreenUtil().setWidth(32),
|
|
|
|
height: ScreenUtil().setWidth(32),
|
|
|
|
),
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(60),
|
|
|
|
SingleChildScrollView(
|
|
|
|
controller: _scrollController,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: cancelReasonList.map((value) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
for (var item in cancelReasonList) {
|
|
|
|
item['select'] = false;
|
|
|
|
isShowTF = false;
|
|
|
|
paddingBottom =
|
|
|
|
ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
138 -
|
|
|
|
340 -
|
|
|
|
46;
|
|
|
|
340;
|
|
|
|
if (item['title'] == value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
if (item['title'] == '其他原因') {
|
|
|
|
isShowTF = true;
|
|
|
|
// paddingBottom = 130;
|
|
|
|
paddingBottom =
|
|
|
|
ScreenUtil.screenHeightDp.ceil() -
|
|
|
|
138 -
|
|
|
|
340 -
|
|
|
|
46;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
child: Column(children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
value['select']
|
|
|
|
? 'assets/select.png'
|
|
|
|
: 'assets/unselect.png',
|
|
|
|
width: ScreenUtil().setWidth(44)),
|
|
|
|
HEmptyView(30),
|
|
|
|
Text(value['title'],
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
color: MyColours.color_333333))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
value['title'] == '其他原因' && isShowTF
|
|
|
|
? Material(
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
child: Column(children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
value['select']
|
|
|
|
? 'assets/select.png'
|
|
|
|
: 'assets/unselect.png',
|
|
|
|
width: ScreenUtil().setWidth(44)),
|
|
|
|
HEmptyView(30),
|
|
|
|
Text(value['title'],
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
color: MyColours.color_333333))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
value['title'] == '其他原因' && isShowTF
|
|
|
|
? Material(
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(76)),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: _cancelController,
|
|
|
|
focusNode: _cancelNode,
|
|
|
|
textAlignVertical:
|
|
|
|
TextAlignVertical.bottom,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "请填写原因",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
enabledBorder: UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color:
|
|
|
|
MyColours.color_d8d8d8),
|
|
|
|
color: Colors.white,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(76)),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: _cancelController,
|
|
|
|
focusNode: _cancelNode,
|
|
|
|
textAlignVertical:
|
|
|
|
TextAlignVertical.bottom,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "请填写原因",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
enabledBorder: UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color:
|
|
|
|
MyColours.color_d8d8d8),
|
|
|
|
),
|
|
|
|
// border: InputBorder.none,
|
|
|
|
),
|
|
|
|
// border: InputBorder.none,
|
|
|
|
onChanged: (_) {
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_cancelNode.unfocus();
|
|
|
|
},
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
),
|
|
|
|
onChanged: (_) {
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_cancelNode.unfocus();
|
|
|
|
},
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
),
|
|
|
|
))
|
|
|
|
: Container(),
|
|
|
|
VEmptyView(40)
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
VEmptyView(15),
|
|
|
|
Material(
|
|
|
|
child: RoundButton(
|
|
|
|
onPressed: () {
|
|
|
|
String desc = '';
|
|
|
|
for (var value in cancelReasonList) {
|
|
|
|
if (value['select'] == true) {
|
|
|
|
desc = value['title'];
|
|
|
|
if (value['title'] == '其他原因') {
|
|
|
|
desc = _cancelController.text.trim();
|
|
|
|
if (desc.isEmpty) {
|
|
|
|
Utils.showToast("请填写原因");
|
|
|
|
return;
|
|
|
|
))
|
|
|
|
: Container(),
|
|
|
|
VEmptyView(40)
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(15),
|
|
|
|
Material(
|
|
|
|
child: RoundButton(
|
|
|
|
onPressed: () {
|
|
|
|
String desc = '';
|
|
|
|
for (var value in cancelReasonList) {
|
|
|
|
if (value['select'] == true) {
|
|
|
|
desc = value['title'];
|
|
|
|
if (value['title'] == '其他原因') {
|
|
|
|
desc = _cancelController.text.trim();
|
|
|
|
if (desc.isEmpty) {
|
|
|
|
Utils.showToast("请填写原因");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (desc == '') {
|
|
|
|
Utils.showToast('请选择原因');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (desc == '') {
|
|
|
|
Utils.showToast('请选择原因');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Loading.showLoading(context);
|
|
|
|
setReserveStatus('4', desc: desc);
|
|
|
|
},
|
|
|
|
text: '确认',
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
width: ScreenUtil().setWidth(300),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Loading.showLoading(context);
|
|
|
|
setReserveStatus('4', desc: desc);
|
|
|
|
},
|
|
|
|
text: '确认',
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
width: ScreenUtil().setWidth(300),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
...
|
...
|
@@ -511,8 +522,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
list.add(manager.roleUserName);
|
|
|
|
}
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, list)
|
|
|
|
.then((value) {
|
|
|
|
context, list,(value){
|
|
|
|
if (value != null) {
|
|
|
|
setState(() {
|
|
|
|
cusmanText =
|
|
...
|
...
|
@@ -521,6 +531,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
});
|
|
|
|
_setCurrManager();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.then((value) {
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Text(
|
...
|
...
|
|