Showing
14 changed files
with
816 additions
and
409 deletions
| 1 | PODS: | 1 | PODS: |
| 2 | - audioplayers (0.0.1): | 2 | - audioplayers (0.0.1): |
| 3 | - Flutter | 3 | - Flutter |
| 4 | -<<<<<<< HEAD | ||
| 5 | - Bugly (2.5.71) | 4 | - Bugly (2.5.71) |
| 6 | -======= | ||
| 7 | - connectivity (0.0.1): | 5 | - connectivity (0.0.1): |
| 8 | - Flutter | 6 | - Flutter |
| 9 | - Reachability | 7 | - Reachability |
| 8 | + - connectivity_for_web (0.1.0): | ||
| 9 | + - Flutter | ||
| 10 | - connectivity_macos (0.0.1): | 10 | - connectivity_macos (0.0.1): |
| 11 | - Flutter | 11 | - Flutter |
| 12 | - contacts_service (0.2.2): | 12 | - contacts_service (0.2.2): |
| 13 | - Flutter | 13 | - Flutter |
| 14 | - device_info (0.0.1): | 14 | - device_info (0.0.1): |
| 15 | - Flutter | 15 | - Flutter |
| 16 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 17 | - Flutter (1.0.0) | 16 | - Flutter (1.0.0) |
| 18 | - flutter_bugly (0.0.1): | 17 | - flutter_bugly (0.0.1): |
| 19 | - Bugly | 18 | - Bugly |
| @@ -40,12 +39,17 @@ PODS: | @@ -40,12 +39,17 @@ PODS: | ||
| 40 | - Flutter | 39 | - Flutter |
| 41 | - path_provider (0.0.1): | 40 | - path_provider (0.0.1): |
| 42 | - Flutter | 41 | - Flutter |
| 42 | + - path_provider_linux (0.0.1): | ||
| 43 | + - Flutter | ||
| 43 | - path_provider_macos (0.0.1): | 44 | - path_provider_macos (0.0.1): |
| 44 | - Flutter | 45 | - Flutter |
| 45 | - - permission_handler (4.4.0): | 46 | + - "permission_handler (4.4.0+hotfix.4)": |
| 46 | - Flutter | 47 | - Flutter |
| 48 | + - Reachability (3.2) | ||
| 47 | - shared_preferences (0.0.1): | 49 | - shared_preferences (0.0.1): |
| 48 | - Flutter | 50 | - Flutter |
| 51 | + - shared_preferences_linux (0.0.1): | ||
| 52 | + - Flutter | ||
| 49 | - shared_preferences_macos (0.0.1): | 53 | - shared_preferences_macos (0.0.1): |
| 50 | - Flutter | 54 | - Flutter |
| 51 | - shared_preferences_web (0.0.1): | 55 | - shared_preferences_web (0.0.1): |
| @@ -55,31 +59,23 @@ PODS: | @@ -55,31 +59,23 @@ PODS: | ||
| 55 | - FMDB (~> 2.7.2) | 59 | - FMDB (~> 2.7.2) |
| 56 | - url_launcher (0.0.1): | 60 | - url_launcher (0.0.1): |
| 57 | - Flutter | 61 | - Flutter |
| 62 | + - url_launcher_linux (0.0.1): | ||
| 63 | + - Flutter | ||
| 58 | - url_launcher_macos (0.0.1): | 64 | - url_launcher_macos (0.0.1): |
| 59 | - Flutter | 65 | - Flutter |
| 60 | - url_launcher_web (0.0.1): | 66 | - url_launcher_web (0.0.1): |
| 61 | - Flutter | 67 | - Flutter |
| 62 | -<<<<<<< HEAD | ||
| 63 | - - WechatOpenSDK (1.8.7.1) | ||
| 64 | - | ||
| 65 | -DEPENDENCIES: | ||
| 66 | - - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | ||
| 67 | -======= | ||
| 68 | -<<<<<<< HEAD | ||
| 69 | - - WechatOpenSDK (1.8.6.2) | ||
| 70 | -======= | ||
| 71 | - webview_flutter (0.0.1): | 68 | - webview_flutter (0.0.1): |
| 72 | - Flutter | 69 | - Flutter |
| 73 | - WechatOpenSDK (1.8.7.1) | 70 | - WechatOpenSDK (1.8.7.1) |
| 74 | ->>>>>>> dev | ||
| 75 | 71 | ||
| 76 | DEPENDENCIES: | 72 | DEPENDENCIES: |
| 77 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | 73 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) |
| 78 | - connectivity (from `.symlinks/plugins/connectivity/ios`) | 74 | - connectivity (from `.symlinks/plugins/connectivity/ios`) |
| 75 | + - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) | ||
| 79 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) | 76 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) |
| 80 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) | 77 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) |
| 81 | - device_info (from `.symlinks/plugins/device_info/ios`) | 78 | - device_info (from `.symlinks/plugins/device_info/ios`) |
| 82 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 83 | - Flutter (from `Flutter`) | 79 | - Flutter (from `Flutter`) |
| 84 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | 80 | - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) |
| 85 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 81 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| @@ -89,13 +85,16 @@ DEPENDENCIES: | @@ -89,13 +85,16 @@ DEPENDENCIES: | ||
| 89 | - jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`) | 85 | - jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`) |
| 90 | - package_info (from `.symlinks/plugins/package_info/ios`) | 86 | - package_info (from `.symlinks/plugins/package_info/ios`) |
| 91 | - path_provider (from `.symlinks/plugins/path_provider/ios`) | 87 | - path_provider (from `.symlinks/plugins/path_provider/ios`) |
| 88 | + - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) | ||
| 92 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) | 89 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) |
| 93 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) | 90 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) |
| 94 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) | 91 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) |
| 92 | + - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) | ||
| 95 | - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) | 93 | - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) |
| 96 | - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) | 94 | - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) |
| 97 | - sqflite (from `.symlinks/plugins/sqflite/ios`) | 95 | - sqflite (from `.symlinks/plugins/sqflite/ios`) |
| 98 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) | 96 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) |
| 97 | + - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) | ||
| 99 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) | 98 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) |
| 100 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) | 99 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) |
| 101 | - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) | 100 | - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) |
| @@ -106,22 +105,22 @@ SPEC REPOS: | @@ -106,22 +105,22 @@ SPEC REPOS: | ||
| 106 | - FMDB | 105 | - FMDB |
| 107 | - JCore | 106 | - JCore |
| 108 | - JPush | 107 | - JPush |
| 108 | + - Reachability | ||
| 109 | - WechatOpenSDK | 109 | - WechatOpenSDK |
| 110 | 110 | ||
| 111 | EXTERNAL SOURCES: | 111 | EXTERNAL SOURCES: |
| 112 | audioplayers: | 112 | audioplayers: |
| 113 | :path: ".symlinks/plugins/audioplayers/ios" | 113 | :path: ".symlinks/plugins/audioplayers/ios" |
| 114 | -<<<<<<< HEAD | ||
| 115 | -======= | ||
| 116 | connectivity: | 114 | connectivity: |
| 117 | :path: ".symlinks/plugins/connectivity/ios" | 115 | :path: ".symlinks/plugins/connectivity/ios" |
| 116 | + connectivity_for_web: | ||
| 117 | + :path: ".symlinks/plugins/connectivity_for_web/ios" | ||
| 118 | connectivity_macos: | 118 | connectivity_macos: |
| 119 | :path: ".symlinks/plugins/connectivity_macos/ios" | 119 | :path: ".symlinks/plugins/connectivity_macos/ios" |
| 120 | contacts_service: | 120 | contacts_service: |
| 121 | :path: ".symlinks/plugins/contacts_service/ios" | 121 | :path: ".symlinks/plugins/contacts_service/ios" |
| 122 | device_info: | 122 | device_info: |
| 123 | :path: ".symlinks/plugins/device_info/ios" | 123 | :path: ".symlinks/plugins/device_info/ios" |
| 124 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 125 | Flutter: | 124 | Flutter: |
| 126 | :path: Flutter | 125 | :path: Flutter |
| 127 | flutter_bugly: | 126 | flutter_bugly: |
| @@ -140,12 +139,16 @@ EXTERNAL SOURCES: | @@ -140,12 +139,16 @@ EXTERNAL SOURCES: | ||
| 140 | :path: ".symlinks/plugins/package_info/ios" | 139 | :path: ".symlinks/plugins/package_info/ios" |
| 141 | path_provider: | 140 | path_provider: |
| 142 | :path: ".symlinks/plugins/path_provider/ios" | 141 | :path: ".symlinks/plugins/path_provider/ios" |
| 142 | + path_provider_linux: | ||
| 143 | + :path: ".symlinks/plugins/path_provider_linux/ios" | ||
| 143 | path_provider_macos: | 144 | path_provider_macos: |
| 144 | :path: ".symlinks/plugins/path_provider_macos/ios" | 145 | :path: ".symlinks/plugins/path_provider_macos/ios" |
| 145 | permission_handler: | 146 | permission_handler: |
| 146 | :path: ".symlinks/plugins/permission_handler/ios" | 147 | :path: ".symlinks/plugins/permission_handler/ios" |
| 147 | shared_preferences: | 148 | shared_preferences: |
| 148 | :path: ".symlinks/plugins/shared_preferences/ios" | 149 | :path: ".symlinks/plugins/shared_preferences/ios" |
| 150 | + shared_preferences_linux: | ||
| 151 | + :path: ".symlinks/plugins/shared_preferences_linux/ios" | ||
| 149 | shared_preferences_macos: | 152 | shared_preferences_macos: |
| 150 | :path: ".symlinks/plugins/shared_preferences_macos/ios" | 153 | :path: ".symlinks/plugins/shared_preferences_macos/ios" |
| 151 | shared_preferences_web: | 154 | shared_preferences_web: |
| @@ -154,6 +157,8 @@ EXTERNAL SOURCES: | @@ -154,6 +157,8 @@ EXTERNAL SOURCES: | ||
| 154 | :path: ".symlinks/plugins/sqflite/ios" | 157 | :path: ".symlinks/plugins/sqflite/ios" |
| 155 | url_launcher: | 158 | url_launcher: |
| 156 | :path: ".symlinks/plugins/url_launcher/ios" | 159 | :path: ".symlinks/plugins/url_launcher/ios" |
| 160 | + url_launcher_linux: | ||
| 161 | + :path: ".symlinks/plugins/url_launcher_linux/ios" | ||
| 157 | url_launcher_macos: | 162 | url_launcher_macos: |
| 158 | :path: ".symlinks/plugins/url_launcher_macos/ios" | 163 | :path: ".symlinks/plugins/url_launcher_macos/ios" |
| 159 | url_launcher_web: | 164 | url_launcher_web: |
| @@ -163,14 +168,12 @@ EXTERNAL SOURCES: | @@ -163,14 +168,12 @@ EXTERNAL SOURCES: | ||
| 163 | 168 | ||
| 164 | SPEC CHECKSUMS: | 169 | SPEC CHECKSUMS: |
| 165 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c | 170 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c |
| 166 | -<<<<<<< HEAD | ||
| 167 | Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac | 171 | Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac |
| 168 | -======= | ||
| 169 | - connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 | 172 | + connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 |
| 173 | + connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b | ||
| 170 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 | 174 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 |
| 171 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca | 175 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca |
| 172 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | 176 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 |
| 173 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 174 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | 177 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec |
| 175 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | 178 | flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 |
| 176 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 179 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| @@ -182,26 +185,22 @@ SPEC CHECKSUMS: | @@ -182,26 +185,22 @@ SPEC CHECKSUMS: | ||
| 182 | JPush: a401b946dcc76b37335422487201bc1ecc8dd296 | 185 | JPush: a401b946dcc76b37335422487201bc1ecc8dd296 |
| 183 | jpush_flutter: 69133df35eaf9135e540549b154d992c44f8ee44 | 186 | jpush_flutter: 69133df35eaf9135e540549b154d992c44f8ee44 |
| 184 | package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 | 187 | package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 |
| 185 | - path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d | 188 | + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c |
| 189 | + path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 | ||
| 186 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 | 190 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 |
| 187 | - permission_handler: f615215121f43c1640d2b8500d4ad749512828a8 | ||
| 188 | - shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01 | 191 | + permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b |
| 192 | + Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | ||
| 193 | + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | ||
| 194 | + shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 | ||
| 189 | shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 | 195 | shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 |
| 190 | shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 | 196 | shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 |
| 191 | sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 | 197 | sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 |
| 192 | - url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 | 198 | + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef |
| 199 | + url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 | ||
| 193 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 | 200 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 |
| 194 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c | 201 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c |
| 195 | -<<<<<<< HEAD | ||
| 196 | - WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | ||
| 197 | -======= | ||
| 198 | -<<<<<<< HEAD | ||
| 199 | - WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a | ||
| 200 | -======= | ||
| 201 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 | 202 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 |
| 202 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | 203 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 |
| 203 | ->>>>>>> dev | ||
| 204 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 205 | 204 | ||
| 206 | PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13 | 205 | PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13 |
| 207 | 206 |
| @@ -369,15 +369,10 @@ | @@ -369,15 +369,10 @@ | ||
| 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 370 | CLANG_ENABLE_MODULES = YES; | 370 | CLANG_ENABLE_MODULES = YES; |
| 371 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 371 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 372 | -<<<<<<< HEAD | ||
| 373 | CODE_SIGN_IDENTITY = "Apple Development"; | 372 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 374 | CODE_SIGN_STYLE = Automatic; | 373 | CODE_SIGN_STYLE = Automatic; |
| 375 | - CURRENT_PROJECT_VERSION = 3; | ||
| 376 | -======= | ||
| 377 | - CODE_SIGN_STYLE = Manual; | ||
| 378 | CURRENT_PROJECT_VERSION = 8; | 374 | CURRENT_PROJECT_VERSION = 8; |
| 379 | ->>>>>>> 6d4505c5bf3110e572bc68cbdefa56aee05df137 | ||
| 380 | - DEVELOPMENT_TEAM = 8J59HM8B82; | 375 | + DEVELOPMENT_TEAM = ""; |
| 381 | ENABLE_BITCODE = NO; | 376 | ENABLE_BITCODE = NO; |
| 382 | FRAMEWORK_SEARCH_PATHS = ( | 377 | FRAMEWORK_SEARCH_PATHS = ( |
| 383 | "$(inherited)", | 378 | "$(inherited)", |
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | <key>CFBundleInfoDictionaryVersion</key> | 13 | <key>CFBundleInfoDictionaryVersion</key> |
| 14 | <string>6.0</string> | 14 | <string>6.0</string> |
| 15 | <key>CFBundleName</key> | 15 | <key>CFBundleName</key> |
| 16 | - <string>一键订</string> | 16 | + <string>Runner</string> |
| 17 | <key>CFBundlePackageType</key> | 17 | <key>CFBundlePackageType</key> |
| 18 | <string>APPL</string> | 18 | <string>APPL</string> |
| 19 | <key>CFBundleShortVersionString</key> | 19 | <key>CFBundleShortVersionString</key> |
| @@ -16,4 +16,4 @@ class HttpUrl{ | @@ -16,4 +16,4 @@ class HttpUrl{ | ||
| 16 | static const String send_sms="?service=App.SendSMS.NewMessage";//发送短信 | 16 | static const String send_sms="?service=App.SendSMS.NewMessage";//发送短信 |
| 17 | static const String check_update="http://xt03.colorcun.com/admin/api/compareversion?flat=3"; | 17 | static const String check_update="http://xt03.colorcun.com/admin/api/compareversion?flat=3"; |
| 18 | static const String upload_contact="?service=App.Seller.SaveCallRecord";//上传通讯录 | 18 | static const String upload_contact="?service=App.Seller.SaveCallRecord";//上传通讯录 |
| 19 | -} | ||
| 19 | +} |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_picker/flutter_picker.dart'; | 4 | import 'package:flutter_picker/flutter_picker.dart'; |
| 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| @@ -13,7 +15,11 @@ import 'package:one_key/utils/utils.dart'; | @@ -13,7 +15,11 @@ import 'package:one_key/utils/utils.dart'; | ||
| 13 | import 'package:one_key/widgets/MyDivider.dart'; | 15 | import 'package:one_key/widgets/MyDivider.dart'; |
| 14 | import 'package:one_key/widgets/app_bar.dart'; | 16 | import 'package:one_key/widgets/app_bar.dart'; |
| 15 | import 'package:one_key/widgets/common_button.dart'; | 17 | import 'package:one_key/widgets/common_button.dart'; |
| 18 | +import 'package:one_key/widgets/dialog.dart'; | ||
| 19 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 20 | +import 'package:one_key/widgets/loading.dart'; | ||
| 16 | import 'package:one_key/widgets/need_item.dart'; | 21 | import 'package:one_key/widgets/need_item.dart'; |
| 22 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 17 | import 'package:one_key/widgets/row_multi_text.dart'; | 23 | import 'package:one_key/widgets/row_multi_text.dart'; |
| 18 | import 'package:one_key/widgets/table_item.dart'; | 24 | import 'package:one_key/widgets/table_item.dart'; |
| 19 | import 'package:one_key/models/table.dart' as t; | 25 | import 'package:one_key/models/table.dart' as t; |
| @@ -42,22 +48,59 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -42,22 +48,59 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 42 | List<Manager> managers = []; //客户经理 | 48 | List<Manager> managers = []; //客户经理 |
| 43 | 49 | ||
| 44 | Manager manager = Manager(); | 50 | Manager manager = Manager(); |
| 51 | + List cancelReasonList = []; | ||
| 52 | + bool isShowTF = false; | ||
| 53 | + int paddingBottom = 174; | ||
| 54 | + int paddingTop = 138; | ||
| 55 | + FocusNode _cancelNode = FocusNode(); | ||
| 56 | + TextEditingController _cancelController = TextEditingController(); | ||
| 57 | + StateSetter _cancelState; | ||
| 45 | 58 | ||
| 46 | @override | 59 | @override |
| 47 | void initState() { | 60 | void initState() { |
| 48 | // TODO: implement initState | 61 | // TODO: implement initState |
| 49 | super.initState(); | 62 | super.initState(); |
| 50 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 63 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 51 | - detailEntity = await detailModel.getReserveDetail(context, { | ||
| 52 | - "rid": widget.rid, | ||
| 53 | - }); | ||
| 54 | - setState(() { | ||
| 55 | - cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman; | ||
| 56 | - }); | 64 | + _getReserveDetail(); |
| 57 | managers = await detailModel.getManagers(context); | 65 | managers = await detailModel.getManagers(context); |
| 66 | + _initCancel(); | ||
| 67 | + //添加listener监听 | ||
| 68 | + //对应的TextField失去或者获取焦点都会回调此监听 | ||
| 69 | + _cancelNode.addListener(() { | ||
| 70 | + if (_cancelNode.hasFocus) { | ||
| 71 | + print('得到焦点'); | ||
| 72 | + paddingTop = 125; | ||
| 73 | + } else { | ||
| 74 | + print('失去焦点'); | ||
| 75 | + paddingTop = 138; | ||
| 76 | + } | ||
| 77 | + _cancelState(() {}); | ||
| 78 | + }); | ||
| 79 | + }); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + _getReserveDetail() async { | ||
| 83 | + detailEntity = await detailModel.getReserveDetail(context, { | ||
| 84 | + "rid": widget.rid, | ||
| 85 | + }); | ||
| 86 | + setState(() { | ||
| 87 | + cusmanText = detailEntity.cusman.isEmpty ? "请选择" : detailEntity.cusman; | ||
| 58 | }); | 88 | }); |
| 59 | } | 89 | } |
| 60 | 90 | ||
| 91 | + /// 初始化取消原因数据 | ||
| 92 | + _initCancel() { | ||
| 93 | + isShowTF = false; | ||
| 94 | + paddingBottom = 174; | ||
| 95 | + cancelReasonList = [ | ||
| 96 | + {'title': '顾客取消', 'select': false}, | ||
| 97 | + {'title': '顾客行程有变', 'select': false}, | ||
| 98 | + {'title': '信息填写有误', 'select': false}, | ||
| 99 | + {'title': '操作失误', 'select': false}, | ||
| 100 | + {'title': '其他原因', 'select': false}, | ||
| 101 | + ]; | ||
| 102 | + } | ||
| 103 | + | ||
| 61 | //设置当前客户经理 | 104 | //设置当前客户经理 |
| 62 | _setCurrManager() { | 105 | _setCurrManager() { |
| 63 | manager = managers.firstWhere((manager) => manager.userName == cusmanText, | 106 | manager = managers.firstWhere((manager) => manager.userName == cusmanText, |
| @@ -71,6 +114,29 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -71,6 +114,29 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 71 | detailModel.setReserveCusmnan(context, params); | 114 | detailModel.setReserveCusmnan(context, params); |
| 72 | } | 115 | } |
| 73 | 116 | ||
| 117 | + ///处理在线预订 | ||
| 118 | + setReserveStatus(String status, {String tid = "", String desc}) async { | ||
| 119 | + // bus.emit("remove_untreated_message",widget.mid); | ||
| 120 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 121 | + Map<String, String> causeMap = { | ||
| 122 | + "uid": userModel.user.openid, | ||
| 123 | + "uname": userModel.user.account, | ||
| 124 | + "desc": desc, | ||
| 125 | + }; | ||
| 126 | + Map<String, String> params = { | ||
| 127 | + "rid": widget.rid, | ||
| 128 | + "status": status, //5安排包间 6 拒绝订单 | ||
| 129 | + "tid": tid, | ||
| 130 | + // "mid": widget.mid, | ||
| 131 | + "cause": json.encode(causeMap) | ||
| 132 | + }; | ||
| 133 | + bool success = | ||
| 134 | + await detailModel.setReserveStatus(context, params, ifPush: false); | ||
| 135 | + if (success) { | ||
| 136 | + _getReserveDetail(); | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + | ||
| 74 | /// 取消预订, 变更预订按钮 | 140 | /// 取消预订, 变更预订按钮 |
| 75 | Widget _cancelAndChangeBtn(GestureTapCallback onTap, String title) { | 141 | Widget _cancelAndChangeBtn(GestureTapCallback onTap, String title) { |
| 76 | return InkWell( | 142 | return InkWell( |
| @@ -85,314 +151,487 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -85,314 +151,487 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 85 | ); | 151 | ); |
| 86 | } | 152 | } |
| 87 | 153 | ||
| 154 | + ///取消预订弹框 | ||
| 155 | + _showCancelWidget(context) { | ||
| 156 | + showGeneralDialog( | ||
| 157 | + context: context, | ||
| 158 | + barrierDismissible: false, | ||
| 159 | + barrierLabel: | ||
| 160 | + MaterialLocalizations.of(context).modalBarrierDismissLabel, | ||
| 161 | + transitionDuration: const Duration(milliseconds: 150), | ||
| 162 | + pageBuilder: (BuildContext context, Animation animation, | ||
| 163 | + Animation secondaryAnimation) { | ||
| 164 | + return StatefulBuilder(builder: (context, state) { | ||
| 165 | + _cancelState = state; | ||
| 166 | + return GestureDetector( | ||
| 167 | + behavior: HitTestBehavior.opaque, | ||
| 168 | + // onTap: () { | ||
| 169 | + // Navigator.of(context).pop(); | ||
| 170 | + // }, | ||
| 171 | + child: Container( | ||
| 172 | + decoration: BoxDecoration( | ||
| 173 | + color: Color.fromRGBO(00, 00, 00, 0.5), | ||
| 174 | + ), | ||
| 175 | + padding: EdgeInsets.fromLTRB( | ||
| 176 | + ScreenUtil().setWidth(50), | ||
| 177 | + ScreenUtil().setWidth(paddingTop * 2), | ||
| 178 | + ScreenUtil().setWidth(50), | ||
| 179 | + ScreenUtil().setWidth(paddingBottom * 2)), | ||
| 180 | + child: Container( | ||
| 181 | + padding: EdgeInsets.all(ScreenUtil().setWidth(40)), | ||
| 182 | + decoration: BoxDecoration( | ||
| 183 | + color: Colors.white, | ||
| 184 | + borderRadius: | ||
| 185 | + BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 186 | + ), | ||
| 187 | + child: Column( | ||
| 188 | + children: [ | ||
| 189 | + Stack( | ||
| 190 | + children: [ | ||
| 191 | + Center( | ||
| 192 | + child: Text( | ||
| 193 | + '请选择取消原因', | ||
| 194 | + style: TextStyle( | ||
| 195 | + fontSize: ScreenUtil().setSp(34), | ||
| 196 | + fontWeight: FontWeight.bold, | ||
| 197 | + decoration: TextDecoration.none, | ||
| 198 | + color: MyColours.color_353535), | ||
| 199 | + ), | ||
| 200 | + ), | ||
| 201 | + Positioned( | ||
| 202 | + top: ScreenUtil().setWidth(8), | ||
| 203 | + right: ScreenUtil().setWidth(0), | ||
| 204 | + child: GestureDetector( | ||
| 205 | + onTap: () { | ||
| 206 | + _initCancel(); | ||
| 207 | + Navigator.of(context).pop(); | ||
| 208 | + }, | ||
| 209 | + child: Image.asset( | ||
| 210 | + 'assets/message_selected.png', | ||
| 211 | + width: ScreenUtil().setWidth(32)), | ||
| 212 | + )) | ||
| 213 | + ], | ||
| 214 | + ), | ||
| 215 | + VEmptyView(60), | ||
| 216 | + Column( | ||
| 217 | + children: cancelReasonList.map((value) { | ||
| 218 | + return GestureDetector( | ||
| 219 | + onTap: () { | ||
| 220 | + for (var item in cancelReasonList) { | ||
| 221 | + item['select'] = false; | ||
| 222 | + isShowTF = false; | ||
| 223 | + paddingBottom = 174; | ||
| 224 | + if (item['title'] == value['title']) { | ||
| 225 | + item['select'] = true; | ||
| 226 | + if (item['title'] == '其他原因') { | ||
| 227 | + isShowTF = true; | ||
| 228 | + paddingBottom = 130; | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + state(() {}); | ||
| 233 | + }, | ||
| 234 | + child: Column(children: [ | ||
| 235 | + Row( | ||
| 236 | + children: [ | ||
| 237 | + Image.asset( | ||
| 238 | + value['select'] | ||
| 239 | + ? 'assets/message_selected.png' | ||
| 240 | + : 'assets/message_default.png', | ||
| 241 | + width: ScreenUtil().setWidth(44)), | ||
| 242 | + HEmptyView(30), | ||
| 243 | + Text(value['title'], | ||
| 244 | + style: TextStyle( | ||
| 245 | + fontSize: ScreenUtil().setSp(32), | ||
| 246 | + fontWeight: FontWeight.normal, | ||
| 247 | + decoration: TextDecoration.none, | ||
| 248 | + color: MyColours.color_333333)) | ||
| 249 | + ], | ||
| 250 | + ), | ||
| 251 | + value['title'] == '其他原因' && isShowTF | ||
| 252 | + ? Material( | ||
| 253 | + child: Container( | ||
| 254 | + color: Colors.white, | ||
| 255 | + padding: EdgeInsets.only( | ||
| 256 | + left: ScreenUtil().setWidth(76)), | ||
| 257 | + child: TextField( | ||
| 258 | + maxLines: 1, | ||
| 259 | + controller: _cancelController, | ||
| 260 | + focusNode: _cancelNode, | ||
| 261 | + textAlignVertical: | ||
| 262 | + TextAlignVertical.bottom, | ||
| 263 | + decoration: InputDecoration( | ||
| 264 | + hintText: "请填写原因", | ||
| 265 | + hintStyle: TextStyle( | ||
| 266 | + color: MyColours.color_999999, | ||
| 267 | + fontSize: ScreenUtil().setSp(30), | ||
| 268 | + ), | ||
| 269 | + enabledBorder: UnderlineInputBorder( | ||
| 270 | + borderSide: BorderSide( | ||
| 271 | + color: | ||
| 272 | + MyColours.color_d8d8d8), | ||
| 273 | + ), | ||
| 274 | + // border: InputBorder.none, | ||
| 275 | + ), | ||
| 276 | + onChanged: (_) { | ||
| 277 | + setState(() {}); | ||
| 278 | + }, | ||
| 279 | + onEditingComplete: () { | ||
| 280 | + print('fff'); | ||
| 281 | + _cancelNode.unfocus(); | ||
| 282 | + }, | ||
| 283 | + // keyboardType: TextInputType.number, | ||
| 284 | + ), | ||
| 285 | + )) | ||
| 286 | + : Container(), | ||
| 287 | + VEmptyView(40) | ||
| 288 | + ]), | ||
| 289 | + ); | ||
| 290 | + }).toList(), | ||
| 291 | + ), | ||
| 292 | + VEmptyView(15), | ||
| 293 | + Material( | ||
| 294 | + child: RoundButton( | ||
| 295 | + onPressed: () { | ||
| 296 | + String desc = ''; | ||
| 297 | + for (var value in cancelReasonList) { | ||
| 298 | + if (value['select'] == true) { | ||
| 299 | + desc = value['title']; | ||
| 300 | + if (value['title'] == '其他原因') { | ||
| 301 | + desc = _cancelController.text.trim(); | ||
| 302 | + if (desc.isEmpty) { | ||
| 303 | + Utils.showToast("请填写原因"); | ||
| 304 | + return; | ||
| 305 | + } | ||
| 306 | + } | ||
| 307 | + } | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + if (desc == '') { | ||
| 311 | + Utils.showToast('请选择原因'); | ||
| 312 | + return; | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + Navigator.of(context).pop(); | ||
| 316 | + setReserveStatus('4', desc: desc); | ||
| 317 | + }, | ||
| 318 | + text: '确认', | ||
| 319 | + height: ScreenUtil().setWidth(80), | ||
| 320 | + width: ScreenUtil().setWidth(300), | ||
| 321 | + radius: ScreenUtil().setWidth(10), | ||
| 322 | + ), | ||
| 323 | + ) | ||
| 324 | + ], | ||
| 325 | + ), | ||
| 326 | + )), | ||
| 327 | + ); | ||
| 328 | + }); | ||
| 329 | + }); | ||
| 330 | + } | ||
| 331 | + | ||
| 88 | @override | 332 | @override |
| 89 | Widget build(BuildContext context) { | 333 | Widget build(BuildContext context) { |
| 90 | // TODO: implement build | 334 | // TODO: implement build |
| 91 | - return SafeArea( | ||
| 92 | - child: detailEntity == null | ||
| 93 | - ? Container( | ||
| 94 | - width: double.infinity, | ||
| 95 | - height: double.infinity, | ||
| 96 | - color: MyColours.color_ffffff, | ||
| 97 | - ) | ||
| 98 | - : Container( | ||
| 99 | - color: MyColours.color_ffffff, | ||
| 100 | - child: Column( | ||
| 101 | - children: <Widget>[ | ||
| 102 | - MyAppBar( | ||
| 103 | - "订座详情", | ||
| 104 | - showBack: true, | ||
| 105 | - ), | ||
| 106 | - Expanded( | ||
| 107 | - child: DefaultTextStyle( | ||
| 108 | - style: TextStyle(decoration: TextDecoration.none), | ||
| 109 | - child: Container( | ||
| 110 | - color: MyColours.color_ffffff, | ||
| 111 | - child: SingleChildScrollView( | ||
| 112 | - child: Container( | ||
| 113 | - color: MyColours.color_ffffff, | ||
| 114 | - padding: EdgeInsets.symmetric( | ||
| 115 | - horizontal: ScreenUtil().setWidth(43)), | ||
| 116 | - child: Column( | ||
| 117 | - children: <Widget>[ | ||
| 118 | - RowMultiText("用餐时段", detailEntity.ddateMd), | ||
| 119 | - Stack( | ||
| 120 | - alignment: Alignment.center, | ||
| 121 | - children: <Widget>[ | ||
| 122 | - Column( | ||
| 123 | - children: <Widget>[ | ||
| 124 | - RowMultiText( | ||
| 125 | - "用餐时间", detailEntity.ddateHm), | ||
| 126 | - Offstage( | ||
| 127 | - offstage: detailEntity.type == "0" | ||
| 128 | - ? false | ||
| 129 | - : true, | ||
| 130 | - child: RowMultiText( | ||
| 131 | - "用餐人数", detailEntity.pnum), | ||
| 132 | - ) | ||
| 133 | - ], | ||
| 134 | - ), | ||
| 135 | - Image.asset( | ||
| 136 | - detailEntity.statuImgAssets, | ||
| 137 | - width: ScreenUtil().setWidth(100), | ||
| 138 | - height: ScreenUtil().setWidth(30), | ||
| 139 | - ) | ||
| 140 | - ], | ||
| 141 | - ), | ||
| 142 | - Offstage( | ||
| 143 | - offstage: detailEntity.demands.length <= 0 | ||
| 144 | - ? true | ||
| 145 | - : false, | ||
| 146 | - child: Column( | 335 | + return detailEntity == null |
| 336 | + ? Container( | ||
| 337 | + width: double.infinity, | ||
| 338 | + height: double.infinity, | ||
| 339 | + color: MyColours.color_ffffff, | ||
| 340 | + ) | ||
| 341 | + : Container( | ||
| 342 | + color: MyColours.color_ffffff, | ||
| 343 | + child: Column( | ||
| 344 | + children: <Widget>[ | ||
| 345 | + SizedBox(height: ScreenUtil.statusBarHeight), | ||
| 346 | + MyAppBar( | ||
| 347 | + "订座详情", | ||
| 348 | + showBack: true, | ||
| 349 | + ), | ||
| 350 | + Expanded( | ||
| 351 | + child: DefaultTextStyle( | ||
| 352 | + style: TextStyle(decoration: TextDecoration.none), | ||
| 353 | + child: Container( | ||
| 354 | + color: MyColours.color_ffffff, | ||
| 355 | + child: SingleChildScrollView( | ||
| 356 | + child: Container( | ||
| 357 | + color: MyColours.color_ffffff, | ||
| 358 | + padding: EdgeInsets.symmetric( | ||
| 359 | + horizontal: ScreenUtil().setWidth(43)), | ||
| 360 | + child: Column( | ||
| 361 | + children: <Widget>[ | ||
| 362 | + RowMultiText("用餐时段", detailEntity.ddateMd), | ||
| 363 | + Stack( | ||
| 364 | + alignment: Alignment.center, | ||
| 365 | + children: <Widget>[ | ||
| 366 | + Column( | ||
| 147 | children: <Widget>[ | 367 | children: <Widget>[ |
| 148 | RowMultiText( | 368 | RowMultiText( |
| 149 | - "包间需求", | ||
| 150 | - (detailEntity.demands.length | ||
| 151 | - .toString() + | ||
| 152 | - "个") ?? | ||
| 153 | - ""), | ||
| 154 | - Align( | ||
| 155 | - alignment: Alignment.centerRight, | ||
| 156 | - child: Offstage( | ||
| 157 | - offstage: detailEntity | ||
| 158 | - .demands.length > | ||
| 159 | - 0 | ||
| 160 | - ? false | ||
| 161 | - : true, | ||
| 162 | - child: Container( | ||
| 163 | - height: ScreenUtil() | ||
| 164 | - .setHeight(210), | ||
| 165 | - child: ListView.builder( | ||
| 166 | - itemBuilder: | ||
| 167 | - (BuildContext contxt, | ||
| 168 | - int index) { | ||
| 169 | - return NeedItem( | ||
| 170 | - detailEntity | ||
| 171 | - .demands[index]); | ||
| 172 | - }, | ||
| 173 | - itemCount: detailEntity | ||
| 174 | - .demands.length, | ||
| 175 | - shrinkWrap: true, | ||
| 176 | - scrollDirection: | ||
| 177 | - Axis.horizontal, | ||
| 178 | - ), | ||
| 179 | - ), | ||
| 180 | - )) | 369 | + "用餐时间", detailEntity.ddateHm), |
| 370 | + Offstage( | ||
| 371 | + offstage: detailEntity.type == "0" | ||
| 372 | + ? false | ||
| 373 | + : true, | ||
| 374 | + child: RowMultiText( | ||
| 375 | + "用餐人数", detailEntity.pnum), | ||
| 376 | + ) | ||
| 181 | ], | 377 | ], |
| 182 | ), | 378 | ), |
| 379 | + Image.asset( | ||
| 380 | + detailEntity.statuImgAssets, | ||
| 381 | + width: ScreenUtil().setWidth(100), | ||
| 382 | + height: ScreenUtil().setWidth(30), | ||
| 383 | + ) | ||
| 384 | + ], | ||
| 385 | + ), | ||
| 386 | + Offstage( | ||
| 387 | + offstage: detailEntity.demands.length <= 0 | ||
| 388 | + ? true | ||
| 389 | + : false, | ||
| 390 | + child: Column( | ||
| 391 | + children: <Widget>[ | ||
| 392 | + RowMultiText( | ||
| 393 | + "包间需求", | ||
| 394 | + (detailEntity.demands.length | ||
| 395 | + .toString() + | ||
| 396 | + "个") ?? | ||
| 397 | + ""), | ||
| 398 | + Align( | ||
| 399 | + alignment: Alignment.centerRight, | ||
| 400 | + child: Offstage( | ||
| 401 | + offstage: | ||
| 402 | + detailEntity.demands.length > | ||
| 403 | + 0 | ||
| 404 | + ? false | ||
| 405 | + : true, | ||
| 406 | + child: Container( | ||
| 407 | + height: | ||
| 408 | + ScreenUtil().setHeight(210), | ||
| 409 | + child: ListView.builder( | ||
| 410 | + itemBuilder: | ||
| 411 | + (BuildContext contxt, | ||
| 412 | + int index) { | ||
| 413 | + return NeedItem(detailEntity | ||
| 414 | + .demands[index]); | ||
| 415 | + }, | ||
| 416 | + itemCount: detailEntity | ||
| 417 | + .demands.length, | ||
| 418 | + shrinkWrap: true, | ||
| 419 | + scrollDirection: | ||
| 420 | + Axis.horizontal, | ||
| 421 | + ), | ||
| 422 | + ), | ||
| 423 | + )) | ||
| 424 | + ], | ||
| 183 | ), | 425 | ), |
| 184 | - RowMultiText( | ||
| 185 | - "预订桌位", | ||
| 186 | - (detailEntity.tables.length.toString() + | ||
| 187 | - "个")), | ||
| 188 | - Align( | ||
| 189 | - alignment: Alignment.centerRight, | ||
| 190 | - child: Offstage( | ||
| 191 | - offstage: | ||
| 192 | - detailEntity.tables.length > 0 | ||
| 193 | - ? false | ||
| 194 | - : true, | ||
| 195 | - child: Container( | ||
| 196 | - height: ScreenUtil().setHeight(210), | ||
| 197 | - child: ListView.builder( | ||
| 198 | - itemBuilder: (BuildContext contxt, | ||
| 199 | - int index) { | ||
| 200 | - return TableItem( | ||
| 201 | - detailEntity.tables[index]); | ||
| 202 | - }, | ||
| 203 | - itemCount: | ||
| 204 | - detailEntity.tables.length, | ||
| 205 | - shrinkWrap: true, | ||
| 206 | - scrollDirection: Axis.horizontal, | ||
| 207 | - ), | 426 | + ), |
| 427 | + RowMultiText( | ||
| 428 | + "预订桌位", | ||
| 429 | + (detailEntity.tables.length.toString() + | ||
| 430 | + "个")), | ||
| 431 | + Align( | ||
| 432 | + alignment: Alignment.centerRight, | ||
| 433 | + child: Offstage( | ||
| 434 | + offstage: detailEntity.tables.length > 0 | ||
| 435 | + ? false | ||
| 436 | + : true, | ||
| 437 | + child: Container( | ||
| 438 | + height: ScreenUtil().setHeight(210), | ||
| 439 | + child: ListView.builder( | ||
| 440 | + itemBuilder: (BuildContext contxt, | ||
| 441 | + int index) { | ||
| 442 | + return TableItem( | ||
| 443 | + detailEntity.tables[index]); | ||
| 444 | + }, | ||
| 445 | + itemCount: | ||
| 446 | + detailEntity.tables.length, | ||
| 447 | + shrinkWrap: true, | ||
| 448 | + scrollDirection: Axis.horizontal, | ||
| 208 | ), | 449 | ), |
| 209 | - )), | ||
| 210 | - RowMultiText("客户姓名", detailEntity.rnameStr), | ||
| 211 | - RowMultiText( | ||
| 212 | - "客户电话", detailEntity.phone ?? ""), | ||
| 213 | - RowMultiText( | ||
| 214 | - "备注信息", detailEntity.cusdem ?? ""), | ||
| 215 | - MyDivider(double.infinity, | ||
| 216 | - ScreenUtil().setHeight(1)), | ||
| 217 | - Container( | ||
| 218 | - color: MyColours.color_ffffff, | ||
| 219 | - width: double.infinity, | ||
| 220 | - height: ScreenUtil().setHeight(80), | 450 | + ), |
| 451 | + )), | ||
| 452 | + RowMultiText("客户姓名", detailEntity.rnameStr), | ||
| 453 | + RowMultiText( | ||
| 454 | + "客户电话", detailEntity.phone ?? ""), | ||
| 455 | + RowMultiText( | ||
| 456 | + "备注信息", detailEntity.cusdem ?? ""), | ||
| 457 | + MyDivider(double.infinity, | ||
| 458 | + ScreenUtil().setHeight(1)), | ||
| 459 | + Container( | ||
| 460 | + color: MyColours.color_ffffff, | ||
| 461 | + width: double.infinity, | ||
| 462 | + height: ScreenUtil().setHeight(80), | ||
| 463 | + alignment: Alignment.center, | ||
| 464 | + child: Stack( | ||
| 221 | alignment: Alignment.center, | 465 | alignment: Alignment.center, |
| 222 | - child: Stack( | ||
| 223 | - alignment: Alignment.center, | ||
| 224 | - children: <Widget>[ | ||
| 225 | - Positioned( | ||
| 226 | - left: 0, | ||
| 227 | - child: Text( | ||
| 228 | - "客户经理", | ||
| 229 | - style: TextStyle( | ||
| 230 | - color: MyColours.color_828282, | ||
| 231 | - fontSize: | ||
| 232 | - ScreenUtil().setSp(30)), | ||
| 233 | - ), | 466 | + children: <Widget>[ |
| 467 | + Positioned( | ||
| 468 | + left: 0, | ||
| 469 | + child: Text( | ||
| 470 | + "客户经理", | ||
| 471 | + style: TextStyle( | ||
| 472 | + color: MyColours.color_828282, | ||
| 473 | + fontSize: | ||
| 474 | + ScreenUtil().setSp(30)), | ||
| 234 | ), | 475 | ), |
| 235 | - Positioned( | ||
| 236 | - right: 0, | ||
| 237 | - child: GestureDetector( | ||
| 238 | - onTap: () async { | ||
| 239 | - List<String> list = []; | ||
| 240 | - for (Manager manager | ||
| 241 | - in managers) { | ||
| 242 | - list.add( | ||
| 243 | - manager.roleUserName); | 476 | + ), |
| 477 | + Positioned( | ||
| 478 | + right: 0, | ||
| 479 | + child: GestureDetector( | ||
| 480 | + onTap: () async { | ||
| 481 | + List<String> list = []; | ||
| 482 | + for (Manager manager | ||
| 483 | + in managers) { | ||
| 484 | + list.add(manager.roleUserName); | ||
| 485 | + } | ||
| 486 | + DialogUtil.showSelectCusmanDialog( | ||
| 487 | + context, list) | ||
| 488 | + .then((value) { | ||
| 489 | + if (value != null) { | ||
| 490 | + setState(() { | ||
| 491 | + cusmanText = | ||
| 492 | + managers[value.first] | ||
| 493 | + .userName; | ||
| 494 | + }); | ||
| 495 | + _setCurrManager(); | ||
| 244 | } | 496 | } |
| 245 | - DialogUtil | ||
| 246 | - .showSelectCusmanDialog( | ||
| 247 | - context, list) | ||
| 248 | - .then((value) { | ||
| 249 | - if (value != null) { | ||
| 250 | - setState(() { | ||
| 251 | - cusmanText = | ||
| 252 | - managers[value.first] | ||
| 253 | - .userName; | ||
| 254 | - }); | ||
| 255 | - _setCurrManager(); | ||
| 256 | - } | ||
| 257 | - }); | ||
| 258 | - }, | ||
| 259 | - child: Text( | ||
| 260 | - cusmanText, | ||
| 261 | - style: TextStyle( | ||
| 262 | - color: MyColours.color_353535, | ||
| 263 | - fontSize: | ||
| 264 | - ScreenUtil().setSp(30), | ||
| 265 | - decoration: | ||
| 266 | - TextDecoration.underline, | ||
| 267 | - ), | 497 | + }); |
| 498 | + }, | ||
| 499 | + child: Text( | ||
| 500 | + cusmanText, | ||
| 501 | + style: TextStyle( | ||
| 502 | + color: MyColours.color_353535, | ||
| 503 | + fontSize: | ||
| 504 | + ScreenUtil().setSp(30), | ||
| 505 | + decoration: | ||
| 506 | + TextDecoration.underline, | ||
| 268 | ), | 507 | ), |
| 269 | ), | 508 | ), |
| 270 | - ) | ||
| 271 | - ], | ||
| 272 | - ), | 509 | + ), |
| 510 | + ) | ||
| 511 | + ], | ||
| 273 | ), | 512 | ), |
| 274 | - RowMultiText( | ||
| 275 | - "记录人", detailEntity.note_name ?? ""), | ||
| 276 | - Offstage( | ||
| 277 | - offstage: (detailEntity.status == "4" && | ||
| 278 | - detailEntity.cancel != null) | ||
| 279 | - ? false | ||
| 280 | - : true, | ||
| 281 | - child: Column( | ||
| 282 | - children: <Widget>[ | ||
| 283 | - MyDivider(double.infinity, | ||
| 284 | - ScreenUtil().setHeight(2)), | ||
| 285 | - RowMultiText("取消原因", | ||
| 286 | - detailEntity.cancel?.desc ?? ""), | ||
| 287 | - RowMultiText( | ||
| 288 | - "取消时间", | ||
| 289 | - detailEntity.cancel?.cdateStr ?? | ||
| 290 | - ""), | ||
| 291 | - RowMultiText("操作人", | ||
| 292 | - detailEntity.cancel?.uname ?? ""), | ||
| 293 | - ], | ||
| 294 | - ), | 513 | + ), |
| 514 | + RowMultiText( | ||
| 515 | + "记录人", detailEntity.note_name ?? ""), | ||
| 516 | + Offstage( | ||
| 517 | + offstage: (detailEntity.status == "4" && | ||
| 518 | + detailEntity.cancel != null) | ||
| 519 | + ? false | ||
| 520 | + : true, | ||
| 521 | + child: Column( | ||
| 522 | + children: <Widget>[ | ||
| 523 | + MyDivider(double.infinity, | ||
| 524 | + ScreenUtil().setHeight(2)), | ||
| 525 | + RowMultiText("取消原因", | ||
| 526 | + detailEntity.cancel?.desc ?? "", | ||
| 527 | + textAlign: TextAlign.left), | ||
| 528 | + RowMultiText( | ||
| 529 | + "取消时间", | ||
| 530 | + detailEntity.cancel?.cdateStr ?? | ||
| 531 | + ""), | ||
| 532 | + RowMultiText("操作人", | ||
| 533 | + detailEntity.cancel?.uname ?? ""), | ||
| 534 | + ], | ||
| 295 | ), | 535 | ), |
| 296 | - ], | ||
| 297 | - )), | ||
| 298 | - ), | ||
| 299 | - )), | ||
| 300 | - ), | ||
| 301 | - Offstage( | ||
| 302 | - offstage: (detailEntity.status == "3" || | ||
| 303 | - detailEntity.status == "4" || | ||
| 304 | - detailEntity.status == "6") | ||
| 305 | - ? true | ||
| 306 | - : false, | ||
| 307 | - child: Container( | ||
| 308 | - width: double.infinity, | ||
| 309 | - decoration: BoxDecoration( | ||
| 310 | - color: MyColours.color_ffffff, | ||
| 311 | - border: Border( | ||
| 312 | - top: BorderSide( | ||
| 313 | - color: MyColours.color_dbe3e3, | ||
| 314 | - width: ScreenUtil().setWidth(1)))), | ||
| 315 | - padding: EdgeInsets.symmetric( | ||
| 316 | - horizontal: ScreenUtil().setHeight(40)), | ||
| 317 | - margin: EdgeInsets.symmetric( | ||
| 318 | - vertical: ScreenUtil().setHeight(20)), | ||
| 319 | - child: CommonButton( | ||
| 320 | - content: "通知客户", | ||
| 321 | - width: 669, | ||
| 322 | - height: 80, | ||
| 323 | - fontSize: 34, | ||
| 324 | - onPress: () { | ||
| 325 | - DialogUtil.showShareDialog(context)?.then((value) { | ||
| 326 | - switch (value) { | ||
| 327 | - case 1: //微信 | ||
| 328 | - NavigatorUtil.goInvicationPage( | ||
| 329 | - context, | ||
| 330 | - detailEntity.id, | ||
| 331 | - detailEntity.tableinfoStr, | ||
| 332 | - detailEntity.ddate, | ||
| 333 | - detailEntity.ddateStr); | ||
| 334 | - break; | ||
| 335 | - case 2: //短信 | ||
| 336 | - NavigatorUtil.goSmsPage( | ||
| 337 | - context, detailEntity.id); | ||
| 338 | - break; | ||
| 339 | - case 3: //电话 | ||
| 340 | - if (detailEntity.phone != null && | ||
| 341 | - detailEntity.phone.isNotEmpty) { | ||
| 342 | - Utils.goPhone(detailEntity.phone); | ||
| 343 | - } else { | ||
| 344 | - Utils.showToast("没有客户电话!"); | ||
| 345 | - } | ||
| 346 | - break; | ||
| 347 | - } | ||
| 348 | - }); | ||
| 349 | - }, | ||
| 350 | - ), | 536 | + ), |
| 537 | + ], | ||
| 538 | + )), | ||
| 539 | + ), | ||
| 540 | + )), | ||
| 541 | + ), | ||
| 542 | + Offstage( | ||
| 543 | + offstage: (detailEntity.status == "3" || | ||
| 544 | + detailEntity.status == "4" || | ||
| 545 | + detailEntity.status == "6") | ||
| 546 | + ? true | ||
| 547 | + : false, | ||
| 548 | + child: Container( | ||
| 549 | + width: double.infinity, | ||
| 550 | + decoration: BoxDecoration( | ||
| 551 | + color: MyColours.color_ffffff, | ||
| 552 | + border: Border( | ||
| 553 | + top: BorderSide( | ||
| 554 | + color: MyColours.color_dbe3e3, | ||
| 555 | + width: ScreenUtil().setWidth(1)))), | ||
| 556 | + padding: EdgeInsets.symmetric( | ||
| 557 | + horizontal: ScreenUtil().setHeight(40)), | ||
| 558 | + margin: EdgeInsets.symmetric( | ||
| 559 | + vertical: ScreenUtil().setHeight(20)), | ||
| 560 | + child: CommonButton( | ||
| 561 | + content: "通知客户", | ||
| 562 | + width: 669, | ||
| 563 | + height: 80, | ||
| 564 | + fontSize: 34, | ||
| 565 | + onPress: () { | ||
| 566 | + DialogUtil.showShareDialog(context)?.then((value) { | ||
| 567 | + switch (value) { | ||
| 568 | + case 1: //微信 | ||
| 569 | + NavigatorUtil.goInvicationPage( | ||
| 570 | + context, | ||
| 571 | + detailEntity.id, | ||
| 572 | + detailEntity.tableinfoStr, | ||
| 573 | + detailEntity.ddate, | ||
| 574 | + detailEntity.ddateStr); | ||
| 575 | + break; | ||
| 576 | + case 2: //短信 | ||
| 577 | + NavigatorUtil.goSmsPage(context, detailEntity.id); | ||
| 578 | + break; | ||
| 579 | + case 3: //电话 | ||
| 580 | + if (detailEntity.phone != null && | ||
| 581 | + detailEntity.phone.isNotEmpty) { | ||
| 582 | + Utils.goPhone(detailEntity.phone); | ||
| 583 | + } else { | ||
| 584 | + Utils.showToast("没有客户电话!"); | ||
| 585 | + } | ||
| 586 | + break; | ||
| 587 | + } | ||
| 588 | + }); | ||
| 589 | + }, | ||
| 351 | ), | 590 | ), |
| 352 | ), | 591 | ), |
| 353 | - Offstage( | ||
| 354 | - offstage: (detailEntity.status == "3" || | ||
| 355 | - detailEntity.status == "4" || | ||
| 356 | - detailEntity.status == "6") | ||
| 357 | - ? true | ||
| 358 | - : false, | ||
| 359 | - child: Container( | ||
| 360 | - width: double.infinity, | ||
| 361 | - height: ScreenUtil().setWidth(80), | ||
| 362 | - margin: EdgeInsets.symmetric( | ||
| 363 | - horizontal: ScreenUtil().setHeight(40)), | ||
| 364 | - decoration: BoxDecoration( | ||
| 365 | - border: Border.all( | ||
| 366 | - color: MyColours.color_199095, | ||
| 367 | - width: ScreenUtil().setWidth(2)), | ||
| 368 | - borderRadius: | ||
| 369 | - BorderRadius.circular(ScreenUtil().setWidth(5)), | ||
| 370 | - ), | ||
| 371 | - // child: Text('fff'), | ||
| 372 | - child: Material( | ||
| 373 | - child: Row( | ||
| 374 | - children: [ | ||
| 375 | - Expanded( | ||
| 376 | - child: _cancelAndChangeBtn(() { | ||
| 377 | - print('点击变更预订'); | ||
| 378 | - }, '变更预订')), | ||
| 379 | - MyDivider( | ||
| 380 | - ScreenUtil().setWidth(2), | ||
| 381 | - ScreenUtil().setWidth(50), | ||
| 382 | - color: MyColours.color_199095, | ||
| 383 | - ), | ||
| 384 | - Expanded( | ||
| 385 | - child: _cancelAndChangeBtn(() { | ||
| 386 | - print('点击取消预订'); | ||
| 387 | - }, '取消预订')), | ||
| 388 | - ], | ||
| 389 | - )), | 592 | + ), |
| 593 | + Offstage( | ||
| 594 | + offstage: (detailEntity.status == "3" || | ||
| 595 | + detailEntity.status == "4" || | ||
| 596 | + detailEntity.status == "6") | ||
| 597 | + ? true | ||
| 598 | + : false, | ||
| 599 | + child: Container( | ||
| 600 | + width: double.infinity, | ||
| 601 | + height: ScreenUtil().setWidth(80), | ||
| 602 | + margin: EdgeInsets.symmetric( | ||
| 603 | + horizontal: ScreenUtil().setHeight(40)), | ||
| 604 | + decoration: BoxDecoration( | ||
| 605 | + border: Border.all( | ||
| 606 | + color: MyColours.color_199095, | ||
| 607 | + width: ScreenUtil().setWidth(2)), | ||
| 608 | + borderRadius: | ||
| 609 | + BorderRadius.circular(ScreenUtil().setWidth(5)), | ||
| 390 | ), | 610 | ), |
| 611 | + // child: Text('fff'), | ||
| 612 | + child: Material( | ||
| 613 | + child: Row( | ||
| 614 | + children: [ | ||
| 615 | + Expanded( | ||
| 616 | + child: _cancelAndChangeBtn(() { | ||
| 617 | + print('点击变更预订'); | ||
| 618 | + }, '变更预订')), | ||
| 619 | + MyDivider( | ||
| 620 | + ScreenUtil().setWidth(2), | ||
| 621 | + ScreenUtil().setWidth(50), | ||
| 622 | + color: MyColours.color_199095, | ||
| 623 | + ), | ||
| 624 | + Expanded( | ||
| 625 | + child: _cancelAndChangeBtn(() { | ||
| 626 | + _showCancelWidget(context); | ||
| 627 | + }, '取消预订')), | ||
| 628 | + ], | ||
| 629 | + )), | ||
| 391 | ), | 630 | ), |
| 392 | - VEmptyView(ScreenUtil().setWidth(60)) | ||
| 393 | - ], | ||
| 394 | - ), | 631 | + ), |
| 632 | + VEmptyView(ScreenUtil().setWidth(60)) | ||
| 633 | + ], | ||
| 395 | ), | 634 | ), |
| 396 | - ); | 635 | + ); |
| 397 | } | 636 | } |
| 398 | } | 637 | } |
| @@ -9,14 +9,15 @@ import 'package:one_key/provider/user_model.dart'; | @@ -9,14 +9,15 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 9 | import 'package:one_key/utils/navigator_util.dart'; | 9 | import 'package:one_key/utils/navigator_util.dart'; |
| 10 | import 'package:one_key/utils/utils.dart'; | 10 | import 'package:one_key/utils/utils.dart'; |
| 11 | import 'package:provider/provider.dart'; | 11 | import 'package:provider/provider.dart'; |
| 12 | -class NotebookDetailModel extends ChangeNotifier{ | ||
| 13 | - | ||
| 14 | 12 | ||
| 13 | +class NotebookDetailModel extends ChangeNotifier { | ||
| 15 | ///获取已预订订单 | 14 | ///获取已预订订单 |
| 16 | - Future<NotebookDetail> getReserveDetail(BuildContext context,Map<String,String> params) async { | ||
| 17 | - BaseResp<Map<String,dynamic>> baseResp = await DioUtil() | ||
| 18 | - .request<Map<String,dynamic>>(context, Method.get, HttpUrl.reserve_detail, | ||
| 19 | - data: params) | 15 | + Future<NotebookDetail> getReserveDetail( |
| 16 | + BuildContext context, Map<String, String> params) async { | ||
| 17 | + BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 18 | + .request<Map<String, dynamic>>( | ||
| 19 | + context, Method.get, HttpUrl.reserve_detail, | ||
| 20 | + data: params) | ||
| 20 | .catchError((error) { | 21 | .catchError((error) { |
| 21 | print(error.toString()); | 22 | print(error.toString()); |
| 22 | }); | 23 | }); |
| @@ -27,59 +28,71 @@ class NotebookDetailModel extends ChangeNotifier{ | @@ -27,59 +28,71 @@ class NotebookDetailModel extends ChangeNotifier{ | ||
| 27 | 28 | ||
| 28 | ///获取商家信息 | 29 | ///获取商家信息 |
| 29 | Future<List<Manager>> getManagers(BuildContext context) async { | 30 | Future<List<Manager>> getManagers(BuildContext context) async { |
| 30 | - UserModel userModel=Provider.of<UserModel>(context,listen: false); | ||
| 31 | - Map<String,String> params={"seller_id": userModel.user.sellerid, "seller_openid": userModel.user.openid}; | 31 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 32 | + Map<String, String> params = { | ||
| 33 | + "seller_id": userModel.user.sellerid, | ||
| 34 | + "seller_openid": userModel.user.openid | ||
| 35 | + }; | ||
| 32 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | 36 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() |
| 33 | .request<Map<String, dynamic>>(context, Method.get, HttpUrl.sellerinfo, | 37 | .request<Map<String, dynamic>>(context, Method.get, HttpUrl.sellerinfo, |
| 34 | - data: params) | 38 | + data: params) |
| 35 | .catchError((error) { | 39 | .catchError((error) { |
| 36 | print(error.toString()); | 40 | print(error.toString()); |
| 37 | }); | 41 | }); |
| 38 | if (baseResp.code == Constant.status_success) { | 42 | if (baseResp.code == Constant.status_success) { |
| 39 | - return (baseResp.data["manager"] as List).map((value)=>Manager.fromJson(value as Map<String,dynamic>)).toList(); | 43 | + return (baseResp.data["manager"] as List) |
| 44 | + .map((value) => Manager.fromJson(value as Map<String, dynamic>)) | ||
| 45 | + .toList(); | ||
| 40 | } | 46 | } |
| 41 | } | 47 | } |
| 42 | 48 | ||
| 43 | ///设置客户经理 | 49 | ///设置客户经理 |
| 44 | - setReserveCusmnan(BuildContext context,Map<String,String> params) async { | 50 | + setReserveCusmnan(BuildContext context, Map<String, String> params) async { |
| 45 | BaseResp<String> baseResp = await DioUtil() | 51 | BaseResp<String> baseResp = await DioUtil() |
| 46 | .request<String>(context, Method.get, HttpUrl.set_reserve_cusman, | 52 | .request<String>(context, Method.get, HttpUrl.set_reserve_cusman, |
| 47 | - data: params) | 53 | + data: params) |
| 48 | .catchError((error) { | 54 | .catchError((error) { |
| 49 | print(error.toString()); | 55 | print(error.toString()); |
| 50 | }); | 56 | }); |
| 51 | if (baseResp.code == Constant.status_success) { | 57 | if (baseResp.code == Constant.status_success) { |
| 52 | - }else{ | ||
| 53 | - Utils.showToast(baseResp.msg??""); | 58 | + } else { |
| 59 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 54 | } | 60 | } |
| 55 | } | 61 | } |
| 56 | 62 | ||
| 57 | //安排在线预订 | 63 | //安排在线预订 |
| 58 | - setReserveStatus(BuildContext context,Map<String,String> params) async { | ||
| 59 | - BaseResp<Map<String,dynamic>> baseResp = await DioUtil() | ||
| 60 | - .request<Map<String,dynamic>>(context, Method.get, HttpUrl.set_reserve_status, | ||
| 61 | - data: params,showLoading: false) | 64 | + setReserveStatus(BuildContext context, Map<String, String> params, |
| 65 | + {ifPush = true}) async { | ||
| 66 | + BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 67 | + .request<Map<String, dynamic>>( | ||
| 68 | + context, Method.get, HttpUrl.set_reserve_status, | ||
| 69 | + data: params, showLoading: false) | ||
| 62 | .catchError((error) { | 70 | .catchError((error) { |
| 63 | print(error.toString()); | 71 | print(error.toString()); |
| 64 | }); | 72 | }); |
| 65 | - if(baseResp.code==Constant.status_success){ | ||
| 66 | - NavigatorUtil.goNotebookDetailPage(context, params["rid"],replace: true); | ||
| 67 | - }else{ | 73 | + if (baseResp.code == Constant.status_success) { |
| 74 | + if (ifPush) { | ||
| 75 | + NavigatorUtil.goNotebookDetailPage(context, params["rid"], | ||
| 76 | + replace: true); | ||
| 77 | + } else { | ||
| 78 | + return true; | ||
| 79 | + } | ||
| 80 | + } else { | ||
| 68 | Utils.showToast(baseResp.msg); | 81 | Utils.showToast(baseResp.msg); |
| 69 | } | 82 | } |
| 70 | } | 83 | } |
| 71 | 84 | ||
| 72 | //设置消息状态 | 85 | //设置消息状态 |
| 73 | - setMessageStatus(BuildContext context,Map<String,String> params) async { | 86 | + setMessageStatus(BuildContext context, Map<String, String> params) async { |
| 74 | BaseResp<dynamic> baseResp = await DioUtil() | 87 | BaseResp<dynamic> baseResp = await DioUtil() |
| 75 | .request<dynamic>(context, Method.get, HttpUrl.set_message_status, | 88 | .request<dynamic>(context, Method.get, HttpUrl.set_message_status, |
| 76 | - data: params,showLoading: false) | 89 | + data: params, showLoading: false) |
| 77 | .catchError((error) { | 90 | .catchError((error) { |
| 78 | print(error.toString()); | 91 | print(error.toString()); |
| 79 | }); | 92 | }); |
| 80 | - if(baseResp.code==Constant.status_success){ | ||
| 81 | - }else{ | 93 | + if (baseResp.code == Constant.status_success) { |
| 94 | + } else { | ||
| 82 | Utils.showToast(baseResp.msg); | 95 | Utils.showToast(baseResp.msg); |
| 83 | } | 96 | } |
| 84 | } | 97 | } |
| 85 | -} | ||
| 98 | +} |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | 2 | ||
| 3 | class MyColours { | 3 | class MyColours { |
| 4 | - | ||
| 5 | static const Color app_main = Color(0xFF24A4A8); | 4 | static const Color app_main = Color(0xFF24A4A8); |
| 6 | - static const Color color_ffffff=Color(0xffffffff); | ||
| 7 | - static const Color color_fefefe=Color(0xfffefefe); | ||
| 8 | - static const Color color_f5f5f5=Color(0xfff5f5f5); | ||
| 9 | - static const Color color_199095=Color(0xff199095); | ||
| 10 | - static const Color color_999999=Color(0xff999999); | ||
| 11 | - static const Color color_353535=Color(0xff353535); | ||
| 12 | - static const Color color_d8d8d8=Color(0xffD8D8D8); | ||
| 13 | - static const Color color_bff6f7=Color(0xffBFF6F7); | ||
| 14 | - static const Color color_c1c1c1=Color(0xffC1C1C1); | ||
| 15 | - static const Color color_2bb5b7=Color(0xff2BB5B7); | ||
| 16 | - static const Color color_26000000=Color(0x26000000); | ||
| 17 | - static const Color color_d93535=Color(0xffD93535); | ||
| 18 | - static const Color color_E14553=Color(0xffE14553); | ||
| 19 | - static const Color color_131313=Color(0xff131313); | ||
| 20 | - static const Color color_2e000000=Color(0x2e000000); | ||
| 21 | - static const Color color_14000000=Color(0x14000000); | ||
| 22 | - static const Color color_bfbfbf=Color(0xffBFBFBF); | ||
| 23 | - static const Color color_828282=Color(0xff828282); | ||
| 24 | - static const Color color_a8e2e4=Color(0xffA8E2E4); | ||
| 25 | - static const Color color_63a6d1=Color(0xff63A6D1); | ||
| 26 | - static const Color color_666666=Color(0xff666666); | ||
| 27 | - static const Color color_777777=Color(0xff777777); | ||
| 28 | - static const Color color_ea5750=Color(0xffEA5750); | ||
| 29 | - static const Color color_89c0b7=Color(0xff89C0B7); | ||
| 30 | - static const Color color_ededed=Color(0xffededed); | ||
| 31 | - static const Color color_f7fdfd=Color(0xffF7FDFD); | ||
| 32 | - static const Color color_dbe3e3=Color(0xffdbe3e3); | ||
| 33 | - static const Color color_f3f3f3=Color(0xfff3f3f3); | ||
| 34 | - static const Color color_f49a5e=Color(0xffF49A5E); | ||
| 35 | - static const Color color_ff0000=Color(0xffff0000); | ||
| 36 | - static const Color color_000000=Color(0xff000000); | ||
| 37 | - static const Color color_97e9ea=Color(0xff97E9EA); | ||
| 38 | - static const Color color_f1f1f1=Color(0xfff1f1f1); | ||
| 39 | - static const Color color_eadab9=Color(0xffeadab9); | ||
| 40 | - static const Color color_e3d2ac=Color(0xffe3d2ac); | ||
| 41 | - static const Color color_83734d=Color(0xff83734d); | ||
| 42 | - static const Color color_dfdfdf=Color(0xffdfdfdf); | 5 | + static const Color color_ffffff = Color(0xffffffff); |
| 6 | + static const Color color_fefefe = Color(0xfffefefe); | ||
| 7 | + static const Color color_f5f5f5 = Color(0xfff5f5f5); | ||
| 8 | + static const Color color_199095 = Color(0xff199095); | ||
| 9 | + static const Color color_999999 = Color(0xff999999); | ||
| 10 | + static const Color color_353535 = Color(0xff353535); | ||
| 11 | + static const Color color_d8d8d8 = Color(0xffD8D8D8); | ||
| 12 | + static const Color color_bff6f7 = Color(0xffBFF6F7); | ||
| 13 | + static const Color color_c1c1c1 = Color(0xffC1C1C1); | ||
| 14 | + static const Color color_2bb5b7 = Color(0xff2BB5B7); | ||
| 15 | + static const Color color_26000000 = Color(0x26000000); | ||
| 16 | + static const Color color_d93535 = Color(0xffD93535); | ||
| 17 | + static const Color color_E14553 = Color(0xffE14553); | ||
| 18 | + static const Color color_131313 = Color(0xff131313); | ||
| 19 | + static const Color color_2e000000 = Color(0x2e000000); | ||
| 20 | + static const Color color_14000000 = Color(0x14000000); | ||
| 21 | + static const Color color_bfbfbf = Color(0xffBFBFBF); | ||
| 22 | + static const Color color_828282 = Color(0xff828282); | ||
| 23 | + static const Color color_a8e2e4 = Color(0xffA8E2E4); | ||
| 24 | + static const Color color_63a6d1 = Color(0xff63A6D1); | ||
| 25 | + static const Color color_666666 = Color(0xff666666); | ||
| 26 | + static const Color color_777777 = Color(0xff777777); | ||
| 27 | + static const Color color_ea5750 = Color(0xffEA5750); | ||
| 28 | + static const Color color_89c0b7 = Color(0xff89C0B7); | ||
| 29 | + static const Color color_ededed = Color(0xffededed); | ||
| 30 | + static const Color color_f7fdfd = Color(0xffF7FDFD); | ||
| 31 | + static const Color color_dbe3e3 = Color(0xffdbe3e3); | ||
| 32 | + static const Color color_f3f3f3 = Color(0xfff3f3f3); | ||
| 33 | + static const Color color_f49a5e = Color(0xffF49A5E); | ||
| 34 | + static const Color color_ff0000 = Color(0xffff0000); | ||
| 35 | + static const Color color_000000 = Color(0xff000000); | ||
| 36 | + static const Color color_97e9ea = Color(0xff97E9EA); | ||
| 37 | + static const Color color_f1f1f1 = Color(0xfff1f1f1); | ||
| 38 | + static const Color color_eadab9 = Color(0xffeadab9); | ||
| 39 | + static const Color color_e3d2ac = Color(0xffe3d2ac); | ||
| 40 | + static const Color color_83734d = Color(0xff83734d); | ||
| 41 | + static const Color color_dfdfdf = Color(0xffdfdfdf); | ||
| 42 | + static const Color color_333333 = Color(0xff333333); | ||
| 43 | } | 43 | } |
| 44 | - |
lib/widgets/dialog.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | + | ||
| 3 | +class ShowDialog extends Dialog { | ||
| 4 | + Widget child; | ||
| 5 | + ShowDialog({Key key, this.child}) : super(key: key); | ||
| 6 | + @override | ||
| 7 | + Widget build(BuildContext context) { | ||
| 8 | + return Material( | ||
| 9 | + //透明层 | ||
| 10 | + type: MaterialType.transparency, | ||
| 11 | + child: Stack( | ||
| 12 | + children: <Widget>[ | ||
| 13 | + InkWell( | ||
| 14 | + onTap: () { | ||
| 15 | + Navigator.pop(context); | ||
| 16 | + }, | ||
| 17 | + child: Container( | ||
| 18 | + width: MediaQuery.of(context).size.width, | ||
| 19 | + height: MediaQuery.of(context).size.height, | ||
| 20 | + ), | ||
| 21 | + ), | ||
| 22 | + child //内容 | ||
| 23 | + ], | ||
| 24 | + )); | ||
| 25 | + } | ||
| 26 | +} |
lib/widgets/round_button.dart
0 → 100644
| 1 | +import 'package:common_utils/common_utils.dart'; | ||
| 2 | +import 'package:flutter/material.dart'; | ||
| 3 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 4 | +import 'package:one_key/res/colors.dart'; | ||
| 5 | + | ||
| 6 | +class RoundButton extends StatelessWidget { | ||
| 7 | + const RoundButton( | ||
| 8 | + {Key key, | ||
| 9 | + this.width, | ||
| 10 | + this.height = 50, | ||
| 11 | + this.margin, | ||
| 12 | + this.radius, | ||
| 13 | + this.bgColor, | ||
| 14 | + this.highlightColor, | ||
| 15 | + this.splashColor, | ||
| 16 | + this.child, | ||
| 17 | + this.text, | ||
| 18 | + this.style, | ||
| 19 | + this.onPressed, | ||
| 20 | + this.image, | ||
| 21 | + this.imgWidth = 13.0, | ||
| 22 | + this.fontSize = 24, | ||
| 23 | + this.gradientStart = MyColours.color_199095, | ||
| 24 | + this.gradientEnd = MyColours.color_199095, | ||
| 25 | + this.textColor = Colors.white, | ||
| 26 | + this.borderColor = Colors.transparent, this.isBold = true}) | ||
| 27 | + : super(key: key); | ||
| 28 | + | ||
| 29 | + final String image; | ||
| 30 | + final double width; | ||
| 31 | + final double height; | ||
| 32 | + final double imgWidth; | ||
| 33 | + final double fontSize; | ||
| 34 | + final Color textColor; | ||
| 35 | + final bool isBold; | ||
| 36 | + | ||
| 37 | + /// Empty space to surround the [decoration] and [child]. | ||
| 38 | + final EdgeInsetsGeometry margin; | ||
| 39 | + | ||
| 40 | + final double radius; | ||
| 41 | + final Color bgColor; | ||
| 42 | + final Color highlightColor; | ||
| 43 | + final Color splashColor; | ||
| 44 | + final Color gradientStart; | ||
| 45 | + final Color gradientEnd; | ||
| 46 | + final Widget child; | ||
| 47 | + final Color borderColor; | ||
| 48 | + | ||
| 49 | + final String text; | ||
| 50 | + final TextStyle style; | ||
| 51 | + | ||
| 52 | + final VoidCallback onPressed; | ||
| 53 | + | ||
| 54 | + @override | ||
| 55 | + Widget build(BuildContext context) { | ||
| 56 | + Color _bgColor = bgColor ?? Theme.of(context).primaryColor; | ||
| 57 | + BorderRadius _borderRadius = BorderRadius.circular(radius ?? (height / 2)); | ||
| 58 | + return new Container( | ||
| 59 | + width: width, | ||
| 60 | + height: height, | ||
| 61 | + margin: margin, | ||
| 62 | + decoration: BoxDecoration( | ||
| 63 | + borderRadius: _borderRadius, | ||
| 64 | + border: Border.all(color: borderColor, width: ScreenUtil().setWidth(2)), | ||
| 65 | + gradient: LinearGradient( | ||
| 66 | + begin: Alignment.topLeft, | ||
| 67 | + end: Alignment.bottomRight, | ||
| 68 | + colors: [ | ||
| 69 | + gradientStart, | ||
| 70 | + gradientEnd, | ||
| 71 | + ], | ||
| 72 | + ), | ||
| 73 | + ), | ||
| 74 | + child: new InkWell( | ||
| 75 | + borderRadius: _borderRadius, | ||
| 76 | + onTap: () => onPressed(), | ||
| 77 | + child: child ?? | ||
| 78 | + new Center( | ||
| 79 | + child: Row( | ||
| 80 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 81 | + children: <Widget>[ | ||
| 82 | + !ObjectUtil.isEmptyString(image) | ||
| 83 | + ? Padding( | ||
| 84 | + padding: EdgeInsets.only(right: 6, bottom: 3), | ||
| 85 | + child: Image.asset( | ||
| 86 | + image, | ||
| 87 | + width: ScreenUtil().setWidth(imgWidth), | ||
| 88 | + ), | ||
| 89 | + ) | ||
| 90 | + : Text(''), | ||
| 91 | + Text( | ||
| 92 | + text, | ||
| 93 | + style: style ?? | ||
| 94 | + new TextStyle( | ||
| 95 | + color: textColor, | ||
| 96 | + fontSize:ScreenUtil().setSp(fontSize), | ||
| 97 | + fontWeight: isBold ? FontWeight.bold : FontWeight.normal), | ||
| 98 | + ) | ||
| 99 | + ], | ||
| 100 | + ), | ||
| 101 | + ), | ||
| 102 | + )); | ||
| 103 | + } | ||
| 104 | +} |
| @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; | @@ -2,12 +2,12 @@ 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/res/colors.dart'; | 3 | import 'package:one_key/res/colors.dart'; |
| 4 | 4 | ||
| 5 | -class RowMultiText extends StatelessWidget{ | ||
| 6 | - | 5 | +class RowMultiText extends StatelessWidget { |
| 7 | final String title; | 6 | final String title; |
| 8 | final String content; | 7 | final String content; |
| 8 | + final TextAlign textAlign; | ||
| 9 | 9 | ||
| 10 | - RowMultiText(this.title, this.content); | 10 | + RowMultiText(this.title, this.content, {this.textAlign = TextAlign.right}); |
| 11 | 11 | ||
| 12 | @override | 12 | @override |
| 13 | Widget build(BuildContext context) { | 13 | Widget build(BuildContext context) { |
| @@ -22,17 +22,27 @@ class RowMultiText extends StatelessWidget{ | @@ -22,17 +22,27 @@ class RowMultiText extends StatelessWidget{ | ||
| 22 | children: <Widget>[ | 22 | children: <Widget>[ |
| 23 | Align( | 23 | Align( |
| 24 | alignment: Alignment.centerLeft, | 24 | alignment: Alignment.centerLeft, |
| 25 | - child: Text(title,style: TextStyle(color: MyColours.color_828282,fontSize: ScreenUtil().setSp(30)),), | 25 | + child: Text( |
| 26 | + title, | ||
| 27 | + style: TextStyle( | ||
| 28 | + color: MyColours.color_828282, | ||
| 29 | + fontSize: ScreenUtil().setSp(30)), | ||
| 30 | + ), | ||
| 26 | ), | 31 | ), |
| 27 | Expanded( | 32 | Expanded( |
| 28 | child: Container( | 33 | child: Container( |
| 29 | alignment: Alignment.centerRight, | 34 | alignment: Alignment.centerRight, |
| 30 | margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)), | 35 | margin: EdgeInsets.only(left: ScreenUtil().setWidth(20)), |
| 31 | - child: Text(content,style: TextStyle(color: MyColours.color_353535,fontSize: ScreenUtil().setSp(30)),softWrap: true,textAlign: TextAlign.right,), | 36 | + child: Text(content, |
| 37 | + style: TextStyle( | ||
| 38 | + color: MyColours.color_353535, | ||
| 39 | + fontSize: ScreenUtil().setSp(30)), | ||
| 40 | + softWrap: true, | ||
| 41 | + textAlign: this.textAlign), | ||
| 32 | ), | 42 | ), |
| 33 | ) | 43 | ) |
| 34 | ], | 44 | ], |
| 35 | ), | 45 | ), |
| 36 | ); | 46 | ); |
| 37 | } | 47 | } |
| 38 | -} | ||
| 48 | +} |
| @@ -141,6 +141,13 @@ packages: | @@ -141,6 +141,13 @@ packages: | ||
| 141 | url: "https://pub.flutter-io.cn" | 141 | url: "https://pub.flutter-io.cn" |
| 142 | source: hosted | 142 | source: hosted |
| 143 | version: "1.14.13" | 143 | version: "1.14.13" |
| 144 | + common_utils: | ||
| 145 | + dependency: "direct main" | ||
| 146 | + description: | ||
| 147 | + name: common_utils | ||
| 148 | + url: "https://pub.flutter-io.cn" | ||
| 149 | + source: hosted | ||
| 150 | + version: "1.2.1" | ||
| 144 | connectivity: | 151 | connectivity: |
| 145 | dependency: "direct main" | 152 | dependency: "direct main" |
| 146 | description: | 153 | description: |
| @@ -218,6 +225,13 @@ packages: | @@ -218,6 +225,13 @@ packages: | ||
| 218 | url: "https://pub.flutter-io.cn" | 225 | url: "https://pub.flutter-io.cn" |
| 219 | source: hosted | 226 | source: hosted |
| 220 | version: "1.2.9" | 227 | version: "1.2.9" |
| 228 | + decimal: | ||
| 229 | + dependency: transitive | ||
| 230 | + description: | ||
| 231 | + name: decimal | ||
| 232 | + url: "https://pub.flutter-io.cn" | ||
| 233 | + source: hosted | ||
| 234 | + version: "0.3.5" | ||
| 221 | device_info: | 235 | device_info: |
| 222 | dependency: "direct main" | 236 | dependency: "direct main" |
| 223 | description: | 237 | description: |
| @@ -681,6 +695,13 @@ packages: | @@ -681,6 +695,13 @@ packages: | ||
| 681 | url: "https://pub.flutter-io.cn" | 695 | url: "https://pub.flutter-io.cn" |
| 682 | source: hosted | 696 | source: hosted |
| 683 | version: "2.1.3" | 697 | version: "2.1.3" |
| 698 | + rational: | ||
| 699 | + dependency: transitive | ||
| 700 | + description: | ||
| 701 | + name: rational | ||
| 702 | + url: "https://pub.flutter-io.cn" | ||
| 703 | + source: hosted | ||
| 704 | + version: "0.3.8" | ||
| 684 | rxdart: | 705 | rxdart: |
| 685 | dependency: transitive | 706 | dependency: transitive |
| 686 | description: | 707 | description: |
-
Please register or login to post a comment