|
|
|
import 'package:flutter/gestures.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
import '../../res/colors.dart';
|
|
|
|
import '../../utils/dialog_util.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
|
|
import '../../utils/utils.dart';
|
|
|
|
import '../../widgets/h_empty_view.dart';
|
|
|
|
import '../../widgets/system_app_bar.dart';
|
|
|
|
|
|
|
|
class FeastCreatePage extends StatefulWidget {
|
|
|
|
FeastCreatePage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_FeastCreatePageState createState() => _FeastCreatePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _FeastCreatePageState extends State<FeastCreatePage> {
|
|
|
|
TextEditingController nameC = TextEditingController();
|
|
|
|
TextEditingController phoneC = TextEditingController();
|
|
|
|
FocusNode nameF = FocusNode();
|
|
|
|
FocusNode phoneF = FocusNode();
|
|
|
|
TextEditingController customC = TextEditingController();
|
|
|
|
FocusNode customF = FocusNode();
|
|
|
|
List sexList;
|
|
|
|
int sexSelectIndex = 0;
|
|
|
|
String sexStr = '先生';
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
|
|
super.initState();
|
|
|
|
Utils.changeStatusColor(color: MyColours.color_438E93);
|
|
|
|
initSexList();
|
|
|
|
}
|
|
|
|
|
|
|
|
///称谓
|
|
|
|
initSexList() {
|
|
|
|
String sexStr = '1';
|
|
|
|
sexList = [
|
|
|
|
{
|
|
|
|
'title': '先生',
|
|
|
|
'select': sexStr == '1' ? true : false,
|
|
|
|
'code': '1',
|
|
|
|
'hasLeftBorder': true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': '女士',
|
|
|
|
'select': sexStr == '2' ? true : false,
|
|
|
|
'code': '2',
|
|
|
|
'hasLeftBorder': false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': '公司',
|
|
|
|
'select': sexStr == '3' ? true : false,
|
|
|
|
'code': '3',
|
|
|
|
'hasLeftBorder': false
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget menuBtn(String title, bool select) {
|
|
|
|
return Container(
|
|
|
|
width: w(40),
|
|
|
|
height: h(40),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: select ? MyColours.color_438E93 : MyColours.color_BFC4D4,
|
|
|
|
borderRadius: BorderRadius.circular(r(20))),
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(color: MyColours.color_F6F6F6, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget arrow() {
|
|
|
|
return Image.asset(
|
|
|
|
Utils.getImgPath('f_arrow'),
|
|
|
|
width: w(24),
|
|
|
|
height: h(24),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget menu() {
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.all(w(24)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
menuBtn('意向', true),
|
|
|
|
arrow(),
|
|
|
|
menuBtn('选台', false),
|
|
|
|
arrow(),
|
|
|
|
menuBtn('定金', false),
|
|
|
|
arrow(),
|
|
|
|
menuBtn('签约', false),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _selectWidget(String title, String labelShow) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
// DialogUtil.showSelectCusmanDialog(
|
|
|
|
// context,
|
|
|
|
// customerProvider.labelList.map((item) {
|
|
|
|
// return item.label;
|
|
|
|
// }).toList(), (value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// setState(() {
|
|
|
|
// customerProvider.labelSelIndex = value.first;
|
|
|
|
// labelShow = customerProvider
|
|
|
|
// .labelList[customerProvider.labelSelIndex].label;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// selecteds: customerProvider.labelSelIndex == null
|
|
|
|
// ? []
|
|
|
|
// : [customerProvider.labelSelIndex])
|
|
|
|
// .then((value) {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(60),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16),
|
|
|
|
right: w(8),
|
|
|
|
top: ScreenUtil().setWidth(18 * 2),
|
|
|
|
bottom: h(14)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: w(80),
|
|
|
|
child: RichText(
|
|
|
|
textScaleFactor: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
// textDirection: TextDirection.ltr,
|
|
|
|
|
|
|
|
text: TextSpan(
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
text: title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
recognizer: TapGestureRecognizer()
|
|
|
|
..onTap = () {}),
|
|
|
|
TextSpan(
|
|
|
|
text: '*',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_E34D59,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
//点击事件
|
|
|
|
recognizer: TapGestureRecognizer()
|
|
|
|
..onTap = () {}),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
labelShow,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('f_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(32 * 2),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _inputWidget(String title, String labelShow,
|
|
|
|
TextEditingController controller, FocusNode node) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
// DialogUtil.showSelectCusmanDialog(
|
|
|
|
// context,
|
|
|
|
// customerProvider.labelList.map((item) {
|
|
|
|
// return item.label;
|
|
|
|
// }).toList(), (value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// setState(() {
|
|
|
|
// customerProvider.labelSelIndex = value.first;
|
|
|
|
// labelShow = customerProvider
|
|
|
|
// .labelList[customerProvider.labelSelIndex].label;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// selecteds: customerProvider.labelSelIndex == null
|
|
|
|
// ? []
|
|
|
|
// : [customerProvider.labelSelIndex])
|
|
|
|
// .then((value) {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(60),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16),
|
|
|
|
right: w(8),
|
|
|
|
top: ScreenUtil().setWidth(18 * 2),
|
|
|
|
bottom: h(14)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: w(80),
|
|
|
|
child: RichText(
|
|
|
|
textScaleFactor: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
// textDirection: TextDirection.ltr,
|
|
|
|
|
|
|
|
text: TextSpan(
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
text: title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
recognizer: TapGestureRecognizer()
|
|
|
|
..onTap = () {}),
|
|
|
|
TextSpan(
|
|
|
|
text: '*',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_E34D59,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
//点击事件
|
|
|
|
recognizer: TapGestureRecognizer()
|
|
|
|
..onTap = () {}),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: h(40),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
controller: controller,
|
|
|
|
focusNode: node,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: labelShow,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
// border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
|
|
|
|
// nameStr = value;
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
node.unfocus();
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + _nameSuffix();
|
|
|
|
// _addNameSuffix(nameStr, sexStr);
|
|
|
|
},
|
|
|
|
keyboardType: title == '电话'
|
|
|
|
? TextInputType.number
|
|
|
|
: TextInputType.text,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
title == '电话' ? SizedBox() : HEmptyView(10),
|
|
|
|
title == '电话'
|
|
|
|
? SizedBox()
|
|
|
|
: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
List<String> list = [];
|
|
|
|
for (Map item in sexList) {
|
|
|
|
list.add(item['title']);
|
|
|
|
}
|
|
|
|
DialogUtil.showSelectCusmanDialog(context, list,
|
|
|
|
(value) async {
|
|
|
|
if (value != null) {
|
|
|
|
sexSelectIndex = value.first;
|
|
|
|
sexStr = list[sexSelectIndex];
|
|
|
|
// if (nameStr != null && nameStr != '') {
|
|
|
|
// _addNameSuffix(nameStr, sexStr);
|
|
|
|
// }
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}, selecteds: [sexSelectIndex]).then((value) {});
|
|
|
|
},
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
sexStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Image.asset(Utils.getImgPath('quan_down_f'),
|
|
|
|
width: ScreenUtil().setWidth(28),
|
|
|
|
height: ScreenUtil().setWidth(28)),
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget remark() {
|
|
|
|
return Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(top: h(29), left: w(16), right: w(18), bottom: h(22)),
|
|
|
|
child: //输入框
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30),
|
|
|
|
vertical: ScreenUtil().setWidth(18)),
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_DBDBDB, width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
child: TextField(
|
|
|
|
controller: customC,
|
|
|
|
focusNode: customF,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
textBaseline: TextBaseline.alphabetic),
|
|
|
|
textAlignVertical: TextAlignVertical.center,
|
|
|
|
maxLines: 5,
|
|
|
|
maxLength: 100,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "请输入备注",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {
|
|
|
|
// currentRemark = value ?? "";
|
|
|
|
// });
|
|
|
|
// if (value.length < currRemark.length &&
|
|
|
|
// currRemark.substring(value.length) != ',') {
|
|
|
|
// setState(() {
|
|
|
|
// currRemark = value ?? "";
|
|
|
|
// });
|
|
|
|
// if (sum == 0) {
|
|
|
|
// for (int i = 0; i < remarks.length; i++) {
|
|
|
|
// if (remarks[i].isSelect &&
|
|
|
|
// remarks[i].remark == selectItem.last) {
|
|
|
|
// setState(() {
|
|
|
|
// remarks[i].isSelect = false;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// sum++;
|
|
|
|
// if (sum == selectItem.last.length ||
|
|
|
|
// selectItem.length == 1 ||
|
|
|
|
// selectItem.length == 0) {
|
|
|
|
// selectItem.removeLast();
|
|
|
|
// sum = 0;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// setState(() {
|
|
|
|
// currRemark = value ?? "";
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'新建宴会',
|
|
|
|
needWhite: true,
|
|
|
|
bgColor: MyColours.color_438E93,
|
|
|
|
titleColor: MyColours.color_F6F6F6,
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Column(children: <Widget>[
|
|
|
|
menu(),
|
|
|
|
MyDivider(double.infinity, h(1), color: MyColours.color_DBDBDB),
|
|
|
|
VEmptyView(26),
|
|
|
|
_selectWidget('宴会日期', '2022-08-02(周二 七月十五)'),
|
|
|
|
_selectWidget('接单人', '刘经理'),
|
|
|
|
_selectWidget('跟单人', '请选择'),
|
|
|
|
_selectWidget('宴会类型', '请选择'),
|
|
|
|
_inputWidget('预订人', '请输入', nameC, nameF),
|
|
|
|
_inputWidget('电话', '请输入', phoneC, phoneF),
|
|
|
|
remark()
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|