|
|
|
import 'package:easy_contact_picker/easy_contact_picker.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
import 'package:one_key/provider/coupon_provider.dart';
|
|
|
|
import 'package:one_key/provider/notebook_detail_model.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
...
|
...
|
@@ -19,7 +20,8 @@ import 'package:provider/provider.dart'; |
|
|
|
*/
|
|
|
|
class EditReserverPage extends StatefulWidget {
|
|
|
|
final String rid;
|
|
|
|
EditReserverPage(this.rid, {Key key}) : super(key: key);
|
|
|
|
final bool needBtn;
|
|
|
|
EditReserverPage(this.rid, {Key key, this.needBtn}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_EditReserverPageState createState() => _EditReserverPageState();
|
|
...
|
...
|
@@ -153,352 +155,482 @@ class _EditReserverPageState extends State<EditReserverPage> { |
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(children: [
|
|
|
|
//第一行 顾客姓名
|
|
|
|
body: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(children: [
|
|
|
|
//第一行 顾客姓名
|
|
|
|
|
|
|
|
VEmptyView(40),
|
|
|
|
VEmptyView(40),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_efefef))),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_efefef))),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: detailModel.nameController,
|
|
|
|
focusNode: _nameNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客人姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: detailModel.nameController,
|
|
|
|
focusNode: _nameNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "客人姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
|
|
|
|
nameStr = value;
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_nameNode.unfocus();
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + _nameSuffix();
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// HEmptyView(40),
|
|
|
|
Row(
|
|
|
|
children: detailModel.sexList.map((value) {
|
|
|
|
return _callButton(
|
|
|
|
onPress: () {
|
|
|
|
for (var item in detailModel.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']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
detailModel.notifyListeners();
|
|
|
|
},
|
|
|
|
content: value['title'],
|
|
|
|
hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
isSelect: value['select']);
|
|
|
|
}).toList()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// VEmptyView(30),
|
|
|
|
// MyDivider(double.infinity,
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// color:
|
|
|
|
// MyColours.color_efefef),
|
|
|
|
//电话
|
|
|
|
VEmptyView(20),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_efefef))),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: detailModel.phoneController,
|
|
|
|
focusNode: _phoneNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "电话",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
nameStr = value;
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_nameNode.unfocus();
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + _nameSuffix();
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
if (value.isEmpty || value.length > 11) {
|
|
|
|
//内容为空,或 超过11位
|
|
|
|
setState(() {
|
|
|
|
detailModel.userHistorys.clear();
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"keywords": value,
|
|
|
|
"sid": Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
};
|
|
|
|
detailModel.getUserHistorys(context, params);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
},
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = true;
|
|
|
|
});
|
|
|
|
// Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
// _controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_openAddressBook();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(84) * 3,
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Text('一键录入',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
decoration: TextDecoration.underline)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(180),
|
|
|
|
width: double.infinity,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: !(showPhoneHistory &&
|
|
|
|
detailModel.userHistorys.length > 0),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
border: Border.all(color: Colors.white),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_e5e5e5,
|
|
|
|
blurRadius: ScreenUtil().setWidth(20))
|
|
|
|
]),
|
|
|
|
width: ScreenUtil().setWidth(440),
|
|
|
|
height: detailModel.userHistorys.length > 1
|
|
|
|
? ScreenUtil().setWidth(180)
|
|
|
|
: ScreenUtil().setWidth(104),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: MediaQuery.removePadding(
|
|
|
|
context: context,
|
|
|
|
removeTop: true,
|
|
|
|
child: ListView.builder(
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
detailModel.phoneController.text =
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index].phone;
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// _homeEnterModel
|
|
|
|
// .userHistorys[index].rname +
|
|
|
|
// _nameSuffix();
|
|
|
|
// HEmptyView(40),
|
|
|
|
Row(
|
|
|
|
children: detailModel.sexList.map((value) {
|
|
|
|
return _callButton(
|
|
|
|
onPress: () {
|
|
|
|
for (var item in detailModel.sexList) {
|
|
|
|
item['select'] = false;
|
|
|
|
if (item['title'] == value['title']) {
|
|
|
|
item['select'] = true;
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + item['title'];
|
|
|
|
if (nameStr != null &&
|
|
|
|
nameStr != '') {
|
|
|
|
_addNameSuffix(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index].rname,
|
|
|
|
_nameSuffix());
|
|
|
|
nameStr = detailModel
|
|
|
|
.userHistorys[index].rname;
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
nameStr, item['title']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
detailModel.notifyListeners();
|
|
|
|
},
|
|
|
|
content: value['title'],
|
|
|
|
hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
isSelect: value['select']);
|
|
|
|
}).toList()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// VEmptyView(30),
|
|
|
|
// MyDivider(double.infinity,
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// color:
|
|
|
|
// MyColours.color_efefef),
|
|
|
|
//电话
|
|
|
|
VEmptyView(20),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color:
|
|
|
|
MyColours.color_efefef))),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: detailModel.phoneController,
|
|
|
|
focusNode: _phoneNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "电话",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
border: InputBorder.none,
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
if (value.isEmpty ||
|
|
|
|
value.length > 11) {
|
|
|
|
//内容为空,或 超过11位
|
|
|
|
setState(() {
|
|
|
|
detailModel.userHistorys.clear();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(102),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(detailModel
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
detailModel
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index].phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"keywords": value,
|
|
|
|
"sid": Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
};
|
|
|
|
detailModel.getUserHistorys(
|
|
|
|
context, params);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
},
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = true;
|
|
|
|
});
|
|
|
|
// Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
// _controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_openAddressBook();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(84) * 3,
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Text('一键录入',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
decoration:
|
|
|
|
TextDecoration.underline)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(180),
|
|
|
|
width: double.infinity,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: !(showPhoneHistory &&
|
|
|
|
detailModel.userHistorys.length > 0),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
border: Border.all(color: Colors.white),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_e5e5e5,
|
|
|
|
blurRadius:
|
|
|
|
ScreenUtil().setWidth(20))
|
|
|
|
]),
|
|
|
|
width: ScreenUtil().setWidth(440),
|
|
|
|
height: detailModel.userHistorys.length > 1
|
|
|
|
? ScreenUtil().setWidth(180)
|
|
|
|
: ScreenUtil().setWidth(104),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: MediaQuery.removePadding(
|
|
|
|
context: context,
|
|
|
|
removeTop: true,
|
|
|
|
child: ListView.builder(
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
detailModel.phoneController
|
|
|
|
.text = detailModel
|
|
|
|
.userHistorys[
|
|
|
|
index]
|
|
|
|
.phone !=
|
|
|
|
null
|
|
|
|
? detailModel
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone
|
|
|
|
: '';
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// _homeEnterModel
|
|
|
|
// .userHistorys[index].rname +
|
|
|
|
// _nameSuffix();
|
|
|
|
_addNameSuffix(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname,
|
|
|
|
_nameSuffix());
|
|
|
|
nameStr = detailModel
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname;
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
detailModel.userHistorys
|
|
|
|
.clear();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(102),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(detailModel
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
detailModel
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
2))
|
|
|
|
: BorderSide
|
|
|
|
.none)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment
|
|
|
|
.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent:
|
|
|
|
ScreenUtil().setWidth(104),
|
|
|
|
itemCount:
|
|
|
|
detailModel.userHistorys.length,
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(top: ScreenUtil().setWidth(60)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '返回',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
width: ScreenUtil().setWidth(180),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
borderColor: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
onPressed: () {
|
|
|
|
// setState(() {
|
|
|
|
// nameStr = '';
|
|
|
|
// detailModel.nameController.text = '';
|
|
|
|
// detailModel.phoneController.text = '';
|
|
|
|
// });
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
widget.needBtn
|
|
|
|
? RoundButton(
|
|
|
|
text: '保存并发短信',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
width: ScreenUtil().setWidth(200),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: MyColours.color_199095,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_199095,
|
|
|
|
onPressed: () async {
|
|
|
|
if (nameStr == null ||
|
|
|
|
nameStr.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写客人姓名');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (detailModel.phoneController.text
|
|
|
|
.trim()
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请填写电话');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!Utils.phoneRegExp(
|
|
|
|
detailModel.phoneController.text)) {
|
|
|
|
Utils.showToast('手机号错误,请修改正确');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String sex = '1';
|
|
|
|
for (var item in detailModel.sexList) {
|
|
|
|
if (item['select']) {
|
|
|
|
sex = item['code'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool sucess = await detailModel
|
|
|
|
.upReserveInfo(context, widget.rid,
|
|
|
|
name: nameStr,
|
|
|
|
sex: sex,
|
|
|
|
phone: detailModel
|
|
|
|
.phoneController.text,
|
|
|
|
showLoading: true);
|
|
|
|
if (sucess) {
|
|
|
|
bus.emit(
|
|
|
|
"refresh_tablemanager"); //刷新桌位
|
|
|
|
bus.emit(
|
|
|
|
"refresh_book_list"); //刷新已预订列表
|
|
|
|
bus.emit("refresh_detail");
|
|
|
|
UserModel userModel =
|
|
|
|
Provider.of<UserModel>(context,
|
|
|
|
listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"rid": widget.rid,
|
|
|
|
"sid": userModel.user.sellerid
|
|
|
|
};
|
|
|
|
CouponProvider couponProvider =
|
|
|
|
Provider.of<CouponProvider>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
|
|
|
bool success = await couponProvider
|
|
|
|
.sendSMSWxSendSms(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Navigator.of(context).pop(
|
|
|
|
detailModel
|
|
|
|
.userHistorys[index].rname,
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
|
|
itemCount: detailModel.userHistorys.length,
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
.phoneController.text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
RoundButton(
|
|
|
|
text: widget.needBtn ? '仅保存' : '保存',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
width: ScreenUtil().setWidth(180),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: widget.needBtn
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_199095,
|
|
|
|
gradientEnd: widget.needBtn
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_199095,
|
|
|
|
textColor: widget.needBtn
|
|
|
|
? MyColours.color_333333
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_199095,
|
|
|
|
onPressed: () async {
|
|
|
|
if (nameStr == null ||
|
|
|
|
nameStr.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写客人姓名');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(top: ScreenUtil().setWidth(60)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '返回',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
width: ScreenUtil().setWidth(180),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
textColor: MyColours.color_333333,
|
|
|
|
borderColor: MyColours.color_199095,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
nameStr = '';
|
|
|
|
detailModel.nameController.text = '';
|
|
|
|
detailModel.phoneController.text = '';
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
RoundButton(
|
|
|
|
text: '保存',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(70),
|
|
|
|
width: ScreenUtil().setWidth(180),
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
onPressed: () async {
|
|
|
|
if (nameStr == null || nameStr.trim().length == 0) {
|
|
|
|
Utils.showToast('请填写客人姓名');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (detailModel.phoneController.text
|
|
|
|
.trim()
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请填写电话');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!Utils.phoneRegExp(
|
|
|
|
detailModel.phoneController.text)) {
|
|
|
|
Utils.showToast('手机号错误,请修改正确');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String sex = '1';
|
|
|
|
for (var item in detailModel.sexList) {
|
|
|
|
if (item['select']) {
|
|
|
|
sex = item['code'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool sucess = await detailModel.upReserveInfo(
|
|
|
|
context, widget.rid,
|
|
|
|
name: nameStr,
|
|
|
|
sex: sex,
|
|
|
|
phone: detailModel.phoneController.text);
|
|
|
|
if (sucess) {
|
|
|
|
EventBus()
|
|
|
|
.emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
bus.emit("refresh_detail");
|
|
|
|
|
|
|
|
if (detailModel.phoneController.text.trim().length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请填写电话');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String sex = '1';
|
|
|
|
for (var item in detailModel.sexList) {
|
|
|
|
if (item['select']) {
|
|
|
|
sex = item['code'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool sucess = await detailModel.upReserveInfo(
|
|
|
|
context, widget.rid,
|
|
|
|
name: nameStr,
|
|
|
|
sex: sex,
|
|
|
|
phone: detailModel.phoneController.text);
|
|
|
|
if (sucess) {
|
|
|
|
EventBus().emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
bus.emit("refresh_detail");
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(40)
|
|
|
|
])));
|
|
|
|
Navigator.of(context)
|
|
|
|
.pop(detailModel.phoneController.text);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(40)
|
|
|
|
])))));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|