Showing
5 changed files
with
260 additions
and
43 deletions
| @@ -1285,6 +1285,31 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -1285,6 +1285,31 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 1285 | ); | 1285 | ); |
| 1286 | } | 1286 | } |
| 1287 | 1287 | ||
| 1288 | + String _returnOldDayDateWeek(DateTime day) { | ||
| 1289 | + String date = ''; | ||
| 1290 | + DateTime dateNow = DateTime.now(); | ||
| 1291 | + // dateShowNow = ""; | ||
| 1292 | + // if (Utils.isOneDay(day, dateNow)) { | ||
| 1293 | + // dateShowNow = "今天 "; | ||
| 1294 | + // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) { | ||
| 1295 | + // dateShowNow = "明天 "; | ||
| 1296 | + // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) { | ||
| 1297 | + // dateShowNow = "后天 "; | ||
| 1298 | + // } | ||
| 1299 | + String ymd = "${day.year}年" + | ||
| 1300 | + Utils.addZeroNumber(day.month) + | ||
| 1301 | + "月" + | ||
| 1302 | + Utils.addZeroNumber(day.day) + | ||
| 1303 | + '日'; | ||
| 1304 | + | ||
| 1305 | + date += ymd; | ||
| 1306 | + // date += ' '; | ||
| 1307 | + // date += Utils.lunarCalendarHolidays(day)!; | ||
| 1308 | + // date += ' '; | ||
| 1309 | + date += "星期${Utils.formatWeekDayNum(day.weekday)}"; | ||
| 1310 | + return date; | ||
| 1311 | + } | ||
| 1312 | + | ||
| 1288 | ///取消预订弹框 | 1313 | ///取消预订弹框 |
| 1289 | _showCancelWidget(context, phone) { | 1314 | _showCancelWidget(context, phone) { |
| 1290 | _scrollController = ScrollController(); | 1315 | _scrollController = ScrollController(); |
| @@ -1554,23 +1579,66 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -1554,23 +1579,66 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 1554 | } | 1579 | } |
| 1555 | } | 1580 | } |
| 1556 | 1581 | ||
| 1557 | - Navigator.of(context).pop(); | ||
| 1558 | - Loading.showLoading(context); | 1582 | + //取消确认弹框 |
| 1583 | + DateTime dateTime = | ||
| 1584 | + DateTime.fromMillisecondsSinceEpoch( | ||
| 1585 | + int.parse(detailModel! | ||
| 1586 | + .detailModelAllSunModel! | ||
| 1587 | + .ddate!) * | ||
| 1588 | + 1000); | ||
| 1559 | 1589 | ||
| 1560 | - await setReserveStatus('4', | ||
| 1561 | - desc: desc, phone: phone); | 1590 | + String oldInfo = |
| 1591 | + _returnOldDayDateWeek(dateTime); | ||
| 1562 | 1592 | ||
| 1563 | - if (detailModel!.detailModelAllSunModel! | ||
| 1564 | - .reserveDepositInfo!.length > | ||
| 1565 | - 0) { | ||
| 1566 | - Map<String, String?> pramas = { | ||
| 1567 | - 'rid': widget.rid, | ||
| 1568 | - 'cancel': desc2 | ||
| 1569 | - }; | 1593 | + oldInfo += |
| 1594 | + ' ${detailModel!.detailModelAllSunModel!.mname}'; | ||
| 1570 | 1595 | ||
| 1571 | - await detailModel! | ||
| 1572 | - .setReserveDeposit(context, pramas); | 1596 | + String result = ''; |
| 1597 | + | ||
| 1598 | + detailModel! | ||
| 1599 | + .detailModelAllSunModel!.tables | ||
| 1600 | + .forEach((element) { | ||
| 1601 | + result += element + '、'; | ||
| 1602 | + }); | ||
| 1603 | + | ||
| 1604 | + if (result.endsWith('、')) { | ||
| 1605 | + result = result.substring( | ||
| 1606 | + 0, result.length - 1); | ||
| 1573 | } | 1607 | } |
| 1608 | + | ||
| 1609 | + oldInfo += ' ${result}'; | ||
| 1610 | + | ||
| 1611 | + // oldInfo = detailEntity!.ddateYMD + detailEntity!.tableinfoStr; | ||
| 1612 | + | ||
| 1613 | + print(oldInfo); | ||
| 1614 | + | ||
| 1615 | + DialogUtil.cupertinoAlertDialogCancelReseve( | ||
| 1616 | + context, | ||
| 1617 | + title: '', | ||
| 1618 | + // content1: | ||
| 1619 | + // '确定要将${oldInfo}的预订 变更为 ${newInfo}?', | ||
| 1620 | + content: oldInfo, | ||
| 1621 | + lTitle: '取消', | ||
| 1622 | + lCallback: () {}, | ||
| 1623 | + rTitle: '确定', rCallback: () async { | ||
| 1624 | + Navigator.of(context).pop(); | ||
| 1625 | + Loading.showLoading(context); | ||
| 1626 | + | ||
| 1627 | + await setReserveStatus('4', | ||
| 1628 | + desc: desc, phone: phone); | ||
| 1629 | + | ||
| 1630 | + if (detailModel!.detailModelAllSunModel! | ||
| 1631 | + .reserveDepositInfo!.length > | ||
| 1632 | + 0) { | ||
| 1633 | + Map<String, String?> pramas = { | ||
| 1634 | + 'rid': widget.rid, | ||
| 1635 | + 'cancel': desc2 | ||
| 1636 | + }; | ||
| 1637 | + | ||
| 1638 | + await detailModel!.setReserveDeposit( | ||
| 1639 | + context, pramas); | ||
| 1640 | + } | ||
| 1641 | + }); | ||
| 1574 | }), | 1642 | }), |
| 1575 | ], | 1643 | ], |
| 1576 | ), | 1644 | ), |
| @@ -884,6 +884,31 @@ class NoteBookPageState extends State<NoteBookPage> { | @@ -884,6 +884,31 @@ class NoteBookPageState extends State<NoteBookPage> { | ||
| 884 | ); | 884 | ); |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | + String _returnOldDayDateWeek(DateTime day) { | ||
| 888 | + String date = ''; | ||
| 889 | + // DateTime dateNow = DateTime.now(); | ||
| 890 | + | ||
| 891 | + // if (Utils.isOneDay(day, dateNow)) { | ||
| 892 | + // dateShowNow = "今天 "; | ||
| 893 | + // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) { | ||
| 894 | + // dateShowNow = "明天 "; | ||
| 895 | + // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) { | ||
| 896 | + // dateShowNow = "后天 "; | ||
| 897 | + // } | ||
| 898 | + String ymd = "${day.year}年" + | ||
| 899 | + Utils.addZeroNumber(day.month) + | ||
| 900 | + "月" + | ||
| 901 | + Utils.addZeroNumber(day.day) + | ||
| 902 | + '日'; | ||
| 903 | + | ||
| 904 | + date += ymd; | ||
| 905 | + // date += ' '; | ||
| 906 | + // date += Utils.lunarCalendarHolidays(day)!; | ||
| 907 | + // date += ' '; | ||
| 908 | + date += "星期${Utils.formatWeekDayNum(day.weekday)}"; | ||
| 909 | + return date; | ||
| 910 | + } | ||
| 911 | + | ||
| 887 | ///取消预订弹框 | 912 | ///取消预订弹框 |
| 888 | _showCancelWidget(context, NoteBookOnlySunModel notebook, | 913 | _showCancelWidget(context, NoteBookOnlySunModel notebook, |
| 889 | List<ReserveDepositSunModel> reserveDepositList) { | 914 | List<ReserveDepositSunModel> reserveDepositList) { |
| @@ -1182,26 +1207,67 @@ class NoteBookPageState extends State<NoteBookPage> { | @@ -1182,26 +1207,67 @@ class NoteBookPageState extends State<NoteBookPage> { | ||
| 1182 | } | 1207 | } |
| 1183 | } | 1208 | } |
| 1184 | 1209 | ||
| 1185 | - Navigator.of(context).pop(); | ||
| 1186 | - Loading.showLoading(context); | ||
| 1187 | - | ||
| 1188 | - await setReserveStatus( | ||
| 1189 | - '4', | ||
| 1190 | - notebook, | ||
| 1191 | - desc: desc, | ||
| 1192 | - ); | ||
| 1193 | - | ||
| 1194 | - if (reserveDepositList.length > 0) { | ||
| 1195 | - Map<String, String?> pramas = { | ||
| 1196 | - 'rid': notebook.id, | ||
| 1197 | - 'cancel': desc2 == '其他原因' | ||
| 1198 | - ? _depositController.text | ||
| 1199 | - : desc2 | ||
| 1200 | - }; | ||
| 1201 | - | ||
| 1202 | - await detailModel.setReserveDeposit( | ||
| 1203 | - context, pramas); | ||
| 1204 | - } | 1210 | + //取消确认弹框 |
| 1211 | + | ||
| 1212 | + DateTime dateTime = | ||
| 1213 | + DateTime.fromMillisecondsSinceEpoch( | ||
| 1214 | + int.parse(notebook.ddate!) * | ||
| 1215 | + 1000); | ||
| 1216 | + | ||
| 1217 | + String oldInfo = | ||
| 1218 | + _returnOldDayDateWeek(dateTime); | ||
| 1219 | + | ||
| 1220 | + oldInfo += | ||
| 1221 | + ' ${notebook.mname}'; | ||
| 1222 | + | ||
| 1223 | + String result = notebook.tableNameStr??''; | ||
| 1224 | + | ||
| 1225 | + // notebook.tablename | ||
| 1226 | + // .forEach((element) { | ||
| 1227 | + // result += element + '、'; | ||
| 1228 | + // }); | ||
| 1229 | + | ||
| 1230 | + // if (result.endsWith('、')) { | ||
| 1231 | + // result = result.substring( | ||
| 1232 | + // 0, result.length - 1); | ||
| 1233 | + // } | ||
| 1234 | + | ||
| 1235 | + oldInfo += ' ${result}'; | ||
| 1236 | + | ||
| 1237 | + // oldInfo = detailEntity!.ddateYMD + detailEntity!.tableinfoStr; | ||
| 1238 | + | ||
| 1239 | + print(oldInfo); | ||
| 1240 | + | ||
| 1241 | + DialogUtil.cupertinoAlertDialogCancelReseve( | ||
| 1242 | + context, | ||
| 1243 | + title: '', | ||
| 1244 | + // content1: | ||
| 1245 | + // '确定要将${oldInfo}的预订 变更为 ${newInfo}?', | ||
| 1246 | + content: oldInfo, | ||
| 1247 | + lTitle: '取消', | ||
| 1248 | + lCallback: () {}, | ||
| 1249 | + rTitle: '确定', rCallback: () async { | ||
| 1250 | + Navigator.of(context).pop(); | ||
| 1251 | + Loading.showLoading(context); | ||
| 1252 | + | ||
| 1253 | + await setReserveStatus( | ||
| 1254 | + '4', | ||
| 1255 | + notebook, | ||
| 1256 | + desc: desc, | ||
| 1257 | + ); | ||
| 1258 | + | ||
| 1259 | + if (reserveDepositList.length > 0) { | ||
| 1260 | + Map<String, String?> pramas = { | ||
| 1261 | + 'rid': notebook.id, | ||
| 1262 | + 'cancel': desc2 == '其他原因' | ||
| 1263 | + ? _depositController.text | ||
| 1264 | + : desc2 | ||
| 1265 | + }; | ||
| 1266 | + | ||
| 1267 | + await detailModel.setReserveDeposit( | ||
| 1268 | + context, pramas); | ||
| 1269 | + } | ||
| 1270 | + }); | ||
| 1205 | }), | 1271 | }), |
| 1206 | ], | 1272 | ], |
| 1207 | ), | 1273 | ), |
| @@ -11853,15 +11853,98 @@ class DialogUtil { | @@ -11853,15 +11853,98 @@ class DialogUtil { | ||
| 11853 | ), | 11853 | ), |
| 11854 | children: [ | 11854 | children: [ |
| 11855 | TextSpan( | 11855 | TextSpan( |
| 11856 | - text: '确定要将', style: TextStyle(color: contentColor)), | 11856 | + text: '确定要将预订:', style: TextStyle(color: contentColor)), |
| 11857 | + TextSpan(text: '\n\n', style: TextStyle(color: contentColor)), | ||
| 11857 | TextSpan( | 11858 | TextSpan( |
| 11858 | - text: contentold, | ||
| 11859 | - style: TextStyle(color: MyColours.color_438E93)), | ||
| 11860 | - TextSpan(text: '的预订变更为', style: TextStyle(color: contentColor)), | 11859 | + text: contentold, style: TextStyle(color: contentColor)), |
| 11860 | + TextSpan(text: '\n\n', style: TextStyle(color: contentColor)), | ||
| 11861 | + TextSpan(text: '变更为:', style: TextStyle(color: contentColor)), | ||
| 11862 | + TextSpan(text: '\n', style: TextStyle(color: contentColor)), | ||
| 11861 | TextSpan( | 11863 | TextSpan( |
| 11862 | - text: contentnew, | ||
| 11863 | - style: TextStyle(color: MyColours.color_438E93)), | ||
| 11864 | - TextSpan(text: '?', style: TextStyle(color: contentColor)), | 11864 | + text: contentnew, style: TextStyle(color: contentColor)), |
| 11865 | + // TextSpan(text: '?', style: TextStyle(color: contentColor)), | ||
| 11866 | + ])), | ||
| 11867 | + // content: Text(content, | ||
| 11868 | + // textAlign: textAlign, | ||
| 11869 | + // style: TextStyle( | ||
| 11870 | + // fontWeight: | ||
| 11871 | + // isBoldContent ? FontWeight.bold : FontWeight.normal, | ||
| 11872 | + // fontSize: ScreenUtil().setSp(30), | ||
| 11873 | + // color: contentColor)), | ||
| 11874 | + actions: [ | ||
| 11875 | + if (showlTitle) | ||
| 11876 | + CupertinoDialogAction( | ||
| 11877 | + child: Text(lTitle, | ||
| 11878 | + style: TextStyle( | ||
| 11879 | + fontSize: ScreenUtil().setSp(32), | ||
| 11880 | + color: MyColours.color_E6000000)), | ||
| 11881 | + onPressed: () { | ||
| 11882 | + Navigator.of(context).pop(); | ||
| 11883 | + if (lCallback != null) { | ||
| 11884 | + lCallback(); | ||
| 11885 | + } | ||
| 11886 | + }, | ||
| 11887 | + ), | ||
| 11888 | + CupertinoDialogAction( | ||
| 11889 | + child: Text(rTitle, | ||
| 11890 | + style: TextStyle( | ||
| 11891 | + fontWeight: isBold ? FontWeight.bold : FontWeight.normal, | ||
| 11892 | + fontSize: ScreenUtil().setSp(32), | ||
| 11893 | + color: rColor)), | ||
| 11894 | + onPressed: () { | ||
| 11895 | + Navigator.of(context).pop(); | ||
| 11896 | + | ||
| 11897 | + if (rCallback != null) { | ||
| 11898 | + rCallback(); | ||
| 11899 | + } | ||
| 11900 | + }, | ||
| 11901 | + ), | ||
| 11902 | + ], | ||
| 11903 | + ); | ||
| 11904 | + }, | ||
| 11905 | + ); | ||
| 11906 | + } | ||
| 11907 | + | ||
| 11908 | + static cupertinoAlertDialogCancelReseve(BuildContext context, | ||
| 11909 | + {String title = "", | ||
| 11910 | + String content = "内容", | ||
| 11911 | + String lTitle = "取消", | ||
| 11912 | + String rTitle = "确定", | ||
| 11913 | + Color rColor = MyColours.color_438E93, | ||
| 11914 | + bool isBold = false, | ||
| 11915 | + bool isBoldContent = false, | ||
| 11916 | + bool showlTitle = true, | ||
| 11917 | + Color contentColor = MyColours.color_99000000, | ||
| 11918 | + VoidCallback? lCallback, | ||
| 11919 | + TextAlign textAlign = TextAlign.center, | ||
| 11920 | + VoidCallback? rCallback}) { | ||
| 11921 | + showCupertinoDialog( | ||
| 11922 | + context: context, | ||
| 11923 | + builder: (context) { | ||
| 11924 | + return CupertinoAlertDialog( | ||
| 11925 | + title: title != '' | ||
| 11926 | + ? Text(title, | ||
| 11927 | + style: TextStyle( | ||
| 11928 | + fontWeight: FontWeight.bold, | ||
| 11929 | + fontSize: ScreenUtil().setSp(32), | ||
| 11930 | + color: MyColours.color_E6000000)) | ||
| 11931 | + : SizedBox(), | ||
| 11932 | + content: RichText( | ||
| 11933 | + text: TextSpan( | ||
| 11934 | + style: TextStyle( | ||
| 11935 | + fontSize: ScreenUtil().setSp(28), | ||
| 11936 | + ), | ||
| 11937 | + children: [ | ||
| 11938 | + TextSpan( | ||
| 11939 | + text: '确定要将预订:', style: TextStyle(color: contentColor)), | ||
| 11940 | + TextSpan(text: '\n\n', style: TextStyle(color: contentColor)), | ||
| 11941 | + TextSpan(text: content, style: TextStyle(color: contentColor)), | ||
| 11942 | + TextSpan(text: '\n\n', style: TextStyle(color: contentColor)), | ||
| 11943 | + TextSpan(text: '取消吗?', style: TextStyle(color: contentColor)), | ||
| 11944 | + // TextSpan(text: '\n', style: TextStyle(color: contentColor)), | ||
| 11945 | + // TextSpan( | ||
| 11946 | + // text: contentnew, style: TextStyle(color: contentColor)), | ||
| 11947 | + // TextSpan(text: '?', style: TextStyle(color: contentColor)), | ||
| 11865 | ])), | 11948 | ])), |
| 11866 | // content: Text(content, | 11949 | // content: Text(content, |
| 11867 | // textAlign: textAlign, | 11950 | // textAlign: textAlign, |
| @@ -660,10 +660,10 @@ packages: | @@ -660,10 +660,10 @@ packages: | ||
| 660 | dependency: "direct main" | 660 | dependency: "direct main" |
| 661 | description: | 661 | description: |
| 662 | name: flutter_downloader | 662 | name: flutter_downloader |
| 663 | - sha256: "93a9ddbd561f8a3f5483b4189453fba145a0a1014a88143c96a966296b78a118" | 663 | + sha256: "3d7313746c5f376b2209a59888a1c2766d94e09c26dc93fa23a725426e3f341c" |
| 664 | url: "https://pub.flutter-io.cn" | 664 | url: "https://pub.flutter-io.cn" |
| 665 | source: hosted | 665 | source: hosted |
| 666 | - version: "1.12.0" | 666 | + version: "1.10.5" |
| 667 | flutter_draggable_gridview: | 667 | flutter_draggable_gridview: |
| 668 | dependency: "direct main" | 668 | dependency: "direct main" |
| 669 | description: | 669 | description: |
| @@ -213,7 +213,7 @@ dependencies: | @@ -213,7 +213,7 @@ dependencies: | ||
| 213 | flutter_inappwebview: ^6.2.0-beta.2 | 213 | flutter_inappwebview: ^6.2.0-beta.2 |
| 214 | 214 | ||
| 215 | # flutter_inappwebview: ^6.0.0 | 215 | # flutter_inappwebview: ^6.0.0 |
| 216 | - flutter_downloader: ^1.12.0 | 216 | + flutter_downloader: 1.10.5 |
| 217 | # android_path_provider: 0.3.0 | 217 | # android_path_provider: 0.3.0 |
| 218 | # open_file: ^3.2.1 | 218 | # open_file: ^3.2.1 |
| 219 | # open_file: ^3.3.2 | 219 | # open_file: ^3.3.2 |
-
Please register or login to post a comment