|
...
|
...
|
@@ -1219,6 +1219,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
print(userModel.user.openid);
|
|
|
|
print(widget.rid);
|
|
|
|
print(widget.uid);
|
|
|
|
bool notDo = userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
(widget.uid != userModel.user.openid &&
|
|
|
|
userModel.user.role_name != '前台') &&
|
|
|
|
userModel.user.role_name != '前台';
|
|
|
|
|
|
|
|
bool notDoWechat = userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid != userModel.user.openid;
|
|
|
|
return Scaffold(
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -1589,17 +1600,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
detailEntity.cusdem ??
|
|
|
|
"",
|
|
|
|
callback: () {
|
|
|
|
if (userModel.user
|
|
|
|
.role_name !=
|
|
|
|
'管理员' &&
|
|
|
|
userModel.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user
|
|
|
|
.openid) {
|
|
|
|
if (notDo) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
//备注弹窗
|
|
...
|
...
|
@@ -2162,17 +2163,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
text: '填写预订人信息',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
textColor: userModel.user.role_name != '管理员' &&
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid
|
|
|
|
textColor: notDo
|
|
|
|
? MyColours
|
|
|
|
.color_999999
|
|
|
|
: Colors.white,
|
|
...
|
...
|
@@ -2182,47 +2173,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
.setWidth(240),
|
|
|
|
radius: ScreenUtil()
|
|
|
|
.setWidth(10),
|
|
|
|
borderColor: userModel.user.role_name != '管理员' &&
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid
|
|
|
|
borderColor: notDo
|
|
|
|
? MyColours
|
|
|
|
.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_199095,
|
|
|
|
gradientStart: userModel.user.role_name != '管理员' &&
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid
|
|
|
|
gradientStart: notDo
|
|
|
|
? MyColours
|
|
|
|
.color_ffffff
|
|
|
|
: MyColours
|
|
|
|
.color_199095,
|
|
|
|
gradientEnd: userModel.user.role_name != '管理员' &&
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid
|
|
|
|
gradientEnd: notDo
|
|
|
|
? MyColours
|
|
|
|
.color_ffffff
|
|
|
|
: MyColours
|
|
...
|
...
|
@@ -2231,18 +2192,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
// setState(() {
|
|
|
|
// setTop = true;
|
|
|
|
// });
|
|
|
|
if (userModel.user
|
|
|
|
.role_name !=
|
|
|
|
'管理员' &&
|
|
|
|
userModel.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid) {
|
|
|
|
if (notDo) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
NavigatorUtil
|
|
...
|
...
|
@@ -2494,20 +2444,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
null &&
|
|
|
|
formatPhone !=
|
|
|
|
'') {
|
|
|
|
if (userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'管理员' &&
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid !=
|
|
|
|
"null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel
|
|
|
|
.user
|
|
|
|
.openid) {
|
|
|
|
if (notDo) {
|
|
|
|
} else {
|
|
|
|
DialogUtil
|
|
|
|
.goPhone(
|
|
...
|
...
|
@@ -2672,11 +2609,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
flex: 1,
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil
|
|
|
|
.goOrderAdvanceHomePage(
|
|
|
|
context,
|
|
|
|
detailEntity,
|
|
|
|
widget.rid);
|
|
|
|
if (!notDoWechat) {
|
|
|
|
NavigatorUtil
|
|
|
|
.goOrderAdvanceHomePage(
|
|
|
|
context,
|
|
|
|
detailEntity,
|
|
|
|
widget.rid);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
...
|
...
|
@@ -2687,8 +2626,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
width: w(1),
|
|
|
|
color: MyColours
|
|
|
|
.color_438E93),
|
|
|
|
color: notDoWechat
|
|
|
|
? MyColours
|
|
|
|
.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_438E93),
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(
|
|
|
|
ScreenUtil()
|
|
...
|
...
|
@@ -2698,8 +2640,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('预点菜',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_438E93,
|
|
|
|
color: notDoWechat
|
|
|
|
? MyColours
|
|
|
|
.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_438E93,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
...
|
...
|
@@ -2736,17 +2681,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
// _nameStr.length -
|
|
|
|
// 1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
NavigatorUtil
|
|
|
|
.goInvicationPage(
|
|
|
|
context,
|
|
|
|
detailEntity.id,
|
|
|
|
);
|
|
|
|
if (!notDoWechat) {
|
|
|
|
NavigatorUtil
|
|
|
|
.goInvicationPage(
|
|
|
|
context,
|
|
|
|
detailEntity.id,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color:
|
|
|
|
MyColours.color_199095,
|
|
|
|
color: notDoWechat
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_199095,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(
|
|
|
|
ScreenUtil()
|
|
...
|
...
|
@@ -3165,10 +3113,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
horizontal: ScreenUtil().setHeight(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid != userModel.user.openid
|
|
|
|
color: notDo
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
...
|
...
|
@@ -3183,11 +3128,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
Expanded(
|
|
|
|
child: _cancelAndChangeBtn(() {
|
|
|
|
print('点击变更预订');
|
|
|
|
if (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user.openid) {
|
|
|
|
if (notDo) {
|
|
|
|
} else {
|
|
|
|
NavigatorUtil.goNoteBookChangeFPage(
|
|
|
|
context,
|
|
...
|
...
|
@@ -3195,50 +3136,24 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
|
|
widget.rid);
|
|
|
|
}
|
|
|
|
}, '变更预订',
|
|
|
|
fontColor: userModel
|
|
|
|
.user.role_name !=
|
|
|
|
'管理员' &&
|
|
|
|
userModel
|
|
|
|
.user.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user.openid
|
|
|
|
fontColor: notDo
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095)),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
color:
|
|
|
|
userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user.openid
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
color: notDo
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: _cancelAndChangeBtn(() {
|
|
|
|
if (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user.openid) {
|
|
|
|
if (notDo) {
|
|
|
|
} else {
|
|
|
|
_showCancelWidget(context);
|
|
|
|
}
|
|
|
|
}, '取消预订',
|
|
|
|
fontColor: userModel
|
|
|
|
.user.role_name !=
|
|
|
|
'管理员' &&
|
|
|
|
userModel
|
|
|
|
.user.role_name !=
|
|
|
|
'店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
widget.uid !=
|
|
|
|
userModel.user.openid
|
|
|
|
fontColor: notDo
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095)),
|
|
|
|
],
|
|
...
|
...
|
@@ -3284,15 +3199,19 @@ class TitleAndBtn extends StatelessWidget { |
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
bool hasAuthority = true; //
|
|
|
|
if (title == "备注") {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
if (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
uid != "null" &&
|
|
|
|
uid != userModel.user.openid) {
|
|
|
|
hasAuthority = false;
|
|
|
|
}
|
|
|
|
// if (title == "备注") {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
bool notDo = (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
uid != "null" &&
|
|
|
|
(uid != userModel.user.openid &&
|
|
|
|
userModel.user.role_name != '前台') &&
|
|
|
|
userModel.user.role_name != '前台') ||
|
|
|
|
userModel.user.role_name == '迎宾';
|
|
|
|
if (notDo) {
|
|
|
|
hasAuthority = false;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -3312,16 +3231,24 @@ class TitleAndBtn extends StatelessWidget { |
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
"选填",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
softWrap: true,
|
|
|
|
),
|
|
|
|
if (Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.role_name !=
|
|
|
|
'迎宾')
|
|
|
|
Text(
|
|
|
|
"选填",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
softWrap: true,
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
InkWell(
|
|
|
|
onTap: callback,
|
|
|
|
onTap: () {
|
|
|
|
if (hasAuthority) {
|
|
|
|
callback();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(44),
|
|
|
|
decoration: BoxDecoration(
|
|
...
|
...
|
@@ -3367,6 +3294,7 @@ class TitleAndTextfield extends StatefulWidget { |
|
|
|
final bool isPrice;
|
|
|
|
|
|
|
|
final VoidCallback callback;
|
|
|
|
final String uid;
|
|
|
|
|
|
|
|
const TitleAndTextfield(
|
|
|
|
{Key key,
|
|
...
|
...
|
@@ -3378,7 +3306,8 @@ class TitleAndTextfield extends StatefulWidget { |
|
|
|
this.controller,
|
|
|
|
this.focusNode,
|
|
|
|
this.isPrice = true,
|
|
|
|
this.callback})
|
|
|
|
this.callback,
|
|
|
|
this.uid})
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -3389,9 +3318,23 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> |
|
|
|
with WidgetsBindingObserver {
|
|
|
|
// FocusNode numberFocusNode = new FocusNode();
|
|
|
|
OverlayEntry overlayEntry;
|
|
|
|
bool hasAuthority = true; //
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
// if (title == "备注") {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
bool notDo = (userModel.user.role_name != '管理员' &&
|
|
|
|
userModel.user.role_name != '店长' &&
|
|
|
|
widget.uid != "null" &&
|
|
|
|
(widget.uid != userModel.user.openid &&
|
|
|
|
userModel.user.role_name != '前台') &&
|
|
|
|
userModel.user.role_name != '前台') ||
|
|
|
|
userModel.user.role_name == '迎宾';
|
|
|
|
if (notDo) {
|
|
|
|
hasAuthority = false;
|
|
|
|
}
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
// if (Platform.isIOS) {
|
|
|
|
widget.focusNode.addListener(() {
|
|
...
|
...
|
@@ -3538,13 +3481,14 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> |
|
|
|
// widget.detailModel.strTF.trim().length > 0
|
|
|
|
// ? Text("¥", style: TextStyle(color: MyColours.color_199095))
|
|
|
|
// : SizedBox(),
|
|
|
|
Text(
|
|
|
|
"选填",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
softWrap: true,
|
|
|
|
),
|
|
|
|
if (hasAuthority)
|
|
|
|
Text(
|
|
|
|
"选填",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
softWrap: true,
|
|
|
|
),
|
|
|
|
HEmptyView(6),
|
|
|
|
Container(
|
|
|
|
constraints:
|
|
...
|
...
|
@@ -3554,7 +3498,9 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> |
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_199095))),
|
|
|
|
color: hasAuthority
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_999999))),
|
|
|
|
child: IntrinsicWidth(
|
|
|
|
child: TextField(
|
|
|
|
controller: widget.controller,
|
|
...
|
...
|
@@ -3563,6 +3509,7 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> |
|
|
|
// LengthLimitingTextInputFormatter(9),
|
|
|
|
// FilteringTextInputFormatter.digitsOnly
|
|
|
|
// ],
|
|
|
|
enabled: hasAuthority,
|
|
|
|
|
|
|
|
inputFormatters: widget.isPrice
|
|
|
|
? [
|
|
...
|
...
|
@@ -3577,13 +3524,17 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> |
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
color: hasAuthority
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_333333),
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "修改",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
color: hasAuthority
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
),
|
|
|
|
prefix: widget.detailModel.strTF != null &&
|
...
|
...
|
|