Showing
17 changed files
with
3083 additions
and
724 deletions
Too many changes to show.
To preserve performance only 17 of 17+ files are displayed.
| @@ -78,6 +78,7 @@ post_install do |installer| | @@ -78,6 +78,7 @@ post_install do |installer| | ||
| 78 | 'PERMISSION_NOTIFICATIONS=1', | 78 | 'PERMISSION_NOTIFICATIONS=1', |
| 79 | # dart: PermissionGroup.mediaLibrary | 79 | # dart: PermissionGroup.mediaLibrary |
| 80 | 'PERMISSION_MEDIA_LIBRARY=1', | 80 | 'PERMISSION_MEDIA_LIBRARY=1', |
| 81 | + 'PERMISSION_MICROPHONE=1', | ||
| 81 | ] | 82 | ] |
| 82 | end | 83 | end |
| 83 | end | 84 | end |
| @@ -428,6 +428,6 @@ SPEC CHECKSUMS: | @@ -428,6 +428,6 @@ SPEC CHECKSUMS: | ||
| 428 | webview_flutter: 3603125dfd3bcbc9d8d418c3f80aeecf331c068b | 428 | webview_flutter: 3603125dfd3bcbc9d8d418c3f80aeecf331c068b |
| 429 | WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f | 429 | WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f |
| 430 | 430 | ||
| 431 | -PODFILE CHECKSUM: 9f0bd7dbe9f70039fe4541e505d6b5d2ad23ffd6 | 431 | +PODFILE CHECKSUM: 1cefd2e71f0fcfa4f2430db723fe500dadb93e92 |
| 432 | 432 | ||
| 433 | COCOAPODS: 1.16.2 | 433 | COCOAPODS: 1.16.2 |
| @@ -555,7 +555,11 @@ | @@ -555,7 +555,11 @@ | ||
| 555 | CODE_SIGN_IDENTITY = "Apple Development"; | 555 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 556 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; | 556 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; |
| 557 | CODE_SIGN_STYLE = Manual; | 557 | CODE_SIGN_STYLE = Manual; |
| 558 | +<<<<<<< HEAD | ||
| 558 | CURRENT_PROJECT_VERSION = 5410; | 559 | CURRENT_PROJECT_VERSION = 5410; |
| 560 | +======= | ||
| 561 | + CURRENT_PROJECT_VERSION = 5422; | ||
| 562 | +>>>>>>> v5.4.2+ | ||
| 559 | DEVELOPMENT_TEAM = 8J59HM8B82; | 563 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 560 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; | 564 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; |
| 561 | ENABLE_BITCODE = NO; | 565 | ENABLE_BITCODE = NO; |
| @@ -572,7 +576,11 @@ | @@ -572,7 +576,11 @@ | ||
| 572 | "$(inherited)", | 576 | "$(inherited)", |
| 573 | "$(PROJECT_DIR)/Flutter", | 577 | "$(PROJECT_DIR)/Flutter", |
| 574 | ); | 578 | ); |
| 579 | +<<<<<<< HEAD | ||
| 575 | MARKETING_VERSION = 5.4.1; | 580 | MARKETING_VERSION = 5.4.1; |
| 581 | +======= | ||
| 582 | + MARKETING_VERSION = 5.4.2; | ||
| 583 | +>>>>>>> v5.4.2+ | ||
| 576 | PODS_ROOT = "$(inherited)"; | 584 | PODS_ROOT = "$(inherited)"; |
| 577 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 585 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 578 | PRODUCT_NAME = Runner; | 586 | PRODUCT_NAME = Runner; |
| @@ -709,7 +717,11 @@ | @@ -709,7 +717,11 @@ | ||
| 709 | CODE_SIGN_IDENTITY = "Apple Development"; | 717 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 710 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; | 718 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; |
| 711 | CODE_SIGN_STYLE = Manual; | 719 | CODE_SIGN_STYLE = Manual; |
| 720 | +<<<<<<< HEAD | ||
| 712 | CURRENT_PROJECT_VERSION = 5410; | 721 | CURRENT_PROJECT_VERSION = 5410; |
| 722 | +======= | ||
| 723 | + CURRENT_PROJECT_VERSION = 5422; | ||
| 724 | +>>>>>>> v5.4.2+ | ||
| 713 | DEVELOPMENT_TEAM = 8J59HM8B82; | 725 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 714 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; | 726 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; |
| 715 | ENABLE_BITCODE = NO; | 727 | ENABLE_BITCODE = NO; |
| @@ -727,7 +739,11 @@ | @@ -727,7 +739,11 @@ | ||
| 727 | "$(inherited)", | 739 | "$(inherited)", |
| 728 | "$(PROJECT_DIR)/Flutter", | 740 | "$(PROJECT_DIR)/Flutter", |
| 729 | ); | 741 | ); |
| 742 | +<<<<<<< HEAD | ||
| 730 | MARKETING_VERSION = 5.4.1; | 743 | MARKETING_VERSION = 5.4.1; |
| 744 | +======= | ||
| 745 | + MARKETING_VERSION = 5.4.2; | ||
| 746 | +>>>>>>> v5.4.2+ | ||
| 731 | PACKAGE_CONFIG = "/Users/naji2021/Desktop/Flutter-ReserveApp/.dart_tool/package_config.json"; | 747 | PACKAGE_CONFIG = "/Users/naji2021/Desktop/Flutter-ReserveApp/.dart_tool/package_config.json"; |
| 732 | PODS_ROOT = "$(inherited)"; | 748 | PODS_ROOT = "$(inherited)"; |
| 733 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 749 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| @@ -754,7 +770,11 @@ | @@ -754,7 +770,11 @@ | ||
| 754 | CODE_SIGN_IDENTITY = "Apple Development"; | 770 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 755 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; | 771 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; |
| 756 | CODE_SIGN_STYLE = Manual; | 772 | CODE_SIGN_STYLE = Manual; |
| 773 | +<<<<<<< HEAD | ||
| 757 | CURRENT_PROJECT_VERSION = 5410; | 774 | CURRENT_PROJECT_VERSION = 5410; |
| 775 | +======= | ||
| 776 | + CURRENT_PROJECT_VERSION = 5422; | ||
| 777 | +>>>>>>> v5.4.2+ | ||
| 758 | DEVELOPMENT_TEAM = 8J59HM8B82; | 778 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 759 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; | 779 | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 8J59HM8B82; |
| 760 | ENABLE_BITCODE = NO; | 780 | ENABLE_BITCODE = NO; |
| @@ -771,7 +791,11 @@ | @@ -771,7 +791,11 @@ | ||
| 771 | "$(inherited)", | 791 | "$(inherited)", |
| 772 | "$(PROJECT_DIR)/Flutter", | 792 | "$(PROJECT_DIR)/Flutter", |
| 773 | ); | 793 | ); |
| 794 | +<<<<<<< HEAD | ||
| 774 | MARKETING_VERSION = 5.4.1; | 795 | MARKETING_VERSION = 5.4.1; |
| 796 | +======= | ||
| 797 | + MARKETING_VERSION = 5.4.2; | ||
| 798 | +>>>>>>> v5.4.2+ | ||
| 775 | PODS_ROOT = "$(inherited)"; | 799 | PODS_ROOT = "$(inherited)"; |
| 776 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 800 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 777 | PRODUCT_NAME = Runner; | 801 | PRODUCT_NAME = Runner; |
| @@ -78,6 +78,9 @@ | @@ -78,6 +78,9 @@ | ||
| 78 | <key>NSAllowsArbitraryLoads</key> | 78 | <key>NSAllowsArbitraryLoads</key> |
| 79 | <true/> | 79 | <true/> |
| 80 | </dict> | 80 | </dict> |
| 81 | + | ||
| 82 | + <key>NSMicrophoneUsageDescription</key> | ||
| 83 | + <string>需要您的同意,APP才能使用您的麦克风来录制店铺视频介绍</string> | ||
| 81 | <key>NSAppleMusicUsageDescription</key> | 84 | <key>NSAppleMusicUsageDescription</key> |
| 82 | <string>需要您的同意,APP才能访问媒体资料库</string> | 85 | <string>需要您的同意,APP才能访问媒体资料库</string> |
| 83 | <key>NSCalendarsUsageDescription</key> | 86 | <key>NSCalendarsUsageDescription</key> |
| @@ -11,10 +11,10 @@ class Constant { | @@ -11,10 +11,10 @@ class Constant { | ||
| 11 | * | 11 | * |
| 12 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! | 12 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! |
| 13 | * */ | 13 | * */ |
| 14 | - static const WXMiniProgramType wxMiniProgramType = | ||
| 15 | - WXMiniProgramType.RELEASE; //正式版 | ||
| 16 | // static const WXMiniProgramType wxMiniProgramType = | 14 | // static const WXMiniProgramType wxMiniProgramType = |
| 17 | - // WXMiniProgramType.PREVIEW; //体验版 | 15 | + // WXMiniProgramType.RELEASE; //正式版 |
| 16 | + static const WXMiniProgramType wxMiniProgramType = | ||
| 17 | + WXMiniProgramType.PREVIEW; //体验版 | ||
| 18 | // static const WXMiniProgramType wxMiniProgramType = | 18 | // static const WXMiniProgramType wxMiniProgramType = |
| 19 | // WXMiniProgramType.TEST; //开发版 | 19 | // WXMiniProgramType.TEST; //开发版 |
| 20 | 20 |
| @@ -60,6 +60,8 @@ class GetDzSellerConfSunModel { | @@ -60,6 +60,8 @@ class GetDzSellerConfSunModel { | ||
| 60 | String depositPrice; | 60 | String depositPrice; |
| 61 | String liteStyle; | 61 | String liteStyle; |
| 62 | 62 | ||
| 63 | + String liteStyleTitle; | ||
| 64 | + | ||
| 63 | String storePushMeg; | 65 | String storePushMeg; |
| 64 | String storePushSms; | 66 | String storePushSms; |
| 65 | 67 | ||
| @@ -105,6 +107,7 @@ class GetDzSellerConfSunModel { | @@ -105,6 +107,7 @@ class GetDzSellerConfSunModel { | ||
| 105 | this.isShowNoticeDeposit, | 107 | this.isShowNoticeDeposit, |
| 106 | this.depositPrice, | 108 | this.depositPrice, |
| 107 | this.liteStyle, | 109 | this.liteStyle, |
| 110 | + this.liteStyleTitle, | ||
| 108 | this.storePushMeg, | 111 | this.storePushMeg, |
| 109 | this.storePushSms, | 112 | this.storePushSms, |
| 110 | this.pcNotPhone, | 113 | this.pcNotPhone, |
| @@ -159,6 +162,7 @@ class GetDzSellerConfSunModel { | @@ -159,6 +162,7 @@ class GetDzSellerConfSunModel { | ||
| 159 | isShowNoticeDeposit = json['is_show_notice_deposit']; | 162 | isShowNoticeDeposit = json['is_show_notice_deposit']; |
| 160 | depositPrice = json['deposit_price']; | 163 | depositPrice = json['deposit_price']; |
| 161 | liteStyle = json['lite_style']; | 164 | liteStyle = json['lite_style']; |
| 165 | + liteStyleTitle = json['lite_style_title']; | ||
| 162 | 166 | ||
| 163 | storePushMeg = json['store_push_meg']; | 167 | storePushMeg = json['store_push_meg']; |
| 164 | storePushSms = json['store_push_sms']; | 168 | storePushSms = json['store_push_sms']; |
| @@ -207,6 +211,8 @@ class GetDzSellerConfSunModel { | @@ -207,6 +211,8 @@ class GetDzSellerConfSunModel { | ||
| 207 | data['is_show_notice_deposit'] = this.isShowNoticeDeposit; | 211 | data['is_show_notice_deposit'] = this.isShowNoticeDeposit; |
| 208 | data['deposit_price'] = this.depositPrice; | 212 | data['deposit_price'] = this.depositPrice; |
| 209 | data['lite_style'] = this.liteStyle; | 213 | data['lite_style'] = this.liteStyle; |
| 214 | + data['lite_style_title'] = this.liteStyleTitle; | ||
| 215 | + | ||
| 210 | data['store_push_meg'] = this.storePushMeg; | 216 | data['store_push_meg'] = this.storePushMeg; |
| 211 | data['store_push_sms'] = this.storePushSms; | 217 | data['store_push_sms'] = this.storePushSms; |
| 212 | data['pc_not_phone'] = this.pcNotPhone; | 218 | data['pc_not_phone'] = this.pcNotPhone; |
lib/models/addition_model.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:one_key/models/upload_img_model.dart'; | ||
| 3 | + | ||
| 4 | +class AdditionModel { | ||
| 5 | + String content; | ||
| 6 | + String type; // 1图片 2文本 | ||
| 7 | + // int order; //顺序 | ||
| 8 | + UploadImgModel image; | ||
| 9 | + TextEditingController infoC = TextEditingController(); | ||
| 10 | + | ||
| 11 | + AdditionModel(); | ||
| 12 | + | ||
| 13 | + factory AdditionModel.fromJson(Map<String, dynamic> json) => AdditionModel() | ||
| 14 | + ..content = json["content"] | ||
| 15 | + ..type = json["type"]; | ||
| 16 | + // ..order = json['order']; | ||
| 17 | + | ||
| 18 | + Map<String, dynamic> toJson() => <String, dynamic>{ | ||
| 19 | + "content": content, "type": type, | ||
| 20 | + // 'order': order | ||
| 21 | + }; | ||
| 22 | +} |
| 1 | import 'dart:convert' as convert; | 1 | import 'dart:convert' as convert; |
| 2 | +import 'dart:convert'; | ||
| 2 | 3 | ||
| 3 | import 'package:one_key/models/recharge_list_model.dart'; | 4 | import 'package:one_key/models/recharge_list_model.dart'; |
| 5 | +import 'package:one_key/models/reserve_img_text.dart'; | ||
| 4 | 6 | ||
| 5 | import 'coupon_model.dart'; | 7 | import 'coupon_model.dart'; |
| 6 | 8 | ||
| @@ -145,6 +147,10 @@ class MarkReserveModel { | @@ -145,6 +147,10 @@ class MarkReserveModel { | ||
| 145 | String swichSlogan; // | 147 | String swichSlogan; // |
| 146 | String swichCustomer; // | 148 | String swichCustomer; // |
| 147 | List<String> parkImages; | 149 | List<String> parkImages; |
| 150 | + String isIntroduceAll; | ||
| 151 | + String title; | ||
| 152 | + | ||
| 153 | + List<ContentModel> content; | ||
| 148 | 154 | ||
| 149 | MarkReserveModel( | 155 | MarkReserveModel( |
| 150 | {this.swichPhone, | 156 | {this.swichPhone, |
| @@ -171,7 +177,10 @@ class MarkReserveModel { | @@ -171,7 +177,10 @@ class MarkReserveModel { | ||
| 171 | this.swichWelcome, | 177 | this.swichWelcome, |
| 172 | this.swichSlogan, | 178 | this.swichSlogan, |
| 173 | this.swichCustomer, | 179 | this.swichCustomer, |
| 174 | - this.parkImages}); | 180 | + this.parkImages, |
| 181 | + this.isIntroduceAll, | ||
| 182 | + this.title, | ||
| 183 | + this.content}); | ||
| 175 | 184 | ||
| 176 | MarkReserveModel.fromJson(Map<String, dynamic> json) { | 185 | MarkReserveModel.fromJson(Map<String, dynamic> json) { |
| 177 | swichPhone = json['swich_phone']; | 186 | swichPhone = json['swich_phone']; |
| @@ -221,6 +230,27 @@ class MarkReserveModel { | @@ -221,6 +230,27 @@ class MarkReserveModel { | ||
| 221 | }); | 230 | }); |
| 222 | } | 231 | } |
| 223 | } | 232 | } |
| 233 | + | ||
| 234 | + if (json['content'] != null) { | ||
| 235 | + content = []; | ||
| 236 | + | ||
| 237 | + if (json['content'] is List) { | ||
| 238 | + List temp = json['content']; | ||
| 239 | + temp.forEach((element) { | ||
| 240 | + content.add(ContentModel.fromJson(element)); | ||
| 241 | + }); | ||
| 242 | + } else { | ||
| 243 | + if (jsonDecode(json['content']) is List) { | ||
| 244 | + List temp = jsonDecode(json['content']); | ||
| 245 | + temp.forEach((element) { | ||
| 246 | + content.add(ContentModel.fromJson(element)); | ||
| 247 | + }); | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + isIntroduceAll = json['is_introduce_all']; | ||
| 253 | + title = json['title']; | ||
| 224 | } | 254 | } |
| 225 | 255 | ||
| 226 | Map<String, dynamic> toJson() { | 256 | Map<String, dynamic> toJson() { |
| @@ -250,11 +280,14 @@ class MarkReserveModel { | @@ -250,11 +280,14 @@ class MarkReserveModel { | ||
| 250 | data['long'] = this.long; | 280 | data['long'] = this.long; |
| 251 | data['lat'] = this.lat; | 281 | data['lat'] = this.lat; |
| 252 | 282 | ||
| 253 | -data['swich_welcome'] = this.swichWelcome; | ||
| 254 | -data['swich_slogan'] = this.swichSlogan; | ||
| 255 | -data['swich_customer'] = this.swichCustomer; | ||
| 256 | -data['park_info_images'] = this.parkImages; | ||
| 257 | - | 283 | + data['swich_welcome'] = this.swichWelcome; |
| 284 | + data['swich_slogan'] = this.swichSlogan; | ||
| 285 | + data['swich_customer'] = this.swichCustomer; | ||
| 286 | + data['park_info_images'] = this.parkImages; | ||
| 287 | + | ||
| 288 | + data['is_introduce_all'] = this.isIntroduceAll; | ||
| 289 | + data['title'] = this.title; | ||
| 290 | + data['content'] = this.content.map((e) => e.toJson()).toList(); | ||
| 258 | 291 | ||
| 259 | return data; | 292 | return data; |
| 260 | } | 293 | } |
| @@ -268,6 +301,10 @@ class MarkStoreModel { | @@ -268,6 +301,10 @@ class MarkStoreModel { | ||
| 268 | String isIntroduce; | 301 | String isIntroduce; |
| 269 | String isAbove; | 302 | String isAbove; |
| 270 | String isImages; | 303 | String isImages; |
| 304 | + String isIntroduceAll; | ||
| 305 | + String title; | ||
| 306 | + | ||
| 307 | + List<ContentModel> content; | ||
| 271 | 308 | ||
| 272 | MarkStoreModel( | 309 | MarkStoreModel( |
| 273 | {this.style, | 310 | {this.style, |
| @@ -276,7 +313,9 @@ class MarkStoreModel { | @@ -276,7 +313,9 @@ class MarkStoreModel { | ||
| 276 | this.images, | 313 | this.images, |
| 277 | this.isIntroduce, | 314 | this.isIntroduce, |
| 278 | this.isAbove, | 315 | this.isAbove, |
| 279 | - this.isImages}); | 316 | + this.isImages, |
| 317 | + this.isIntroduceAll, | ||
| 318 | + this.title}); | ||
| 280 | 319 | ||
| 281 | MarkStoreModel.fromJson(Map<String, dynamic> json) { | 320 | MarkStoreModel.fromJson(Map<String, dynamic> json) { |
| 282 | style = json['style']; | 321 | style = json['style']; |
| @@ -296,9 +335,31 @@ class MarkStoreModel { | @@ -296,9 +335,31 @@ class MarkStoreModel { | ||
| 296 | } | 335 | } |
| 297 | } | 336 | } |
| 298 | 337 | ||
| 338 | + if (json['content'] != null) { | ||
| 339 | + content = []; | ||
| 340 | + | ||
| 341 | + | ||
| 342 | + if (json['content'] is List) { | ||
| 343 | + List temp = json['content']; | ||
| 344 | + temp.forEach((element) { | ||
| 345 | + content.add(ContentModel.fromJson(element)); | ||
| 346 | + }); | ||
| 347 | + } else { | ||
| 348 | + if (jsonDecode(json['content']) is List) { | ||
| 349 | + List temp = jsonDecode(json['content']); | ||
| 350 | + temp.forEach((element) { | ||
| 351 | + content.add(ContentModel.fromJson(element)); | ||
| 352 | + }); | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + | ||
| 299 | isIntroduce = json['is_introduce']; | 357 | isIntroduce = json['is_introduce']; |
| 300 | isAbove = json['is_above']; | 358 | isAbove = json['is_above']; |
| 301 | isImages = json['is_images']; | 359 | isImages = json['is_images']; |
| 360 | + | ||
| 361 | + isIntroduceAll = json['is_introduce_all']; | ||
| 362 | + title = json['title']; | ||
| 302 | } | 363 | } |
| 303 | 364 | ||
| 304 | Map<String, dynamic> toJson() { | 365 | Map<String, dynamic> toJson() { |
| @@ -310,6 +371,9 @@ class MarkStoreModel { | @@ -310,6 +371,9 @@ class MarkStoreModel { | ||
| 310 | data['is_introduce'] = this.isIntroduce; | 371 | data['is_introduce'] = this.isIntroduce; |
| 311 | data['is_above'] = this.isAbove; | 372 | data['is_above'] = this.isAbove; |
| 312 | data['is_images'] = this.isImages; | 373 | data['is_images'] = this.isImages; |
| 374 | + data['is_introduce_all'] = this.isIntroduceAll; | ||
| 375 | + data['title'] = this.title; | ||
| 376 | + data['content'] = this.content; | ||
| 313 | 377 | ||
| 314 | return data; | 378 | return data; |
| 315 | } | 379 | } |
| @@ -324,6 +388,10 @@ class MarkChefModel { | @@ -324,6 +388,10 @@ class MarkChefModel { | ||
| 324 | String isIntroduce; | 388 | String isIntroduce; |
| 325 | String isAbove; | 389 | String isAbove; |
| 326 | String isImages; | 390 | String isImages; |
| 391 | + String isIntroduceAll; | ||
| 392 | + String title; | ||
| 393 | + | ||
| 394 | + List<ContentModel> content; | ||
| 327 | 395 | ||
| 328 | MarkChefModel( | 396 | MarkChefModel( |
| 329 | {this.style, | 397 | {this.style, |
| @@ -333,7 +401,10 @@ class MarkChefModel { | @@ -333,7 +401,10 @@ class MarkChefModel { | ||
| 333 | this.image, | 401 | this.image, |
| 334 | this.isIntroduce, | 402 | this.isIntroduce, |
| 335 | this.isAbove, | 403 | this.isAbove, |
| 336 | - this.isImages}); | 404 | + this.isImages, |
| 405 | + this.isIntroduceAll, | ||
| 406 | + this.title, | ||
| 407 | + this.content}); | ||
| 337 | 408 | ||
| 338 | MarkChefModel.fromJson(Map<String, dynamic> json) { | 409 | MarkChefModel.fromJson(Map<String, dynamic> json) { |
| 339 | style = json['style']; | 410 | style = json['style']; |
| @@ -344,6 +415,25 @@ class MarkChefModel { | @@ -344,6 +415,25 @@ class MarkChefModel { | ||
| 344 | isIntroduce = json['is_introduce']; | 415 | isIntroduce = json['is_introduce']; |
| 345 | isAbove = json['is_above']; | 416 | isAbove = json['is_above']; |
| 346 | isImages = json['is_images']; | 417 | isImages = json['is_images']; |
| 418 | + if (json['content'] != null) { | ||
| 419 | + content = []; | ||
| 420 | + if (json['content'] is List) { | ||
| 421 | + List temp = json['content']; | ||
| 422 | + temp.forEach((element) { | ||
| 423 | + content.add(ContentModel.fromJson(element)); | ||
| 424 | + }); | ||
| 425 | + } else { | ||
| 426 | + if (jsonDecode(json['content']) is List) { | ||
| 427 | + List temp = jsonDecode(json['content']); | ||
| 428 | + temp.forEach((element) { | ||
| 429 | + content.add(ContentModel.fromJson(element)); | ||
| 430 | + }); | ||
| 431 | + } | ||
| 432 | + } | ||
| 433 | + } | ||
| 434 | + | ||
| 435 | + isIntroduceAll = json['is_introduce_all']; | ||
| 436 | + title = json['title']; | ||
| 347 | } | 437 | } |
| 348 | 438 | ||
| 349 | Map<String, dynamic> toJson() { | 439 | Map<String, dynamic> toJson() { |
| @@ -356,6 +446,9 @@ class MarkChefModel { | @@ -356,6 +446,9 @@ class MarkChefModel { | ||
| 356 | data['is_introduce'] = this.isIntroduce; | 446 | data['is_introduce'] = this.isIntroduce; |
| 357 | data['is_above'] = this.isAbove; | 447 | data['is_above'] = this.isAbove; |
| 358 | data['is_images'] = this.isImages; | 448 | data['is_images'] = this.isImages; |
| 449 | + data['is_introduce_all'] = this.isIntroduceAll; | ||
| 450 | + data['title'] = this.title; | ||
| 451 | + data['content'] = this.content; | ||
| 359 | return data; | 452 | return data; |
| 360 | } | 453 | } |
| 361 | } | 454 | } |
| @@ -365,10 +458,13 @@ class MarkSignboardModel { | @@ -365,10 +458,13 @@ class MarkSignboardModel { | ||
| 365 | 458 | ||
| 366 | List<String> images; | 459 | List<String> images; |
| 367 | 460 | ||
| 368 | - MarkSignboardModel({ | ||
| 369 | - this.swich, | ||
| 370 | - this.images, | ||
| 371 | - }); | 461 | + String isIntroduceAll; |
| 462 | + String title; | ||
| 463 | + | ||
| 464 | + List<ContentModel> content; | ||
| 465 | + | ||
| 466 | + MarkSignboardModel( | ||
| 467 | + {this.swich, this.images, this.isIntroduceAll, this.title, this.content}); | ||
| 372 | 468 | ||
| 373 | MarkSignboardModel.fromJson(Map<String, dynamic> json) { | 469 | MarkSignboardModel.fromJson(Map<String, dynamic> json) { |
| 374 | swich = json['swich']; | 470 | swich = json['swich']; |
| @@ -384,6 +480,25 @@ class MarkSignboardModel { | @@ -384,6 +480,25 @@ class MarkSignboardModel { | ||
| 384 | }); | 480 | }); |
| 385 | } | 481 | } |
| 386 | } | 482 | } |
| 483 | + if (json['content'] != null) { | ||
| 484 | + content = []; | ||
| 485 | + if (json['content'] is List) { | ||
| 486 | + List temp = json['content']; | ||
| 487 | + temp.forEach((element) { | ||
| 488 | + content.add(ContentModel.fromJson(element)); | ||
| 489 | + }); | ||
| 490 | + } else { | ||
| 491 | + if (jsonDecode(json['content']) is List) { | ||
| 492 | + List temp = jsonDecode(json['content']); | ||
| 493 | + temp.forEach((element) { | ||
| 494 | + content.add(ContentModel.fromJson(element)); | ||
| 495 | + }); | ||
| 496 | + } | ||
| 497 | + } | ||
| 498 | + } | ||
| 499 | + | ||
| 500 | + isIntroduceAll = json['is_introduce_all']; | ||
| 501 | + title = json['title']; | ||
| 387 | } | 502 | } |
| 388 | 503 | ||
| 389 | Map<String, dynamic> toJson() { | 504 | Map<String, dynamic> toJson() { |
| @@ -391,6 +506,9 @@ class MarkSignboardModel { | @@ -391,6 +506,9 @@ class MarkSignboardModel { | ||
| 391 | data['swich'] = this.swich; | 506 | data['swich'] = this.swich; |
| 392 | 507 | ||
| 393 | data['images'] = this.images; | 508 | data['images'] = this.images; |
| 509 | + data['is_introduce_all'] = this.isIntroduceAll; | ||
| 510 | + data['title'] = this.title; | ||
| 511 | + data['content'] = this.content; | ||
| 394 | return data; | 512 | return data; |
| 395 | } | 513 | } |
| 396 | } | 514 | } |
| @@ -66,12 +66,26 @@ class ReserveImgTextSunModel { | @@ -66,12 +66,26 @@ class ReserveImgTextSunModel { | ||
| 66 | class ContentModel{ | 66 | class ContentModel{ |
| 67 | String type; | 67 | String type; |
| 68 | String content; | 68 | String content; |
| 69 | + String duration; | ||
| 69 | 70 | ||
| 70 | - ContentModel({this.type, this.content}); | 71 | + |
| 72 | + ContentModel({this.type, this.content, | ||
| 73 | + this.duration}); | ||
| 71 | 74 | ||
| 72 | ContentModel.fromJson(Map<String, dynamic> json) { | 75 | ContentModel.fromJson(Map<String, dynamic> json) { |
| 73 | type = json["type"]; | 76 | type = json["type"]; |
| 74 | content = json["content"]; | 77 | content = json["content"]; |
| 78 | + duration = json["duration"]; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + Map<String, dynamic> toJson() { | ||
| 83 | + final Map<String, dynamic> _data = <String, dynamic>{}; | ||
| 84 | + _data["type"] = type; | ||
| 85 | + _data["content"] = content; | ||
| 86 | + _data["duration"] = duration; | ||
| 87 | + | ||
| 88 | + return _data; | ||
| 75 | } | 89 | } |
| 76 | 90 | ||
| 77 | } | 91 | } |
| @@ -22,7 +22,8 @@ import 'package:permission_handler/permission_handler.dart'; | @@ -22,7 +22,8 @@ import 'package:permission_handler/permission_handler.dart'; | ||
| 22 | 22 | ||
| 23 | import 'package:image_picker/image_picker.dart'; | 23 | import 'package:image_picker/image_picker.dart'; |
| 24 | // import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; | 24 | // import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; |
| 25 | -import 'package:qiniu_flutter_sdk_diox/qiniu_flutter_sdk_diox.dart'; | 25 | +// import 'package:qiniu_flutter_sdk_diox/qiniu_flutter_sdk_diox.dart'; |
| 26 | +import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; | ||
| 26 | import 'package:wechat_assets_picker/wechat_assets_picker.dart'; | 27 | import 'package:wechat_assets_picker/wechat_assets_picker.dart'; |
| 27 | import '../online_check/dispose.dart'; | 28 | import '../online_check/dispose.dart'; |
| 28 | import 'package:photo_manager/photo_manager.dart'; | 29 | import 'package:photo_manager/photo_manager.dart'; |
| @@ -14,6 +14,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; | @@ -14,6 +14,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 14 | import 'package:permission_handler/permission_handler.dart'; | 14 | import 'package:permission_handler/permission_handler.dart'; |
| 15 | import 'package:provider/provider.dart'; | 15 | import 'package:provider/provider.dart'; |
| 16 | 16 | ||
| 17 | +import '../../models/addition_model.dart'; | ||
| 17 | import '../../models/reserve_img_text.dart'; | 18 | import '../../models/reserve_img_text.dart'; |
| 18 | import '../../models/upload_img_model.dart'; | 19 | import '../../models/upload_img_model.dart'; |
| 19 | import '../../provider/marketing_center_provider.dart'; | 20 | import '../../provider/marketing_center_provider.dart'; |
| @@ -30,25 +31,7 @@ import 'dart:io'; | @@ -30,25 +31,7 @@ import 'dart:io'; | ||
| 30 | * 预订信息模块设置-自定义图文默认 | 31 | * 预订信息模块设置-自定义图文默认 |
| 31 | */ | 32 | */ |
| 32 | 33 | ||
| 33 | -class AdditionModel { | ||
| 34 | - String content; | ||
| 35 | - String type; // 1图片 2文本 | ||
| 36 | - // int order; //顺序 | ||
| 37 | - UploadImgModel image; | ||
| 38 | - TextEditingController infoC = TextEditingController(); | ||
| 39 | 34 | ||
| 40 | - AdditionModel(); | ||
| 41 | - | ||
| 42 | - factory AdditionModel.fromJson(Map<String, dynamic> json) => AdditionModel() | ||
| 43 | - ..content = json["content"] | ||
| 44 | - ..type = json["type"]; | ||
| 45 | - // ..order = json['order']; | ||
| 46 | - | ||
| 47 | - Map<String, dynamic> toJson() => <String, dynamic>{ | ||
| 48 | - "content": content, "type": type, | ||
| 49 | - // 'order': order | ||
| 50 | - }; | ||
| 51 | -} | ||
| 52 | 35 | ||
| 53 | class InvicationAdditionPage extends StatefulWidget { | 36 | class InvicationAdditionPage extends StatefulWidget { |
| 54 | final String rid; | 37 | final String rid; |
| @@ -45,6 +45,7 @@ import 'package:permission_handler/permission_handler.dart'; | @@ -45,6 +45,7 @@ import 'package:permission_handler/permission_handler.dart'; | ||
| 45 | import 'package:provider/provider.dart'; | 45 | import 'package:provider/provider.dart'; |
| 46 | import 'package:one_key/models/table_list.dart' as t; | 46 | import 'package:one_key/models/table_list.dart' as t; |
| 47 | import 'package:sendsms/sendsms.dart'; | 47 | import 'package:sendsms/sendsms.dart'; |
| 48 | +import 'package:url_launcher/url_launcher.dart'; | ||
| 48 | 49 | ||
| 49 | import 'dart:ui' as ui; | 50 | import 'dart:ui' as ui; |
| 50 | 51 | ||
| @@ -5032,6 +5033,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -5032,6 +5033,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 5032 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', | 5033 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', |
| 5033 | returnWeek(dateTime, context) + _getDsoltStrShow(), | 5034 | returnWeek(dateTime, context) + _getDsoltStrShow(), |
| 5034 | detailModel.liteStyle, | 5035 | detailModel.liteStyle, |
| 5036 | + detailModel.liteStyleTitle, | ||
| 5035 | depositId: detailModel.depositId); | 5037 | depositId: detailModel.depositId); |
| 5036 | print(isSuccess); | 5038 | print(isSuccess); |
| 5037 | if (isSuccess) { | 5039 | if (isSuccess) { |
| @@ -5049,6 +5051,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -5049,6 +5051,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 5049 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', | 5051 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', |
| 5050 | returnWeek(dateTime, context) + _getDsoltStrShow(), | 5052 | returnWeek(dateTime, context) + _getDsoltStrShow(), |
| 5051 | detailModel.liteStyle, | 5053 | detailModel.liteStyle, |
| 5054 | + detailModel.liteStyleTitle, | ||
| 5052 | depositId: detailModel.depositId); | 5055 | depositId: detailModel.depositId); |
| 5053 | print(isSuccess); | 5056 | print(isSuccess); |
| 5054 | if (isSuccess) { | 5057 | if (isSuccess) { |
| @@ -5065,6 +5068,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -5065,6 +5068,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 5065 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', | 5068 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', |
| 5066 | returnWeek(dateTime, context) + _getDsoltStrShow(), | 5069 | returnWeek(dateTime, context) + _getDsoltStrShow(), |
| 5067 | detailModel.liteStyle, | 5070 | detailModel.liteStyle, |
| 5071 | + detailModel.liteStyleTitle, | ||
| 5068 | depositId: detailModel.depositId); | 5072 | depositId: detailModel.depositId); |
| 5069 | print(isSuccess); | 5073 | print(isSuccess); |
| 5070 | if (isSuccess) { | 5074 | if (isSuccess) { |
| @@ -5080,6 +5084,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -5080,6 +5084,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 5080 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', | 5084 | '${Utils.addZeroNumber(dateTime.month)}月${Utils.addZeroNumber(dateTime.day)}日', |
| 5081 | returnWeek(dateTime, context) + _getDsoltStrShow(), | 5085 | returnWeek(dateTime, context) + _getDsoltStrShow(), |
| 5082 | detailModel.liteStyle, | 5086 | detailModel.liteStyle, |
| 5087 | + detailModel.liteStyleTitle, | ||
| 5083 | depositId: detailModel.depositId); | 5088 | depositId: detailModel.depositId); |
| 5084 | print(isSuccess); | 5089 | print(isSuccess); |
| 5085 | if (isSuccess) { | 5090 | if (isSuccess) { |
| @@ -5326,33 +5331,77 @@ class InvicationPageState extends State<InvicationPage> | @@ -5326,33 +5331,77 @@ class InvicationPageState extends State<InvicationPage> | ||
| 5326 | } | 5331 | } |
| 5327 | }), | 5332 | }), |
| 5328 | HEmptyView(20), | 5333 | HEmptyView(20), |
| 5329 | - // RoundButton( | ||
| 5330 | - // text: '微信消息通知', | ||
| 5331 | - // width: ScreenUtil().setWidth(110 * 2), | ||
| 5332 | - // height: ScreenUtil().setWidth(96), | ||
| 5333 | - // fontSize: 30, | ||
| 5334 | - // textColor: MyColours.color_999999, | ||
| 5335 | - // gradientStart: MyColours.color_f3f3f3, | ||
| 5336 | - // gradientEnd: MyColours.color_f3f3f3, | ||
| 5337 | - // radius: ScreenUtil().setWidth(8), | ||
| 5338 | - // isBold: false, | ||
| 5339 | - // onPressed: () async { | ||
| 5340 | - // //重新查询短信内容 | ||
| 5341 | - | ||
| 5342 | - // await _getReserveDetailRelationData(showCicle: true); | ||
| 5343 | - // await Utils.goWeChatShareText(detailModel.smsContent); | ||
| 5344 | - // // dynamic isSuccess = await Utils.goShareInvicationToWeChat( | ||
| 5345 | - // // context, | ||
| 5346 | - // // widget.rid, | ||
| 5347 | - // // Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 5348 | - // // isWechat: false); | ||
| 5349 | - // // print(isSuccess); | ||
| 5350 | - // // if (isSuccess) { | ||
| 5351 | - // // // _addForward(); | ||
| 5352 | - // // } | ||
| 5353 | - // }, | ||
| 5354 | - // ), | ||
| 5355 | - // HEmptyView(20), | 5334 | + Expanded( |
| 5335 | + child: RoundButton( | ||
| 5336 | + text: '微信消息', | ||
| 5337 | + // width: ScreenUtil().setWidth(110 * 2), | ||
| 5338 | + height: ScreenUtil().setWidth(96), | ||
| 5339 | + fontSize: 30, | ||
| 5340 | + textColor: MyColours.color_999999, | ||
| 5341 | + gradientStart: MyColours.color_f3f3f3, | ||
| 5342 | + gradientEnd: MyColours.color_f3f3f3, | ||
| 5343 | + radius: ScreenUtil().setWidth(8), | ||
| 5344 | + isBold: false, | ||
| 5345 | + onPressed: () async { | ||
| 5346 | + //重新查询短信内容 | ||
| 5347 | + | ||
| 5348 | + await _getReserveDetailRelationData(showCicle: true); | ||
| 5349 | + await Utils.goWeChatShareText(detailModel.smsContent); | ||
| 5350 | + // dynamic isSuccess = await Utils.goShareInvicationToWeChat( | ||
| 5351 | + // context, | ||
| 5352 | + // widget.rid, | ||
| 5353 | + // Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 5354 | + // isWechat: false); | ||
| 5355 | + // print(isSuccess); | ||
| 5356 | + // if (isSuccess) { | ||
| 5357 | + // // _addForward(); | ||
| 5358 | + // } | ||
| 5359 | + }, | ||
| 5360 | + )), | ||
| 5361 | + HEmptyView(20), | ||
| 5362 | + Expanded( | ||
| 5363 | + child: RoundButton( | ||
| 5364 | + text: 'WhatsApp', | ||
| 5365 | + // width: ScreenUtil().setWidth(110 * 2), | ||
| 5366 | + height: ScreenUtil().setWidth(96), | ||
| 5367 | + fontSize: 30, | ||
| 5368 | + textColor: MyColours.color_999999, | ||
| 5369 | + gradientStart: MyColours.color_f3f3f3, | ||
| 5370 | + gradientEnd: MyColours.color_f3f3f3, | ||
| 5371 | + radius: ScreenUtil().setWidth(8), | ||
| 5372 | + isBold: false, | ||
| 5373 | + onPressed: () async { | ||
| 5374 | + if (detailModel.smsContent == '') { | ||
| 5375 | + Utils.showToast('没有内容'); | ||
| 5376 | + return; | ||
| 5377 | + } | ||
| 5378 | + // 构建WhatsApp分享的URL | ||
| 5379 | + final String whatsAppUrl = | ||
| 5380 | + 'whatsapp://send?text=${detailModel.smsContent}'; | ||
| 5381 | + | ||
| 5382 | + // 检查设备是否安装了WhatsApp | ||
| 5383 | + bool isInstalled = await canLaunch(whatsAppUrl); | ||
| 5384 | + | ||
| 5385 | + if (isInstalled) { | ||
| 5386 | + // 打开WhatsApp并分享视频 | ||
| 5387 | + await launch(whatsAppUrl); | ||
| 5388 | + } else { | ||
| 5389 | + // WhatsApp未安装,处理错误或提示用户 | ||
| 5390 | + print('WhatsApp未安装'); | ||
| 5391 | + Utils.showToast('WhatsApp未安装'); | ||
| 5392 | + } | ||
| 5393 | + // dynamic isSuccess = await Utils.goShareInvicationToWeChat( | ||
| 5394 | + // context, | ||
| 5395 | + // widget.rid, | ||
| 5396 | + // Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 5397 | + // isWechat: false); | ||
| 5398 | + // print(isSuccess); | ||
| 5399 | + // if (isSuccess) { | ||
| 5400 | + // // _addForward(); | ||
| 5401 | + // } | ||
| 5402 | + }, | ||
| 5403 | + )), | ||
| 5404 | + HEmptyView(20), | ||
| 5356 | // RoundButton( | 5405 | // RoundButton( |
| 5357 | // text: '企业微信通知', | 5406 | // text: '企业微信通知', |
| 5358 | // width: ScreenUtil().setWidth(110 * 2), | 5407 | // width: ScreenUtil().setWidth(110 * 2), |
| 1 | +import 'dart:async'; | ||
| 2 | + | ||
| 1 | import 'package:city_pickers/city_pickers.dart'; | 3 | import 'package:city_pickers/city_pickers.dart'; |
| 2 | import 'package:city_pickers/modal/result.dart'; | 4 | import 'package:city_pickers/modal/result.dart'; |
| 3 | import 'package:flutter/material.dart'; | 5 | import 'package:flutter/material.dart'; |
| @@ -12,6 +14,7 @@ import 'package:permission_handler/permission_handler.dart'; | @@ -12,6 +14,7 @@ import 'package:permission_handler/permission_handler.dart'; | ||
| 12 | import 'package:provider/provider.dart'; | 14 | import 'package:provider/provider.dart'; |
| 13 | 15 | ||
| 14 | import '../../provider/collect_store_provider.dart'; | 16 | import '../../provider/collect_store_provider.dart'; |
| 17 | +import '../../provider/other_login_provider.dart'; | ||
| 15 | import '../../route/navigator_util.dart'; | 18 | import '../../route/navigator_util.dart'; |
| 16 | import '../../utils/screen_util.dart'; | 19 | import '../../utils/screen_util.dart'; |
| 17 | import '../../utils/utils.dart'; | 20 | import '../../utils/utils.dart'; |
| @@ -32,6 +35,7 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -32,6 +35,7 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 32 | TextEditingController nameC = TextEditingController(); | 35 | TextEditingController nameC = TextEditingController(); |
| 33 | TextEditingController phoneC = TextEditingController(); | 36 | TextEditingController phoneC = TextEditingController(); |
| 34 | TextEditingController personC = TextEditingController(); | 37 | TextEditingController personC = TextEditingController(); |
| 38 | + TextEditingController codeC = TextEditingController(); | ||
| 35 | String storeAddress = '点击设置您的地址'; | 39 | String storeAddress = '点击设置您的地址'; |
| 36 | double lat; | 40 | double lat; |
| 37 | double lng; | 41 | double lng; |
| @@ -43,6 +47,48 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -43,6 +47,48 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 43 | 47 | ||
| 44 | CollectStoreProvider collectStoreProvider; | 48 | CollectStoreProvider collectStoreProvider; |
| 45 | 49 | ||
| 50 | + FocusNode _codeNode; | ||
| 51 | + | ||
| 52 | + OtherLoginProvider otherLoginProvider; | ||
| 53 | + | ||
| 54 | + //定义变量 | ||
| 55 | + Timer _timer; | ||
| 56 | + //倒计时数值 | ||
| 57 | + var countdownTime = 0; | ||
| 58 | + | ||
| 59 | + // String phone; | ||
| 60 | + String code; | ||
| 61 | + bool enabled = true; //手机号码框是否可以编辑 | ||
| 62 | + bool codeEnabled = false; //验证码是否可用 | ||
| 63 | + | ||
| 64 | + @override | ||
| 65 | + void dispose() { | ||
| 66 | + super.dispose(); | ||
| 67 | + if (_timer != null) { | ||
| 68 | + _timer?.cancel(); | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + ///倒计时方法 | ||
| 73 | + startCountdown() { | ||
| 74 | + countdownTime = 600; | ||
| 75 | + final call = (timer) { | ||
| 76 | + setState(() { | ||
| 77 | + if (countdownTime < 1) { | ||
| 78 | + // model.code = null; | ||
| 79 | + enabled = true; | ||
| 80 | + codeEnabled = false; | ||
| 81 | + _timer.cancel(); | ||
| 82 | + } else { | ||
| 83 | + enabled = false; | ||
| 84 | + codeEnabled = true; | ||
| 85 | + countdownTime -= 1; | ||
| 86 | + } | ||
| 87 | + }); | ||
| 88 | + }; | ||
| 89 | + _timer = Timer.periodic(Duration(seconds: 1), call); | ||
| 90 | + } | ||
| 91 | + | ||
| 46 | /// 高级筛选输入框 | 92 | /// 高级筛选输入框 |
| 47 | Widget _textFeildWidget( | 93 | Widget _textFeildWidget( |
| 48 | TextEditingController controller, String name, String hintText) { | 94 | TextEditingController controller, String name, String hintText) { |
| @@ -75,7 +121,9 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -75,7 +121,9 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 75 | border: OutlineInputBorder(borderSide: BorderSide.none), | 121 | border: OutlineInputBorder(borderSide: BorderSide.none), |
| 76 | contentPadding: EdgeInsets.zero, | 122 | contentPadding: EdgeInsets.zero, |
| 77 | ), | 123 | ), |
| 78 | - keyboardType: TextInputType.text, | 124 | + keyboardType: name == '联系电话:' |
| 125 | + ? TextInputType.numberWithOptions() | ||
| 126 | + : TextInputType.text, | ||
| 79 | textInputAction: TextInputAction.done, | 127 | textInputAction: TextInputAction.done, |
| 80 | 128 | ||
| 81 | onChanged: (value) { | 129 | onChanged: (value) { |
| @@ -95,6 +143,106 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -95,6 +143,106 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 95 | ])); | 143 | ])); |
| 96 | } | 144 | } |
| 97 | 145 | ||
| 146 | + /// 高级筛选输入框 | ||
| 147 | + Widget _textFeildWidgetBtn( | ||
| 148 | + TextEditingController controller, String name, String hintText) { | ||
| 149 | + return Container( | ||
| 150 | + padding: EdgeInsets.symmetric( | ||
| 151 | + horizontal: ScreenUtil().setWidth(32), | ||
| 152 | + ), | ||
| 153 | + height: w(48), | ||
| 154 | + alignment: Alignment.center, | ||
| 155 | + child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ | ||
| 156 | + _textWidget(name, MyColours.color_515151, FontWeight.normal, 32), | ||
| 157 | + Expanded( | ||
| 158 | + child: TextField( | ||
| 159 | + maxLines: 1, | ||
| 160 | + controller: controller, | ||
| 161 | + // focusNode: _focusNode, | ||
| 162 | + // autofocus: true, | ||
| 163 | + textAlign: TextAlign.right, | ||
| 164 | + style: TextStyle( | ||
| 165 | + color: MyColours.color_515151, | ||
| 166 | + fontSize: ScreenUtil().setSp(32)), | ||
| 167 | + // textAlignVertical: TextAlignVertical.center, | ||
| 168 | + decoration: InputDecoration( | ||
| 169 | + hintText: hintText, | ||
| 170 | + hintStyle: TextStyle( | ||
| 171 | + color: MyColours.color_66000000, | ||
| 172 | + fontSize: ScreenUtil().setSp(32), | ||
| 173 | + ), | ||
| 174 | + isCollapsed: true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 175 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 176 | + contentPadding: EdgeInsets.zero, | ||
| 177 | + ), | ||
| 178 | + keyboardType: TextInputType.numberWithOptions(decimal: true), | ||
| 179 | + textInputAction: TextInputAction.done, | ||
| 180 | + | ||
| 181 | + onChanged: (value) { | ||
| 182 | + code = value; | ||
| 183 | + }, | ||
| 184 | + | ||
| 185 | + onEditingComplete: () { | ||
| 186 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 187 | + // contantShowModel.searchData( | ||
| 188 | + // contantShowModel.controller.text); | ||
| 189 | + // _searchSellerLocation(); | ||
| 190 | + // _focusNode.unfocus(); | ||
| 191 | + }, | ||
| 192 | + ), | ||
| 193 | + ), | ||
| 194 | + HEmptyView(10), | ||
| 195 | + RoundButton( | ||
| 196 | + width: w(100), | ||
| 197 | + height: w(25), | ||
| 198 | + text: countdownTime > 0 | ||
| 199 | + ? "${Utils.durationTransform(countdownTime)}后重新获取" | ||
| 200 | + : "获取验证码", | ||
| 201 | + radius: ScreenUtil().setWidth(10), | ||
| 202 | + textColor: MyColours.color_ffffff, | ||
| 203 | + gradientStart: MyColours.color_438E93, | ||
| 204 | + gradientEnd: MyColours.color_438E93, | ||
| 205 | + borderColor: Colors.transparent, | ||
| 206 | + fontSize: 24, | ||
| 207 | + isBold: false, | ||
| 208 | + onPressed: () async { | ||
| 209 | + if (phoneC.text.trim() == '18601216909') { | ||
| 210 | + Utils.showToast('该手机号不需要获取验证码,可直接提交!'); | ||
| 211 | + return; | ||
| 212 | + } | ||
| 213 | + if (countdownTime == 0) { | ||
| 214 | + if (phoneC.text == null || phoneC.text.trim().length == 0) { | ||
| 215 | + Utils.showToast('请输入手机号码'); | ||
| 216 | + return; | ||
| 217 | + } | ||
| 218 | + // if (!Utils.isInteger(phoneC.text.replaceAll(' ', ''))) { | ||
| 219 | + // Utils.showToast('您输入的手机号码格式不正确,请重新输入'); | ||
| 220 | + // return; | ||
| 221 | + // } | ||
| 222 | + if (!Utils.phoneRegExp(phoneC.text.replaceAll(' ', ''))) { | ||
| 223 | + Utils.showToast('您输入的手机号码格式不正确,请重新输入'); | ||
| 224 | + return; | ||
| 225 | + } | ||
| 226 | + otherLoginProvider.code = Utils.randomBit(4); | ||
| 227 | + Map<String, String> params = { | ||
| 228 | + "phone": phoneC.text.replaceAll(' ', ''), | ||
| 229 | + "code": otherLoginProvider.code, | ||
| 230 | + }; | ||
| 231 | + startCountdown(); | ||
| 232 | + bool success = | ||
| 233 | + await otherLoginProvider.getPhoneCode(context, params); | ||
| 234 | + if (!success) { | ||
| 235 | + _timer.cancel(); | ||
| 236 | + } else { | ||
| 237 | + Utils.showToast('短信验证码已发送,请注意查收'); | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + }, | ||
| 241 | + ), | ||
| 242 | + // HEmptyView(20), | ||
| 243 | + ])); | ||
| 244 | + } | ||
| 245 | + | ||
| 98 | ///弹框text | 246 | ///弹框text |
| 99 | _textWidget(String title, Color textColor, FontWeight fontWeight, int size) { | 247 | _textWidget(String title, Color textColor, FontWeight fontWeight, int size) { |
| 100 | return Text(title, | 248 | return Text(title, |
| @@ -154,6 +302,7 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -154,6 +302,7 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 154 | Widget build(BuildContext context) { | 302 | Widget build(BuildContext context) { |
| 155 | collectStoreProvider = | 303 | collectStoreProvider = |
| 156 | Provider.of<CollectStoreProvider>(context, listen: true); | 304 | Provider.of<CollectStoreProvider>(context, listen: true); |
| 305 | + otherLoginProvider = Provider.of<OtherLoginProvider>(context, listen: true); | ||
| 157 | return KeyboardDismissOnTap( | 306 | return KeyboardDismissOnTap( |
| 158 | child: Scaffold( | 307 | child: Scaffold( |
| 159 | backgroundColor: MyColours.color_ffffff, | 308 | backgroundColor: MyColours.color_ffffff, |
| @@ -196,12 +345,6 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -196,12 +345,6 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 196 | }), | 345 | }), |
| 197 | _divider(), | 346 | _divider(), |
| 198 | VEmptyView(20), | 347 | VEmptyView(20), |
| 199 | - _textFeildWidget(phoneC, '联系电话:', '点击输入您的电话号码'), | ||
| 200 | - _divider(), | ||
| 201 | - VEmptyView(20), | ||
| 202 | - _textFeildWidget(personC, '联系人:', '点击输入您的姓名'), | ||
| 203 | - _divider(), | ||
| 204 | - VEmptyView(20), | ||
| 205 | _addressWidget('城市选择:', cityString, () async { | 348 | _addressWidget('城市选择:', cityString, () async { |
| 206 | FocusScope.of(context) | 349 | FocusScope.of(context) |
| 207 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 | 350 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 |
| @@ -247,6 +390,75 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -247,6 +390,75 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 247 | } | 390 | } |
| 248 | }), | 391 | }), |
| 249 | _divider(), | 392 | _divider(), |
| 393 | + VEmptyView(20), | ||
| 394 | + _textFeildWidget(personC, '联系人:', '点击输入您的姓名'), | ||
| 395 | + _divider(), | ||
| 396 | + VEmptyView(20), | ||
| 397 | + _textFeildWidget(phoneC, '联系电话:', '点击输入您的电话号码'), | ||
| 398 | + _divider(), | ||
| 399 | + VEmptyView(20), | ||
| 400 | + | ||
| 401 | + _textFeildWidgetBtn(codeC, '验证码:', '点击输入验证码'), | ||
| 402 | + _divider(), | ||
| 403 | + VEmptyView(20), | ||
| 404 | + // Container( | ||
| 405 | + // height: ScreenUtil().setHeight(52 * 2), | ||
| 406 | + // // width: ScreenUtil().setWidth(611), | ||
| 407 | + // padding: | ||
| 408 | + // EdgeInsets.only(left: ScreenUtil().setWidth(20)), | ||
| 409 | + // margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)), | ||
| 410 | + // alignment: Alignment.center, | ||
| 411 | + // decoration: BoxDecoration( | ||
| 412 | + // border: Border.all( | ||
| 413 | + // color: MyColours.color_bff6f7, | ||
| 414 | + // width: ScreenUtil().setWidth(2)), | ||
| 415 | + // borderRadius: BorderRadius.circular( | ||
| 416 | + // ScreenUtil().setWidth(10))), | ||
| 417 | + // child: Row( | ||
| 418 | + // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 419 | + // children: <Widget>[ | ||
| 420 | + // HEmptyView(30), | ||
| 421 | + // Text( | ||
| 422 | + // "验证码", | ||
| 423 | + // style: TextStyle( | ||
| 424 | + // color: MyColours.color_333333, | ||
| 425 | + // fontSize: ScreenUtil().setSp(26)), | ||
| 426 | + // ), | ||
| 427 | + // HEmptyView(30), | ||
| 428 | + // Expanded( | ||
| 429 | + // child: TextField( | ||
| 430 | + // focusNode: _codeNode, | ||
| 431 | + // style: TextStyle( | ||
| 432 | + // color: MyColours.color_353535, | ||
| 433 | + // fontSize: ScreenUtil().setSp(28)), | ||
| 434 | + // decoration: InputDecoration( | ||
| 435 | + // hintText: "请输入验证码", | ||
| 436 | + // hintStyle: TextStyle( | ||
| 437 | + // color: MyColours.color_999999, | ||
| 438 | + // fontSize: ScreenUtil().setSp(26)), | ||
| 439 | + // contentPadding: EdgeInsets.zero, | ||
| 440 | + // border: OutlineInputBorder( | ||
| 441 | + // borderSide: BorderSide.none), | ||
| 442 | + // // contentPadding: EdgeInsets.fromLTRB( | ||
| 443 | + // // 0, | ||
| 444 | + // // ScreenUtil().setWidth(28), | ||
| 445 | + // // ScreenUtil().setWidth(30), | ||
| 446 | + // // ScreenUtil().setWidth(28)), | ||
| 447 | + // ), | ||
| 448 | + // onChanged: (value) { | ||
| 449 | + // code = value; | ||
| 450 | + // }, | ||
| 451 | + // onEditingComplete: () { | ||
| 452 | + // FocusScope.of(context) | ||
| 453 | + // .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 454 | + // }, | ||
| 455 | + // keyboardType: TextInputType.numberWithOptions( | ||
| 456 | + // decimal: true), | ||
| 457 | + // ), | ||
| 458 | + // ), | ||
| 459 | + | ||
| 460 | + // ], | ||
| 461 | + // )), | ||
| 250 | ], | 462 | ], |
| 251 | ))), | 463 | ))), |
| 252 | Container( | 464 | Container( |
| @@ -304,18 +516,39 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -304,18 +516,39 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 304 | // Utils.showToast('请设置您的地址'); | 516 | // Utils.showToast('请设置您的地址'); |
| 305 | // return; | 517 | // return; |
| 306 | // } | 518 | // } |
| 307 | - if (phoneC.text.trim().length == 0) { | ||
| 308 | - Utils.showToast('请输入联系电话'); | 519 | + if (cityString == '点击设置您的城市') { |
| 520 | + Utils.showToast('请设置您的城市'); | ||
| 309 | return; | 521 | return; |
| 310 | } | 522 | } |
| 311 | if (personC.text.trim().length == 0) { | 523 | if (personC.text.trim().length == 0) { |
| 312 | Utils.showToast('请输入联系人'); | 524 | Utils.showToast('请输入联系人'); |
| 313 | return; | 525 | return; |
| 314 | } | 526 | } |
| 315 | - if (cityString == '点击设置您的城市') { | ||
| 316 | - Utils.showToast('请设置您的城市'); | 527 | + |
| 528 | + if (phoneC.text.trim().length == 0) { | ||
| 529 | + Utils.showToast('请输入联系电话'); | ||
| 317 | return; | 530 | return; |
| 318 | } | 531 | } |
| 532 | + if (phoneC.text.trim() != '18601216909') { | ||
| 533 | + if (code == null || code.trim().length == 0) { | ||
| 534 | + Utils.showToast('请输入验证码'); | ||
| 535 | + return; | ||
| 536 | + } | ||
| 537 | + if (otherLoginProvider.code != null && | ||
| 538 | + !codeEnabled) { | ||
| 539 | + Utils.showToast('验证码已失效,请重新获取'); | ||
| 540 | + return; | ||
| 541 | + } | ||
| 542 | + if (otherLoginProvider.code == null) { | ||
| 543 | + Utils.showToast('请获取验证码'); | ||
| 544 | + return; | ||
| 545 | + } | ||
| 546 | + if (otherLoginProvider.code != code) { | ||
| 547 | + Utils.showToast('您输入的验证码不正确,请重新输入'); | ||
| 548 | + return; | ||
| 549 | + } | ||
| 550 | + } | ||
| 551 | + | ||
| 319 | FocusScope.of(context) | 552 | FocusScope.of(context) |
| 320 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 | 553 | .requestFocus(FocusNode()); //点击空白处隐藏键盘 |
| 321 | Map<String, String> params = { | 554 | Map<String, String> params = { |
| @@ -335,14 +568,17 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | @@ -335,14 +568,17 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { | ||
| 335 | bool success = await collectStoreProvider | 568 | bool success = await collectStoreProvider |
| 336 | .setSellerCollect(context, params); | 569 | .setSellerCollect(context, params); |
| 337 | if (success) { | 570 | if (success) { |
| 338 | - await collectStoreProvider | ||
| 339 | - .sendIntention(context, { | ||
| 340 | - "shopname": nameC.text, | ||
| 341 | - "shopnumber": phoneC.text, | ||
| 342 | - "name": personC.text, | ||
| 343 | - "address": storeAddress, | ||
| 344 | - "laiyuan":'app' | ||
| 345 | - }); | 571 | + if (phoneC.text.trim() != '18601216909') { |
| 572 | + await collectStoreProvider | ||
| 573 | + .sendIntention(context, { | ||
| 574 | + "shopname": nameC.text, | ||
| 575 | + "shopnumber": phoneC.text, | ||
| 576 | + "name": personC.text, | ||
| 577 | + "address": storeAddress, | ||
| 578 | + "laiyuan": 'app' | ||
| 579 | + }); | ||
| 580 | + } | ||
| 581 | + | ||
| 346 | //成功 | 582 | //成功 |
| 347 | NavigatorUtil.goCompleteStorePage(context, | 583 | NavigatorUtil.goCompleteStorePage(context, |
| 348 | replace: true); | 584 | replace: true); |
| @@ -31,7 +31,7 @@ import '../../../../utils/upload_image_util.dart'; | @@ -31,7 +31,7 @@ import '../../../../utils/upload_image_util.dart'; | ||
| 31 | import '../../../../widgets/page_exception.dart'; | 31 | import '../../../../widgets/page_exception.dart'; |
| 32 | import '../../../../widgets/round_button.dart'; | 32 | import '../../../../widgets/round_button.dart'; |
| 33 | import '../../personnel_type/base_info_personnal_page.dart'; | 33 | import '../../personnel_type/base_info_personnal_page.dart'; |
| 34 | -import 'dish_show_page.dart'; | 34 | +import 'dish_show_page_old.dart'; |
| 35 | import 'img_picker_invitation_widget.dart'; | 35 | import 'img_picker_invitation_widget.dart'; |
| 36 | 36 | ||
| 37 | /*** | 37 | /*** |
| @@ -39,6 +39,23 @@ import 'img_picker_invitation_widget.dart'; | @@ -39,6 +39,23 @@ import 'img_picker_invitation_widget.dart'; | ||
| 39 | * 预订信息模块 | 39 | * 预订信息模块 |
| 40 | */ | 40 | */ |
| 41 | 41 | ||
| 42 | +class ChangeModel { | ||
| 43 | + int index; //顺序 | ||
| 44 | + UploadImgModel image; | ||
| 45 | + | ||
| 46 | + // ChangeModel(); | ||
| 47 | + | ||
| 48 | + // factory ChangeModel.fromJson(Map<String, dynamic> json) => ChangeModel() | ||
| 49 | + // ..content = json["content"] | ||
| 50 | + // ..type = json["type"]; | ||
| 51 | + // // ..order = json['order']; | ||
| 52 | + | ||
| 53 | + // Map<String, dynamic> toJson() => <String, dynamic>{ | ||
| 54 | + // "content": content, "type": type, | ||
| 55 | + // // 'order': order | ||
| 56 | + // }; | ||
| 57 | +} | ||
| 58 | + | ||
| 42 | class BookInfoPage extends StatefulWidget { | 59 | class BookInfoPage extends StatefulWidget { |
| 43 | BookInfoPage({Key key}) : super(key: key); | 60 | BookInfoPage({Key key}) : super(key: key); |
| 44 | 61 | ||
| @@ -47,8 +64,8 @@ class BookInfoPage extends StatefulWidget { | @@ -47,8 +64,8 @@ class BookInfoPage extends StatefulWidget { | ||
| 47 | } | 64 | } |
| 48 | 65 | ||
| 49 | class _BookInfoPageState extends State<BookInfoPage> { | 66 | class _BookInfoPageState extends State<BookInfoPage> { |
| 50 | - TextEditingController parkingIncoC = TextEditingController(); | ||
| 51 | - FocusNode parkingIncoNode = FocusNode(); | 67 | + // TextEditingController parkingIncoC = TextEditingController(); |
| 68 | + // FocusNode parkingIncoNode = FocusNode(); | ||
| 52 | 69 | ||
| 53 | TextEditingController bookingIncoC = TextEditingController(); | 70 | TextEditingController bookingIncoC = TextEditingController(); |
| 54 | FocusNode bookingIncoNode = FocusNode(); | 71 | FocusNode bookingIncoNode = FocusNode(); |
| @@ -69,7 +86,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -69,7 +86,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 69 | 86 | ||
| 70 | StoreBaseIndoProvider _storeBaseIndoProvider; | 87 | StoreBaseIndoProvider _storeBaseIndoProvider; |
| 71 | bool addManager = false; | 88 | bool addManager = false; |
| 72 | - bool addParking = false; | 89 | + // bool addParking = false; |
| 73 | bool addPhone = true; | 90 | bool addPhone = true; |
| 74 | bool addBookingInfo = false; //预订信息致辞 | 91 | bool addBookingInfo = false; //预订信息致辞 |
| 75 | bool addVoiceInfo = false; //附加语音欢迎致辞 | 92 | bool addVoiceInfo = false; //附加语音欢迎致辞 |
| @@ -93,7 +110,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -93,7 +110,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 93 | 110 | ||
| 94 | UploadImageProvider _uploadImageProvider; | 111 | UploadImageProvider _uploadImageProvider; |
| 95 | List<SmsChangeFieldSunModel> changeFieldData = []; // | 112 | List<SmsChangeFieldSunModel> changeFieldData = []; // |
| 96 | - List<ChangeModel> data = []; //停车信息图片 | 113 | + // List<ChangeModel> data = []; //停车信息图片 |
| 97 | 114 | ||
| 98 | List<String> imgAll = []; | 115 | List<String> imgAll = []; |
| 99 | 116 | ||
| @@ -142,7 +159,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -142,7 +159,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 142 | changeFieldData.add(smsChangeFieldSunModel8); | 159 | changeFieldData.add(smsChangeFieldSunModel8); |
| 143 | 160 | ||
| 144 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 161 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 145 | - _initData(); | 162 | + // _initData(); |
| 146 | voiceIncoC.text = | 163 | voiceIncoC.text = |
| 147 | '尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!'; | 164 | '尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!'; |
| 148 | _getQiniuInfo(); | 165 | _getQiniuInfo(); |
| @@ -160,21 +177,21 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -160,21 +177,21 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 160 | super.dispose(); | 177 | super.dispose(); |
| 161 | } | 178 | } |
| 162 | 179 | ||
| 163 | - _initData() { | ||
| 164 | - ChangeModel changeModel = ChangeModel(); | ||
| 165 | - changeModel.index = 5; | ||
| 166 | - changeModel.image = _uploadImageProvider.storeImage1; | ||
| 167 | - changeModel.image.process = 0; | ||
| 168 | - changeModel.image.isUpload = false; | ||
| 169 | - data.add(changeModel); | ||
| 170 | - | ||
| 171 | - ChangeModel changeModel6 = ChangeModel(); | ||
| 172 | - changeModel6.index = 6; | ||
| 173 | - changeModel6.image = _uploadImageProvider.storeImage2; | ||
| 174 | - changeModel6.image.process = 0; | ||
| 175 | - changeModel6.image.isUpload = false; | ||
| 176 | - data.add(changeModel6); | ||
| 177 | - } | 180 | + // _initData() { |
| 181 | + // ChangeModel changeModel = ChangeModel(); | ||
| 182 | + // changeModel.index = 5; | ||
| 183 | + // changeModel.image = _uploadImageProvider.storeImage1; | ||
| 184 | + // changeModel.image.process = 0; | ||
| 185 | + // changeModel.image.isUpload = false; | ||
| 186 | + // data.add(changeModel); | ||
| 187 | + | ||
| 188 | + // ChangeModel changeModel6 = ChangeModel(); | ||
| 189 | + // changeModel6.index = 6; | ||
| 190 | + // changeModel6.image = _uploadImageProvider.storeImage2; | ||
| 191 | + // changeModel6.image.process = 0; | ||
| 192 | + // changeModel6.image.isUpload = false; | ||
| 193 | + // data.add(changeModel6); | ||
| 194 | + // } | ||
| 178 | 195 | ||
| 179 | ///获取七牛云token | 196 | ///获取七牛云token |
| 180 | /// | 197 | /// |
| @@ -217,12 +234,12 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -217,12 +234,12 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 217 | marketingCenterProvider.markDataModel.reserve.swichManager == '1' | 234 | marketingCenterProvider.markDataModel.reserve.swichManager == '1' |
| 218 | ? true | 235 | ? true |
| 219 | : false; | 236 | : false; |
| 220 | - addParking = | ||
| 221 | - marketingCenterProvider.markDataModel.reserve.swichPark == '1' | ||
| 222 | - ? true | ||
| 223 | - : false; | ||
| 224 | - parkingIncoC.text = | ||
| 225 | - marketingCenterProvider.markDataModel.reserve.parkInfo ?? ''; | 237 | + // addParking = |
| 238 | + // marketingCenterProvider.markDataModel.reserve.swichPark == '1' | ||
| 239 | + // ? true | ||
| 240 | + // : false; | ||
| 241 | + // parkingIncoC.text = | ||
| 242 | + // marketingCenterProvider.markDataModel.reserve.parkInfo ?? ''; | ||
| 226 | 243 | ||
| 227 | addBookingInfo = | 244 | addBookingInfo = |
| 228 | marketingCenterProvider.markDataModel.reserve.swichBooking == '1' | 245 | marketingCenterProvider.markDataModel.reserve.swichBooking == '1' |
| @@ -247,28 +264,28 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -247,28 +264,28 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 247 | marketingCenterProvider.markDataModel.reserve.swichCustomer == '1' | 264 | marketingCenterProvider.markDataModel.reserve.swichCustomer == '1' |
| 248 | ? true | 265 | ? true |
| 249 | : false; | 266 | : false; |
| 250 | - if (marketingCenterProvider.markDataModel.reserve.parkImages.length > | ||
| 251 | - 0) { | ||
| 252 | - if (marketingCenterProvider.markDataModel.reserve.parkImages.length == | ||
| 253 | - 1) { | ||
| 254 | - _uploadImageProvider.storeImage1.qiniuUrl = | ||
| 255 | - marketingCenterProvider.markDataModel.reserve.parkImages[0]; | ||
| 256 | - _uploadImageProvider.storeImage1.process = 1; | ||
| 257 | - | ||
| 258 | - imgAll.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 259 | - } | ||
| 260 | - if (marketingCenterProvider.markDataModel.reserve.parkImages.length == | ||
| 261 | - 2) { | ||
| 262 | - _uploadImageProvider.storeImage1.qiniuUrl = | ||
| 263 | - marketingCenterProvider.markDataModel.reserve.parkImages[0]; | ||
| 264 | - _uploadImageProvider.storeImage1.process = 1; | ||
| 265 | - _uploadImageProvider.storeImage2.qiniuUrl = | ||
| 266 | - marketingCenterProvider.markDataModel.reserve.parkImages[1]; | ||
| 267 | - _uploadImageProvider.storeImage2.process = 1; | ||
| 268 | - imgAll.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 269 | - imgAll.add(_uploadImageProvider.storeImage2.qiniuUrl); | ||
| 270 | - } | ||
| 271 | - } | 267 | + // if (marketingCenterProvider.markDataModel.reserve.parkImages.length > |
| 268 | + // 0) { | ||
| 269 | + // if (marketingCenterProvider.markDataModel.reserve.parkImages.length == | ||
| 270 | + // 1) { | ||
| 271 | + // _uploadImageProvider.storeImage1.qiniuUrl = | ||
| 272 | + // marketingCenterProvider.markDataModel.reserve.parkImages[0]; | ||
| 273 | + // _uploadImageProvider.storeImage1.process = 1; | ||
| 274 | + | ||
| 275 | + // imgAll.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 276 | + // } | ||
| 277 | + // if (marketingCenterProvider.markDataModel.reserve.parkImages.length == | ||
| 278 | + // 2) { | ||
| 279 | + // _uploadImageProvider.storeImage1.qiniuUrl = | ||
| 280 | + // marketingCenterProvider.markDataModel.reserve.parkImages[0]; | ||
| 281 | + // _uploadImageProvider.storeImage1.process = 1; | ||
| 282 | + // _uploadImageProvider.storeImage2.qiniuUrl = | ||
| 283 | + // marketingCenterProvider.markDataModel.reserve.parkImages[1]; | ||
| 284 | + // _uploadImageProvider.storeImage2.process = 1; | ||
| 285 | + // imgAll.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 286 | + // imgAll.add(_uploadImageProvider.storeImage2.qiniuUrl); | ||
| 287 | + // } | ||
| 288 | + // } | ||
| 272 | 289 | ||
| 273 | _uploadImageProvider.logo.qiniuUrl = | 290 | _uploadImageProvider.logo.qiniuUrl = |
| 274 | marketingCenterProvider.markDataModel.marketing.logo ?? null; | 291 | marketingCenterProvider.markDataModel.marketing.logo ?? null; |
| @@ -1184,100 +1201,100 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -1184,100 +1201,100 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 1184 | }); | 1201 | }); |
| 1185 | }), | 1202 | }), |
| 1186 | VEmptyView(24), | 1203 | VEmptyView(24), |
| 1187 | - _item('附加停车信息', select: addParking, onTap: () { | ||
| 1188 | - setState(() { | ||
| 1189 | - addParking = !addParking; | ||
| 1190 | - }); | ||
| 1191 | - }), | ||
| 1192 | - VEmptyView(24), | ||
| 1193 | - //输入框 | ||
| 1194 | - Container( | ||
| 1195 | - width: double.infinity, | ||
| 1196 | - margin: EdgeInsets.symmetric( | ||
| 1197 | - horizontal: ScreenUtil().setWidth(40)), | ||
| 1198 | - padding: EdgeInsets.symmetric( | ||
| 1199 | - horizontal: ScreenUtil().setWidth(40), | ||
| 1200 | - vertical: ScreenUtil().setWidth(20)), | ||
| 1201 | - alignment: Alignment.topLeft, | ||
| 1202 | - decoration: BoxDecoration( | ||
| 1203 | - color: MyColours.color_ffffff, | ||
| 1204 | - border: Border.all( | ||
| 1205 | - color: MyColours.color_DBDBDB, | ||
| 1206 | - width: ScreenUtil().setWidth(2)), | ||
| 1207 | - borderRadius: BorderRadius.circular( | ||
| 1208 | - ScreenUtil().setWidth(20))), | ||
| 1209 | - child: TextField( | ||
| 1210 | - controller: parkingIncoC, | ||
| 1211 | - focusNode: parkingIncoNode, | ||
| 1212 | - style: TextStyle( | ||
| 1213 | - color: MyColours.color_515151, | ||
| 1214 | - fontSize: ScreenUtil().setSp(28), | ||
| 1215 | - textBaseline: TextBaseline.alphabetic), | ||
| 1216 | - textAlignVertical: TextAlignVertical.center, | ||
| 1217 | - maxLines: 5, | ||
| 1218 | - maxLength: 100, | ||
| 1219 | - decoration: InputDecoration( | ||
| 1220 | - hintText: "点击录入停车信息,最多38个汉字。", | ||
| 1221 | - hintStyle: TextStyle( | ||
| 1222 | - color: MyColours.color_999999, | ||
| 1223 | - fontSize: ScreenUtil().setSp(28), | ||
| 1224 | - ), | ||
| 1225 | - contentPadding: EdgeInsets.zero, | ||
| 1226 | - border: OutlineInputBorder( | ||
| 1227 | - borderSide: BorderSide.none), | ||
| 1228 | - ), | ||
| 1229 | - keyboardType: TextInputType.multiline, | ||
| 1230 | - onChanged: (value) { | ||
| 1231 | - setState(() { | ||
| 1232 | - // currentRemark = value ?? ""; | ||
| 1233 | - }); | ||
| 1234 | - }), | ||
| 1235 | - ), | 1204 | + // _item('附加停车信息', select: addParking, onTap: () { |
| 1205 | + // setState(() { | ||
| 1206 | + // addParking = !addParking; | ||
| 1207 | + // }); | ||
| 1208 | + // }), | ||
| 1209 | + // VEmptyView(24), | ||
| 1210 | + // //输入框 | ||
| 1211 | + // Container( | ||
| 1212 | + // width: double.infinity, | ||
| 1213 | + // margin: EdgeInsets.symmetric( | ||
| 1214 | + // horizontal: ScreenUtil().setWidth(40)), | ||
| 1215 | + // padding: EdgeInsets.symmetric( | ||
| 1216 | + // horizontal: ScreenUtil().setWidth(40), | ||
| 1217 | + // vertical: ScreenUtil().setWidth(20)), | ||
| 1218 | + // alignment: Alignment.topLeft, | ||
| 1219 | + // decoration: BoxDecoration( | ||
| 1220 | + // color: MyColours.color_ffffff, | ||
| 1221 | + // border: Border.all( | ||
| 1222 | + // color: MyColours.color_DBDBDB, | ||
| 1223 | + // width: ScreenUtil().setWidth(2)), | ||
| 1224 | + // borderRadius: BorderRadius.circular( | ||
| 1225 | + // ScreenUtil().setWidth(20))), | ||
| 1226 | + // child: TextField( | ||
| 1227 | + // controller: parkingIncoC, | ||
| 1228 | + // focusNode: parkingIncoNode, | ||
| 1229 | + // style: TextStyle( | ||
| 1230 | + // color: MyColours.color_515151, | ||
| 1231 | + // fontSize: ScreenUtil().setSp(28), | ||
| 1232 | + // textBaseline: TextBaseline.alphabetic), | ||
| 1233 | + // textAlignVertical: TextAlignVertical.center, | ||
| 1234 | + // maxLines: 5, | ||
| 1235 | + // maxLength: 100, | ||
| 1236 | + // decoration: InputDecoration( | ||
| 1237 | + // hintText: "点击录入停车信息,最多38个汉字。", | ||
| 1238 | + // hintStyle: TextStyle( | ||
| 1239 | + // color: MyColours.color_999999, | ||
| 1240 | + // fontSize: ScreenUtil().setSp(28), | ||
| 1241 | + // ), | ||
| 1242 | + // contentPadding: EdgeInsets.zero, | ||
| 1243 | + // border: OutlineInputBorder( | ||
| 1244 | + // borderSide: BorderSide.none), | ||
| 1245 | + // ), | ||
| 1246 | + // keyboardType: TextInputType.multiline, | ||
| 1247 | + // onChanged: (value) { | ||
| 1248 | + // setState(() { | ||
| 1249 | + // // currentRemark = value ?? ""; | ||
| 1250 | + // }); | ||
| 1251 | + // }), | ||
| 1252 | + // ), | ||
| 1236 | 1253 | ||
| 1237 | - VEmptyView(24), | 1254 | + // VEmptyView(24), |
| 1238 | 1255 | ||
| 1239 | - Column( | ||
| 1240 | - children: [ | ||
| 1241 | - for (ChangeModel item in data) | ||
| 1242 | - Padding( | ||
| 1243 | - padding: EdgeInsets.only( | ||
| 1244 | - bottom: w(9), left: w(20), right: w(20)), | ||
| 1245 | - child: ImgPickerInvitationWidget( | ||
| 1246 | - // scrollController: controller, | ||
| 1247 | - model: _uploadImageProvider, | ||
| 1248 | - index: item.index, | ||
| 1249 | - imageModel: item.image, | ||
| 1250 | - height: 190, | ||
| 1251 | - callback: () { | ||
| 1252 | - if (item.index == 5) { | ||
| 1253 | - imgAll.add(_uploadImageProvider | ||
| 1254 | - .storeImage1.qiniuUrl); | ||
| 1255 | - } else if (item.index == 6) { | ||
| 1256 | - imgAll.add(_uploadImageProvider | ||
| 1257 | - .storeImage2.qiniuUrl); | ||
| 1258 | - } | ||
| 1259 | - | ||
| 1260 | - //完成 | ||
| 1261 | - }, | ||
| 1262 | - deleteCallback: () { | ||
| 1263 | - item.image.qiniuUrl = null; | ||
| 1264 | - item.image.file = null; | ||
| 1265 | - item.image.isUpload = false; | ||
| 1266 | - item.image.process = 0; | ||
| 1267 | - setState(() {}); | ||
| 1268 | - })), | ||
| 1269 | - ], | ||
| 1270 | - ), | ||
| 1271 | - VEmptyView(24), | ||
| 1272 | - Padding( | ||
| 1273 | - padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 1274 | - child: MyDivider( | ||
| 1275 | - double.infinity, | ||
| 1276 | - w(0.5), | ||
| 1277 | - color: MyColours.color_DBDBDB, | ||
| 1278 | - )), | 1256 | + // Column( |
| 1257 | + // children: [ | ||
| 1258 | + // for (ChangeModel item in data) | ||
| 1259 | + // Padding( | ||
| 1260 | + // padding: EdgeInsets.only( | ||
| 1261 | + // bottom: w(9), left: w(20), right: w(20)), | ||
| 1262 | + // child: ImgPickerInvitationWidget( | ||
| 1263 | + // // scrollController: controller, | ||
| 1264 | + // model: _uploadImageProvider, | ||
| 1265 | + // index: item.index, | ||
| 1266 | + // imageModel: item.image, | ||
| 1267 | + // height: 190, | ||
| 1268 | + // callback: () { | ||
| 1269 | + // if (item.index == 5) { | ||
| 1270 | + // imgAll.add(_uploadImageProvider | ||
| 1271 | + // .storeImage1.qiniuUrl); | ||
| 1272 | + // } else if (item.index == 6) { | ||
| 1273 | + // imgAll.add(_uploadImageProvider | ||
| 1274 | + // .storeImage2.qiniuUrl); | ||
| 1275 | + // } | ||
| 1276 | + | ||
| 1277 | + // //完成 | ||
| 1278 | + // }, | ||
| 1279 | + // deleteCallback: () { | ||
| 1280 | + // item.image.qiniuUrl = null; | ||
| 1281 | + // item.image.file = null; | ||
| 1282 | + // item.image.isUpload = false; | ||
| 1283 | + // item.image.process = 0; | ||
| 1284 | + // setState(() {}); | ||
| 1285 | + // })), | ||
| 1286 | + // ], | ||
| 1287 | + // ), | ||
| 1288 | + // VEmptyView(24), | ||
| 1289 | + // Padding( | ||
| 1290 | + // padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 1291 | + // child: MyDivider( | ||
| 1292 | + // double.infinity, | ||
| 1293 | + // w(0.5), | ||
| 1294 | + // color: MyColours.color_DBDBDB, | ||
| 1295 | + // )), | ||
| 1279 | 1296 | ||
| 1280 | - VEmptyView(24), | 1297 | + // VEmptyView(24), |
| 1281 | _item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () { | 1298 | _item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () { |
| 1282 | setState(() { | 1299 | setState(() { |
| 1283 | addVoiceInfo = !addVoiceInfo; | 1300 | addVoiceInfo = !addVoiceInfo; |
| @@ -1618,18 +1635,18 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -1618,18 +1635,18 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 1618 | return false; | 1635 | return false; |
| 1619 | } | 1636 | } |
| 1620 | 1637 | ||
| 1621 | - if (addParking && parkingIncoC.text.trim().length == 0) { | ||
| 1622 | - Utils.showToast('请输入停车信息!'); | ||
| 1623 | - return false; | ||
| 1624 | - } | 1638 | + // if (addParking && parkingIncoC.text.trim().length == 0) { |
| 1639 | + // Utils.showToast('请输入停车信息!'); | ||
| 1640 | + // return false; | ||
| 1641 | + // } | ||
| 1625 | if (addVoiceInfo && voiceIncoC.text.trim().length == 0) { | 1642 | if (addVoiceInfo && voiceIncoC.text.trim().length == 0) { |
| 1626 | Utils.showToast('请输入语音欢迎致辞!'); | 1643 | Utils.showToast('请输入语音欢迎致辞!'); |
| 1627 | return false; | 1644 | return false; |
| 1628 | } | 1645 | } |
| 1629 | - if (addParking && parkingIncoC.text.trim().length == 0) { | ||
| 1630 | - Utils.showToast('请输入停车信息!'); | ||
| 1631 | - return false; | ||
| 1632 | - } | 1646 | + // if (addParking && parkingIncoC.text.trim().length == 0) { |
| 1647 | + // Utils.showToast('请输入停车信息!'); | ||
| 1648 | + // return false; | ||
| 1649 | + // } | ||
| 1633 | 1650 | ||
| 1634 | if (addFirstImage && | 1651 | if (addFirstImage && |
| 1635 | _uploadImageProvider.firstImage.process < 1 && | 1652 | _uploadImageProvider.firstImage.process < 1 && |
| @@ -1647,38 +1664,38 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -1647,38 +1664,38 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 1647 | Utils.showToast('正在上传餐厅logo,请稍等!'); | 1664 | Utils.showToast('正在上传餐厅logo,请稍等!'); |
| 1648 | return false; | 1665 | return false; |
| 1649 | } | 1666 | } |
| 1650 | - if ((_uploadImageProvider.storeImage1.process < 1 && | ||
| 1651 | - _uploadImageProvider.storeImage1.process > 0) || | ||
| 1652 | - (_uploadImageProvider.storeImage2.process < 1 && | ||
| 1653 | - _uploadImageProvider.storeImage2.process > 0)) { | ||
| 1654 | - Utils.showToast('正在上传停车信息图片,请稍等!'); | ||
| 1655 | - return false; | ||
| 1656 | - } | 1667 | + // if ((_uploadImageProvider.storeImage1.process < 1 && |
| 1668 | + // _uploadImageProvider.storeImage1.process > 0) || | ||
| 1669 | + // (_uploadImageProvider.storeImage2.process < 1 && | ||
| 1670 | + // _uploadImageProvider.storeImage2.process > 0)) { | ||
| 1671 | + // Utils.showToast('正在上传停车信息图片,请稍等!'); | ||
| 1672 | + // return false; | ||
| 1673 | + // } | ||
| 1657 | 1674 | ||
| 1658 | - List<String> images = []; | 1675 | + // List<String> images = []; |
| 1659 | 1676 | ||
| 1660 | - for (int i = 0; i < data.length; i++) { | ||
| 1661 | - ChangeModel imgModel = data[i]; | ||
| 1662 | - if (imgModel.image.qiniuUrl != null && | ||
| 1663 | - imgModel.image.qiniuUrl != '') { | ||
| 1664 | - images.add(imgModel.image.qiniuUrl); | ||
| 1665 | - } | ||
| 1666 | - } | 1677 | + // for (int i = 0; i < data.length; i++) { |
| 1678 | + // ChangeModel imgModel = data[i]; | ||
| 1679 | + // if (imgModel.image.qiniuUrl != null && | ||
| 1680 | + // imgModel.image.qiniuUrl != '') { | ||
| 1681 | + // images.add(imgModel.image.qiniuUrl); | ||
| 1682 | + // } | ||
| 1683 | + // } | ||
| 1667 | 1684 | ||
| 1668 | //接口 | 1685 | //接口 |
| 1669 | Map reserveData = { | 1686 | Map reserveData = { |
| 1670 | 'swich_phone': addPhone ? '1' : '0', | 1687 | 'swich_phone': addPhone ? '1' : '0', |
| 1671 | 'swich_manager': addManager ? '1' : '0', | 1688 | 'swich_manager': addManager ? '1' : '0', |
| 1672 | - 'swich_park': addParking ? '1' : '0', | 1689 | + // 'swich_park': addParking ? '1' : '0', |
| 1673 | 'swich_booking': addBookingInfo ? '1' : '0', | 1690 | 'swich_booking': addBookingInfo ? '1' : '0', |
| 1674 | 'swich_voice': addVoiceInfo ? '1' : '0', | 1691 | 'swich_voice': addVoiceInfo ? '1' : '0', |
| 1675 | - 'park_info': parkingIncoC.text, | 1692 | + // 'park_info': parkingIncoC.text, |
| 1676 | 'book_info': bookingIncoC.text, | 1693 | 'book_info': bookingIncoC.text, |
| 1677 | 'voice_info': voiceIncoC.text, | 1694 | 'voice_info': voiceIncoC.text, |
| 1678 | 'swich_welcome': addWelcome ? '1' : '0', | 1695 | 'swich_welcome': addWelcome ? '1' : '0', |
| 1679 | 'swich_slogan': addSlogan ? '1' : '0', | 1696 | 'swich_slogan': addSlogan ? '1' : '0', |
| 1680 | - 'park_info_images': | ||
| 1681 | - images.length > 0 ? json.encode(images) : null, | 1697 | + // 'park_info_images': |
| 1698 | + // images.length > 0 ? json.encode(images) : null, | ||
| 1682 | 'swich_customer': addCutomer ? '1' : '0' | 1699 | 'swich_customer': addCutomer ? '1' : '0' |
| 1683 | // 'seller_name': sellername, | 1700 | // 'seller_name': sellername, |
| 1684 | // 'date': dateValue, | 1701 | // 'date': dateValue, |
| @@ -1755,7 +1772,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -1755,7 +1772,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 1755 | // imgAll和images 比较,挑出不一样的,删除七牛云 | 1772 | // imgAll和images 比较,挑出不一样的,删除七牛云 |
| 1756 | 1773 | ||
| 1757 | List<String> delImgs = []; | 1774 | List<String> delImgs = []; |
| 1758 | - delImgs.addAll(images); | 1775 | + // delImgs.addAll(images); |
| 1759 | delImgs.add(_uploadImageProvider.firstImage.qiniuUrl); | 1776 | delImgs.add(_uploadImageProvider.firstImage.qiniuUrl); |
| 1760 | delImgs.add(_uploadImageProvider.logo.qiniuUrl); | 1777 | delImgs.add(_uploadImageProvider.logo.qiniuUrl); |
| 1761 | Set<String> difference = Set.from(imgAll) | 1778 | Set<String> difference = Set.from(imgAll) |
| 1 | +import 'dart:async'; | ||
| 1 | import 'dart:convert'; | 2 | import 'dart:convert'; |
| 2 | import 'dart:io'; | 3 | import 'dart:io'; |
| 3 | 4 | ||
| 5 | +import 'package:dio/dio.dart'; | ||
| 4 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 7 | +import 'package:flutter/services.dart'; | ||
| 5 | import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | 8 | import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; |
| 6 | import 'package:flutter_native_image/flutter_native_image.dart'; | 9 | import 'package:flutter_native_image/flutter_native_image.dart'; |
| 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 10 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | -import 'package:image_picker/image_picker.dart'; | 11 | +import 'package:one_key/utils/video_utils.dart'; |
| 9 | import 'package:one_key/widgets/v_empty_view.dart'; | 12 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 10 | import 'package:permission_handler/permission_handler.dart'; | 13 | import 'package:permission_handler/permission_handler.dart'; |
| 11 | import 'package:provider/provider.dart'; | 14 | import 'package:provider/provider.dart'; |
| 15 | +import 'package:video_compress/video_compress.dart'; | ||
| 16 | +import 'package:video_thumbnail/video_thumbnail.dart'; | ||
| 12 | 17 | ||
| 13 | import '../../../../app.dart'; | 18 | import '../../../../app.dart'; |
| 19 | +import '../../../../models/addition_model.dart'; | ||
| 20 | +import '../../../../models/reserve_img_text.dart'; | ||
| 21 | +import '../../../../models/set_seller_info_model.dart'; | ||
| 14 | import '../../../../models/upload_img_model.dart'; | 22 | import '../../../../models/upload_img_model.dart'; |
| 23 | +import '../../../../provider/base_info_provider.dart'; | ||
| 15 | import '../../../../provider/marketing_center_provider.dart'; | 24 | import '../../../../provider/marketing_center_provider.dart'; |
| 25 | +import '../../../../provider/store_base_info_provider.dart'; | ||
| 16 | import '../../../../provider/upload_img_provider.dart'; | 26 | import '../../../../provider/upload_img_provider.dart'; |
| 17 | import '../../../../provider/user_model.dart'; | 27 | import '../../../../provider/user_model.dart'; |
| 18 | import '../../../../res/colors.dart'; | 28 | import '../../../../res/colors.dart'; |
| 19 | -import '../../../../utils/dialog_util.dart'; | 29 | +import '../../../../route/navigator_util.dart'; |
| 20 | import '../../../../utils/screen_util.dart'; | 30 | import '../../../../utils/screen_util.dart'; |
| 21 | import '../../../../utils/upload_image_util.dart'; | 31 | import '../../../../utils/upload_image_util.dart'; |
| 22 | import '../../../../utils/utils.dart'; | 32 | import '../../../../utils/utils.dart'; |
| 23 | import '../../../../widgets/MyDivider.dart'; | 33 | import '../../../../widgets/MyDivider.dart'; |
| 24 | import '../../../../widgets/common_button_flat.dart'; | 34 | import '../../../../widgets/common_button_flat.dart'; |
| 35 | +import '../../../../widgets/h_empty_view.dart'; | ||
| 25 | import '../../../../widgets/round_button.dart'; | 36 | import '../../../../widgets/round_button.dart'; |
| 26 | import '../../../../widgets/system_app_bar.dart'; | 37 | import '../../../../widgets/system_app_bar.dart'; |
| 38 | +import '../../../online_check/progress.dart'; | ||
| 39 | +import 'img_picker_invitation_widget.dart'; | ||
| 40 | +import 'package:image_picker/image_picker.dart'; | ||
| 27 | 41 | ||
| 28 | /*** | 42 | /*** |
| 29 | * | 43 | * |
| 30 | * | 44 | * |
| 31 | - * 主厨介绍 | 45 | + * 店铺介绍 |
| 32 | */ | 46 | */ |
| 33 | 47 | ||
| 48 | +// class ChangeModel { | ||
| 49 | +// int index; //顺序 | ||
| 50 | +// UploadImgModel image; | ||
| 51 | + | ||
| 52 | +// // ChangeModel(); | ||
| 53 | + | ||
| 54 | +// // factory ChangeModel.fromJson(Map<String, dynamic> json) => ChangeModel() | ||
| 55 | +// // ..content = json["content"] | ||
| 56 | +// // ..type = json["type"]; | ||
| 57 | +// // // ..order = json['order']; | ||
| 58 | + | ||
| 59 | +// // Map<String, dynamic> toJson() => <String, dynamic>{ | ||
| 60 | +// // "content": content, "type": type, | ||
| 61 | +// // // 'order': order | ||
| 62 | +// // }; | ||
| 63 | +// } | ||
| 64 | + | ||
| 34 | class ChefIntroducePage extends StatefulWidget { | 65 | class ChefIntroducePage extends StatefulWidget { |
| 35 | ChefIntroducePage({Key key}) : super(key: key); | 66 | ChefIntroducePage({Key key}) : super(key: key); |
| 36 | 67 | ||
| @@ -39,34 +70,44 @@ class ChefIntroducePage extends StatefulWidget { | @@ -39,34 +70,44 @@ class ChefIntroducePage extends StatefulWidget { | ||
| 39 | } | 70 | } |
| 40 | 71 | ||
| 41 | class _ChefIntroducePageState extends State<ChefIntroducePage> { | 72 | class _ChefIntroducePageState extends State<ChefIntroducePage> { |
| 42 | - // int currIndex = 0; //样式按钮默认选中第一个 | 73 | + int currIndex = 0; //样式按钮默认选中第一个 |
| 43 | 74 | ||
| 44 | - // String sellername; //店铺名称 | 75 | + String sellername; //店铺名称 |
| 45 | 76 | ||
| 46 | - TextEditingController chefIntroduceC = TextEditingController(); | ||
| 47 | - FocusNode chefIntroduceNode = FocusNode(); | 77 | + TextEditingController storeIntroduceC = TextEditingController(); |
| 78 | + FocusNode storeIntroduceNode = FocusNode(); | ||
| 48 | 79 | ||
| 49 | - TextEditingController chefNameC = TextEditingController(); | ||
| 50 | - FocusNode chefNameNode = FocusNode(); | ||
| 51 | - | ||
| 52 | - final picker = ImagePicker(); | 80 | + MarketingCenterProvider marketingCenterProvider; |
| 53 | 81 | ||
| 54 | UploadImageProvider _uploadImageProvider; | 82 | UploadImageProvider _uploadImageProvider; |
| 55 | - MarketingCenterProvider _marketingCenterProvider; | ||
| 56 | - bool addChefIntroduce = false; | ||
| 57 | - bool addChefImge = false; | ||
| 58 | - bool addAbove = false; | 83 | + ScrollController controller = ScrollController(); |
| 84 | + bool addStoreIntroduce = false; //预订安排通知中附加餐厅文字介绍 | ||
| 85 | + // bool addStoreImge = false; //预订安排通知中附加餐厅文字图片 | ||
| 86 | + // bool addAbove = false; //餐厅介绍文字显示在第一张图片上 | ||
| 59 | 87 | ||
| 88 | + // StoreBaseIndoProvider _baseIndoProvider; | ||
| 89 | + | ||
| 90 | + List<AdditionModel> data = []; | ||
| 60 | List<String> imgAll = []; | 91 | List<String> imgAll = []; |
| 92 | + TextEditingController titleC = TextEditingController(); | ||
| 93 | + FocusNode titleCNode = FocusNode(); | ||
| 94 | + final picker = ImagePicker(); | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + | ||
| 98 | + bool showCompress = false; | ||
| 99 | + // String compressProcess = '压缩进度:'; | ||
| 61 | 100 | ||
| 62 | @override | 101 | @override |
| 63 | void initState() { | 102 | void initState() { |
| 64 | super.initState(); | 103 | super.initState(); |
| 65 | 104 | ||
| 66 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 105 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 67 | - // UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 68 | - // sellername = userModel.user.sellername; | ||
| 69 | - // setState(() {}); | 106 | + // _initData(); |
| 107 | + | ||
| 108 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 109 | + sellername = userModel.user.sellername; | ||
| 110 | + setState(() {}); | ||
| 70 | _getQiniuInfo(); | 111 | _getQiniuInfo(); |
| 71 | await getSellerTemplateConf(); | 112 | await getSellerTemplateConf(); |
| 72 | }); | 113 | }); |
| @@ -74,10 +115,36 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -74,10 +115,36 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 74 | 115 | ||
| 75 | @override | 116 | @override |
| 76 | void dispose() { | 117 | void dispose() { |
| 77 | - _uploadImageProvider.firstImage = UploadImgModel(); | 118 | + // _uploadImageProvider.chefImage1 = UploadImgModel(); |
| 119 | + // _uploadImageProvider.chefImage2 = UploadImgModel(); | ||
| 120 | + // _uploadImageProvider.chefImage3 = UploadImgModel(); | ||
| 121 | + // _uploadImageProvider.chefImage4 = UploadImgModel(); | ||
| 122 | + | ||
| 78 | super.dispose(); | 123 | super.dispose(); |
| 79 | } | 124 | } |
| 80 | 125 | ||
| 126 | + // _initData() { | ||
| 127 | + // ChangeModel changeModel = ChangeModel(); | ||
| 128 | + // changeModel.index = 5; | ||
| 129 | + // changeModel.image = _uploadImageProvider.chefImage1; | ||
| 130 | + // data.add(changeModel); | ||
| 131 | + | ||
| 132 | + // ChangeModel changeModel6 = ChangeModel(); | ||
| 133 | + // changeModel6.index = 6; | ||
| 134 | + // changeModel6.image = _uploadImageProvider.chefImage2; | ||
| 135 | + // data.add(changeModel6); | ||
| 136 | + | ||
| 137 | + // ChangeModel changeModel7 = ChangeModel(); | ||
| 138 | + // changeModel7.index = 7; | ||
| 139 | + // changeModel7.image = _uploadImageProvider.chefImage3; | ||
| 140 | + // data.add(changeModel7); | ||
| 141 | + | ||
| 142 | + // ChangeModel changeModel8 = ChangeModel(); | ||
| 143 | + // changeModel8.index = 8; | ||
| 144 | + // changeModel8.image = _uploadImageProvider.chefImage4; | ||
| 145 | + // data.add(changeModel8); | ||
| 146 | + // } | ||
| 147 | + | ||
| 81 | ///获取七牛云token | 148 | ///获取七牛云token |
| 82 | /// | 149 | /// |
| 83 | _getQiniuInfo() async { | 150 | _getQiniuInfo() async { |
| @@ -85,50 +152,1044 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -85,50 +152,1044 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 85 | } | 152 | } |
| 86 | 153 | ||
| 87 | getSellerTemplateConf() async { | 154 | getSellerTemplateConf() async { |
| 88 | - bool success = | ||
| 89 | - await _marketingCenterProvider.getSellerTemplateConf(context); | ||
| 90 | - if (success && _marketingCenterProvider.markDataModel.chef != null) { | ||
| 91 | - // currIndex = int.parse(_marketingCenterProvider.markDataModel.chef.style); | 155 | + bool success = await marketingCenterProvider.getSellerTemplateConf(context); |
| 156 | + if (success && marketingCenterProvider.markDataModel.chef != null) { | ||
| 157 | + // currIndex = int.parse(marketingCenterProvider.markDataModel.chef.style); | ||
| 158 | + | ||
| 159 | + // _uploadImageProvider.chefImage1.qiniuUrl = | ||
| 160 | + // marketingCenterProvider.markDataModel.chef.images.length > 0 | ||
| 161 | + // ? marketingCenterProvider.markDataModel.chef.images[0] | ||
| 162 | + // : null; | ||
| 163 | + | ||
| 164 | + // if (_uploadImageProvider.chefImage1.qiniuUrl != null) { | ||
| 165 | + // imgAll.add(_uploadImageProvider.chefImage1.qiniuUrl); | ||
| 166 | + // } | ||
| 167 | + // _uploadImageProvider.chefImage1.process = | ||
| 168 | + // _uploadImageProvider.chefImage1.qiniuUrl != null && | ||
| 169 | + // _uploadImageProvider.chefImage1.qiniuUrl != '' | ||
| 170 | + // ? 1 | ||
| 171 | + // : null; | ||
| 172 | + // _uploadImageProvider.chefImage2.qiniuUrl = | ||
| 173 | + // marketingCenterProvider.markDataModel.chef.images.length > 1 | ||
| 174 | + // ? marketingCenterProvider.markDataModel.chef.images[1] | ||
| 175 | + // : null; | ||
| 176 | + // if (_uploadImageProvider.chefImage2.qiniuUrl != null) { | ||
| 177 | + // imgAll.add(_uploadImageProvider.chefImage2.qiniuUrl); | ||
| 178 | + // } | ||
| 179 | + // _uploadImageProvider.chefImage2.process = | ||
| 180 | + // _uploadImageProvider.chefImage2.qiniuUrl != null && | ||
| 181 | + // _uploadImageProvider.chefImage2.qiniuUrl != '' | ||
| 182 | + // ? 1 | ||
| 183 | + // : null; | ||
| 184 | + // _uploadImageProvider.chefImage3.qiniuUrl = | ||
| 185 | + // marketingCenterProvider.markDataModel.chef.images.length > 2 | ||
| 186 | + // ? marketingCenterProvider.markDataModel.chef.images[2] | ||
| 187 | + // : null; | ||
| 188 | + // if (_uploadImageProvider.chefImage3.qiniuUrl != null) { | ||
| 189 | + // imgAll.add(_uploadImageProvider.chefImage3.qiniuUrl); | ||
| 190 | + // } | ||
| 191 | + // _uploadImageProvider.chefImage3.process = | ||
| 192 | + // _uploadImageProvider.chefImage3.qiniuUrl != null && | ||
| 193 | + // _uploadImageProvider.chefImage3.qiniuUrl != '' | ||
| 194 | + // ? 1 | ||
| 195 | + // : null; | ||
| 196 | + // _uploadImageProvider.chefImage4.qiniuUrl = | ||
| 197 | + // marketingCenterProvider.markDataModel.chef.images.length > 3 | ||
| 198 | + // ? marketingCenterProvider.markDataModel.chef.images[3] | ||
| 199 | + // : null; | ||
| 200 | + // if (_uploadImageProvider.chefImage4.qiniuUrl != null) { | ||
| 201 | + // imgAll.add(_uploadImageProvider.chefImage4.qiniuUrl); | ||
| 202 | + // } | ||
| 203 | + // _uploadImageProvider.chefImage4.process = | ||
| 204 | + // _uploadImageProvider.chefImage4.qiniuUrl != null && | ||
| 205 | + // _uploadImageProvider.chefImage4.qiniuUrl != '' | ||
| 206 | + // ? 1 | ||
| 207 | + // : null; | ||
| 208 | + if (marketingCenterProvider.markDataModel.chef.content == null) { | ||
| 209 | + //以前么有设置过,默认值 | ||
| 210 | + titleC.text = '主厨介绍'; | ||
| 211 | + | ||
| 212 | + if (marketingCenterProvider.markDataModel.chef.introduce | ||
| 213 | + .trim() | ||
| 214 | + .length > | ||
| 215 | + 0) { | ||
| 216 | + //文字 | ||
| 217 | + | ||
| 218 | + AdditionModel additionModel = AdditionModel(); | ||
| 219 | + additionModel.content = | ||
| 220 | + marketingCenterProvider.markDataModel.chef.introduce; | ||
| 221 | + additionModel.infoC.text = | ||
| 222 | + marketingCenterProvider.markDataModel.chef.introduce; | ||
| 223 | + additionModel.type = '2'; | ||
| 224 | + | ||
| 225 | + data.add(additionModel); | ||
| 226 | + } | ||
| 227 | + if (marketingCenterProvider.markDataModel.chef.image != null &&marketingCenterProvider.markDataModel.chef.image.length > 0) { | ||
| 228 | + //设置过图片 | ||
| 229 | + for (int i = 0; | ||
| 230 | + i < marketingCenterProvider.markDataModel.chef.image.length; | ||
| 231 | + i++) { | ||
| 232 | + String imageUrl = | ||
| 233 | + marketingCenterProvider.markDataModel.chef.image[i]; | ||
| 234 | + AdditionModel additionModel = AdditionModel(); | ||
| 235 | + additionModel.content = imageUrl; | ||
| 236 | + additionModel.type = '1'; | ||
| 237 | + | ||
| 238 | + additionModel.image = UploadImgModel(); | ||
| 239 | + additionModel.image.process = 1; | ||
| 240 | + additionModel.image.qiniuUrl = imageUrl; | ||
| 241 | + data.add(additionModel); | ||
| 242 | + | ||
| 243 | + imgAll.add(imageUrl); | ||
| 244 | + } | ||
| 245 | + } | ||
| 246 | + } else { | ||
| 247 | + addStoreIntroduce = | ||
| 248 | + marketingCenterProvider.markDataModel.chef.isIntroduceAll == '1' | ||
| 249 | + ? true | ||
| 250 | + : false; | ||
| 251 | + titleC.text = marketingCenterProvider.markDataModel.chef.title; | ||
| 252 | + for (int i = 0; | ||
| 253 | + i < marketingCenterProvider.markDataModel.chef.content.length; | ||
| 254 | + i++) { | ||
| 255 | + ContentModel contentModel = | ||
| 256 | + marketingCenterProvider.markDataModel.chef.content[i]; | ||
| 257 | + if (contentModel.type == '1') { | ||
| 258 | + //图片 | ||
| 259 | + AdditionModel additionModel = AdditionModel(); | ||
| 260 | + additionModel.content = contentModel.content; | ||
| 261 | + additionModel.type = '1'; | ||
| 262 | + | ||
| 263 | + additionModel.image = UploadImgModel(); | ||
| 264 | + additionModel.image.process = 1; | ||
| 265 | + additionModel.image.qiniuUrl = contentModel.content; | ||
| 266 | + data.add(additionModel); | ||
| 267 | + | ||
| 268 | + imgAll.add(contentModel.content); | ||
| 269 | + } else if (contentModel.type == '2') { | ||
| 270 | + //文本 | ||
| 271 | + AdditionModel additionModel = AdditionModel(); | ||
| 272 | + additionModel.content = contentModel.content; | ||
| 273 | + additionModel.infoC.text = contentModel.content; | ||
| 274 | + additionModel.type = contentModel.type; | ||
| 275 | + | ||
| 276 | + data.add(additionModel); | ||
| 277 | + } else { | ||
| 278 | + //视频 | ||
| 279 | + AdditionModel additionModel = AdditionModel(); | ||
| 280 | + String thumbnailPathString = | ||
| 281 | + await VideoUtils.getThumbnailFile(contentModel.content); | ||
| 282 | + File thumbnailPath = File(thumbnailPathString); //封面 | ||
| 283 | + additionModel.content = contentModel.content; | ||
| 284 | + additionModel.type = '3'; | ||
| 92 | 285 | ||
| 93 | - _uploadImageProvider.firstImage.qiniuUrl = | ||
| 94 | - _marketingCenterProvider.markDataModel.chef.image ?? null; | 286 | + additionModel.image = UploadImgModel(); |
| 287 | + additionModel.image.process = 1; | ||
| 288 | + additionModel.image.duration = contentModel.duration; | ||
| 289 | + additionModel.image.thumbnailPath = thumbnailPath; | ||
| 290 | + additionModel.image.qiniuUrl = contentModel.content; | ||
| 291 | + data.add(additionModel); | ||
| 95 | 292 | ||
| 96 | - if (_uploadImageProvider.firstImage.qiniuUrl != null) { | ||
| 97 | - imgAll.add(_uploadImageProvider.firstImage.qiniuUrl); | 293 | + imgAll.add(contentModel.content); |
| 294 | + } | ||
| 295 | + } | ||
| 98 | } | 296 | } |
| 297 | + } | ||
| 99 | 298 | ||
| 100 | - _uploadImageProvider.firstImage.process = | ||
| 101 | - _uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 102 | - _uploadImageProvider.firstImage.qiniuUrl != '' | ||
| 103 | - ? 1 | ||
| 104 | - : null; | ||
| 105 | - | ||
| 106 | - chefNameC.text = _marketingCenterProvider.markDataModel.chef.chefName; | ||
| 107 | - chefIntroduceC.text = | ||
| 108 | - _marketingCenterProvider.markDataModel.chef.introduce; | ||
| 109 | - addChefIntroduce = | ||
| 110 | - _marketingCenterProvider.markDataModel.chef.isIntroduce == '1' | ||
| 111 | - ? true | ||
| 112 | - : false; | ||
| 113 | - addChefImge = _marketingCenterProvider.markDataModel.chef.isImages == '1' | ||
| 114 | - ? true | ||
| 115 | - : false; | ||
| 116 | - addAbove = _marketingCenterProvider.markDataModel.chef.isAbove == '1' | ||
| 117 | - ? true | ||
| 118 | - : false; | 299 | + // addStoreImge = marketingCenterProvider.markDataModel.chef.isImages == '1' |
| 300 | + // ? true | ||
| 301 | + // : false; | ||
| 302 | + // addAbove = marketingCenterProvider.markDataModel.chef.isAbove == '1' | ||
| 303 | + // ? true | ||
| 304 | + // : false; | ||
| 119 | 305 | ||
| 120 | - setState(() {}); | 306 | + setState(() {}); |
| 307 | + } | ||
| 308 | + | ||
| 309 | + ///图文合并,图文分开,无文字 | ||
| 310 | + // Widget _selectBtnWidget() { | ||
| 311 | + // return Container( | ||
| 312 | + // decoration: BoxDecoration( | ||
| 313 | + // border: Border( | ||
| 314 | + // bottom: | ||
| 315 | + // BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 316 | + // margin: EdgeInsets.only(left: w(16)), | ||
| 317 | + // padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 318 | + // child: Row( | ||
| 319 | + // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 320 | + // children: [ | ||
| 321 | + // Text( | ||
| 322 | + // '附加餐厅介绍', | ||
| 323 | + // style: TextStyle( | ||
| 324 | + // color: MyColours.color_515151, | ||
| 325 | + // fontSize: ScreenUtil().setWidth(32)), | ||
| 326 | + // ), | ||
| 327 | + // Container( | ||
| 328 | + // height: ScreenUtil().setWidth(74), | ||
| 329 | + // decoration: BoxDecoration( | ||
| 330 | + // color: Color.fromRGBO(232, 232, 232, 1), | ||
| 331 | + // borderRadius: BorderRadius.circular( | ||
| 332 | + // r(11), | ||
| 333 | + // ), | ||
| 334 | + // // border: Border.all( | ||
| 335 | + // // width: w(1), color: MyColours.color_438E93), | ||
| 336 | + // ), | ||
| 337 | + // child: Row( | ||
| 338 | + // // mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 339 | + // // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 340 | + // children: <Widget>[ | ||
| 341 | + // CommonButtonFlat( | ||
| 342 | + // content: "无文字", | ||
| 343 | + // state: currIndex == 0 ? 1 : 0, | ||
| 344 | + // fontSize: 28, | ||
| 345 | + // right: false, | ||
| 346 | + // width: w(52), | ||
| 347 | + // onPress: () { | ||
| 348 | + // if (currIndex == 0) return; | ||
| 349 | + // setState(() { | ||
| 350 | + // currIndex = 0; | ||
| 351 | + // }); | ||
| 352 | + // }, | ||
| 353 | + // ), | ||
| 354 | + // currIndex == 2 | ||
| 355 | + // ? MyDivider( | ||
| 356 | + // ScreenUtil().setWidth(4), | ||
| 357 | + // ScreenUtil().setWidth(46), | ||
| 358 | + // color: MyColours.color_dfdfdf, | ||
| 359 | + // ) | ||
| 360 | + // : SizedBox(), | ||
| 361 | + // CommonButtonFlat( | ||
| 362 | + // content: "图文合并", | ||
| 363 | + // state: currIndex == 1 ? 1 : 0, | ||
| 364 | + // fontSize: 28, | ||
| 365 | + // width: w(66), | ||
| 366 | + // left: false, | ||
| 367 | + // right: false, | ||
| 368 | + // onPress: () { | ||
| 369 | + // if (currIndex == 1) return; | ||
| 370 | + // setState(() { | ||
| 371 | + // currIndex = 1; | ||
| 372 | + // }); | ||
| 373 | + // }, | ||
| 374 | + // ), | ||
| 375 | + // currIndex == 0 | ||
| 376 | + // ? MyDivider( | ||
| 377 | + // ScreenUtil().setWidth(4), | ||
| 378 | + // ScreenUtil().setWidth(46), | ||
| 379 | + // color: MyColours.color_dfdfdf, | ||
| 380 | + // ) | ||
| 381 | + // : SizedBox(), | ||
| 382 | + // Container( | ||
| 383 | + // child: CommonButtonFlat( | ||
| 384 | + // content: "图文分开", | ||
| 385 | + // left: false, | ||
| 386 | + // state: currIndex == 2 ? 1 : 0, | ||
| 387 | + // fontSize: 28, | ||
| 388 | + // width: w(66), | ||
| 389 | + // onPress: () { | ||
| 390 | + // if (currIndex == 2) return; | ||
| 391 | + // setState(() { | ||
| 392 | + // currIndex = 2; | ||
| 393 | + // }); | ||
| 394 | + // }, | ||
| 395 | + // )), | ||
| 396 | + // ], | ||
| 397 | + // ), | ||
| 398 | + // ), | ||
| 399 | + // ], | ||
| 400 | + // )); | ||
| 401 | + // } | ||
| 402 | + | ||
| 403 | + // Widget _introduceWidget(EdgeInsets edgeInsets, | ||
| 404 | + // {double width = double.infinity, | ||
| 405 | + // Color textColor = MyColours.color_515151, | ||
| 406 | + // Color hintColor = MyColours.color_999999, | ||
| 407 | + // BoxDecoration boxDecoration}) { | ||
| 408 | + // return Container( | ||
| 409 | + // width: width, | ||
| 410 | + // alignment: Alignment.centerLeft, | ||
| 411 | + // padding: edgeInsets, | ||
| 412 | + // decoration: boxDecoration, | ||
| 413 | + // child: Column( | ||
| 414 | + // crossAxisAlignment: CrossAxisAlignment.start, | ||
| 415 | + // children: [ | ||
| 416 | + // Text( | ||
| 417 | + // 'Introduce', | ||
| 418 | + // style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)), | ||
| 419 | + // ), | ||
| 420 | + // Text( | ||
| 421 | + // '品牌介绍', | ||
| 422 | + // style: TextStyle(color: MyColours.color_B39437, fontSize: font(14)), | ||
| 423 | + // ), | ||
| 424 | + // VEmptyView(16), | ||
| 425 | + // Text( | ||
| 426 | + // '${sellername}', | ||
| 427 | + // style: TextStyle(color: textColor, fontSize: font(14)), | ||
| 428 | + // ), | ||
| 429 | + // VEmptyView(32), | ||
| 430 | + // Container( | ||
| 431 | + // width: double.infinity, | ||
| 432 | + // // margin: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 433 | + // // padding: EdgeInsets.symmetric(horizontal: w(6)), | ||
| 434 | + // decoration: BoxDecoration( | ||
| 435 | + // border: Border( | ||
| 436 | + // left: BorderSide( | ||
| 437 | + // width: w(2), color: MyColours.color_EEAE74))), | ||
| 438 | + // child: Container( | ||
| 439 | + // width: double.infinity, | ||
| 440 | + // padding: EdgeInsets.symmetric( | ||
| 441 | + // horizontal: ScreenUtil().setWidth(12), | ||
| 442 | + // ), | ||
| 443 | + // alignment: Alignment.topLeft, | ||
| 444 | + // child: TextField( | ||
| 445 | + // textAlign: TextAlign.left, | ||
| 446 | + // controller: storeIntroduceC, | ||
| 447 | + // focusNode: storeIntroduceNode, | ||
| 448 | + // style: TextStyle( | ||
| 449 | + // height: 2, | ||
| 450 | + // color: textColor, | ||
| 451 | + // fontSize: ScreenUtil().setSp(20), | ||
| 452 | + // textBaseline: TextBaseline.alphabetic), | ||
| 453 | + // textAlignVertical: TextAlignVertical.center, | ||
| 454 | + // maxLines: 7, | ||
| 455 | + // decoration: InputDecoration( | ||
| 456 | + // hintText: "点这里录入餐厅介绍文字", | ||
| 457 | + // hintStyle: TextStyle( | ||
| 458 | + // color: hintColor, | ||
| 459 | + // fontSize: ScreenUtil().setSp(20), | ||
| 460 | + // ), | ||
| 461 | + // contentPadding: EdgeInsets.zero, | ||
| 462 | + // border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 463 | + // ), | ||
| 464 | + // keyboardType: TextInputType.multiline, | ||
| 465 | + // textInputAction: TextInputAction.newline, | ||
| 466 | + // onChanged: (value) { | ||
| 467 | + // setState(() { | ||
| 468 | + // // currentRemark = value ?? ""; | ||
| 469 | + // }); | ||
| 470 | + // }), | ||
| 471 | + // )), | ||
| 472 | + // ], | ||
| 473 | + // ), | ||
| 474 | + // ); | ||
| 475 | + // } | ||
| 476 | + | ||
| 477 | + // ///无文字 | ||
| 478 | + // Widget _noTextWidget() { | ||
| 479 | + // return Column( | ||
| 480 | + // children: [ | ||
| 481 | + // ImgPickerInvitationWidget( | ||
| 482 | + // scrollController: controller, | ||
| 483 | + // uploadType: UploadType.InvitationStoreType, | ||
| 484 | + // model: _uploadImageProvider, | ||
| 485 | + // index: 5, | ||
| 486 | + // imageModel: _uploadImageProvider.chefImage1, | ||
| 487 | + // deleteCallback: () { | ||
| 488 | + // _uploadImageProvider.chefImage1.qiniuUrl = null; | ||
| 489 | + // _uploadImageProvider.chefImage1.file = null; | ||
| 490 | + // _uploadImageProvider.chefImage1.isUpload = false; | ||
| 491 | + // _uploadImageProvider.chefImage1.process = 0; | ||
| 492 | + // setState(() {}); | ||
| 493 | + // }), | ||
| 494 | + // VEmptyView(18), | ||
| 495 | + // ImgPickerInvitationWidget( | ||
| 496 | + // scrollController: controller, | ||
| 497 | + // uploadType: UploadType.InvitationStoreType, | ||
| 498 | + // model: _uploadImageProvider, | ||
| 499 | + // index: 6, | ||
| 500 | + // imageModel: _uploadImageProvider.chefImage2, | ||
| 501 | + // deleteCallback: () { | ||
| 502 | + // _uploadImageProvider.chefImage2.qiniuUrl = null; | ||
| 503 | + // _uploadImageProvider.chefImage2.file = null; | ||
| 504 | + // _uploadImageProvider.chefImage2.isUpload = false; | ||
| 505 | + // _uploadImageProvider.chefImage2.process = 0; | ||
| 506 | + // setState(() {}); | ||
| 507 | + // }), | ||
| 508 | + // VEmptyView(18), | ||
| 509 | + // ImgPickerInvitationWidget( | ||
| 510 | + // scrollController: controller, | ||
| 511 | + // uploadType: UploadType.InvitationStoreType, | ||
| 512 | + // model: _uploadImageProvider, | ||
| 513 | + // index: 7, | ||
| 514 | + // imageModel: _uploadImageProvider.chefImage3, | ||
| 515 | + // deleteCallback: () { | ||
| 516 | + // _uploadImageProvider.chefImage3.qiniuUrl = null; | ||
| 517 | + // _uploadImageProvider.chefImage3.file = null; | ||
| 518 | + // _uploadImageProvider.chefImage3.isUpload = false; | ||
| 519 | + // _uploadImageProvider.chefImage3.process = 0; | ||
| 520 | + // setState(() {}); | ||
| 521 | + // }), | ||
| 522 | + // VEmptyView(18), | ||
| 523 | + // ImgPickerInvitationWidget( | ||
| 524 | + // scrollController: controller, | ||
| 525 | + // model: _uploadImageProvider, | ||
| 526 | + // index: 8, | ||
| 527 | + // uploadType: UploadType.InvitationStoreType, | ||
| 528 | + // imageModel: _uploadImageProvider.chefImage4, | ||
| 529 | + // deleteCallback: () { | ||
| 530 | + // _uploadImageProvider.chefImage4.qiniuUrl = null; | ||
| 531 | + // _uploadImageProvider.chefImage4.file = null; | ||
| 532 | + // _uploadImageProvider.chefImage4.isUpload = false; | ||
| 533 | + // _uploadImageProvider.chefImage4.process = 0; | ||
| 534 | + // setState(() {}); | ||
| 535 | + // }), | ||
| 536 | + // ], | ||
| 537 | + // ); | ||
| 538 | + // } | ||
| 539 | + | ||
| 540 | + ///图文合并 | ||
| 541 | + // Widget _mergingWidget() { | ||
| 542 | + // Color themColor = MyColours.color_0C0F0E; | ||
| 543 | + // int colorValue = null; | ||
| 544 | + // if (marketingCenterProvider.markDataModel.home != null && | ||
| 545 | + // marketingCenterProvider.markDataModel.home.themeColor != null) { | ||
| 546 | + // colorValue = | ||
| 547 | + // int.parse(marketingCenterProvider.markDataModel.home.themeColor); | ||
| 548 | + // } | ||
| 549 | + | ||
| 550 | + // if (colorValue != null) { | ||
| 551 | + // themColor = Color(colorValue); | ||
| 552 | + // } | ||
| 553 | + // return Column( | ||
| 554 | + // children: [ | ||
| 555 | + // Stack( | ||
| 556 | + // children: [ | ||
| 557 | + // ImgPickerInvitationWidget( | ||
| 558 | + // scrollController: controller, | ||
| 559 | + // uploadType: UploadType.InvitationStoreType, | ||
| 560 | + // model: _uploadImageProvider, | ||
| 561 | + // index: 5, | ||
| 562 | + // padding: EdgeInsets.only(left: w(160)), | ||
| 563 | + // imageModel: _uploadImageProvider.chefImage1), | ||
| 564 | + // Positioned( | ||
| 565 | + // child: _introduceWidget( | ||
| 566 | + // EdgeInsets.only( | ||
| 567 | + // left: w(15), top: w(23), right: w(7), bottom: w(42)), | ||
| 568 | + // textColor: MyColours.color_ffffff, | ||
| 569 | + // hintColor: MyColours.color_ffffff, | ||
| 570 | + // boxDecoration: BoxDecoration( | ||
| 571 | + // gradient: LinearGradient( | ||
| 572 | + // stops: [0, 1], | ||
| 573 | + // begin: Alignment.topCenter, | ||
| 574 | + // end: Alignment.bottomCenter, | ||
| 575 | + // colors: [ | ||
| 576 | + // themColor, | ||
| 577 | + // MyColours.color_4D0C0F0E, | ||
| 578 | + // ], | ||
| 579 | + // ), | ||
| 580 | + // )), | ||
| 581 | + // width: w(160), | ||
| 582 | + // ), | ||
| 583 | + // ], | ||
| 584 | + // ), | ||
| 585 | + // VEmptyView(18), | ||
| 586 | + // ImgPickerInvitationWidget( | ||
| 587 | + // scrollController: controller, | ||
| 588 | + // uploadType: UploadType.InvitationStoreType, | ||
| 589 | + // model: _uploadImageProvider, | ||
| 590 | + // index: 6, | ||
| 591 | + // imageModel: _uploadImageProvider.chefImage2), | ||
| 592 | + // VEmptyView(18), | ||
| 593 | + // ImgPickerInvitationWidget( | ||
| 594 | + // scrollController: controller, | ||
| 595 | + // uploadType: UploadType.InvitationStoreType, | ||
| 596 | + // model: _uploadImageProvider, | ||
| 597 | + // index: 7, | ||
| 598 | + // imageModel: _uploadImageProvider.chefImage3), | ||
| 599 | + // VEmptyView(18), | ||
| 600 | + // ImgPickerInvitationWidget( | ||
| 601 | + // scrollController: controller, | ||
| 602 | + // uploadType: UploadType.InvitationStoreType, | ||
| 603 | + // model: _uploadImageProvider, | ||
| 604 | + // index: 8, | ||
| 605 | + // imageModel: _uploadImageProvider.chefImage4), | ||
| 606 | + // ], | ||
| 607 | + // ); | ||
| 608 | + // } | ||
| 609 | +/** | ||
| 610 | + ///图文分开 | ||
| 611 | + Widget _separateWidget() { | ||
| 612 | + return ReorderableListView( | ||
| 613 | + shrinkWrap: true, | ||
| 614 | + scrollController: controller, | ||
| 615 | + children: <Widget>[ | ||
| 616 | + // _introduceWidget(EdgeInsets.all(w(15)), | ||
| 617 | + // boxDecoration: BoxDecoration(color: MyColours.color_ffffff)), | ||
| 618 | + // VEmptyView(18), | ||
| 619 | + | ||
| 620 | + for (ChangeModel item in data) | ||
| 621 | + Container( | ||
| 622 | + key: ValueKey(item), | ||
| 623 | + child: Padding( | ||
| 624 | + padding: | ||
| 625 | + EdgeInsets.only(bottom: item.index != 8 ? w(9) : 0), | ||
| 626 | + child: ImgPickerInvitationWidget( | ||
| 627 | + scrollController: controller, | ||
| 628 | + uploadType: UploadType.InvitationStoreType, | ||
| 629 | + model: _uploadImageProvider, | ||
| 630 | + index: item.index, | ||
| 631 | + imageModel: item.image, | ||
| 632 | + callback: () { | ||
| 633 | + //完成 | ||
| 634 | + if (item.index == 5) { | ||
| 635 | + imgAll | ||
| 636 | + .add(_uploadImageProvider.chefImage1.qiniuUrl); | ||
| 637 | + } else if (item.index == 6) { | ||
| 638 | + imgAll | ||
| 639 | + .add(_uploadImageProvider.chefImage2.qiniuUrl); | ||
| 640 | + } else if (item.index == 7) { | ||
| 641 | + imgAll | ||
| 642 | + .add(_uploadImageProvider.chefImage3.qiniuUrl); | ||
| 643 | + } else if (item.index == 8) { | ||
| 644 | + imgAll | ||
| 645 | + .add(_uploadImageProvider.chefImage4.qiniuUrl); | ||
| 646 | + } | ||
| 647 | + }, | ||
| 648 | + deleteCallback: () { | ||
| 649 | + item.image.qiniuUrl = null; | ||
| 650 | + item.image.file = null; | ||
| 651 | + item.image.isUpload = false; | ||
| 652 | + item.image.process = 0.01; | ||
| 653 | + setState(() {}); | ||
| 654 | + }))), | ||
| 655 | + | ||
| 656 | + // ImgPickerInvitationWidget( | ||
| 657 | + // scrollController: controller, | ||
| 658 | + // uploadType: UploadType.InvitationStoreType, | ||
| 659 | + // model: _uploadImageProvider, | ||
| 660 | + // index: 6, | ||
| 661 | + // imageModel: _uploadImageProvider.chefImage2, | ||
| 662 | + // deleteCallback: () { | ||
| 663 | + // _uploadImageProvider.chefImage2.qiniuUrl = null; | ||
| 664 | + // _uploadImageProvider.chefImage2.file = null; | ||
| 665 | + // _uploadImageProvider.chefImage2.isUpload = false; | ||
| 666 | + // _uploadImageProvider.chefImage2.process = 0.01; | ||
| 667 | + // setState(() {}); | ||
| 668 | + // }), | ||
| 669 | + // VEmptyView(18), | ||
| 670 | + // ImgPickerInvitationWidget( | ||
| 671 | + // scrollController: controller, | ||
| 672 | + // uploadType: UploadType.InvitationStoreType, | ||
| 673 | + // model: _uploadImageProvider, | ||
| 674 | + // index: 7, | ||
| 675 | + // imageModel: _uploadImageProvider.chefImage3, | ||
| 676 | + // deleteCallback: () { | ||
| 677 | + // _uploadImageProvider.chefImage3.qiniuUrl = null; | ||
| 678 | + // _uploadImageProvider.chefImage3.file = null; | ||
| 679 | + // _uploadImageProvider.chefImage3.isUpload = false; | ||
| 680 | + // _uploadImageProvider.chefImage3.process = 0.01; | ||
| 681 | + // setState(() {}); | ||
| 682 | + // }), | ||
| 683 | + // VEmptyView(18), | ||
| 684 | + // ImgPickerInvitationWidget( | ||
| 685 | + // scrollController: controller, | ||
| 686 | + // uploadType: UploadType.InvitationStoreType, | ||
| 687 | + // model: _uploadImageProvider, | ||
| 688 | + // index: 8, | ||
| 689 | + // imageModel: _uploadImageProvider.chefImage4, | ||
| 690 | + // deleteCallback: () { | ||
| 691 | + // _uploadImageProvider.chefImage4.qiniuUrl = null; | ||
| 692 | + // _uploadImageProvider.chefImage4.file = null; | ||
| 693 | + // _uploadImageProvider.chefImage4.isUpload = false; | ||
| 694 | + // _uploadImageProvider.chefImage4.process = 0.01; | ||
| 695 | + // setState(() {}); | ||
| 696 | + // }), | ||
| 697 | + ], | ||
| 698 | + onReorder: (int oldIndex, int newIndex) async { | ||
| 699 | + if (oldIndex < newIndex) { | ||
| 700 | + newIndex -= 1; | ||
| 701 | + } | ||
| 702 | + | ||
| 703 | + // var childold = tableManagerModel.areas[oldIndex]; | ||
| 704 | + // Map<String, String> params = { | ||
| 705 | + // 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 706 | + // .user | ||
| 707 | + // .sellerid, | ||
| 708 | + // 'regionid': childold.rid, | ||
| 709 | + // 'order_o': tableManagerModel.areas[newIndex].orderId, | ||
| 710 | + // 'sort': oldIndex < newIndex ? '2' : '1' | ||
| 711 | + // }; | ||
| 712 | + var child = data.removeAt(oldIndex); | ||
| 713 | + data.insert(newIndex, child); | ||
| 714 | + setState(() {}); | ||
| 715 | + // await tableManagerModel.sortByRegion(context, params); | ||
| 716 | + // //刷新前一页数据 | ||
| 717 | + // bus.emit('refresh_table_area'); | ||
| 718 | + }); | ||
| 719 | + } | ||
| 720 | + */ | ||
| 721 | + | ||
| 722 | + ///输入框 | ||
| 723 | + Widget _textfield(String title, String hintText, | ||
| 724 | + TextEditingController controller, FocusNode focusNode, | ||
| 725 | + {TextInputType textInputType = TextInputType.text}) { | ||
| 726 | + return Container( | ||
| 727 | + decoration: BoxDecoration( | ||
| 728 | + border: Border( | ||
| 729 | + bottom: | ||
| 730 | + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 731 | + margin: EdgeInsets.only(left: w(16)), | ||
| 732 | + padding: EdgeInsets.only(top: w(12), bottom: w(4), right: w(16)), | ||
| 733 | + child: Row( | ||
| 734 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 735 | + children: [ | ||
| 736 | + Container( | ||
| 737 | + height: w(48), | ||
| 738 | + alignment: Alignment.center, | ||
| 739 | + child: Text( | ||
| 740 | + title, | ||
| 741 | + style: TextStyle( | ||
| 742 | + color: MyColours.color_515151, | ||
| 743 | + fontSize: ScreenUtil().setSp(32)), | ||
| 744 | + ), | ||
| 745 | + ), | ||
| 746 | + HEmptyView(80), | ||
| 747 | + Expanded( | ||
| 748 | + // width: ScreenUtil().setWidth(231 * 2), | ||
| 749 | + child: Container( | ||
| 750 | + // height: w(54), | ||
| 751 | + child: TextField( | ||
| 752 | + controller: controller, | ||
| 753 | + textAlign: TextAlign.right, | ||
| 754 | + textAlignVertical: TextAlignVertical.bottom, | ||
| 755 | + maxLines: 1, | ||
| 756 | + // //光标颜色 | ||
| 757 | + // cursorColor: | ||
| 758 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 759 | + //输入文本的样式 | ||
| 760 | + inputFormatters: title == '标题名称' | ||
| 761 | + ? [LengthLimitingTextInputFormatter(15)] | ||
| 762 | + : [], | ||
| 763 | + style: TextStyle( | ||
| 764 | + color: MyColours.color_515151, | ||
| 765 | + fontSize: ScreenUtil().setSp(32), | ||
| 766 | + ), | ||
| 767 | + focusNode: focusNode, | ||
| 768 | + decoration: InputDecoration( | ||
| 769 | + isCollapsed: true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 770 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 771 | + hintText: hintText, | ||
| 772 | + hintStyle: TextStyle( | ||
| 773 | + color: MyColours.color_999999, | ||
| 774 | + fontSize: ScreenUtil().setSp(32), | ||
| 775 | + ), | ||
| 776 | + enabledBorder: new UnderlineInputBorder( | ||
| 777 | + borderSide: BorderSide.none, | ||
| 778 | + ), | ||
| 779 | + focusedBorder: new UnderlineInputBorder( | ||
| 780 | + borderSide: BorderSide.none, | ||
| 781 | + ), | ||
| 782 | + ), | ||
| 783 | + onChanged: (value) {}, | ||
| 784 | + onEditingComplete: () { | ||
| 785 | + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 786 | + }, | ||
| 787 | + keyboardType: textInputType), | ||
| 788 | + )), | ||
| 789 | + // HEmptyView(32) | ||
| 790 | + ], | ||
| 791 | + ), | ||
| 792 | + ); | ||
| 793 | + } | ||
| 794 | + | ||
| 795 | + Widget _item(String title, {bool select, GestureTapCallback onTap}) { | ||
| 796 | + return InkWell( | ||
| 797 | + onTap: onTap, | ||
| 798 | + child: Container( | ||
| 799 | + decoration: BoxDecoration( | ||
| 800 | + border: Border( | ||
| 801 | + bottom: BorderSide( | ||
| 802 | + color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 803 | + margin: EdgeInsets.only(left: w(16)), | ||
| 804 | + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 805 | + child: Row( | ||
| 806 | + children: [ | ||
| 807 | + Text( | ||
| 808 | + title, | ||
| 809 | + style: TextStyle( | ||
| 810 | + color: MyColours.color_515151, | ||
| 811 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 812 | + ), | ||
| 813 | + Spacer(), | ||
| 814 | + Container( | ||
| 815 | + padding: | ||
| 816 | + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 817 | + child: Image.asset( | ||
| 818 | + Utils.getImgPath(select ? 'swich_on' : 'swich_off'), | ||
| 819 | + width: w(44), | ||
| 820 | + ), | ||
| 821 | + ) | ||
| 822 | + ], | ||
| 823 | + ))); | ||
| 824 | + } | ||
| 825 | + | ||
| 826 | + /// 修改店铺基本信息 | ||
| 827 | + // _setSellerInfoById(String text) async { | ||
| 828 | + // Map<String, dynamic> params = { | ||
| 829 | + // 'id': Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 830 | + // }; | ||
| 831 | + | ||
| 832 | + // params['sellerdesc'] = text; | ||
| 833 | + | ||
| 834 | + // FormData formData = FormData.fromMap(params); | ||
| 835 | + | ||
| 836 | + // SetSellerInfoSunModel sunModel = | ||
| 837 | + // await _baseIndoProvider.setSellerInfoById(context, formData); | ||
| 838 | + // if (sunModel != null) { | ||
| 839 | + // //修改成功 | ||
| 840 | + // // Utils.showToast('保存店铺信息成功'); | ||
| 841 | + // // EventBus().emit('changeStatusColor'); | ||
| 842 | + | ||
| 843 | + // } else { | ||
| 844 | + // // Utils.showToast('保存失败'); | ||
| 845 | + // } | ||
| 846 | + // } | ||
| 847 | + | ||
| 848 | + List<Widget> _scrolleWidget() { | ||
| 849 | + List<Widget> temp = []; | ||
| 850 | + for (AdditionModel item in data) { | ||
| 851 | + if (item.type == '1') { | ||
| 852 | + //图片 | ||
| 853 | + if (item.image.qiniuUrl == null && item.image.file == null) { | ||
| 854 | + } else { | ||
| 855 | + temp.add(Container( | ||
| 856 | + key: ValueKey(item), | ||
| 857 | + margin: EdgeInsets.only(bottom: w(12)), | ||
| 858 | + child: InkWell( | ||
| 859 | + onTap: () { | ||
| 860 | + // double process; | ||
| 861 | + // String qiniuUrl; | ||
| 862 | + // List<String> tempList = []; | ||
| 863 | + // // if (title == '头像') { | ||
| 864 | + // process = item.image.process; | ||
| 865 | + // qiniuUrl = item.image.qiniuUrl; | ||
| 866 | + // // } else { | ||
| 867 | + // // process = _uploadImageProvider.erweima.process; | ||
| 868 | + // // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 869 | + // // } | ||
| 870 | + | ||
| 871 | + // if (qiniuUrl != null && | ||
| 872 | + // qiniuUrl != '') { | ||
| 873 | + // // tempList.add(qiniuUrl); | ||
| 874 | + | ||
| 875 | + // // ///没有上传完成的不可以点击 | ||
| 876 | + // // _showPhotoView(context, 0, tempList); | ||
| 877 | + | ||
| 878 | + // // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 879 | + // // _uploadImageProvider.firstImage.process = 0; | ||
| 880 | + // // setState(() {}); | ||
| 881 | + // _openModalBottomSheet(context); | ||
| 882 | + // // Utils.getPickPermission(context, () { | ||
| 883 | + // // _getFromPictureOrCamera( | ||
| 884 | + // // _uploadImageProvider.firstImage, | ||
| 885 | + // // ImageSource.gallery); | ||
| 886 | + // // }, | ||
| 887 | + // // Platform.isAndroid | ||
| 888 | + // // ? Permission.storage | ||
| 889 | + // // : Permission.photos); | ||
| 890 | + // } | ||
| 891 | + }, | ||
| 892 | + child: Stack(alignment: Alignment.bottomCenter, children: [ | ||
| 893 | + Stack(clipBehavior: Clip.none, children: [ | ||
| 894 | + item.image.qiniuUrl != null && item.image.qiniuUrl != '' | ||
| 895 | + ? Image.network( | ||
| 896 | + item.image.qiniuUrl, | ||
| 897 | + fit: BoxFit.contain, | ||
| 898 | + width: double.infinity, | ||
| 899 | + // width: ScreenUtil() | ||
| 900 | + // .setWidth(imgSize * 2), | ||
| 901 | + // height: ScreenUtil().setWidth( | ||
| 902 | + // _uploadImageProvider | ||
| 903 | + // .imgSizefirstImage * | ||
| 904 | + // 2), | ||
| 905 | + ) | ||
| 906 | + : Image.file( | ||
| 907 | + item.image.file, | ||
| 908 | + fit: BoxFit.contain, | ||
| 909 | + width: double.infinity, | ||
| 910 | + // width: ScreenUtil() | ||
| 911 | + // .setWidth(imgSize * 2), | ||
| 912 | + // height: ScreenUtil().setWidth( | ||
| 913 | + // _uploadImageProvider | ||
| 914 | + // .imgSizefirstImage * | ||
| 915 | + // 2), | ||
| 916 | + ), | ||
| 917 | + Positioned( | ||
| 918 | + left: 0, | ||
| 919 | + top: 0, | ||
| 920 | + child: (item.image.file != null) && | ||
| 921 | + item.image.process != 1 && | ||
| 922 | + item.image.process != 0.01 | ||
| 923 | + ? Container( | ||
| 924 | + width: ScreenUtil().screenWidth, | ||
| 925 | + height: | ||
| 926 | + w(_uploadImageProvider.imgSizefirstImage), | ||
| 927 | + color: MyColours.color_4D000000, | ||
| 928 | + child: Center( | ||
| 929 | + child: Text('上传中', | ||
| 930 | + style: TextStyle( | ||
| 931 | + color: MyColours.color_F8F9FD)), | ||
| 932 | + ), | ||
| 933 | + ) | ||
| 934 | + : Container()), | ||
| 935 | + ]), | ||
| 936 | + // item.image.process == 1 | ||
| 937 | + // ? Container( | ||
| 938 | + // width: w(150), | ||
| 939 | + // height: w(30), | ||
| 940 | + // color: MyColours.color_4D000000, | ||
| 941 | + // alignment: Alignment.center, | ||
| 942 | + // child: Text( | ||
| 943 | + // '点击图片可以更换', | ||
| 944 | + // style: TextStyle( | ||
| 945 | + // color: MyColours | ||
| 946 | + // .color_F8F9FD, | ||
| 947 | + // fontSize: font(14), | ||
| 948 | + // fontWeight: | ||
| 949 | + // FontWeight.bold), | ||
| 950 | + // )) | ||
| 951 | + // : SizedBox(), | ||
| 952 | + item.image.process == 1 | ||
| 953 | + ? Positioned( | ||
| 954 | + top: 0, | ||
| 955 | + right: 0, | ||
| 956 | + child: InkWell( | ||
| 957 | + onTap: () { | ||
| 958 | + data.remove(item); | ||
| 959 | + setState(() {}); | ||
| 960 | + }, | ||
| 961 | + child: Container( | ||
| 962 | + width: w(20), | ||
| 963 | + height: w(20), | ||
| 964 | + color: Colors.transparent, | ||
| 965 | + alignment: Alignment.center, | ||
| 966 | + child: Image.asset( | ||
| 967 | + Utils.getImgPath('delete'))))) | ||
| 968 | + : SizedBox(), | ||
| 969 | + ])))); | ||
| 970 | + } | ||
| 971 | + } else if (item.type == '2') { | ||
| 972 | + //文本 | ||
| 973 | + temp.add(Container( | ||
| 974 | + key: ValueKey(item), | ||
| 975 | + decoration: BoxDecoration( | ||
| 976 | + border: Border.all(width: w(1), color: MyColours.color_DBDBDB)), | ||
| 977 | + // child: Text(item.content), | ||
| 978 | + | ||
| 979 | + // color: Colors.red, | ||
| 980 | + child: Stack( | ||
| 981 | + children: [ | ||
| 982 | + Container( | ||
| 983 | + // height: w(152), | ||
| 984 | + decoration: BoxDecoration( | ||
| 985 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 986 | + border: Border.all( | ||
| 987 | + width: w(1), color: MyColours.color_DBDBDB)), | ||
| 988 | + margin: EdgeInsets.only( | ||
| 989 | + left: w(10), top: w(10), bottom: w(10), right: w(60)), | ||
| 990 | + padding: EdgeInsets.only( | ||
| 991 | + top: w(16), bottom: w(16), left: w(14), right: w(10)), | ||
| 992 | + child: TextField( | ||
| 993 | + controller: item.infoC, | ||
| 994 | + // textAlign: TextAlign.right, | ||
| 995 | + // focusNode: _cusdemNode, | ||
| 996 | + style: TextStyle( | ||
| 997 | + color: MyColours.color_515151, | ||
| 998 | + fontSize: ScreenUtil().setSp(28), | ||
| 999 | + // textBaseline: TextBaseline.alphabetic | ||
| 1000 | + ), | ||
| 1001 | + // textAlignVertical: TextAlignVertical.center, | ||
| 1002 | + maxLines: 5, | ||
| 1003 | + maxLength: 200, | ||
| 1004 | + // inputFormatters: [ | ||
| 1005 | + // LengthLimitingTextInputFormatter(10), // 设置输入长度限制 | ||
| 1006 | + // ], | ||
| 1007 | + decoration: InputDecoration( | ||
| 1008 | + hintText: "点击录入文字", | ||
| 1009 | + hintStyle: TextStyle( | ||
| 1010 | + color: MyColours.color_999999, | ||
| 1011 | + fontSize: ScreenUtil().setSp(28), | ||
| 1012 | + ), | ||
| 1013 | + contentPadding: EdgeInsets.zero, | ||
| 1014 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 1015 | + ), | ||
| 1016 | + keyboardType: TextInputType.multiline, | ||
| 1017 | + onChanged: (value) { | ||
| 1018 | + item.content = value; | ||
| 1019 | + })), | ||
| 1020 | + Positioned( | ||
| 1021 | + top: w(10), | ||
| 1022 | + right: w(10), | ||
| 1023 | + child: InkWell( | ||
| 1024 | + onTap: () { | ||
| 1025 | + data.remove(item); | ||
| 1026 | + setState(() {}); | ||
| 1027 | + }, | ||
| 1028 | + child: Container( | ||
| 1029 | + width: w(20), | ||
| 1030 | + height: w(20), | ||
| 1031 | + color: Colors.transparent, | ||
| 1032 | + alignment: Alignment.center, | ||
| 1033 | + child: Image.asset(Utils.getImgPath('delete'))))) | ||
| 1034 | + ], | ||
| 1035 | + ), | ||
| 1036 | + )); | ||
| 1037 | + } else { | ||
| 1038 | + //视频 | ||
| 1039 | + if (item.image.qiniuUrl == null && item.image.file == null) { | ||
| 1040 | + } else { | ||
| 1041 | + temp.add(Container( | ||
| 1042 | + key: ValueKey(item), | ||
| 1043 | + margin: EdgeInsets.only(bottom: w(12)), | ||
| 1044 | + child: InkWell( | ||
| 1045 | + onTap: () { | ||
| 1046 | + if (item.image.process == 1) { | ||
| 1047 | + NavigatorUtil.goPlayVideoPage(context, | ||
| 1048 | + urlStr: item.image.qiniuUrl); | ||
| 1049 | + } | ||
| 1050 | + }, | ||
| 1051 | + child: Stack(alignment: Alignment.bottomRight, children: [ | ||
| 1052 | + Stack( | ||
| 1053 | + alignment: Alignment.center, | ||
| 1054 | + children: [ | ||
| 1055 | + Stack( | ||
| 1056 | + alignment: Alignment.topRight, | ||
| 1057 | + children: [ | ||
| 1058 | + Image.file( | ||
| 1059 | + item.image.thumbnailPath, | ||
| 1060 | + fit: BoxFit.contain, | ||
| 1061 | + width: double.infinity, | ||
| 1062 | + ) | ||
| 1063 | + // : FutureBuilder( | ||
| 1064 | + // //显示缩略图 | ||
| 1065 | + // future: _initializeVideoPlayerFuture, | ||
| 1066 | + // builder: (context, snapshot) { | ||
| 1067 | + // print(snapshot.connectionState); | ||
| 1068 | + // if (snapshot.hasError) | ||
| 1069 | + // print(snapshot.error); | ||
| 1070 | + // if (snapshot.connectionState == | ||
| 1071 | + // ConnectionState.done) { | ||
| 1072 | + // return Container( | ||
| 1073 | + // // width: ScreenUtil().setWidth(225), | ||
| 1074 | + // child: AspectRatio( | ||
| 1075 | + // aspectRatio: 1 / 1, | ||
| 1076 | + | ||
| 1077 | + // // aspectRatio: _controller.value.aspectRatio, | ||
| 1078 | + // child: VideoPlayer(_controller), | ||
| 1079 | + // ), | ||
| 1080 | + // ); | ||
| 1081 | + // } else { | ||
| 1082 | + // return Center( | ||
| 1083 | + // child: CircularProgressIndicator(), | ||
| 1084 | + // ); | ||
| 1085 | + // } | ||
| 1086 | + // }, | ||
| 1087 | + // ), | ||
| 1088 | + , | ||
| 1089 | + Offstage( | ||
| 1090 | + offstage: item.image.process < 1, | ||
| 1091 | + child: GestureDetector( | ||
| 1092 | + child: Image.asset( | ||
| 1093 | + Utils.getImgPath("delete"), | ||
| 1094 | + width: ScreenUtil().setWidth(40), | ||
| 1095 | + height: ScreenUtil().setWidth(40), | ||
| 1096 | + ), | ||
| 1097 | + onTap: () { | ||
| 1098 | + //点击删除按钮 | ||
| 1099 | + data.remove(item); | ||
| 1100 | + setState(() {}); | ||
| 1101 | + // setState(() { | ||
| 1102 | + // widget.model.imageListDenvironment | ||
| 1103 | + // .removeWhere((element) => | ||
| 1104 | + // element == | ||
| 1105 | + // widget.model | ||
| 1106 | + // .imageListDenvironment[ | ||
| 1107 | + // index]); | ||
| 1108 | + // widget.model.imageQiniuUrlList | ||
| 1109 | + // .removeWhere((element) => | ||
| 1110 | + // element == | ||
| 1111 | + // widget.model | ||
| 1112 | + // .imageQiniuUrlList[index]); | ||
| 1113 | + // }); | ||
| 1114 | + }, | ||
| 1115 | + ), | ||
| 1116 | + ), | ||
| 1117 | + ], | ||
| 1118 | + ), | ||
| 1119 | + // Offstage( | ||
| 1120 | + // offstage: widget.model.imageListDenvironment[index].process == 1, | ||
| 1121 | + // child: Progress(widget.model.imageListDenvironment[index].process), | ||
| 1122 | + // ), | ||
| 1123 | + | ||
| 1124 | + showCompress | ||
| 1125 | + ? Container( | ||
| 1126 | + width: ScreenUtil().setWidth(90.0 * 2), | ||
| 1127 | + height: ScreenUtil().setWidth(90.0 * 2), | ||
| 1128 | + decoration: BoxDecoration( | ||
| 1129 | + color: Color.fromRGBO(0, 0, 0, 0.5), | ||
| 1130 | + borderRadius: BorderRadius.circular(r(5))), | ||
| 1131 | + child: Center( | ||
| 1132 | + child: Text('压缩中...', | ||
| 1133 | + style: TextStyle( | ||
| 1134 | + fontSize: ScreenUtil().setSp(24), | ||
| 1135 | + color: MyColours.color_fefefe)), | ||
| 1136 | + )) | ||
| 1137 | + : item.image.process == 1 | ||
| 1138 | + ? Align( | ||
| 1139 | + alignment: Alignment.center, | ||
| 1140 | + child: Image.asset( | ||
| 1141 | + Utils.getImgPath('play'), | ||
| 1142 | + width: ScreenUtil().setWidth(60), | ||
| 1143 | + )) | ||
| 1144 | + : Progress( | ||
| 1145 | + item.image.process, | ||
| 1146 | + size: 90.0, | ||
| 1147 | + ), | ||
| 1148 | + ], | ||
| 1149 | + ), | ||
| 1150 | + Align( | ||
| 1151 | + alignment: Alignment.bottomRight, | ||
| 1152 | + child: Padding( | ||
| 1153 | + padding: EdgeInsets.only( | ||
| 1154 | + bottom: ScreenUtil().setWidth(10), | ||
| 1155 | + right: ScreenUtil().setWidth(10)), | ||
| 1156 | + child: Text( | ||
| 1157 | + item.image.duration, | ||
| 1158 | + style: TextStyle( | ||
| 1159 | + color: MyColours.color_fefefe, | ||
| 1160 | + fontSize: ScreenUtil().setSp(24)), | ||
| 1161 | + )), | ||
| 1162 | + ) | ||
| 1163 | + ])))); | ||
| 1164 | + } | ||
| 1165 | + } | ||
| 121 | } | 1166 | } |
| 1167 | + return temp; | ||
| 122 | } | 1168 | } |
| 123 | 1169 | ||
| 124 | ///#相机拍照,单图选择 | 1170 | ///#相机拍照,单图选择 |
| 125 | - Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { | 1171 | + Future _getFromPictureOrCamera(int index, imageSource) async { |
| 126 | final pickedFile = await picker.pickImage(source: imageSource); | 1172 | final pickedFile = await picker.pickImage(source: imageSource); |
| 127 | if (pickedFile != null) { | 1173 | if (pickedFile != null) { |
| 1174 | + UploadImgModel uploadImgModel = UploadImgModel(); //图 | ||
| 1175 | + _uploadImageProvider.setDynamicValue('${data.length}', uploadImgModel); | ||
| 1176 | + | ||
| 1177 | + AdditionModel additionModel = AdditionModel(); | ||
| 1178 | + // additionModel.content = imgModel.qiniuUrl; | ||
| 1179 | + additionModel.type = '1'; | ||
| 1180 | + // additionModel.order = data.length; | ||
| 1181 | + additionModel.image = uploadImgModel; | ||
| 1182 | + // additionModel.image.process = 1; | ||
| 1183 | + // additionModel.image.qiniuUrl = | ||
| 1184 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 1185 | + | ||
| 1186 | + data.add(additionModel); | ||
| 128 | File compressedFile = await FlutterNativeImage.compressImage( | 1187 | File compressedFile = await FlutterNativeImage.compressImage( |
| 129 | pickedFile.path, | 1188 | pickedFile.path, |
| 130 | quality: 50, | 1189 | quality: 50, |
| 131 | percentage: 50); | 1190 | percentage: 50); |
| 1191 | + UploadImgModel imgModel = | ||
| 1192 | + _uploadImageProvider.getDynamicValue('${index}'); | ||
| 132 | setState(() { | 1193 | setState(() { |
| 133 | if (pickedFile != null) { | 1194 | if (pickedFile != null) { |
| 134 | imgModel.file = File(pickedFile.path); | 1195 | imgModel.file = File(pickedFile.path); |
| @@ -143,23 +1204,38 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -143,23 +1204,38 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 143 | // _uploadImageProvider.touxiang.qiniuUrl = null; | 1204 | // _uploadImageProvider.touxiang.qiniuUrl = null; |
| 144 | // } else { | 1205 | // } else { |
| 145 | // _uploadImageProvider.imgSizeErweima = 76; | 1206 | // _uploadImageProvider.imgSizeErweima = 76; |
| 146 | - _uploadImageProvider.firstImage.qiniuUrl = null; | 1207 | + imgModel.qiniuUrl = null; |
| 147 | // } | 1208 | // } |
| 148 | bool need = await Utils.sizeNeed(File(pickedFile.path)); | 1209 | bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 149 | File file = File(pickedFile.path); | 1210 | File file = File(pickedFile.path); |
| 150 | if (need) { | 1211 | if (need) { |
| 151 | file = File(compressedFile.absolute.path); | 1212 | file = File(compressedFile.absolute.path); |
| 152 | } | 1213 | } |
| 153 | - UploadImageUtil() | ||
| 154 | - .startUploadOnly(context, file, 4, true, _uploadImageProvider, () { | ||
| 155 | - imgAll.add(_uploadImageProvider.firstImage.qiniuUrl); | 1214 | + UploadImageUtil().startUploadOnlyAddition( |
| 1215 | + context, file, index, true, _uploadImageProvider, () { | ||
| 1216 | + UploadImgModel imgModel = | ||
| 1217 | + _uploadImageProvider.getDynamicValue('${index}'); | ||
| 1218 | + AdditionModel additionModel = AdditionModel(); | ||
| 1219 | + additionModel.content = imgModel.qiniuUrl; | ||
| 1220 | + additionModel.type = '1'; | ||
| 1221 | + // additionModel.order = index; | ||
| 1222 | + additionModel.image = imgModel; | ||
| 1223 | + // additionModel.image.process = 1; | ||
| 1224 | + // additionModel.image.qiniuUrl = | ||
| 1225 | + // 'https://inews.gtimg.com/om_bt/OGlQWfsaAoKkuCcMZ2o9IVEPqd-72DQy5EAN02XBHUwfYAA/641'; | ||
| 1226 | + | ||
| 1227 | + data[index] = additionModel; | ||
| 1228 | + | ||
| 1229 | + imgAll.add(imgModel.qiniuUrl); | ||
| 1230 | + setState(() {}); | ||
| 156 | }); | 1231 | }); |
| 157 | } | 1232 | } |
| 158 | } | 1233 | } |
| 159 | } | 1234 | } |
| 160 | 1235 | ||
| 161 | ///添加图片UI弹出 | 1236 | ///添加图片UI弹出 |
| 162 | - Future _openModalBottomSheet(context) async { | 1237 | + Future _openModalBottomSheet(context, int index, |
| 1238 | + {FileType fileType = FileType.image}) async { | ||
| 163 | final option = await showModalBottomSheet( | 1239 | final option = await showModalBottomSheet( |
| 164 | context: context, | 1240 | context: context, |
| 165 | backgroundColor: Colors.transparent, | 1241 | backgroundColor: Colors.transparent, |
| @@ -177,22 +1253,47 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -177,22 +1253,47 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 177 | children: <Widget>[ | 1253 | children: <Widget>[ |
| 178 | InkWell( | 1254 | InkWell( |
| 179 | onTap: () { | 1255 | onTap: () { |
| 180 | - // Utils.getPickPermission(context, () { | ||
| 181 | - // _getFromPictureOrCamera( | ||
| 182 | - // _uploadImageProvider.firstImage, ImageSource.camera); | 1256 | + if (Platform.isAndroid) { |
| 1257 | + Utils.getPickPermission(context, () { | ||
| 1258 | + if (fileType == FileType.image) { | ||
| 1259 | + _getFromPictureOrCamera(index, ImageSource.camera); | ||
| 1260 | + } else { | ||
| 1261 | + _getVideoFromPictureOrCamera(ImageSource.camera); | ||
| 1262 | + } | ||
| 1263 | + if (Navigator.canPop(context)) { | ||
| 1264 | + Navigator.pop(context); | ||
| 1265 | + } | ||
| 1266 | + }, Permission.storage); | ||
| 1267 | + } else { | ||
| 1268 | + if (fileType == FileType.image) { | ||
| 1269 | + Utils.getPickPermission(context, () { | ||
| 1270 | + _getFromPictureOrCamera(index, ImageSource.camera); | ||
| 183 | 1271 | ||
| 184 | - // Navigator.pop(context); | ||
| 185 | - // }, Permission.camera); | ||
| 186 | - Utils.getPickPermission(context, () { | ||
| 187 | - _getFromPictureOrCamera( | ||
| 188 | - _uploadImageProvider.firstImage, ImageSource.camera); | ||
| 189 | - if (Navigator.canPop(context)) { | ||
| 190 | - Navigator.pop(context); | 1272 | + if (Navigator.canPop(context)) { |
| 1273 | + Navigator.pop(context); | ||
| 1274 | + } | ||
| 1275 | + }, Permission.photos); | ||
| 1276 | + } else { | ||
| 1277 | + Utils.getPickPermission(context, () async { | ||
| 1278 | + Utils.getPickPermission(context, () { | ||
| 1279 | + _getVideoFromPictureOrCamera(ImageSource.camera); | ||
| 1280 | + if (Navigator.canPop(context)) { | ||
| 1281 | + Navigator.pop(context); | ||
| 1282 | + } | ||
| 1283 | + }, Permission.microphone); | ||
| 1284 | + }, Permission.camera); | ||
| 191 | } | 1285 | } |
| 192 | - }, | ||
| 193 | - Platform.isAndroid | ||
| 194 | - ? Permission.storage | ||
| 195 | - : Permission.photos); | 1286 | + } |
| 1287 | + // Utils.getPickPermission(context, () { | ||
| 1288 | + // if (fileType == FileType.image) { | ||
| 1289 | + // _getImageFromPictureOrCamera(ImageSource.camera); | ||
| 1290 | + // } else { | ||
| 1291 | + // _getVideoFromPictureOrCamera(ImageSource.camera); | ||
| 1292 | + // } | ||
| 1293 | + // if (Navigator.canPop(context)) { | ||
| 1294 | + // Navigator.pop(context); | ||
| 1295 | + // } | ||
| 1296 | + // }, Permission.camera); | ||
| 196 | }, | 1297 | }, |
| 197 | child: Container( | 1298 | child: Container( |
| 198 | width: double.infinity, | 1299 | width: double.infinity, |
| @@ -223,9 +1324,13 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -223,9 +1324,13 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 223 | // Platform.isAndroid | 1324 | // Platform.isAndroid |
| 224 | // ? Permission.storage | 1325 | // ? Permission.storage |
| 225 | // : Permission.photos); | 1326 | // : Permission.photos); |
| 1327 | + | ||
| 226 | Utils.getPickPermission(context, () { | 1328 | Utils.getPickPermission(context, () { |
| 227 | - _getFromPictureOrCamera( | ||
| 228 | - _uploadImageProvider.firstImage, ImageSource.gallery); | 1329 | + if (fileType == FileType.image) { |
| 1330 | + _getFromPictureOrCamera(index, ImageSource.gallery); | ||
| 1331 | + } else { | ||
| 1332 | + _getVideoFromPictureOrCamera(ImageSource.gallery); | ||
| 1333 | + } | ||
| 229 | if (Navigator.canPop(context)) { | 1334 | if (Navigator.canPop(context)) { |
| 230 | Navigator.pop(context); | 1335 | Navigator.pop(context); |
| 231 | } | 1336 | } |
| @@ -233,6 +1338,22 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -233,6 +1338,22 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 233 | Platform.isAndroid | 1338 | Platform.isAndroid |
| 234 | ? Permission.storage | 1339 | ? Permission.storage |
| 235 | : Permission.photos); | 1340 | : Permission.photos); |
| 1341 | + | ||
| 1342 | + // Utils.getPickPermission(context, () { | ||
| 1343 | + // if (fileType == FileType.image) { | ||
| 1344 | + // pickAsset(RequestType.image); | ||
| 1345 | + // } else { | ||
| 1346 | + // _getVideoFromPictureOrCamera(ImageSource.gallery); | ||
| 1347 | + // } | ||
| 1348 | + // // // | ||
| 1349 | + // // _getFromPictureOrCamera(ImageSource.gallery); | ||
| 1350 | + // if (Navigator.canPop(context)) { | ||
| 1351 | + // Navigator.pop(context); | ||
| 1352 | + // } | ||
| 1353 | + // }, | ||
| 1354 | + // Platform.isAndroid | ||
| 1355 | + // ? Permission.storage | ||
| 1356 | + // : Permission.photos); | ||
| 236 | }, | 1357 | }, |
| 237 | child: Container( | 1358 | child: Container( |
| 238 | width: double.infinity, | 1359 | width: double.infinity, |
| @@ -276,244 +1397,106 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -276,244 +1397,106 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 276 | }); | 1397 | }); |
| 277 | } | 1398 | } |
| 278 | 1399 | ||
| 279 | - Widget _uploadImage({EdgeInsets padding = EdgeInsets.zero}) { | ||
| 280 | - return _uploadImageProvider.firstImage.file != null || | ||
| 281 | - (_uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 282 | - _uploadImageProvider.firstImage.qiniuUrl != '') | ||
| 283 | - ? InkWell( | ||
| 284 | - onTap: () { | ||
| 285 | - double process; | ||
| 286 | - String qiniuUrl; | ||
| 287 | - List<String> tempList = []; | ||
| 288 | - // if (title == '头像') { | ||
| 289 | - process = _uploadImageProvider.firstImage.process; | ||
| 290 | - qiniuUrl = _uploadImageProvider.firstImage.qiniuUrl; | ||
| 291 | - // } else { | ||
| 292 | - // process = _uploadImageProvider.erweima.process; | ||
| 293 | - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 294 | - // } | ||
| 295 | - | ||
| 296 | - if (qiniuUrl != null && qiniuUrl != '') { | ||
| 297 | - // tempList.add(qiniuUrl); | ||
| 298 | - | ||
| 299 | - // ///没有上传完成的不可以点击 | ||
| 300 | - // _showPhotoView(context, 0, tempList); | ||
| 301 | - | ||
| 302 | - // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 303 | - // _uploadImageProvider.firstImage.process = 0; | ||
| 304 | - // setState(() {}); | ||
| 305 | - FocusScope.of(context).requestFocus(FocusNode()); | ||
| 306 | - _openModalBottomSheet(context); | ||
| 307 | - // Utils.getPickPermission(context, () { | ||
| 308 | - // _getFromPictureOrCamera( | ||
| 309 | - // _uploadImageProvider.firstImage, | ||
| 310 | - // ImageSource.gallery); | ||
| 311 | - // }, | ||
| 312 | - // Platform.isAndroid | ||
| 313 | - // ? Permission.storage | ||
| 314 | - // : Permission.photos); | ||
| 315 | - } | ||
| 316 | - }, | ||
| 317 | - child: Stack(alignment: Alignment.bottomCenter, children: [ | ||
| 318 | - Stack(clipBehavior: Clip.none, children: [ | ||
| 319 | - _uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 320 | - _uploadImageProvider.firstImage.qiniuUrl != '' | ||
| 321 | - ? Center( | ||
| 322 | - child: Image.network( | ||
| 323 | - _uploadImageProvider.firstImage.qiniuUrl, | ||
| 324 | - fit: BoxFit.contain, | ||
| 325 | - // width: double.infinity, | ||
| 326 | - // width: ScreenUtil() | ||
| 327 | - // .setWidth(imgSize * 2), | ||
| 328 | - // height: ScreenUtil().setWidth( | ||
| 329 | - // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 330 | - )) | ||
| 331 | - : Center( | ||
| 332 | - child: Image.file( | ||
| 333 | - _uploadImageProvider.firstImage.file, | ||
| 334 | - fit: BoxFit.contain, | ||
| 335 | - // width: double.infinity, | ||
| 336 | - // width: ScreenUtil() | ||
| 337 | - // .setWidth(imgSize * 2), | ||
| 338 | - // height: ScreenUtil().setWidth( | ||
| 339 | - // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 340 | - )), | ||
| 341 | - Positioned( | ||
| 342 | - left: 0, | ||
| 343 | - top: 0, | ||
| 344 | - right: padding.right, | ||
| 345 | - child: (_uploadImageProvider.firstImage.file != null) && | ||
| 346 | - _uploadImageProvider.firstImage.process != 1 && | ||
| 347 | - _uploadImageProvider.firstImage.process != 0.01 | ||
| 348 | - ? Container( | ||
| 349 | - width: ScreenUtil().screenWidth, | ||
| 350 | - height: w(_uploadImageProvider.imgSizefirstImage), | ||
| 351 | - color: MyColours.color_4D000000, | ||
| 352 | - child: Center( | ||
| 353 | - child: Text('上传中', | ||
| 354 | - style: | ||
| 355 | - TextStyle(color: MyColours.color_F8F9FD)), | ||
| 356 | - ), | ||
| 357 | - ) | ||
| 358 | - : Container()), | ||
| 359 | - if (_uploadImageProvider.firstImage.process == 1) | ||
| 360 | - Positioned( | ||
| 361 | - top: 0, | ||
| 362 | - right: 0, | ||
| 363 | - child: GestureDetector( | ||
| 364 | - child: Image.asset( | ||
| 365 | - Utils.getImgPath("delete"), | ||
| 366 | - width: ScreenUtil().setWidth(40), | ||
| 367 | - height: ScreenUtil().setWidth(40), | ||
| 368 | - ), | ||
| 369 | - onTap: () { | ||
| 370 | - //已经传到服务器,弹提醒窗口,是否删除 | ||
| 371 | - //修改之前有内容,则弹框 | ||
| 372 | - DialogUtil.cupertinoAlertDialog(context, | ||
| 373 | - title: "", content: "是否确定删除该照片?", lCallback: () { | ||
| 374 | - print("取消"); | ||
| 375 | - }, rCallback: () { | ||
| 376 | - _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 377 | - _uploadImageProvider.firstImage.file = null; | ||
| 378 | - _uploadImageProvider.firstImage.isUpload = false; | ||
| 379 | - _uploadImageProvider.firstImage.process = 0.01; | ||
| 380 | - setState(() {}); | ||
| 381 | - }); | ||
| 382 | - }, | ||
| 383 | - )) | ||
| 384 | - ]), | ||
| 385 | - _uploadImageProvider.firstImage.process == 1 | ||
| 386 | - ? Container( | ||
| 387 | - width: w(150), | ||
| 388 | - height: w(30), | ||
| 389 | - color: MyColours.color_4D000000, | ||
| 390 | - alignment: Alignment.center, | ||
| 391 | - margin: padding, | ||
| 392 | - child: Text( | ||
| 393 | - '点击图片可以更换', | ||
| 394 | - style: TextStyle( | ||
| 395 | - color: MyColours.color_F8F9FD, | ||
| 396 | - fontSize: font(14), | ||
| 397 | - fontWeight: FontWeight.bold), | ||
| 398 | - )) | ||
| 399 | - : SizedBox(), | ||
| 400 | - ])) | ||
| 401 | - : InkWell( | ||
| 402 | - onTap: () { | ||
| 403 | - // double process; | ||
| 404 | - // String qiniuUrl; | ||
| 405 | - // List<String> tempList = []; | ||
| 406 | - // if (title == '头像') { | ||
| 407 | - // process = _uploadImageProvider.touxiang.process; | ||
| 408 | - // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl; | ||
| 409 | - // } else { | ||
| 410 | - // process = _uploadImageProvider.erweima.process; | ||
| 411 | - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 412 | - // } | ||
| 413 | - | ||
| 414 | - // if (qiniuUrl != null && qiniuUrl != '') { | ||
| 415 | - // tempList.add(qiniuUrl); | ||
| 416 | - | ||
| 417 | - // ///没有上传完成的不可以点击 | ||
| 418 | - // _showPhotoView(context, 0, tempList); | ||
| 419 | - // } else { | ||
| 420 | - // Utils.getPickPermission(context, () { | ||
| 421 | - // _getFromPictureOrCamera( | ||
| 422 | - // _uploadImageProvider.firstImage, ImageSource.gallery); | ||
| 423 | - // }, Platform.isAndroid ? Permission.storage : Permission.photos); | ||
| 424 | - FocusScope.of(context).requestFocus(FocusNode()); | ||
| 425 | - _openModalBottomSheet(context); | ||
| 426 | - }, | ||
| 427 | - child: Container( | ||
| 428 | - color: MyColours.color_d9d9d9, | ||
| 429 | - width: double.infinity, | ||
| 430 | - height: w(_uploadImageProvider.imgSizefirstImage), | ||
| 431 | - margin: padding, | ||
| 432 | - child: Column( | ||
| 433 | - mainAxisAlignment: MainAxisAlignment.center, | ||
| 434 | - children: [ | ||
| 435 | - // VEmptyView(80), | ||
| 436 | - Image.asset( | ||
| 437 | - Utils.getImgPath('add_img'), | ||
| 438 | - width: w(63), | ||
| 439 | - ), | ||
| 440 | - VEmptyView(28), | ||
| 441 | - Container( | ||
| 442 | - width: w(139), | ||
| 443 | - height: w(60), | ||
| 444 | - child: Text( | ||
| 445 | - '点击上传照片\n为了更好的效果\n建议上传4:3照片', | ||
| 446 | - textAlign: TextAlign.center, | ||
| 447 | - style: TextStyle( | ||
| 448 | - height: 1.4, | ||
| 449 | - color: MyColours.color_ffffff, | ||
| 450 | - fontSize: font(14), | ||
| 451 | - fontWeight: FontWeight.bold), | ||
| 452 | - )) | ||
| 453 | - ], | ||
| 454 | - ), | ||
| 455 | - )); | ||
| 456 | - } | ||
| 457 | - | ||
| 458 | - ///无介绍 | ||
| 459 | - Widget _noTextWidget() { | ||
| 460 | - return SizedBox(); | ||
| 461 | - // return Column( | ||
| 462 | - // children: [ | ||
| 463 | - // _uploadImage(), | ||
| 464 | - // VEmptyView(18), | ||
| 465 | - // ], | ||
| 466 | - // ); | ||
| 467 | - } | ||
| 468 | - | ||
| 469 | - ///图文分开 | ||
| 470 | - Widget _separateWidget() { | ||
| 471 | - return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ | ||
| 472 | - // _introduceWidget(EdgeInsets.all(w(15)), | ||
| 473 | - // boxDecoration: BoxDecoration(color: MyColours.color_ffffff)), | ||
| 474 | - // VEmptyView(18), | ||
| 475 | - _uploadImage(), | ||
| 476 | - ]); | ||
| 477 | - } | 1400 | + ///视频 |
| 1401 | + Future _getVideoFromPictureOrCamera(ImageSource imageSource) async { | ||
| 1402 | + final pickedFile = await picker.pickVideo( | ||
| 1403 | + source: imageSource, maxDuration: const Duration(minutes: 2)); | ||
| 1404 | + if (pickedFile != null) { | ||
| 1405 | + int key = data.length; //上传变量key | ||
| 1406 | + // String ddd = Utils.getPicSuffix(pickedFile.path); //获取后缀MP4 | ||
| 1407 | + // print(ddd); | ||
| 1408 | + await VideoCompress.setLogLevel(0); | ||
| 1409 | + final info = await VideoCompress.getMediaInfo( | ||
| 1410 | + pickedFile.path); //视频信息:时长、像素(宽高)、大小、path | ||
| 1411 | + String duration = '00:00'; | ||
| 1412 | + if (info != null) { | ||
| 1413 | + //限制视频时长 | ||
| 1414 | + if (info.duration > 30000 || info.duration < 0) { | ||
| 1415 | + Utils.showToast('请选择30秒以内的视频'); | ||
| 1416 | + return; | ||
| 1417 | + } | ||
| 1418 | + duration = VideoUtils.getDuration( | ||
| 1419 | + info.duration, | ||
| 1420 | + ); //转化视频时长单位(00:13、 02:00) | ||
| 1421 | + } | ||
| 1422 | + UploadImgModel uploadImgModel = UploadImgModel(); //图 | ||
| 1423 | + _uploadImageProvider.setDynamicValue('${key}', uploadImgModel); | ||
| 478 | 1424 | ||
| 479 | - Widget _item(String title, {bool select, GestureTapCallback onTap}) { | ||
| 480 | - return InkWell( | ||
| 481 | - onTap: onTap, | ||
| 482 | - child: Container( | ||
| 483 | - decoration: BoxDecoration( | ||
| 484 | - border: Border( | ||
| 485 | - bottom: BorderSide( | ||
| 486 | - color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 487 | - margin: EdgeInsets.only(left: w(16)), | ||
| 488 | - padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 489 | - child: Row( | ||
| 490 | - children: [ | ||
| 491 | - Text( | ||
| 492 | - title, | ||
| 493 | - style: TextStyle( | ||
| 494 | - color: MyColours.color_515151, | ||
| 495 | - fontSize: ScreenUtil().setWidth(32)), | ||
| 496 | - ), | ||
| 497 | - Spacer(), | ||
| 498 | - Container( | ||
| 499 | - padding: | ||
| 500 | - EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 501 | - child: Image.asset( | ||
| 502 | - Utils.getImgPath(select ? 'swich_on' : 'swich_off'), | ||
| 503 | - width: w(44), | ||
| 504 | - ), | ||
| 505 | - ) | ||
| 506 | - ], | ||
| 507 | - ))); | 1425 | + AdditionModel additionModel = AdditionModel(); |
| 1426 | + additionModel.type = '3'; | ||
| 1427 | + additionModel.image = uploadImgModel; | ||
| 1428 | + data.add(additionModel); | ||
| 1429 | + //获取视频封面图 | ||
| 1430 | + String thumbnailPathString = | ||
| 1431 | + await VideoUtils.getThumbnailFile(pickedFile.path); | ||
| 1432 | + File thumbnailPath = File(thumbnailPathString); | ||
| 1433 | + //视频数据赋值:封面、时长、类型、进度、path | ||
| 1434 | + UploadImgModel imgModel = _uploadImageProvider.getDynamicValue('${key}'); | ||
| 1435 | + setState(() { | ||
| 1436 | + imgModel.file = File(pickedFile.path); | ||
| 1437 | + imgModel.process = 0.01; | ||
| 1438 | + imgModel.fileType = FileType.video; | ||
| 1439 | + imgModel.thumbnailPath = thumbnailPath; | ||
| 1440 | + imgModel.duration = duration; | ||
| 1441 | + imgModel.qiniuUrl = null; | ||
| 1442 | + }); | ||
| 1443 | + //上传文件准备 | ||
| 1444 | + File file = File(pickedFile.path); | ||
| 1445 | + //是否需要压缩 | ||
| 1446 | + bool need = await VideoUtils.shouldCompress(pickedFile.path); | ||
| 1447 | + if (need) { | ||
| 1448 | + Subscription _subscription; //展示压缩进度 | ||
| 1449 | + showCompress = true; | ||
| 1450 | + setState(() {}); | ||
| 1451 | + //需要压缩 | ||
| 1452 | + // 订阅压缩进度 | ||
| 1453 | + _subscription = VideoCompress.compressProgress$.subscribe((progress) { | ||
| 1454 | + // 回调进度给外部 | ||
| 1455 | + debugPrint('progress: $progress'); | ||
| 1456 | + // compressProcess = '压缩进度: ${progress.toStringAsFixed(1)}%'; | ||
| 1457 | + setState(() {}); | ||
| 1458 | + }, onDone: () {}, onError: (error) {}, cancelOnError: true); | ||
| 1459 | + file = await VideoUtils.compress(pickedFile.path); //压缩后的文件 | ||
| 1460 | + if (file != null) { | ||
| 1461 | + //压缩完成 | ||
| 1462 | + showCompress = false; | ||
| 1463 | + _subscription.unsubscribe(); // 取消订阅 | ||
| 1464 | + setState(() {}); | ||
| 1465 | + } else { | ||
| 1466 | + data.removeLast(); | ||
| 1467 | + _subscription.unsubscribe(); // 取消订阅 | ||
| 1468 | + setState(() {}); | ||
| 1469 | + throw Exception('Failed to compress video'); | ||
| 1470 | + } | ||
| 1471 | + } | ||
| 1472 | + //开始上传任务 | ||
| 1473 | + UploadImageUtil().startUploadOnlyAddition( | ||
| 1474 | + context, file, key, true, _uploadImageProvider, () { | ||
| 1475 | + //上传成功后赋值 | ||
| 1476 | + UploadImgModel imgModel = | ||
| 1477 | + _uploadImageProvider.getDynamicValue('${key}'); | ||
| 1478 | + AdditionModel additionModel = AdditionModel(); | ||
| 1479 | + additionModel.content = imgModel.qiniuUrl; | ||
| 1480 | + additionModel.type = '3'; | ||
| 1481 | + additionModel.image = imgModel; | ||
| 1482 | + data[key] = additionModel; | ||
| 1483 | + imgAll.add(imgModel.qiniuUrl); | ||
| 1484 | + setState(() {}); | ||
| 1485 | + }); | ||
| 1486 | + } else { | ||
| 1487 | + print('No image selected.'); | ||
| 1488 | + } | ||
| 508 | } | 1489 | } |
| 509 | 1490 | ||
| 510 | @override | 1491 | @override |
| 511 | Widget build(BuildContext context) { | 1492 | Widget build(BuildContext context) { |
| 1493 | + // _baseIndoProvider = | ||
| 1494 | + // Provider.of<StoreBaseIndoProvider>(context, listen: false); | ||
| 512 | _uploadImageProvider = | 1495 | _uploadImageProvider = |
| 513 | Provider.of<UploadImageProvider>(context, listen: true); | 1496 | Provider.of<UploadImageProvider>(context, listen: true); |
| 514 | - | ||
| 515 | - _marketingCenterProvider = | 1497 | + marketingCenterProvider = |
| 516 | Provider.of<MarketingCenterProvider>(context, listen: true); | 1498 | Provider.of<MarketingCenterProvider>(context, listen: true); |
| 1499 | + bool hasVedio = data.any((element) => element.type == '3'); | ||
| 517 | return KeyboardDismissOnTap( | 1500 | return KeyboardDismissOnTap( |
| 518 | child: Scaffold( | 1501 | child: Scaffold( |
| 519 | backgroundColor: MyColours.color_ffffff, | 1502 | backgroundColor: MyColours.color_ffffff, |
| @@ -529,198 +1512,372 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -529,198 +1512,372 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 529 | children: [ | 1512 | children: [ |
| 530 | Expanded( | 1513 | Expanded( |
| 531 | child: SingleChildScrollView( | 1514 | child: SingleChildScrollView( |
| 1515 | + controller: controller, | ||
| 532 | child: Column( | 1516 | child: Column( |
| 533 | children: [ | 1517 | children: [ |
| 534 | - // _selectBtnWidget(), | ||
| 535 | - // VEmptyView(24), | ||
| 536 | - // Container( | ||
| 537 | - // alignment: Alignment.centerLeft, | ||
| 538 | - // padding: EdgeInsets.only(left: w(16)), | ||
| 539 | - // height: w(48), | ||
| 540 | - // child: Text( | ||
| 541 | - // '效果预览', | ||
| 542 | - // style: TextStyle( | ||
| 543 | - // fontSize: font(16), | ||
| 544 | - // color: MyColours.color_515151), | ||
| 545 | - // ), | ||
| 546 | - // ), | ||
| 547 | - // VEmptyView(24), | ||
| 548 | - _item('预订安排通知中附加主厨文字介绍', select: addChefIntroduce, | 1518 | + _item('预订通知中展示主厨介绍', select: addStoreIntroduce, |
| 549 | onTap: () { | 1519 | onTap: () { |
| 550 | setState(() { | 1520 | setState(() { |
| 551 | - addChefIntroduce = !addChefIntroduce; | 1521 | + addStoreIntroduce = !addStoreIntroduce; |
| 552 | }); | 1522 | }); |
| 553 | }), | 1523 | }), |
| 554 | 1524 | ||
| 555 | - VEmptyView(24), | ||
| 556 | - //输入框 | ||
| 557 | - Container( | ||
| 558 | - width: double.infinity, | ||
| 559 | - margin: EdgeInsets.symmetric( | ||
| 560 | - horizontal: ScreenUtil().setWidth(40)), | ||
| 561 | - padding: EdgeInsets.symmetric( | ||
| 562 | - horizontal: ScreenUtil().setWidth(40), | ||
| 563 | - vertical: ScreenUtil().setWidth(20)), | ||
| 564 | - alignment: Alignment.topLeft, | ||
| 565 | - decoration: BoxDecoration( | ||
| 566 | - color: MyColours.color_ffffff, | ||
| 567 | - border: Border.all( | ||
| 568 | - color: MyColours.color_DBDBDB, | ||
| 569 | - width: ScreenUtil().setWidth(2)), | ||
| 570 | - borderRadius: BorderRadius.circular( | ||
| 571 | - ScreenUtil().setWidth(20))), | ||
| 572 | - child: TextField( | ||
| 573 | - controller: chefIntroduceC, | ||
| 574 | - focusNode: chefIntroduceNode, | ||
| 575 | - style: TextStyle( | ||
| 576 | - color: MyColours.color_515151, | ||
| 577 | - fontSize: ScreenUtil().setSp(28), | ||
| 578 | - textBaseline: TextBaseline.alphabetic), | ||
| 579 | - textAlignVertical: TextAlignVertical.center, | ||
| 580 | - maxLines: 5, | ||
| 581 | - maxLength: 100, | ||
| 582 | - decoration: InputDecoration( | ||
| 583 | - hintText: "点击录入餐厅介绍文字信息,最多100个汉字。", | ||
| 584 | - hintStyle: TextStyle( | ||
| 585 | - color: MyColours.color_999999, | ||
| 586 | - fontSize: ScreenUtil().setSp(28), | ||
| 587 | - ), | ||
| 588 | - contentPadding: EdgeInsets.zero, | ||
| 589 | - border: OutlineInputBorder( | ||
| 590 | - borderSide: BorderSide.none), | ||
| 591 | - ), | ||
| 592 | - keyboardType: TextInputType.multiline, | ||
| 593 | - onChanged: (value) { | ||
| 594 | - setState(() { | ||
| 595 | - // currentRemark = value ?? ""; | ||
| 596 | - }); | ||
| 597 | - }), | 1525 | + _textfield( |
| 1526 | + '标题名称', | ||
| 1527 | + '请输入', | ||
| 1528 | + titleC, | ||
| 1529 | + titleCNode, | ||
| 598 | ), | 1530 | ), |
| 599 | - VEmptyView(24), | ||
| 600 | - Padding( | ||
| 601 | - padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 602 | - child: MyDivider( | ||
| 603 | - double.infinity, | ||
| 604 | - w(0.5), | ||
| 605 | - color: MyColours.color_DBDBDB, | ||
| 606 | - )), | ||
| 607 | - VEmptyView(24), | ||
| 608 | - // _selectBtnWidget(), | ||
| 609 | - _item('预订安排通知中附加主厨介绍图片', select: addChefImge, onTap: () { | ||
| 610 | - setState(() { | ||
| 611 | - addChefImge = !addChefImge; | ||
| 612 | - }); | ||
| 613 | - }), | ||
| 614 | 1531 | ||
| 615 | VEmptyView(24), | 1532 | VEmptyView(24), |
| 616 | - _separateWidget(), | ||
| 617 | - VEmptyView(24), | ||
| 618 | - _item('主厨介绍文字显示在图片上', select: addAbove, onTap: () { | ||
| 619 | - setState(() { | ||
| 620 | - addAbove = !addAbove; | ||
| 621 | - }); | ||
| 622 | - }), | 1533 | + if (data.length > 0) |
| 1534 | + Padding( | ||
| 1535 | + padding: EdgeInsets.symmetric( | ||
| 1536 | + // horizontal: ScreenUtil().setWidth(32), | ||
| 1537 | + vertical: ScreenUtil().setWidth(26)), | ||
| 1538 | + child: ReorderableListView( | ||
| 1539 | + shrinkWrap: true, | ||
| 1540 | + scrollController: controller, | ||
| 1541 | + children: _scrolleWidget(), | ||
| 1542 | + onReorder: (int oldIndex, int newIndex) async { | ||
| 1543 | + print(newIndex); | ||
| 1544 | + if (oldIndex < newIndex) { | ||
| 1545 | + newIndex -= 1; | ||
| 1546 | + } | ||
| 1547 | + print(newIndex); | ||
| 1548 | + | ||
| 1549 | + // var childold = tableManagerModel.areas[oldIndex]; | ||
| 1550 | + // Map<String, String> params = { | ||
| 1551 | + // 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 1552 | + // .user | ||
| 1553 | + // .sellerid, | ||
| 1554 | + // 'regionid': childold.rid, | ||
| 1555 | + // 'order_o': tableManagerModel.areas[newIndex].orderId, | ||
| 1556 | + // 'sort': oldIndex < newIndex ? '2' : '1' | ||
| 1557 | + // }; | ||
| 1558 | + var child = data.removeAt(oldIndex); | ||
| 1559 | + data.insert(newIndex, child); | ||
| 1560 | + setState(() {}); | ||
| 1561 | + // await tableManagerModel.sortByRegion(context, params); | ||
| 1562 | + // //刷新前一页数据 | ||
| 1563 | + // bus.emit('refresh_table_area'); | ||
| 1564 | + }, | ||
| 1565 | + )), | ||
| 1566 | + | ||
| 1567 | + //输入框 | ||
| 1568 | + // Container( | ||
| 1569 | + // width: double.infinity, | ||
| 1570 | + // margin: EdgeInsets.symmetric( | ||
| 1571 | + // horizontal: ScreenUtil().setWidth(40)), | ||
| 1572 | + // padding: EdgeInsets.symmetric( | ||
| 1573 | + // horizontal: ScreenUtil().setWidth(40), | ||
| 1574 | + // vertical: ScreenUtil().setWidth(20)), | ||
| 1575 | + // alignment: Alignment.topLeft, | ||
| 1576 | + // decoration: BoxDecoration( | ||
| 1577 | + // color: MyColours.color_ffffff, | ||
| 1578 | + // border: Border.all( | ||
| 1579 | + // color: MyColours.color_DBDBDB, | ||
| 1580 | + // width: ScreenUtil().setWidth(2)), | ||
| 1581 | + // borderRadius: BorderRadius.circular( | ||
| 1582 | + // ScreenUtil().setWidth(20))), | ||
| 1583 | + // child: TextField( | ||
| 1584 | + // controller: storeIntroduceC, | ||
| 1585 | + // focusNode: storeIntroduceNode, | ||
| 1586 | + // style: TextStyle( | ||
| 1587 | + // color: MyColours.color_515151, | ||
| 1588 | + // fontSize: ScreenUtil().setSp(28), | ||
| 1589 | + // textBaseline: TextBaseline.alphabetic), | ||
| 1590 | + // textAlignVertical: TextAlignVertical.center, | ||
| 1591 | + // maxLines: 5, | ||
| 1592 | + // maxLength: 500, | ||
| 1593 | + // decoration: InputDecoration( | ||
| 1594 | + // hintText: "点击录入餐厅介绍文字信息,最多100个汉字。", | ||
| 1595 | + // hintStyle: TextStyle( | ||
| 1596 | + // color: MyColours.color_999999, | ||
| 1597 | + // fontSize: ScreenUtil().setSp(28), | ||
| 1598 | + // ), | ||
| 1599 | + // contentPadding: EdgeInsets.zero, | ||
| 1600 | + // border: OutlineInputBorder( | ||
| 1601 | + // borderSide: BorderSide.none), | ||
| 1602 | + // ), | ||
| 1603 | + // keyboardType: TextInputType.multiline, | ||
| 1604 | + // onChanged: (value) { | ||
| 1605 | + // setState(() { | ||
| 1606 | + // // currentRemark = value ?? ""; | ||
| 1607 | + // }); | ||
| 1608 | + // }), | ||
| 1609 | + // ), | ||
| 1610 | + // VEmptyView(24), | ||
| 1611 | + // Padding( | ||
| 1612 | + // padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 1613 | + // child: MyDivider( | ||
| 1614 | + // double.infinity, | ||
| 1615 | + // w(0.5), | ||
| 1616 | + // color: MyColours.color_DBDBDB, | ||
| 1617 | + // )), | ||
| 1618 | + // VEmptyView(24), | ||
| 1619 | + // // _selectBtnWidget(), | ||
| 1620 | + // _item('预订安排通知中附加餐厅介绍图片', select: addStoreImge, onTap: () { | ||
| 1621 | + // setState(() { | ||
| 1622 | + // addStoreImge = !addStoreImge; | ||
| 1623 | + // }); | ||
| 1624 | + // }), | ||
| 1625 | + | ||
| 1626 | + // VEmptyView(24), | ||
| 1627 | + // // Container( | ||
| 1628 | + // // alignment: Alignment.centerLeft, | ||
| 1629 | + // // padding: EdgeInsets.only(left: w(16)), | ||
| 1630 | + // // height: w(48), | ||
| 1631 | + // // child: Text( | ||
| 1632 | + // // '效果预览', | ||
| 1633 | + // // style: TextStyle( | ||
| 1634 | + // // fontSize: font(16), | ||
| 1635 | + // // color: MyColours.color_515151), | ||
| 1636 | + // // ), | ||
| 1637 | + // // ), | ||
| 1638 | + // // VEmptyView(24), | ||
| 1639 | + // // currIndex == 0 | ||
| 1640 | + // // ? _noTextWidget() | ||
| 1641 | + // // : currIndex == 1 | ||
| 1642 | + // // ? _mergingWidget() | ||
| 1643 | + // // : | ||
| 1644 | + // _separateWidget(), | ||
| 1645 | + // VEmptyView(24), | ||
| 1646 | + // _item('餐厅介绍文字显示在第一张图片上', select: addAbove, onTap: () { | ||
| 1647 | + // setState(() { | ||
| 1648 | + // addAbove = !addAbove; | ||
| 1649 | + // }); | ||
| 1650 | + // }), | ||
| 623 | 1651 | ||
| 624 | VEmptyView(24), | 1652 | VEmptyView(24), |
| 625 | ], | 1653 | ], |
| 626 | ), | 1654 | ), |
| 627 | )), | 1655 | )), |
| 628 | - Container( | ||
| 629 | - color: MyColours.color_ffffff, | ||
| 630 | - padding: EdgeInsets.only( | ||
| 631 | - left: w(45), right: w(45), top: w(12), bottom: w(25)), | ||
| 632 | - child: RoundButton( | ||
| 633 | - text: '保存', | ||
| 634 | - gradientStart: MyColours.color_199095, | ||
| 635 | - gradientEnd: MyColours.color_199095, | ||
| 636 | - // borderColor: MyColours.color_999999, | ||
| 637 | - radius: r(5), | ||
| 638 | - fontSize: 34, | ||
| 639 | - height: w(40), | ||
| 640 | - isBold: true, | ||
| 641 | - onPressed: () async { | ||
| 642 | - FocusScope.of(context) | ||
| 643 | - .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 644 | - | ||
| 645 | - if (addChefIntroduce && | ||
| 646 | - chefIntroduceC.text.trim().length == 0) { | ||
| 647 | - Utils.showToast('请输入主厨介绍文字!'); | ||
| 648 | - return false; | ||
| 649 | - } | ||
| 650 | - if (addChefImge && | ||
| 651 | - _uploadImageProvider.firstImage.qiniuUrl == null) { | ||
| 652 | - Utils.showToast('请上传图片!'); | ||
| 653 | - return false; | ||
| 654 | - } | 1656 | + Column( |
| 1657 | + children: [ | ||
| 1658 | + Container( | ||
| 1659 | + padding: EdgeInsets.only(top: w(15)), | ||
| 1660 | + child: Row( | ||
| 1661 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 1662 | + children: [ | ||
| 1663 | + InkWell( | ||
| 1664 | + onTap: () { | ||
| 1665 | + if (!hasVedio) { | ||
| 1666 | + _openModalBottomSheet(context, data.length, | ||
| 1667 | + fileType: FileType.video); | ||
| 1668 | + } | ||
| 1669 | + }, | ||
| 1670 | + child: Container( | ||
| 1671 | + width: w(77), | ||
| 1672 | + height: w(34), | ||
| 1673 | + alignment: Alignment.center, | ||
| 1674 | + decoration: BoxDecoration( | ||
| 1675 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 1676 | + border: Border.all( | ||
| 1677 | + width: w(1), | ||
| 1678 | + color: hasVedio | ||
| 1679 | + ? MyColours.color_999999 | ||
| 1680 | + : MyColours.color_438E93)), | ||
| 1681 | + child: Text( | ||
| 1682 | + '+视频', | ||
| 1683 | + style: TextStyle( | ||
| 1684 | + color: hasVedio | ||
| 1685 | + ? MyColours.color_999999 | ||
| 1686 | + : MyColours.color_000000, | ||
| 1687 | + fontSize: font(14)), | ||
| 1688 | + ), | ||
| 1689 | + )), | ||
| 1690 | + HEmptyView(20), | ||
| 1691 | + InkWell( | ||
| 1692 | + onTap: () { | ||
| 1693 | + _openModalBottomSheet(context, data.length); | ||
| 1694 | + }, | ||
| 1695 | + child: Container( | ||
| 1696 | + width: w(77), | ||
| 1697 | + height: w(34), | ||
| 1698 | + alignment: Alignment.center, | ||
| 1699 | + decoration: BoxDecoration( | ||
| 1700 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 1701 | + border: Border.all( | ||
| 1702 | + width: w(1), | ||
| 1703 | + color: MyColours.color_438E93)), | ||
| 1704 | + child: Text( | ||
| 1705 | + '+图片', | ||
| 1706 | + style: TextStyle( | ||
| 1707 | + color: MyColours.color_000000, | ||
| 1708 | + fontSize: font(14)), | ||
| 1709 | + ), | ||
| 1710 | + )), | ||
| 1711 | + HEmptyView(20), | ||
| 1712 | + InkWell( | ||
| 1713 | + onTap: () { | ||
| 1714 | + AdditionModel additionModel1 = AdditionModel(); | ||
| 1715 | + // additionModel1.content = | ||
| 1716 | + // 'webenkjfkdfjakdfjaldfkjaldfjaldf'; | ||
| 1717 | + additionModel1.type = '2'; | ||
| 1718 | + // additionModel1.order = data.length; | ||
| 655 | 1719 | ||
| 656 | - if (addChefImge && | ||
| 657 | - _uploadImageProvider.firstImage.process < 1) { | ||
| 658 | - Utils.showToast('正在上传图片,请稍等'); | ||
| 659 | - return false; | ||
| 660 | - } | 1720 | + data.add(additionModel1); |
| 1721 | + setState(() {}); | ||
| 1722 | + }, | ||
| 1723 | + child: Container( | ||
| 1724 | + width: w(77), | ||
| 1725 | + height: w(34), | ||
| 1726 | + alignment: Alignment.center, | ||
| 1727 | + decoration: BoxDecoration( | ||
| 1728 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 1729 | + border: Border.all( | ||
| 1730 | + width: w(1), | ||
| 1731 | + color: MyColours.color_438E93)), | ||
| 1732 | + child: Text( | ||
| 1733 | + '+文字', | ||
| 1734 | + style: TextStyle( | ||
| 1735 | + color: MyColours.color_000000, | ||
| 1736 | + fontSize: font(14)), | ||
| 1737 | + ), | ||
| 1738 | + )), | ||
| 1739 | + ], | ||
| 1740 | + ), | ||
| 1741 | + ), | ||
| 1742 | + VEmptyView(24), | ||
| 1743 | + Text( | ||
| 1744 | + '注:\n1. 为了保证客户访问速度,只能有1个视频,时常不超过30秒\n2. 上下拖动可以调整展示顺序', | ||
| 1745 | + style: TextStyle( | ||
| 1746 | + height: 1.5, | ||
| 1747 | + color: MyColours.color_999999, | ||
| 1748 | + fontSize: font(12)), | ||
| 1749 | + ), | ||
| 1750 | + Container( | ||
| 1751 | + color: MyColours.color_ffffff, | ||
| 1752 | + padding: EdgeInsets.only( | ||
| 1753 | + left: w(45), right: w(45), top: w(13), bottom: w(25)), | ||
| 1754 | + child: RoundButton( | ||
| 1755 | + text: '保存', | ||
| 1756 | + gradientStart: MyColours.color_199095, | ||
| 1757 | + gradientEnd: MyColours.color_199095, | ||
| 1758 | + // borderColor: MyColours.color_999999, | ||
| 1759 | + radius: r(5), | ||
| 1760 | + fontSize: 34, | ||
| 1761 | + height: w(40), | ||
| 1762 | + isBold: true, | ||
| 1763 | + onPressed: () async { | ||
| 1764 | + FocusScope.of(context) | ||
| 1765 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 661 | 1766 | ||
| 662 | - // List<String> images = []; | ||
| 663 | - // if (_uploadImageProvider.storeImage1.qiniuUrl != null && | ||
| 664 | - // _uploadImageProvider.storeImage1.qiniuUrl != '') { | ||
| 665 | - // images.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 666 | - // } | ||
| 667 | - // if (_uploadImageProvider.storeImage2.qiniuUrl != null && | ||
| 668 | - // _uploadImageProvider.storeImage2.qiniuUrl != '') { | ||
| 669 | - // images.add(_uploadImageProvider.storeImage2.qiniuUrl); | ||
| 670 | - // } | ||
| 671 | - // if (_uploadImageProvider.storeImage3.qiniuUrl != null && | ||
| 672 | - // _uploadImageProvider.storeImage3.qiniuUrl != '') { | ||
| 673 | - // images.add(_uploadImageProvider.storeImage3.qiniuUrl); | ||
| 674 | - // } | ||
| 675 | - // if (_uploadImageProvider.storeImage3.qiniuUrl != null && | ||
| 676 | - // _uploadImageProvider.storeImage3.qiniuUrl != '') { | ||
| 677 | - // images.add(_uploadImageProvider.storeImage3.qiniuUrl); | ||
| 678 | - // } | ||
| 679 | - // if (images.length == 0) { | ||
| 680 | - // Utils.showToast('请至少上传一张图片!'); | ||
| 681 | - // return false; | ||
| 682 | - // } | ||
| 683 | - | ||
| 684 | - //接口 | ||
| 685 | - Map chefData = { | ||
| 686 | - 'introduce': chefIntroduceC.text, | ||
| 687 | - 'image': _uploadImageProvider.firstImage.qiniuUrl, | ||
| 688 | - 'is_introduce': addChefIntroduce ? '1' : '0', | ||
| 689 | - 'is_images': addChefImge ? '1' : '0', | ||
| 690 | - 'is_above': addAbove ? '1' : '0' | ||
| 691 | - }; | ||
| 692 | - | ||
| 693 | - Map<String, String> params = { | ||
| 694 | - 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 695 | - .user | ||
| 696 | - .sellerid, | ||
| 697 | - 'chef': json.encode(chefData) | ||
| 698 | - }; | ||
| 699 | - | ||
| 700 | - bool success = await _marketingCenterProvider | ||
| 701 | - .setSellerTemplateConf(context, params, | ||
| 702 | - showLoading: true); | ||
| 703 | - if (success) { | ||
| 704 | - // imgAll和images 比较,挑出不一样的,删除七牛云 | ||
| 705 | - Set<String> difference = Set.from(imgAll) | ||
| 706 | - ..removeAll( | ||
| 707 | - [_uploadImageProvider.firstImage.qiniuUrl]); | ||
| 708 | - List<String> differenceList = | ||
| 709 | - difference.toList(); //需要删除的图片 | ||
| 710 | - if (differenceList.length > 0) { | ||
| 711 | - String delImgs = | ||
| 712 | - Utils.listToStringEnglish(differenceList); | ||
| 713 | - | ||
| 714 | - _uploadImageProvider.deleteImg(context, delImgs, | ||
| 715 | - needToast: false); | ||
| 716 | - } | ||
| 717 | - Utils.showToast('保存成功'); | ||
| 718 | - if (Navigator.canPop(context)) { | ||
| 719 | - Navigator.pop(context); | ||
| 720 | - } | ||
| 721 | - } | ||
| 722 | - }, | ||
| 723 | - ), | 1767 | + if (titleC.text.trim().length == 0) { |
| 1768 | + Utils.showToast('请输入标题名称!'); | ||
| 1769 | + return false; | ||
| 1770 | + } | ||
| 1771 | + | ||
| 1772 | + if (addStoreIntroduce && data.length == 0) { | ||
| 1773 | + Utils.showToast('请录入主厨介绍!'); | ||
| 1774 | + return false; | ||
| 1775 | + } | ||
| 1776 | + | ||
| 1777 | + print(data); | ||
| 1778 | + | ||
| 1779 | + bool can = true; | ||
| 1780 | + innerloop: | ||
| 1781 | + for (AdditionModel item in data) { | ||
| 1782 | + if (item.type == '1' && item.image.process < 1) { | ||
| 1783 | + Utils.showToast('正在上传,请稍等'); | ||
| 1784 | + // return false; | ||
| 1785 | + can = false; | ||
| 1786 | + break innerloop; | ||
| 1787 | + } | ||
| 1788 | + } | ||
| 1789 | + data.removeWhere((element) => | ||
| 1790 | + element.type == '2' && | ||
| 1791 | + (element.infoC.text.trim() == '' || | ||
| 1792 | + element.infoC.text == null)); | ||
| 1793 | + if (can) { | ||
| 1794 | + List temp = []; | ||
| 1795 | + List<String> delImgs = []; | ||
| 1796 | + // String text = ''; | ||
| 1797 | + for (int i = 0; i < data.length; i++) { | ||
| 1798 | + AdditionModel element = data[i]; | ||
| 1799 | + temp.add({ | ||
| 1800 | + 'type': element.type, | ||
| 1801 | + 'content': element.type == '2' | ||
| 1802 | + ? element.infoC.text | ||
| 1803 | + : element.image.qiniuUrl, | ||
| 1804 | + 'duration': element.type == '3' | ||
| 1805 | + ? element.image.duration | ||
| 1806 | + : '' | ||
| 1807 | + }); | ||
| 1808 | + if (element.type == '2') { | ||
| 1809 | + // text += '${element.infoC.text}\n'; | ||
| 1810 | + } else { | ||
| 1811 | + delImgs.add(element.image.qiniuUrl); | ||
| 1812 | + } | ||
| 1813 | + } | ||
| 1814 | + | ||
| 1815 | + // List<String> images = []; | ||
| 1816 | + // for (int i = 0; i < data.length; i++) { | ||
| 1817 | + // ChangeModel imgModel = data[i]; | ||
| 1818 | + // if (imgModel.image.qiniuUrl != null && | ||
| 1819 | + // imgModel.image.qiniuUrl != '') { | ||
| 1820 | + // images.add(imgModel.image.qiniuUrl); | ||
| 1821 | + // } | ||
| 1822 | + // } | ||
| 1823 | + | ||
| 1824 | + // if (images.length == 0) { | ||
| 1825 | + // Utils.showToast('请至少上传一张图片!'); | ||
| 1826 | + // return false; | ||
| 1827 | + // } | ||
| 1828 | + // if (text.trim().length > 0) { | ||
| 1829 | + // //同步店铺信息 | ||
| 1830 | + // _setSellerInfoById(text); //同步店铺简介 | ||
| 1831 | + // } | ||
| 1832 | + | ||
| 1833 | + //接口 | ||
| 1834 | + Map storeData = { | ||
| 1835 | + // 'style': currIndex.toString(), | ||
| 1836 | + // 'seller_name': sellername, | ||
| 1837 | + 'content': jsonEncode(temp), | ||
| 1838 | + 'title': titleC.text, | ||
| 1839 | + // 'images': json.encode(images), | ||
| 1840 | + 'is_introduce_all': | ||
| 1841 | + addStoreIntroduce ? '1' : '0', | ||
| 1842 | + // 'is_images': addStoreImge ? '1' : '0', | ||
| 1843 | + // 'is_above': addAbove ? '1' : '0' | ||
| 1844 | + }; | ||
| 1845 | + | ||
| 1846 | + Map<String, String> params = { | ||
| 1847 | + 'sid': Provider.of<UserModel>(context, | ||
| 1848 | + listen: false) | ||
| 1849 | + .user | ||
| 1850 | + .sellerid, | ||
| 1851 | + 'chef': json.encode(storeData) | ||
| 1852 | + }; | ||
| 1853 | + | ||
| 1854 | + bool success = await marketingCenterProvider | ||
| 1855 | + .setSellerTemplateConf(context, params, | ||
| 1856 | + showLoading: true); | ||
| 1857 | + if (success) { | ||
| 1858 | + // await VideoUtils.clearTemporaryDirectory(); | ||
| 1859 | + // imgAll和images 比较,挑出不一样的,删除七牛云 | ||
| 1860 | + Set<String> difference = Set.from(imgAll) | ||
| 1861 | + ..removeAll(delImgs); | ||
| 1862 | + List<String> differenceList = | ||
| 1863 | + difference.toList(); //需要删除的图片 | ||
| 1864 | + if (differenceList.length > 0) { | ||
| 1865 | + String delImgs = | ||
| 1866 | + Utils.listToStringEnglish(differenceList); | ||
| 1867 | + | ||
| 1868 | + _uploadImageProvider.deleteImg( | ||
| 1869 | + context, delImgs, | ||
| 1870 | + needToast: false); | ||
| 1871 | + } | ||
| 1872 | + | ||
| 1873 | + if (Navigator.canPop(context)) { | ||
| 1874 | + Navigator.pop(context); | ||
| 1875 | + } | ||
| 1876 | + } | ||
| 1877 | + } | ||
| 1878 | + }), | ||
| 1879 | + ) | ||
| 1880 | + ], | ||
| 724 | ) | 1881 | ) |
| 725 | ], | 1882 | ], |
| 726 | ))); | 1883 | ))); |
| 1 | +// import 'dart:convert'; | ||
| 2 | +// import 'dart:io'; | ||
| 3 | + | ||
| 4 | +// import 'package:flutter/material.dart'; | ||
| 5 | +// import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | ||
| 6 | +// import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 7 | +// import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 8 | +// import 'package:image_picker/image_picker.dart'; | ||
| 9 | +// import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 10 | +// import 'package:permission_handler/permission_handler.dart'; | ||
| 11 | +// import 'package:provider/provider.dart'; | ||
| 12 | + | ||
| 13 | +// import '../../../../app.dart'; | ||
| 14 | +// import '../../../../models/upload_img_model.dart'; | ||
| 15 | +// import '../../../../provider/marketing_center_provider.dart'; | ||
| 16 | +// import '../../../../provider/upload_img_provider.dart'; | ||
| 17 | +// import '../../../../provider/user_model.dart'; | ||
| 18 | +// import '../../../../res/colors.dart'; | ||
| 19 | +// import '../../../../utils/dialog_util.dart'; | ||
| 20 | +// import '../../../../utils/screen_util.dart'; | ||
| 21 | +// import '../../../../utils/upload_image_util.dart'; | ||
| 22 | +// import '../../../../utils/utils.dart'; | ||
| 23 | +// import '../../../../widgets/MyDivider.dart'; | ||
| 24 | +// import '../../../../widgets/common_button_flat.dart'; | ||
| 25 | +// import '../../../../widgets/round_button.dart'; | ||
| 26 | +// import '../../../../widgets/system_app_bar.dart'; | ||
| 27 | + | ||
| 28 | +// /*** | ||
| 29 | +// * | ||
| 30 | +// * | ||
| 31 | +// * 主厨介绍 | ||
| 32 | +// */ | ||
| 33 | + | ||
| 34 | +// class ChefIntroducePage extends StatefulWidget { | ||
| 35 | +// ChefIntroducePage({Key key}) : super(key: key); | ||
| 36 | + | ||
| 37 | +// @override | ||
| 38 | +// _ChefIntroducePageState createState() => _ChefIntroducePageState(); | ||
| 39 | +// } | ||
| 40 | + | ||
| 41 | +// class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 42 | +// // int currIndex = 0; //样式按钮默认选中第一个 | ||
| 43 | + | ||
| 44 | +// // String sellername; //店铺名称 | ||
| 45 | + | ||
| 46 | +// TextEditingController chefIntroduceC = TextEditingController(); | ||
| 47 | +// FocusNode chefIntroduceNode = FocusNode(); | ||
| 48 | + | ||
| 49 | +// TextEditingController chefNameC = TextEditingController(); | ||
| 50 | +// FocusNode chefNameNode = FocusNode(); | ||
| 51 | + | ||
| 52 | +// final picker = ImagePicker(); | ||
| 53 | + | ||
| 54 | +// UploadImageProvider _uploadImageProvider; | ||
| 55 | +// MarketingCenterProvider _marketingCenterProvider; | ||
| 56 | +// bool addChefIntroduce = false; | ||
| 57 | +// bool addChefImge = false; | ||
| 58 | +// bool addAbove = false; | ||
| 59 | + | ||
| 60 | +// List<String> imgAll = []; | ||
| 61 | + | ||
| 62 | +// @override | ||
| 63 | +// void initState() { | ||
| 64 | +// super.initState(); | ||
| 65 | + | ||
| 66 | +// WidgetsBinding.instance.addPostFrameCallback((_) async { | ||
| 67 | +// // UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 68 | +// // sellername = userModel.user.sellername; | ||
| 69 | +// // setState(() {}); | ||
| 70 | +// _getQiniuInfo(); | ||
| 71 | +// await getSellerTemplateConf(); | ||
| 72 | +// }); | ||
| 73 | +// } | ||
| 74 | + | ||
| 75 | +// @override | ||
| 76 | +// void dispose() { | ||
| 77 | +// _uploadImageProvider.firstImage = UploadImgModel(); | ||
| 78 | +// super.dispose(); | ||
| 79 | +// } | ||
| 80 | + | ||
| 81 | +// ///获取七牛云token | ||
| 82 | +// /// | ||
| 83 | +// _getQiniuInfo() async { | ||
| 84 | +// await _uploadImageProvider.getQiniuInfo(context, {}); | ||
| 85 | +// } | ||
| 86 | + | ||
| 87 | +// getSellerTemplateConf() async { | ||
| 88 | +// bool success = | ||
| 89 | +// await _marketingCenterProvider.getSellerTemplateConf(context); | ||
| 90 | +// if (success && _marketingCenterProvider.markDataModel.chef != null) { | ||
| 91 | +// // currIndex = int.parse(_marketingCenterProvider.markDataModel.chef.style); | ||
| 92 | + | ||
| 93 | +// _uploadImageProvider.firstImage.qiniuUrl = | ||
| 94 | +// _marketingCenterProvider.markDataModel.chef.image ?? null; | ||
| 95 | + | ||
| 96 | +// if (_uploadImageProvider.firstImage.qiniuUrl != null) { | ||
| 97 | +// imgAll.add(_uploadImageProvider.firstImage.qiniuUrl); | ||
| 98 | +// } | ||
| 99 | + | ||
| 100 | +// _uploadImageProvider.firstImage.process = | ||
| 101 | +// _uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 102 | +// _uploadImageProvider.firstImage.qiniuUrl != '' | ||
| 103 | +// ? 1 | ||
| 104 | +// : null; | ||
| 105 | + | ||
| 106 | +// chefNameC.text = _marketingCenterProvider.markDataModel.chef.chefName; | ||
| 107 | +// chefIntroduceC.text = | ||
| 108 | +// _marketingCenterProvider.markDataModel.chef.introduce; | ||
| 109 | +// addChefIntroduce = | ||
| 110 | +// _marketingCenterProvider.markDataModel.chef.isIntroduce == '1' | ||
| 111 | +// ? true | ||
| 112 | +// : false; | ||
| 113 | +// addChefImge = _marketingCenterProvider.markDataModel.chef.isImages == '1' | ||
| 114 | +// ? true | ||
| 115 | +// : false; | ||
| 116 | +// addAbove = _marketingCenterProvider.markDataModel.chef.isAbove == '1' | ||
| 117 | +// ? true | ||
| 118 | +// : false; | ||
| 119 | + | ||
| 120 | +// setState(() {}); | ||
| 121 | +// } | ||
| 122 | +// } | ||
| 123 | + | ||
| 124 | +// ///#相机拍照,单图选择 | ||
| 125 | +// Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { | ||
| 126 | +// final pickedFile = await picker.pickImage(source: imageSource); | ||
| 127 | +// if (pickedFile != null) { | ||
| 128 | +// File compressedFile = await FlutterNativeImage.compressImage( | ||
| 129 | +// pickedFile.path, | ||
| 130 | +// quality: 50, | ||
| 131 | +// percentage: 50); | ||
| 132 | +// setState(() { | ||
| 133 | +// if (pickedFile != null) { | ||
| 134 | +// imgModel.file = File(pickedFile.path); | ||
| 135 | +// imgModel.process = 0.01; | ||
| 136 | +// } else { | ||
| 137 | +// print('No image selected.'); | ||
| 138 | +// } | ||
| 139 | +// }); | ||
| 140 | +// if (pickedFile != null) { | ||
| 141 | +// // if (title == '头像') { | ||
| 142 | +// // _uploadImageProvider.imgSizeTouxiang = 76; | ||
| 143 | +// // _uploadImageProvider.touxiang.qiniuUrl = null; | ||
| 144 | +// // } else { | ||
| 145 | +// // _uploadImageProvider.imgSizeErweima = 76; | ||
| 146 | +// _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 147 | +// // } | ||
| 148 | +// bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 149 | +// File file = File(pickedFile.path); | ||
| 150 | +// if (need) { | ||
| 151 | +// file = File(compressedFile.absolute.path); | ||
| 152 | +// } | ||
| 153 | +// UploadImageUtil() | ||
| 154 | +// .startUploadOnly(context, file, 4, true, _uploadImageProvider, () { | ||
| 155 | +// imgAll.add(_uploadImageProvider.firstImage.qiniuUrl); | ||
| 156 | +// }); | ||
| 157 | +// } | ||
| 158 | +// } | ||
| 159 | +// } | ||
| 160 | + | ||
| 161 | +// ///添加图片UI弹出 | ||
| 162 | +// Future _openModalBottomSheet(context) async { | ||
| 163 | +// final option = await showModalBottomSheet( | ||
| 164 | +// context: context, | ||
| 165 | +// backgroundColor: Colors.transparent, | ||
| 166 | +// isDismissible: false, | ||
| 167 | +// builder: (BuildContext context) { | ||
| 168 | +// return Container( | ||
| 169 | +// // height: ScreenUtil().setWidth(180 * 2), | ||
| 170 | +// decoration: BoxDecoration( | ||
| 171 | +// color: MyColours.color_ffffff, | ||
| 172 | +// borderRadius: BorderRadius.only( | ||
| 173 | +// topLeft: Radius.circular(ScreenUtil().setWidth(24)), | ||
| 174 | +// topRight: Radius.circular(ScreenUtil().setWidth(24)))), | ||
| 175 | +// child: Column( | ||
| 176 | +// mainAxisSize: MainAxisSize.min, | ||
| 177 | +// children: <Widget>[ | ||
| 178 | +// InkWell( | ||
| 179 | +// onTap: () { | ||
| 180 | +// // Utils.getPickPermission(context, () { | ||
| 181 | +// // _getFromPictureOrCamera( | ||
| 182 | +// // _uploadImageProvider.firstImage, ImageSource.camera); | ||
| 183 | + | ||
| 184 | +// // Navigator.pop(context); | ||
| 185 | +// // }, Permission.camera); | ||
| 186 | +// Utils.getPickPermission(context, () { | ||
| 187 | +// _getFromPictureOrCamera( | ||
| 188 | +// _uploadImageProvider.firstImage, ImageSource.camera); | ||
| 189 | +// if (Navigator.canPop(context)) { | ||
| 190 | +// Navigator.pop(context); | ||
| 191 | +// } | ||
| 192 | +// }, | ||
| 193 | +// Platform.isAndroid | ||
| 194 | +// ? Permission.storage | ||
| 195 | +// : Permission.photos); | ||
| 196 | +// }, | ||
| 197 | +// child: Container( | ||
| 198 | +// width: double.infinity, | ||
| 199 | +// height: ScreenUtil().setWidth(58 * 2), | ||
| 200 | +// child: Center( | ||
| 201 | +// child: Text( | ||
| 202 | +// '拍摄', | ||
| 203 | +// style: TextStyle( | ||
| 204 | +// fontSize: ScreenUtil().setSp(32), | ||
| 205 | +// color: MyColours.color_353535, | ||
| 206 | +// fontWeight: FontWeight.bold), | ||
| 207 | +// ), | ||
| 208 | +// )), | ||
| 209 | +// ), | ||
| 210 | +// MyDivider( | ||
| 211 | +// double.infinity, | ||
| 212 | +// ScreenUtil().setWidth(2), | ||
| 213 | +// color: MyColours.color_EEEEEE, | ||
| 214 | +// ), | ||
| 215 | +// InkWell( | ||
| 216 | +// onTap: () { | ||
| 217 | +// // Utils.getPickPermission(context, () { | ||
| 218 | +// // // pickAsset(RequestType.image); | ||
| 219 | +// // _getFromPictureOrCamera( | ||
| 220 | +// // _uploadImageProvider.firstImage, ImageSource.gallery); | ||
| 221 | +// // Navigator.pop(context); | ||
| 222 | +// // }, | ||
| 223 | +// // Platform.isAndroid | ||
| 224 | +// // ? Permission.storage | ||
| 225 | +// // : Permission.photos); | ||
| 226 | +// Utils.getPickPermission(context, () { | ||
| 227 | +// _getFromPictureOrCamera( | ||
| 228 | +// _uploadImageProvider.firstImage, ImageSource.gallery); | ||
| 229 | +// if (Navigator.canPop(context)) { | ||
| 230 | +// Navigator.pop(context); | ||
| 231 | +// } | ||
| 232 | +// }, | ||
| 233 | +// Platform.isAndroid | ||
| 234 | +// ? Permission.storage | ||
| 235 | +// : Permission.photos); | ||
| 236 | +// }, | ||
| 237 | +// child: Container( | ||
| 238 | +// width: double.infinity, | ||
| 239 | +// height: ScreenUtil().setWidth(58 * 2), | ||
| 240 | +// child: Center( | ||
| 241 | +// child: Text( | ||
| 242 | +// '从相册选择', | ||
| 243 | +// style: TextStyle( | ||
| 244 | +// fontSize: ScreenUtil().setSp(32), | ||
| 245 | +// color: MyColours.color_353535, | ||
| 246 | +// fontWeight: FontWeight.bold), | ||
| 247 | +// ), | ||
| 248 | +// )), | ||
| 249 | +// ), | ||
| 250 | +// MyDivider( | ||
| 251 | +// double.infinity, | ||
| 252 | +// ScreenUtil().setWidth(10), | ||
| 253 | +// color: MyColours.color_EEEEEE, | ||
| 254 | +// ), | ||
| 255 | +// InkWell( | ||
| 256 | +// onTap: () { | ||
| 257 | +// if (Navigator.canPop(context)) { | ||
| 258 | +// Navigator.pop(context, '取消'); | ||
| 259 | +// } | ||
| 260 | +// }, | ||
| 261 | +// child: Container( | ||
| 262 | +// width: double.infinity, | ||
| 263 | +// height: ScreenUtil().setWidth(58 * 2), | ||
| 264 | +// child: Center( | ||
| 265 | +// child: Text( | ||
| 266 | +// '取消', | ||
| 267 | +// style: TextStyle( | ||
| 268 | +// fontSize: ScreenUtil().setSp(32), | ||
| 269 | +// color: MyColours.color_353535, | ||
| 270 | +// fontWeight: FontWeight.bold), | ||
| 271 | +// ), | ||
| 272 | +// ))) | ||
| 273 | +// ], | ||
| 274 | +// ), | ||
| 275 | +// ); | ||
| 276 | +// }); | ||
| 277 | +// } | ||
| 278 | + | ||
| 279 | +// Widget _uploadImage({EdgeInsets padding = EdgeInsets.zero}) { | ||
| 280 | +// return _uploadImageProvider.firstImage.file != null || | ||
| 281 | +// (_uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 282 | +// _uploadImageProvider.firstImage.qiniuUrl != '') | ||
| 283 | +// ? InkWell( | ||
| 284 | +// onTap: () { | ||
| 285 | +// double process; | ||
| 286 | +// String qiniuUrl; | ||
| 287 | +// List<String> tempList = []; | ||
| 288 | +// // if (title == '头像') { | ||
| 289 | +// process = _uploadImageProvider.firstImage.process; | ||
| 290 | +// qiniuUrl = _uploadImageProvider.firstImage.qiniuUrl; | ||
| 291 | +// // } else { | ||
| 292 | +// // process = _uploadImageProvider.erweima.process; | ||
| 293 | +// // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 294 | +// // } | ||
| 295 | + | ||
| 296 | +// if (qiniuUrl != null && qiniuUrl != '') { | ||
| 297 | +// // tempList.add(qiniuUrl); | ||
| 298 | + | ||
| 299 | +// // ///没有上传完成的不可以点击 | ||
| 300 | +// // _showPhotoView(context, 0, tempList); | ||
| 301 | + | ||
| 302 | +// // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 303 | +// // _uploadImageProvider.firstImage.process = 0; | ||
| 304 | +// // setState(() {}); | ||
| 305 | +// FocusScope.of(context).requestFocus(FocusNode()); | ||
| 306 | +// _openModalBottomSheet(context); | ||
| 307 | +// // Utils.getPickPermission(context, () { | ||
| 308 | +// // _getFromPictureOrCamera( | ||
| 309 | +// // _uploadImageProvider.firstImage, | ||
| 310 | +// // ImageSource.gallery); | ||
| 311 | +// // }, | ||
| 312 | +// // Platform.isAndroid | ||
| 313 | +// // ? Permission.storage | ||
| 314 | +// // : Permission.photos); | ||
| 315 | +// } | ||
| 316 | +// }, | ||
| 317 | +// child: Stack(alignment: Alignment.bottomCenter, children: [ | ||
| 318 | +// Stack(clipBehavior: Clip.none, children: [ | ||
| 319 | +// _uploadImageProvider.firstImage.qiniuUrl != null && | ||
| 320 | +// _uploadImageProvider.firstImage.qiniuUrl != '' | ||
| 321 | +// ? Center( | ||
| 322 | +// child: Image.network( | ||
| 323 | +// _uploadImageProvider.firstImage.qiniuUrl, | ||
| 324 | +// fit: BoxFit.contain, | ||
| 325 | +// // width: double.infinity, | ||
| 326 | +// // width: ScreenUtil() | ||
| 327 | +// // .setWidth(imgSize * 2), | ||
| 328 | +// // height: ScreenUtil().setWidth( | ||
| 329 | +// // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 330 | +// )) | ||
| 331 | +// : Center( | ||
| 332 | +// child: Image.file( | ||
| 333 | +// _uploadImageProvider.firstImage.file, | ||
| 334 | +// fit: BoxFit.contain, | ||
| 335 | +// // width: double.infinity, | ||
| 336 | +// // width: ScreenUtil() | ||
| 337 | +// // .setWidth(imgSize * 2), | ||
| 338 | +// // height: ScreenUtil().setWidth( | ||
| 339 | +// // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 340 | +// )), | ||
| 341 | +// Positioned( | ||
| 342 | +// left: 0, | ||
| 343 | +// top: 0, | ||
| 344 | +// right: padding.right, | ||
| 345 | +// child: (_uploadImageProvider.firstImage.file != null) && | ||
| 346 | +// _uploadImageProvider.firstImage.process != 1 && | ||
| 347 | +// _uploadImageProvider.firstImage.process != 0.01 | ||
| 348 | +// ? Container( | ||
| 349 | +// width: ScreenUtil().screenWidth, | ||
| 350 | +// height: w(_uploadImageProvider.imgSizefirstImage), | ||
| 351 | +// color: MyColours.color_4D000000, | ||
| 352 | +// child: Center( | ||
| 353 | +// child: Text('上传中', | ||
| 354 | +// style: | ||
| 355 | +// TextStyle(color: MyColours.color_F8F9FD)), | ||
| 356 | +// ), | ||
| 357 | +// ) | ||
| 358 | +// : Container()), | ||
| 359 | +// if (_uploadImageProvider.firstImage.process == 1) | ||
| 360 | +// Positioned( | ||
| 361 | +// top: 0, | ||
| 362 | +// right: 0, | ||
| 363 | +// child: GestureDetector( | ||
| 364 | +// child: Image.asset( | ||
| 365 | +// Utils.getImgPath("delete"), | ||
| 366 | +// width: ScreenUtil().setWidth(40), | ||
| 367 | +// height: ScreenUtil().setWidth(40), | ||
| 368 | +// ), | ||
| 369 | +// onTap: () { | ||
| 370 | +// //已经传到服务器,弹提醒窗口,是否删除 | ||
| 371 | +// //修改之前有内容,则弹框 | ||
| 372 | +// DialogUtil.cupertinoAlertDialog(context, | ||
| 373 | +// title: "", content: "是否确定删除该照片?", lCallback: () { | ||
| 374 | +// print("取消"); | ||
| 375 | +// }, rCallback: () { | ||
| 376 | +// _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 377 | +// _uploadImageProvider.firstImage.file = null; | ||
| 378 | +// _uploadImageProvider.firstImage.isUpload = false; | ||
| 379 | +// _uploadImageProvider.firstImage.process = 0.01; | ||
| 380 | +// setState(() {}); | ||
| 381 | +// }); | ||
| 382 | +// }, | ||
| 383 | +// )) | ||
| 384 | +// ]), | ||
| 385 | +// _uploadImageProvider.firstImage.process == 1 | ||
| 386 | +// ? Container( | ||
| 387 | +// width: w(150), | ||
| 388 | +// height: w(30), | ||
| 389 | +// color: MyColours.color_4D000000, | ||
| 390 | +// alignment: Alignment.center, | ||
| 391 | +// margin: padding, | ||
| 392 | +// child: Text( | ||
| 393 | +// '点击图片可以更换', | ||
| 394 | +// style: TextStyle( | ||
| 395 | +// color: MyColours.color_F8F9FD, | ||
| 396 | +// fontSize: font(14), | ||
| 397 | +// fontWeight: FontWeight.bold), | ||
| 398 | +// )) | ||
| 399 | +// : SizedBox(), | ||
| 400 | +// ])) | ||
| 401 | +// : InkWell( | ||
| 402 | +// onTap: () { | ||
| 403 | +// // double process; | ||
| 404 | +// // String qiniuUrl; | ||
| 405 | +// // List<String> tempList = []; | ||
| 406 | +// // if (title == '头像') { | ||
| 407 | +// // process = _uploadImageProvider.touxiang.process; | ||
| 408 | +// // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl; | ||
| 409 | +// // } else { | ||
| 410 | +// // process = _uploadImageProvider.erweima.process; | ||
| 411 | +// // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 412 | +// // } | ||
| 413 | + | ||
| 414 | +// // if (qiniuUrl != null && qiniuUrl != '') { | ||
| 415 | +// // tempList.add(qiniuUrl); | ||
| 416 | + | ||
| 417 | +// // ///没有上传完成的不可以点击 | ||
| 418 | +// // _showPhotoView(context, 0, tempList); | ||
| 419 | +// // } else { | ||
| 420 | +// // Utils.getPickPermission(context, () { | ||
| 421 | +// // _getFromPictureOrCamera( | ||
| 422 | +// // _uploadImageProvider.firstImage, ImageSource.gallery); | ||
| 423 | +// // }, Platform.isAndroid ? Permission.storage : Permission.photos); | ||
| 424 | +// FocusScope.of(context).requestFocus(FocusNode()); | ||
| 425 | +// _openModalBottomSheet(context); | ||
| 426 | +// }, | ||
| 427 | +// child: Container( | ||
| 428 | +// color: MyColours.color_d9d9d9, | ||
| 429 | +// width: double.infinity, | ||
| 430 | +// height: w(_uploadImageProvider.imgSizefirstImage), | ||
| 431 | +// margin: padding, | ||
| 432 | +// child: Column( | ||
| 433 | +// mainAxisAlignment: MainAxisAlignment.center, | ||
| 434 | +// children: [ | ||
| 435 | +// // VEmptyView(80), | ||
| 436 | +// Image.asset( | ||
| 437 | +// Utils.getImgPath('add_img'), | ||
| 438 | +// width: w(63), | ||
| 439 | +// ), | ||
| 440 | +// VEmptyView(28), | ||
| 441 | +// Container( | ||
| 442 | +// width: w(139), | ||
| 443 | +// height: w(60), | ||
| 444 | +// child: Text( | ||
| 445 | +// '点击上传照片\n为了更好的效果\n建议上传4:3照片', | ||
| 446 | +// textAlign: TextAlign.center, | ||
| 447 | +// style: TextStyle( | ||
| 448 | +// height: 1.4, | ||
| 449 | +// color: MyColours.color_ffffff, | ||
| 450 | +// fontSize: font(14), | ||
| 451 | +// fontWeight: FontWeight.bold), | ||
| 452 | +// )) | ||
| 453 | +// ], | ||
| 454 | +// ), | ||
| 455 | +// )); | ||
| 456 | +// } | ||
| 457 | + | ||
| 458 | +// ///无介绍 | ||
| 459 | +// Widget _noTextWidget() { | ||
| 460 | +// return SizedBox(); | ||
| 461 | +// // return Column( | ||
| 462 | +// // children: [ | ||
| 463 | +// // _uploadImage(), | ||
| 464 | +// // VEmptyView(18), | ||
| 465 | +// // ], | ||
| 466 | +// // ); | ||
| 467 | +// } | ||
| 468 | + | ||
| 469 | +// ///图文分开 | ||
| 470 | +// Widget _separateWidget() { | ||
| 471 | +// return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ | ||
| 472 | +// // _introduceWidget(EdgeInsets.all(w(15)), | ||
| 473 | +// // boxDecoration: BoxDecoration(color: MyColours.color_ffffff)), | ||
| 474 | +// // VEmptyView(18), | ||
| 475 | +// _uploadImage(), | ||
| 476 | +// ]); | ||
| 477 | +// } | ||
| 478 | + | ||
| 479 | +// Widget _item(String title, {bool select, GestureTapCallback onTap}) { | ||
| 480 | +// return InkWell( | ||
| 481 | +// onTap: onTap, | ||
| 482 | +// child: Container( | ||
| 483 | +// decoration: BoxDecoration( | ||
| 484 | +// border: Border( | ||
| 485 | +// bottom: BorderSide( | ||
| 486 | +// color: MyColours.color_E7E7E7, width: w(0.5)))), | ||
| 487 | +// margin: EdgeInsets.only(left: w(16)), | ||
| 488 | +// padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), | ||
| 489 | +// child: Row( | ||
| 490 | +// children: [ | ||
| 491 | +// Text( | ||
| 492 | +// title, | ||
| 493 | +// style: TextStyle( | ||
| 494 | +// color: MyColours.color_515151, | ||
| 495 | +// fontSize: ScreenUtil().setWidth(32)), | ||
| 496 | +// ), | ||
| 497 | +// Spacer(), | ||
| 498 | +// Container( | ||
| 499 | +// padding: | ||
| 500 | +// EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)), | ||
| 501 | +// child: Image.asset( | ||
| 502 | +// Utils.getImgPath(select ? 'swich_on' : 'swich_off'), | ||
| 503 | +// width: w(44), | ||
| 504 | +// ), | ||
| 505 | +// ) | ||
| 506 | +// ], | ||
| 507 | +// ))); | ||
| 508 | +// } | ||
| 509 | + | ||
| 510 | +// @override | ||
| 511 | +// Widget build(BuildContext context) { | ||
| 512 | +// _uploadImageProvider = | ||
| 513 | +// Provider.of<UploadImageProvider>(context, listen: true); | ||
| 514 | + | ||
| 515 | +// _marketingCenterProvider = | ||
| 516 | +// Provider.of<MarketingCenterProvider>(context, listen: true); | ||
| 517 | +// return KeyboardDismissOnTap( | ||
| 518 | +// child: Scaffold( | ||
| 519 | +// backgroundColor: MyColours.color_ffffff, | ||
| 520 | +// appBar: SystemAppBar( | ||
| 521 | +// '主厨介绍', | ||
| 522 | +// onTap: () { | ||
| 523 | +// if (Navigator.canPop(context)) { | ||
| 524 | +// Navigator.pop(context); | ||
| 525 | +// } | ||
| 526 | +// }, | ||
| 527 | +// ), | ||
| 528 | +// body: Column( | ||
| 529 | +// children: [ | ||
| 530 | +// Expanded( | ||
| 531 | +// child: SingleChildScrollView( | ||
| 532 | +// child: Column( | ||
| 533 | +// children: [ | ||
| 534 | +// // _selectBtnWidget(), | ||
| 535 | +// // VEmptyView(24), | ||
| 536 | +// // Container( | ||
| 537 | +// // alignment: Alignment.centerLeft, | ||
| 538 | +// // padding: EdgeInsets.only(left: w(16)), | ||
| 539 | +// // height: w(48), | ||
| 540 | +// // child: Text( | ||
| 541 | +// // '效果预览', | ||
| 542 | +// // style: TextStyle( | ||
| 543 | +// // fontSize: font(16), | ||
| 544 | +// // color: MyColours.color_515151), | ||
| 545 | +// // ), | ||
| 546 | +// // ), | ||
| 547 | +// // VEmptyView(24), | ||
| 548 | +// _item('预订安排通知中附加主厨文字介绍', select: addChefIntroduce, | ||
| 549 | +// onTap: () { | ||
| 550 | +// setState(() { | ||
| 551 | +// addChefIntroduce = !addChefIntroduce; | ||
| 552 | +// }); | ||
| 553 | +// }), | ||
| 554 | + | ||
| 555 | +// VEmptyView(24), | ||
| 556 | +// //输入框 | ||
| 557 | +// Container( | ||
| 558 | +// width: double.infinity, | ||
| 559 | +// margin: EdgeInsets.symmetric( | ||
| 560 | +// horizontal: ScreenUtil().setWidth(40)), | ||
| 561 | +// padding: EdgeInsets.symmetric( | ||
| 562 | +// horizontal: ScreenUtil().setWidth(40), | ||
| 563 | +// vertical: ScreenUtil().setWidth(20)), | ||
| 564 | +// alignment: Alignment.topLeft, | ||
| 565 | +// decoration: BoxDecoration( | ||
| 566 | +// color: MyColours.color_ffffff, | ||
| 567 | +// border: Border.all( | ||
| 568 | +// color: MyColours.color_DBDBDB, | ||
| 569 | +// width: ScreenUtil().setWidth(2)), | ||
| 570 | +// borderRadius: BorderRadius.circular( | ||
| 571 | +// ScreenUtil().setWidth(20))), | ||
| 572 | +// child: TextField( | ||
| 573 | +// controller: chefIntroduceC, | ||
| 574 | +// focusNode: chefIntroduceNode, | ||
| 575 | +// style: TextStyle( | ||
| 576 | +// color: MyColours.color_515151, | ||
| 577 | +// fontSize: ScreenUtil().setSp(28), | ||
| 578 | +// textBaseline: TextBaseline.alphabetic), | ||
| 579 | +// textAlignVertical: TextAlignVertical.center, | ||
| 580 | +// maxLines: 5, | ||
| 581 | +// maxLength: 100, | ||
| 582 | +// decoration: InputDecoration( | ||
| 583 | +// hintText: "点击录入餐厅介绍文字信息,最多100个汉字。", | ||
| 584 | +// hintStyle: TextStyle( | ||
| 585 | +// color: MyColours.color_999999, | ||
| 586 | +// fontSize: ScreenUtil().setSp(28), | ||
| 587 | +// ), | ||
| 588 | +// contentPadding: EdgeInsets.zero, | ||
| 589 | +// border: OutlineInputBorder( | ||
| 590 | +// borderSide: BorderSide.none), | ||
| 591 | +// ), | ||
| 592 | +// keyboardType: TextInputType.multiline, | ||
| 593 | +// onChanged: (value) { | ||
| 594 | +// setState(() { | ||
| 595 | +// // currentRemark = value ?? ""; | ||
| 596 | +// }); | ||
| 597 | +// }), | ||
| 598 | +// ), | ||
| 599 | +// VEmptyView(24), | ||
| 600 | +// Padding( | ||
| 601 | +// padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 602 | +// child: MyDivider( | ||
| 603 | +// double.infinity, | ||
| 604 | +// w(0.5), | ||
| 605 | +// color: MyColours.color_DBDBDB, | ||
| 606 | +// )), | ||
| 607 | +// VEmptyView(24), | ||
| 608 | +// // _selectBtnWidget(), | ||
| 609 | +// _item('预订安排通知中附加主厨介绍图片', select: addChefImge, onTap: () { | ||
| 610 | +// setState(() { | ||
| 611 | +// addChefImge = !addChefImge; | ||
| 612 | +// }); | ||
| 613 | +// }), | ||
| 614 | + | ||
| 615 | +// VEmptyView(24), | ||
| 616 | +// _separateWidget(), | ||
| 617 | +// VEmptyView(24), | ||
| 618 | +// _item('主厨介绍文字显示在图片上', select: addAbove, onTap: () { | ||
| 619 | +// setState(() { | ||
| 620 | +// addAbove = !addAbove; | ||
| 621 | +// }); | ||
| 622 | +// }), | ||
| 623 | + | ||
| 624 | +// VEmptyView(24), | ||
| 625 | +// ], | ||
| 626 | +// ), | ||
| 627 | +// )), | ||
| 628 | +// Container( | ||
| 629 | +// color: MyColours.color_ffffff, | ||
| 630 | +// padding: EdgeInsets.only( | ||
| 631 | +// left: w(45), right: w(45), top: w(12), bottom: w(25)), | ||
| 632 | +// child: RoundButton( | ||
| 633 | +// text: '保存', | ||
| 634 | +// gradientStart: MyColours.color_199095, | ||
| 635 | +// gradientEnd: MyColours.color_199095, | ||
| 636 | +// // borderColor: MyColours.color_999999, | ||
| 637 | +// radius: r(5), | ||
| 638 | +// fontSize: 34, | ||
| 639 | +// height: w(40), | ||
| 640 | +// isBold: true, | ||
| 641 | +// onPressed: () async { | ||
| 642 | +// FocusScope.of(context) | ||
| 643 | +// .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 644 | + | ||
| 645 | +// if (addChefIntroduce && | ||
| 646 | +// chefIntroduceC.text.trim().length == 0) { | ||
| 647 | +// Utils.showToast('请输入主厨介绍文字!'); | ||
| 648 | +// return false; | ||
| 649 | +// } | ||
| 650 | +// if (addChefImge && | ||
| 651 | +// _uploadImageProvider.firstImage.qiniuUrl == null) { | ||
| 652 | +// Utils.showToast('请上传图片!'); | ||
| 653 | +// return false; | ||
| 654 | +// } | ||
| 655 | + | ||
| 656 | +// if (addChefImge && | ||
| 657 | +// _uploadImageProvider.firstImage.process < 1) { | ||
| 658 | +// Utils.showToast('正在上传图片,请稍等'); | ||
| 659 | +// return false; | ||
| 660 | +// } | ||
| 661 | + | ||
| 662 | +// // List<String> images = []; | ||
| 663 | +// // if (_uploadImageProvider.storeImage1.qiniuUrl != null && | ||
| 664 | +// // _uploadImageProvider.storeImage1.qiniuUrl != '') { | ||
| 665 | +// // images.add(_uploadImageProvider.storeImage1.qiniuUrl); | ||
| 666 | +// // } | ||
| 667 | +// // if (_uploadImageProvider.storeImage2.qiniuUrl != null && | ||
| 668 | +// // _uploadImageProvider.storeImage2.qiniuUrl != '') { | ||
| 669 | +// // images.add(_uploadImageProvider.storeImage2.qiniuUrl); | ||
| 670 | +// // } | ||
| 671 | +// // if (_uploadImageProvider.storeImage3.qiniuUrl != null && | ||
| 672 | +// // _uploadImageProvider.storeImage3.qiniuUrl != '') { | ||
| 673 | +// // images.add(_uploadImageProvider.storeImage3.qiniuUrl); | ||
| 674 | +// // } | ||
| 675 | +// // if (_uploadImageProvider.storeImage3.qiniuUrl != null && | ||
| 676 | +// // _uploadImageProvider.storeImage3.qiniuUrl != '') { | ||
| 677 | +// // images.add(_uploadImageProvider.storeImage3.qiniuUrl); | ||
| 678 | +// // } | ||
| 679 | +// // if (images.length == 0) { | ||
| 680 | +// // Utils.showToast('请至少上传一张图片!'); | ||
| 681 | +// // return false; | ||
| 682 | +// // } | ||
| 683 | + | ||
| 684 | +// //接口 | ||
| 685 | +// Map chefData = { | ||
| 686 | +// 'introduce': chefIntroduceC.text, | ||
| 687 | +// 'image': _uploadImageProvider.firstImage.qiniuUrl, | ||
| 688 | +// 'is_introduce': addChefIntroduce ? '1' : '0', | ||
| 689 | +// 'is_images': addChefImge ? '1' : '0', | ||
| 690 | +// 'is_above': addAbove ? '1' : '0' | ||
| 691 | +// }; | ||
| 692 | + | ||
| 693 | +// Map<String, String> params = { | ||
| 694 | +// 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 695 | +// .user | ||
| 696 | +// .sellerid, | ||
| 697 | +// 'chef': json.encode(chefData) | ||
| 698 | +// }; | ||
| 699 | + | ||
| 700 | +// bool success = await _marketingCenterProvider | ||
| 701 | +// .setSellerTemplateConf(context, params, | ||
| 702 | +// showLoading: true); | ||
| 703 | +// if (success) { | ||
| 704 | +// // imgAll和images 比较,挑出不一样的,删除七牛云 | ||
| 705 | +// Set<String> difference = Set.from(imgAll) | ||
| 706 | +// ..removeAll( | ||
| 707 | +// [_uploadImageProvider.firstImage.qiniuUrl]); | ||
| 708 | +// List<String> differenceList = | ||
| 709 | +// difference.toList(); //需要删除的图片 | ||
| 710 | +// if (differenceList.length > 0) { | ||
| 711 | +// String delImgs = | ||
| 712 | +// Utils.listToStringEnglish(differenceList); | ||
| 713 | + | ||
| 714 | +// _uploadImageProvider.deleteImg(context, delImgs, | ||
| 715 | +// needToast: false); | ||
| 716 | +// } | ||
| 717 | +// Utils.showToast('保存成功'); | ||
| 718 | +// if (Navigator.canPop(context)) { | ||
| 719 | +// Navigator.pop(context); | ||
| 720 | +// } | ||
| 721 | +// } | ||
| 722 | +// }, | ||
| 723 | +// ), | ||
| 724 | +// ) | ||
| 725 | +// ], | ||
| 726 | +// ))); | ||
| 727 | +// } | ||
| 728 | +// } |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment