|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/customer_label_model.dart';
|
|
|
|
import 'package:one_key/models/guest_info_model.dart';
|
|
|
|
import 'package:one_key/provider/customer_provider.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import '../../models/notebook_detail.dart';
|
|
|
|
import '../../widgets/page_exception.dart';
|
|
|
|
|
|
|
|
class OrderCustomerDetailPage extends StatefulWidget {
|
|
|
|
final NotebookDetail detailEntity;
|
|
|
|
OrderCustomerDetailPage({Key key, this.detailEntity}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_OrderCustomerDetailPageState createState() =>
|
|
|
|
_OrderCustomerDetailPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> {
|
|
|
|
List sexList = []; // 先生、女士、公司
|
|
|
|
TextEditingController nameController = TextEditingController();
|
|
|
|
FocusNode nameFocus = FocusNode();
|
|
|
|
String nameStr;
|
|
|
|
TextEditingController phoneController = TextEditingController();
|
|
|
|
FocusNode phoneFocus = FocusNode();
|
|
|
|
TextEditingController adressController = TextEditingController();
|
|
|
|
FocusNode adressFocus = FocusNode();
|
|
|
|
TextEditingController departmentController = TextEditingController();
|
|
|
|
FocusNode departmentFocus = FocusNode();
|
|
|
|
TextEditingController positionController = TextEditingController();
|
|
|
|
FocusNode positionFocus = FocusNode();
|
|
|
|
TextEditingController jkController = TextEditingController();
|
|
|
|
TextEditingController xhController = TextEditingController();
|
|
|
|
TextEditingController fwController = TextEditingController();
|
|
|
|
bool showLabel = false;
|
|
|
|
|
|
|
|
CustomerProvider customerProvider;
|
|
|
|
String labelShow = '';
|
|
|
|
ScrollController scrollController = ScrollController();
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
if ((widget.detailEntity.rnameStr == '' ||
|
|
|
|
widget.detailEntity.rnameStr == null) &&
|
|
|
|
(widget.detailEntity.phone == '' ||
|
|
|
|
widget.detailEntity.phone == null) &&
|
|
|
|
widget.detailEntity.status != "4") {
|
|
|
|
//没有联系人
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
customerProvider.pageStateGuestInfo = PageState.Empty;
|
|
|
|
customerProvider.notifyListeners();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
_initSexList();
|
|
|
|
nameFocus.addListener(() {
|
|
|
|
if (nameFocus.hasFocus) {
|
|
|
|
print('得到焦点');
|
|
|
|
} else {
|
|
|
|
print('失去焦点');
|
|
|
|
// _homeEnterModel.nameController.text = nameStr + _nameSuffix();
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
_getGuestInfo();
|
|
|
|
|
|
|
|
_getLabelBySellerid();
|
|
|
|
// scrollController.jumpTo(scrollController.position.minScrollExtent);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_getGuestInfo() async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
"id": '195',
|
|
|
|
'phone': '18049359922'
|
|
|
|
};
|
|
|
|
bool success = await customerProvider.getGuestInfo(context, params);
|
|
|
|
if (success) {
|
|
|
|
Guest guest = customerProvider.guestInfoSunModel.guest;
|
|
|
|
if (guest.rname != '' &&
|
|
|
|
guest.rname != null &&
|
|
|
|
guest.sex != '' &&
|
|
|
|
guest.sex != null) {
|
|
|
|
nameStr = guest.rname;
|
|
|
|
for (var item in sexList) {
|
|
|
|
item['select'] = false;
|
|
|
|
if (item['code'] == guest.sex) {
|
|
|
|
item['select'] = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
}
|
|
|
|
phoneController.text = guest.phone ?? '';
|
|
|
|
adressController.text = guest.company ?? '';
|
|
|
|
departmentController.text = guest.section ?? '';
|
|
|
|
positionController.text = guest.position ?? '';
|
|
|
|
jkController.text = guest.taboos ?? '';
|
|
|
|
xhController.text = guest.like ?? '';
|
|
|
|
fwController.text = guest.serve ?? '';
|
|
|
|
labelShow = guest.label ?? '';
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
// await customerProvider.searchData(customerProvider.controller.text);
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取商家标签
|
|
|
|
_getLabelBySellerid() async {
|
|
|
|
List<CustomerLabelSunModel> modelLabel =
|
|
|
|
await customerProvider.getLabelBySellerid(context);
|
|
|
|
|
|
|
|
if (modelLabel.length > 0) {
|
|
|
|
for (int i = 0; i < customerProvider.labelList.length; i++) {
|
|
|
|
if (labelShow == customerProvider.labelList[i].label) {
|
|
|
|
customerProvider.labelSelIndex = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_setGuestInfo() async {
|
|
|
|
if (nameStr.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写客户姓名');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (phoneController.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写客户电话');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String sex = '1';
|
|
|
|
for (var item in sexList) {
|
|
|
|
if (item['select']) {
|
|
|
|
sex = item['code'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"id": '195',
|
|
|
|
'sex': sex,
|
|
|
|
'rname': nameStr,
|
|
|
|
'phone': phoneController.text
|
|
|
|
};
|
|
|
|
|
|
|
|
if (adressController.text.trim().length > 0) {
|
|
|
|
params['company'] = adressController.text;
|
|
|
|
}
|
|
|
|
if (departmentController.text.trim().length > 0) {
|
|
|
|
params['section'] = departmentController.text;
|
|
|
|
}
|
|
|
|
if (positionController.text.trim().length > 0) {
|
|
|
|
params['position'] = positionController.text;
|
|
|
|
}
|
|
|
|
if (labelShow != '') {
|
|
|
|
params['label'] = labelShow;
|
|
|
|
}
|
|
|
|
if (jkController.text.trim().length > 0) {
|
|
|
|
params['taboos'] = jkController.text;
|
|
|
|
}
|
|
|
|
if (xhController.text.trim().length > 0) {
|
|
|
|
params['like'] = xhController.text;
|
|
|
|
}
|
|
|
|
if (fwController.text.trim().length > 0) {
|
|
|
|
params['serve'] = fwController.text;
|
|
|
|
}
|
|
|
|
bool sucess =
|
|
|
|
await customerProvider.setGuestInfo(context, params, showLoading: true);
|
|
|
|
if (sucess) {
|
|
|
|
Utils.showToast('保存成功');
|
|
|
|
// bus.emit('refresh_guest_info');
|
|
|
|
// bus.emit('refresh_guest_list_my');
|
|
|
|
Map data = {};
|
|
|
|
if (jkController.text.trim().length > 0) {
|
|
|
|
data['taboos'] = jkController.text;
|
|
|
|
}
|
|
|
|
if (xhController.text.trim().length > 0) {
|
|
|
|
data['like'] = xhController.text;
|
|
|
|
}
|
|
|
|
if (fwController.text.trim().length > 0) {
|
|
|
|
data['serve'] = fwController.text;
|
|
|
|
}
|
|
|
|
Navigator.pop(context, data);
|
|
|
|
// 刷新前一页
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///称谓
|
|
|
|
_initSexList() {
|
|
|
|
// String sexStr = detailEntity.sex;
|
|
|
|
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
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
_addNameSuffix(String name, String suffix) {
|
|
|
|
if (name == nameController.text && nameController.text.endsWith(suffix)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
nameController.text = name + suffix;
|
|
|
|
}
|
|
|
|
|
|
|
|
//姓名后缀
|
|
|
|
_nameSuffix() {
|
|
|
|
for (var item in sexList) {
|
|
|
|
if (item['select'] == true) {
|
|
|
|
return item['title'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _callButton(
|
|
|
|
{GestureTapCallback onPress,
|
|
|
|
content,
|
|
|
|
hasLeftBorder = true,
|
|
|
|
isSelect = false}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onPress,
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(84),
|
|
|
|
height: ScreenUtil().setHeight(48),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: isSelect ? MyColours.color_199095 : MyColours.color_fefefe,
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_6AB6B9,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
top: BorderSide(
|
|
|
|
color: MyColours.color_6AB6B9,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
left: hasLeftBorder
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours.color_6AB6B9,
|
|
|
|
width: ScreenUtil().setWidth(2))
|
|
|
|
: BorderSide.none,
|
|
|
|
right: BorderSide(
|
|
|
|
color: MyColours.color_6AB6B9,
|
|
|
|
width: ScreenUtil().setWidth(2)))),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(
|
|
|
|
content,
|
|
|
|
style: TextStyle(
|
|
|
|
color: isSelect ? Colors.white : MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _textfieldWidget(String title, String hint,
|
|
|
|
TextEditingController controller, FocusNode focusNode) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(60),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(220, 220, 220, 1)))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
height: ScreenUtil().setWidth(35),
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: controller,
|
|
|
|
focusNode: focusNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: hint,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
// if (controller == nameController) {
|
|
|
|
// nameFocus.unfocus();
|
|
|
|
// // _homeEnterModel.nameController.text =
|
|
|
|
// // nameStr + _nameSuffix();
|
|
|
|
// _addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
// }
|
|
|
|
print('fff');
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///忌口和喜好
|
|
|
|
Widget _textMulLine(
|
|
|
|
String title, String hintText, TextEditingController controller) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
)),
|
|
|
|
VEmptyView(20),
|
|
|
|
TextField(
|
|
|
|
controller: controller,
|
|
|
|
// keyboardType: TextInputType.number, //键盘类型,数字键盘
|
|
|
|
maxLines: 4,
|
|
|
|
// maxLength: 50,
|
|
|
|
|
|
|
|
// maxLengthEnforced: true,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_333333), //输入文本的样式
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// fillColor: MyColours.color_F9F9F9,
|
|
|
|
// fillColor: Colors.red,
|
|
|
|
// filled: true,
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
//未选中时候的颜色
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: MyColours.color_cccccc,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
),
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
//选中时外边框颜色
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
color: MyColours.app_main,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderRadius:
|
|
|
|
// BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
// color: Colors.red, width: ScreenUtil().setWidth(2))),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'编辑客户详情',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Consumer<CustomerProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateGuestInfo != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateGuestInfo,
|
|
|
|
callback: () {
|
|
|
|
if (model.pageStateGuestInfo == PageState.Empty) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
} else {
|
|
|
|
model.pageStateGuestInfo = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getGuestInfo();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦,",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
showText: '去添加',
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(50)),
|
|
|
|
child: ListView(
|
|
|
|
controller: scrollController,
|
|
|
|
children: [
|
|
|
|
// VEmptyView(30),
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(60),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(10)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(
|
|
|
|
220, 220, 220, 1)))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// color: Colors.red,
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
height: ScreenUtil().setWidth(35),
|
|
|
|
child: Text(
|
|
|
|
'姓名',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: nameController,
|
|
|
|
focusNode: nameFocus,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "填写姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
|
|
|
|
if (value.endsWith('先生') ||
|
|
|
|
value.endsWith('女士') ||
|
|
|
|
value.endsWith('公司')) {
|
|
|
|
nameStr = value.substring(
|
|
|
|
0, value.length - 2);
|
|
|
|
} else {
|
|
|
|
nameStr = value;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
nameFocus.unfocus();
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + _nameSuffix();
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// HEmptyView(40),
|
|
|
|
Row(
|
|
|
|
children: sexList.map((value) {
|
|
|
|
return _callButton(
|
|
|
|
onPress: () {
|
|
|
|
for (var item in sexList) {
|
|
|
|
item['select'] = false;
|
|
|
|
if (item['title'] ==
|
|
|
|
value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + item['title'];
|
|
|
|
if (nameStr != null &&
|
|
|
|
nameStr != '') {
|
|
|
|
_addNameSuffix(
|
|
|
|
nameStr, item['title']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
content: value['title'],
|
|
|
|
hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
isSelect: value['select']);
|
|
|
|
}).toList()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_textfieldWidget(
|
|
|
|
'电话', '填写电话', phoneController, phoneFocus),
|
|
|
|
_textfieldWidget('工作单位', '填写工作单位', adressController,
|
|
|
|
adressFocus),
|
|
|
|
_textfieldWidget('部门', '填写部门', departmentController,
|
|
|
|
departmentFocus),
|
|
|
|
_textfieldWidget('职位', '填写职位', positionController,
|
|
|
|
positionFocus),
|
|
|
|
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.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(50)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(
|
|
|
|
220, 220, 220, 1)))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// color: Colors.red,
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
height: ScreenUtil().setWidth(35),
|
|
|
|
child: Text(
|
|
|
|
'自定义标签',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
labelShow,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
Color.fromRGBO(193, 194, 63, 1),
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(showLabel
|
|
|
|
? 'c_arrow_up'
|
|
|
|
: 'c_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(24),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
|
|
|
|
VEmptyView(60),
|
|
|
|
_textMulLine(
|
|
|
|
'忌口', '点这里输入客户忌口的东西,请用逗号隔开。', jkController),
|
|
|
|
VEmptyView(30),
|
|
|
|
_textMulLine(
|
|
|
|
'喜好', '点这里输入客户喜好的东西,请用逗号隔开。', xhController),
|
|
|
|
VEmptyView(30),
|
|
|
|
_textMulLine(
|
|
|
|
'服务',
|
|
|
|
'点这里输入客户需要的服务,如安静的包间、远离厕所等,请用逗号隔开。',
|
|
|
|
fwController),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
RoundButton(
|
|
|
|
text: '保存',
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(90)),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
fontSize: 26,
|
|
|
|
isBold: false,
|
|
|
|
onPressed: () {
|
|
|
|
_setGuestInfo();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(30)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|