Commit d4d895cbde0313f38d82bbdad147e0e8b973440f
1 parent
cc48c5d6
导出文件存储权限获取:访问所有文件&&客户详情按钮显示颜色&&用餐类型默认普通用餐(下单时候传入)
Showing
10 changed files
with
142 additions
and
106 deletions
| @@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
| 18 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | 18 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> |
| 19 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | 19 | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> |
| 20 | <uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/> | 20 | <uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/> |
| 21 | - | 21 | +<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> |
| 22 | <uses-permission android:name="android.permission.READ_CALL_LOG" /> | 22 | <uses-permission android:name="android.permission.READ_CALL_LOG" /> |
| 23 | 23 | ||
| 24 | <application | 24 | <application |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | archiveVersion = 1; | 3 | archiveVersion = 1; |
| 4 | classes = { | 4 | classes = { |
| 5 | }; | 5 | }; |
| 6 | - objectVersion = 46; | 6 | + objectVersion = 50; |
| 7 | objects = { | 7 | objects = { |
| 8 | 8 | ||
| 9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
| @@ -51,6 +51,8 @@ | @@ -51,6 +51,8 @@ | ||
| 51 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | 51 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; |
| 52 | 720060DA25B9912C0014BE3B /* tts_all.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_all.caf; sourceTree = "<group>"; }; | 52 | 720060DA25B9912C0014BE3B /* tts_all.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_all.caf; sourceTree = "<group>"; }; |
| 53 | 7206E2DB26200F770055D76E /* 一键订Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "一键订Debug.entitlements"; sourceTree = "<group>"; }; | 53 | 7206E2DB26200F770055D76E /* 一键订Debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "一键订Debug.entitlements"; sourceTree = "<group>"; }; |
| 54 | + 72544E7E2B592D7D00A1A4EF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; }; | ||
| 55 | + 72544E7F2B592D7E00A1A4EF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; }; | ||
| 54 | 728D93632B1DBD6C00EFD19A /* tts_voice.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_voice.caf; sourceTree = "<group>"; }; | 56 | 728D93632B1DBD6C00EFD19A /* tts_voice.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_voice.caf; sourceTree = "<group>"; }; |
| 55 | 728D93642B1DBD6C00EFD19A /* tts_deposit.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_deposit.caf; sourceTree = "<group>"; }; | 57 | 728D93642B1DBD6C00EFD19A /* tts_deposit.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_deposit.caf; sourceTree = "<group>"; }; |
| 56 | 728D93652B1DBD6C00EFD19A /* tts_wine_remind.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_wine_remind.caf; sourceTree = "<group>"; }; | 58 | 728D93652B1DBD6C00EFD19A /* tts_wine_remind.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_wine_remind.caf; sourceTree = "<group>"; }; |
| @@ -231,6 +233,7 @@ | @@ -231,6 +233,7 @@ | ||
| 231 | knownRegions = ( | 233 | knownRegions = ( |
| 232 | en, | 234 | en, |
| 233 | Base, | 235 | Base, |
| 236 | + "zh-Hans", | ||
| 234 | ); | 237 | ); |
| 235 | mainGroup = 97C146E51CF9000F007C117D; | 238 | mainGroup = 97C146E51CF9000F007C117D; |
| 236 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; | 239 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; |
| @@ -464,6 +467,7 @@ | @@ -464,6 +467,7 @@ | ||
| 464 | isa = PBXVariantGroup; | 467 | isa = PBXVariantGroup; |
| 465 | children = ( | 468 | children = ( |
| 466 | 97C146FB1CF9000F007C117D /* Base */, | 469 | 97C146FB1CF9000F007C117D /* Base */, |
| 470 | + 72544E7E2B592D7D00A1A4EF /* zh-Hans */, | ||
| 467 | ); | 471 | ); |
| 468 | name = Main.storyboard; | 472 | name = Main.storyboard; |
| 469 | sourceTree = "<group>"; | 473 | sourceTree = "<group>"; |
| @@ -472,6 +476,7 @@ | @@ -472,6 +476,7 @@ | ||
| 472 | isa = PBXVariantGroup; | 476 | isa = PBXVariantGroup; |
| 473 | children = ( | 477 | children = ( |
| 474 | 97C147001CF9000F007C117D /* Base */, | 478 | 97C147001CF9000F007C117D /* Base */, |
| 479 | + 72544E7F2B592D7E00A1A4EF /* zh-Hans */, | ||
| 475 | ); | 480 | ); |
| 476 | name = LaunchScreen.storyboard; | 481 | name = LaunchScreen.storyboard; |
| 477 | sourceTree = "<group>"; | 482 | sourceTree = "<group>"; |
| @@ -483,6 +488,7 @@ | @@ -483,6 +488,7 @@ | ||
| 483 | isa = XCBuildConfiguration; | 488 | isa = XCBuildConfiguration; |
| 484 | buildSettings = { | 489 | buildSettings = { |
| 485 | ALWAYS_SEARCH_USER_PATHS = NO; | 490 | ALWAYS_SEARCH_USER_PATHS = NO; |
| 491 | + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | ||
| 486 | CLANG_ANALYZER_NONNULL = YES; | 492 | CLANG_ANALYZER_NONNULL = YES; |
| 487 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | 493 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; |
| 488 | CLANG_CXX_LIBRARY = "libc++"; | 494 | CLANG_CXX_LIBRARY = "libc++"; |
| @@ -570,6 +576,7 @@ | @@ -570,6 +576,7 @@ | ||
| 570 | isa = XCBuildConfiguration; | 576 | isa = XCBuildConfiguration; |
| 571 | buildSettings = { | 577 | buildSettings = { |
| 572 | ALWAYS_SEARCH_USER_PATHS = NO; | 578 | ALWAYS_SEARCH_USER_PATHS = NO; |
| 579 | + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | ||
| 573 | CLANG_ANALYZER_NONNULL = YES; | 580 | CLANG_ANALYZER_NONNULL = YES; |
| 574 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | 581 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; |
| 575 | CLANG_CXX_LIBRARY = "libc++"; | 582 | CLANG_CXX_LIBRARY = "libc++"; |
| @@ -627,6 +634,7 @@ | @@ -627,6 +634,7 @@ | ||
| 627 | isa = XCBuildConfiguration; | 634 | isa = XCBuildConfiguration; |
| 628 | buildSettings = { | 635 | buildSettings = { |
| 629 | ALWAYS_SEARCH_USER_PATHS = NO; | 636 | ALWAYS_SEARCH_USER_PATHS = NO; |
| 637 | + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | ||
| 630 | CLANG_ANALYZER_NONNULL = YES; | 638 | CLANG_ANALYZER_NONNULL = YES; |
| 631 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | 639 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; |
| 632 | CLANG_CXX_LIBRARY = "libc++"; | 640 | CLANG_CXX_LIBRARY = "libc++"; |
| @@ -689,7 +697,7 @@ | @@ -689,7 +697,7 @@ | ||
| 689 | CURRENT_PROJECT_VERSION = 519; | 697 | CURRENT_PROJECT_VERSION = 519; |
| 690 | DEVELOPMENT_TEAM = 8J59HM8B82; | 698 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 691 | ENABLE_BITCODE = NO; | 699 | ENABLE_BITCODE = NO; |
| 692 | - FLUTTER_BUILD_MODE = release; | 700 | + FLUTTER_BUILD_MODE = debug; |
| 693 | FRAMEWORK_SEARCH_PATHS = ( | 701 | FRAMEWORK_SEARCH_PATHS = ( |
| 694 | "$(inherited)", | 702 | "$(inherited)", |
| 695 | "$(PROJECT_DIR)/Flutter", | 703 | "$(PROJECT_DIR)/Flutter", |
| 1 | + |
ios/Runner/zh-Hans.lproj/Main.strings
0 → 100644
| 1 | + |
| @@ -118,7 +118,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -118,7 +118,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 118 | 118 | ||
| 119 | CollectStoreProvider collectStoreProvider; | 119 | CollectStoreProvider collectStoreProvider; |
| 120 | ScrollController controller = ScrollController(); | 120 | ScrollController controller = ScrollController(); |
| 121 | - String reserveType = '请选择'; | 121 | + String reserveType = '普通用餐'; |
| 122 | 122 | ||
| 123 | @override | 123 | @override |
| 124 | void initState() { | 124 | void initState() { |
| @@ -441,7 +441,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -441,7 +441,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 441 | 441 | ||
| 442 | reserveType = | 442 | reserveType = |
| 443 | detailEntity.reserve_type == null || detailEntity.reserve_type == '' | 443 | detailEntity.reserve_type == null || detailEntity.reserve_type == '' |
| 444 | - ? '请选择' | 444 | + ? '普通用餐' |
| 445 | : detailEntity.reserve_type; | 445 | : detailEntity.reserve_type; |
| 446 | _initTime(int.parse(detailEntity.ddate_solt)); | 446 | _initTime(int.parse(detailEntity.ddate_solt)); |
| 447 | setState(() { | 447 | setState(() { |
| @@ -1758,11 +1758,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1758,11 +1758,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1758 | showMsg: "加载中,请稍后...", | 1758 | showMsg: "加载中,请稍后...", |
| 1759 | ); | 1759 | ); |
| 1760 | } else { | 1760 | } else { |
| 1761 | + UserModel userModel = | ||
| 1762 | + Provider.of<UserModel>(context, listen: false); | ||
| 1761 | bool customerBtnHigh = | 1763 | bool customerBtnHigh = |
| 1762 | Provider.of<UserModel>(context, listen: false) | 1764 | Provider.of<UserModel>(context, listen: false) |
| 1763 | - .user | ||
| 1764 | - .openid == | ||
| 1765 | - detailEntity.guest_uid; | 1765 | + .user |
| 1766 | + .openid == | ||
| 1767 | + detailEntity.guest_uid || | ||
| 1768 | + userModel.user.role_name == '管理员' || | ||
| 1769 | + userModel.user.role_name == '店长'; | ||
| 1766 | return Column( | 1770 | return Column( |
| 1767 | children: [ | 1771 | children: [ |
| 1768 | Expanded( | 1772 | Expanded( |
| @@ -168,7 +168,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -168,7 +168,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 168 | List<String> styleList = []; //餐单类型 | 168 | List<String> styleList = []; //餐单类型 |
| 169 | String styleShow = ''; | 169 | String styleShow = ''; |
| 170 | int styleIndex; | 170 | int styleIndex; |
| 171 | - String reserveType = '请选择'; | 171 | + String reserveType = '普通用餐'; |
| 172 | 172 | ||
| 173 | MyTextSelectionControls _myExtendedMaterialTextSelectionControls = | 173 | MyTextSelectionControls _myExtendedMaterialTextSelectionControls = |
| 174 | MyTextSelectionControls(); | 174 | MyTextSelectionControls(); |
| @@ -1154,7 +1154,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -1154,7 +1154,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 1154 | 1154 | ||
| 1155 | reserveType = | 1155 | reserveType = |
| 1156 | detailEntity.reserve_type == null || detailEntity.reserve_type == '' | 1156 | detailEntity.reserve_type == null || detailEntity.reserve_type == '' |
| 1157 | - ? '请选择' | 1157 | + ? '普通用餐' |
| 1158 | : detailEntity.reserve_type; | 1158 | : detailEntity.reserve_type; |
| 1159 | 1159 | ||
| 1160 | _initTime(int.parse(detailEntity.ddate_solt)); | 1160 | _initTime(int.parse(detailEntity.ddate_solt)); |
| @@ -100,13 +100,17 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | @@ -100,13 +100,17 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | ||
| 100 | 100 | ||
| 101 | // if()/ | 101 | // if()/ |
| 102 | 102 | ||
| 103 | - final directory = await getExternalStorageDirectory(); | ||
| 104 | - externalStorageDirPath = directory?.path; | 103 | + // final directory = await getExternalStorageDirectory(); |
| 104 | + // externalStorageDirPath = directory?.path; | ||
| 105 | + | ||
| 106 | + externalStorageDirPath = '/storage/emulated/0/Download'; | ||
| 105 | } else if (Platform.isIOS) { | 107 | } else if (Platform.isIOS) { |
| 106 | // externalStorageDirPath = | 108 | // externalStorageDirPath = |
| 107 | // (await getApplicationDocumentsDirectory()).absolute.path; | 109 | // (await getApplicationDocumentsDirectory()).absolute.path; |
| 108 | 110 | ||
| 109 | - externalStorageDirPath = (await getTemporaryDirectory()).path; | 111 | + // externalStorageDirPath = (await getTemporaryDirectory()).path; |
| 112 | + | ||
| 113 | + externalStorageDirPath = (await getApplicationSupportDirectory()).path; | ||
| 110 | 114 | ||
| 111 | externalStorageDirPath = | 115 | externalStorageDirPath = |
| 112 | externalStorageDirPath.replaceFirst("Library/Caches", "Documents"); | 116 | externalStorageDirPath.replaceFirst("Library/Caches", "Documents"); |
| @@ -125,7 +129,7 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | @@ -125,7 +129,7 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | ||
| 125 | // return true; | 129 | // return true; |
| 126 | // } | 130 | // } |
| 127 | 131 | ||
| 128 | - final status = await Permission.storage.status; | 132 | + final status = await Permission.manageExternalStorage.status; |
| 129 | if (status == PermissionStatus.granted) { | 133 | if (status == PermissionStatus.granted) { |
| 130 | return true; | 134 | return true; |
| 131 | } | 135 | } |
| @@ -137,17 +141,18 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | @@ -137,17 +141,18 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | ||
| 137 | // print('failed to get downloads path: $err, $st'); | 141 | // print('failed to get downloads path: $err, $st'); |
| 138 | 142 | ||
| 139 | // if()/ | 143 | // if()/ |
| 140 | - PermissionStatus permissionStatus = await Permission.storage.status; | 144 | + PermissionStatus permissionStatus = |
| 145 | + await Permission.manageExternalStorage.status; | ||
| 141 | 146 | ||
| 142 | if (permissionStatus != PermissionStatus.permanentlyDenied) { | 147 | if (permissionStatus != PermissionStatus.permanentlyDenied) { |
| 143 | //全局提示权限使用目的 | 148 | //全局提示权限使用目的 |
| 144 | BuildContext context = App.navigatorKey.currentState.overlay.context; | 149 | BuildContext context = App.navigatorKey.currentState.overlay.context; |
| 145 | DialogUtil.showAuthorityDestination( | 150 | DialogUtil.showAuthorityDestination( |
| 146 | - context, 'h_storage', '存储权限使用说明', '用于存储下载的预订表。'); | 151 | + context, 'h_storage', '访问所有文件权限', '用于存储下载的预订表。'); |
| 147 | } | 152 | } |
| 148 | } | 153 | } |
| 149 | 154 | ||
| 150 | - final result = await Permission.storage.request(); | 155 | + final result = await Permission.manageExternalStorage.request(); |
| 151 | return result == PermissionStatus.granted; | 156 | return result == PermissionStatus.granted; |
| 152 | } | 157 | } |
| 153 | 158 | ||
| @@ -334,16 +339,31 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | @@ -334,16 +339,31 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | ||
| 334 | String starttime = fromDate.replaceAll('-', ''); | 339 | String starttime = fromDate.replaceAll('-', ''); |
| 335 | String endtime = endDate.replaceAll('-', ''); | 340 | String endtime = endDate.replaceAll('-', ''); |
| 336 | String fileName = "/${sellername}${starttime}至${endtime}.xlsx"; | 341 | String fileName = "/${sellername}${starttime}至${endtime}.xlsx"; |
| 337 | - String filePath = _localPath + fileName; | 342 | + String filePath = _localPath + '${fileName}'; |
| 343 | + // Utils.showToast('文件已保存到${filePath}'); | ||
| 338 | if (fileBytes != null) { | 344 | if (fileBytes != null) { |
| 339 | - File file = File(filePath) | 345 | + // File file = |
| 346 | + File(filePath) | ||
| 340 | ..createSync(recursive: true) | 347 | ..createSync(recursive: true) |
| 341 | ..writeAsBytesSync(fileBytes); | 348 | ..writeAsBytesSync(fileBytes); |
| 342 | - file.copy('/storage/emulated/0/Download${fileName}'); | 349 | + // try { |
| 350 | + // // File file1 = File('/storage/emulated/0/Download${fileName}') | ||
| 351 | + // // ..createSync(recursive: true) | ||
| 352 | + // // ..writeAsBytesSync(fileBytes); | ||
| 353 | + // // File file2 = | ||
| 354 | + // // await file.copy('/storage/emulated/0/Documents${fileName}'); | ||
| 355 | + // File file1 = await file.copy('/storage/emulated/0/Download${fileName}'); | ||
| 356 | + // Utils.showToast('文件已保存到${file1.path}'); | ||
| 357 | + // } catch (e) { | ||
| 358 | + // Utils.showToast('保存失败:${e}'); | ||
| 359 | + // } | ||
| 360 | + | ||
| 343 | Loading.hideLoading(context); | 361 | Loading.hideLoading(context); |
| 344 | DialogUtil.cupertinoAlertDialog(context, | 362 | DialogUtil.cupertinoAlertDialog(context, |
| 345 | title: '提示', | 363 | title: '提示', |
| 346 | - content: '文件下载完成,是否打开?', | 364 | + content: Platform.isAndroid |
| 365 | + ? '文件已保存到 /sdcard/Download${fileName}' | ||
| 366 | + : '文件下载完成,是否打开?', | ||
| 347 | lTitle: '取消', | 367 | lTitle: '取消', |
| 348 | rTitle: '打开', lCallback: () { | 368 | rTitle: '打开', lCallback: () { |
| 349 | progress = null; | 369 | progress = null; |
| @@ -522,82 +542,81 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | @@ -522,82 +542,81 @@ class _ExportBookDataPageState extends State<ExportBookDataPage> { | ||
| 522 | // return; | 542 | // return; |
| 523 | // } | 543 | // } |
| 524 | 544 | ||
| 525 | - if (timeType == '点击选择') { | ||
| 526 | - Utils.showToast('请选择时间类型'); | ||
| 527 | - return; | ||
| 528 | - } | ||
| 529 | - if (fromDate == '点击选择') { | ||
| 530 | - Utils.showToast('请选择开始日期'); | ||
| 531 | - return; | ||
| 532 | - } | ||
| 533 | - if (endDate == '点击选择') { | ||
| 534 | - Utils.showToast('请选择结束日期'); | ||
| 535 | - return; | ||
| 536 | - } | ||
| 537 | - if (DateUtil.getDateTime(endDate) | ||
| 538 | - .compareTo(DateUtil.getDateTime(fromDate)) < | ||
| 539 | - 0) { | ||
| 540 | - Utils.showToast('结束日期不能早于开始日期!'); | ||
| 541 | - return; | ||
| 542 | - } | ||
| 543 | - // } | 545 | + bool _permissionReady = await _checkPermission(); |
| 546 | + if (_permissionReady) { | ||
| 547 | + await _prepareSaveDir(); | ||
| 548 | + if (timeType == '点击选择') { | ||
| 549 | + Utils.showToast('请选择时间类型'); | ||
| 550 | + return; | ||
| 551 | + } | ||
| 552 | + if (fromDate == '点击选择') { | ||
| 553 | + Utils.showToast('请选择开始日期'); | ||
| 554 | + return; | ||
| 555 | + } | ||
| 556 | + if (endDate == '点击选择') { | ||
| 557 | + Utils.showToast('请选择结束日期'); | ||
| 558 | + return; | ||
| 559 | + } | ||
| 560 | + if (DateUtil.getDateTime(endDate) | ||
| 561 | + .compareTo(DateUtil.getDateTime(fromDate)) < | ||
| 562 | + 0) { | ||
| 563 | + Utils.showToast('结束日期不能早于开始日期!'); | ||
| 564 | + return; | ||
| 565 | + } | ||
| 566 | + // } | ||
| 544 | 567 | ||
| 545 | - bool temp = customerProvider.reportFieldModelData | ||
| 546 | - .any((element) => element.select); | ||
| 547 | - if (!temp) { | ||
| 548 | - Utils.showToast('请选择导出字段'); | ||
| 549 | - return; | ||
| 550 | - } | 568 | + bool temp = customerProvider.reportFieldModelData |
| 569 | + .any((element) => element.select); | ||
| 570 | + if (!temp) { | ||
| 571 | + Utils.showToast('请选择导出字段'); | ||
| 572 | + return; | ||
| 573 | + } | ||
| 551 | 574 | ||
| 552 | - String from = fromDate + ' 00:00:00'; | ||
| 553 | - String end = endDate + ' 23:59:59'; | ||
| 554 | - String stime = fromDate == '点击设置开始日期' | ||
| 555 | - ? "" | ||
| 556 | - : '${(DateUtil.getDateMsByTimeStr(from) / 1000).floor()}'; | ||
| 557 | - String etime = endDate == '点击设置结束日期' | ||
| 558 | - ? '' | ||
| 559 | - : '${(DateUtil.getDateMsByTimeStr(end) / 1000).floor()}'; | ||
| 560 | - | ||
| 561 | - String fields = ''; | ||
| 562 | - customerProvider.reportFieldModelData.forEach((element) { | ||
| 563 | - if (element.select) { | ||
| 564 | - fields += element.code + ','; | 575 | + String from = fromDate + ' 00:00:00'; |
| 576 | + String end = endDate + ' 23:59:59'; | ||
| 577 | + String stime = fromDate == '点击设置开始日期' | ||
| 578 | + ? "" | ||
| 579 | + : '${(DateUtil.getDateMsByTimeStr(from) / 1000).floor()}'; | ||
| 580 | + String etime = endDate == '点击设置结束日期' | ||
| 581 | + ? '' | ||
| 582 | + : '${(DateUtil.getDateMsByTimeStr(end) / 1000).floor()}'; | ||
| 583 | + | ||
| 584 | + String fields = ''; | ||
| 585 | + customerProvider.reportFieldModelData.forEach((element) { | ||
| 586 | + if (element.select) { | ||
| 587 | + fields += element.code + ','; | ||
| 588 | + } | ||
| 589 | + }); | ||
| 590 | + if (fields.endsWith(',')) { | ||
| 591 | + fields = fields.substring(0, fields.length - 1); | ||
| 565 | } | 592 | } |
| 566 | - }); | ||
| 567 | - if (fields.endsWith(',')) { | ||
| 568 | - fields = fields.substring(0, fields.length - 1); | ||
| 569 | - } | ||
| 570 | 593 | ||
| 571 | - Map<String, String> pramas = { | ||
| 572 | - 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 573 | - .user | ||
| 574 | - .sellerid, | ||
| 575 | - 'time': timeType == '到店时间' ? 'ddate' : 'cdate', | ||
| 576 | - 'rdate': stime, | ||
| 577 | - 'edate': etime, | ||
| 578 | - 'fields': fields | ||
| 579 | - }; | ||
| 580 | - bool success = | ||
| 581 | - await customerProvider.getExportInfo(context, pramas); | ||
| 582 | - if (success) { | ||
| 583 | - //成功 | ||
| 584 | - | ||
| 585 | - bool _permissionReady = await _checkPermission(); | ||
| 586 | - if (_permissionReady) { | ||
| 587 | - await _prepareSaveDir(); | 594 | + Map<String, String> pramas = { |
| 595 | + 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 596 | + .user | ||
| 597 | + .sellerid, | ||
| 598 | + 'time': timeType == '到店时间' ? 'ddate' : 'cdate', | ||
| 599 | + 'rdate': stime, | ||
| 600 | + 'edate': etime, | ||
| 601 | + 'fields': fields | ||
| 602 | + }; | ||
| 603 | + bool success = | ||
| 604 | + await customerProvider.getExportInfo(context, pramas); | ||
| 605 | + if (success) { | ||
| 606 | + //成功 | ||
| 588 | _download(); | 607 | _download(); |
| 589 | - } else { | ||
| 590 | - String title = Platform.isAndroid ? '存储' : '相册'; | ||
| 591 | - | ||
| 592 | - //用户选择不在弹出权限提示框 | ||
| 593 | - print('never'); | ||
| 594 | - // Navigator.pop(context); | ||
| 595 | - DialogUtil.openAlertDialog(context, '未获得${title}权限', | ||
| 596 | - "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () { | ||
| 597 | - openSetting(); | ||
| 598 | - Navigator.pop(context, ''); | ||
| 599 | - }); | ||
| 600 | } | 608 | } |
| 609 | + } else { | ||
| 610 | + // String title = Platform.isAndroid ? '存储' : '相册'; | ||
| 611 | + | ||
| 612 | + // //用户选择不在弹出权限提示框 | ||
| 613 | + // print('never'); | ||
| 614 | + // // Navigator.pop(context); | ||
| 615 | + // DialogUtil.openAlertDialog(context, '未获得${title}权限', | ||
| 616 | + // "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, onTap: () { | ||
| 617 | + // openSetting(); | ||
| 618 | + // Navigator.pop(context, ''); | ||
| 619 | + // }); | ||
| 601 | } | 620 | } |
| 602 | }, | 621 | }, |
| 603 | ) | 622 | ) |
| @@ -417,14 +417,13 @@ class TableManagerModel with ChangeNotifier { | @@ -417,14 +417,13 @@ class TableManagerModel with ChangeNotifier { | ||
| 417 | 417 | ||
| 418 | ///录入更改内部预订 | 418 | ///录入更改内部预订 |
| 419 | Future<SunReserveInfoModel> setReserveInfo( | 419 | Future<SunReserveInfoModel> setReserveInfo( |
| 420 | - BuildContext context, | ||
| 421 | - CustomCallBack callback, { | ||
| 422 | - needKeep = false, | ||
| 423 | - Guest guest, | ||
| 424 | - String pnum, | ||
| 425 | - String tempTime, | ||
| 426 | - String cusdem, | ||
| 427 | - }) async { | 420 | + BuildContext context, CustomCallBack callback, |
| 421 | + {needKeep = false, | ||
| 422 | + Guest guest, | ||
| 423 | + String pnum, | ||
| 424 | + String tempTime, | ||
| 425 | + String cusdem, | ||
| 426 | + String reserveType = '普通用餐'}) async { | ||
| 428 | if (selectTables.length == 0) { | 427 | if (selectTables.length == 0) { |
| 429 | Utils.showToast('请选择桌位'); | 428 | Utils.showToast('请选择桌位'); |
| 430 | return null; | 429 | return null; |
| @@ -570,6 +569,8 @@ class TableManagerModel with ChangeNotifier { | @@ -570,6 +569,8 @@ class TableManagerModel with ChangeNotifier { | ||
| 570 | } | 569 | } |
| 571 | } | 570 | } |
| 572 | 571 | ||
| 572 | + params['reserve_type'] = reserveType; | ||
| 573 | + | ||
| 573 | print(params); | 574 | print(params); |
| 574 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | 575 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() |
| 575 | .request<Map<String, dynamic>>( | 576 | .request<Map<String, dynamic>>( |
| @@ -965,42 +965,42 @@ packages: | @@ -965,42 +965,42 @@ packages: | ||
| 965 | name: path_provider | 965 | name: path_provider |
| 966 | url: "https://pub.flutter-io.cn" | 966 | url: "https://pub.flutter-io.cn" |
| 967 | source: hosted | 967 | source: hosted |
| 968 | - version: "2.0.15" | 968 | + version: "2.1.0" |
| 969 | path_provider_android: | 969 | path_provider_android: |
| 970 | dependency: transitive | 970 | dependency: transitive |
| 971 | description: | 971 | description: |
| 972 | name: path_provider_android | 972 | name: path_provider_android |
| 973 | url: "https://pub.flutter-io.cn" | 973 | url: "https://pub.flutter-io.cn" |
| 974 | source: hosted | 974 | source: hosted |
| 975 | - version: "2.0.14" | 975 | + version: "2.1.0" |
| 976 | path_provider_foundation: | 976 | path_provider_foundation: |
| 977 | dependency: transitive | 977 | dependency: transitive |
| 978 | description: | 978 | description: |
| 979 | name: path_provider_foundation | 979 | name: path_provider_foundation |
| 980 | url: "https://pub.flutter-io.cn" | 980 | url: "https://pub.flutter-io.cn" |
| 981 | source: hosted | 981 | source: hosted |
| 982 | - version: "2.2.4" | 982 | + version: "2.3.0" |
| 983 | path_provider_linux: | 983 | path_provider_linux: |
| 984 | dependency: transitive | 984 | dependency: transitive |
| 985 | description: | 985 | description: |
| 986 | name: path_provider_linux | 986 | name: path_provider_linux |
| 987 | url: "https://pub.flutter-io.cn" | 987 | url: "https://pub.flutter-io.cn" |
| 988 | source: hosted | 988 | source: hosted |
| 989 | - version: "2.1.7" | 989 | + version: "2.2.0" |
| 990 | path_provider_platform_interface: | 990 | path_provider_platform_interface: |
| 991 | dependency: transitive | 991 | dependency: transitive |
| 992 | description: | 992 | description: |
| 993 | name: path_provider_platform_interface | 993 | name: path_provider_platform_interface |
| 994 | url: "https://pub.flutter-io.cn" | 994 | url: "https://pub.flutter-io.cn" |
| 995 | source: hosted | 995 | source: hosted |
| 996 | - version: "2.0.4" | 996 | + version: "2.1.0" |
| 997 | path_provider_windows: | 997 | path_provider_windows: |
| 998 | dependency: transitive | 998 | dependency: transitive |
| 999 | description: | 999 | description: |
| 1000 | name: path_provider_windows | 1000 | name: path_provider_windows |
| 1001 | url: "https://pub.flutter-io.cn" | 1001 | url: "https://pub.flutter-io.cn" |
| 1002 | source: hosted | 1002 | source: hosted |
| 1003 | - version: "2.1.7" | 1003 | + version: "2.2.0" |
| 1004 | pedantic: | 1004 | pedantic: |
| 1005 | dependency: transitive | 1005 | dependency: transitive |
| 1006 | description: | 1006 | description: |
| @@ -53,11 +53,13 @@ dependencies: | @@ -53,11 +53,13 @@ dependencies: | ||
| 53 | # 权限管理 | 53 | # 权限管理 |
| 54 | # permission_handler: ^10.0.0 | 54 | # permission_handler: ^10.0.0 |
| 55 | permission_handler: ^11.0.1 | 55 | permission_handler: ^11.0.1 |
| 56 | + # permission_handler: ^11.2.0 | ||
| 56 | # permission_handler: ^5.0.1 | 57 | # permission_handler: ^5.0.1 |
| 57 | # permission_handler: ^5.0.1+1 ^6.1.1 4.4.0 | 58 | # permission_handler: ^5.0.1+1 ^6.1.1 4.4.0 |
| 58 | # 文件系统访问 | 59 | # 文件系统访问 |
| 59 | # path_provider: ^1.6.5 | 60 | # path_provider: ^1.6.5 |
| 60 | - path_provider: ^2.0.10 | 61 | + # path_provider: ^2.0.10 |
| 62 | + path_provider: ^2.1.0 | ||
| 61 | ## 官方image组件扩展,支持多种图片效果展示 | 63 | ## 官方image组件扩展,支持多种图片效果展示 |
| 62 | # extended_image: ^1.1.1 | 64 | # extended_image: ^1.1.1 |
| 63 | # 任意位置访问navigator | 65 | # 任意位置访问navigator |
-
Please register or login to post a comment