Showing
56 changed files
with
1118 additions
and
596 deletions
| @@ -11,14 +11,14 @@ if (flutterRoot == null) { | @@ -11,14 +11,14 @@ if (flutterRoot == null) { | ||
| 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | -def flutterVersionCode = "180" | 14 | +def flutterVersionCode = "181" |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '180' | 16 | + flutterVersionCode = '181' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | -def flutterVersionName = "1.8.0" | 19 | +def flutterVersionName = "1.8.1" |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '1.8.0' | 21 | + flutterVersionName = '1.8.1' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
assets/tts_all.mp3
100644 → 100755
No preview for this file type
assets/tts_cancel.mp3
100644 → 100755
No preview for this file type
assets/tts_invoice.mp3
0 → 100755
No preview for this file type
assets/tts_new.mp3
0 → 100755
No preview for this file type
assets/tts_online.mp3
100644 → 100755
No preview for this file type
assets/tts_pay.mp3
0 → 100755
No preview for this file type
assets/tts_pre_pay.mp3
0 → 100755
No preview for this file type
| @@ -9,7 +9,14 @@ | @@ -9,7 +9,14 @@ | ||
| 9 | /* Begin PBXBuildFile section */ | 9 | /* Begin PBXBuildFile section */ |
| 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; | 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; |
| 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; | 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; |
| 12 | - 72CAA69425B7E2CA00753A2F /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 72CAA69325B7E2CA00753A2F /* Settings.bundle */; }; | 12 | + 72DFBB9425BA6CD700EE1E5D /* tts_all.caf in Resources */ = {isa = PBXBuildFile; fileRef = 720060DA25B9912C0014BE3B /* tts_all.caf */; }; |
| 13 | + 72DFBB9525BA6CD700EE1E5D /* tts_cancel.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB8C25BA6CBF00EE1E5D /* tts_cancel.caf */; }; | ||
| 14 | + 72DFBB9625BA6CD700EE1E5D /* tts_invoice.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB9325BA6CBF00EE1E5D /* tts_invoice.caf */; }; | ||
| 15 | + 72DFBB9725BA6CD700EE1E5D /* tts_new.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB8E25BA6CBF00EE1E5D /* tts_new.caf */; }; | ||
| 16 | + 72DFBB9825BA6CD700EE1E5D /* tts_online.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB8F25BA6CBF00EE1E5D /* tts_online.caf */; }; | ||
| 17 | + 72DFBB9925BA6CD700EE1E5D /* tts_order.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB9225BA6CBF00EE1E5D /* tts_order.caf */; }; | ||
| 18 | + 72DFBB9A25BA6CD700EE1E5D /* tts_pay.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB8D25BA6CBF00EE1E5D /* tts_pay.caf */; }; | ||
| 19 | + 72DFBB9B25BA6CD700EE1E5D /* tts_pre_pay.caf in Resources */ = {isa = PBXBuildFile; fileRef = 72DFBB9125BA6CBF00EE1E5D /* tts_pre_pay.caf */; }; | ||
| 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; | 20 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; |
| 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; | 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; |
| 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; | 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; |
| @@ -36,7 +43,14 @@ | @@ -36,7 +43,14 @@ | ||
| 36 | 22513BD076488FBD50F0303F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; | 43 | 22513BD076488FBD50F0303F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; |
| 37 | 2DCAB49DF131E02F3BAF38E1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; | 44 | 2DCAB49DF131E02F3BAF38E1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; |
| 38 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; |
| 39 | - 72CAA69325B7E2CA00753A2F /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; }; | 46 | + 720060DA25B9912C0014BE3B /* tts_all.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_all.caf; sourceTree = "<group>"; }; |
| 47 | + 72DFBB8C25BA6CBF00EE1E5D /* tts_cancel.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_cancel.caf; sourceTree = "<group>"; }; | ||
| 48 | + 72DFBB8D25BA6CBF00EE1E5D /* tts_pay.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_pay.caf; sourceTree = "<group>"; }; | ||
| 49 | + 72DFBB8E25BA6CBF00EE1E5D /* tts_new.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_new.caf; sourceTree = "<group>"; }; | ||
| 50 | + 72DFBB8F25BA6CBF00EE1E5D /* tts_online.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_online.caf; sourceTree = "<group>"; }; | ||
| 51 | + 72DFBB9125BA6CBF00EE1E5D /* tts_pre_pay.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_pre_pay.caf; sourceTree = "<group>"; }; | ||
| 52 | + 72DFBB9225BA6CBF00EE1E5D /* tts_order.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_order.caf; sourceTree = "<group>"; }; | ||
| 53 | + 72DFBB9325BA6CBF00EE1E5D /* tts_invoice.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = tts_invoice.caf; sourceTree = "<group>"; }; | ||
| 40 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; | 54 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; |
| 41 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; | 55 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; |
| 42 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; | 56 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; |
| @@ -97,6 +111,14 @@ | @@ -97,6 +111,14 @@ | ||
| 97 | 97C146E51CF9000F007C117D = { | 111 | 97C146E51CF9000F007C117D = { |
| 98 | isa = PBXGroup; | 112 | isa = PBXGroup; |
| 99 | children = ( | 113 | children = ( |
| 114 | + 720060DA25B9912C0014BE3B /* tts_all.caf */, | ||
| 115 | + 72DFBB8C25BA6CBF00EE1E5D /* tts_cancel.caf */, | ||
| 116 | + 72DFBB9325BA6CBF00EE1E5D /* tts_invoice.caf */, | ||
| 117 | + 72DFBB8E25BA6CBF00EE1E5D /* tts_new.caf */, | ||
| 118 | + 72DFBB8F25BA6CBF00EE1E5D /* tts_online.caf */, | ||
| 119 | + 72DFBB9225BA6CBF00EE1E5D /* tts_order.caf */, | ||
| 120 | + 72DFBB8D25BA6CBF00EE1E5D /* tts_pay.caf */, | ||
| 121 | + 72DFBB9125BA6CBF00EE1E5D /* tts_pre_pay.caf */, | ||
| 100 | 9740EEB11CF90186004384FC /* Flutter */, | 122 | 9740EEB11CF90186004384FC /* Flutter */, |
| 101 | 97C146F01CF9000F007C117D /* Runner */, | 123 | 97C146F01CF9000F007C117D /* Runner */, |
| 102 | 97C146EF1CF9000F007C117D /* Products */, | 124 | 97C146EF1CF9000F007C117D /* Products */, |
| @@ -120,7 +142,6 @@ | @@ -120,7 +142,6 @@ | ||
| 120 | EE6AF8FF2457DB720005E3B9 /* RunnerProfile.entitlements */, | 142 | EE6AF8FF2457DB720005E3B9 /* RunnerProfile.entitlements */, |
| 121 | 97C146FA1CF9000F007C117D /* Main.storyboard */, | 143 | 97C146FA1CF9000F007C117D /* Main.storyboard */, |
| 122 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, | 144 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, |
| 123 | - 72CAA69325B7E2CA00753A2F /* Settings.bundle */, | ||
| 124 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, | 145 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, |
| 125 | 97C147021CF9000F007C117D /* Info.plist */, | 146 | 97C147021CF9000F007C117D /* Info.plist */, |
| 126 | 97C146F11CF9000F007C117D /* Supporting Files */, | 147 | 97C146F11CF9000F007C117D /* Supporting Files */, |
| @@ -204,9 +225,16 @@ | @@ -204,9 +225,16 @@ | ||
| 204 | isa = PBXResourcesBuildPhase; | 225 | isa = PBXResourcesBuildPhase; |
| 205 | buildActionMask = 2147483647; | 226 | buildActionMask = 2147483647; |
| 206 | files = ( | 227 | files = ( |
| 228 | + 72DFBB9425BA6CD700EE1E5D /* tts_all.caf in Resources */, | ||
| 229 | + 72DFBB9525BA6CD700EE1E5D /* tts_cancel.caf in Resources */, | ||
| 230 | + 72DFBB9625BA6CD700EE1E5D /* tts_invoice.caf in Resources */, | ||
| 231 | + 72DFBB9725BA6CD700EE1E5D /* tts_new.caf in Resources */, | ||
| 232 | + 72DFBB9825BA6CD700EE1E5D /* tts_online.caf in Resources */, | ||
| 233 | + 72DFBB9925BA6CD700EE1E5D /* tts_order.caf in Resources */, | ||
| 234 | + 72DFBB9A25BA6CD700EE1E5D /* tts_pay.caf in Resources */, | ||
| 235 | + 72DFBB9B25BA6CD700EE1E5D /* tts_pre_pay.caf in Resources */, | ||
| 207 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, | 236 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, |
| 208 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, | 237 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, |
| 209 | - 72CAA69425B7E2CA00753A2F /* Settings.bundle in Resources */, | ||
| 210 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, | 238 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, |
| 211 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, | 239 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, |
| 212 | ); | 240 | ); |
| @@ -417,7 +445,7 @@ | @@ -417,7 +445,7 @@ | ||
| 417 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 445 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 418 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
| 419 | CODE_SIGN_STYLE = Automatic; | 447 | CODE_SIGN_STYLE = Automatic; |
| 420 | - CURRENT_PROJECT_VERSION = 165; | 448 | + CURRENT_PROJECT_VERSION = 170; |
| 421 | DEVELOPMENT_TEAM = 8J59HM8B82; | 449 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 422 | ENABLE_BITCODE = NO; | 450 | ENABLE_BITCODE = NO; |
| 423 | FRAMEWORK_SEARCH_PATHS = ( | 451 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -430,7 +458,7 @@ | @@ -430,7 +458,7 @@ | ||
| 430 | "$(inherited)", | 458 | "$(inherited)", |
| 431 | "$(PROJECT_DIR)/Flutter", | 459 | "$(PROJECT_DIR)/Flutter", |
| 432 | ); | 460 | ); |
| 433 | - MARKETING_VERSION = 1.7.0; | 461 | + MARKETING_VERSION = 1.8.0; |
| 434 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 462 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 435 | PRODUCT_NAME = "一键订"; | 463 | PRODUCT_NAME = "一键订"; |
| 436 | PROVISIONING_PROFILE_SPECIFIER = ""; | 464 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -559,7 +587,7 @@ | @@ -559,7 +587,7 @@ | ||
| 559 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 587 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 560 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 588 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 561 | CODE_SIGN_STYLE = Automatic; | 589 | CODE_SIGN_STYLE = Automatic; |
| 562 | - CURRENT_PROJECT_VERSION = 165; | 590 | + CURRENT_PROJECT_VERSION = 170; |
| 563 | DEVELOPMENT_TEAM = 8J59HM8B82; | 591 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 564 | ENABLE_BITCODE = NO; | 592 | ENABLE_BITCODE = NO; |
| 565 | FRAMEWORK_SEARCH_PATHS = ( | 593 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -572,7 +600,7 @@ | @@ -572,7 +600,7 @@ | ||
| 572 | "$(inherited)", | 600 | "$(inherited)", |
| 573 | "$(PROJECT_DIR)/Flutter", | 601 | "$(PROJECT_DIR)/Flutter", |
| 574 | ); | 602 | ); |
| 575 | - MARKETING_VERSION = 1.7.0; | 603 | + MARKETING_VERSION = 1.8.0; |
| 576 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 604 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 577 | PRODUCT_NAME = "一键订"; | 605 | PRODUCT_NAME = "一键订"; |
| 578 | PROVISIONING_PROFILE_SPECIFIER = ""; | 606 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -592,7 +620,7 @@ | @@ -592,7 +620,7 @@ | ||
| 592 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 620 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 593 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 621 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 594 | CODE_SIGN_STYLE = Automatic; | 622 | CODE_SIGN_STYLE = Automatic; |
| 595 | - CURRENT_PROJECT_VERSION = 165; | 623 | + CURRENT_PROJECT_VERSION = 170; |
| 596 | DEVELOPMENT_TEAM = 8J59HM8B82; | 624 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 597 | ENABLE_BITCODE = NO; | 625 | ENABLE_BITCODE = NO; |
| 598 | FRAMEWORK_SEARCH_PATHS = ( | 626 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -605,7 +633,7 @@ | @@ -605,7 +633,7 @@ | ||
| 605 | "$(inherited)", | 633 | "$(inherited)", |
| 606 | "$(PROJECT_DIR)/Flutter", | 634 | "$(PROJECT_DIR)/Flutter", |
| 607 | ); | 635 | ); |
| 608 | - MARKETING_VERSION = 1.7.0; | 636 | + MARKETING_VERSION = 1.8.0; |
| 609 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 637 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 610 | PRODUCT_NAME = "一键订"; | 638 | PRODUCT_NAME = "一键订"; |
| 611 | PROVISIONING_PROFILE_SPECIFIER = ""; | 639 | PROVISIONING_PROFILE_SPECIFIER = ""; |
ios/Runner/Assets.xcassets/Contents.json
0 → 100644
| @@ -2,8 +2,6 @@ | @@ -2,8 +2,6 @@ | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | <plist version="1.0"> | 3 | <plist version="1.0"> |
| 4 | <dict> | 4 | <dict> |
| 5 | - <key>NSCameraUsageDescription</key> | ||
| 6 | - <string>需要您的同意,APP才能访问您的相机来上传消费清单</string> | ||
| 7 | <key>CFBundleDevelopmentRegion</key> | 5 | <key>CFBundleDevelopmentRegion</key> |
| 8 | <string>$(DEVELOPMENT_LANGUAGE)</string> | 6 | <string>$(DEVELOPMENT_LANGUAGE)</string> |
| 9 | <key>CFBundleDisplayName</key> | 7 | <key>CFBundleDisplayName</key> |
| @@ -52,12 +50,12 @@ | @@ -52,12 +50,12 @@ | ||
| 52 | <key>NSAllowsArbitraryLoads</key> | 50 | <key>NSAllowsArbitraryLoads</key> |
| 53 | <true/> | 51 | <true/> |
| 54 | </dict> | 52 | </dict> |
| 55 | - <key>NSPhotoLibraryUsageDescription</key> | ||
| 56 | - <string>需要您的同意,APP才能访问您的相册来上传消费清单</string> | ||
| 57 | <key>NSAppleMusicUsageDescription</key> | 53 | <key>NSAppleMusicUsageDescription</key> |
| 58 | <string>需要您的同意,APP才能访问媒体资料库</string> | 54 | <string>需要您的同意,APP才能访问媒体资料库</string> |
| 59 | <key>NSCalendarsUsageDescription</key> | 55 | <key>NSCalendarsUsageDescription</key> |
| 60 | <string>需要您的同意,APP才能访问日历</string> | 56 | <string>需要您的同意,APP才能访问日历</string> |
| 57 | + <key>NSCameraUsageDescription</key> | ||
| 58 | + <string>需要您的同意,APP才能访问您的相机来上传消费清单</string> | ||
| 61 | <key>NSContactsUsageDescription</key> | 59 | <key>NSContactsUsageDescription</key> |
| 62 | <string>允许访问您的通讯录来一键录入联系人</string> | 60 | <string>允许访问您的通讯录来一键录入联系人</string> |
| 63 | <key>NSLocationAlwaysUsageDescription</key> | 61 | <key>NSLocationAlwaysUsageDescription</key> |
| @@ -66,6 +64,8 @@ | @@ -66,6 +64,8 @@ | ||
| 66 | <string>需要您的同意,APP才能在使用期间访问位置</string> | 64 | <string>需要您的同意,APP才能在使用期间访问位置</string> |
| 67 | <key>NSMotionUsageDescription</key> | 65 | <key>NSMotionUsageDescription</key> |
| 68 | <string>需要您的同意,APP才能访问运动与健身</string> | 66 | <string>需要您的同意,APP才能访问运动与健身</string> |
| 67 | + <key>NSPhotoLibraryUsageDescription</key> | ||
| 68 | + <string>需要您的同意,APP才能访问您的相册来上传消费清单</string> | ||
| 69 | <key>NSSpeechRecognitionUsageDescription</key> | 69 | <key>NSSpeechRecognitionUsageDescription</key> |
| 70 | <string>需要您的同意,APP才能访问语音识别</string> | 70 | <string>需要您的同意,APP才能访问语音识别</string> |
| 71 | <key>UILaunchStoryboardName</key> | 71 | <key>UILaunchStoryboardName</key> |
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | -<plist version="1.0"> | ||
| 4 | -<dict> | ||
| 5 | - <key>StringsTable</key> | ||
| 6 | - <string>Root</string> | ||
| 7 | - <key>PreferenceSpecifiers</key> | ||
| 8 | - <array> | ||
| 9 | - <dict> | ||
| 10 | - <key>Type</key> | ||
| 11 | - <string>PSGroupSpecifier</string> | ||
| 12 | - <key>Title</key> | ||
| 13 | - <string>Group</string> | ||
| 14 | - </dict> | ||
| 15 | - <dict> | ||
| 16 | - <key>Type</key> | ||
| 17 | - <string>PSTextFieldSpecifier</string> | ||
| 18 | - <key>Title</key> | ||
| 19 | - <string>Name</string> | ||
| 20 | - <key>Key</key> | ||
| 21 | - <string>name_preference</string> | ||
| 22 | - <key>DefaultValue</key> | ||
| 23 | - <string></string> | ||
| 24 | - <key>IsSecure</key> | ||
| 25 | - <false/> | ||
| 26 | - <key>KeyboardType</key> | ||
| 27 | - <string>Alphabet</string> | ||
| 28 | - <key>AutocapitalizationType</key> | ||
| 29 | - <string>None</string> | ||
| 30 | - <key>AutocorrectionType</key> | ||
| 31 | - <string>No</string> | ||
| 32 | - </dict> | ||
| 33 | - <dict> | ||
| 34 | - <key>Type</key> | ||
| 35 | - <string>PSToggleSwitchSpecifier</string> | ||
| 36 | - <key>Title</key> | ||
| 37 | - <string>Enabled</string> | ||
| 38 | - <key>Key</key> | ||
| 39 | - <string>enabled_preference</string> | ||
| 40 | - <key>DefaultValue</key> | ||
| 41 | - <true/> | ||
| 42 | - </dict> | ||
| 43 | - <dict> | ||
| 44 | - <key>Type</key> | ||
| 45 | - <string>PSSliderSpecifier</string> | ||
| 46 | - <key>Key</key> | ||
| 47 | - <string>slider_preference</string> | ||
| 48 | - <key>DefaultValue</key> | ||
| 49 | - <real>0.5</real> | ||
| 50 | - <key>MinimumValue</key> | ||
| 51 | - <integer>0</integer> | ||
| 52 | - <key>MaximumValue</key> | ||
| 53 | - <integer>1</integer> | ||
| 54 | - <key>MinimumValueImage</key> | ||
| 55 | - <string></string> | ||
| 56 | - <key>MaximumValueImage</key> | ||
| 57 | - <string></string> | ||
| 58 | - </dict> | ||
| 59 | - </array> | ||
| 60 | -</dict> | ||
| 61 | -</plist> |
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
ios/tts_all.caf
0 → 100644
No preview for this file type
ios/tts_cancel.caf
0 → 100644
No preview for this file type
ios/tts_invoice.caf
0 → 100644
No preview for this file type
ios/tts_new.caf
0 → 100644
No preview for this file type
ios/tts_online.caf
0 → 100644
No preview for this file type
ios/tts_order.caf
0 → 100644
No preview for this file type
ios/tts_pay.caf
0 → 100644
No preview for this file type
ios/tts_pre_pay.caf
0 → 100644
No preview for this file type
| @@ -14,56 +14,65 @@ part 'notebook_detail.g.dart'; | @@ -14,56 +14,65 @@ part 'notebook_detail.g.dart'; | ||
| 14 | class NotebookDetail { | 14 | class NotebookDetail { |
| 15 | NotebookDetail(); | 15 | NotebookDetail(); |
| 16 | 16 | ||
| 17 | - NotebookDetail.def(BuildContext context){ | ||
| 18 | - id="-1"; | ||
| 19 | - pnum="6"; | ||
| 20 | - rname=""; | ||
| 21 | - sex="1"; | ||
| 22 | - phone=""; | ||
| 23 | - cusdem=""; | ||
| 24 | - type="0"; | ||
| 25 | - ddate=(DateTime.now().millisecondsSinceEpoch/1000).floor().toString(); | ||
| 26 | - ddate_solt=defDdateSolt(context); | ||
| 27 | - is_set_ddate="0"; | ||
| 28 | - tables=[]; | 17 | + NotebookDetail.def(BuildContext context) { |
| 18 | + id = "-1"; | ||
| 19 | + pnum = "6"; | ||
| 20 | + rname = ""; | ||
| 21 | + sex = "1"; | ||
| 22 | + phone = ""; | ||
| 23 | + cusdem = ""; | ||
| 24 | + type = "0"; | ||
| 25 | + ddate = (DateTime.now().millisecondsSinceEpoch / 1000).floor().toString(); | ||
| 26 | + ddate_solt = defDdateSolt(context); | ||
| 27 | + is_set_ddate = "0"; | ||
| 28 | + tables = []; | ||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | - NotebookDetail.fromTableManager(String ddateStr,String ddatesolt,t.Table table){ | ||
| 32 | - id="-1"; | ||
| 33 | - pnum="6"; | ||
| 34 | - rname=""; | ||
| 35 | - sex="1"; | ||
| 36 | - phone=""; | ||
| 37 | - cusdem=""; | ||
| 38 | - type="0"; | ||
| 39 | - ddate=ddateStr; | ||
| 40 | - ddate_solt=ddatesolt; | ||
| 41 | - is_set_ddate="1"; | ||
| 42 | - tables=[table]; | 31 | + NotebookDetail.fromTableManager( |
| 32 | + String ddateStr, String ddatesolt, t.Table table) { | ||
| 33 | + id = "-1"; | ||
| 34 | + pnum = "6"; | ||
| 35 | + rname = ""; | ||
| 36 | + sex = "1"; | ||
| 37 | + phone = ""; | ||
| 38 | + cusdem = ""; | ||
| 39 | + type = "0"; | ||
| 40 | + ddate = ddateStr; | ||
| 41 | + ddate_solt = ddatesolt; | ||
| 42 | + is_set_ddate = "1"; | ||
| 43 | + tables = [table]; | ||
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | - String defDdateSolt(BuildContext context){ | ||
| 46 | - int millsNow=DateTime.now().millisecondsSinceEpoch; | ||
| 47 | - UserModel userModel=Provider.of<UserModel>(context,listen: false); | ||
| 48 | - String morning=userModel.user.morning==""?"00:00-00:00":userModel.user.morning; | ||
| 49 | - String noon=userModel.user.noon==""?"00:00-00:00":userModel.user.noon; | ||
| 50 | - String night=userModel.user.night==""?"00:00-00:00":userModel.user.night; | ||
| 51 | - String endMorning=morning.split("-")[1]; | ||
| 52 | - String endNoon=noon.split("-")[1]; | ||
| 53 | - String endNight=night.split("-")[1]; | ||
| 54 | - int endMorningMills=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(DateTime.now()).replaceRange(11,19, "$endMorning:00")); | ||
| 55 | - int endNoonMills=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(DateTime.now()).replaceRange(11,19, "$endNoon:00")); | ||
| 56 | - int endNightMills=DateUtil.getDateMsByTimeStr(DateUtil.formatDate(DateTime.now()).replaceRange(11,19, "$endNight:00")); | ||
| 57 | - if(millsNow<=endMorningMills){ | 46 | + String defDdateSolt(BuildContext context) { |
| 47 | + int millsNow = DateTime.now().millisecondsSinceEpoch; | ||
| 48 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 49 | + String morning = | ||
| 50 | + userModel.user.morning == "" ? "00:00-00:00" : userModel.user.morning; | ||
| 51 | + String noon = | ||
| 52 | + userModel.user.noon == "" ? "00:00-00:00" : userModel.user.noon; | ||
| 53 | + String night = | ||
| 54 | + userModel.user.night == "" ? "00:00-00:00" : userModel.user.night; | ||
| 55 | + String endMorning = morning.split("-")[1]; | ||
| 56 | + String endNoon = noon.split("-")[1]; | ||
| 57 | + String endNight = night.split("-")[1]; | ||
| 58 | + int endMorningMills = DateUtil.getDateMsByTimeStr( | ||
| 59 | + DateUtil.formatDate(DateTime.now()) | ||
| 60 | + .replaceRange(11, 19, "$endMorning:00")); | ||
| 61 | + int endNoonMills = DateUtil.getDateMsByTimeStr( | ||
| 62 | + DateUtil.formatDate(DateTime.now()) | ||
| 63 | + .replaceRange(11, 19, "$endNoon:00")); | ||
| 64 | + int endNightMills = DateUtil.getDateMsByTimeStr( | ||
| 65 | + DateUtil.formatDate(DateTime.now()) | ||
| 66 | + .replaceRange(11, 19, "$endNight:00")); | ||
| 67 | + if (millsNow <= endMorningMills) { | ||
| 58 | return "1"; | 68 | return "1"; |
| 59 | - }else if(millsNow<=endNoonMills){ | 69 | + } else if (millsNow <= endNoonMills) { |
| 60 | return "2"; | 70 | return "2"; |
| 61 | - }else if(millsNow<=endNightMills){ | 71 | + } else if (millsNow <= endNightMills) { |
| 62 | return "3"; | 72 | return "3"; |
| 63 | } | 73 | } |
| 64 | } | 74 | } |
| 65 | 75 | ||
| 66 | - | ||
| 67 | String id; | 76 | String id; |
| 68 | String abolition; | 77 | String abolition; |
| 69 | String tableinfo; | 78 | String tableinfo; |
| @@ -86,6 +95,7 @@ class NotebookDetail { | @@ -86,6 +95,7 @@ class NotebookDetail { | ||
| 86 | List<t.Table> tables; //预订桌位 | 95 | List<t.Table> tables; //预订桌位 |
| 87 | Cancel cancel; | 96 | Cancel cancel; |
| 88 | Order order; | 97 | Order order; |
| 98 | + OrderInfo orderInfo; | ||
| 89 | 99 | ||
| 90 | String get statuImgAssets { | 100 | String get statuImgAssets { |
| 91 | switch (status) { | 101 | switch (status) { |
| @@ -93,6 +103,9 @@ class NotebookDetail { | @@ -93,6 +103,9 @@ class NotebookDetail { | ||
| 93 | return "assets/status_undeal.png"; | 103 | return "assets/status_undeal.png"; |
| 94 | case "1": | 104 | case "1": |
| 95 | case "5": | 105 | case "5": |
| 106 | + if (orderInfo != null && orderInfo.status == '3') { | ||
| 107 | + return "assets/statu_finished.png"; | ||
| 108 | + } | ||
| 96 | return "assets/statu_booked.png"; | 109 | return "assets/statu_booked.png"; |
| 97 | case "2": | 110 | case "2": |
| 98 | return "assets/statu_reached.png"; | 111 | return "assets/statu_reached.png"; |
| @@ -105,18 +118,19 @@ class NotebookDetail { | @@ -105,18 +118,19 @@ class NotebookDetail { | ||
| 105 | } | 118 | } |
| 106 | } | 119 | } |
| 107 | 120 | ||
| 108 | - String get demandStr{ | ||
| 109 | - String demand=""; | ||
| 110 | - for(t.Table table in demands){ | ||
| 111 | - demand+=table.name+","; | 121 | + String get demandStr { |
| 122 | + String demand = ""; | ||
| 123 | + for (t.Table table in demands) { | ||
| 124 | + demand += table.name + ","; | ||
| 112 | } | 125 | } |
| 113 | - return demand.substring(0,demand.length-1); | 126 | + return demand.substring(0, demand.length - 1); |
| 114 | } | 127 | } |
| 115 | 128 | ||
| 116 | String get ddateMd { | 129 | String get ddateMd { |
| 117 | DateTime dateTime = | 130 | DateTime dateTime = |
| 118 | DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); | 131 | DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); |
| 119 | - String md ="${dateTime.year}年 "+Utils.addZeroNumber(dateTime.month) + | 132 | + String md = "${dateTime.year}年 " + |
| 133 | + Utils.addZeroNumber(dateTime.month) + | ||
| 120 | "月" + | 134 | "月" + |
| 121 | Utils.addZeroNumber(dateTime.day) + | 135 | Utils.addZeroNumber(dateTime.day) + |
| 122 | "日"; | 136 | "日"; |
| @@ -201,8 +215,6 @@ class NotebookDetail { | @@ -201,8 +215,6 @@ class NotebookDetail { | ||
| 201 | String toString() { | 215 | String toString() { |
| 202 | return 'NotebookDetail{id: $id, abolition: $abolition, tableinfo: $tableinfo, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel}'; | 216 | return 'NotebookDetail{id: $id, abolition: $abolition, tableinfo: $tableinfo, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel}'; |
| 203 | } | 217 | } |
| 204 | - | ||
| 205 | - | ||
| 206 | } | 218 | } |
| 207 | 219 | ||
| 208 | @JsonSerializable() | 220 | @JsonSerializable() |
| @@ -230,10 +242,9 @@ class Cancel { | @@ -230,10 +242,9 @@ class Cancel { | ||
| 230 | factory Cancel.fromJson(Map<String, dynamic> json) => _$CancelFromJson(json); | 242 | factory Cancel.fromJson(Map<String, dynamic> json) => _$CancelFromJson(json); |
| 231 | Map<String, dynamic> toJson() => _$CancelToJson(this); | 243 | Map<String, dynamic> toJson() => _$CancelToJson(this); |
| 232 | } | 244 | } |
| 233 | - | ||
| 234 | -@JsonSerializable() | ||
| 235 | - class Order extends Object { | ||
| 236 | 245 | ||
| 246 | +@JsonSerializable() | ||
| 247 | +class Order extends Object { | ||
| 237 | @JsonKey(name: 'id') | 248 | @JsonKey(name: 'id') |
| 238 | String id; | 249 | String id; |
| 239 | 250 | ||
| @@ -270,18 +281,29 @@ class Cancel { | @@ -270,18 +281,29 @@ class Cancel { | ||
| 270 | @JsonKey(name: 'cookbooklist') | 281 | @JsonKey(name: 'cookbooklist') |
| 271 | List<Cookbooklist> cookbooklist; | 282 | List<Cookbooklist> cookbooklist; |
| 272 | 283 | ||
| 273 | - Order(this.id,this.rid,this.no,this.rowNum,this.pnum,this.sellerid,this.openid,this.price,this.type,this.behavior,this.cdate,this.cookbooklist,); | ||
| 274 | - | ||
| 275 | - factory Order.fromJson(Map<String, dynamic> srcJson) => _$OrderFromJson(srcJson); | 284 | + Order( |
| 285 | + this.id, | ||
| 286 | + this.rid, | ||
| 287 | + this.no, | ||
| 288 | + this.rowNum, | ||
| 289 | + this.pnum, | ||
| 290 | + this.sellerid, | ||
| 291 | + this.openid, | ||
| 292 | + this.price, | ||
| 293 | + this.type, | ||
| 294 | + this.behavior, | ||
| 295 | + this.cdate, | ||
| 296 | + this.cookbooklist, | ||
| 297 | + ); | ||
| 298 | + | ||
| 299 | + factory Order.fromJson(Map<String, dynamic> srcJson) => | ||
| 300 | + _$OrderFromJson(srcJson); | ||
| 276 | 301 | ||
| 277 | Map<String, dynamic> toJson() => _$OrderToJson(this); | 302 | Map<String, dynamic> toJson() => _$OrderToJson(this); |
| 278 | - | ||
| 279 | } | 303 | } |
| 280 | 304 | ||
| 281 | - | ||
| 282 | @JsonSerializable() | 305 | @JsonSerializable() |
| 283 | - class Cookbooklist extends Object { | ||
| 284 | - | 306 | +class Cookbooklist extends Object { |
| 285 | @JsonKey(name: 'id') | 307 | @JsonKey(name: 'id') |
| 286 | String id; | 308 | String id; |
| 287 | 309 | ||
| @@ -330,10 +352,142 @@ class Cancel { | @@ -330,10 +352,142 @@ class Cancel { | ||
| 330 | @JsonKey(name: 'cdate') | 352 | @JsonKey(name: 'cdate') |
| 331 | String cdate; | 353 | String cdate; |
| 332 | 354 | ||
| 333 | - Cookbooklist(this.id,this.orderid,this.openid,this.cookbookid,this.price,this.cookname,this.cookunit,this.cookimage,this.className,this.classid,this.classOrder,this.fromSoucre,this.source,this.status,this.identity,this.cdate,); | ||
| 334 | - | ||
| 335 | - factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) => _$CookbooklistFromJson(srcJson); | 355 | + Cookbooklist( |
| 356 | + this.id, | ||
| 357 | + this.orderid, | ||
| 358 | + this.openid, | ||
| 359 | + this.cookbookid, | ||
| 360 | + this.price, | ||
| 361 | + this.cookname, | ||
| 362 | + this.cookunit, | ||
| 363 | + this.cookimage, | ||
| 364 | + this.className, | ||
| 365 | + this.classid, | ||
| 366 | + this.classOrder, | ||
| 367 | + this.fromSoucre, | ||
| 368 | + this.source, | ||
| 369 | + this.status, | ||
| 370 | + this.identity, | ||
| 371 | + this.cdate, | ||
| 372 | + ); | ||
| 373 | + | ||
| 374 | + factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) => | ||
| 375 | + _$CookbooklistFromJson(srcJson); | ||
| 336 | 376 | ||
| 337 | Map<String, dynamic> toJson() => _$CookbooklistToJson(this); | 377 | Map<String, dynamic> toJson() => _$CookbooklistToJson(this); |
| 378 | +} | ||
| 379 | + | ||
| 380 | +@JsonSerializable() | ||
| 381 | +class OrderInfo extends Object { | ||
| 382 | + @JsonKey(name: 'id') | ||
| 383 | + String id; | ||
| 384 | + | ||
| 385 | + @JsonKey(name: 'order_no') | ||
| 386 | + String orderNo; | ||
| 387 | + | ||
| 388 | + @JsonKey(name: 'out_trade_no') | ||
| 389 | + String outTradeNo; | ||
| 390 | + | ||
| 391 | + @JsonKey(name: 'openid') | ||
| 392 | + String openid; | ||
| 393 | + | ||
| 394 | + @JsonKey(name: 'sid') | ||
| 395 | + String sid; | ||
| 396 | + | ||
| 397 | + @JsonKey(name: 'rid') | ||
| 398 | + String rid; | ||
| 399 | + | ||
| 400 | + @JsonKey(name: 'sellername') | ||
| 401 | + String sellername; | ||
| 402 | + | ||
| 403 | + @JsonKey(name: 'tablename') | ||
| 404 | + String tablename; | ||
| 405 | + | ||
| 406 | + @JsonKey(name: 'wechat_no') | ||
| 407 | + String wechatNo; | ||
| 408 | + | ||
| 409 | + @JsonKey(name: 'bill_list') | ||
| 410 | + List<dynamic> billList; | ||
| 411 | + | ||
| 412 | + @JsonKey(name: 'price') | ||
| 413 | + String price; | ||
| 414 | + | ||
| 415 | + @JsonKey(name: 'should_price') | ||
| 416 | + String shouldPrice; | ||
| 417 | + | ||
| 418 | + @JsonKey(name: 'subsidy_type') | ||
| 419 | + String subsidyType; | ||
| 420 | + | ||
| 421 | + @JsonKey(name: 'subsidy_price') | ||
| 422 | + String subsidyPrice; | ||
| 423 | + | ||
| 424 | + @JsonKey(name: 'is_wine') | ||
| 425 | + String isWine; | ||
| 426 | + | ||
| 427 | + @JsonKey(name: 'is_pack') | ||
| 428 | + String isPack; | ||
| 429 | + | ||
| 430 | + @JsonKey(name: 'status') | ||
| 431 | + String status; | ||
| 338 | 432 | ||
| 433 | + @JsonKey(name: 'pay_time') | ||
| 434 | + String payTime; | ||
| 435 | + | ||
| 436 | + @JsonKey(name: 'confirm_time') | ||
| 437 | + String confirmTime; | ||
| 438 | + | ||
| 439 | + @JsonKey(name: 'remarks') | ||
| 440 | + String remarks; | ||
| 441 | + | ||
| 442 | + @JsonKey(name: 'attach') | ||
| 443 | + String attach; | ||
| 444 | + | ||
| 445 | + @JsonKey(name: 'currency') | ||
| 446 | + String currency; | ||
| 447 | + | ||
| 448 | + @JsonKey(name: 'detail') | ||
| 449 | + String detail; | ||
| 450 | + | ||
| 451 | + @JsonKey(name: 'description') | ||
| 452 | + String description; | ||
| 453 | + | ||
| 454 | + @JsonKey(name: 'profit_sharing') | ||
| 455 | + String profitSharing; | ||
| 456 | + | ||
| 457 | + @JsonKey(name: 'create_time') | ||
| 458 | + String createTime; | ||
| 459 | + | ||
| 460 | + OrderInfo( | ||
| 461 | + this.id, | ||
| 462 | + this.orderNo, | ||
| 463 | + this.outTradeNo, | ||
| 464 | + this.openid, | ||
| 465 | + this.sid, | ||
| 466 | + this.rid, | ||
| 467 | + this.sellername, | ||
| 468 | + this.tablename, | ||
| 469 | + this.wechatNo, | ||
| 470 | + this.billList, | ||
| 471 | + this.price, | ||
| 472 | + this.shouldPrice, | ||
| 473 | + this.subsidyType, | ||
| 474 | + this.subsidyPrice, | ||
| 475 | + this.isWine, | ||
| 476 | + this.isPack, | ||
| 477 | + this.status, | ||
| 478 | + this.payTime, | ||
| 479 | + this.confirmTime, | ||
| 480 | + this.remarks, | ||
| 481 | + this.attach, | ||
| 482 | + this.currency, | ||
| 483 | + this.detail, | ||
| 484 | + this.description, | ||
| 485 | + this.profitSharing, | ||
| 486 | + this.createTime, | ||
| 487 | + ); | ||
| 488 | + | ||
| 489 | + factory OrderInfo.fromJson(Map<String, dynamic> srcJson) => | ||
| 490 | + _$OrderInfoFromJson(srcJson); | ||
| 491 | + | ||
| 492 | + Map<String, dynamic> toJson() => _$OrderInfoToJson(this); | ||
| 339 | } | 493 | } |
| @@ -39,7 +39,10 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { | @@ -39,7 +39,10 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { | ||
| 39 | : Cancel.fromJson(json['cancel'] as Map<String, dynamic>) | 39 | : Cancel.fromJson(json['cancel'] as Map<String, dynamic>) |
| 40 | ..order = json['order'] == null | 40 | ..order = json['order'] == null |
| 41 | ? null | 41 | ? null |
| 42 | - : Order.fromJson(json['order'] as Map<String, dynamic>); | 42 | + : Order.fromJson(json['order'] as Map<String, dynamic>) |
| 43 | + ..orderInfo = json['order_info'] == null | ||
| 44 | + ? null | ||
| 45 | + : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>); | ||
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => | 48 | Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => |
| @@ -65,9 +68,67 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => | @@ -65,9 +68,67 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => | ||
| 65 | 'demands': instance.demands, | 68 | 'demands': instance.demands, |
| 66 | 'tables': instance.tables, | 69 | 'tables': instance.tables, |
| 67 | 'cancel': instance.cancel, | 70 | 'cancel': instance.cancel, |
| 68 | - 'order':instance.order | 71 | + 'order': instance.order, |
| 72 | + 'order_info': instance.orderInfo | ||
| 69 | }; | 73 | }; |
| 74 | +OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) { | ||
| 75 | + return OrderInfo( | ||
| 76 | + json['id'] as String, | ||
| 77 | + json['order_no'] as String, | ||
| 78 | + json['out_trade_no'] as String, | ||
| 79 | + json['openid'] as String, | ||
| 80 | + json['sid'] as String, | ||
| 81 | + json['rid'] as String, | ||
| 82 | + json['sellername'] as String, | ||
| 83 | + json['tablename'] as String, | ||
| 84 | + json['wechat_no'] as String, | ||
| 85 | + json['bill_list'] as List, | ||
| 86 | + json['price'] as String, | ||
| 87 | + json['should_price'] as String, | ||
| 88 | + json['subsidy_type'] as String, | ||
| 89 | + json['subsidy_price'] as String, | ||
| 90 | + json['is_wine'] as String, | ||
| 91 | + json['is_pack'] as String, | ||
| 92 | + json['status'] as String, | ||
| 93 | + json['pay_time'] as String, | ||
| 94 | + json['confirm_time'] as String, | ||
| 95 | + json['remarks'] as String, | ||
| 96 | + json['attach'] as String, | ||
| 97 | + json['currency'] as String, | ||
| 98 | + json['detail'] as String, | ||
| 99 | + json['description'] as String, | ||
| 100 | + json['profit_sharing'] as String, | ||
| 101 | + json['create_time'] as String); | ||
| 102 | +} | ||
| 70 | 103 | ||
| 104 | +Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{ | ||
| 105 | + 'id': instance.id, | ||
| 106 | + 'order_no': instance.orderNo, | ||
| 107 | + 'out_trade_no': instance.outTradeNo, | ||
| 108 | + 'openid': instance.openid, | ||
| 109 | + 'sid': instance.sid, | ||
| 110 | + 'rid': instance.rid, | ||
| 111 | + 'sellername': instance.sellername, | ||
| 112 | + 'tablename': instance.tablename, | ||
| 113 | + 'wechat_no': instance.wechatNo, | ||
| 114 | + 'bill_list': instance.billList, | ||
| 115 | + 'price': instance.price, | ||
| 116 | + 'should_price': instance.shouldPrice, | ||
| 117 | + 'subsidy_type': instance.subsidyType, | ||
| 118 | + 'subsidy_price': instance.subsidyPrice, | ||
| 119 | + 'is_wine': instance.isWine, | ||
| 120 | + 'is_pack': instance.isPack, | ||
| 121 | + 'status': instance.status, | ||
| 122 | + 'pay_time': instance.payTime, | ||
| 123 | + 'confirm_time': instance.confirmTime, | ||
| 124 | + 'remarks': instance.remarks, | ||
| 125 | + 'attach': instance.attach, | ||
| 126 | + 'currency': instance.currency, | ||
| 127 | + 'detail': instance.detail, | ||
| 128 | + 'description': instance.description, | ||
| 129 | + 'profit_sharing': instance.profitSharing, | ||
| 130 | + 'create_time': instance.createTime | ||
| 131 | + }; | ||
| 71 | Cancel _$CancelFromJson(Map<String, dynamic> json) { | 132 | Cancel _$CancelFromJson(Map<String, dynamic> json) { |
| 72 | return Cancel() | 133 | return Cancel() |
| 73 | ..uname = json['uname'] as String | 134 | ..uname = json['uname'] as String |
| @@ -512,8 +512,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -512,8 +512,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 512 | ), | 512 | ), |
| 513 | Image.asset( | 513 | Image.asset( |
| 514 | detailEntity.statuImgAssets, | 514 | detailEntity.statuImgAssets, |
| 515 | - width: ScreenUtil().setWidth(100), | ||
| 516 | - height: ScreenUtil().setWidth(30), | 515 | + width: ScreenUtil().setWidth(114), |
| 516 | + height: ScreenUtil().setWidth(56), | ||
| 517 | ) | 517 | ) |
| 518 | ], | 518 | ], |
| 519 | ), | 519 | ), |
| @@ -889,7 +889,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -889,7 +889,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 889 | )), | 889 | )), |
| 890 | ), | 890 | ), |
| 891 | Offstage( | 891 | Offstage( |
| 892 | - offstage: (detailEntity.status == "3" || | 892 | + offstage: ((detailEntity.orderInfo != null && |
| 893 | + detailEntity.orderInfo.status == "3") || | ||
| 894 | + detailEntity.status == "3" || | ||
| 893 | detailEntity.status == "4" || | 895 | detailEntity.status == "4" || |
| 894 | detailEntity.status == "6"), | 896 | detailEntity.status == "6"), |
| 895 | child: Container( | 897 | child: Container( |
| @@ -906,11 +908,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -906,11 +908,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 906 | child: Row( | 908 | child: Row( |
| 907 | children: [ | 909 | children: [ |
| 908 | Offstage( | 910 | Offstage( |
| 909 | - offstage: (detailEntity.status == "3" || | ||
| 910 | - detailEntity.status == "4" || | ||
| 911 | - detailEntity.status == "6") | ||
| 912 | - ? true | ||
| 913 | - : false, | 911 | + offstage: |
| 912 | + ((detailEntity.orderInfo != null && | ||
| 913 | + detailEntity.orderInfo | ||
| 914 | + .status == | ||
| 915 | + "3") || | ||
| 916 | + detailEntity.status == "3" || | ||
| 917 | + detailEntity.status == "4" || | ||
| 918 | + detailEntity.status == "6") | ||
| 919 | + ? true | ||
| 920 | + : false, | ||
| 914 | child: _cancelAndChangeBtn(() { | 921 | child: _cancelAndChangeBtn(() { |
| 915 | DialogUtil.showShareDialog(context) | 922 | DialogUtil.showShareDialog(context) |
| 916 | ?.then((value) { | 923 | ?.then((value) { |
| @@ -961,7 +968,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -961,7 +968,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 961 | offstage: !(detailEntity | 968 | offstage: !(detailEntity |
| 962 | .order.cookbooklist.length > | 969 | .order.cookbooklist.length > |
| 963 | 0 && | 970 | 0 && |
| 964 | - (detailEntity.status != "3" && | 971 | + ((detailEntity.orderInfo != null && |
| 972 | + detailEntity | ||
| 973 | + .orderInfo.status == | ||
| 974 | + "3") && | ||
| 975 | + detailEntity.status != "3" && | ||
| 965 | detailEntity.status != "4" && | 976 | detailEntity.status != "4" && |
| 966 | detailEntity.status != "6")), | 977 | detailEntity.status != "6")), |
| 967 | child: MyDivider(ScreenUtil().setWidth(2), | 978 | child: MyDivider(ScreenUtil().setWidth(2), |
| @@ -979,7 +990,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -979,7 +990,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 979 | rid: detailEntity.id); | 990 | rid: detailEntity.id); |
| 980 | }, '查看菜品', | 991 | }, '查看菜品', |
| 981 | bgColor: MyColours.color_199095, | 992 | bgColor: MyColours.color_199095, |
| 982 | - width: (detailEntity.status == "3" || | 993 | + width: ((detailEntity.orderInfo != |
| 994 | + null && | ||
| 995 | + detailEntity.orderInfo | ||
| 996 | + .status == | ||
| 997 | + "3") || | ||
| 998 | + detailEntity.status == "3" || | ||
| 983 | detailEntity.status == "4" || | 999 | detailEntity.status == "4" || |
| 984 | detailEntity.status == "6") | 1000 | detailEntity.status == "6") |
| 985 | ? ScreenUtil.screenWidthDp - | 1001 | ? ScreenUtil.screenWidthDp - |
| @@ -992,7 +1008,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -992,7 +1008,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 992 | ], | 1008 | ], |
| 993 | ))), | 1009 | ))), |
| 994 | Offstage( | 1010 | Offstage( |
| 995 | - offstage: (detailEntity.status == "3" || | 1011 | + offstage: ((detailEntity.orderInfo != null && |
| 1012 | + detailEntity.orderInfo.status == "3") || | ||
| 1013 | + detailEntity.status == "3" || | ||
| 996 | detailEntity.status == "4" || | 1014 | detailEntity.status == "4" || |
| 997 | detailEntity.status == "6") | 1015 | detailEntity.status == "6") |
| 998 | ? true | 1016 | ? true |
| @@ -126,6 +126,27 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -126,6 +126,27 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 126 | //在线买单消息 去查看 跳转在线买单详情页面 | 126 | //在线买单消息 去查看 跳转在线买单详情页面 |
| 127 | NavigatorUtil.goOnlineCheckDetailPage(context, | 127 | NavigatorUtil.goOnlineCheckDetailPage(context, |
| 128 | rid: notifyParam["rid"], fromNotify: true); | 128 | rid: notifyParam["rid"], fromNotify: true); |
| 129 | + Map<String, String> params = { | ||
| 130 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 131 | + "id": notifyParam['mid'], | ||
| 132 | + "status": "is_read" | ||
| 133 | + }; | ||
| 134 | + MessageDialogModel messageDialogModel = | ||
| 135 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 136 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 137 | + break; | ||
| 138 | + case "14": | ||
| 139 | + //发票详情页面跳转 | ||
| 140 | + NavigatorUtil.goInvoiceDetailPage(context, | ||
| 141 | + rid: '${notifyParam["rid"]}', fromNotify: true); | ||
| 142 | + Map<String, String> params = { | ||
| 143 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 144 | + "id": notifyParam['mid'], | ||
| 145 | + "status": "is_read" | ||
| 146 | + }; | ||
| 147 | + MessageDialogModel messageDialogModel = | ||
| 148 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 149 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 129 | break; | 150 | break; |
| 130 | case "1": | 151 | case "1": |
| 131 | NavigatorUtil.goHasOrderFoodPage(context, | 152 | NavigatorUtil.goHasOrderFoodPage(context, |
| @@ -231,6 +252,31 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -231,6 +252,31 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 231 | //在线买单消息 去查看 跳转在线买单详情页面 | 252 | //在线买单消息 去查看 跳转在线买单详情页面 |
| 232 | NavigatorUtil.goOnlineCheckDetailPage(context, | 253 | NavigatorUtil.goOnlineCheckDetailPage(context, |
| 233 | rid: custom["rid"], fromNotify: true); | 254 | rid: custom["rid"], fromNotify: true); |
| 255 | + Map<String, String> params = { | ||
| 256 | + "sid": Provider.of<UserModel>(context, listen: false) | ||
| 257 | + .user | ||
| 258 | + .sellerid, | ||
| 259 | + "id": custom['mid'], | ||
| 260 | + "status": "is_read" | ||
| 261 | + }; | ||
| 262 | + MessageDialogModel messageDialogModel = | ||
| 263 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 264 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 265 | + break; | ||
| 266 | + case "14": | ||
| 267 | + //发票详情页面跳转 | ||
| 268 | + NavigatorUtil.goInvoiceDetailPage(context, | ||
| 269 | + rid: '${custom["rid"]}', fromNotify: true); | ||
| 270 | + Map<String, String> params = { | ||
| 271 | + "sid": Provider.of<UserModel>(context, listen: false) | ||
| 272 | + .user | ||
| 273 | + .sellerid, | ||
| 274 | + "id": custom['mid'], | ||
| 275 | + "status": "is_read" | ||
| 276 | + }; | ||
| 277 | + MessageDialogModel messageDialogModel = | ||
| 278 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 279 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 234 | break; | 280 | break; |
| 235 | case "1": | 281 | case "1": |
| 236 | NavigatorUtil.goHasOrderFoodPage(context, | 282 | NavigatorUtil.goHasOrderFoodPage(context, |
| @@ -357,26 +403,30 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -357,26 +403,30 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 357 | 403 | ||
| 358 | ///获取全部未读消息 | 404 | ///获取全部未读消息 |
| 359 | /// | 405 | /// |
| 406 | + | ||
| 360 | _getAllUnMessages() { | 407 | _getAllUnMessages() { |
| 361 | - getUntreatedMessage('11,10,1,12,13,14', () { | ||
| 362 | - MessageDialogModel messageModel = | ||
| 363 | - Provider.of<MessageDialogModel>(context, listen: false); | ||
| 364 | - if (messageModel.messages.isNotEmpty) { | ||
| 365 | - //底部弹出布局 | ||
| 366 | - if (!messageModel.showMessageDialog) { | ||
| 367 | - DialogUtil.showMessageDialog(context); | ||
| 368 | - } else { | ||
| 369 | - messageModel.notifyListeners(); | ||
| 370 | - } | ||
| 371 | - //播放声音 | ||
| 372 | - if (messageModel.messages.length > 1) { | ||
| 373 | - messageModel.play("-1"); | ||
| 374 | - } else { | ||
| 375 | - for (Message message in messageModel.messages) { | ||
| 376 | - messageModel.play(message.message_type); | 408 | + MessageDialogModel messageModel = |
| 409 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 410 | + messageModel.messages = []; | ||
| 411 | + getUntreatedMessage('1', () { | ||
| 412 | + getUntreatedMessage('10', () { | ||
| 413 | + if (messageModel.messages.isNotEmpty) { | ||
| 414 | + //底部弹出布局 | ||
| 415 | + if (!messageModel.showMessageDialog) { | ||
| 416 | + DialogUtil.showMessageDialog(context); | ||
| 417 | + } else { | ||
| 418 | + messageModel.notifyListeners(); | ||
| 419 | + } | ||
| 420 | + //播放声音 | ||
| 421 | + if (messageModel.messages.length > 1) { | ||
| 422 | + messageModel.play("-1"); | ||
| 423 | + } else { | ||
| 424 | + for (Message message in messageModel.messages) { | ||
| 425 | + messageModel.play(message.message_type); | ||
| 426 | + } | ||
| 377 | } | 427 | } |
| 378 | } | 428 | } |
| 379 | - } | 429 | + }); |
| 380 | }); | 430 | }); |
| 381 | } | 431 | } |
| 382 | 432 |
| @@ -19,8 +19,7 @@ import '../../app.dart'; | @@ -19,8 +19,7 @@ import '../../app.dart'; | ||
| 19 | class MessageDialogItem extends StatelessWidget { | 19 | class MessageDialogItem extends StatelessWidget { |
| 20 | final Message message; | 20 | final Message message; |
| 21 | final bool isTreated; | 21 | final bool isTreated; |
| 22 | - final VoidCallback callback; | ||
| 23 | - MessageDialogItem(this.message, {this.isTreated = false, this.callback}); | 22 | + MessageDialogItem(this.message, {this.isTreated = false}); |
| 24 | 23 | ||
| 25 | @override | 24 | @override |
| 26 | Widget build(BuildContext context) { | 25 | Widget build(BuildContext context) { |
| @@ -177,6 +176,7 @@ class MessageDialogItem extends StatelessWidget { | @@ -177,6 +176,7 @@ class MessageDialogItem extends StatelessWidget { | ||
| 177 | state: 1, | 176 | state: 1, |
| 178 | onPress: () async { | 177 | onPress: () async { |
| 179 | messageDialogModel.removeMessage(message.id); | 178 | messageDialogModel.removeMessage(message.id); |
| 179 | + | ||
| 180 | if (message.message_type == "10") { | 180 | if (message.message_type == "10") { |
| 181 | NavigatorUtil.goHandleOnlinePage( | 181 | NavigatorUtil.goHandleOnlinePage( |
| 182 | context, message.rid.toString(), message.id, | 182 | context, message.rid.toString(), message.id, |
| @@ -190,7 +190,6 @@ class MessageDialogItem extends StatelessWidget { | @@ -190,7 +190,6 @@ class MessageDialogItem extends StatelessWidget { | ||
| 190 | ? true | 190 | ? true |
| 191 | : false); | 191 | : false); |
| 192 | bus.emit("remove_untreated_message", message.id); | 192 | bus.emit("remove_untreated_message", message.id); |
| 193 | - | ||
| 194 | Map<String, String> params = { | 193 | Map<String, String> params = { |
| 195 | "sid": Provider.of<UserModel>(context, listen: false) | 194 | "sid": Provider.of<UserModel>(context, listen: false) |
| 196 | .user | 195 | .user |
| @@ -208,7 +207,7 @@ class MessageDialogItem extends StatelessWidget { | @@ -208,7 +207,7 @@ class MessageDialogItem extends StatelessWidget { | ||
| 208 | replace: messageDialogModel.messages.isEmpty | 207 | replace: messageDialogModel.messages.isEmpty |
| 209 | ? true | 208 | ? true |
| 210 | : false); | 209 | : false); |
| 211 | - bus.emit("remove_untreated_message_order", message.id); | 210 | + bus.emit("remove_untreated_message", message.id); |
| 212 | Map<String, String> params = { | 211 | Map<String, String> params = { |
| 213 | "sid": Provider.of<UserModel>(context, listen: false) | 212 | "sid": Provider.of<UserModel>(context, listen: false) |
| 214 | .user | 213 | .user |
| @@ -221,12 +220,19 @@ class MessageDialogItem extends StatelessWidget { | @@ -221,12 +220,19 @@ class MessageDialogItem extends StatelessWidget { | ||
| 221 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 | 220 | bus.emit("refresh_untreated_num"); //刷新未读消息数目 |
| 222 | } else if ('${message.message_type}' == "12") { | 221 | } else if ('${message.message_type}' == "12") { |
| 223 | //在线买单消息 去处理 跳转在线买单处理页面 | 222 | //在线买单消息 去处理 跳转在线买单处理页面 |
| 224 | - NavigatorUtil.goOnlineCheckEditPage(context, | ||
| 225 | - rid: '${message.rid}', mid: message.id); | 223 | + await NavigatorUtil.goOnlineCheckEditPage(context, |
| 224 | + rid: '${message.rid}', | ||
| 225 | + mid: message.id, | ||
| 226 | + replace: messageDialogModel.messages.isEmpty | ||
| 227 | + ? true | ||
| 228 | + : false); | ||
| 226 | } else if ('${message.message_type}' == "13") { | 229 | } else if ('${message.message_type}' == "13") { |
| 227 | //在线买单消息 去查看 跳转在线买单详情页面 | 230 | //在线买单消息 去查看 跳转在线买单详情页面 |
| 228 | NavigatorUtil.goOnlineCheckDetailPage(context, | 231 | NavigatorUtil.goOnlineCheckDetailPage(context, |
| 229 | - rid: '${message.rid}'); | 232 | + rid: '${message.rid}', |
| 233 | + replace: messageDialogModel.messages.isEmpty | ||
| 234 | + ? true | ||
| 235 | + : false); | ||
| 230 | bus.emit("remove_untreated_message", message.id); | 236 | bus.emit("remove_untreated_message", message.id); |
| 231 | 237 | ||
| 232 | Map<String, String> params = { | 238 | Map<String, String> params = { |
| @@ -244,7 +250,10 @@ class MessageDialogItem extends StatelessWidget { | @@ -244,7 +250,10 @@ class MessageDialogItem extends StatelessWidget { | ||
| 244 | } else if (message.message_type == "14") { | 250 | } else if (message.message_type == "14") { |
| 245 | //发票详情页面跳转 | 251 | //发票详情页面跳转 |
| 246 | NavigatorUtil.goInvoiceDetailPage(context, | 252 | NavigatorUtil.goInvoiceDetailPage(context, |
| 247 | - rid: '${message.rid}'); | 253 | + rid: '${message.rid}', |
| 254 | + replace: messageDialogModel.messages.isEmpty | ||
| 255 | + ? true | ||
| 256 | + : false); | ||
| 248 | bus.emit("remove_untreated_message", message.id); | 257 | bus.emit("remove_untreated_message", message.id); |
| 249 | 258 | ||
| 250 | Map<String, String> params = { | 259 | Map<String, String> params = { |
| @@ -41,9 +41,8 @@ class MessageOnlineCheckPageState extends State<MessageOnlineCheckPage> { | @@ -41,9 +41,8 @@ class MessageOnlineCheckPageState extends State<MessageOnlineCheckPage> { | ||
| 41 | // TODO: implement initState | 41 | // TODO: implement initState |
| 42 | super.initState(); | 42 | super.initState(); |
| 43 | //移除在线买单消息 | 43 | //移除在线买单消息 |
| 44 | - // bus.on("remove_untreated_message", (args) { | 44 | + // bus.on("remove_untreated_message_check", (args) { |
| 45 | // messageModel.removeUntreatedMessageByMid(args.toString()); | 45 | // messageModel.removeUntreatedMessageByMid(args.toString()); |
| 46 | - | ||
| 47 | // messageDialogModel.removeMessage(args.toString()); | 46 | // messageDialogModel.removeMessage(args.toString()); |
| 48 | // }); | 47 | // }); |
| 49 | _controller = EasyRefreshController(); | 48 | _controller = EasyRefreshController(); |
| @@ -59,7 +58,7 @@ class MessageOnlineCheckPageState extends State<MessageOnlineCheckPage> { | @@ -59,7 +58,7 @@ class MessageOnlineCheckPageState extends State<MessageOnlineCheckPage> { | ||
| 59 | void dispose() { | 58 | void dispose() { |
| 60 | // TODO: implement dispose | 59 | // TODO: implement dispose |
| 61 | super.dispose(); | 60 | super.dispose(); |
| 62 | - // bus.off("remove_untreated_message"); | 61 | + // bus.off("remove_untreated_message_check"); |
| 63 | } | 62 | } |
| 64 | 63 | ||
| 65 | //三种分类各自的未读消息数目 | 64 | //三种分类各自的未读消息数目 |
| @@ -40,12 +40,11 @@ class MessageOnlinePageState extends State<MessageOnlinePage> { | @@ -40,12 +40,11 @@ class MessageOnlinePageState extends State<MessageOnlinePage> { | ||
| 40 | void initState() { | 40 | void initState() { |
| 41 | // TODO: implement initState | 41 | // TODO: implement initState |
| 42 | super.initState(); | 42 | super.initState(); |
| 43 | - //移除在线预订消息 | ||
| 44 | - bus.on("remove_untreated_message", (args) { | ||
| 45 | - messageModel.removeUntreatedMessageByMid(args.toString()); | ||
| 46 | - | ||
| 47 | - messageDialogModel.removeMessage(args.toString()); | ||
| 48 | - }); | 43 | + // //移除在线预订消息 |
| 44 | + // bus.on("remove_untreated_message", (args) { | ||
| 45 | + // messageModel.removeUntreatedMessageByMid(args.toString()); | ||
| 46 | + // messageDialogModel.removeMessage(args.toString()); | ||
| 47 | + // }); | ||
| 49 | _controller = EasyRefreshController(); | 48 | _controller = EasyRefreshController(); |
| 50 | WidgetsBinding.instance.addPostFrameCallback((_) { | 49 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 51 | // getMessage(); | 50 | // getMessage(); |
| @@ -59,7 +58,7 @@ class MessageOnlinePageState extends State<MessageOnlinePage> { | @@ -59,7 +58,7 @@ class MessageOnlinePageState extends State<MessageOnlinePage> { | ||
| 59 | void dispose() { | 58 | void dispose() { |
| 60 | // TODO: implement dispose | 59 | // TODO: implement dispose |
| 61 | super.dispose(); | 60 | super.dispose(); |
| 62 | - bus.off("remove_untreated_message"); | 61 | + // bus.off("remove_untreated_message"); |
| 63 | } | 62 | } |
| 64 | 63 | ||
| 65 | //三种分类各自的未读消息数目 | 64 | //三种分类各自的未读消息数目 |
| @@ -332,63 +332,69 @@ class _MessageHasOrderFoodPageState extends State<MessageHasOrderFoodPage> { | @@ -332,63 +332,69 @@ class _MessageHasOrderFoodPageState extends State<MessageHasOrderFoodPage> { | ||
| 332 | Widget build(BuildContext context) { | 332 | Widget build(BuildContext context) { |
| 333 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); | 333 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); |
| 334 | return Scaffold( | 334 | return Scaffold( |
| 335 | - backgroundColor: MyColours.color_ffffff, | ||
| 336 | - appBar: SystemAppBar( | ||
| 337 | - '已点菜品', | ||
| 338 | - onTap: () { | 335 | + backgroundColor: MyColours.color_ffffff, |
| 336 | + appBar: SystemAppBar( | ||
| 337 | + '已点菜品', | ||
| 338 | + onTap: () { | ||
| 339 | + if (widget.fromNotify) { | ||
| 340 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 341 | + } else { | ||
| 342 | + Navigator.of(context).pop(); | ||
| 343 | + } | ||
| 344 | + }, | ||
| 345 | + ), | ||
| 346 | + body: WillPopScope(child: Consumer<OrderFoodProvider>( | ||
| 347 | + builder: (context, model, _) { | ||
| 348 | + if (model.pageState != PageState.Success) { | ||
| 349 | + return ExceptionPage( | ||
| 350 | + pageState: model.pageState, | ||
| 351 | + callback: () { | ||
| 352 | + _getOrderFoodData(); | ||
| 353 | + _getTableInfoData(); | ||
| 354 | + }, | ||
| 355 | + emptyMsg: "暂时没有已选菜品哦", | ||
| 356 | + emptyImg: "empty_search", | ||
| 357 | + showMsg: "加载中,请稍后...", | ||
| 358 | + ); | ||
| 359 | + } else { | ||
| 360 | + return Padding( | ||
| 361 | + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)), | ||
| 362 | + child: Column( | ||
| 363 | + children: [ | ||
| 364 | + Expanded( | ||
| 365 | + child: list(_orderFoodProvider.orderList), | ||
| 366 | + ), | ||
| 367 | + RoundButton( | ||
| 368 | + text: '分享', | ||
| 369 | + margin: EdgeInsets.symmetric( | ||
| 370 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 371 | + width: double.infinity, | ||
| 372 | + height: 50, | ||
| 373 | + fontSize: 34, | ||
| 374 | + isBold: false, | ||
| 375 | + gradientStart: MyColours.color_199095, | ||
| 376 | + gradientEnd: MyColours.color_199095, | ||
| 377 | + radius: ScreenUtil().setWidth(10), | ||
| 378 | + onPressed: () { | ||
| 379 | + Utils.goShareOrderFoodToWeChat(context, | ||
| 380 | + rid: widget.rid, | ||
| 381 | + title: '菜品已点好,快来看看都点了什么~', | ||
| 382 | + img: | ||
| 383 | + 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg'); | ||
| 384 | + }, | ||
| 385 | + ) | ||
| 386 | + ], | ||
| 387 | + ), | ||
| 388 | + ); | ||
| 389 | + } | ||
| 390 | + }, | ||
| 391 | + ), onWillPop: () async { | ||
| 339 | if (widget.fromNotify) { | 392 | if (widget.fromNotify) { |
| 340 | NavigatorUtil.goHomePage(context, initialIndex: 0); | 393 | NavigatorUtil.goHomePage(context, initialIndex: 0); |
| 341 | - } else { | ||
| 342 | - Navigator.of(context).pop(); | ||
| 343 | - } | ||
| 344 | - }, | ||
| 345 | - ), | ||
| 346 | - body: Consumer<OrderFoodProvider>( | ||
| 347 | - builder: (context, model, _) { | ||
| 348 | - if (model.pageState != PageState.Success) { | ||
| 349 | - return ExceptionPage( | ||
| 350 | - pageState: model.pageState, | ||
| 351 | - callback: () { | ||
| 352 | - _getOrderFoodData(); | ||
| 353 | - _getTableInfoData(); | ||
| 354 | - }, | ||
| 355 | - emptyMsg: "暂时没有已选菜品哦", | ||
| 356 | - emptyImg: "empty_search", | ||
| 357 | - showMsg: "加载中,请稍后...", | ||
| 358 | - ); | ||
| 359 | - } else { | ||
| 360 | - return Padding( | ||
| 361 | - padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)), | ||
| 362 | - child: Column( | ||
| 363 | - children: [ | ||
| 364 | - Expanded( | ||
| 365 | - child: list(_orderFoodProvider.orderList), | ||
| 366 | - ), | ||
| 367 | - RoundButton( | ||
| 368 | - text: '分享', | ||
| 369 | - margin: EdgeInsets.symmetric( | ||
| 370 | - horizontal: ScreenUtil().setWidth(40)), | ||
| 371 | - width: double.infinity, | ||
| 372 | - height: 50, | ||
| 373 | - fontSize: 34, | ||
| 374 | - isBold: false, | ||
| 375 | - gradientStart: MyColours.color_199095, | ||
| 376 | - gradientEnd: MyColours.color_199095, | ||
| 377 | - radius: ScreenUtil().setWidth(10), | ||
| 378 | - onPressed: () { | ||
| 379 | - Utils.goShareOrderFoodToWeChat(context, | ||
| 380 | - rid: widget.rid, | ||
| 381 | - title: '菜品已点好,快来看看都点了什么~', | ||
| 382 | - img: | ||
| 383 | - 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg'); | ||
| 384 | - }, | ||
| 385 | - ) | ||
| 386 | - ], | ||
| 387 | - ), | ||
| 388 | - ); | 394 | + return true; |
| 389 | } | 395 | } |
| 390 | - }, | ||
| 391 | - ), | ||
| 392 | - ); | 396 | + Navigator.of(context).pop(); |
| 397 | + return true; | ||
| 398 | + })); | ||
| 393 | } | 399 | } |
| 394 | } | 400 | } |
| @@ -48,19 +48,18 @@ class MessageOrderPageState extends State<MessageOrderPage> { | @@ -48,19 +48,18 @@ class MessageOrderPageState extends State<MessageOrderPage> { | ||
| 48 | setState(() { | 48 | setState(() { |
| 49 | messageModel.pageState = PageState.Loading; | 49 | messageModel.pageState = PageState.Loading; |
| 50 | }); | 50 | }); |
| 51 | - | ||
| 52 | }); | 51 | }); |
| 53 | //从列表数据本地移除提前点餐消息 | 52 | //从列表数据本地移除提前点餐消息 |
| 54 | - bus.on("remove_untreated_message_order", (args) { | ||
| 55 | - messageModel.removeUntreatedMessageByMid(args.toString()); | ||
| 56 | - messageDialogModel.removeMessage(args.toString()); | ||
| 57 | - }); | 53 | + // bus.on("remove_untreated_message_order", (args) { |
| 54 | + // messageModel.removeUntreatedMessageByMid(args.toString()); | ||
| 55 | + // messageDialogModel.removeMessage(args.toString()); | ||
| 56 | + // }); | ||
| 58 | } | 57 | } |
| 59 | 58 | ||
| 60 | @override | 59 | @override |
| 61 | void dispose() { | 60 | void dispose() { |
| 62 | super.dispose(); | 61 | super.dispose(); |
| 63 | - bus.off("remove_untreated_message_order"); | 62 | + // bus.off("remove_untreated_message_order"); |
| 64 | } | 63 | } |
| 65 | 64 | ||
| 66 | //三种分类各自的未读消息数目 | 65 | //三种分类各自的未读消息数目 |
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | ||
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | import 'package:one_key/constant/state.dart'; | 3 | import 'package:one_key/constant/state.dart'; |
| 4 | import 'package:one_key/pages/message/message_online_check_page.dart'; | 4 | import 'package:one_key/pages/message/message_online_check_page.dart'; |
| 5 | +import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 5 | import 'package:one_key/provider/message_model.dart'; | 6 | import 'package:one_key/provider/message_model.dart'; |
| 6 | import 'package:one_key/provider/user_model.dart'; | 7 | import 'package:one_key/provider/user_model.dart'; |
| 7 | import 'package:one_key/res/colors.dart'; | 8 | import 'package:one_key/res/colors.dart'; |
| @@ -32,6 +33,7 @@ class MessagePageState extends State<MessagePage> | @@ -32,6 +33,7 @@ class MessagePageState extends State<MessagePage> | ||
| 32 | 33 | ||
| 33 | MessageModel messageModel; | 34 | MessageModel messageModel; |
| 34 | UserModel userModel; | 35 | UserModel userModel; |
| 36 | + MessageDialogModel messageDialogModel; | ||
| 35 | 37 | ||
| 36 | @override | 38 | @override |
| 37 | void initState() { | 39 | void initState() { |
| @@ -50,6 +52,11 @@ class MessagePageState extends State<MessagePage> | @@ -50,6 +52,11 @@ class MessagePageState extends State<MessagePage> | ||
| 50 | bus.on("refresh_untreated_num", (arg) { | 52 | bus.on("refresh_untreated_num", (arg) { |
| 51 | _getUnMsgNum(); | 53 | _getUnMsgNum(); |
| 52 | }); | 54 | }); |
| 55 | + //移除在线预订消息 | ||
| 56 | + bus.on("remove_untreated_message", (args) { | ||
| 57 | + messageModel.removeUntreatedMessageByMid(args.toString()); | ||
| 58 | + messageDialogModel.removeMessage(args.toString()); | ||
| 59 | + }); | ||
| 53 | } | 60 | } |
| 54 | 61 | ||
| 55 | //三种分类各自的未读消息数目 | 62 | //三种分类各自的未读消息数目 |
| @@ -83,6 +90,8 @@ class MessagePageState extends State<MessagePage> | @@ -83,6 +90,8 @@ class MessagePageState extends State<MessagePage> | ||
| 83 | Widget build(BuildContext context) { | 90 | Widget build(BuildContext context) { |
| 84 | messageModel = Provider.of<MessageModel>(context, listen: true); | 91 | messageModel = Provider.of<MessageModel>(context, listen: true); |
| 85 | userModel = Provider.of<UserModel>(context, listen: false); | 92 | userModel = Provider.of<UserModel>(context, listen: false); |
| 93 | + messageDialogModel = | ||
| 94 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 86 | return Container( | 95 | return Container( |
| 87 | width: double.infinity, | 96 | width: double.infinity, |
| 88 | height: double.infinity, | 97 | height: double.infinity, |
| @@ -222,5 +231,6 @@ class MessagePageState extends State<MessagePage> | @@ -222,5 +231,6 @@ class MessagePageState extends State<MessagePage> | ||
| 222 | // TODO: implement dispose | 231 | // TODO: implement dispose |
| 223 | super.dispose(); | 232 | super.dispose(); |
| 224 | bus.off("refresh_untreated_num"); | 233 | bus.off("refresh_untreated_num"); |
| 234 | + bus.off("remove_untreated_message"); | ||
| 225 | } | 235 | } |
| 226 | } | 236 | } |
| @@ -14,8 +14,7 @@ import 'package:provider/provider.dart'; | @@ -14,8 +14,7 @@ import 'package:provider/provider.dart'; | ||
| 14 | class MessageItem extends StatelessWidget { | 14 | class MessageItem extends StatelessWidget { |
| 15 | final Message message; | 15 | final Message message; |
| 16 | final bool isTreated; | 16 | final bool isTreated; |
| 17 | - final VoidCallback callback; | ||
| 18 | - MessageItem(this.message, {this.isTreated = false, this.callback}); | 17 | + MessageItem(this.message, {this.isTreated = false}); |
| 19 | 18 | ||
| 20 | @override | 19 | @override |
| 21 | Widget build(BuildContext context) { | 20 | Widget build(BuildContext context) { |
| @@ -80,7 +79,7 @@ class MessageItem extends StatelessWidget { | @@ -80,7 +79,7 @@ class MessageItem extends StatelessWidget { | ||
| 80 | child: Stack( | 79 | child: Stack( |
| 81 | children: <Widget>[ | 80 | children: <Widget>[ |
| 82 | Container( | 81 | Container( |
| 83 | - height: ScreenUtil().setWidth(290), | 82 | + // height: ScreenUtil().setWidth(290), |
| 84 | margin: EdgeInsets.symmetric( | 83 | margin: EdgeInsets.symmetric( |
| 85 | horizontal: ScreenUtil().setWidth(39), | 84 | horizontal: ScreenUtil().setWidth(39), |
| 86 | vertical: ScreenUtil().setWidth(12)), | 85 | vertical: ScreenUtil().setWidth(12)), |
| @@ -134,7 +133,7 @@ class MessageItem extends StatelessWidget { | @@ -134,7 +133,7 @@ class MessageItem extends StatelessWidget { | ||
| 134 | ), | 133 | ), |
| 135 | VEmptyView(10), | 134 | VEmptyView(10), |
| 136 | Text( | 135 | Text( |
| 137 | - "${subTitleTextSec}:${message.message_type != '12' ? message.ddateStr : message.cdateStr}", | 136 | + "${subTitleTextSec}:${(message.message_type != '12' && message.message_type != '13' && message.message_type != '14') ? message.ddateStr : message.cdateStr}", |
| 138 | style: TextStyle( | 137 | style: TextStyle( |
| 139 | color: textColor, | 138 | color: textColor, |
| 140 | fontSize: ScreenUtil().setSp(28)), | 139 | fontSize: ScreenUtil().setSp(28)), |
| @@ -147,7 +146,8 @@ class MessageItem extends StatelessWidget { | @@ -147,7 +146,8 @@ class MessageItem extends StatelessWidget { | ||
| 147 | fontSize: ScreenUtil().setSp(28)), | 146 | fontSize: ScreenUtil().setSp(28)), |
| 148 | ), | 147 | ), |
| 149 | ], | 148 | ], |
| 150 | - ) | 149 | + ), |
| 150 | + message.message_type == "11" ? VEmptyView(80) : VEmptyView(0) | ||
| 151 | ], | 151 | ], |
| 152 | ), | 152 | ), |
| 153 | ), | 153 | ), |
| @@ -192,7 +192,7 @@ class MessageItem extends StatelessWidget { | @@ -192,7 +192,7 @@ class MessageItem extends StatelessWidget { | ||
| 192 | //提前点餐 | 192 | //提前点餐 |
| 193 | NavigatorUtil.goHasOrderFoodPage(context, | 193 | NavigatorUtil.goHasOrderFoodPage(context, |
| 194 | rid: message.rid); | 194 | rid: message.rid); |
| 195 | - bus.emit("remove_untreated_message_order", message.id); | 195 | + bus.emit("remove_untreated_message", message.id); |
| 196 | 196 | ||
| 197 | Map<String, String> params = { | 197 | Map<String, String> params = { |
| 198 | "sid": Provider.of<UserModel>(context, listen: false) | 198 | "sid": Provider.of<UserModel>(context, listen: false) |
| @@ -11,9 +11,12 @@ import 'package:one_key/pages/online_check/progress.dart'; | @@ -11,9 +11,12 @@ import 'package:one_key/pages/online_check/progress.dart'; | ||
| 11 | 11 | ||
| 12 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 12 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 13 | import 'package:one_key/res/colors.dart'; | 13 | import 'package:one_key/res/colors.dart'; |
| 14 | +import 'package:one_key/utils/dialog_util.dart'; | ||
| 15 | +import 'package:one_key/utils/misc.dart'; | ||
| 14 | import 'package:one_key/utils/utils.dart'; | 16 | import 'package:one_key/utils/utils.dart'; |
| 15 | import 'package:one_key/widgets/MyDivider.dart'; | 17 | import 'package:one_key/widgets/MyDivider.dart'; |
| 16 | import 'package:one_key/widgets/v_empty_view.dart'; | 18 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 19 | +import 'package:permission_handler/permission_handler.dart'; | ||
| 17 | import 'package:photo/photo.dart'; | 20 | import 'package:photo/photo.dart'; |
| 18 | import 'package:provider/provider.dart'; | 21 | import 'package:provider/provider.dart'; |
| 19 | 22 | ||
| @@ -258,8 +261,10 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -258,8 +261,10 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 258 | children: <Widget>[ | 261 | children: <Widget>[ |
| 259 | InkWell( | 262 | InkWell( |
| 260 | onTap: () { | 263 | onTap: () { |
| 261 | - _getFromPictureOrCamera(ImageSource.camera); | ||
| 262 | - Navigator.pop(context); | 264 | + _getPickPermission(() { |
| 265 | + _getFromPictureOrCamera(ImageSource.camera); | ||
| 266 | + Navigator.pop(context); | ||
| 267 | + }, PermissionGroup.camera); | ||
| 263 | }, | 268 | }, |
| 264 | child: Container( | 269 | child: Container( |
| 265 | width: double.infinity, | 270 | width: double.infinity, |
| @@ -281,9 +286,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -281,9 +286,11 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 281 | ), | 286 | ), |
| 282 | InkWell( | 287 | InkWell( |
| 283 | onTap: () { | 288 | onTap: () { |
| 284 | - pickAsset(PickType.onlyImage); | ||
| 285 | - // _getFromPictureOrCamera(ImageSource.gallery); | ||
| 286 | - Navigator.pop(context); | 289 | + _getPickPermission(() { |
| 290 | + pickAsset(PickType.onlyImage); | ||
| 291 | + // _getFromPictureOrCamera(ImageSource.gallery); | ||
| 292 | + Navigator.pop(context); | ||
| 293 | + }, PermissionGroup.photos); | ||
| 287 | }, | 294 | }, |
| 288 | child: Container( | 295 | child: Container( |
| 289 | width: double.infinity, | 296 | width: double.infinity, |
| @@ -325,6 +332,45 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -325,6 +332,45 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 325 | }); | 332 | }); |
| 326 | } | 333 | } |
| 327 | 334 | ||
| 335 | + ///检测是否有相机或者相册权限 | ||
| 336 | + _getPickPermission( | ||
| 337 | + VoidCallback callback, PermissionGroup permissionGroup) async { | ||
| 338 | + if (!(await checkPermission(permissionGroup))) { | ||
| 339 | + String title = '相册'; | ||
| 340 | + if (permissionGroup == PermissionGroup.camera) { | ||
| 341 | + title = '相机'; | ||
| 342 | + } | ||
| 343 | + PermissionStatus status = await permissionStatus(permissionGroup); | ||
| 344 | + if (status == PermissionStatus.neverAskAgain) { | ||
| 345 | + //用户选择不在弹出权限提示框 | ||
| 346 | + print('never'); | ||
| 347 | + Navigator.pop(context); | ||
| 348 | + DialogUtil.openAlertDialog( | ||
| 349 | + context, '未获得${title}权限', "请在手机的权限管理里,将${title}权限开启", '去设置', 340.0, | ||
| 350 | + onTap: () { | ||
| 351 | + openSetting(); | ||
| 352 | + Navigator.pop(context, ''); | ||
| 353 | + }); | ||
| 354 | + } else { | ||
| 355 | + // 申请权限 | ||
| 356 | + bool canContacts = await requestPermission(permissionGroup); | ||
| 357 | + if (canContacts) { | ||
| 358 | + callback(); | ||
| 359 | + } else { | ||
| 360 | + Navigator.pop(context); | ||
| 361 | + //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处 | ||
| 362 | + DialogUtil.openAlertDialog(context, '未获得${title}权限', | ||
| 363 | + "请在手机的权限管理里,将${title}权限开启。", '去设置', 340.0, onTap: () { | ||
| 364 | + openSetting(); | ||
| 365 | + Navigator.pop(context, ''); | ||
| 366 | + }); | ||
| 367 | + } | ||
| 368 | + } | ||
| 369 | + } else { | ||
| 370 | + callback(); | ||
| 371 | + } | ||
| 372 | + } | ||
| 373 | + | ||
| 328 | //查看大图 | 374 | //查看大图 |
| 329 | _showPhotoView(BuildContext context, int index, List imgs, | 375 | _showPhotoView(BuildContext context, int index, List imgs, |
| 330 | {isShow = false, List dashName}) async { | 376 | {isShow = false, List dashName}) async { |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | +import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 3 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 4 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 4 | import 'package:one_key/provider/order_food_provider.dart'; | 5 | import 'package:one_key/provider/order_food_provider.dart'; |
| 5 | import 'package:one_key/provider/user_model.dart'; | 6 | import 'package:one_key/provider/user_model.dart'; |
| 6 | import 'package:one_key/res/colors.dart'; | 7 | import 'package:one_key/res/colors.dart'; |
| 8 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 7 | import 'package:one_key/utils/navigator_util.dart'; | 9 | import 'package:one_key/utils/navigator_util.dart'; |
| 8 | import 'package:one_key/utils/utils.dart'; | 10 | import 'package:one_key/utils/utils.dart'; |
| 9 | import 'package:one_key/widgets/h_empty_view.dart'; | 11 | import 'package:one_key/widgets/h_empty_view.dart'; |
| @@ -29,11 +31,28 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | @@ -29,11 +31,28 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | ||
| 29 | void initState() { | 31 | void initState() { |
| 30 | super.initState(); | 32 | super.initState(); |
| 31 | WidgetsBinding.instance.addPostFrameCallback((_) { | 33 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 34 | + if (widget.fromNotify) { | ||
| 35 | + _setMessageStatus(); | ||
| 36 | + } | ||
| 32 | _getTableInfoData(); | 37 | _getTableInfoData(); |
| 33 | _getOrderInfo(); | 38 | _getOrderInfo(); |
| 34 | }); | 39 | }); |
| 35 | } | 40 | } |
| 36 | 41 | ||
| 42 | + _setMessageStatus() { | ||
| 43 | + Future.delayed(Duration(milliseconds: 200), () async { | ||
| 44 | + Map<String, String> params = { | ||
| 45 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 46 | + "id": widget.rid, | ||
| 47 | + "status": "is_read" | ||
| 48 | + }; | ||
| 49 | + MessageDialogModel messageDialogModel = | ||
| 50 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 51 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 52 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 53 | + }); | ||
| 54 | + } | ||
| 55 | + | ||
| 37 | ///获取订单详情 | 56 | ///获取订单详情 |
| 38 | _getOrderInfo() async { | 57 | _getOrderInfo() async { |
| 39 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 58 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| @@ -95,7 +114,6 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | @@ -95,7 +114,6 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | ||
| 95 | } | 114 | } |
| 96 | } | 115 | } |
| 97 | return Container( | 116 | return Container( |
| 98 | - height: ScreenUtil().setWidth(57 * 2), | ||
| 99 | decoration: BoxDecoration( | 117 | decoration: BoxDecoration( |
| 100 | color: Colors.white, | 118 | color: Colors.white, |
| 101 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), | 119 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), |
| @@ -148,6 +166,7 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | @@ -148,6 +166,7 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | ||
| 148 | Offstage( | 166 | Offstage( |
| 149 | offstage: arrowStatus, | 167 | offstage: arrowStatus, |
| 150 | child: Column( | 168 | child: Column( |
| 169 | + mainAxisSize: MainAxisSize.min, | ||
| 151 | crossAxisAlignment: CrossAxisAlignment.start, | 170 | crossAxisAlignment: CrossAxisAlignment.start, |
| 152 | children: [ | 171 | children: [ |
| 153 | VEmptyView(14), | 172 | VEmptyView(14), |
| @@ -415,15 +434,18 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | @@ -415,15 +434,18 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | ||
| 415 | style: TextStyle( | 434 | style: TextStyle( |
| 416 | fontSize: ScreenUtil().setSp(28), color: MyColours.color_707070), | 435 | fontSize: ScreenUtil().setSp(28), color: MyColours.color_707070), |
| 417 | ), | 436 | ), |
| 418 | - HEmptyView(176), | ||
| 419 | - Text( | 437 | + HEmptyView(60), |
| 438 | + Expanded( | ||
| 439 | + child: Text( | ||
| 420 | subTitle, | 440 | subTitle, |
| 421 | maxLines: 3, | 441 | maxLines: 3, |
| 442 | + overflow: TextOverflow.ellipsis, | ||
| 443 | + textAlign: TextAlign.right, | ||
| 422 | style: TextStyle( | 444 | style: TextStyle( |
| 423 | fontSize: ScreenUtil().setSp(28), | 445 | fontSize: ScreenUtil().setSp(28), |
| 424 | color: MyColours.color_707070, | 446 | color: MyColours.color_707070, |
| 425 | fontWeight: FontWeight.bold), | 447 | fontWeight: FontWeight.bold), |
| 426 | - ) | 448 | + )) |
| 427 | ], | 449 | ], |
| 428 | ); | 450 | ); |
| 429 | } | 451 | } |
| @@ -445,15 +467,24 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | @@ -445,15 +467,24 @@ class _InvoiceDetailPageState extends State<InvoiceDetailPage> { | ||
| 445 | } | 467 | } |
| 446 | }, | 468 | }, |
| 447 | ), | 469 | ), |
| 448 | - body: SingleChildScrollView( | ||
| 449 | - child: Padding( | ||
| 450 | - padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 451 | - child: Column(children: [ | ||
| 452 | - _tableInfoWidget(), | ||
| 453 | - VEmptyView(20), | ||
| 454 | - _invoiceInfoWidget(), | ||
| 455 | - VEmptyView(20), | ||
| 456 | - _customInfoWidget() | ||
| 457 | - ])))); | 470 | + body: WillPopScope( |
| 471 | + child: SingleChildScrollView( | ||
| 472 | + child: Padding( | ||
| 473 | + padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 474 | + child: Column(children: [ | ||
| 475 | + _tableInfoWidget(), | ||
| 476 | + VEmptyView(20), | ||
| 477 | + _invoiceInfoWidget(), | ||
| 478 | + VEmptyView(20), | ||
| 479 | + _customInfoWidget() | ||
| 480 | + ]))), | ||
| 481 | + onWillPop: () async { | ||
| 482 | + if (widget.fromNotify) { | ||
| 483 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 484 | + return true; | ||
| 485 | + } | ||
| 486 | + Navigator.of(context).pop(); | ||
| 487 | + return true; | ||
| 488 | + })); | ||
| 458 | } | 489 | } |
| 459 | } | 490 | } |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/screenutil.dart'; | 2 | import 'package:flutter_screenutil/screenutil.dart'; |
| 3 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | 3 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; |
| 4 | +import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 4 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 5 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 5 | import 'package:one_key/provider/order_food_provider.dart'; | 6 | import 'package:one_key/provider/order_food_provider.dart'; |
| 6 | import 'package:one_key/provider/user_model.dart'; | 7 | import 'package:one_key/provider/user_model.dart'; |
| 7 | import 'package:one_key/res/colors.dart'; | 8 | import 'package:one_key/res/colors.dart'; |
| 9 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 8 | import 'package:one_key/utils/navigator_util.dart'; | 10 | import 'package:one_key/utils/navigator_util.dart'; |
| 9 | import 'package:one_key/utils/utils.dart'; | 11 | import 'package:one_key/utils/utils.dart'; |
| 10 | import 'package:one_key/widgets/h_empty_view.dart'; | 12 | import 'package:one_key/widgets/h_empty_view.dart'; |
| @@ -30,6 +32,9 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | @@ -30,6 +32,9 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | ||
| 30 | void initState() { | 32 | void initState() { |
| 31 | super.initState(); | 33 | super.initState(); |
| 32 | WidgetsBinding.instance.addPostFrameCallback((_) { | 34 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 35 | + if (widget.fromNotify) { | ||
| 36 | + _setMessageStatus(); | ||
| 37 | + } | ||
| 33 | _getQiniuInfo(); | 38 | _getQiniuInfo(); |
| 34 | _getTableInfoData(); | 39 | _getTableInfoData(); |
| 35 | _getOrderInfo(); | 40 | _getOrderInfo(); |
| @@ -43,6 +48,20 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | @@ -43,6 +48,20 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | ||
| 43 | super.dispose(); | 48 | super.dispose(); |
| 44 | } | 49 | } |
| 45 | 50 | ||
| 51 | + _setMessageStatus() { | ||
| 52 | + Future.delayed(Duration(milliseconds: 200), () async { | ||
| 53 | + Map<String, String> params = { | ||
| 54 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 55 | + "id": widget.rid, | ||
| 56 | + "status": "is_read" | ||
| 57 | + }; | ||
| 58 | + MessageDialogModel messageDialogModel = | ||
| 59 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 60 | + await messageDialogModel.setMessageStatus(context, params); | ||
| 61 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 62 | + }); | ||
| 63 | + } | ||
| 64 | + | ||
| 46 | ///获取七牛云token | 65 | ///获取七牛云token |
| 47 | /// | 66 | /// |
| 48 | _getQiniuInfo() async { | 67 | _getQiniuInfo() async { |
| @@ -544,36 +563,46 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | @@ -544,36 +563,46 @@ class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> { | ||
| 544 | Provider.of<OnlineCheckEditProvider>(context, listen: true); | 563 | Provider.of<OnlineCheckEditProvider>(context, listen: true); |
| 545 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); | 564 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); |
| 546 | return Scaffold( | 565 | return Scaffold( |
| 547 | - backgroundColor: MyColours.color_f5f5f5, | ||
| 548 | - appBar: SystemAppBar( | ||
| 549 | - '买单申请详情', | ||
| 550 | - onTap: () { | ||
| 551 | - if (widget.fromNotify) { | ||
| 552 | - NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 553 | - } else { | ||
| 554 | - Navigator.of(context).pop(); | ||
| 555 | - } | ||
| 556 | - }, | ||
| 557 | - ), | ||
| 558 | - body: SingleChildScrollView( | ||
| 559 | - child: Padding( | ||
| 560 | - padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 561 | - child: Column( | ||
| 562 | - children: [ | ||
| 563 | - _consumptionInfoWidget(), | ||
| 564 | - VEmptyView(20), | ||
| 565 | - _customerInfoWidget(), | ||
| 566 | - VEmptyView(20), | ||
| 567 | - Offstage( | ||
| 568 | - offstage: _onlineCheckEditProvider.orderInfoSunModel != null | ||
| 569 | - ? _onlineCheckEditProvider.orderInfoSunModel.status == '2' | ||
| 570 | - : true, | ||
| 571 | - child: _orderInfoWidget(), | ||
| 572 | - ) | ||
| 573 | - ], | ||
| 574 | - ), | 566 | + backgroundColor: MyColours.color_f5f5f5, |
| 567 | + appBar: SystemAppBar( | ||
| 568 | + '买单申请详情', | ||
| 569 | + onTap: () { | ||
| 570 | + if (widget.fromNotify) { | ||
| 571 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 572 | + } else { | ||
| 573 | + Navigator.of(context).pop(); | ||
| 574 | + } | ||
| 575 | + }, | ||
| 575 | ), | 576 | ), |
| 576 | - ), | ||
| 577 | - ); | 577 | + body: WillPopScope( |
| 578 | + child: SingleChildScrollView( | ||
| 579 | + child: Padding( | ||
| 580 | + padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 581 | + child: Column( | ||
| 582 | + children: [ | ||
| 583 | + _consumptionInfoWidget(), | ||
| 584 | + VEmptyView(20), | ||
| 585 | + _customerInfoWidget(), | ||
| 586 | + VEmptyView(20), | ||
| 587 | + Offstage( | ||
| 588 | + offstage: _onlineCheckEditProvider.orderInfoSunModel != | ||
| 589 | + null | ||
| 590 | + ? _onlineCheckEditProvider.orderInfoSunModel.status == | ||
| 591 | + '2' | ||
| 592 | + : true, | ||
| 593 | + child: _orderInfoWidget(), | ||
| 594 | + ) | ||
| 595 | + ], | ||
| 596 | + ), | ||
| 597 | + ), | ||
| 598 | + ), | ||
| 599 | + onWillPop: () async { | ||
| 600 | + if (widget.fromNotify) { | ||
| 601 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 602 | + return true; | ||
| 603 | + } | ||
| 604 | + Navigator.of(context).pop(); | ||
| 605 | + return true; | ||
| 606 | + })); | ||
| 578 | } | 607 | } |
| 579 | } | 608 | } |
| @@ -3,6 +3,7 @@ import 'dart:convert'; | @@ -3,6 +3,7 @@ import 'dart:convert'; | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | import 'package:flutter_screenutil/screenutil.dart'; | 4 | import 'package:flutter_screenutil/screenutil.dart'; |
| 5 | import 'package:one_key/pages/online_check/img_picker_widget.dart'; | 5 | import 'package:one_key/pages/online_check/img_picker_widget.dart'; |
| 6 | +import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 6 | import 'package:one_key/provider/notebook_detail_model.dart'; | 7 | import 'package:one_key/provider/notebook_detail_model.dart'; |
| 7 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 8 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 8 | import 'package:one_key/provider/order_food_provider.dart'; | 9 | import 'package:one_key/provider/order_food_provider.dart'; |
| @@ -102,6 +103,16 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -102,6 +103,16 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 102 | 103 | ||
| 103 | ///商家确认账单操作 | 104 | ///商家确认账单操作 |
| 104 | _updateOrderInfo() async { | 105 | _updateOrderInfo() async { |
| 106 | + bus.emit("remove_untreated_message", widget.mid); | ||
| 107 | + MessageDialogModel messageDialogModel = | ||
| 108 | + Provider.of<MessageDialogModel>(context, listen: false); | ||
| 109 | + Map<String, String> paramsSetMessageStatus = { | ||
| 110 | + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 111 | + "id": widget.mid, | ||
| 112 | + "status": "is_handle" | ||
| 113 | + }; | ||
| 114 | + await messageDialogModel.setMessageStatus(context, paramsSetMessageStatus); | ||
| 115 | + bus.emit("refresh_untreated_num"); //刷新未读消息数目 | ||
| 105 | String price = _editingController.text; | 116 | String price = _editingController.text; |
| 106 | if (_editingController.text.startsWith('¥')) { | 117 | if (_editingController.text.startsWith('¥')) { |
| 107 | price = _editingController.text | 118 | price = _editingController.text |
| @@ -488,97 +499,115 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | @@ -488,97 +499,115 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { | ||
| 488 | Provider.of<OnlineCheckEditProvider>(context, listen: true); | 499 | Provider.of<OnlineCheckEditProvider>(context, listen: true); |
| 489 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); | 500 | _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); |
| 490 | return Scaffold( | 501 | return Scaffold( |
| 491 | - backgroundColor: MyColours.color_f5f5f5, | ||
| 492 | - appBar: SystemAppBar( | ||
| 493 | - '提前买单', | ||
| 494 | - onTap: () { | ||
| 495 | - if (widget.fromNotify) { | ||
| 496 | - NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 497 | - } else { | ||
| 498 | - Navigator.of(context).pop(); | ||
| 499 | - } | ||
| 500 | - }, | ||
| 501 | - ), | ||
| 502 | - body: InkWell( | ||
| 503 | - onTap: () { | ||
| 504 | - _focusNode.unfocus(); | ||
| 505 | - }, | ||
| 506 | - child: Padding( | ||
| 507 | - padding: | ||
| 508 | - EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)), | ||
| 509 | - child: Column( | ||
| 510 | - children: [ | ||
| 511 | - Expanded( | ||
| 512 | - child: SingleChildScrollView( | ||
| 513 | - controller: _scrollController, | ||
| 514 | - child: Column( | ||
| 515 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 516 | - children: [ | ||
| 517 | - VEmptyView(40), | ||
| 518 | - //图标 | ||
| 519 | - _getLogoWidget(), | ||
| 520 | - VEmptyView(40), | ||
| 521 | - _getTabAndMoneyInfoWidget(), | ||
| 522 | - VEmptyView(10), | ||
| 523 | - // 备注信息 | ||
| 524 | - Offstage( | ||
| 525 | - offstage: | ||
| 526 | - _onlineCheckEditProvider.orderInfoSunModel != | ||
| 527 | - null | ||
| 528 | - ? _onlineCheckEditProvider | ||
| 529 | - .orderInfoSunModel.orderRemark == | ||
| 530 | - '' | ||
| 531 | - : true, | ||
| 532 | - child: Container( | ||
| 533 | - padding: EdgeInsets.symmetric( | ||
| 534 | - horizontal: ScreenUtil().setWidth(20)), | ||
| 535 | - child: Text( | ||
| 536 | - _onlineCheckEditProvider.orderInfoSunModel != | ||
| 537 | - null | ||
| 538 | - ? _onlineCheckEditProvider | ||
| 539 | - .orderInfoSunModel.orderRemark | ||
| 540 | - : '', | ||
| 541 | - style: TextStyle( | ||
| 542 | - fontSize: ScreenUtil().setSp(28), | ||
| 543 | - color: MyColours.color_FD5656), | ||
| 544 | - ), | ||
| 545 | - ), | ||
| 546 | - ), | ||
| 547 | - VEmptyView(20), | ||
| 548 | - ImgPickerWidget( | ||
| 549 | - scrollController: _scrollController), | ||
| 550 | - VEmptyView(20), | ||
| 551 | - _customInfoWidget() | ||
| 552 | - ], | ||
| 553 | - ))), | ||
| 554 | - Padding( | ||
| 555 | - padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(16), 0, | ||
| 556 | - ScreenUtil().setWidth(16), ScreenUtil().setWidth(40)), | ||
| 557 | - child: CommonButton( | ||
| 558 | - width: double.infinity, | ||
| 559 | - height: 84, | ||
| 560 | - fontSize: 34, | ||
| 561 | - content: '发送给顾客', | ||
| 562 | - state: btnState, | ||
| 563 | - onPress: () async { | ||
| 564 | - if (_editingController.text.startsWith('¥') && | ||
| 565 | - _editingController.text.length == 1) { | ||
| 566 | - Utils.showToast('请输入金额'); | ||
| 567 | - setState(() { | ||
| 568 | - btnState = -1; | ||
| 569 | - }); | ||
| 570 | - return; | ||
| 571 | - } | ||
| 572 | - DialogUtil.confirmDialog( | ||
| 573 | - context, _editingController.text, 426, onTap: () { | ||
| 574 | - Navigator.pop(context); | ||
| 575 | - _updateOrderInfo(); | ||
| 576 | - }); | ||
| 577 | - }, | ||
| 578 | - )) | ||
| 579 | - ], | ||
| 580 | - )), | ||
| 581 | - ), | ||
| 582 | - ); | 502 | + backgroundColor: MyColours.color_f5f5f5, |
| 503 | + appBar: SystemAppBar( | ||
| 504 | + '提前买单', | ||
| 505 | + onTap: () { | ||
| 506 | + if (widget.fromNotify) { | ||
| 507 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 508 | + } else { | ||
| 509 | + Navigator.of(context).pop(); | ||
| 510 | + } | ||
| 511 | + }, | ||
| 512 | + ), | ||
| 513 | + body: WillPopScope( | ||
| 514 | + child: InkWell( | ||
| 515 | + onTap: () { | ||
| 516 | + _focusNode.unfocus(); | ||
| 517 | + }, | ||
| 518 | + child: Padding( | ||
| 519 | + padding: EdgeInsets.symmetric( | ||
| 520 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 521 | + child: Column( | ||
| 522 | + children: [ | ||
| 523 | + Expanded( | ||
| 524 | + child: SingleChildScrollView( | ||
| 525 | + controller: _scrollController, | ||
| 526 | + child: Column( | ||
| 527 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 528 | + children: [ | ||
| 529 | + VEmptyView(40), | ||
| 530 | + //图标 | ||
| 531 | + _getLogoWidget(), | ||
| 532 | + VEmptyView(40), | ||
| 533 | + _getTabAndMoneyInfoWidget(), | ||
| 534 | + VEmptyView(10), | ||
| 535 | + // 备注信息 | ||
| 536 | + Offstage( | ||
| 537 | + offstage: _onlineCheckEditProvider | ||
| 538 | + .orderInfoSunModel != | ||
| 539 | + null | ||
| 540 | + ? _onlineCheckEditProvider | ||
| 541 | + .orderInfoSunModel | ||
| 542 | + .orderRemark == | ||
| 543 | + '' | ||
| 544 | + : true, | ||
| 545 | + child: Container( | ||
| 546 | + padding: EdgeInsets.symmetric( | ||
| 547 | + horizontal: | ||
| 548 | + ScreenUtil().setWidth(20)), | ||
| 549 | + child: Text( | ||
| 550 | + _onlineCheckEditProvider | ||
| 551 | + .orderInfoSunModel != | ||
| 552 | + null | ||
| 553 | + ? _onlineCheckEditProvider | ||
| 554 | + .orderInfoSunModel.orderRemark | ||
| 555 | + : '', | ||
| 556 | + style: TextStyle( | ||
| 557 | + fontSize: ScreenUtil().setSp(28), | ||
| 558 | + color: MyColours.color_FD5656), | ||
| 559 | + ), | ||
| 560 | + ), | ||
| 561 | + ), | ||
| 562 | + VEmptyView(20), | ||
| 563 | + ImgPickerWidget( | ||
| 564 | + scrollController: _scrollController), | ||
| 565 | + VEmptyView(20), | ||
| 566 | + _customInfoWidget() | ||
| 567 | + ], | ||
| 568 | + ))), | ||
| 569 | + Padding( | ||
| 570 | + padding: EdgeInsets.fromLTRB( | ||
| 571 | + ScreenUtil().setWidth(16), | ||
| 572 | + 0, | ||
| 573 | + ScreenUtil().setWidth(16), | ||
| 574 | + ScreenUtil().setWidth(40)), | ||
| 575 | + child: CommonButton( | ||
| 576 | + width: double.infinity, | ||
| 577 | + height: 84, | ||
| 578 | + fontSize: 34, | ||
| 579 | + content: '发送给顾客', | ||
| 580 | + state: btnState, | ||
| 581 | + onPress: () async { | ||
| 582 | + if (btnState == 1) { | ||
| 583 | + _focusNode.unfocus(); | ||
| 584 | + if (_editingController.text.startsWith('¥') && | ||
| 585 | + _editingController.text.length == 1) { | ||
| 586 | + Utils.showToast('请输入金额'); | ||
| 587 | + setState(() { | ||
| 588 | + btnState = -1; | ||
| 589 | + }); | ||
| 590 | + return; | ||
| 591 | + } | ||
| 592 | + DialogUtil.confirmDialog( | ||
| 593 | + context, _editingController.text, 438, | ||
| 594 | + onTap: () { | ||
| 595 | + Navigator.pop(context); | ||
| 596 | + _updateOrderInfo(); | ||
| 597 | + }); | ||
| 598 | + } | ||
| 599 | + }, | ||
| 600 | + )) | ||
| 601 | + ], | ||
| 602 | + )), | ||
| 603 | + ), | ||
| 604 | + onWillPop: () async { | ||
| 605 | + if (widget.fromNotify) { | ||
| 606 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 607 | + return true; | ||
| 608 | + } | ||
| 609 | + Navigator.of(context).pop(); | ||
| 610 | + return true; | ||
| 611 | + })); | ||
| 583 | } | 612 | } |
| 584 | } | 613 | } |
| @@ -249,7 +249,7 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -249,7 +249,7 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 249 | } | 249 | } |
| 250 | }, | 250 | }, |
| 251 | canSelected: true, | 251 | canSelected: true, |
| 252 | - canChoose: widget.canChoose, | 252 | + fromPage: 'change', |
| 253 | tableMap: tableMap, | 253 | tableMap: tableMap, |
| 254 | rid: widget.rid); | 254 | rid: widget.rid); |
| 255 | }, | 255 | }, |
| @@ -20,8 +20,6 @@ import 'package:provider/provider.dart'; | @@ -20,8 +20,6 @@ import 'package:provider/provider.dart'; | ||
| 20 | import 'dart:convert' as convert; | 20 | import 'dart:convert' as convert; |
| 21 | 21 | ||
| 22 | class TableManagerPage extends StatefulWidget { | 22 | class TableManagerPage extends StatefulWidget { |
| 23 | - | ||
| 24 | - | ||
| 25 | @override | 23 | @override |
| 26 | State<StatefulWidget> createState() { | 24 | State<StatefulWidget> createState() { |
| 27 | // TODO: implement createState | 25 | // TODO: implement createState |
| @@ -30,7 +28,6 @@ class TableManagerPage extends StatefulWidget { | @@ -30,7 +28,6 @@ class TableManagerPage extends StatefulWidget { | ||
| 30 | } | 28 | } |
| 31 | 29 | ||
| 32 | class TableManagerPageState extends State<TableManagerPage> { | 30 | class TableManagerPageState extends State<TableManagerPage> { |
| 33 | - | ||
| 34 | TableManagerModel tableManagerModel; | 31 | TableManagerModel tableManagerModel; |
| 35 | 32 | ||
| 36 | @override | 33 | @override |
| @@ -38,10 +35,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -38,10 +35,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 38 | // TODO: implement initState | 35 | // TODO: implement initState |
| 39 | super.initState(); | 36 | super.initState(); |
| 40 | LogUtil.v("table_manager_page initState"); | 37 | LogUtil.v("table_manager_page initState"); |
| 41 | - tableManagerModel=Provider.of<TableManagerModel>(context,listen: false); | 38 | + tableManagerModel = Provider.of<TableManagerModel>(context, listen: false); |
| 42 | WidgetsBinding.instance.addPostFrameCallback((_) { | 39 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 43 | tableManagerModel.initTime(context); | 40 | tableManagerModel.initTime(context); |
| 44 | - EventBus().on("refresh_tablemanager", (arg) {//订座-完成预订 刷新管理桌位 | 41 | + EventBus().on("refresh_tablemanager", (arg) { |
| 42 | + //订座-完成预订 刷新管理桌位 | ||
| 45 | tableManagerModel.getReserveList(context); | 43 | tableManagerModel.getReserveList(context); |
| 46 | }); | 44 | }); |
| 47 | }); | 45 | }); |
| @@ -51,17 +49,15 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -51,17 +49,15 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 51 | Widget build(BuildContext context) { | 49 | Widget build(BuildContext context) { |
| 52 | return SafeArea( | 50 | return SafeArea( |
| 53 | child: Consumer<TableManagerModel>( | 51 | child: Consumer<TableManagerModel>( |
| 54 | - builder: (context,model,child){ | 52 | + builder: (context, model, child) { |
| 55 | return Column( | 53 | return Column( |
| 56 | children: <Widget>[ | 54 | children: <Widget>[ |
| 57 | - MyAppBar( | ||
| 58 | - "桌位", | ||
| 59 | - showBack: false | ||
| 60 | - ), | 55 | + MyAppBar("桌位", showBack: false), |
| 61 | Container( | 56 | Container( |
| 62 | color: MyColours.color_ffffff, | 57 | color: MyColours.color_ffffff, |
| 63 | width: double.infinity, | 58 | width: double.infinity, |
| 64 | - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(16)), | 59 | + padding: |
| 60 | + EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(16)), | ||
| 65 | child: Row( | 61 | child: Row( |
| 66 | crossAxisAlignment: CrossAxisAlignment.center, | 62 | crossAxisAlignment: CrossAxisAlignment.center, |
| 67 | children: <Widget>[ | 63 | children: <Widget>[ |
| @@ -69,10 +65,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -69,10 +65,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 69 | child: Center( | 65 | child: Center( |
| 70 | child: GestureDetector( | 66 | child: GestureDetector( |
| 71 | onTap: () { | 67 | onTap: () { |
| 72 | - DialogUtil.showCalendarDialog(context, tableManagerModel.dateTime) | 68 | + DialogUtil.showCalendarDialog( |
| 69 | + context, tableManagerModel.dateTime) | ||
| 73 | .then((day) { | 70 | .then((day) { |
| 74 | if (day != null) { | 71 | if (day != null) { |
| 75 | - tableManagerModel.createDateText(context,day); | 72 | + tableManagerModel.createDateText(context, day); |
| 76 | } | 73 | } |
| 77 | }); | 74 | }); |
| 78 | }, | 75 | }, |
| @@ -101,56 +98,77 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -101,56 +98,77 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 101 | crossAxisAlignment: CrossAxisAlignment.center, | 98 | crossAxisAlignment: CrossAxisAlignment.center, |
| 102 | children: <Widget>[ | 99 | children: <Widget>[ |
| 103 | Offstage( | 100 | Offstage( |
| 104 | - offstage: tableManagerModel.morning == "00:00-00:00" ? true : false, | 101 | + offstage: |
| 102 | + tableManagerModel.morning == "00:00-00:00" | ||
| 103 | + ? true | ||
| 104 | + : false, | ||
| 105 | child: Padding( | 105 | child: Padding( |
| 106 | padding: EdgeInsets.only( | 106 | padding: EdgeInsets.only( |
| 107 | right: ScreenUtil().setWidth(18)), | 107 | right: ScreenUtil().setWidth(18)), |
| 108 | child: CommonButton( | 108 | child: CommonButton( |
| 109 | content: "早市", | 109 | content: "早市", |
| 110 | - state: tableManagerModel.currTimeIndex == 1 ? 1 : 0, | 110 | + state: |
| 111 | + tableManagerModel.currTimeIndex == 1 | ||
| 112 | + ? 1 | ||
| 113 | + : 0, | ||
| 111 | width: 92, | 114 | width: 92, |
| 112 | height: 48, | 115 | height: 48, |
| 113 | fontSize: 32, | 116 | fontSize: 32, |
| 114 | onPress: () { | 117 | onPress: () { |
| 115 | - if (tableManagerModel.currTimeIndex == 1) return; | 118 | + if (tableManagerModel.currTimeIndex == |
| 119 | + 1) return; | ||
| 116 | tableManagerModel.currTimeIndex = 1; | 120 | tableManagerModel.currTimeIndex = 1; |
| 117 | - tableManagerModel.getReserveList(context); | 121 | + tableManagerModel |
| 122 | + .getReserveList(context); | ||
| 118 | }, | 123 | }, |
| 119 | ))), | 124 | ))), |
| 120 | Offstage( | 125 | Offstage( |
| 121 | - offstage: tableManagerModel.noon == "00:00-00:00" ? true : false, | 126 | + offstage: |
| 127 | + tableManagerModel.noon == "00:00-00:00" | ||
| 128 | + ? true | ||
| 129 | + : false, | ||
| 122 | child: Padding( | 130 | child: Padding( |
| 123 | padding: EdgeInsets.only( | 131 | padding: EdgeInsets.only( |
| 124 | right: ScreenUtil().setWidth(18)), | 132 | right: ScreenUtil().setWidth(18)), |
| 125 | child: CommonButton( | 133 | child: CommonButton( |
| 126 | content: "午市", | 134 | content: "午市", |
| 127 | - state: tableManagerModel.currTimeIndex == 2 ? 1 : 0, | 135 | + state: |
| 136 | + tableManagerModel.currTimeIndex == 2 | ||
| 137 | + ? 1 | ||
| 138 | + : 0, | ||
| 128 | width: 92, | 139 | width: 92, |
| 129 | height: 48, | 140 | height: 48, |
| 130 | fontSize: 32, | 141 | fontSize: 32, |
| 131 | onPress: () { | 142 | onPress: () { |
| 132 | - if (tableManagerModel.currTimeIndex == 2) return; | 143 | + if (tableManagerModel.currTimeIndex == |
| 144 | + 2) return; | ||
| 133 | tableManagerModel.currTimeIndex = 2; | 145 | tableManagerModel.currTimeIndex = 2; |
| 134 | - tableManagerModel.getReserveList(context); | 146 | + tableManagerModel |
| 147 | + .getReserveList(context); | ||
| 135 | }, | 148 | }, |
| 136 | ))), | 149 | ))), |
| 137 | Offstage( | 150 | Offstage( |
| 138 | - offstage: tableManagerModel.night == "00:00-00:00" ? true : false, | 151 | + offstage: tableManagerModel.night == "00:00-00:00" |
| 152 | + ? true | ||
| 153 | + : false, | ||
| 139 | child: Container( | 154 | child: Container( |
| 140 | - // padding: EdgeInsets.symmetric( | ||
| 141 | - // horizontal: ScreenUtil().setWidth(10)), | 155 | + // padding: EdgeInsets.symmetric( |
| 156 | + // horizontal: ScreenUtil().setWidth(10)), | ||
| 142 | child: CommonButton( | 157 | child: CommonButton( |
| 143 | - content: "晚市", | ||
| 144 | - state: tableManagerModel.currTimeIndex == 3 ? 1 : 0, | ||
| 145 | - width: 92, | ||
| 146 | - height: 48, | ||
| 147 | - fontSize: 32, | ||
| 148 | - onPress: () { | ||
| 149 | - if (tableManagerModel.currTimeIndex == 3) return; | ||
| 150 | - tableManagerModel.currTimeIndex = 3; | ||
| 151 | - tableManagerModel.getReserveList(context); | ||
| 152 | - }, | ||
| 153 | - )), | 158 | + content: "晚市", |
| 159 | + state: tableManagerModel.currTimeIndex == 3 | ||
| 160 | + ? 1 | ||
| 161 | + : 0, | ||
| 162 | + width: 92, | ||
| 163 | + height: 48, | ||
| 164 | + fontSize: 32, | ||
| 165 | + onPress: () { | ||
| 166 | + if (tableManagerModel.currTimeIndex == 3) | ||
| 167 | + return; | ||
| 168 | + tableManagerModel.currTimeIndex = 3; | ||
| 169 | + tableManagerModel.getReserveList(context); | ||
| 170 | + }, | ||
| 171 | + )), | ||
| 154 | ), | 172 | ), |
| 155 | ], | 173 | ], |
| 156 | ), | 174 | ), |
| @@ -166,138 +184,205 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -166,138 +184,205 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 166 | ), | 184 | ), |
| 167 | Expanded( | 185 | Expanded( |
| 168 | child: Consumer<TableManagerModel>( | 186 | child: Consumer<TableManagerModel>( |
| 169 | - builder: (context,model,child){ | ||
| 170 | - if (model.pageState != PageState.Success) { | ||
| 171 | - return ExceptionPage( | ||
| 172 | - pageState: model.pageState, | ||
| 173 | - callback: () { | ||
| 174 | - if(tableManagerModel.tableOuterList.isEmpty){ | ||
| 175 | - tableManagerModel.getTableList(context); | ||
| 176 | - }else{ | ||
| 177 | - tableManagerModel.getReserveList(context); | ||
| 178 | - } | ||
| 179 | - }, | ||
| 180 | - emptyMsg: "暂时没有桌位哦", | ||
| 181 | - emptyImg: "empty_search", | ||
| 182 | - showMsg: "加载中,请稍后...", | ||
| 183 | - ); | ||
| 184 | - }else{ | ||
| 185 | - return Container( | ||
| 186 | - color: MyColours.color_ffffff, | ||
| 187 | - child: Row( | ||
| 188 | - children: <Widget>[ | ||
| 189 | - Container( | ||
| 190 | - width: ScreenUtil().setWidth(170), | ||
| 191 | - height: double.infinity, | ||
| 192 | - color: MyColours.color_f1f1f1, | ||
| 193 | - child: ListView.builder( | ||
| 194 | - itemBuilder: (context, index) { | ||
| 195 | - return Selector<TableManagerModel,Area>( | ||
| 196 | - selector: (context,model)=>model.areas[index], | ||
| 197 | - builder: (context,area,_){ | ||
| 198 | - return AreaItem(area, tableManagerModel.currentArea, | ||
| 199 | - (area) { | ||
| 200 | - setState(() { | ||
| 201 | - tableManagerModel.currentArea = (area as Area).name; | ||
| 202 | - tableManagerModel.currentTables=tableManagerModel.areaTableMap[tableManagerModel.currentArea]; | ||
| 203 | - }); | ||
| 204 | - }); | ||
| 205 | - }, | ||
| 206 | - ); | ||
| 207 | - }, | ||
| 208 | - itemExtent: ScreenUtil().setHeight(207), | ||
| 209 | - itemCount: tableManagerModel.areas.length, | ||
| 210 | - ), | ||
| 211 | - ), | ||
| 212 | - Expanded( | ||
| 213 | - child: Padding( | ||
| 214 | - padding: EdgeInsets.symmetric( | ||
| 215 | - vertical: ScreenUtil().setHeight(10), | ||
| 216 | - horizontal: ScreenUtil().setWidth(9)), | ||
| 217 | - child: Column( | ||
| 218 | - children: [ | 187 | + builder: (context, model, child) { |
| 188 | + if (model.pageState != PageState.Success) { | ||
| 189 | + return ExceptionPage( | ||
| 190 | + pageState: model.pageState, | ||
| 191 | + callback: () { | ||
| 192 | + if (tableManagerModel.tableOuterList.isEmpty) { | ||
| 193 | + tableManagerModel.getTableList(context); | ||
| 194 | + } else { | ||
| 195 | + tableManagerModel.getReserveList(context); | ||
| 196 | + } | ||
| 197 | + }, | ||
| 198 | + emptyMsg: "暂时没有桌位哦", | ||
| 199 | + emptyImg: "empty_search", | ||
| 200 | + showMsg: "加载中,请稍后...", | ||
| 201 | + ); | ||
| 202 | + } else { | ||
| 203 | + return Container( | ||
| 204 | + color: MyColours.color_ffffff, | ||
| 205 | + child: Row( | ||
| 206 | + children: <Widget>[ | ||
| 207 | + Container( | ||
| 208 | + width: ScreenUtil().setWidth(170), | ||
| 209 | + height: double.infinity, | ||
| 210 | + color: MyColours.color_f1f1f1, | ||
| 211 | + child: ListView.builder( | ||
| 212 | + itemBuilder: (context, index) { | ||
| 213 | + return Selector<TableManagerModel, Area>( | ||
| 214 | + selector: (context, model) => | ||
| 215 | + model.areas[index], | ||
| 216 | + builder: (context, area, _) { | ||
| 217 | + return AreaItem( | ||
| 218 | + area, tableManagerModel.currentArea, | ||
| 219 | + (area) { | ||
| 220 | + setState(() { | ||
| 221 | + tableManagerModel.currentArea = | ||
| 222 | + (area as Area).name; | ||
| 223 | + tableManagerModel.currentTables = | ||
| 224 | + tableManagerModel.areaTableMap[ | ||
| 225 | + tableManagerModel | ||
| 226 | + .currentArea]; | ||
| 227 | + }); | ||
| 228 | + }); | ||
| 229 | + }, | ||
| 230 | + ); | ||
| 231 | + }, | ||
| 232 | + itemExtent: ScreenUtil().setHeight(207), | ||
| 233 | + itemCount: tableManagerModel.areas.length, | ||
| 234 | + ), | ||
| 235 | + ), | ||
| 219 | Expanded( | 236 | Expanded( |
| 220 | - child: GridView.builder( | ||
| 221 | - gridDelegate: | ||
| 222 | - SliverGridDelegateWithFixedCrossAxisCount( | ||
| 223 | - crossAxisCount: 3, | ||
| 224 | - childAspectRatio: 8 / 9), | ||
| 225 | - itemBuilder: (context, index) { | ||
| 226 | - return Selector<TableManagerModel,t.Table>( | ||
| 227 | - shouldRebuild: (pre,next)=>true, | ||
| 228 | - selector: (context,model)=>model.currentTables[index], | ||
| 229 | - builder: (context,table,_){ | ||
| 230 | - return TableItem( | ||
| 231 | - table, | ||
| 232 | - onSelected: (table) { | ||
| 233 | - if ((table as t.Table).selected) { | ||
| 234 | - tableManagerModel.selectTables.add(table); | ||
| 235 | - } else { | ||
| 236 | - tableManagerModel.selectTables.removeWhere( | ||
| 237 | - (t) => t.id == table.id); | ||
| 238 | - } | ||
| 239 | - DialogUtil.showTableManagerDialog(context, table).then((value){ | ||
| 240 | - if(value!=null){ | ||
| 241 | - switch(value){ | ||
| 242 | - case 1://查看详情 | ||
| 243 | - NavigatorUtil.goNotebookDetailPage(context, tableManagerModel.tableMap[table.id].id); | ||
| 244 | - break; | ||
| 245 | - case 2://订座 | ||
| 246 | - NavigatorUtil.goNoteBookChangePage(context, NotebookDetail.fromTableManager(tableManagerModel.getCurrDdateStr(), tableManagerModel.currTimeIndex.toString(),table), ""); | ||
| 247 | - break; | ||
| 248 | - case 3://停用,启用桌位 | ||
| 249 | - Map<String,String> params={ | ||
| 250 | - "id":(table as t.Table).id, | ||
| 251 | - "status":(table as t.Table).enable=="1"?"0":"1" | ||
| 252 | - }; | ||
| 253 | - tableManagerModel.setSwitchStatus(context, params).then((value){ | ||
| 254 | - if(value!=null){ | ||
| 255 | - (table as t.Table).enable=((int.parse((table as t.Table).enable)+1)%2).toString(); | ||
| 256 | - if((table as t.Table).enable=="1"){ | ||
| 257 | - for(Area area in tableManagerModel.areas){ | ||
| 258 | - if(area.name==tableManagerModel.currentArea){ | ||
| 259 | - if(table.sign != '5'&&table.sign != '1'){//已预订 | ||
| 260 | - area.count++; | 237 | + child: Padding( |
| 238 | + padding: EdgeInsets.symmetric( | ||
| 239 | + vertical: ScreenUtil().setHeight(10), | ||
| 240 | + horizontal: ScreenUtil().setWidth(9)), | ||
| 241 | + child: Column( | ||
| 242 | + children: [ | ||
| 243 | + Expanded( | ||
| 244 | + child: GridView.builder( | ||
| 245 | + gridDelegate: | ||
| 246 | + SliverGridDelegateWithFixedCrossAxisCount( | ||
| 247 | + crossAxisCount: 3, | ||
| 248 | + childAspectRatio: 8 / 9), | ||
| 249 | + itemBuilder: (context, index) { | ||
| 250 | + return Selector<TableManagerModel, | ||
| 251 | + t.Table>( | ||
| 252 | + shouldRebuild: (pre, next) => true, | ||
| 253 | + selector: (context, model) => | ||
| 254 | + model.currentTables[index], | ||
| 255 | + builder: (context, table, _) { | ||
| 256 | + return TableItem(table, | ||
| 257 | + onSelected: (table) { | ||
| 258 | + if ((table as t.Table) | ||
| 259 | + .selected) { | ||
| 260 | + tableManagerModel.selectTables | ||
| 261 | + .add(table); | ||
| 262 | + } else { | ||
| 263 | + tableManagerModel.selectTables | ||
| 264 | + .removeWhere((t) => | ||
| 265 | + t.id == table.id); | ||
| 266 | + } | ||
| 267 | + DialogUtil | ||
| 268 | + .showTableManagerDialog( | ||
| 269 | + context, table) | ||
| 270 | + .then((value) { | ||
| 271 | + if (value != null) { | ||
| 272 | + switch (value) { | ||
| 273 | + case 1: //查看详情 | ||
| 274 | + NavigatorUtil | ||
| 275 | + .goNotebookDetailPage( | ||
| 276 | + context, | ||
| 277 | + tableManagerModel | ||
| 278 | + .tableMap[ | ||
| 279 | + table | ||
| 280 | + .id] | ||
| 281 | + .id); | ||
| 282 | + break; | ||
| 283 | + case 2: //订座 | ||
| 284 | + NavigatorUtil.goNoteBookChangePage( | ||
| 285 | + context, | ||
| 286 | + NotebookDetail.fromTableManager( | ||
| 287 | + tableManagerModel | ||
| 288 | + .getCurrDdateStr(), | ||
| 289 | + tableManagerModel | ||
| 290 | + .currTimeIndex | ||
| 291 | + .toString(), | ||
| 292 | + table), | ||
| 293 | + ""); | ||
| 294 | + break; | ||
| 295 | + case 3: //停用,启用桌位 | ||
| 296 | + Map<String, String> | ||
| 297 | + params = { | ||
| 298 | + "id": | ||
| 299 | + (table as t.Table) | ||
| 300 | + .id, | ||
| 301 | + "status": (table as t | ||
| 302 | + .Table) | ||
| 303 | + .enable == | ||
| 304 | + "1" | ||
| 305 | + ? "0" | ||
| 306 | + : "1" | ||
| 307 | + }; | ||
| 308 | + tableManagerModel | ||
| 309 | + .setSwitchStatus( | ||
| 310 | + context, params) | ||
| 311 | + .then((value) { | ||
| 312 | + if (value != null) { | ||
| 313 | + (table as t.Table) | ||
| 314 | + .enable = | ||
| 315 | + ((int.parse((table as t.Table).enable) + | ||
| 316 | + 1) % | ||
| 317 | + 2) | ||
| 318 | + .toString(); | ||
| 319 | + if ((table as t | ||
| 320 | + .Table) | ||
| 321 | + .enable == | ||
| 322 | + "1") { | ||
| 323 | + for (Area area | ||
| 324 | + in tableManagerModel | ||
| 325 | + .areas) { | ||
| 326 | + if (area.name == | ||
| 327 | + tableManagerModel | ||
| 328 | + .currentArea) { | ||
| 329 | + if (table.sign != | ||
| 330 | + '5' && | ||
| 331 | + table.sign != | ||
| 332 | + '1') { | ||
| 333 | + //已预订 | ||
| 334 | + area.count++; | ||
| 335 | + } | ||
| 336 | + break; | ||
| 261 | } | 337 | } |
| 262 | - break; | ||
| 263 | } | 338 | } |
| 264 | - } | ||
| 265 | - }else{ | ||
| 266 | - for(Area area in tableManagerModel.areas){ | ||
| 267 | - if(area.name==tableManagerModel.currentArea){ | ||
| 268 | - if(table.sign != '5'&&table.sign != '1'){//已预订 | ||
| 269 | - area.count--; | 339 | + } else { |
| 340 | + for (Area area | ||
| 341 | + in tableManagerModel | ||
| 342 | + .areas) { | ||
| 343 | + if (area.name == | ||
| 344 | + tableManagerModel | ||
| 345 | + .currentArea) { | ||
| 346 | + if (table.sign != | ||
| 347 | + '5' && | ||
| 348 | + table.sign != | ||
| 349 | + '1') { | ||
| 350 | + //已预订 | ||
| 351 | + area.count--; | ||
| 352 | + } | ||
| 353 | + break; | ||
| 270 | } | 354 | } |
| 271 | - break; | ||
| 272 | } | 355 | } |
| 273 | } | 356 | } |
| 357 | + tableManagerModel | ||
| 358 | + .notifyListeners(); | ||
| 274 | } | 359 | } |
| 275 | - tableManagerModel.notifyListeners(); | ||
| 276 | - } | ||
| 277 | - }); | ||
| 278 | - break; | 360 | + }); |
| 361 | + break; | ||
| 362 | + } | ||
| 279 | } | 363 | } |
| 280 | - } | ||
| 281 | - }); | 364 | + }); |
| 365 | + }, | ||
| 366 | + canSelected: false, | ||
| 367 | + fromPage: 'table_manage', | ||
| 368 | + tableMap: tableManagerModel | ||
| 369 | + .tableMap, | ||
| 370 | + rid: ""); | ||
| 282 | }, | 371 | }, |
| 283 | - canSelected: false, | ||
| 284 | - canChoose: false, | ||
| 285 | - tableMap: tableManagerModel.tableMap, | ||
| 286 | - rid: ""); | ||
| 287 | - }, | ||
| 288 | - ); | ||
| 289 | - }, | ||
| 290 | - itemCount: tableManagerModel.currentTables.length, | ||
| 291 | - )), | 372 | + ); |
| 373 | + }, | ||
| 374 | + itemCount: tableManagerModel | ||
| 375 | + .currentTables.length, | ||
| 376 | + )), | ||
| 377 | + ], | ||
| 378 | + )), | ||
| 379 | + ) | ||
| 292 | ], | 380 | ], |
| 293 | - )), | ||
| 294 | - ) | ||
| 295 | - ], | ||
| 296 | - ), | ||
| 297 | - ); | ||
| 298 | - } | ||
| 299 | - }, | ||
| 300 | - ), | 381 | + ), |
| 382 | + ); | ||
| 383 | + } | ||
| 384 | + }, | ||
| 385 | + ), | ||
| 301 | ), | 386 | ), |
| 302 | ], | 387 | ], |
| 303 | ); | 388 | ); |
| @@ -32,6 +32,18 @@ class MessageDialogModel extends ChangeNotifier { | @@ -32,6 +32,18 @@ class MessageDialogModel extends ChangeNotifier { | ||
| 32 | case "11": //取消在线预订 | 32 | case "11": //取消在线预订 |
| 33 | _player.play("tts_cancel.mp3"); | 33 | _player.play("tts_cancel.mp3"); |
| 34 | break; | 34 | break; |
| 35 | + case "12": | ||
| 36 | + //在线买单消息 去处理 跳转在线买单处理页面 | ||
| 37 | + _player.play("tts_pre_pay.mp3"); | ||
| 38 | + break; | ||
| 39 | + case "13": | ||
| 40 | + //在线买单消息 去查看 跳转在线买单详情页面 | ||
| 41 | + _player.play("tts_pay.mp3"); | ||
| 42 | + break; | ||
| 43 | + case "14": | ||
| 44 | + //发票详情页面跳转 | ||
| 45 | + _player.play("tts_invoice.mp3"); | ||
| 46 | + break; | ||
| 35 | case "1": //提前点餐 | 47 | case "1": //提前点餐 |
| 36 | _player.play("tts_order.mp3"); | 48 | _player.play("tts_order.mp3"); |
| 37 | break; | 49 | break; |
| @@ -76,24 +88,22 @@ class MessageDialogModel extends ChangeNotifier { | @@ -76,24 +88,22 @@ class MessageDialogModel extends ChangeNotifier { | ||
| 76 | messagesTemp.removeWhere((message) { | 88 | messagesTemp.removeWhere((message) { |
| 77 | if (message.message_type.toString() == "10") { | 89 | if (message.message_type.toString() == "10") { |
| 78 | if (message.status == "4") { | 90 | if (message.status == "4") { |
| 91 | + //取消预定 | ||
| 92 | + ///此状态移除,不展示 | ||
| 79 | return true; | 93 | return true; |
| 80 | } | 94 | } |
| 81 | - return false; | ||
| 82 | - } else if (message.message_type.toString() == "11") { | ||
| 83 | - return false; | ||
| 84 | - } else if (message.message_type.toString() == "1") { | ||
| 85 | - return false; | ||
| 86 | } | 95 | } |
| 87 | - return true; | 96 | + return false; |
| 88 | }); | 97 | }); |
| 89 | - // if (params["type_id"] == '10') { | ||
| 90 | - // unMessagesOnline = messagesTemp; | ||
| 91 | - // } else if (params["type_id"] == '1') { | ||
| 92 | - // unMessagesOrder = messagesTemp; | ||
| 93 | - // } | ||
| 94 | - messages.addAll(messagesTemp); | ||
| 95 | - // messages.addAll(unMessagesOnline); | ||
| 96 | - // messages.addAll(unMessagesOrder); | 98 | + if (params["type_id"] == '10') { |
| 99 | + unMessagesOnline = messagesTemp; | ||
| 100 | + messages.addAll(unMessagesOnline); | ||
| 101 | + } else if (params["type_id"] == '1') { | ||
| 102 | + unMessagesOrder = messagesTemp; | ||
| 103 | + messages = unMessagesOrder; | ||
| 104 | + } | ||
| 105 | + // messages.addAll(messagesTemp); | ||
| 106 | + | ||
| 97 | callback(); | 107 | callback(); |
| 98 | // if (messages.isNotEmpty) { | 108 | // if (messages.isNotEmpty) { |
| 99 | // //播放声音 | 109 | // //播放声音 |
| @@ -9,9 +9,6 @@ import 'package:one_key/net/http_url.dart'; | @@ -9,9 +9,6 @@ import 'package:one_key/net/http_url.dart'; | ||
| 9 | 9 | ||
| 10 | class MessageModel extends ChangeNotifier { | 10 | class MessageModel extends ChangeNotifier { |
| 11 | List<Message> messages = []; //消息 | 11 | List<Message> messages = []; //消息 |
| 12 | - | ||
| 13 | - List<Message> unMessagesOnline = []; //未读在线消息(取消预定和新的预订) | ||
| 14 | - List<Message> unMessagesOrder = []; //未读提前点餐消息 | ||
| 15 | PageState pageState = PageState.Loading; | 12 | PageState pageState = PageState.Loading; |
| 16 | // 未处理消息总数 | 13 | // 未处理消息总数 |
| 17 | int onlineTotal = 0; //在线消息 | 14 | int onlineTotal = 0; //在线消息 |
| @@ -21,8 +18,6 @@ class MessageModel extends ChangeNotifier { | @@ -21,8 +18,6 @@ class MessageModel extends ChangeNotifier { | ||
| 21 | 18 | ||
| 22 | initData() { | 19 | initData() { |
| 23 | messages = []; //消息 | 20 | messages = []; //消息 |
| 24 | - unMessagesOnline = []; //未读在线消息(取消预定和新的预订) | ||
| 25 | - unMessagesOrder = []; //未读提前点餐消息 | ||
| 26 | pageState = PageState.Loading; | 21 | pageState = PageState.Loading; |
| 27 | } | 22 | } |
| 28 | 23 | ||
| @@ -64,15 +59,7 @@ class MessageModel extends ChangeNotifier { | @@ -64,15 +59,7 @@ class MessageModel extends ChangeNotifier { | ||
| 64 | return Message.fromJson(value); | 59 | return Message.fromJson(value); |
| 65 | }).toList()); | 60 | }).toList()); |
| 66 | } | 61 | } |
| 67 | - if (params["status"] == '0') { | ||
| 68 | - //未读消息数据 | ||
| 69 | - //1提前点餐2内部预订 在线预订展示包括取消预订和新的预定 "type_id" | ||
| 70 | - if (params["type_id"] == '1') { | ||
| 71 | - unMessagesOrder = messages; | ||
| 72 | - } else { | ||
| 73 | - unMessagesOnline = messages; | ||
| 74 | - } | ||
| 75 | - } | 62 | + |
| 76 | // if(params["type_id"]=="10"){//在线预订 | 63 | // if(params["type_id"]=="10"){//在线预订 |
| 77 | // messages.removeWhere((message) { | 64 | // messages.removeWhere((message) { |
| 78 | // if (message.message_type.toString() == "10") {//在线预订 | 65 | // if (message.message_type.toString() == "10") {//在线预订 |
| @@ -673,7 +673,8 @@ class DialogUtil { | @@ -673,7 +673,8 @@ class DialogUtil { | ||
| 673 | children: [ | 673 | children: [ |
| 674 | Offstage( | 674 | Offstage( |
| 675 | offstage: !(table.signStr == "已预订" || | 675 | offstage: !(table.signStr == "已预订" || |
| 676 | - table.signStr == "用餐中"), | 676 | + table.signStr == "用餐中" || |
| 677 | + table.signStr == "已买单"), | ||
| 677 | child: GestureDetector( | 678 | child: GestureDetector( |
| 678 | behavior: HitTestBehavior.opaque, | 679 | behavior: HitTestBehavior.opaque, |
| 679 | onTap: () { | 680 | onTap: () { |
| @@ -11,6 +11,32 @@ Future<bool> checkContactPermission() async { | @@ -11,6 +11,32 @@ Future<bool> checkContactPermission() async { | ||
| 11 | } | 11 | } |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | +Future<bool> checkPermission(PermissionGroup permissionGroup) async { | ||
| 15 | + PermissionStatus permissionStatus = | ||
| 16 | + await PermissionHandler().checkPermissionStatus(permissionGroup); | ||
| 17 | + if (permissionStatus == PermissionStatus.granted) { | ||
| 18 | + return true; | ||
| 19 | + } else { | ||
| 20 | + return false; | ||
| 21 | + } | ||
| 22 | +} | ||
| 23 | +Future<bool> requestPermission(PermissionGroup permissionGroup) async { | ||
| 24 | + final permissions = | ||
| 25 | + await PermissionHandler().requestPermissions([permissionGroup]); | ||
| 26 | + if (permissions[permissionGroup] == PermissionStatus.granted) { | ||
| 27 | + return true; | ||
| 28 | + } else { | ||
| 29 | + return false; | ||
| 30 | + } | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +Future<PermissionStatus> permissionStatus( | ||
| 34 | + PermissionGroup permissionGroup) async { | ||
| 35 | + PermissionStatus permissionStatus = | ||
| 36 | + await PermissionHandler().checkPermissionStatus(permissionGroup); | ||
| 37 | + return permissionStatus; | ||
| 38 | +} | ||
| 39 | + | ||
| 14 | Future<PermissionStatus> contactPermissionStatus() async { | 40 | Future<PermissionStatus> contactPermissionStatus() async { |
| 15 | PermissionStatus permissionStatus = | 41 | PermissionStatus permissionStatus = |
| 16 | await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); | 42 | await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts); |
| @@ -45,9 +45,9 @@ class NavigatorUtil { | @@ -45,9 +45,9 @@ class NavigatorUtil { | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | /// 处理在线预订 | 47 | /// 处理在线预订 |
| 48 | - static void goHandleOnlinePage(BuildContext context, String rid, String mid, | 48 | + static Future goHandleOnlinePage(BuildContext context, String rid, String mid, |
| 49 | {fromNotify = false, replace = false}) { | 49 | {fromNotify = false, replace = false}) { |
| 50 | - _navigateTo(context, | 50 | + return _navigateTo(context, |
| 51 | "${Routes.handle_online_page}?rid=$rid&mid=$mid&fromNotify=$fromNotify", | 51 | "${Routes.handle_online_page}?rid=$rid&mid=$mid&fromNotify=$fromNotify", |
| 52 | replace: replace); | 52 | replace: replace); |
| 53 | } | 53 | } |
| @@ -130,9 +130,9 @@ class NavigatorUtil { | @@ -130,9 +130,9 @@ class NavigatorUtil { | ||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | /// 提前买单编辑页面 | 132 | /// 提前买单编辑页面 |
| 133 | - static void goOnlineCheckEditPage(BuildContext context, | 133 | + static Future goOnlineCheckEditPage(BuildContext context, |
| 134 | {String rid, String mid, fromNotify = false, replace = false}) { | 134 | {String rid, String mid, fromNotify = false, replace = false}) { |
| 135 | - _navigateTo(context, | 135 | + return _navigateTo(context, |
| 136 | "${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}&mid=$mid", | 136 | "${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}&mid=$mid", |
| 137 | replace: replace); | 137 | replace: replace); |
| 138 | } | 138 | } |
| @@ -10,7 +10,7 @@ class TableItem extends StatefulWidget { | @@ -10,7 +10,7 @@ class TableItem extends StatefulWidget { | ||
| 10 | final t.Table table; | 10 | final t.Table table; |
| 11 | final bool canSelected; //是否能选中 | 11 | final bool canSelected; //是否能选中 |
| 12 | final ValueChanged onSelected; | 12 | final ValueChanged onSelected; |
| 13 | - final bool canChoose; //从变更页面进来 = true | 13 | + final String fromPage; // 变更、新建、桌位管理三个页面 |
| 14 | final String rid; | 14 | final String rid; |
| 15 | final Map<String, Notebook> tableMap; //记录已预订桌位对应的订单 | 15 | final Map<String, Notebook> tableMap; //记录已预订桌位对应的订单 |
| 16 | 16 | ||
| @@ -20,7 +20,7 @@ class TableItem extends StatefulWidget { | @@ -20,7 +20,7 @@ class TableItem extends StatefulWidget { | ||
| 20 | {this.onSelected, | 20 | {this.onSelected, |
| 21 | this.canSelected = false, | 21 | this.canSelected = false, |
| 22 | this.height = 185, | 22 | this.height = 185, |
| 23 | - this.canChoose = false, | 23 | + this.fromPage = 'new', |
| 24 | this.rid, | 24 | this.rid, |
| 25 | this.tableMap}); | 25 | this.tableMap}); |
| 26 | 26 | ||
| @@ -45,7 +45,7 @@ class TableItemState extends State<TableItem> { | @@ -45,7 +45,7 @@ class TableItemState extends State<TableItem> { | ||
| 45 | 45 | ||
| 46 | return GestureDetector( | 46 | return GestureDetector( |
| 47 | onTap: () { | 47 | onTap: () { |
| 48 | - if (widget.canSelected && widget.canChoose) { | 48 | + if (widget.canSelected && widget.fromPage == 'change') { |
| 49 | //从变更页面进来 canChoose = true | 49 | //从变更页面进来 canChoose = true |
| 50 | if (widget.canSelected && signStr.isEmpty) { | 50 | if (widget.canSelected && signStr.isEmpty) { |
| 51 | setState(() { | 51 | setState(() { |
| @@ -71,17 +71,17 @@ class TableItemState extends State<TableItem> { | @@ -71,17 +71,17 @@ class TableItemState extends State<TableItem> { | ||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | - } else if (widget.canSelected && signStr.isEmpty) { | 74 | + } else if (widget.fromPage == 'new' && widget.canSelected && signStr.isEmpty) { |
| 75 | //从安排桌位进来 | 75 | //从安排桌位进来 |
| 76 | setState(() { | 76 | setState(() { |
| 77 | table.selected = !(table.selected ?? false); | 77 | table.selected = !(table.selected ?? false); |
| 78 | }); | 78 | }); |
| 79 | widget.onSelected(table); | 79 | widget.onSelected(table); |
| 80 | } | 80 | } |
| 81 | - // else { | ||
| 82 | - // table.selected = !(table.selected ?? false); | ||
| 83 | - // widget.onSelected(table); | ||
| 84 | - // } | 81 | + else if (widget.fromPage == 'table_manage'){ |
| 82 | + table.selected = !(table.selected ?? false); | ||
| 83 | + widget.onSelected(table); | ||
| 84 | + } | ||
| 85 | }, | 85 | }, |
| 86 | child: Stack( | 86 | child: Stack( |
| 87 | children: <Widget>[ | 87 | children: <Widget>[ |
-
Please register or login to post a comment