Commit 50f1096a65d2bec07546e20558c8a92d3c0e36e4

Authored by weixin_45529955
1 parent f25bdccc

取消预订增加确认弹框

... ... @@ -1285,6 +1285,31 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
);
}
String _returnOldDayDateWeek(DateTime day) {
String date = '';
DateTime dateNow = DateTime.now();
// dateShowNow = "";
// if (Utils.isOneDay(day, dateNow)) {
// dateShowNow = "今天 ";
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
// dateShowNow = "明天 ";
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
// dateShowNow = "后天 ";
// }
String ymd = "${day.year}年" +
Utils.addZeroNumber(day.month) +
"月" +
Utils.addZeroNumber(day.day) +
'日';
date += ymd;
// date += ' ';
// date += Utils.lunarCalendarHolidays(day)!;
// date += ' ';
date += "星期${Utils.formatWeekDayNum(day.weekday)}";
return date;
}
///取消预订弹框
_showCancelWidget(context, phone) {
_scrollController = ScrollController();
... ... @@ -1554,23 +1579,66 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
}
}
Navigator.of(context).pop();
Loading.showLoading(context);
//取消确认弹框
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(
int.parse(detailModel!
.detailModelAllSunModel!
.ddate!) *
1000);
await setReserveStatus('4',
desc: desc, phone: phone);
String oldInfo =
_returnOldDayDateWeek(dateTime);
if (detailModel!.detailModelAllSunModel!
.reserveDepositInfo!.length >
0) {
Map<String, String?> pramas = {
'rid': widget.rid,
'cancel': desc2
};
oldInfo +=
' ${detailModel!.detailModelAllSunModel!.mname}';
await detailModel!
.setReserveDeposit(context, pramas);
String result = '';
detailModel!
.detailModelAllSunModel!.tables
.forEach((element) {
result += element + '、';
});
if (result.endsWith('、')) {
result = result.substring(
0, result.length - 1);
}
oldInfo += ' ${result}';
// oldInfo = detailEntity!.ddateYMD + detailEntity!.tableinfoStr;
print(oldInfo);
DialogUtil.cupertinoAlertDialogCancelReseve(
context,
title: '',
// content1:
// '确定要将${oldInfo}的预订 变更为 ${newInfo}?',
content: oldInfo,
lTitle: '取消',
lCallback: () {},
rTitle: '确定', rCallback: () async {
Navigator.of(context).pop();
Loading.showLoading(context);
await setReserveStatus('4',
desc: desc, phone: phone);
if (detailModel!.detailModelAllSunModel!
.reserveDepositInfo!.length >
0) {
Map<String, String?> pramas = {
'rid': widget.rid,
'cancel': desc2
};
await detailModel!.setReserveDeposit(
context, pramas);
}
});
}),
],
),
... ...
... ... @@ -884,6 +884,31 @@ class NoteBookPageState extends State<NoteBookPage> {
);
}
String _returnOldDayDateWeek(DateTime day) {
String date = '';
// DateTime dateNow = DateTime.now();
// if (Utils.isOneDay(day, dateNow)) {
// dateShowNow = "今天 ";
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
// dateShowNow = "明天 ";
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
// dateShowNow = "后天 ";
// }
String ymd = "${day.year}年" +
Utils.addZeroNumber(day.month) +
"月" +
Utils.addZeroNumber(day.day) +
'日';
date += ymd;
// date += ' ';
// date += Utils.lunarCalendarHolidays(day)!;
// date += ' ';
date += "星期${Utils.formatWeekDayNum(day.weekday)}";
return date;
}
///取消预订弹框
_showCancelWidget(context, NoteBookOnlySunModel notebook,
List<ReserveDepositSunModel> reserveDepositList) {
... ... @@ -1182,26 +1207,67 @@ class NoteBookPageState extends State<NoteBookPage> {
}
}
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);
}
//取消确认弹框
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(
int.parse(notebook.ddate!) *
1000);
String oldInfo =
_returnOldDayDateWeek(dateTime);
oldInfo +=
' ${notebook.mname}';
String result = notebook.tableNameStr??'';
// notebook.tablename
// .forEach((element) {
// result += element + '、';
// });
// if (result.endsWith('、')) {
// result = result.substring(
// 0, result.length - 1);
// }
oldInfo += ' ${result}';
// oldInfo = detailEntity!.ddateYMD + detailEntity!.tableinfoStr;
print(oldInfo);
DialogUtil.cupertinoAlertDialogCancelReseve(
context,
title: '',
// content1:
// '确定要将${oldInfo}的预订 变更为 ${newInfo}?',
content: oldInfo,
lTitle: '取消',
lCallback: () {},
rTitle: '确定', rCallback: () async {
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);
}
});
}),
],
),
... ...
... ... @@ -11853,15 +11853,98 @@ class DialogUtil {
),
children: [
TextSpan(
text: '确定要将', style: TextStyle(color: contentColor)),
text: '确定要将预订:', style: TextStyle(color: contentColor)),
TextSpan(text: '\n\n', style: TextStyle(color: contentColor)),
TextSpan(
text: contentold,
style: TextStyle(color: MyColours.color_438E93)),
TextSpan(text: '的预订变更为', style: TextStyle(color: contentColor)),
text: contentold, style: TextStyle(color: contentColor)),
TextSpan(text: '\n\n', style: TextStyle(color: contentColor)),
TextSpan(text: '变更为:', style: TextStyle(color: contentColor)),
TextSpan(text: '\n', style: TextStyle(color: contentColor)),
TextSpan(
text: contentnew,
style: TextStyle(color: MyColours.color_438E93)),
TextSpan(text: '?', style: TextStyle(color: contentColor)),
text: contentnew, style: TextStyle(color: contentColor)),
// TextSpan(text: '?', style: TextStyle(color: contentColor)),
])),
// content: Text(content,
// textAlign: textAlign,
// style: TextStyle(
// fontWeight:
// isBoldContent ? FontWeight.bold : FontWeight.normal,
// fontSize: ScreenUtil().setSp(30),
// color: contentColor)),
actions: [
if (showlTitle)
CupertinoDialogAction(
child: Text(lTitle,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E6000000)),
onPressed: () {
Navigator.of(context).pop();
if (lCallback != null) {
lCallback();
}
},
),
CupertinoDialogAction(
child: Text(rTitle,
style: TextStyle(
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
fontSize: ScreenUtil().setSp(32),
color: rColor)),
onPressed: () {
Navigator.of(context).pop();
if (rCallback != null) {
rCallback();
}
},
),
],
);
},
);
}
static cupertinoAlertDialogCancelReseve(BuildContext context,
{String title = "",
String content = "内容",
String lTitle = "取消",
String rTitle = "确定",
Color rColor = MyColours.color_438E93,
bool isBold = false,
bool isBoldContent = false,
bool showlTitle = true,
Color contentColor = MyColours.color_99000000,
VoidCallback? lCallback,
TextAlign textAlign = TextAlign.center,
VoidCallback? rCallback}) {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: title != ''
? Text(title,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E6000000))
: SizedBox(),
content: RichText(
text: TextSpan(
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
),
children: [
TextSpan(
text: '确定要将预订:', style: TextStyle(color: contentColor)),
TextSpan(text: '\n\n', style: TextStyle(color: contentColor)),
TextSpan(text: content, style: TextStyle(color: contentColor)),
TextSpan(text: '\n\n', style: TextStyle(color: contentColor)),
TextSpan(text: '取消吗?', style: TextStyle(color: contentColor)),
// TextSpan(text: '\n', style: TextStyle(color: contentColor)),
// TextSpan(
// text: contentnew, style: TextStyle(color: contentColor)),
// TextSpan(text: '?', style: TextStyle(color: contentColor)),
])),
// content: Text(content,
// textAlign: textAlign,
... ...
... ... @@ -660,10 +660,10 @@ packages:
dependency: "direct main"
description:
name: flutter_downloader
sha256: "93a9ddbd561f8a3f5483b4189453fba145a0a1014a88143c96a966296b78a118"
sha256: "3d7313746c5f376b2209a59888a1c2766d94e09c26dc93fa23a725426e3f341c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.12.0"
version: "1.10.5"
flutter_draggable_gridview:
dependency: "direct main"
description:
... ...
... ... @@ -213,7 +213,7 @@ dependencies:
flutter_inappwebview: ^6.2.0-beta.2
# flutter_inappwebview: ^6.0.0
flutter_downloader: ^1.12.0
flutter_downloader: 1.10.5
# android_path_provider: 0.3.0
# open_file: ^3.2.1
# open_file: ^3.3.2
... ...