Commit c2372ef5aa0b8119479c7ee1690bf25bc397e803

Authored by wdn127929
1 parent a569f4ea

订座详情+请客人反馈

... ... @@ -104,6 +104,8 @@ class NotebookDetail {
String gid;
String place_order_name; //下单人
dynamic is_user_comments; //是否评价过
String get statuImgAssets {
... ... @@ -300,7 +302,7 @@ class NotebookDetail {
@override
String toString() {
return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,place_order_name:$place_order_name}';
return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,place_order_name:$place_order_name,is_user_comments:$is_user_comments}';
}
}
... ...
... ... @@ -49,7 +49,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
? null
: OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>)
..gid = json['gid'] as String
..place_order_name = json['place_order_name'] as String;
..place_order_name = json['place_order_name'] as String
..is_user_comments = json['is_user_comments'] as dynamic;
}
Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
... ... @@ -83,7 +84,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
'order': instance.order,
'order_info': instance.orderInfo,
'gid': instance.gid,
'place_order_name': instance.place_order_name
'place_order_name': instance.place_order_name,
'is_user_comments': instance.is_user_comments,
};
OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
return OrderInfo(
... ...
... ... @@ -1458,36 +1458,34 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
"预订日期", detailEntity.ddateF,
textColor:
MyColours.color_333333),
Stack(
alignment: Alignment.center,
children: <Widget>[
RowMultiText("时段",
detailEntity.ddateSolt,
textColor:
MyColours.color_333333),
Image.asset(
detailEntity.statuImgAssets,
width: ScreenUtil()
.setWidth(114),
height:
ScreenUtil().setWidth(56),
)
],
),
TitleAndBtn(
title: "时间",
content: ddateHm,
list: personNumList,
detailModel: model,
uid: widget.uid,
callback: () {
//时间弹窗
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
_showDateChooseWidget(context);
},
Row(
children: [
Expanded(
flex: 1,
child: RowMultiText("时段",
detailEntity.ddateSolt,
textColor: MyColours
.color_333333)),
HEmptyView(60),
Expanded(
flex: 1,
child: TitleAndBtn(
title: "时间",
content: ddateHm,
list: personNumList,
detailModel: model,
uid: widget.uid,
callback: () {
//时间弹窗
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
_showDateChooseWidget(
context);
},
)),
],
),
// Offstage(
... ... @@ -1547,33 +1545,52 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// ])
// .then((value) {});
// }),
TitleAndTextfield(
title: "人数",
detailModel: detailModel,
rid: widget.rid,
isPrice: false,
controller: pnumC,
focusNode: pnumF,
uid: widget.uid,
callback: () async {
bool sucess =
await detailModel
.upReserveInfo(
context,
widget.rid,
actualPum:
pnumC.text);
if (sucess) {
bus.emit(
"refresh_book_list"); //刷新已预订列表
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
await _getReserveDetail(
showCicle: false);
}
}),
Row(children: [
Expanded(
flex: 1,
child: TitleAndTextfield(
title: "人数",
detailModel: detailModel,
rid: widget.rid,
isPrice: false,
controller: pnumC,
focusNode: pnumF,
uid: widget.uid,
callback: () async {
bool sucess =
await detailModel
.upReserveInfo(
context,
widget.rid,
actualPum:
pnumC
.text);
if (sucess) {
bus.emit(
"refresh_book_list"); //刷新已预订列表
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
await _getReserveDetail(
showCicle: false);
}
})),
HEmptyView(60),
Expanded(
flex: 1,
child: TitleAndTextfield(
title: "消费金额",
detailModel: detailModel,
rid: widget.rid,
isPrice: true,
uid: widget.uid,
controller: detailModel
.numController,
focusNode: priceF,
))
]),
// ),
// Offstage(
// offstage:
... ... @@ -1627,42 +1644,54 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// ],
// ),
// ),
TitleAndTextfield(
title: "消费金额",
detailModel: detailModel,
rid: widget.rid,
isPrice: true,
uid: widget.uid,
controller:
detailModel.numController,
focusNode: priceF,
),
Offstage(
offstage: detailEntity
.place_order_name ==
'' ||
detailEntity
.place_order_name ==
null,
child: RowMultiText("下单人",
'${detailEntity.place_order_name ?? ''}',
textColor:
MyColours.color_333333),
),
Offstage(
offstage:
detailEntity.nick_name ==
'' ||
detailEntity.nick_name ==
null,
child: RowMultiText(
"记录人",
'${detailEntity.nick_name ?? ''}' +
' ' +
'${detailEntity.seller_user_phone ?? ''}',
textColor:
MyColours.color_333333),
),
Stack(
alignment: Alignment.topCenter,
children: [
Column(
children: [
// Offstage(
// offstage: detailEntity
// .place_order_name ==
// '' ||
// detailEntity
// .place_order_name ==
// null,
// child:
// ),
RowMultiText("下单人",
'${detailEntity.place_order_name ?? ''}',
textColor: MyColours
.color_333333),
// Offstage(
// offstage: detailEntity
// .nick_name ==
// '' ||
// detailEntity
// .nick_name ==
// null,
// child:
RowMultiText(
"记录人",
'${detailEntity.nick_name ?? ''}' +
' ' +
'${detailEntity.seller_user_phone ?? ''}',
textColor: MyColours
.color_333333),
// ),
],
),
Positioned(
top: w(10),
child: Image.asset(
detailEntity
.statuImgAssets,
width: ScreenUtil()
.setWidth(114),
height: ScreenUtil()
.setWidth(56),
))
]),
RowMultiText(
"下单时间",
_getDateTime(
... ... @@ -2885,75 +2914,62 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
),
)),
// : SizedBox(),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
// String _nameStr = '';
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables.length;
// i++) {
// _nameStr +=
// '${detailEntity.tables[i].name},';
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(
// 0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr =
// _nameStr.substring(
// 0,
// _nameStr.length -
// 1);
// }
if (Utils.getAuthority(
context, '通知客户') ||
widget.uid ==
userModel
.user.openid) {
NavigatorUtil
.goInvicationPage(
context,
detailEntity.id,
);
}
},
child: Container(
decoration: BoxDecoration(
color: !(Utils.getAuthority(
if ('${detailEntity.is_user_comments}' !=
'1')
Expanded(
flex: 1,
child: InkWell(
onTap: () {
// if (Utils.getAuthority(
// context, '请客人反馈') ||
// widget.uid ==
// userModel
// .user.openid) {
Utils.goShareFeedbackPageToWeChat(
context,
title: '欢迎来吐槽',
img:
'https://nosqn.colorcun.com/share_feedback.jpg',
rid: widget.rid,
// oid: oid,
sid: Provider.of<
UserModel>(
context,
'通知客户') ||
widget.uid ==
userModel.user
.openid)
? MyColours.color_999999
: MyColours
.color_199095,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10)),
),
child: Align(
alignment: Alignment.center,
child: Text('通知客户',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil()
.setSp(
34))),
listen: false)
.user
.sellerid);
// }
},
child: Container(
margin: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20)),
decoration: BoxDecoration(
color: MyColours
.color_ffffff,
border: Border.all(
width: w(1),
color: MyColours
.color_438E93),
borderRadius: BorderRadius
.circular(ScreenUtil()
.setWidth(10)),
),
child: Align(
alignment:
Alignment.center,
child: Text('请客人反馈',
style: TextStyle(
color: MyColours
.color_438E93,
fontSize:
ScreenUtil()
.setSp(
34))),
),
),
),
)),
)),
// Expanded(
// flex: 1,
... ... @@ -3340,83 +3356,274 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// ],
)),
Offstage(
offstage: ((detailEntity.orderInfo != null &&
detailEntity.orderInfo.status == "3") ||
detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6")
? true
: false,
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(84),
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
border: Border.all(
color: !(Utils.getAuthority(
context, '变更预订') ||
widget.uid == userModel.user.openid)
? MyColours.color_999999
: MyColours.color_199095,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
),
// child: Text('fff'),
child: Material(
color: Colors.transparent,
child: Row(
children: [
Expanded(
child: _cancelAndChangeBtn(() {
print('点击变更预订');
if (Utils.getAuthority(
context, '变更预订') ||
widget.uid ==
userModel.user.openid) {
NavigatorUtil.goNoteBookChangeFPage(
context,
detailEntity,
widget.rid);
}
}, '变更预订',
fontColor: !(Utils.getAuthority(
context, '变更预订') ||
widget.uid ==
userModel.user.openid)
? MyColours.color_999999
: MyColours.color_199095)),
MyDivider(
ScreenUtil().setWidth(2),
ScreenUtil().setWidth(50),
color: !(Utils.getAuthority(
offstage: ((detailEntity.orderInfo != null &&
detailEntity.orderInfo.status == "3") ||
detailEntity.status == "3" ||
detailEntity.status == "4" ||
detailEntity.status == "6"),
child: Container(
// width: double.infinity,
height: ScreenUtil().setWidth(84),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
),
margin: EdgeInsets.symmetric(
vertical: ScreenUtil().setHeight(20),
horizontal: ScreenUtil().setHeight(40)),
child: Row(children: [
Expanded(
flex: 1,
child: InkWell(
onTap: () {
print('点击变更预订');
if (Utils.getAuthority(
context, '变更预订') ||
widget.uid ==
userModel.user.openid) {
NavigatorUtil
.goNoteBookChangeFPage(
context,
detailEntity,
widget.rid);
}
},
child: Container(
margin: EdgeInsets.only(
right:
ScreenUtil().setWidth(20)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
width: w(1),
color: !(Utils.getAuthority(
context, '变更预订') ||
widget.uid ==
userModel
.user.openid)
? MyColours.color_999999
: MyColours.color_199095,
),
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10)),
),
child: Align(
alignment: Alignment.center,
child: Text('变更预订',
style: TextStyle(
color: !(Utils
.getAuthority(
context,
'变更预订') ||
widget.uid ==
userModel.user
.openid)
? MyColours
.color_999999
: MyColours
.color_199095,
fontSize: ScreenUtil()
.setSp(34))),
),
),
)),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
if (Utils.getAuthority(
context, '取消预订') ||
widget.uid ==
userModel.user.openid)
? MyColours.color_999999
: MyColours.color_199095,
),
Expanded(
child: _cancelAndChangeBtn(() {
if (Utils.getAuthority(
context, '取消预订') ||
widget.uid ==
userModel.user.openid) {
_showCancelWidget(
context, detailEntity.phone);
}
}, '取消预订',
fontColor: !(Utils.getAuthority(
context, '取消预订') ||
userModel.user.openid) {
_showCancelWidget(
context, detailEntity.phone);
}
},
child: Container(
margin: EdgeInsets.only(
right:
ScreenUtil().setWidth(20)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
width: w(1),
color: !(Utils.getAuthority(
context, '取消预订') ||
widget.uid ==
userModel
.user.openid)
? MyColours.color_999999
: MyColours.color_199095,
),
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10)),
),
child: Align(
alignment: Alignment.center,
child: Text('取消预订',
style: TextStyle(
color: !(Utils
.getAuthority(
context,
'取消预订') ||
widget.uid ==
userModel.user
.openid)
? MyColours
.color_999999
: MyColours
.color_199095,
fontSize: ScreenUtil()
.setSp(34))),
),
),
)),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
// String _nameStr = '';
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables.length;
// i++) {
// _nameStr +=
// '${detailEntity.tables[i].name},';
// _tid +=
// '${detailEntity.tables[i].id},';
// }
// if (_tid.endsWith(',')) {
// _tid = _tid.substring(
// 0, _tid.length - 1);
// }
// if (_nameStr.endsWith(',')) {
// _nameStr =
// _nameStr.substring(
// 0,
// _nameStr.length -
// 1);
// }
if (Utils.getAuthority(
context, '通知客户') ||
widget.uid ==
userModel.user.openid) {
NavigatorUtil.goInvicationPage(
context,
detailEntity.id,
);
}
},
child: Container(
decoration: BoxDecoration(
color: !(Utils.getAuthority(
context, '通知客户') ||
widget.uid ==
userModel.user.openid)
? MyColours.color_999999
: MyColours.color_199095)),
],
)),
),
),
: MyColours.color_199095,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10)),
),
child: Align(
alignment: Alignment.center,
child: Text('通知客户',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize: ScreenUtil()
.setSp(34))),
),
),
)),
]))),
// Offstage(
// offstage: ((detailEntity.orderInfo != null &&
// detailEntity.orderInfo.status == "3") ||
// detailEntity.status == "3" ||
// detailEntity.status == "4" ||
// detailEntity.status == "6")
// ? true
// : false,
// child: Container(
// width: double.infinity,
// height: ScreenUtil().setWidth(84),
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setHeight(40)),
// decoration: BoxDecoration(
// border: Border.all(
// color: !(Utils.getAuthority(
// context, '变更预订') ||
// widget.uid == userModel.user.openid)
// ? MyColours.color_999999
// : MyColours.color_199095,
// width: ScreenUtil().setWidth(2)),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10)),
// ),
// // child: Text('fff'),
// child: Material(
// color: Colors.transparent,
// child: Row(
// children: [
// Expanded(
// child: _cancelAndChangeBtn(() {
// print('点击变更预订');
// if (Utils.getAuthority(
// context, '变更预订') ||
// widget.uid ==
// userModel.user.openid) {
// NavigatorUtil.goNoteBookChangeFPage(
// context,
// detailEntity,
// widget.rid);
// }
// }, '变更预订',
// fontColor: !(Utils.getAuthority(
// context, '变更预订') ||
// widget.uid ==
// userModel.user.openid)
// ? MyColours.color_999999
// : MyColours.color_199095)),
// MyDivider(
// ScreenUtil().setWidth(2),
// ScreenUtil().setWidth(50),
// color: !(Utils.getAuthority(
// context, '取消预订') ||
// widget.uid ==
// userModel.user.openid)
// ? MyColours.color_999999
// : MyColours.color_199095,
// ),
// Expanded(
// child: _cancelAndChangeBtn(() {
// if (Utils.getAuthority(
// context, '取消预订') ||
// widget.uid ==
// userModel.user.openid) {
// _showCancelWidget(
// context, detailEntity.phone);
// }
// }, '取消预订',
// fontColor: !(Utils.getAuthority(
// context, '取消预订') ||
// widget.uid ==
// userModel.user.openid)
// ? MyColours.color_999999
// : MyColours.color_199095)),
// ],
// )),
// ),
// ),
VEmptyView(ScreenUtil().setWidth(60))
])
],
... ... @@ -3488,16 +3695,16 @@ class TitleAndBtn extends StatelessWidget {
),
),
Spacer(),
if (Utils.getAuthority(context, title) ||
uid == userModel.user.openid)
Text(
"选填",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
softWrap: true,
),
HEmptyView(10),
// if (Utils.getAuthority(context, title) ||
// uid == userModel.user.openid)
// Text(
// "选填",
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(30)),
// softWrap: true,
// ),
// HEmptyView(10),
InkWell(
onTap: () {
if (Utils.getAuthority(context, title) ||
... ... @@ -3743,16 +3950,16 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield>
// widget.detailModel.strTF.trim().length > 0
// ? Text("¥", style: TextStyle(color: MyColours.color_199095))
// : SizedBox(),
if (Utils.getAuthority(context, widget.title) ||
widget.uid == userModel.user.openid)
Text(
"选填",
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(30)),
softWrap: true,
),
HEmptyView(6),
// if (Utils.getAuthority(context, widget.title) ||
// widget.uid == userModel.user.openid)
// Text(
// "选填",
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(30)),
// softWrap: true,
// ),
// HEmptyView(6),
Container(
constraints:
BoxConstraints(maxHeight: ScreenUtil().setWidth(50)),
... ...
... ... @@ -1317,6 +1317,44 @@ class Utils {
Loading.hideLoading(context);
}
//请客人反馈----跳转小程序请客人反馈
static goShareFeedbackPageToWeChat(BuildContext context,
{String title, String rid, String img, String oid, String sid}) async {
Loading.showLoading(context);
String _webPageUrl = "http://colorcun.com/";
// String _thumbnail = img;
// String _thumbnail = sellerImage == null || sellerImage == ''
// ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'
// : sellerImage;
String _thumbnail = 'https://nosqn.colorcun.com/share_feedback.jpg';
String _title = title;
String _userName = "gh_487873d353b3";
// String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid";
String _path =
"pages/pinglun/createOpinion?oid=$rid&types=1&sellerid=$sid&sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}";
String _description = "OneKey";
// Uint8List source = await testComporessList(context, _thumbnail);
var model = new WeChatShareMiniProgramModel(
// miniProgramType: , //体验版
miniProgramType: Constant.wxMiniProgramType, //正式版
// miniProgramType: //开发版
webPageUrl: _webPageUrl,
userName: _userName,
title: _title,
path: _path,
// thumbnail: WeChatImage.asset(Utils.getImgPath('mini_image')),
description: _description,
// thumbnail: WeChatImage.binary(source)
thumbnail: WeChatImage.network(_thumbnail));
bool isShare = await shareToWeChat(model);
print(isShare);
Loading.hideLoading(context);
}
//请客户点菜----跳转小程序提前点餐
static goShareOrderPageToWeChat(BuildContext context,
{String title, String rid, String img, String oid, String sid}) async {
... ...