Commit d53c7578e9e398a9067f7083bd23eb40a1960b92

Authored by wdn127929
1 parent ee776451

取消预订定金去向UI

1.84 KB | W: | H:

2.52 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.07 KB | W: | H:

3.34 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -84,6 +84,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
Manager manager = Manager();
List cancelReasonList = [];
List depositReasonList = [];
bool isShowTF = false;
// int paddingBottom;
int paddingTop = 138;
... ... @@ -91,6 +92,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
TextEditingController _cancelController = TextEditingController();
StateSetter _cancelState;
FocusNode _depositNode = FocusNode();
TextEditingController _depositController = TextEditingController();
ScrollController _scrollController;
String formatPhone = "";
... ... @@ -136,6 +140,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
getSellerVersion();
_getReserveTypeField();
_initCancel();
_initdDeposit();
_getReserveDetail();
_getOrderInfo();
_getReserveDepositByRid();
... ... @@ -152,11 +157,37 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_cancelNode.addListener(() {
if (_cancelNode.hasFocus) {
print('得到焦点');
paddingTop = 80;
_scrollController.jumpTo(_scrollController.position.maxScrollExtent);
for (var item in cancelReasonList) {
item['select'] = false;
if (item['title'] == '其他原因') {
item['select'] = true;
}
}
// state(() {});
// _scrollController.jumpTo(_scrollController.position.maxScrollExtent);
} else {
print('失去焦点');
}
_cancelState(() {});
});
_depositNode.addListener(() {
if (_depositNode.hasFocus) {
print('得到焦点');
for (var item in depositReasonList) {
item['select'] = false;
if (item['title'] == '其他原因') {
item['select'] = true;
}
}
// state(() {});
// _scrollController.jumpTo(_scrollController.position.maxScrollExtent);
} else {
print('失去焦点');
paddingTop = 138;
}
_cancelState(() {});
});
... ... @@ -486,8 +517,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '操作失误', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '其他原因', 'select': false},
];
}
_initdDeposit() {
isShowTF = false;
// paddingBottom = ScreenUtil().screenHeight.ceil() - 138 - 340;
depositReasonList = [
{'title': '订金已退', 'select': false},
{'title': '充入会员卡', 'select': false},
{'title': '留下次使用', 'select': false},
{'title': '抵做餐费用', 'select': false},
{'title': '其他原因', 'select': false},
];
}
... ... @@ -582,6 +625,111 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
);
}
Widget _depositWidget() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: w(24)),
height: ScreenUtil().setWidth(48),
child: Text(
'请选择预订订金走向',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_E5000000),
),
),
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(horizontal: w(24)),
child: Wrap(
runSpacing: w(20),
// mainAxisSize: MainAxisSize.min,
children: depositReasonList.map((value) {
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
for (var item in depositReasonList) {
item['select'] = false;
isShowTF = false;
if (item['title'] == value['title']) {
item['select'] = true;
if (item['title'] == '其他原因') {
isShowTF = true;
}
}
}
_cancelState(() {});
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil().setWidth(48)),
HEmptyView(16),
value['title'] == '其他原因'
? Expanded(
child: Container(
// height: w(42),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(r(4))),
padding: EdgeInsets.only(
left: w(8), top: w(10), bottom: w(10)),
child: TextField(
maxLines: 1,
controller: _depositController,
focusNode: _depositNode,
// textAlignVertical:
// TextAlignVertical
// .bottom,
decoration: InputDecoration(
isCollapsed: true,
contentPadding: EdgeInsets.zero,
hintText: "其他",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
border: InputBorder.none,
),
onChanged: (_) {},
onEditingComplete: () {
print('fff');
_depositNode.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
: Container(
width: w(100),
child: Text(value['title'],
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none,
color: MyColours.color_E5000000)))
],
),
);
}).toList(),
)),
VEmptyView(34),
MyDivider(double.infinity, w(1), color: MyColours.color_E7E7E7)
],
);
}
///取消预订弹框
_showCancelWidget(context, phone) {
_scrollController = ScrollController();
... ... @@ -595,197 +743,251 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
Animation secondaryAnimation) {
return StatefulBuilder(builder: (context, state) {
_cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(00, 00, 00, 0.5),
),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(50),
ScreenUtil().setWidth(paddingTop * 2),
ScreenUtil().setWidth(50),
ScreenUtil().setWidth(0)),
child: Align(
alignment: Alignment.topCenter,
child: Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: Colors.white,
return Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
// height: ScreenUtil().setWidth(421 * 2),
decoration: BoxDecoration(
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),
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().screenHeight.ceil() -
// 138 -
// 340;
if (item['title'] == value['title']) {
item['select'] = true;
if (item['title'] == '其他原因') {
isShowTF = true;
// paddingBottom = 130;
// paddingBottom =
// ScreenUtil().screenHeight.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_515151))
],
BorderRadius.circular(ScreenUtil().setWidth(16))),
child: SingleChildScrollView(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(
ScreenUtil().setWidth(10)))), //设置圆角
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
VEmptyView(48),
// Stack(
// children: [
VEmptyView(40),
SingleChildScrollView(
controller: _scrollController,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: w(24)),
height: ScreenUtil().setWidth(48),
child: Text(
'请选择取消原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_E5000000),
),
),
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),
),
// border: InputBorder.none,
),
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(24)),
child: Wrap(
runSpacing: w(20),
// mainAxisSize: MainAxisSize.min,
children:
cancelReasonList.map((value) {
return GestureDetector(
onTap: () {
FocusScope.of(context)
.requestFocus(
new FocusNode());
for (var item
in cancelReasonList) {
item['select'] = false;
isShowTF = false;
if (item['title'] ==
value['title']) {
item['select'] = true;
if (item['title'] ==
'其他原因') {
isShowTF = true;
}
}
}
state(() {});
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
: 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;
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(48)),
HEmptyView(16),
value['title'] == '其他原因'
? Expanded(
child: Container(
// height: w(42),
decoration: BoxDecoration(
color: MyColours
.color_f3f3f3,
borderRadius:
BorderRadius
.circular(
r(4))),
padding:
EdgeInsets.only(
left: w(8),
top: w(10),
bottom:
w(10)),
child: TextField(
maxLines: 1,
controller:
_cancelController,
focusNode:
_cancelNode,
// textAlignVertical:
// TextAlignVertical
// .bottom,
decoration:
InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets
.zero,
hintText: "其他",
hintStyle:
TextStyle(
color: MyColours
.color_999999,
fontSize:
ScreenUtil()
.setSp(
30),
),
border:
InputBorder
.none,
),
onChanged: (_) {},
onEditingComplete:
() {
print('fff');
_cancelNode
.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
: Container(
width: w(100),
child: Text(
value['title'],
style: TextStyle(
overflow:
TextOverflow
.ellipsis,
fontSize:
ScreenUtil()
.setSp(
32),
fontWeight:
FontWeight
.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_E5000000)))
],
),
);
}).toList(),
)),
VEmptyView(34),
_depositWidget(),
MyDivider(double.infinity, w(1),
color: MyColours.color_E7E7E7)
],
)),
// VEmptyView(15),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '取消',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 34,
onPressed: () {
_initCancel();
_initdDeposit();
Navigator.of(context).pop();
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_DBDBDB),
RoundButton(
text: '确定',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 34,
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);
Navigator.of(context).pop();
Loading.showLoading(context);
setReserveStatus('4', desc: desc, phone: phone);
},
text: '确认',
height: ScreenUtil().setWidth(80),
width: ScreenUtil().setWidth(300),
radius: ScreenUtil().setWidth(10),
setReserveStatus('4',
desc: desc, phone: phone);
}),
],
),
)
],
],
),
),
)),
),
);
),
));
});
});
}
... ...