Commit 52159fc349715464e66cfd91b6d9cb0445bc96df

Authored by wdn127929
1 parent c01d38a9

已预订页面的取消预订按钮缺少逻辑(临餐,过去订单,订金走向)

... ... @@ -29,25 +29,31 @@ class NoteBookItemF extends StatefulWidget {
final num index;
final NoteBookOnlySunModel notebook;
final bool sellerPreserve;
final GestureTapCallback onTap;
final String? cancelDay;
final bool cancelShopowner;
final bool cancelManager;
// final String? cancelDay;
// final bool cancelShopowner;
// final bool cancelManager;
final bool cancelOther;
final bool isReserveCancel;
// final bool cancelOther;
// final bool isReserveCancel;
final GestureTapCallback? onTapChange;
final GestureTapCallback? onTapReach;
final GestureTapCallback? onTapLeave;
final GestureTapCallback? onTapCancel;
NoteBookItemF(
this.index,
this.notebook,
this.sellerPreserve,
this.onTap,
this.cancelDay,
this.cancelShopowner,
this.cancelManager,
this.cancelOther,
this.isReserveCancel);
// this.cancelDay,
// this.cancelShopowner,
// this.cancelManager,
// this.cancelOther,
// this.isReserveCancel,
{this.onTapChange,
this.onTapReach,
this.onTapLeave,
this.onTapCancel});
@override
State<StatefulWidget> createState() {
... ... @@ -60,71 +66,59 @@ class NoteBookItemFState extends State<NoteBookItemF>
// with SingleTickerProviderStateMixin
{
// bool _large = false;
List cancelReasonList = [];
bool isShowTF = false;
// int paddingBottom;
int paddingTop = 138;
FocusNode _cancelNode = FocusNode();
TextEditingController _cancelController = TextEditingController();
StateSetter? _cancelState;
ScrollController? _scrollController;
// StateSetter? _cancelState;
// ScrollController? _scrollController;
// _onOperateClick() {
// if (widget.notebook.operationText == "通知客户") {
// // 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);
// // }
// NavigatorUtil.goInvicationPage(
// context,
// widget.notebook.id,
// // widget.notebook.tableinfoStr,
// // widget.notebook.ddate,
// // widget.notebook.ddateStr,
// // widget.notebook.phone,
// // widget.notebook.ddate_solt,
// // widget.notebook.rname == null ? '' : widget.notebook.rname,
// // widget.notebook.sex == null ? '' : widget.notebook.sex,
// // widget.notebook.cusdem,
// // tid: widget.notebook.tid
// );
// }
// }
_onOperateClick() {
if (widget.notebook.operationText == "通知客户") {
// 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);
// }
NavigatorUtil.goInvicationPage(
context,
widget.notebook.id,
// widget.notebook.tableinfoStr,
// widget.notebook.ddate,
// widget.notebook.ddateStr,
// widget.notebook.phone,
// widget.notebook.ddate_solt,
// widget.notebook.rname == null ? '' : widget.notebook.rname,
// widget.notebook.sex == null ? '' : widget.notebook.sex,
// widget.notebook.cusdem,
// tid: widget.notebook.tid
);
}
}
/// 初始化取消原因数据
_initCancel() {
// isShowTF = false;
// paddingBottom = ScreenUtil().screenHeight.ceil() - 138 - 340;
cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '操作失误', 'select': false},
{'title': '其他原因', 'select': false},
];
}
_updateSize(bool cando) {
if (!cando) {
... ... @@ -135,362 +129,6 @@ class NoteBookItemFState extends State<NoteBookItemF>
});
}
///处理在线预订
setReserveStatus(String status, {String? desc, String? phone}) async {
// bus.emit("remove_untreated_message",widget.mid);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String?> params = {
"rid": widget.notebook.id,
"status": status, //5安排包间 2:确认到店(到店),3:用餐完成(离店),4:取消预定,5:分配包间:6:拒单
// "uid": userModel.user.openid,
'uid': widget.notebook.uid
};
if (status == '4') {
Map<String, String?> causeMap = {
"uid": userModel.user!.openid,
"uname": userModel.user!.nickName,
"desc": desc,
};
params["cause"] = json.encode(causeMap);
}
params['note_name'] = userModel.user!.account;
NotebookDetailModel detailModel =
Provider.of<NotebookDetailModel>(context, listen: false);
bool success = await detailModel.setReserveStatusOnly(context, params,
ifPush: false, notebook: widget.notebook);
if (success) {
bus.emit("refresh_book_list");
if (status == "4" && phone != null && phone != '') {
getDzSellerConf(widget.notebook.id);
// //取消预订
// bus.emit("refresh_tablemanager"); //刷新桌位
}
// if (status == "4") {
// //取消预订
// bus.emit("refresh_tablemanager"); //刷新桌位
// }
// _getReserveDetail();
}
}
getDzSellerConf(String? rid) async {
MarketingCenterProvider marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: false);
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
bool selectSms =
marketingCenterProvider.dzSellerConfModel!.isOpenCancel == '1'
? true
: false;
if (selectSms) {
Map<String, String?> pramas = {
'rid': rid,
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
};
NotebookDetailModel detailModel =
Provider.of<NotebookDetailModel>(context, listen: false);
detailModel.wxSendCancelSms(context, pramas);
}
}
}
///取消预订弹框
_showCancelWidget(context, phone) {
_scrollController = ScrollController();
_initCancel();
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
body: StatefulBuilder(builder: (context, state) {
_cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Center(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(28 * 2)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
height: ScreenUtil().setWidth(355 * 2),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
// Stack(
// children: [
VEmptyView(48),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
'是否确定取消预订',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Color.fromRGBO(0, 0, 0, 0.9)),
),
),
// Positioned(
// top: ScreenUtil().setWidth(8),
// right: ScreenUtil().setWidth(0),
// child: GestureDetector(
// onTap: () {
// _initCancel();
// Navigator.of(context).pop();
// },
// child: Container(
// padding: EdgeInsets.only(left: 20),
// child: Image.asset(
// 'assets/close.png',
// width: ScreenUtil().setWidth(32),
// height: ScreenUtil().setWidth(32),
// ),
// )))
// ],
// ),
VEmptyView(40),
Container(
child: Column(
// mainAxisSize: MainAxisSize.min,
children: cancelReasonList.map((value) {
return value['title'] == '其他原因'
? SizedBox()
: GestureDetector(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
// isShowTF = false;
// paddingBottom =
// ScreenUtil().screenHeight.ceil() -
// 138 -
// 340;
if (item['title'] ==
value['title']) {
item['select'] = true;
// if (item['title'] == '其他原因') {
// // isShowTF = true;
// // paddingBottom = 130;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340 -
// // 46;
// }
}
}
state(() {});
},
child: Container(
height: ScreenUtil().setWidth(48),
margin: EdgeInsets.only(
bottom:
ScreenUtil().setWidth(40)),
child: Row(
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(42)),
HEmptyView(20),
Container(
child: Text(value['title'],
style: TextStyle(
fontSize: ScreenUtil()
.setSp(32),
fontWeight:
FontWeight.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_333333)))
],
),
),
);
}).toList(),
)),
Material(
child: Container(
color: Colors.white,
height: ScreenUtil().setWidth(42 * 2),
child: Row(children: [
InkWell(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
}
cancelReasonList[4]['select'] =
true;
state(() {});
},
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20)),
child: Image.asset(
cancelReasonList[4]['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(44)))),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(
240, 240, 240, 1),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
// height: ScreenUtil().setWidth(42 * 2),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(16)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
style: TextStyle(
textBaseline:
TextBaseline.alphabetic),
textAlignVertical:
TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: "其他",
// focusColor: Color.fromRGBO(0, 0, 0, 0.4),
hintStyle: TextStyle(
color:
Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
),
// border: InputBorder.none,
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
]))),
VEmptyView(15),
Material(
child: RoundButton(
onPressed: () {
String? desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc = _cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写原因");
return;
}
}
}
}
if (desc == '') {
Utils.showToast('请选择原因');
return;
}
Navigator.of(context).pop();
Loading.showLoading(context);
setReserveStatus('4',
desc: desc, phone: phone);
},
text: '确认',
height: ScreenUtil().setWidth(80),
width: ScreenUtil().setWidth(300),
radius: ScreenUtil().setWidth(10),
),
)
],
),
),
));
}));
});
}
_getIsReserveCancel(bool isReserveCancel) {
//判断时间是否可变更
bool reserveCancel = true; //默认允许变更过去餐段订单的时间
//如果不允许变更过去餐段订单的时间,则开始判断
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
if (!isReserveCancel) {
//找到当前餐段对应的时间段
String? times = widget.notebook.mdate ?? '00:00-00:00';
//组装时间戳
List<String> datas = times.split('-');
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// '-' +
// '${dateTimeSelect.month}' +
// '-' +
// '${dateTimeSelect.day}' +
// ' ${datas[0]}:00'); //选中餐段开始时间戳
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(widget.notebook.ddate!) * 1000);
DateTime selectEtime = DateTime.parse('${dateTime.year}' +
'-' +
Utils.addZeroNumber(dateTime.month) +
'-' +
Utils.addZeroNumber(dateTime.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
// 属于过去餐段
reserveCancel = false;
} else {
// 属于未来餐段
reserveCancel = true;
}
}
return reserveCancel;
}
@override
Widget build(BuildContext context) {
// TODO: implement build
... ... @@ -588,7 +226,7 @@ class NoteBookItemFState extends State<NoteBookItemF>
child: Row(
children: [
InkWell(
onTap: widget.onTap,
onTap: widget.onTapChange,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
... ... @@ -915,11 +553,7 @@ class NoteBookItemFState extends State<NoteBookItemF>
fontSize: 28,
radius:
ScreenUtil().setWidth(8),
onPressed: () {
Loading.showLoading(
context);
setReserveStatus('2');
},
onPressed: widget.onTapReach,
),
notebook.status == '2'
? SizedBox()
... ... @@ -937,10 +571,7 @@ class NoteBookItemFState extends State<NoteBookItemF>
isBold: true,
fontSize: 28,
radius: ScreenUtil().setWidth(8),
onPressed: () {
Loading.showLoading(context);
setReserveStatus('3');
},
onPressed: widget.onTapLeave,
),
if (notebook.status != '2' &&
Utils.getAuthority(
... ... @@ -958,137 +589,7 @@ class NoteBookItemFState extends State<NoteBookItemF>
notebook.uid ==
userModel.user!.openid))
InkWell(
onTap: () {
bool isReserveCancel =
_getIsReserveCancel(widget
.isReserveCancel);
if (isReserveCancel) {
bool cancelCan = false;
DateTime dateTime = DateTime
.fromMillisecondsSinceEpoch(
int.parse(widget
.notebook
.ddate!) *
1000);
String roleName =
Provider.of<UserModel>(
context,
listen:
false)
.user!
.role_name ??
'';
if (roleName == '管理员' ||
roleName == '前台') {
cancelCan = true;
} else if (roleName ==
'店长') {
if (widget
.cancelShopowner) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else if (roleName ==
'客户经理') {
if (widget
.cancelManager) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else {
if (widget.cancelOther) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
}
if (cancelCan) {
_showCancelWidget(context,
notebook.phone);
} else {
Utils.showToast(
'临餐不可取消预订!请与前台联系取消。');
}
} else {
Utils.showToast(
'过去餐段的订单不可取消预订!请与前台联系取消。');
}
},
onTap: widget.onTapCancel,
child: Text(
'取消预订',
style: TextStyle(
... ...
... ... @@ -41,24 +41,22 @@ class NoteBookItemSimple extends StatefulWidget {
final num index;
final NoteBookOnlySunModel notebook;
final GestureTapCallback onTap;
final String? cancelDay;
final bool cancelShopowner;
final bool cancelManager;
final bool cancelOther;
final bool isReserveCancel;
final GestureTapCallback? onTapChange;
final GestureTapCallback? onTapReach;
final GestureTapCallback? onTapLeave;
final GestureTapCallback? onTapCancel;
NoteBookItemSimple(
this.index,
this.notebook,
this.onTap,
this.cancelDay,
this.cancelShopowner,
this.cancelManager,
this.cancelOther,
this.isReserveCancel);
{this.onTapChange,
this.onTapReach,
this.onTapLeave,
this.onTapCancel}
);
@override
State<StatefulWidget> createState() {
... ... @@ -75,67 +73,67 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
bool isShowTF = false;
// int paddingBottom;
int paddingTop = 138;
FocusNode _cancelNode = FocusNode();
TextEditingController _cancelController = TextEditingController();
StateSetter? _cancelState;
// FocusNode _cancelNode = FocusNode();
// TextEditingController _cancelController = TextEditingController();
// StateSetter? _cancelState;
ScrollController? _scrollController;
// ScrollController? _scrollController;
_onOperateClick() {
if (widget.notebook.operationText == "通知客户") {
// String _nameStr = '';
// String _tid = '';
// for (int i = 0;
// i <
// detailEntity
// .tables.length;
// i++) {
// _nameStr +=
// '${detailEntity.tables[i].name},';
// _onOperateClick() {
// if (widget.notebook.operationText == "通知客户") {
// // 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);
// }
NavigatorUtil.goInvicationPage(
context,
widget.notebook.id,
// widget.notebook.tableinfoStr,
// widget.notebook.ddate,
// widget.notebook.ddateStr,
// widget.notebook.phone,
// widget.notebook.ddate_solt,
// widget.notebook.rname == null ? '' : widget.notebook.rname,
// widget.notebook.sex == null ? '' : widget.notebook.sex,
// widget.notebook.cusdem,
// tid: widget.notebook.tid
);
}
}
// // _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);
// // }
// NavigatorUtil.goInvicationPage(
// context,
// widget.notebook.id,
// // widget.notebook.tableinfoStr,
// // widget.notebook.ddate,
// // widget.notebook.ddateStr,
// // widget.notebook.phone,
// // widget.notebook.ddate_solt,
// // widget.notebook.rname == null ? '' : widget.notebook.rname,
// // widget.notebook.sex == null ? '' : widget.notebook.sex,
// // widget.notebook.cusdem,
// // tid: widget.notebook.tid
// );
// }
// }
/// 初始化取消原因数据
_initCancel() {
// isShowTF = false;
// paddingBottom = ScreenUtil().screenHeight.ceil() - 138 - 340;
cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '操作失误', 'select': false},
{'title': '其他原因', 'select': false},
];
}
// /// 初始化取消原因数据
// _initCancel() {
// // isShowTF = false;
// // paddingBottom = ScreenUtil().screenHeight.ceil() - 138 - 340;
// cancelReasonList = [
// {'title': '顾客取消', 'select': false},
// {'title': '顾客行程有变', 'select': false},
// {'title': '信息填写有误', 'select': false},
// {'title': '操作失误', 'select': false},
// {'title': '其他原因', 'select': false},
// ];
// }
_updateSize(bool cando) {
if (!cando) {
... ... @@ -146,360 +144,360 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
});
}
///处理在线预订
setReserveStatus(String status, {String? desc, String? phone}) async {
// bus.emit("remove_untreated_message",widget.mid);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
// ///处理在线预订
// setReserveStatus(String status, {String? desc, String? phone}) async {
// // bus.emit("remove_untreated_message",widget.mid);
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String?> params = {
"rid": widget.notebook.id,
"status": status, //5安排包间 2:确认到店(到店),3:用餐完成(离店),4:取消预定,5:分配包间:6:拒单
// "uid": userModel.user.openid,
'uid': widget.notebook.uid
};
if (status == '4') {
Map<String, String?> causeMap = {
"uid": userModel.user!.openid,
"uname": userModel.user!.nickName,
"desc": desc,
};
params["cause"] = json.encode(causeMap);
}
params['note_name'] = userModel.user!.account;
NotebookDetailModel detailModel =
Provider.of<NotebookDetailModel>(context, listen: false);
bool success = await detailModel.setReserveStatusOnly(context, params,
ifPush: false, notebook: widget.notebook);
if (success) {
bus.emit("refresh_book_list");
if (status == "4" && phone != null && phone != '') {
//取消预订
getDzSellerConf(widget.notebook.id);
}
// if (status == "4") {
// //取消预订
// bus.emit("refresh_tablemanager"); //刷新桌位
// }
// _getReserveDetail();
}
}
// Map<String, String?> params = {
// "rid": widget.notebook.id,
// "status": status, //5安排包间 2:确认到店(到店),3:用餐完成(离店),4:取消预定,5:分配包间:6:拒单
// // "uid": userModel.user.openid,
// 'uid': widget.notebook.uid
// };
// if (status == '4') {
// Map<String, String?> causeMap = {
// "uid": userModel.user!.openid,
// "uname": userModel.user!.nickName,
// "desc": desc,
// };
// params["cause"] = json.encode(causeMap);
// }
// params['note_name'] = userModel.user!.account;
// NotebookDetailModel detailModel =
// Provider.of<NotebookDetailModel>(context, listen: false);
// bool success = await detailModel.setReserveStatusOnly(context, params,
// ifPush: false, notebook: widget.notebook);
// if (success) {
// bus.emit("refresh_book_list");
// if (status == "4" && phone != null && phone != '') {
// //取消预订
// getDzSellerConf(widget.notebook.id);
// }
// // if (status == "4") {
// // //取消预订
// // bus.emit("refresh_tablemanager"); //刷新桌位
// // }
// // _getReserveDetail();
// }
// }
getDzSellerConf(String? rid) async {
MarketingCenterProvider marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: false);
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
bool selectSms =
marketingCenterProvider.dzSellerConfModel!.isOpenCancel == '1'
? true
: false;
// getDzSellerConf(String? rid) async {
// MarketingCenterProvider marketingCenterProvider =
// Provider.of<MarketingCenterProvider>(context, listen: false);
// bool success = await marketingCenterProvider.getDzSellerConf(context);
// if (success && marketingCenterProvider.dzSellerConfModel != null) {
// bool selectSms =
// marketingCenterProvider.dzSellerConfModel!.isOpenCancel == '1'
// ? true
// : false;
if (selectSms) {
Map<String, String?> pramas = {
'rid': rid,
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
};
NotebookDetailModel detailModel =
Provider.of<NotebookDetailModel>(context, listen: false);
detailModel.wxSendCancelSms(context, pramas);
}
}
}
// if (selectSms) {
// Map<String, String?> pramas = {
// 'rid': rid,
// 'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
// };
// NotebookDetailModel detailModel =
// Provider.of<NotebookDetailModel>(context, listen: false);
// detailModel.wxSendCancelSms(context, pramas);
// }
// }
// }
///取消预订弹框
_showCancelWidget(context, phone) {
_scrollController = ScrollController();
_initCancel();
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
body: StatefulBuilder(builder: (context, state) {
_cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Center(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(28 * 2)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
height: ScreenUtil().setWidth(355 * 2),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
// Stack(
// children: [
VEmptyView(48),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
'是否确定取消预订',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Color.fromRGBO(0, 0, 0, 0.9)),
),
),
// Positioned(
// top: ScreenUtil().setWidth(8),
// right: ScreenUtil().setWidth(0),
// child: GestureDetector(
// onTap: () {
// _initCancel();
// Navigator.of(context).pop();
// },
// child: Container(
// padding: EdgeInsets.only(left: 20),
// child: Image.asset(
// 'assets/close.png',
// width: ScreenUtil().setWidth(32),
// height: ScreenUtil().setWidth(32),
// ),
// )))
// ],
// ),
VEmptyView(40),
Container(
child: Column(
// mainAxisSize: MainAxisSize.min,
children: cancelReasonList.map((value) {
return value['title'] == '其他原因'
? SizedBox()
: GestureDetector(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
// isShowTF = false;
// paddingBottom =
// ScreenUtil().screenHeight.ceil() -
// 138 -
// 340;
if (item['title'] ==
value['title']) {
item['select'] = true;
// if (item['title'] == '其他原因') {
// // isShowTF = true;
// // paddingBottom = 130;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340 -
// // 46;
// }
}
}
state(() {});
},
child: Container(
height: ScreenUtil().setWidth(48),
margin: EdgeInsets.only(
bottom:
ScreenUtil().setWidth(40)),
child: Row(
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(42)),
HEmptyView(20),
Container(
child: Text(value['title'],
style: TextStyle(
fontSize: ScreenUtil()
.setSp(32),
fontWeight:
FontWeight.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_333333)))
],
),
),
);
}).toList(),
)),
Material(
child: Container(
color: Colors.white,
height: ScreenUtil().setWidth(42 * 2),
child: Row(children: [
InkWell(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
}
cancelReasonList[4]['select'] =
true;
state(() {});
},
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20)),
child: Image.asset(
cancelReasonList[4]['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(44)))),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(
240, 240, 240, 1),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
// height: ScreenUtil().setWidth(42 * 2),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(16)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
style: TextStyle(
textBaseline:
TextBaseline.alphabetic),
textAlignVertical:
TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: "其他",
// focusColor: Color.fromRGBO(0, 0, 0, 0.4),
hintStyle: TextStyle(
color:
Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
),
// ///取消预订弹框
// _showCancelWidget(context, phone) {
// _scrollController = ScrollController();
// _initCancel();
// showGeneralDialog(
// context: context,
// barrierDismissible: false,
// barrierLabel:
// MaterialLocalizations.of(context).modalBarrierDismissLabel,
// transitionDuration: const Duration(milliseconds: 150),
// barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
// pageBuilder: (BuildContext context, Animation animation,
// Animation secondaryAnimation) {
// return Scaffold(
// backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
// body: StatefulBuilder(builder: (context, state) {
// _cancelState = state;
// return GestureDetector(
// behavior: HitTestBehavior.opaque,
// // onTap: () {
// // Navigator.of(context).pop();
// // },
// child: Center(
// child: Container(
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(28 * 2)),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(32)),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius:
// BorderRadius.circular(ScreenUtil().setWidth(10)),
// ),
// height: ScreenUtil().setWidth(355 * 2),
// child: Column(
// // mainAxisSize: MainAxisSize.min,
// children: [
// // Stack(
// // children: [
// VEmptyView(48),
// Container(
// height: ScreenUtil().setWidth(48),
// child: Text(
// '是否确定取消预订',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// fontWeight: FontWeight.bold,
// decoration: TextDecoration.none,
// color: Color.fromRGBO(0, 0, 0, 0.9)),
// ),
// ),
// // Positioned(
// // top: ScreenUtil().setWidth(8),
// // right: ScreenUtil().setWidth(0),
// // child: GestureDetector(
// // onTap: () {
// // _initCancel();
// // Navigator.of(context).pop();
// // },
// // child: Container(
// // padding: EdgeInsets.only(left: 20),
// // child: Image.asset(
// // 'assets/close.png',
// // width: ScreenUtil().setWidth(32),
// // height: ScreenUtil().setWidth(32),
// // ),
// // )))
// // ],
// // ),
// VEmptyView(40),
// Container(
// child: Column(
// // mainAxisSize: MainAxisSize.min,
// children: cancelReasonList.map((value) {
// return value['title'] == '其他原因'
// ? SizedBox()
// : GestureDetector(
// onTap: () {
// for (var item in cancelReasonList) {
// item['select'] = false;
// // isShowTF = false;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340;
// if (item['title'] ==
// value['title']) {
// item['select'] = true;
// // if (item['title'] == '其他原因') {
// // // isShowTF = true;
// // // paddingBottom = 130;
// // // paddingBottom =
// // // ScreenUtil().screenHeight.ceil() -
// // // 138 -
// // // 340 -
// // // 46;
// // }
// }
// }
// state(() {});
// },
// child: Container(
// height: ScreenUtil().setWidth(48),
// margin: EdgeInsets.only(
// bottom:
// ScreenUtil().setWidth(40)),
// child: Row(
// children: [
// Image.asset(
// value['select']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil()
// .setWidth(42)),
// HEmptyView(20),
// Container(
// child: Text(value['title'],
// style: TextStyle(
// fontSize: ScreenUtil()
// .setSp(32),
// fontWeight:
// FontWeight.normal,
// decoration:
// TextDecoration
// .none,
// color: MyColours
// .color_333333)))
// ],
// ),
// ),
// );
// }).toList(),
// )),
// Material(
// child: Container(
// color: Colors.white,
// height: ScreenUtil().setWidth(42 * 2),
// child: Row(children: [
// InkWell(
// onTap: () {
// for (var item in cancelReasonList) {
// item['select'] = false;
// }
// cancelReasonList[4]['select'] =
// true;
// state(() {});
// },
// child: Padding(
// padding: EdgeInsets.only(
// right: ScreenUtil()
// .setWidth(20)),
// child: Image.asset(
// cancelReasonList[4]['select']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil()
// .setWidth(44)))),
// Expanded(
// child: Container(
// decoration: BoxDecoration(
// color: Color.fromRGBO(
// 240, 240, 240, 1),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(8))),
// // height: ScreenUtil().setWidth(42 * 2),
// padding: EdgeInsets.symmetric(
// horizontal:
// ScreenUtil().setWidth(16)),
// child: TextField(
// maxLines: 1,
// controller: _cancelController,
// focusNode: _cancelNode,
// style: TextStyle(
// textBaseline:
// TextBaseline.alphabetic),
// textAlignVertical:
// TextAlignVertical.center,
// decoration: InputDecoration(
// contentPadding: EdgeInsets.zero,
// hintText: "其他",
// // focusColor: Color.fromRGBO(0, 0, 0, 0.4),
// hintStyle: TextStyle(
// color:
// Color.fromRGBO(0, 0, 0, 0.4),
// fontSize: ScreenUtil().setSp(32),
// ),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// border: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// ),
// border: InputBorder.none,
// // border: InputBorder.none,
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
]))),
// onChanged: (_) {
// setState(() {});
// },
// onEditingComplete: () {
// print('fff');
// _cancelNode.unfocus();
// },
// // keyboardType: TextInputType.numberWithOptions(decimal: true),
// ),
// ))
// ]))),
VEmptyView(15),
Material(
child: RoundButton(
onPressed: () {
String? desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc = _cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写原因");
return;
}
}
}
}
// VEmptyView(15),
// Material(
// child: RoundButton(
// onPressed: () {
// String? desc = '';
// for (var value in cancelReasonList) {
// if (value['select'] == true) {
// desc = value['title'];
// if (value['title'] == '其他原因') {
// desc = _cancelController.text.trim();
// if (desc.isEmpty) {
// Utils.showToast("请填写原因");
// return;
// }
// }
// }
// }
if (desc == '') {
Utils.showToast('请选择原因');
return;
}
// if (desc == '') {
// Utils.showToast('请选择原因');
// return;
// }
Navigator.of(context).pop();
Loading.showLoading(context);
// Navigator.of(context).pop();
// Loading.showLoading(context);
setReserveStatus('4',
desc: desc, phone: phone);
},
text: '确认',
height: ScreenUtil().setWidth(80),
width: ScreenUtil().setWidth(300),
radius: ScreenUtil().setWidth(10),
),
)
],
),
),
));
}));
});
}
// setReserveStatus('4',
// desc: desc, phone: phone);
// },
// text: '确认',
// height: ScreenUtil().setWidth(80),
// width: ScreenUtil().setWidth(300),
// radius: ScreenUtil().setWidth(10),
// ),
// )
// ],
// ),
// ),
// ));
// }));
// });
// }
_getIsReserveCancel(bool isReserveCancel) {
//判断时间是否可变更
// _getIsReserveCancel(bool isReserveCancel) {
// //判断时间是否可变更
bool reserveCancel = true; //默认允许变更过去餐段订单的时间
//如果不允许变更过去餐段订单的时间,则开始判断
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
if (!isReserveCancel) {
//找到当前餐段对应的时间段
String? times = widget.notebook.mdate ?? '00:00-00:00';
// bool reserveCancel = true; //默认允许变更过去餐段订单的时间
// //如果不允许变更过去餐段订单的时间,则开始判断
// //连个条件同时成立: 1.订单的时间是过去 2. 时间改变
// if (!isReserveCancel) {
// //找到当前餐段对应的时间段
// String? times = widget.notebook.mdate ?? '00:00-00:00';
//组装时间戳
List<String> datas = times.split('-');
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// '-' +
// '${dateTimeSelect.month}' +
// '-' +
// '${dateTimeSelect.day}' +
// ' ${datas[0]}:00'); //选中餐段开始时间戳
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(widget.notebook.ddate!) * 1000);
DateTime selectEtime = DateTime.parse('${dateTime.year}' +
'-' +
Utils.addZeroNumber(dateTime.month) +
'-' +
Utils.addZeroNumber(dateTime.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
// 属于过去餐段
reserveCancel = false;
} else {
// 属于未来餐段
reserveCancel = true;
}
}
return reserveCancel;
}
// //组装时间戳
// List<String> datas = times.split('-');
// // DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// // '-' +
// // '${dateTimeSelect.month}' +
// // '-' +
// // '${dateTimeSelect.day}' +
// // ' ${datas[0]}:00'); //选中餐段开始时间戳
// DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
// int.parse(widget.notebook.ddate!) * 1000);
// DateTime selectEtime = DateTime.parse('${dateTime.year}' +
// '-' +
// Utils.addZeroNumber(dateTime.month) +
// '-' +
// Utils.addZeroNumber(dateTime.day) +
// ' ${datas[1]}:00'); //选中餐段结束时间戳
// // 过去的餐段界定
// if (selectEtime.isBefore(DateTime.now())) {
// // 属于过去餐段
// reserveCancel = false;
// } else {
// // 属于未来餐段
// reserveCancel = true;
// }
// }
// return reserveCancel;
// }
@override
Widget build(BuildContext context) {
... ... @@ -598,7 +596,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
child: Row(
children: [
InkWell(
onTap: widget.onTap,
onTap: widget.onTapChange,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
... ... @@ -878,11 +876,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
fontSize: 28,
radius:
ScreenUtil().setWidth(8),
onPressed: () {
Loading.showLoading(
context);
setReserveStatus('2');
},
onPressed: widget.onTapReach
),
notebook.status == '2'
? SizedBox()
... ... @@ -900,10 +894,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
isBold: true,
fontSize: 28,
radius: ScreenUtil().setWidth(8),
onPressed: () {
Loading.showLoading(context);
setReserveStatus('3');
},
onPressed: widget.onTapLeave,
),
if (notebook.status != '2' &&
Utils.getAuthority(
... ... @@ -921,137 +912,7 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple>
notebook.uid ==
userModel.user!.openid))
InkWell(
onTap: () {
bool isReserveCancel =
_getIsReserveCancel(widget
.isReserveCancel);
if (isReserveCancel) {
bool cancelCan = false;
DateTime dateTime = DateTime
.fromMillisecondsSinceEpoch(
int.parse(widget
.notebook
.ddate!) *
1000);
String roleName =
Provider.of<UserModel>(
context,
listen:
false)
.user!
.role_name ??
'';
if (roleName == '管理员' ||
roleName == '前台') {
cancelCan = true;
} else if (roleName ==
'店长') {
if (widget
.cancelShopowner) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else if (roleName ==
'客户经理') {
if (widget
.cancelManager) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else {
if (widget.cancelOther) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds =
dateTime
.difference(
DateTime
.now())
.inSeconds;
if (int.parse(widget
.cancelDay!) !=
0 &&
differenceSeconds <
int.parse(widget
.cancelDay!) *
24 *
60 *
60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
}
if (cancelCan) {
_showCancelWidget(context,
notebook.phone);
} else {
Utils.showToast(
'临餐不可取消预订!请与前台联系取消。');
}
} else {
Utils.showToast(
'过去餐段的订单不可取消预订!请与前台联系取消。');
}
},
onTap: widget.onTapCancel,
child: Text(
'取消预订',
style: TextStyle(
... ...
import 'dart:convert';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
... ... @@ -5,6 +7,7 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/app.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/meal_day_date_model.dart';
import 'package:one_key/pages/notebook/notebook_item_f.dart';
import 'package:one_key/pages/notebook/notebook_item_f_simple.dart';
... ... @@ -28,11 +31,17 @@ import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../models/note_book_only_model.dart';
import '../../models/reserve_deposit_model.dart';
import '../../provider/collect_store_provider.dart';
import '../../provider/marketing_center_provider.dart';
import '../../provider/notebook_detail_model.dart';
import '../../provider/store_base_info_provider.dart';
import '../../provider/table_manage_model.dart';
import '../../utils/screen_util.dart';
import '../../widgets/loading.dart';
import '../../widgets/round_button.dart';
typedef void CancelCallback(String reseon);
class NoteBookPage extends StatefulWidget {
final int tabIndex;
... ... @@ -88,7 +97,9 @@ class NoteBookPageState extends State<NoteBookPage> {
DateTime? date;
String? solt;
late StateSetter _cancelState;
late NotebookDetailModel detailModel
;
// String? roleName =
// Provider.of<UserModel>(context, listen: false).user!.role_name;
... ... @@ -98,12 +109,8 @@ class NoteBookPageState extends State<NoteBookPage> {
// TODO: implement initState
super.initState();
date = widget.date;
date = widget.date;
solt = widget.solt;
// tabIndex = widget.tabIndex;
if (widget.tabIndex == 1) {
... ... @@ -184,8 +191,6 @@ class NoteBookPageState extends State<NoteBookPage> {
super.dispose();
bus.off("refresh_book_list");
// _calendarController.dispose();
}
... ... @@ -669,6 +674,823 @@ class NoteBookPageState extends State<NoteBookPage> {
getCheckValue();
}
///处理在线预订
setReserveStatus(String status, NoteBookOnlySunModel notebook,
{String? desc}) async {
// bus.emit("remove_untreated_message",widget.mid);
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String?> params = {
"rid": notebook.id,
"status": status, //5安排包间 2:确认到店(到店),3:用餐完成(离店),4:取消预定,5:分配包间:6:拒单
// "uid": userModel.user.openid,
'uid': notebook.uid
};
if (status == '4') {
Map<String, String?> causeMap = {
"uid": userModel.user!.openid,
"uname": userModel.user!.nickName,
"desc": desc,
};
params["cause"] = json.encode(causeMap);
}
params['note_name'] = userModel.user!.account;
bool success = await detailModel.setReserveStatusOnly(context, params,
ifPush: false, notebook: notebook);
if (success) {
bus.emit("refresh_book_list");
if (status == "4" && notebook.phone != null && notebook.phone != '') {
getDzSellerConf(notebook.id);
// //取消预订
// bus.emit("refresh_tablemanager"); //刷新桌位
}
// if (status == "4") {
// //取消预订
// bus.emit("refresh_tablemanager"); //刷新桌位
// }
// _getReserveDetail();
}
}
getDzSellerConf(String? rid) async {
MarketingCenterProvider marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: false);
bool success = await marketingCenterProvider.getDzSellerConf(context);
if (success && marketingCenterProvider.dzSellerConfModel != null) {
bool selectSms =
marketingCenterProvider.dzSellerConfModel!.isOpenCancel == '1'
? true
: false;
if (selectSms) {
Map<String, String?> pramas = {
'rid': rid,
'sid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
};
detailModel.wxSendCancelSms(context, pramas);
}
}
}
Widget _depositWidget(
List<ReserveDepositSunModel> reserveDepositList,
List<Map<String, dynamic>> depositReasonList,
FocusNode _depositNode,
TextEditingController _depositController,
CancelCallback callback) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: w(24)),
height: ScreenUtil().setWidth(48),
child: Text(
'请选择预订订金走向',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_E5000000),
),
),
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(horizontal: w(24)),
child: Wrap(
runSpacing: w(20),
// mainAxisSize: MainAxisSize.min,
children: depositReasonList.map((value) {
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
for (var item in depositReasonList) {
item['select'] = false;
// isShowTF = false;
if (item['title'] == value['title']) {
item['select'] = true;
callback(item['title']);
}
}
_cancelState(() {});
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil().setWidth(48)),
HEmptyView(16),
value['title'] == '其他原因'
? Expanded(
child: Container(
// height: w(42),
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(r(4))),
padding: EdgeInsets.only(
left: w(8), top: w(10), bottom: w(10)),
child: TextField(
maxLines: 1,
controller: _depositController,
focusNode: _depositNode,
// textAlignVertical:
// TextAlignVertical
// .bottom,
decoration: InputDecoration(
isCollapsed: true,
contentPadding: EdgeInsets.zero,
hintText: "其他",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(30),
),
border: InputBorder.none,
),
onChanged: (value) {
// if (depositReasonList[4]['select']) {
// callback(value);
// }
},
onEditingComplete: () {
print('fff');
_depositNode.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
: Container(
width: w(100),
child: Text(value['title'],
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none,
color: MyColours.color_E5000000)))
],
),
);
}).toList(),
)),
VEmptyView(34),
// MyDivider(double.infinity, w(1), color: MyColours.color_E7E7E7)
],
);
}
///取消预订弹框
_showCancelWidget(context, NoteBookOnlySunModel notebook,
List<ReserveDepositSunModel> reserveDepositList) {
List<Map<String, dynamic>> cancelReasonList = [
{'title': '顾客取消', 'select': false},
{'title': '顾客行程有变', 'select': false},
{'title': '操作失误', 'select': false},
{'title': '信息填写有误', 'select': false},
{'title': '其他原因', 'select': false},
];
List<Map<String, dynamic>> depositReasonList = [
{'title': '订金已退', 'select': false},
{'title': '充入会员卡', 'select': false},
{'title': '留下次使用', 'select': false},
{'title': '抵做餐费用', 'select': false},
{'title': '其他原因', 'select': false},
];
FocusNode _depositNode = FocusNode();
TextEditingController _depositController = TextEditingController();
ScrollController _scrollController = ScrollController();
FocusNode _cancelNode = FocusNode();
TextEditingController _cancelController = TextEditingController();
String? desc2 = '';
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return StatefulBuilder(builder: (context, state) {
_cancelState = state;
return Scaffold(
backgroundColor: Colors.transparent,
body: Center(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
// height: ScreenUtil().setWidth(421 * 2),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(16))),
child: SingleChildScrollView(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(
ScreenUtil().setWidth(10)))), //设置圆角
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
VEmptyView(48),
// Stack(
// children: [
// VEmptyView(40),
SingleChildScrollView(
controller: _scrollController,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: w(24)),
height: ScreenUtil().setWidth(48),
child: Text(
'请选择取消原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: MyColours.color_E5000000),
),
),
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(24)),
child: Wrap(
runSpacing: w(20),
// mainAxisSize: MainAxisSize.min,
children:
cancelReasonList.map((value) {
return GestureDetector(
onTap: () {
FocusScope.of(context)
.requestFocus(
new FocusNode());
for (var item
in cancelReasonList) {
item['select'] = false;
// isShowTF = false;
if (item['title'] ==
value['title']) {
item['select'] = true;
// if (item['title'] ==
// '其他原因') {
// isShowTF = true;
// }
}
}
state(() {});
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(48)),
HEmptyView(16),
value['title'] == '其他原因'
? Expanded(
child: Container(
// height: w(42),
decoration: BoxDecoration(
color: MyColours
.color_f3f3f3,
borderRadius:
BorderRadius
.circular(
r(4))),
padding:
EdgeInsets.only(
left: w(8),
top: w(10),
bottom:
w(10)),
child: TextField(
maxLines: 1,
controller:
_cancelController,
focusNode:
_cancelNode,
// textAlignVertical:
// TextAlignVertical
// .bottom,
decoration:
InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets
.zero,
hintText: "其他",
hintStyle:
TextStyle(
color: MyColours
.color_999999,
fontSize:
ScreenUtil()
.setSp(
30),
),
border:
InputBorder
.none,
),
onChanged: (_) {},
onEditingComplete:
() {
print('fff');
_cancelNode
.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
: Container(
width: w(100),
child: Text(
value['title'],
style: TextStyle(
overflow:
TextOverflow
.ellipsis,
fontSize:
ScreenUtil()
.setSp(
32),
fontWeight:
FontWeight
.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_E5000000)))
],
),
);
}).toList(),
)),
VEmptyView(34),
if (reserveDepositList.length > 0)
_depositWidget(
reserveDepositList,
depositReasonList,
_depositNode,
_depositController, (value) {
//定金走向
desc2 = value;
}),
MyDivider(double.infinity, w(1),
color: MyColours.color_E7E7E7)
],
)),
// VEmptyView(15),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '取消',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 34,
onPressed: () {
Navigator.of(context).pop();
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_DBDBDB),
RoundButton(
text: '确定',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_438E93,
fontSize: 34,
onPressed: () async {
String? desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc =
_cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写取消原因");
return;
}
}
}
}
if (desc == '') {
Utils.showToast('请选择取消原因');
return;
}
if (reserveDepositList.length > 0) {
// for (var value in depositReasonList) {
// if (value['select'] == true) {
// desc2 = value['title'];
// if (value['title'] == '其他原因') {
// desc2 = _depositController.text
// .trim();
// if (desc2.isEmpty) {
// Utils.showToast("请填写预订订金走向");
// return;
// }
// }
// }
// }
if (desc2 == '') {
Utils.showToast('请选择预订订金走向');
return;
} else if (desc2 == '其他原因' &&
_depositController.text
.trim()
.length ==
0) {
Utils.showToast('请填写预订订金走向');
return;
}
}
Navigator.of(context).pop();
Loading.showLoading(context);
await setReserveStatus(
'4',
notebook,
desc: desc,
);
if (reserveDepositList.length > 0) {
Map<String, String?> pramas = {
'rid': notebook.id,
'cancel': desc2 == '其他原因'
? _depositController.text
: desc2
};
await detailModel.setReserveDeposit(
context, pramas);
}
}),
],
),
],
),
),
)),
),
));
});
});
}
// ///取消预订弹框
// _showCancelWidget(context, NoteBookOnlySunModel notebook) {
// // _scrollController = ScrollController();
// FocusNode _cancelNode = FocusNode();
// TextEditingController _cancelController = TextEditingController();
// /// 初始化取消原因数据
// List cancelReasonList = [];
// cancelReasonList = [
// {'title': '顾客取消', 'select': false},
// {'title': '顾客行程有变', 'select': false},
// {'title': '信息填写有误', 'select': false},
// {'title': '操作失误', 'select': false},
// {'title': '其他原因', 'select': false},
// ];
// showGeneralDialog(
// context: context,
// barrierDismissible: false,
// barrierLabel:
// MaterialLocalizations.of(context).modalBarrierDismissLabel,
// transitionDuration: const Duration(milliseconds: 150),
// barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
// pageBuilder: (BuildContext context, Animation animation,
// Animation secondaryAnimation) {
// return Scaffold(
// backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
// body: StatefulBuilder(builder: (context, state) {
// // _cancelState = state;
// return GestureDetector(
// behavior: HitTestBehavior.opaque,
// // onTap: () {
// // Navigator.of(context).pop();
// // },
// child: Center(
// child: Container(
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(28 * 2)),
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(32)),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius:
// BorderRadius.circular(ScreenUtil().setWidth(10)),
// ),
// height: ScreenUtil().setWidth(355 * 2),
// child: Column(
// // mainAxisSize: MainAxisSize.min,
// children: [
// // Stack(
// // children: [
// VEmptyView(48),
// Container(
// height: ScreenUtil().setWidth(48),
// child: Text(
// '是否确定取消预订',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// fontWeight: FontWeight.bold,
// decoration: TextDecoration.none,
// color: Color.fromRGBO(0, 0, 0, 0.9)),
// ),
// ),
// // Positioned(
// // top: ScreenUtil().setWidth(8),
// // right: ScreenUtil().setWidth(0),
// // child: GestureDetector(
// // onTap: () {
// // _initCancel();
// // Navigator.of(context).pop();
// // },
// // child: Container(
// // padding: EdgeInsets.only(left: 20),
// // child: Image.asset(
// // 'assets/close.png',
// // width: ScreenUtil().setWidth(32),
// // height: ScreenUtil().setWidth(32),
// // ),
// // )))
// // ],
// // ),
// VEmptyView(40),
// Container(
// child: Column(
// // mainAxisSize: MainAxisSize.min,
// children: cancelReasonList.map((value) {
// return value['title'] == '其他原因'
// ? SizedBox()
// : GestureDetector(
// onTap: () {
// for (var item in cancelReasonList) {
// item['select'] = false;
// // isShowTF = false;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340;
// if (item['title'] ==
// value['title']) {
// item['select'] = true;
// // if (item['title'] == '其他原因') {
// // // isShowTF = true;
// // // paddingBottom = 130;
// // // paddingBottom =
// // // ScreenUtil().screenHeight.ceil() -
// // // 138 -
// // // 340 -
// // // 46;
// // }
// }
// }
// state(() {});
// },
// child: Container(
// height: ScreenUtil().setWidth(48),
// margin: EdgeInsets.only(
// bottom:
// ScreenUtil().setWidth(40)),
// child: Row(
// children: [
// Image.asset(
// value['select']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil()
// .setWidth(42)),
// HEmptyView(20),
// Container(
// child: Text(value['title'],
// style: TextStyle(
// fontSize: ScreenUtil()
// .setSp(32),
// fontWeight:
// FontWeight.normal,
// decoration:
// TextDecoration
// .none,
// color: MyColours
// .color_333333)))
// ],
// ),
// ),
// );
// }).toList(),
// )),
// Material(
// child: Container(
// color: Colors.white,
// height: ScreenUtil().setWidth(42 * 2),
// child: Row(children: [
// InkWell(
// onTap: () {
// for (var item in cancelReasonList) {
// item['select'] = false;
// }
// cancelReasonList[4]['select'] =
// true;
// state(() {});
// },
// child: Padding(
// padding: EdgeInsets.only(
// right: ScreenUtil()
// .setWidth(20)),
// child: Image.asset(
// cancelReasonList[4]['select']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil()
// .setWidth(44)))),
// Expanded(
// child: Container(
// decoration: BoxDecoration(
// color: Color.fromRGBO(
// 240, 240, 240, 1),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(8))),
// // height: ScreenUtil().setWidth(42 * 2),
// padding: EdgeInsets.symmetric(
// horizontal:
// ScreenUtil().setWidth(16)),
// child: TextField(
// maxLines: 1,
// controller: _cancelController,
// focusNode: _cancelNode,
// style: TextStyle(
// textBaseline:
// TextBaseline.alphabetic),
// textAlignVertical:
// TextAlignVertical.center,
// decoration: InputDecoration(
// contentPadding: EdgeInsets.zero,
// hintText: "其他",
// // focusColor: Color.fromRGBO(0, 0, 0, 0.4),
// hintStyle: TextStyle(
// color:
// Color.fromRGBO(0, 0, 0, 0.4),
// fontSize: ScreenUtil().setSp(32),
// ),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// border: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// color: Colors.transparent)),
// ),
// // border: InputBorder.none,
// onChanged: (_) {
// setState(() {});
// },
// onEditingComplete: () {
// print('fff');
// _cancelNode.unfocus();
// },
// // keyboardType: TextInputType.numberWithOptions(decimal: true),
// ),
// ))
// ]))),
// VEmptyView(15),
// Material(
// child: RoundButton(
// onPressed: () {
// String? desc = '';
// for (var value in cancelReasonList) {
// if (value['select'] == true) {
// desc = value['title'];
// if (value['title'] == '其他原因') {
// desc = _cancelController.text.trim();
// if (desc.isEmpty) {
// Utils.showToast("请填写原因");
// return;
// }
// }
// }
// }
// if (desc == '') {
// Utils.showToast('请选择原因');
// return;
// }
// Navigator.of(context).pop();
// Loading.showLoading(context);
// setReserveStatus(
// '4',
// notebook,
// desc: desc,
// );
// },
// text: '确认',
// height: ScreenUtil().setWidth(80),
// width: ScreenUtil().setWidth(300),
// radius: ScreenUtil().setWidth(10),
// ),
// )
// ],
// ),
// ),
// ));
// }));
// });
// }
_getIsReserveCancel(bool isCancel, NoteBookOnlySunModel notebook) {
//判断时间是否可变更
bool reserveCancel = true; //默认允许变更过去餐段订单的时间
//如果不允许变更过去餐段订单的时间,则开始判断
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
if (!isCancel) {
//找到当前餐段对应的时间段
String? times = storeBaseIndoProvider.dayDateData!
.where((element) => element.ddateSolt == notebook.ddateSolt)
.first
.mdate ??
'00:00-23:59';
//组装时间戳
List<String> datas = times.split('-');
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// '-' +
// '${dateTimeSelect.month}' +
// '-' +
// '${dateTimeSelect.day}' +
// ' ${datas[0]}:00'); //选中餐段开始时间戳
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(notebook.ddate!) * 1000);
DateTime selectEtime = DateTime.parse('${dateTime.year}' +
'-' +
Utils.addZeroNumber(dateTime.month) +
'-' +
Utils.addZeroNumber(dateTime.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
// 属于过去餐段
reserveCancel = false;
} else {
// 属于未来餐段
reserveCancel = true;
}
}
return reserveCancel;
}
List<Widget> dsoltWidget() {
List<Widget> data = [];
storeBaseIndoProvider.dayDateData!.forEach((element) {
... ... @@ -747,6 +1569,105 @@ class NoteBookPageState extends State<NoteBookPage> {
return data;
}
/// 通过预订ID查收订金详情
_getReserveDepositByRid(String rid) async {
Map<String, String> params = {
'rid': rid,
};
await detailModel.getReserveDepositByRid(context, params,
showLoading: true);
List<ReserveDepositSunModel> reserveDepositList = [];
detailModel.reserveDepositList!.forEach((element) {
if (element.payType != '微信预订通知') {
reserveDepositList.add(element);
} else if (element.payType == '微信预订通知' &&
element.tradeState == 'SUCCESS') {
reserveDepositList.add(element);
}
});
return reserveDepositList;
}
_cancelReaserve(NoteBookOnlySunModel notebook) async {
bool isCancel = _getIsReserveCancel(isReserveCancel, notebook);
if (isCancel) {
bool cancelCan = false;
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(notebook.ddate!) * 1000);
String roleName =
Provider.of<UserModel>(context, listen: false).user!.role_name ?? '';
if (roleName == '管理员' || roleName == '前台') {
cancelCan = true;
} else if (roleName == '店长') {
if (cancelShopowner) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds = dateTime.difference(DateTime.now()).inSeconds;
if (int.parse(cancelDay!) != 0 &&
differenceSeconds < int.parse(cancelDay!) * 24 * 60 * 60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else if (roleName == '客户经理') {
if (cancelManager) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds = dateTime.difference(DateTime.now()).inSeconds;
if (int.parse(cancelDay!) != 0 &&
differenceSeconds < int.parse(cancelDay!) * 24 * 60 * 60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
} else {
if (cancelOther) {
cancelCan = true;
} else {
//临餐不可以取消
//比较相差的天数
int differenceSeconds = dateTime.difference(DateTime.now()).inSeconds;
if (int.parse(cancelDay!) != 0 &&
differenceSeconds < int.parse(cancelDay!) * 24 * 60 * 60) {
// 临餐时间内
cancelCan = false;
} else {
cancelCan = true;
}
}
}
if (cancelCan) {
List<ReserveDepositSunModel> reserveDepositList =
await _getReserveDepositByRid(notebook.id!);
_showCancelWidget(context, notebook, reserveDepositList);
} else {
Utils.showToast('临餐不可取消预订!请与前台联系取消。');
}
} else {
Utils.showToast('过去餐段的订单不可取消预订!请与前台联系取消。');
}
}
@override
Widget build(BuildContext context) {
// TODO: implement build
... ... @@ -756,6 +1677,8 @@ class NoteBookPageState extends State<NoteBookPage> {
Provider.of<StoreBaseIndoProvider>(context, listen: true);
collectStoreProvider =
Provider.of<CollectStoreProvider>(context, listen: true);
detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
// int sum = 3;
// int hide = 0;
// int btnNum = 0;
... ... @@ -1303,28 +2226,47 @@ class NoteBookPageState extends State<NoteBookPage> {
child: model.notebooksSort![index].issimple
? NoteBookItemSimple(
index, model.notebooksSort![index],
() {
onTapChange: () {
_itemChangeSimple(
model.notebooksSort![index]);
},
cancelDay,
cancelShopowner,
cancelManager,
cancelOther,
isReserveCancel)
}, onTapLeave: () {
Loading.showLoading(context);
setReserveStatus(
'3', model.notebooksSort![index]);
}, onTapReach: () {
Loading.showLoading(context);
setReserveStatus(
'2', model.notebooksSort![index]);
}, onTapCancel: () {
_cancelReaserve(
model.notebooksSort![index]);
})
: NoteBookItemF(
index,
model.notebooksSort![index],
collectStoreProvider.sellerPreserve,
() {
onTapChange: () {
_itemChangeSimple(
model.notebooksSort![index]);
},
cancelDay,
cancelShopowner,
cancelManager,
cancelOther,
isReserveCancel),
}, onTapLeave: () {
Loading.showLoading(context);
setReserveStatus(
'3', model.notebooksSort![index]);
}, onTapReach: () {
Loading.showLoading(context);
setReserveStatus(
'2', model.notebooksSort![index]);
}, onTapCancel: () {
_cancelReaserve(
model.notebooksSort![index]);
}
// cancelDay,
// cancelShopowner,
// cancelManager,
// cancelOther,
// isReserveCancel
),
);
}, childCount: model.notebooksSort!.length),
// itemExtent: ScreenUtil().setWidth(112),
... ...
... ... @@ -352,11 +352,11 @@ class NotebookDetailModel extends ChangeNotifier {
/// 通过预订ID查收订金详情
Future<List<ReserveDepositSunModel>?> getReserveDepositByRid(
BuildContext context, Map<String, String> params) async {
BuildContext context, Map<String, String> params,{bool showLoading=false}) async {
try {
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.get_reserve_deposit_by_rid,
data: params, showLoading: false);
data: params, showLoading: showLoading);
if (baseResp.code == Constant.status_success) {
reserveDepositList = ReserveDepositModel.fromJson(
baseResp.responseData as Map<String, dynamic>)
... ...