|
...
|
...
|
@@ -43,6 +43,7 @@ import 'dart:ui' as ui; |
|
|
|
|
|
|
|
import '../../app.dart';
|
|
|
|
|
|
|
|
import '../../provider/customer_provider.dart';
|
|
|
|
import '../../widgets/special_text/my_extended_text_selection_controls.dart';
|
|
|
|
|
|
|
|
class InvicationPage extends StatefulWidget {
|
|
...
|
...
|
@@ -143,7 +144,8 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
bool _showOverlay = false;
|
|
|
|
|
|
|
|
List<String> memberList = [];
|
|
|
|
String memberShow = '会员状态未知';
|
|
|
|
String isMember = '会员状态未知';
|
|
|
|
String memberid;
|
|
|
|
int memberIndex;
|
|
|
|
|
|
|
|
List<String> styleList = []; //餐单类型
|
|
...
|
...
|
@@ -260,6 +262,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
await _getCustomerActivityBaseinfo();
|
|
|
|
|
|
|
|
await _getReserveDetail(showCicle: false);
|
|
|
|
|
|
|
|
await _getTablesPhoto();
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid
|
|
...
|
...
|
@@ -336,6 +339,34 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
_timer = Timer.periodic(Duration(seconds: 1), call);
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取手机号是否为商家会员
|
|
|
|
_getIsMemberByPhone(String phone) async {
|
|
|
|
CustomerProvider customerProvider =
|
|
|
|
Provider.of<CustomerProvider>(context, listen: false);
|
|
|
|
Map<String, String> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'phone': phone
|
|
|
|
};
|
|
|
|
Map temp = await customerProvider.getIsMemberByPhone(context, params);
|
|
|
|
if (temp == null) {
|
|
|
|
//会员状态未知
|
|
|
|
isMember = '会员状态未知';
|
|
|
|
memberIndex = null;
|
|
|
|
memberid = null;
|
|
|
|
} else if (temp['is_member'] == '1') {
|
|
|
|
//会员
|
|
|
|
isMember = '会员';
|
|
|
|
memberIndex = 0;
|
|
|
|
memberid = temp['id'];
|
|
|
|
} else {
|
|
|
|
//非会员
|
|
|
|
isMember = '非会员';
|
|
|
|
memberIndex = 1;
|
|
|
|
memberid = temp['id'];
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
|
|
|
|
_showConfirmWidget(
|
|
|
|
{needBack = false,
|
|
|
|
needSex = false,
|
|
...
|
...
|
@@ -893,6 +924,11 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
ddateStr = detailEntity.ddateStr;
|
|
|
|
reserverPhone = detailEntity.phone;
|
|
|
|
_baseIndoProvider.phoneController.text = reserverPhone.replaceAll(' ', '');
|
|
|
|
|
|
|
|
if (_baseIndoProvider.phoneController.text.length > 0) {
|
|
|
|
//获取是否是会员
|
|
|
|
_getIsMemberByPhone(_baseIndoProvider.phoneController.text);
|
|
|
|
}
|
|
|
|
dateSolt = detailEntity.ddate_solt;
|
|
|
|
nameWidget = detailEntity.rname == null ||
|
|
|
|
detailEntity.rname == '' ||
|
|
...
|
...
|
@@ -1806,6 +1842,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
.sellerid,
|
|
|
|
};
|
|
|
|
_baseIndoProvider.getUserHistorys(context, params);
|
|
|
|
_getIsMemberByPhone(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_phoneNode.unfocus();
|
|
...
|
...
|
@@ -1939,6 +1976,13 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
HEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (_baseIndoProvider.phoneController.text
|
|
|
|
.trim()
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请先输入电话,再设置会员信息!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
|
|
...
|
...
|
@@ -1946,18 +1990,76 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
context, memberList, (value) async {
|
|
|
|
if (value != null) {
|
|
|
|
memberIndex = value.first;
|
|
|
|
memberShow = memberList[memberIndex];
|
|
|
|
isMember = memberList[memberIndex];
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
CustomerProvider customerProvider =
|
|
|
|
Provider.of<CustomerProvider>(context,
|
|
|
|
listen: false);
|
|
|
|
if (memberid != null &&
|
|
|
|
memberIndex != null) {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'id': memberid,
|
|
|
|
'is_member':
|
|
|
|
memberIndex == 0 ? '1' : '0'
|
|
|
|
};
|
|
|
|
|
|
|
|
if (nameStr != null &&
|
|
|
|
nameStr.trim().length > 0) {
|
|
|
|
pramas['rname'] = nameStr;
|
|
|
|
pramas['sex'] =
|
|
|
|
'${sexList.indexOf(sexStr) + 1}';
|
|
|
|
}
|
|
|
|
if (_baseIndoProvider.phoneController.text
|
|
|
|
.replaceAll(' ', '')
|
|
|
|
.length >
|
|
|
|
0) {
|
|
|
|
pramas['phone'] = _baseIndoProvider
|
|
|
|
.phoneController.text
|
|
|
|
.replaceAll(' ', '');
|
|
|
|
}
|
|
|
|
|
|
|
|
await customerProvider.setGuestInfo(
|
|
|
|
context, pramas);
|
|
|
|
} else {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'sellerid': Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
'uid': Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.openid,
|
|
|
|
'phone': _baseIndoProvider
|
|
|
|
.phoneController.text
|
|
|
|
.replaceAll(' ', '')
|
|
|
|
};
|
|
|
|
if (memberIndex != null) {
|
|
|
|
pramas['is_member'] =
|
|
|
|
memberIndex == 0 ? '1' : '0';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nameStr != null &&
|
|
|
|
nameStr.trim().length > 0) {
|
|
|
|
pramas['rname'] = nameStr;
|
|
|
|
pramas['sex'] =
|
|
|
|
'${sexList.indexOf(sexStr) + 1}';
|
|
|
|
}
|
|
|
|
|
|
|
|
await customerProvider.setInsGuest(
|
|
|
|
context, pramas);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, selecteds: [memberIndex ?? 0])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
memberShow,
|
|
|
|
isMember,
|
|
|
|
style: TextStyle(
|
|
|
|
color: memberShow == '会员状态未知'
|
|
|
|
color: isMember == '会员状态未知'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
...
|
...
|
@@ -1972,65 +2074,65 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
//餐单类型
|
|
|
|
enterMore
|
|
|
|
? Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
// top: ScreenUtil().setWidth(40),
|
|
|
|
bottom: ScreenUtil().setWidth(40)),
|
|
|
|
height: ScreenUtil().setWidth(68),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(12)),
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'餐单类型',
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, styleList, (value) async {
|
|
|
|
if (value != null) {
|
|
|
|
styleIndex = value.first;
|
|
|
|
styleShow = styleList[styleIndex];
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}, selecteds: [styleIndex ?? 0])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
styleShow,
|
|
|
|
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)),
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
// enterMore
|
|
|
|
// ? Container(
|
|
|
|
// margin: EdgeInsets.only(
|
|
|
|
// // top: ScreenUtil().setWidth(40),
|
|
|
|
// bottom: ScreenUtil().setWidth(40)),
|
|
|
|
// height: ScreenUtil().setWidth(68),
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(12)),
|
|
|
|
// // color: Colors.red,
|
|
|
|
// border: Border.all(
|
|
|
|
// width: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_DBDBDB)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// '餐单类型',
|
|
|
|
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(28),
|
|
|
|
// color: MyColours.color_353535),
|
|
|
|
// ),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
|
|
|
|
// DialogUtil.showSelectCusmanDialog(
|
|
|
|
// context, styleList, (value) async {
|
|
|
|
// if (value != null) {
|
|
|
|
// styleIndex = value.first;
|
|
|
|
// styleShow = styleList[styleIndex];
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
// }
|
|
|
|
// }, selecteds: [styleIndex ?? 0])
|
|
|
|
// .then((value) {});
|
|
|
|
// },
|
|
|
|
// child: Row(children: [
|
|
|
|
// Text(
|
|
|
|
// styleShow,
|
|
|
|
// 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)),
|
|
|
|
// ]),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ))
|
|
|
|
// : SizedBox(),
|
|
|
|
|
|
|
|
//备注:
|
|
|
|
Column(
|
|
...
|
...
|
@@ -2205,6 +2307,8 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
_getIsMemberByPhone(_baseIndoProvider
|
|
|
|
.userHistorys[index].phone);
|
|
|
|
needHistory = true;
|
|
|
|
_showConfirmWidget(
|
|
|
|
needHistory: true, index: index);
|
|
...
|
...
|
@@ -3193,6 +3297,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
};
|
|
|
|
_baseIndoProvider.getUserHistorys(
|
|
|
|
context, params);
|
|
|
|
_getIsMemberByPhone(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_phoneNode.unfocus();
|
|
...
|
...
|
@@ -3566,6 +3671,7 @@ class InvicationPageState extends State<InvicationPage> |
|
|
|
_addNameSuffix(fullName, sexStr);
|
|
|
|
});
|
|
|
|
_updateReserve();
|
|
|
|
_getIsMemberByPhone(_baseIndoProvider.phoneController.text);
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|