Showing
71 changed files
with
737 additions
and
326 deletions
| @@ -14,16 +14,16 @@ if (flutterRoot == null) { | @@ -14,16 +14,16 @@ if (flutterRoot == null) { | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -def flutterVersionCode = "463" | 17 | +def flutterVersionCode = "466" |
| 18 | if (flutterVersionCode == null) { | 18 | if (flutterVersionCode == null) { |
| 19 | - flutterVersionCode = '463' | 19 | + flutterVersionCode = '466' |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -def flutterVersionName = "4.6.3" | 24 | +def flutterVersionName = "4.6.6" |
| 25 | if (flutterVersionName == null) { | 25 | if (flutterVersionName == null) { |
| 26 | - flutterVersionName = '4.6.3' | 26 | + flutterVersionName = '4.6.6' |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | 29 |
assets/location_blue.png
100755 → 100644
| @@ -505,7 +505,7 @@ | @@ -505,7 +505,7 @@ | ||
| 505 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 505 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 506 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | 506 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
| 507 | CODE_SIGN_STYLE = Automatic; | 507 | CODE_SIGN_STYLE = Automatic; |
| 508 | - CURRENT_PROJECT_VERSION = 463; | 508 | + CURRENT_PROJECT_VERSION = 466; |
| 509 | DEVELOPMENT_TEAM = 8J59HM8B82; | 509 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 510 | ENABLE_BITCODE = NO; | 510 | ENABLE_BITCODE = NO; |
| 511 | FLUTTER_BUILD_MODE = release; | 511 | FLUTTER_BUILD_MODE = release; |
| @@ -520,7 +520,7 @@ | @@ -520,7 +520,7 @@ | ||
| 520 | "$(inherited)", | 520 | "$(inherited)", |
| 521 | "$(PROJECT_DIR)/Flutter", | 521 | "$(PROJECT_DIR)/Flutter", |
| 522 | ); | 522 | ); |
| 523 | - MARKETING_VERSION = 4.6.3; | 523 | + MARKETING_VERSION = 4.6.6; |
| 524 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 524 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 525 | PRODUCT_NAME = Runner; | 525 | PRODUCT_NAME = Runner; |
| 526 | PROVISIONING_PROFILE_SPECIFIER = ""; | 526 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -651,7 +651,7 @@ | @@ -651,7 +651,7 @@ | ||
| 651 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; | 651 | CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; |
| 652 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 652 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 653 | CODE_SIGN_STYLE = Automatic; | 653 | CODE_SIGN_STYLE = Automatic; |
| 654 | - CURRENT_PROJECT_VERSION = 463; | 654 | + CURRENT_PROJECT_VERSION = 466; |
| 655 | DEVELOPMENT_TEAM = 8J59HM8B82; | 655 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 656 | ENABLE_BITCODE = NO; | 656 | ENABLE_BITCODE = NO; |
| 657 | FLUTTER_BUILD_MODE = release; | 657 | FLUTTER_BUILD_MODE = release; |
| @@ -666,7 +666,7 @@ | @@ -666,7 +666,7 @@ | ||
| 666 | "$(inherited)", | 666 | "$(inherited)", |
| 667 | "$(PROJECT_DIR)/Flutter", | 667 | "$(PROJECT_DIR)/Flutter", |
| 668 | ); | 668 | ); |
| 669 | - MARKETING_VERSION = 4.6.3; | 669 | + MARKETING_VERSION = 4.6.6; |
| 670 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 670 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 671 | PRODUCT_NAME = Runner; | 671 | PRODUCT_NAME = Runner; |
| 672 | PROVISIONING_PROFILE_SPECIFIER = ""; | 672 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -687,7 +687,7 @@ | @@ -687,7 +687,7 @@ | ||
| 687 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 687 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 688 | CODE_SIGN_IDENTITY = "iPhone Developer"; | 688 | CODE_SIGN_IDENTITY = "iPhone Developer"; |
| 689 | CODE_SIGN_STYLE = Automatic; | 689 | CODE_SIGN_STYLE = Automatic; |
| 690 | - CURRENT_PROJECT_VERSION = 463; | 690 | + CURRENT_PROJECT_VERSION = 466; |
| 691 | DEVELOPMENT_TEAM = 8J59HM8B82; | 691 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 692 | ENABLE_BITCODE = NO; | 692 | ENABLE_BITCODE = NO; |
| 693 | FLUTTER_BUILD_MODE = release; | 693 | FLUTTER_BUILD_MODE = release; |
| @@ -702,7 +702,7 @@ | @@ -702,7 +702,7 @@ | ||
| 702 | "$(inherited)", | 702 | "$(inherited)", |
| 703 | "$(PROJECT_DIR)/Flutter", | 703 | "$(PROJECT_DIR)/Flutter", |
| 704 | ); | 704 | ); |
| 705 | - MARKETING_VERSION = 4.6.3; | 705 | + MARKETING_VERSION = 4.6.6; |
| 706 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 706 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 707 | PRODUCT_NAME = Runner; | 707 | PRODUCT_NAME = Runner; |
| 708 | PROVISIONING_PROFILE_SPECIFIER = ""; | 708 | PROVISIONING_PROFILE_SPECIFIER = ""; |
105 KB
6.53 KB
6.53 KB
8.86 KB
10.5 KB
11.5 KB
1.25 KB
1.48 KB
1.48 KB
1.9 KB
1.9 KB
1.9 KB
2.78 KB
2.78 KB
2.9 KB
3.83 KB
3.81 KB
3.81 KB
4.37 KB
| 1 | { | 1 | { |
| 2 | "images" : [ | 2 | "images" : [ |
| 3 | { | 3 | { |
| 4 | - "filename" : "Icon-App-20x20@2x.png", | 4 | + "filename" : "40.jpg", |
| 5 | "idiom" : "iphone", | 5 | "idiom" : "iphone", |
| 6 | "scale" : "2x", | 6 | "scale" : "2x", |
| 7 | "size" : "20x20" | 7 | "size" : "20x20" |
| 8 | }, | 8 | }, |
| 9 | { | 9 | { |
| 10 | - "filename" : "Icon-App-20x20@3x.png", | 10 | + "filename" : "60.jpg", |
| 11 | "idiom" : "iphone", | 11 | "idiom" : "iphone", |
| 12 | "scale" : "3x", | 12 | "scale" : "3x", |
| 13 | "size" : "20x20" | 13 | "size" : "20x20" |
| 14 | }, | 14 | }, |
| 15 | { | 15 | { |
| 16 | - "filename" : "Icon-App-29x29@1x.png", | 16 | + "filename" : "29.jpg", |
| 17 | "idiom" : "iphone", | 17 | "idiom" : "iphone", |
| 18 | "scale" : "1x", | 18 | "scale" : "1x", |
| 19 | "size" : "29x29" | 19 | "size" : "29x29" |
| 20 | }, | 20 | }, |
| 21 | { | 21 | { |
| 22 | - "filename" : "Icon-App-29x29@2x.png", | 22 | + "filename" : "58.jpg", |
| 23 | "idiom" : "iphone", | 23 | "idiom" : "iphone", |
| 24 | "scale" : "2x", | 24 | "scale" : "2x", |
| 25 | "size" : "29x29" | 25 | "size" : "29x29" |
| 26 | }, | 26 | }, |
| 27 | { | 27 | { |
| 28 | - "filename" : "Icon-App-29x29@3x.png", | 28 | + "filename" : "87.jpg", |
| 29 | "idiom" : "iphone", | 29 | "idiom" : "iphone", |
| 30 | "scale" : "3x", | 30 | "scale" : "3x", |
| 31 | "size" : "29x29" | 31 | "size" : "29x29" |
| 32 | }, | 32 | }, |
| 33 | { | 33 | { |
| 34 | - "filename" : "Icon-App-40x40@2x.png", | 34 | + "filename" : "80 1.jpg", |
| 35 | "idiom" : "iphone", | 35 | "idiom" : "iphone", |
| 36 | "scale" : "2x", | 36 | "scale" : "2x", |
| 37 | "size" : "40x40" | 37 | "size" : "40x40" |
| 38 | }, | 38 | }, |
| 39 | { | 39 | { |
| 40 | - "filename" : "Icon-App-40x40@3x.png", | 40 | + "filename" : "120 1.jpg", |
| 41 | "idiom" : "iphone", | 41 | "idiom" : "iphone", |
| 42 | "scale" : "3x", | 42 | "scale" : "3x", |
| 43 | "size" : "40x40" | 43 | "size" : "40x40" |
| 44 | }, | 44 | }, |
| 45 | { | 45 | { |
| 46 | - "filename" : "Icon-App-60x60@2x.png", | 46 | + "filename" : "120.jpg", |
| 47 | "idiom" : "iphone", | 47 | "idiom" : "iphone", |
| 48 | "scale" : "2x", | 48 | "scale" : "2x", |
| 49 | "size" : "60x60" | 49 | "size" : "60x60" |
| 50 | }, | 50 | }, |
| 51 | { | 51 | { |
| 52 | - "filename" : "Icon-App-180x180@1x.png", | 52 | + "filename" : "180.jpg", |
| 53 | "idiom" : "iphone", | 53 | "idiom" : "iphone", |
| 54 | "scale" : "3x", | 54 | "scale" : "3x", |
| 55 | "size" : "60x60" | 55 | "size" : "60x60" |
| 56 | }, | 56 | }, |
| 57 | { | 57 | { |
| 58 | - "filename" : "Icon-App-20x20@1x.png", | 58 | + "filename" : "20 1.jpg", |
| 59 | "idiom" : "ipad", | 59 | "idiom" : "ipad", |
| 60 | "scale" : "1x", | 60 | "scale" : "1x", |
| 61 | "size" : "20x20" | 61 | "size" : "20x20" |
| 62 | }, | 62 | }, |
| 63 | { | 63 | { |
| 64 | - "filename" : "Icon-App-20x20@2x.png", | 64 | + "filename" : "40 1.jpg", |
| 65 | "idiom" : "ipad", | 65 | "idiom" : "ipad", |
| 66 | "scale" : "2x", | 66 | "scale" : "2x", |
| 67 | "size" : "20x20" | 67 | "size" : "20x20" |
| 68 | }, | 68 | }, |
| 69 | { | 69 | { |
| 70 | - "filename" : "Icon-App-29x29@1x.png", | 70 | + "filename" : "29 1.jpg", |
| 71 | "idiom" : "ipad", | 71 | "idiom" : "ipad", |
| 72 | "scale" : "1x", | 72 | "scale" : "1x", |
| 73 | "size" : "29x29" | 73 | "size" : "29x29" |
| 74 | }, | 74 | }, |
| 75 | { | 75 | { |
| 76 | - "filename" : "Icon-App-29x29@2x.png", | 76 | + "filename" : "58 1.jpg", |
| 77 | "idiom" : "ipad", | 77 | "idiom" : "ipad", |
| 78 | "scale" : "2x", | 78 | "scale" : "2x", |
| 79 | "size" : "29x29" | 79 | "size" : "29x29" |
| 80 | }, | 80 | }, |
| 81 | { | 81 | { |
| 82 | - "filename" : "Icon-App-40x40@1x.png", | 82 | + "filename" : "40 2.jpg", |
| 83 | "idiom" : "ipad", | 83 | "idiom" : "ipad", |
| 84 | "scale" : "1x", | 84 | "scale" : "1x", |
| 85 | "size" : "40x40" | 85 | "size" : "40x40" |
| 86 | }, | 86 | }, |
| 87 | { | 87 | { |
| 88 | - "filename" : "Icon-App-80x80@1x.png", | 88 | + "filename" : "80 2.jpg", |
| 89 | "idiom" : "ipad", | 89 | "idiom" : "ipad", |
| 90 | "scale" : "2x", | 90 | "scale" : "2x", |
| 91 | "size" : "40x40" | 91 | "size" : "40x40" |
| 92 | }, | 92 | }, |
| 93 | { | 93 | { |
| 94 | - "filename" : "Icon-App-76x76@1x.png", | 94 | + "filename" : "76.jpg", |
| 95 | "idiom" : "ipad", | 95 | "idiom" : "ipad", |
| 96 | "scale" : "1x", | 96 | "scale" : "1x", |
| 97 | "size" : "76x76" | 97 | "size" : "76x76" |
| 98 | }, | 98 | }, |
| 99 | { | 99 | { |
| 100 | - "filename" : "Icon-App-76x76@2x.png", | 100 | + "filename" : "152.jpg", |
| 101 | "idiom" : "ipad", | 101 | "idiom" : "ipad", |
| 102 | "scale" : "2x", | 102 | "scale" : "2x", |
| 103 | "size" : "76x76" | 103 | "size" : "76x76" |
| 104 | }, | 104 | }, |
| 105 | { | 105 | { |
| 106 | - "filename" : "Icon-App-83.5x83.5@2x.png", | 106 | + "filename" : "167.jpg", |
| 107 | "idiom" : "ipad", | 107 | "idiom" : "ipad", |
| 108 | "scale" : "2x", | 108 | "scale" : "2x", |
| 109 | "size" : "83.5x83.5" | 109 | "size" : "83.5x83.5" |
| 110 | }, | 110 | }, |
| 111 | { | 111 | { |
| 112 | - "filename" : "Icon-App-1024x1024@1x.png", | 112 | + "filename" : "1024.jpg", |
| 113 | "idiom" : "ios-marketing", | 113 | "idiom" : "ios-marketing", |
| 114 | "scale" : "1x", | 114 | "scale" : "1x", |
| 115 | "size" : "1024x1024" | 115 | "size" : "1024x1024" |
1.03 KB
2.74 KB
1.76 KB
4.83 KB
8.63 KB
2.82 KB
13.4 KB
13.4 KB
6.65 KB
17.9 KB
7.08 KB
| @@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | <plist version="1.0"> | 3 | <plist version="1.0"> |
| 4 | <dict> | 4 | <dict> |
| 5 | + <key>CFBundleAllowMixedLocalizations</key> | ||
| 6 | + <true/> | ||
| 5 | <key>CADisableMinimumFrameDurationOnPhone</key> | 7 | <key>CADisableMinimumFrameDurationOnPhone</key> |
| 6 | <true/> | 8 | <true/> |
| 7 | <key>CFBundleDevelopmentRegion</key> | 9 | <key>CFBundleDevelopmentRegion</key> |
| @@ -16,17 +16,10 @@ class MarkDataModel extends Object { | @@ -16,17 +16,10 @@ class MarkDataModel extends Object { | ||
| 16 | MarkSignboardModel signboard; | 16 | MarkSignboardModel signboard; |
| 17 | 17 | ||
| 18 | MarkMarketingModel marketing; | 18 | MarkMarketingModel marketing; |
| 19 | + String isNewTemplate; | ||
| 19 | 20 | ||
| 20 | - MarkDataModel( | ||
| 21 | - this.id, | ||
| 22 | - this.sid, | ||
| 23 | - this.home, | ||
| 24 | - this.reserve, | ||
| 25 | - this.store, | ||
| 26 | - this.chef, | ||
| 27 | - this.signboard, | ||
| 28 | - this.marketing, | ||
| 29 | - ); | 21 | + MarkDataModel(this.id, this.sid, this.home, this.reserve, this.store, |
| 22 | + this.chef, this.signboard, this.marketing, this.isNewTemplate); | ||
| 30 | 23 | ||
| 31 | MarkDataModel.fromJson(Map<String, dynamic> json) { | 24 | MarkDataModel.fromJson(Map<String, dynamic> json) { |
| 32 | id = json['id']; | 25 | id = json['id']; |
| @@ -54,6 +47,8 @@ class MarkDataModel extends Object { | @@ -54,6 +47,8 @@ class MarkDataModel extends Object { | ||
| 54 | marketing = json['marketing'] != null | 47 | marketing = json['marketing'] != null |
| 55 | ? new MarkMarketingModel.fromJson(convert.jsonDecode(json['marketing'])) | 48 | ? new MarkMarketingModel.fromJson(convert.jsonDecode(json['marketing'])) |
| 56 | : null; // | 49 | : null; // |
| 50 | + | ||
| 51 | + isNewTemplate = json['is_new_template'] ?? "0"; | ||
| 57 | } | 52 | } |
| 58 | 53 | ||
| 59 | Map<String, dynamic> toJson() { | 54 | Map<String, dynamic> toJson() { |
| @@ -67,6 +62,7 @@ class MarkDataModel extends Object { | @@ -67,6 +62,7 @@ class MarkDataModel extends Object { | ||
| 67 | data['chef'] = this.chef; | 62 | data['chef'] = this.chef; |
| 68 | data['signboard'] = this.signboard; | 63 | data['signboard'] = this.signboard; |
| 69 | data['marketing'] = this.marketing; | 64 | data['marketing'] = this.marketing; |
| 65 | + data['is_new_template'] = this.isNewTemplate; | ||
| 70 | return data; | 66 | return data; |
| 71 | } | 67 | } |
| 72 | } | 68 | } |
| @@ -388,8 +388,10 @@ class HttpUrl { | @@ -388,8 +388,10 @@ class HttpUrl { | ||
| 388 | static const String get_store_wine_check_list = | 388 | static const String get_store_wine_check_list = |
| 389 | "?service=App.Reserve.GetStoreWineCheckList"; // 获取取酒记录 | 389 | "?service=App.Reserve.GetStoreWineCheckList"; // 获取取酒记录 |
| 390 | 390 | ||
| 391 | - | ||
| 392 | - // static const String send_vc_code = | ||
| 393 | - // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码 | 391 | + static const String set_confing = |
| 392 | + "?service=App.Reserve.SetConfing"; // 设置订座商家配置信息 | ||
| 393 | + | ||
| 394 | + // static const String send_vc_code = | ||
| 395 | + // "?service=App.SendSMS.SendVcCode"; // 向指定手机号码发送验证码 | ||
| 394 | 396 | ||
| 395 | } | 397 | } |
| 1 | import 'dart:io'; | 1 | import 'dart:io'; |
| 2 | 2 | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 5 | import 'package:image_picker/image_picker.dart'; | 6 | import 'package:image_picker/image_picker.dart'; |
| 6 | import 'package:one_key/models/upload_img_model.dart'; | 7 | import 'package:one_key/models/upload_img_model.dart'; |
| @@ -188,7 +189,11 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -188,7 +189,11 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 188 | ///#相机拍照,单图选择 | 189 | ///#相机拍照,单图选择 |
| 189 | Future _getFromPictureOrCamera(String title, UploadImgModel imgModel, | 190 | Future _getFromPictureOrCamera(String title, UploadImgModel imgModel, |
| 190 | imageSource, UploadImageProvider model) async { | 191 | imageSource, UploadImageProvider model) async { |
| 191 | - final pickedFile = await picker.getImage(source: imageSource); | 192 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 193 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 194 | + pickedFile.path, | ||
| 195 | + quality: 50, | ||
| 196 | + percentage: 50); | ||
| 192 | setState(() { | 197 | setState(() { |
| 193 | if (pickedFile != null) { | 198 | if (pickedFile != null) { |
| 194 | imgModel.file = File(pickedFile.path); | 199 | imgModel.file = File(pickedFile.path); |
| @@ -200,8 +205,13 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -200,8 +205,13 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 200 | if (pickedFile != null) { | 205 | if (pickedFile != null) { |
| 201 | model.imgSizeTouxiang = 76; | 206 | model.imgSizeTouxiang = 76; |
| 202 | model.touxiang.qiniuUrl = null; | 207 | model.touxiang.qiniuUrl = null; |
| 203 | - UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 204 | - title == '头像' ? 0 : 1, true, model, UploadType.StoreFrontUploadType); | 208 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 209 | + File file = File(pickedFile.path); | ||
| 210 | + if (need) { | ||
| 211 | + file = File(compressedFile.absolute.path); | ||
| 212 | + } | ||
| 213 | + UploadImageUtil().startUpload(context, file, title == '头像' ? 0 : 1, true, | ||
| 214 | + model, UploadType.StoreFrontUploadType); | ||
| 205 | } | 215 | } |
| 206 | } | 216 | } |
| 207 | 217 |
| @@ -3,6 +3,7 @@ import 'dart:async'; | @@ -3,6 +3,7 @@ import 'dart:async'; | ||
| 3 | 3 | ||
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter/rendering.dart'; | 5 | import 'package:flutter/rendering.dart'; |
| 6 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 7 | import 'package:one_key/models/upload_img_model.dart'; | 8 | import 'package:one_key/models/upload_img_model.dart'; |
| 8 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; | 9 | import 'package:one_key/pages/online_check/photo_view_wiget.dart'; |
| @@ -73,9 +74,13 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -73,9 +74,13 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 73 | ///#相机拍照,单图选择 | 74 | ///#相机拍照,单图选择 |
| 74 | //////#相机拍照,单图选择 | 75 | //////#相机拍照,单图选择 |
| 75 | Future _getImageFromPictureOrCamera(ImageSource imageSource) async { | 76 | Future _getImageFromPictureOrCamera(ImageSource imageSource) async { |
| 76 | - final pickedFile = await picker.getImage(source: imageSource); | 77 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 77 | // String ddd = Utils.getPicSuffix(pickedFile.path); | 78 | // String ddd = Utils.getPicSuffix(pickedFile.path); |
| 78 | // print(ddd); | 79 | // print(ddd); |
| 80 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 81 | + pickedFile.path, | ||
| 82 | + quality: 50, | ||
| 83 | + percentage: 50); | ||
| 79 | setState(() { | 84 | setState(() { |
| 80 | if (pickedFile != null) { | 85 | if (pickedFile != null) { |
| 81 | UploadImgModel imgModel = UploadImgModel(); | 86 | UploadImgModel imgModel = UploadImgModel(); |
| @@ -88,9 +93,14 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -88,9 +93,14 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 88 | } | 93 | } |
| 89 | }); | 94 | }); |
| 90 | if (pickedFile != null) { | 95 | if (pickedFile != null) { |
| 96 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 97 | + File file = File(pickedFile.path); | ||
| 98 | + if (need) { | ||
| 99 | + file = File(compressedFile.absolute.path); | ||
| 100 | + } | ||
| 91 | UploadImageUtil().startUpload( | 101 | UploadImageUtil().startUpload( |
| 92 | context, | 102 | context, |
| 93 | - File(pickedFile.path), | 103 | + file, |
| 94 | widget.model.imageListDenvironment.length - 1, | 104 | widget.model.imageListDenvironment.length - 1, |
| 95 | true, | 105 | true, |
| 96 | widget.model, | 106 | widget.model, |
| @@ -100,7 +110,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -100,7 +110,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 100 | 110 | ||
| 101 | ///视频 | 111 | ///视频 |
| 102 | Future _getVideoFromPictureOrCamera(ImageSource imageSource) async { | 112 | Future _getVideoFromPictureOrCamera(ImageSource imageSource) async { |
| 103 | - final pickedFile = await picker.getVideo( | 113 | + final pickedFile = await picker.pickVideo( |
| 104 | source: imageSource, maxDuration: const Duration(seconds: 15)); | 114 | source: imageSource, maxDuration: const Duration(seconds: 15)); |
| 105 | String ddd = Utils.getPicSuffix(pickedFile.path); | 115 | String ddd = Utils.getPicSuffix(pickedFile.path); |
| 106 | print(ddd); | 116 | print(ddd); |
| @@ -120,6 +130,10 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -120,6 +130,10 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 120 | ); | 130 | ); |
| 121 | 131 | ||
| 122 | if (pickedFile != null) { | 132 | if (pickedFile != null) { |
| 133 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 134 | + pickedFile.path, | ||
| 135 | + quality: 50, | ||
| 136 | + percentage: 50); | ||
| 123 | UploadImgModel imgModel = UploadImgModel(); | 137 | UploadImgModel imgModel = UploadImgModel(); |
| 124 | imgModel.file = File(pickedFile.path); | 138 | imgModel.file = File(pickedFile.path); |
| 125 | imgModel.process = 0.01; | 139 | imgModel.process = 0.01; |
| @@ -128,9 +142,14 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -128,9 +142,14 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 128 | imgModel.duration = duration; | 142 | imgModel.duration = duration; |
| 129 | widget.model.imageListDenvironment.add(imgModel); | 143 | widget.model.imageListDenvironment.add(imgModel); |
| 130 | setState(() {}); | 144 | setState(() {}); |
| 145 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 146 | + File file = File(pickedFile.path); | ||
| 147 | + if (need) { | ||
| 148 | + file = File(compressedFile.absolute.path); | ||
| 149 | + } | ||
| 131 | UploadImageUtil().startUpload( | 150 | UploadImageUtil().startUpload( |
| 132 | context, | 151 | context, |
| 133 | - File(pickedFile.path), | 152 | + file, |
| 134 | widget.model.imageListDenvironment.length - 1, | 153 | widget.model.imageListDenvironment.length - 1, |
| 135 | true, | 154 | true, |
| 136 | widget.model, | 155 | widget.model, |
| @@ -205,9 +224,19 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -205,9 +224,19 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 205 | imgModel.fileType = FileType.image; | 224 | imgModel.fileType = FileType.image; |
| 206 | widget.model.imageListDenvironment.add(imgModel); | 225 | widget.model.imageListDenvironment.add(imgModel); |
| 207 | }); | 226 | }); |
| 227 | + | ||
| 228 | + bool need = await Utils.sizeNeed(file); | ||
| 229 | + | ||
| 230 | + if (need) { | ||
| 231 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 232 | + file.path, | ||
| 233 | + quality: 50, | ||
| 234 | + percentage: 50); | ||
| 235 | + file = File(compressedFile.absolute.path); | ||
| 236 | + } | ||
| 208 | UploadImageUtil().startUpload( | 237 | UploadImageUtil().startUpload( |
| 209 | context, | 238 | context, |
| 210 | - File(file.absolute.path), | 239 | + file, |
| 211 | widget.model.imageListDenvironment.length - 1, | 240 | widget.model.imageListDenvironment.length - 1, |
| 212 | false, | 241 | false, |
| 213 | widget.model, | 242 | widget.model, |
| @@ -3,6 +3,7 @@ import 'dart:ui'; | @@ -3,6 +3,7 @@ import 'dart:ui'; | ||
| 3 | 3 | ||
| 4 | import 'package:cached_network_image/cached_network_image.dart'; | 4 | import 'package:cached_network_image/cached_network_image.dart'; |
| 5 | import 'package:flutter/material.dart'; | 5 | import 'package:flutter/material.dart'; |
| 6 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 7 | import 'package:one_key/constant/state.dart'; | 8 | import 'package:one_key/constant/state.dart'; |
| 8 | import 'package:one_key/models/check_seller_acc_model.dart'; | 9 | import 'package:one_key/models/check_seller_acc_model.dart'; |
| @@ -386,7 +387,11 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -386,7 +387,11 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 386 | ///#相机拍照,单图选择 | 387 | ///#相机拍照,单图选择 |
| 387 | Future _getFromPictureOrCamera( | 388 | Future _getFromPictureOrCamera( |
| 388 | String title, UploadImgModel imgModel, imageSource) async { | 389 | String title, UploadImgModel imgModel, imageSource) async { |
| 389 | - final pickedFile = await picker.getImage(source: imageSource); | 390 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 391 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 392 | + pickedFile.path, | ||
| 393 | + quality: 50, | ||
| 394 | + percentage: 50); | ||
| 390 | setState(() { | 395 | setState(() { |
| 391 | if (pickedFile != null) { | 396 | if (pickedFile != null) { |
| 392 | imgModel.file = File(pickedFile.path); | 397 | imgModel.file = File(pickedFile.path); |
| @@ -403,8 +408,13 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -403,8 +408,13 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 403 | _uploadImageProvider.imgSizeErweima = 76; | 408 | _uploadImageProvider.imgSizeErweima = 76; |
| 404 | _uploadImageProvider.erweima.qiniuUrl = null; | 409 | _uploadImageProvider.erweima.qiniuUrl = null; |
| 405 | } | 410 | } |
| 406 | - UploadImageUtil().startUploadOnly(context, File(pickedFile.path), | ||
| 407 | - title == '头像' ? 0 : 1, true, _uploadImageProvider); | 411 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 412 | + File file = File(pickedFile.path); | ||
| 413 | + if (need) { | ||
| 414 | + file = File(compressedFile.absolute.path); | ||
| 415 | + } | ||
| 416 | + UploadImageUtil().startUploadOnly( | ||
| 417 | + context, file, title == '头像' ? 0 : 1, true, _uploadImageProvider); | ||
| 408 | } | 418 | } |
| 409 | } | 419 | } |
| 410 | 420 |
| @@ -231,7 +231,7 @@ | @@ -231,7 +231,7 @@ | ||
| 231 | // ///#相机拍照,单图选择 | 231 | // ///#相机拍照,单图选择 |
| 232 | // Future _getFromPictureOrCamera( | 232 | // Future _getFromPictureOrCamera( |
| 233 | // String title, UploadImgModel imgModel, imageSource) async { | 233 | // String title, UploadImgModel imgModel, imageSource) async { |
| 234 | -// final pickedFile = await picker.getImage(source: imageSource); | 234 | +// final pickedFile = await picker.pickImage(source: imageSource); |
| 235 | // setState(() { | 235 | // setState(() { |
| 236 | // if (pickedFile != null) { | 236 | // if (pickedFile != null) { |
| 237 | // imgModel.file = File(pickedFile.path); | 237 | // imgModel.file = File(pickedFile.path); |
| @@ -436,8 +436,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -436,8 +436,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 436 | '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}') | 436 | '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}') |
| 437 | : SizedBox(), | 437 | : SizedBox(), |
| 438 | VEmptyView(10), | 438 | VEmptyView(10), |
| 439 | - _itemTitleAndSubTtile('地址', '${address}'), | ||
| 440 | - VEmptyView(10), | 439 | + // _itemTitleAndSubTtile('地址', '${address}'), |
| 440 | + // VEmptyView(10), | ||
| 441 | addParking | 441 | addParking |
| 442 | ? _itemTitleAndSubTtile('停车', '${parkingIncoC.text}') | 442 | ? _itemTitleAndSubTtile('停车', '${parkingIncoC.text}') |
| 443 | : SizedBox(), | 443 | : SizedBox(), |
| @@ -3,6 +3,7 @@ import 'dart:io'; | @@ -3,6 +3,7 @@ import 'dart:io'; | ||
| 3 | 3 | ||
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | 5 | import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; |
| 6 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 7 | import 'package:image_picker/image_picker.dart'; | 8 | import 'package:image_picker/image_picker.dart'; |
| 8 | import 'package:one_key/widgets/v_empty_view.dart'; | 9 | import 'package:one_key/widgets/v_empty_view.dart'; |
| @@ -101,7 +102,11 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -101,7 +102,11 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 101 | 102 | ||
| 102 | ///#相机拍照,单图选择 | 103 | ///#相机拍照,单图选择 |
| 103 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { | 104 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { |
| 104 | - final pickedFile = await picker.getImage(source: imageSource); | 105 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 106 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 107 | + pickedFile.path, | ||
| 108 | + quality: 50, | ||
| 109 | + percentage: 50); | ||
| 105 | setState(() { | 110 | setState(() { |
| 106 | if (pickedFile != null) { | 111 | if (pickedFile != null) { |
| 107 | imgModel.file = File(pickedFile.path); | 112 | imgModel.file = File(pickedFile.path); |
| @@ -118,8 +123,13 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -118,8 +123,13 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 118 | // _uploadImageProvider.imgSizeErweima = 76; | 123 | // _uploadImageProvider.imgSizeErweima = 76; |
| 119 | _uploadImageProvider.firstImage.qiniuUrl = null; | 124 | _uploadImageProvider.firstImage.qiniuUrl = null; |
| 120 | // } | 125 | // } |
| 121 | - UploadImageUtil().startUploadOnly( | ||
| 122 | - context, File(pickedFile.path), 4, true, _uploadImageProvider); | 126 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 127 | + File file = File(pickedFile.path); | ||
| 128 | + if (need) { | ||
| 129 | + file = File(compressedFile.absolute.path); | ||
| 130 | + } | ||
| 131 | + UploadImageUtil().startUploadOnly(context, | ||
| 132 | + file, 4, true, _uploadImageProvider); | ||
| 123 | } | 133 | } |
| 124 | } | 134 | } |
| 125 | 135 | ||
| @@ -455,9 +465,9 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -455,9 +465,9 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 455 | // ///没有上传完成的不可以点击 | 465 | // ///没有上传完成的不可以点击 |
| 456 | // _showPhotoView(context, 0, tempList); | 466 | // _showPhotoView(context, 0, tempList); |
| 457 | 467 | ||
| 458 | - _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 459 | - _uploadImageProvider.firstImage.process = 0; | ||
| 460 | - setState(() {}); | 468 | + // _uploadImageProvider.firstImage.qiniuUrl = null; |
| 469 | + // _uploadImageProvider.firstImage.process = 0; | ||
| 470 | + // setState(() {}); | ||
| 461 | FocusScope.of(context).requestFocus(FocusNode()); | 471 | FocusScope.of(context).requestFocus(FocusNode()); |
| 462 | _openModalBottomSheet(context); | 472 | _openModalBottomSheet(context); |
| 463 | // Utils.getPickPermission(context, () { | 473 | // Utils.getPickPermission(context, () { |
| @@ -2,6 +2,7 @@ import 'dart:convert'; | @@ -2,6 +2,7 @@ import 'dart:convert'; | ||
| 2 | import 'dart:io'; | 2 | import 'dart:io'; |
| 3 | 3 | ||
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 6 | import 'package:image_picker/image_picker.dart'; | 7 | import 'package:image_picker/image_picker.dart'; |
| 7 | import 'package:one_key/provider/marketing_center_provider.dart'; | 8 | import 'package:one_key/provider/marketing_center_provider.dart'; |
| @@ -276,7 +277,11 @@ class _FirstImagePageState extends State<FirstImagePage> { | @@ -276,7 +277,11 @@ class _FirstImagePageState extends State<FirstImagePage> { | ||
| 276 | 277 | ||
| 277 | ///#相机拍照,单图选择 | 278 | ///#相机拍照,单图选择 |
| 278 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { | 279 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { |
| 279 | - final pickedFile = await picker.getImage(source: imageSource); | 280 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 281 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 282 | + pickedFile.path, | ||
| 283 | + quality: 50, | ||
| 284 | + percentage: 50); | ||
| 280 | setState(() { | 285 | setState(() { |
| 281 | if (pickedFile != null) { | 286 | if (pickedFile != null) { |
| 282 | imgModel.file = File(pickedFile.path); | 287 | imgModel.file = File(pickedFile.path); |
| @@ -293,8 +298,13 @@ class _FirstImagePageState extends State<FirstImagePage> { | @@ -293,8 +298,13 @@ class _FirstImagePageState extends State<FirstImagePage> { | ||
| 293 | // _uploadImageProvider.imgSizeErweima = 76; | 298 | // _uploadImageProvider.imgSizeErweima = 76; |
| 294 | _uploadImageProvider.firstImage.qiniuUrl = null; | 299 | _uploadImageProvider.firstImage.qiniuUrl = null; |
| 295 | // } | 300 | // } |
| 301 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 302 | + File file = File(pickedFile.path); | ||
| 303 | + if (need) { | ||
| 304 | + file = File(compressedFile.absolute.path); | ||
| 305 | + } | ||
| 296 | UploadImageUtil().startUploadOnly( | 306 | UploadImageUtil().startUploadOnly( |
| 297 | - context, File(pickedFile.path), 4, true, _uploadImageProvider); | 307 | + context, file, 4, true, _uploadImageProvider); |
| 298 | } | 308 | } |
| 299 | } | 309 | } |
| 300 | 310 | ||
| @@ -598,9 +608,9 @@ class _FirstImagePageState extends State<FirstImagePage> { | @@ -598,9 +608,9 @@ class _FirstImagePageState extends State<FirstImagePage> { | ||
| 598 | // ///没有上传完成的不可以点击 | 608 | // ///没有上传完成的不可以点击 |
| 599 | // _showPhotoView(context, 0, tempList); | 609 | // _showPhotoView(context, 0, tempList); |
| 600 | 610 | ||
| 601 | - _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 602 | - _uploadImageProvider.firstImage.process = 0; | ||
| 603 | - setState(() {}); | 611 | + // _uploadImageProvider.firstImage.qiniuUrl = null; |
| 612 | + // _uploadImageProvider.firstImage.process = 0; | ||
| 613 | + // setState(() {}); | ||
| 604 | _openModalBottomSheet(context); | 614 | _openModalBottomSheet(context); |
| 605 | // Utils.getPickPermission(context, () { | 615 | // Utils.getPickPermission(context, () { |
| 606 | // _getFromPictureOrCamera( | 616 | // _getFromPictureOrCamera( |
| @@ -104,7 +104,11 @@ class _ImgPickerInvitationWidgetState | @@ -104,7 +104,11 @@ class _ImgPickerInvitationWidgetState | ||
| 104 | 104 | ||
| 105 | ///#相机拍照,单图选择 | 105 | ///#相机拍照,单图选择 |
| 106 | Future _getFromPictureOrCamera(imageSource) async { | 106 | Future _getFromPictureOrCamera(imageSource) async { |
| 107 | - final pickedFile = await picker.getImage(source: imageSource); | 107 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 108 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 109 | + pickedFile.path, | ||
| 110 | + quality: 50, | ||
| 111 | + percentage: 50); | ||
| 108 | setState(() { | 112 | setState(() { |
| 109 | if (pickedFile != null) { | 113 | if (pickedFile != null) { |
| 110 | widget.imageModel.file = File(pickedFile.path); | 114 | widget.imageModel.file = File(pickedFile.path); |
| @@ -121,8 +125,13 @@ class _ImgPickerInvitationWidgetState | @@ -121,8 +125,13 @@ class _ImgPickerInvitationWidgetState | ||
| 121 | // _uploadImageProvider.imgSizeErweima = 76; | 125 | // _uploadImageProvider.imgSizeErweima = 76; |
| 122 | widget.imageModel.qiniuUrl = null; | 126 | widget.imageModel.qiniuUrl = null; |
| 123 | // } | 127 | // } |
| 124 | - UploadImageUtil().startUploadOnly( | ||
| 125 | - context, File(pickedFile.path), widget.index, true, widget.model); | 128 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 129 | + File file = File(pickedFile.path); | ||
| 130 | + if (need) { | ||
| 131 | + file = File(compressedFile.absolute.path); | ||
| 132 | + } | ||
| 133 | + UploadImageUtil() | ||
| 134 | + .startUploadOnly(context, file, widget.index, true, widget.model); | ||
| 126 | } | 135 | } |
| 127 | } | 136 | } |
| 128 | 137 |
| @@ -2,6 +2,7 @@ import 'dart:convert'; | @@ -2,6 +2,7 @@ import 'dart:convert'; | ||
| 2 | import 'dart:io'; | 2 | import 'dart:io'; |
| 3 | 3 | ||
| 4 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 5 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 6 | import 'package:image_picker/image_picker.dart'; | 7 | import 'package:image_picker/image_picker.dart'; |
| 7 | import 'package:one_key/utils/utils.dart'; | 8 | import 'package:one_key/utils/utils.dart'; |
| @@ -159,7 +160,11 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -159,7 +160,11 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 159 | 160 | ||
| 160 | ///#相机拍照,单图选择 | 161 | ///#相机拍照,单图选择 |
| 161 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { | 162 | Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource) async { |
| 162 | - final pickedFile = await picker.getImage(source: imageSource); | 163 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 164 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 165 | + pickedFile.path, | ||
| 166 | + quality: 50, | ||
| 167 | + percentage: 50); | ||
| 163 | setState(() { | 168 | setState(() { |
| 164 | if (pickedFile != null) { | 169 | if (pickedFile != null) { |
| 165 | imgModel.file = File(pickedFile.path); | 170 | imgModel.file = File(pickedFile.path); |
| @@ -176,8 +181,13 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -176,8 +181,13 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 176 | // _uploadImageProvider.imgSizeErweima = 76; | 181 | // _uploadImageProvider.imgSizeErweima = 76; |
| 177 | _uploadImageProvider.firstImage.qiniuUrl = null; | 182 | _uploadImageProvider.firstImage.qiniuUrl = null; |
| 178 | // } | 183 | // } |
| 184 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); | ||
| 185 | + File file = File(pickedFile.path); | ||
| 186 | + if (need) { | ||
| 187 | + file = File(compressedFile.absolute.path); | ||
| 188 | + } | ||
| 179 | UploadImageUtil().startUploadOnly( | 189 | UploadImageUtil().startUploadOnly( |
| 180 | - context, File(pickedFile.path), 4, true, _uploadImageProvider); | 190 | + context, file, 4, true, _uploadImageProvider); |
| 181 | } | 191 | } |
| 182 | } | 192 | } |
| 183 | 193 | ||
| @@ -422,27 +432,27 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -422,27 +432,27 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 422 | color: MyColours.color_ffffff, | 432 | color: MyColours.color_ffffff, |
| 423 | margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)), | 433 | margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)), |
| 424 | child: Column(children: [ | 434 | child: Column(children: [ |
| 425 | - InkWell( | ||
| 426 | - onTap: () { | ||
| 427 | - setState(() { | ||
| 428 | - is_link = !is_link; | ||
| 429 | - }); | ||
| 430 | - }, | ||
| 431 | - child: Row( | ||
| 432 | - children: [ | ||
| 433 | - Image.asset( | ||
| 434 | - Utils.getImgPath(is_link ? 'f_select' : 'f_select_not'), | ||
| 435 | - width: w(20), | ||
| 436 | - ), | ||
| 437 | - HEmptyView(20), | ||
| 438 | - Text( | ||
| 439 | - '推荐店内充值优惠活动链接', | ||
| 440 | - style: TextStyle( | ||
| 441 | - fontSize: font(14), color: MyColours.color_515151), | ||
| 442 | - ) | ||
| 443 | - ], | ||
| 444 | - )), | ||
| 445 | - VEmptyView(24), | 435 | + // InkWell( |
| 436 | + // onTap: () { | ||
| 437 | + // setState(() { | ||
| 438 | + // is_link = !is_link; | ||
| 439 | + // }); | ||
| 440 | + // }, | ||
| 441 | + // child: Row( | ||
| 442 | + // children: [ | ||
| 443 | + // Image.asset( | ||
| 444 | + // Utils.getImgPath(is_link ? 'f_select' : 'f_select_not'), | ||
| 445 | + // width: w(20), | ||
| 446 | + // ), | ||
| 447 | + // HEmptyView(20), | ||
| 448 | + // Text( | ||
| 449 | + // '推荐店内充值优惠活动链接', | ||
| 450 | + // style: TextStyle( | ||
| 451 | + // fontSize: font(14), color: MyColours.color_515151), | ||
| 452 | + // ) | ||
| 453 | + // ], | ||
| 454 | + // )), | ||
| 455 | + // VEmptyView(24), | ||
| 446 | Container( | 456 | Container( |
| 447 | height: w(180), | 457 | height: w(180), |
| 448 | child: _uploadImageProvider.firstImage.file != null || | 458 | child: _uploadImageProvider.firstImage.file != null || |
| @@ -467,9 +477,9 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -467,9 +477,9 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 467 | // ///没有上传完成的不可以点击 | 477 | // ///没有上传完成的不可以点击 |
| 468 | // _showPhotoView(context, 0, tempList); | 478 | // _showPhotoView(context, 0, tempList); |
| 469 | 479 | ||
| 470 | - _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 471 | - _uploadImageProvider.firstImage.process = 0; | ||
| 472 | - setState(() {}); | 480 | + // _uploadImageProvider.firstImage.qiniuUrl = null; |
| 481 | + // _uploadImageProvider.firstImage.process = 0; | ||
| 482 | + // setState(() {}); | ||
| 473 | _openModalBottomSheet(context); | 483 | _openModalBottomSheet(context); |
| 474 | // Utils.getPickPermission(context, () { | 484 | // Utils.getPickPermission(context, () { |
| 475 | // _getFromPictureOrCamera( | 485 | // _getFromPictureOrCamera( |
| @@ -627,38 +637,38 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -627,38 +637,38 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 627 | }); | 637 | }); |
| 628 | }), | 638 | }), |
| 629 | ), | 639 | ), |
| 630 | - VEmptyView(40), | ||
| 631 | - Container( | ||
| 632 | - width: w(188), | ||
| 633 | - height: w(22), | ||
| 634 | - alignment: Alignment.center, | ||
| 635 | - decoration: BoxDecoration( | ||
| 636 | - borderRadius: BorderRadius.circular(r(11)), | ||
| 637 | - gradient: LinearGradient(stops: [ | ||
| 638 | - -0.57, | ||
| 639 | - 0.55, | ||
| 640 | - 1.48 | ||
| 641 | - ], colors: [ | ||
| 642 | - MyColours.color_4C8DAD, | ||
| 643 | - MyColours.color_0143A3, | ||
| 644 | - MyColours.color_42A5FF | ||
| 645 | - ], begin: Alignment.centerLeft, end: Alignment.centerRight)), | ||
| 646 | - child: RoundButton( | ||
| 647 | - width: w(186), | ||
| 648 | - height: w(20), | ||
| 649 | - text: '点击了解更多会员优惠政策', | ||
| 650 | - gradientStart: MyColours.color_ffffff, | ||
| 651 | - gradientEnd: MyColours.color_ffffff, | ||
| 652 | - borderColor: Colors.transparent, | ||
| 653 | - // borderColor: MyColours.color_999999, | ||
| 654 | - textColor: MyColours.color_999999, | ||
| 655 | - radius: r(11), | ||
| 656 | - fontSize: 24, | ||
| 657 | - | ||
| 658 | - isBold: true, | ||
| 659 | - onPressed: () {}, | ||
| 660 | - )), | ||
| 661 | - VEmptyView(18), | 640 | + // VEmptyView(40), |
| 641 | + // Container( | ||
| 642 | + // width: w(188), | ||
| 643 | + // height: w(22), | ||
| 644 | + // alignment: Alignment.center, | ||
| 645 | + // decoration: BoxDecoration( | ||
| 646 | + // borderRadius: BorderRadius.circular(r(11)), | ||
| 647 | + // gradient: LinearGradient(stops: [ | ||
| 648 | + // -0.57, | ||
| 649 | + // 0.55, | ||
| 650 | + // 1.48 | ||
| 651 | + // ], colors: [ | ||
| 652 | + // MyColours.color_4C8DAD, | ||
| 653 | + // MyColours.color_0143A3, | ||
| 654 | + // MyColours.color_42A5FF | ||
| 655 | + // ], begin: Alignment.centerLeft, end: Alignment.centerRight)), | ||
| 656 | + // child: RoundButton( | ||
| 657 | + // width: w(186), | ||
| 658 | + // height: w(20), | ||
| 659 | + // text: '点击了解更多会员优惠政策', | ||
| 660 | + // gradientStart: MyColours.color_ffffff, | ||
| 661 | + // gradientEnd: MyColours.color_ffffff, | ||
| 662 | + // borderColor: Colors.transparent, | ||
| 663 | + // // borderColor: MyColours.color_999999, | ||
| 664 | + // textColor: MyColours.color_999999, | ||
| 665 | + // radius: r(11), | ||
| 666 | + // fontSize: 24, | ||
| 667 | + | ||
| 668 | + // isBold: true, | ||
| 669 | + // onPressed: () {}, | ||
| 670 | + // )), | ||
| 671 | + // VEmptyView(18), | ||
| 662 | Container( | 672 | Container( |
| 663 | height: w(28), | 673 | height: w(28), |
| 664 | alignment: Alignment.center, | 674 | alignment: Alignment.center, |
| @@ -695,13 +705,13 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -695,13 +705,13 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 695 | child: Column( | 705 | child: Column( |
| 696 | children: [ | 706 | children: [ |
| 697 | _headItem('客户互动及店铺推广'), | 707 | _headItem('客户互动及店铺推广'), |
| 698 | - _storeItemWidget('允许顾客转发邀请函给同行客人。', | ||
| 699 | - '同行客人可以从电子邀请函了解预订信息、一键导航到店,快速联系餐厅服务人员。还可以了解更多餐厅介绍、各种活动。', | ||
| 700 | - onTap: () { | ||
| 701 | - setState(() { | ||
| 702 | - is_transpond = !is_transpond; | ||
| 703 | - }); | ||
| 704 | - }, select: is_transpond), | 708 | + // _storeItemWidget('允许顾客转发邀请函给同行客人。', |
| 709 | + // '同行客人可以从电子邀请函了解预订信息、一键导航到店,快速联系餐厅服务人员。还可以了解更多餐厅介绍、各种活动。', | ||
| 710 | + // onTap: () { | ||
| 711 | + // setState(() { | ||
| 712 | + // is_transpond = !is_transpond; | ||
| 713 | + // }); | ||
| 714 | + // }, select: is_transpond), | ||
| 705 | _storeItemWidget('向被邀请客人开放“确认到店”功能。', | 715 | _storeItemWidget('向被邀请客人开放“确认到店”功能。', |
| 706 | '被邀客人点击确认到店后,方便请客人了解被邀客人是否确认,同时,被邀客人的信息会加入到餐厅客户池中,方便餐厅维护客户。', | 716 | '被邀客人点击确认到店后,方便请客人了解被邀客人是否确认,同时,被邀客人的信息会加入到餐厅客户池中,方便餐厅维护客户。', |
| 707 | onTap: () { | 717 | onTap: () { |
| @@ -724,8 +734,8 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -724,8 +734,8 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 724 | }); | 734 | }); |
| 725 | }, select: is_order), | 735 | }, select: is_order), |
| 726 | VEmptyView(24), | 736 | VEmptyView(24), |
| 727 | - _headItem('预订安排中附带的营销推广'), | ||
| 728 | - VEmptyView(24), | 737 | + // _headItem('预订安排中附带的营销推广'), |
| 738 | + // VEmptyView(24), | ||
| 729 | // couponProvider.couponListSelect.length > 0 | 739 | // couponProvider.couponListSelect.length > 0 |
| 730 | // ? _markingItem('推荐店内代金券优惠', couponProvider.couponListSelect[0].aname, | 740 | // ? _markingItem('推荐店内代金券优惠', couponProvider.couponListSelect[0].aname, |
| 731 | // couponProvider.couponListSelect[0].desc, '100', '5折', onPressed: () { | 741 | // couponProvider.couponListSelect[0].desc, '100', '5折', onPressed: () { |
| @@ -768,21 +778,23 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -768,21 +778,23 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 768 | Utils.showToast('正在上传餐厅logo!,请稍等'); | 778 | Utils.showToast('正在上传餐厅logo!,请稍等'); |
| 769 | return false; | 779 | return false; |
| 770 | } | 780 | } |
| 771 | - if (welcomeTextC.text.trim().length == 0) { | ||
| 772 | - Utils.showToast('请输入输入餐厅欢迎语!'); | ||
| 773 | - return false; | ||
| 774 | - } | 781 | + // if (welcomeTextC.text.trim().length == 0) { |
| 782 | + // Utils.showToast('请输入输入餐厅欢迎语!'); | ||
| 783 | + // return false; | ||
| 784 | + // } | ||
| 775 | 785 | ||
| 776 | //接口 | 786 | //接口 |
| 777 | Map marketingData = { | 787 | Map marketingData = { |
| 778 | - 'is_transpond': is_transpond ? '1' : '0', //转发同行客人 | 788 | + // 'is_transpond': is_transpond ? '1' : '0', //转发同行客人 |
| 789 | + 'is_transpond': '1', //转发同行客人 | ||
| 779 | 'is_arrival': is_arrival ? '1' : '0', //确认到店 | 790 | 'is_arrival': is_arrival ? '1' : '0', //确认到店 |
| 780 | 'is_online_book': is_online_book ? '1' : '0', //在线预订 | 791 | 'is_online_book': is_online_book ? '1' : '0', //在线预订 |
| 781 | 'is_order': is_order ? '1' : '0', //去点餐 | 792 | 'is_order': is_order ? '1' : '0', //去点餐 |
| 782 | 'is_coupon': '0', //代金券暂时 | 793 | 'is_coupon': '0', //代金券暂时 |
| 783 | 'is_recharge': '0', //充值券暂时 | 794 | 'is_recharge': '0', //充值券暂时 |
| 784 | - 'is_link': is_link ? '1' : '0', | ||
| 785 | - 'wecomle': welcomeTextC.text, | 795 | + // 'is_link': is_link ? '1' : '0', |
| 796 | + 'is_link': '0', | ||
| 797 | + 'wecomle': welcomeTextC.text ?? '', | ||
| 786 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, | 798 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, |
| 787 | }; | 799 | }; |
| 788 | Map<String, String> params = { | 800 | Map<String, String> params = { |
| @@ -332,8 +332,8 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -332,8 +332,8 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 332 | VEmptyView(10), | 332 | VEmptyView(10), |
| 333 | _itemTitleAndSubTtile('人数', '${reserveModel.pnum}'), | 333 | _itemTitleAndSubTtile('人数', '${reserveModel.pnum}'), |
| 334 | VEmptyView(10), | 334 | VEmptyView(10), |
| 335 | - _itemTitleAndSubTtile('地址', '${reserveModel.address}'), | ||
| 336 | - VEmptyView(10), | 335 | + // _itemTitleAndSubTtile('地址', '${reserveModel.address}'), |
| 336 | + // VEmptyView(10), | ||
| 337 | reserveModel.swichPark == '1' | 337 | reserveModel.swichPark == '1' |
| 338 | ? _itemTitleAndSubTtile('停车', '${reserveModel.parkInfo}') | 338 | ? _itemTitleAndSubTtile('停车', '${reserveModel.parkInfo}') |
| 339 | : SizedBox(), | 339 | : SizedBox(), |
| @@ -429,24 +429,27 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -429,24 +429,27 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 429 | children: [ | 429 | children: [ |
| 430 | Image.asset( | 430 | Image.asset( |
| 431 | Utils.getImgPath('location_blue'), | 431 | Utils.getImgPath('location_blue'), |
| 432 | - width: w(26), | 432 | + width: w(36), |
| 433 | ), | 433 | ), |
| 434 | HEmptyView(28), | 434 | HEmptyView(28), |
| 435 | Expanded( | 435 | Expanded( |
| 436 | child: Column( | 436 | child: Column( |
| 437 | crossAxisAlignment: CrossAxisAlignment.start, | 437 | crossAxisAlignment: CrossAxisAlignment.start, |
| 438 | children: [ | 438 | children: [ |
| 439 | - Text('${reserveModel.sellerName}', | 439 | + Text('【${reserveModel.sellerName}】', |
| 440 | style: TextStyle( | 440 | style: TextStyle( |
| 441 | color: MyColours.color_000000, | 441 | color: MyColours.color_000000, |
| 442 | fontWeight: FontWeight.bold, | 442 | fontWeight: FontWeight.bold, |
| 443 | fontSize: font(14))), | 443 | fontSize: font(14))), |
| 444 | VEmptyView(10), | 444 | VEmptyView(10), |
| 445 | - Text('${reserveModel.address}', | ||
| 446 | - style: TextStyle( | ||
| 447 | - height: 1.3, | ||
| 448 | - color: MyColours.color_000000, | ||
| 449 | - fontSize: font(14))), | 445 | + Padding( |
| 446 | + padding: EdgeInsets.only(left: w(8)), | ||
| 447 | + child: Text('${reserveModel.address}', | ||
| 448 | + style: TextStyle( | ||
| 449 | + height: 1.3, | ||
| 450 | + color: MyColours.color_000000, | ||
| 451 | + fontSize: font(14))), | ||
| 452 | + ), | ||
| 450 | ], | 453 | ], |
| 451 | )) | 454 | )) |
| 452 | ], | 455 | ], |
| @@ -536,32 +539,34 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -536,32 +539,34 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 536 | style: TextStyle(color: textColor, fontSize: font(14)), | 539 | style: TextStyle(color: textColor, fontSize: font(14)), |
| 537 | ), | 540 | ), |
| 538 | VEmptyView(32), | 541 | VEmptyView(32), |
| 539 | - Container( | ||
| 540 | - width: double.infinity, | ||
| 541 | - // margin: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 542 | - // padding: EdgeInsets.symmetric(horizontal: w(6)), | ||
| 543 | - decoration: BoxDecoration( | ||
| 544 | - border: Border( | ||
| 545 | - left: BorderSide( | ||
| 546 | - width: w(2), color: MyColours.color_EEAE74))), | 542 | + Expanded( |
| 547 | child: Container( | 543 | child: Container( |
| 548 | - width: double.infinity, | ||
| 549 | - padding: EdgeInsets.symmetric( | ||
| 550 | - horizontal: ScreenUtil().setWidth(12), | ||
| 551 | - ), | ||
| 552 | - alignment: Alignment.topLeft, | ||
| 553 | - child: Text( | ||
| 554 | - _marketingCenterProvider.markDataModel.store.introduce, | ||
| 555 | - style: TextStyle( | ||
| 556 | - height: 2, | ||
| 557 | - color: textColor, | ||
| 558 | - fontSize: ScreenUtil().setSp(20), | ||
| 559 | - textBaseline: TextBaseline.alphabetic), | ||
| 560 | - textAlign: TextAlign.center, | ||
| 561 | - overflow: TextOverflow.ellipsis, | ||
| 562 | - maxLines: 7, | ||
| 563 | - ), | ||
| 564 | - )), | 544 | + width: double.infinity, |
| 545 | + | ||
| 546 | + // margin: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 547 | + // padding: EdgeInsets.symmetric(horizontal: w(6)), | ||
| 548 | + decoration: BoxDecoration( | ||
| 549 | + border: Border( | ||
| 550 | + left: BorderSide( | ||
| 551 | + width: w(2), color: MyColours.color_EEAE74))), | ||
| 552 | + child: Container( | ||
| 553 | + width: double.infinity, | ||
| 554 | + padding: EdgeInsets.symmetric( | ||
| 555 | + horizontal: ScreenUtil().setWidth(12), | ||
| 556 | + ), | ||
| 557 | + alignment: Alignment.topLeft, | ||
| 558 | + child: Text( | ||
| 559 | + _marketingCenterProvider.markDataModel.store.introduce, | ||
| 560 | + style: TextStyle( | ||
| 561 | + height: 2, | ||
| 562 | + color: textColor, | ||
| 563 | + fontSize: ScreenUtil().setSp(20), | ||
| 564 | + textBaseline: TextBaseline.alphabetic), | ||
| 565 | + textAlign: TextAlign.center, | ||
| 566 | + overflow: TextOverflow.ellipsis, | ||
| 567 | + maxLines: 7, | ||
| 568 | + ), | ||
| 569 | + ))), | ||
| 565 | ], | 570 | ], |
| 566 | ), | 571 | ), |
| 567 | ); | 572 | ); |
| @@ -871,7 +876,8 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -871,7 +876,8 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 871 | ), | 876 | ), |
| 872 | ), | 877 | ), |
| 873 | VEmptyView(32), | 878 | VEmptyView(32), |
| 874 | - Container( | 879 | + Expanded( |
| 880 | + child: Container( | ||
| 875 | width: double.infinity, | 881 | width: double.infinity, |
| 876 | // margin: EdgeInsets.symmetric(horizontal: w(10)), | 882 | // margin: EdgeInsets.symmetric(horizontal: w(10)), |
| 877 | // padding: EdgeInsets.symmetric(horizontal: w(6)), | 883 | // padding: EdgeInsets.symmetric(horizontal: w(6)), |
| @@ -896,7 +902,7 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -896,7 +902,7 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 896 | maxLines: 7, | 902 | maxLines: 7, |
| 897 | overflow: TextOverflow.ellipsis, | 903 | overflow: TextOverflow.ellipsis, |
| 898 | )), | 904 | )), |
| 899 | - ), | 905 | + )), |
| 900 | ], | 906 | ], |
| 901 | ), | 907 | ), |
| 902 | ); | 908 | ); |
| @@ -1287,6 +1293,21 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -1287,6 +1293,21 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 1287 | fontSize: 32, | 1293 | fontSize: 32, |
| 1288 | height: w(42), | 1294 | height: w(42), |
| 1289 | isBold: true, | 1295 | isBold: true, |
| 1296 | + margin: EdgeInsets.only( | ||
| 1297 | + right: (_marketingCenterProvider | ||
| 1298 | + .markDataModel.marketing != | ||
| 1299 | + null && | ||
| 1300 | + _marketingCenterProvider.markDataModel | ||
| 1301 | + .marketing.isArrival == | ||
| 1302 | + '1') || | ||
| 1303 | + (_marketingCenterProvider | ||
| 1304 | + .markDataModel.marketing != | ||
| 1305 | + null && | ||
| 1306 | + _marketingCenterProvider.markDataModel | ||
| 1307 | + .marketing.isTranspond == | ||
| 1308 | + '1') | ||
| 1309 | + ? w(18) | ||
| 1310 | + : 0), | ||
| 1290 | onPressed: () async {}, | 1311 | onPressed: () async {}, |
| 1291 | ), | 1312 | ), |
| 1292 | if (_marketingCenterProvider.markDataModel.marketing != | 1313 | if (_marketingCenterProvider.markDataModel.marketing != |
| @@ -1305,6 +1326,15 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -1305,6 +1326,15 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 1305 | fontSize: 32, | 1326 | fontSize: 32, |
| 1306 | height: w(42), | 1327 | height: w(42), |
| 1307 | isBold: true, | 1328 | isBold: true, |
| 1329 | + margin: EdgeInsets.only( | ||
| 1330 | + right: (_marketingCenterProvider | ||
| 1331 | + .markDataModel.marketing != | ||
| 1332 | + null && | ||
| 1333 | + _marketingCenterProvider.markDataModel | ||
| 1334 | + .marketing.isTranspond == | ||
| 1335 | + '1') | ||
| 1336 | + ? w(18) | ||
| 1337 | + : 0), | ||
| 1308 | onPressed: () async {}, | 1338 | onPressed: () async {}, |
| 1309 | ), | 1339 | ), |
| 1310 | if (_marketingCenterProvider.markDataModel.marketing != | 1340 | if (_marketingCenterProvider.markDataModel.marketing != |
| @@ -1312,32 +1342,33 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -1312,32 +1342,33 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 1312 | _marketingCenterProvider | 1342 | _marketingCenterProvider |
| 1313 | .markDataModel.marketing.isTranspond == | 1343 | .markDataModel.marketing.isTranspond == |
| 1314 | '1') | 1344 | '1') |
| 1315 | - Container( | ||
| 1316 | - width: w(100), | ||
| 1317 | - height: w(42), | ||
| 1318 | - alignment: Alignment.center, | ||
| 1319 | - decoration: BoxDecoration( | ||
| 1320 | - borderRadius: BorderRadius.circular(r(21)), | ||
| 1321 | - gradient: LinearGradient( | ||
| 1322 | - stops: [ | ||
| 1323 | - -0.57, | ||
| 1324 | - 0.55, | ||
| 1325 | - 1.48 | ||
| 1326 | - ], | ||
| 1327 | - colors: [ | ||
| 1328 | - MyColours.color_4C8DAD, | ||
| 1329 | - MyColours.color_0143A3, | ||
| 1330 | - MyColours.color_42A5FF | ||
| 1331 | - ], | ||
| 1332 | - begin: Alignment.topLeft, | ||
| 1333 | - end: Alignment.bottomRight)), | ||
| 1334 | - child: Text( | ||
| 1335 | - '转发给客人', | ||
| 1336 | - style: TextStyle( | ||
| 1337 | - fontSize: font(16), | ||
| 1338 | - color: MyColours.color_F8F9FD, | ||
| 1339 | - fontWeight: FontWeight.bold), | ||
| 1340 | - )), | 1345 | + Expanded( |
| 1346 | + child: Container( | ||
| 1347 | + // width: w(100), | ||
| 1348 | + height: w(42), | ||
| 1349 | + alignment: Alignment.center, | ||
| 1350 | + decoration: BoxDecoration( | ||
| 1351 | + borderRadius: BorderRadius.circular(r(21)), | ||
| 1352 | + gradient: LinearGradient( | ||
| 1353 | + stops: [ | ||
| 1354 | + -0.57, | ||
| 1355 | + 0.55, | ||
| 1356 | + 1.48 | ||
| 1357 | + ], | ||
| 1358 | + colors: [ | ||
| 1359 | + MyColours.color_4C8DAD, | ||
| 1360 | + MyColours.color_0143A3, | ||
| 1361 | + MyColours.color_42A5FF | ||
| 1362 | + ], | ||
| 1363 | + begin: Alignment.topLeft, | ||
| 1364 | + end: Alignment.bottomRight)), | ||
| 1365 | + child: Text( | ||
| 1366 | + '转发给客人', | ||
| 1367 | + style: TextStyle( | ||
| 1368 | + fontSize: font(16), | ||
| 1369 | + color: MyColours.color_F8F9FD, | ||
| 1370 | + fontWeight: FontWeight.bold), | ||
| 1371 | + ))), | ||
| 1341 | ], | 1372 | ], |
| 1342 | ), | 1373 | ), |
| 1343 | ) | 1374 | ) |
| @@ -520,9 +520,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | @@ -520,9 +520,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { | ||
| 520 | _uploadImageProvider.storeImage3.qiniuUrl != '') { | 520 | _uploadImageProvider.storeImage3.qiniuUrl != '') { |
| 521 | images.add(_uploadImageProvider.storeImage3.qiniuUrl); | 521 | images.add(_uploadImageProvider.storeImage3.qiniuUrl); |
| 522 | } | 522 | } |
| 523 | - if (_uploadImageProvider.storeImage3.qiniuUrl != null && | ||
| 524 | - _uploadImageProvider.storeImage3.qiniuUrl != '') { | ||
| 525 | - images.add(_uploadImageProvider.storeImage3.qiniuUrl); | 523 | + if (_uploadImageProvider.storeImage4.qiniuUrl != null && |
| 524 | + _uploadImageProvider.storeImage4.qiniuUrl != '') { | ||
| 525 | + images.add(_uploadImageProvider.storeImage4.qiniuUrl); | ||
| 526 | } | 526 | } |
| 527 | if (images.length == 0) { | 527 | if (images.length == 0) { |
| 528 | Utils.showToast('请至少上传一张图片!'); | 528 | Utils.showToast('请至少上传一张图片!'); |
| @@ -2,13 +2,16 @@ import 'package:flutter/material.dart'; | @@ -2,13 +2,16 @@ import 'package:flutter/material.dart'; | ||
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | import 'package:one_key/route/navigator_util.dart'; | 3 | import 'package:one_key/route/navigator_util.dart'; |
| 4 | import 'package:one_key/widgets/MyDivider.dart'; | 4 | import 'package:one_key/widgets/MyDivider.dart'; |
| 5 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 5 | import 'package:one_key/widgets/v_empty_view.dart'; | 6 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 6 | import 'package:provider/provider.dart'; | 7 | import 'package:provider/provider.dart'; |
| 7 | 8 | ||
| 8 | import '../../../provider/marketing_center_provider.dart'; | 9 | import '../../../provider/marketing_center_provider.dart'; |
| 10 | +import '../../../provider/user_model.dart'; | ||
| 9 | import '../../../res/colors.dart'; | 11 | import '../../../res/colors.dart'; |
| 10 | import '../../../utils/event_bus.dart'; | 12 | import '../../../utils/event_bus.dart'; |
| 11 | import '../../../utils/screen_util.dart'; | 13 | import '../../../utils/screen_util.dart'; |
| 14 | +import '../../../utils/utils.dart'; | ||
| 12 | import '../../../widgets/round_button.dart'; | 15 | import '../../../widgets/round_button.dart'; |
| 13 | import '../../../widgets/system_app_bar.dart'; | 16 | import '../../../widgets/system_app_bar.dart'; |
| 14 | 17 | ||
| @@ -26,6 +29,26 @@ class MarketingCenterHomePage extends StatefulWidget { | @@ -26,6 +29,26 @@ class MarketingCenterHomePage extends StatefulWidget { | ||
| 26 | 29 | ||
| 27 | class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | 30 | class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { |
| 28 | MarketingCenterProvider marketingCenterProvider; | 31 | MarketingCenterProvider marketingCenterProvider; |
| 32 | + bool select = false; | ||
| 33 | + | ||
| 34 | + @override | ||
| 35 | + void initState() { | ||
| 36 | + super.initState(); | ||
| 37 | + | ||
| 38 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 39 | + getSellerTemplateConf(); | ||
| 40 | + }); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + getSellerTemplateConf() async { | ||
| 44 | + bool success = await marketingCenterProvider.getSellerTemplateConf(context); | ||
| 45 | + if (success && marketingCenterProvider.markDataModel != null) { | ||
| 46 | + select = marketingCenterProvider.markDataModel.isNewTemplate == '1' | ||
| 47 | + ? true | ||
| 48 | + : false; | ||
| 49 | + setState(() {}); | ||
| 50 | + } | ||
| 51 | + } | ||
| 29 | 52 | ||
| 30 | Widget _item(String title, {GestureTapCallback onTap}) { | 53 | Widget _item(String title, {GestureTapCallback onTap}) { |
| 31 | return InkWell( | 54 | return InkWell( |
| @@ -78,93 +101,166 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -78,93 +101,166 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 78 | EventBus().emit('changeStatusColor'); | 101 | EventBus().emit('changeStatusColor'); |
| 79 | Navigator.of(context).pop(); | 102 | Navigator.of(context).pop(); |
| 80 | }, | 103 | }, |
| 81 | - child: SingleChildScrollView( | ||
| 82 | - child: Column( | ||
| 83 | - children: [ | ||
| 84 | - // InkWell( | ||
| 85 | - // onTap: () { | ||
| 86 | - // // NavigatorUtil.goWebPage(context, '隐私政策', "zc", | ||
| 87 | - // // need: true); | ||
| 88 | - // }, | ||
| 89 | - // child: Padding( | ||
| 90 | - // padding: EdgeInsets.only( | ||
| 91 | - // left: w(16), | ||
| 92 | - // top: w(12), | ||
| 93 | - // bottom: w(12), | ||
| 94 | - // right: w(12)), | ||
| 95 | - // child: Row( | ||
| 96 | - // children: [ | ||
| 97 | - // Text( | ||
| 98 | - // '会员充值优惠活动', | ||
| 99 | - // style: TextStyle( | ||
| 100 | - // color: MyColours.color_515151, | ||
| 101 | - // fontSize: ScreenUtil().setWidth(32)), | ||
| 102 | - // ), | ||
| 103 | - // Spacer(), | ||
| 104 | - // Container( | ||
| 105 | - // padding: EdgeInsets.symmetric( | ||
| 106 | - // horizontal: w(7), vertical: w(4)), | ||
| 107 | - // child: Image.asset( | ||
| 108 | - // "assets/arrow_right_new.png", | ||
| 109 | - // width: ScreenUtil().setWidth(18), | ||
| 110 | - // height: ScreenUtil().setWidth(32), | ||
| 111 | - // ), | ||
| 112 | - // ) | ||
| 113 | - // ], | ||
| 114 | - // ))), | ||
| 115 | - // Padding( | ||
| 116 | - // padding: EdgeInsets.only(left: w(16)), | ||
| 117 | - // child: MyDivider(double.infinity, w(0.5), | ||
| 118 | - // color: MyColours.color_E7E7E7)), | ||
| 119 | - // VEmptyView(24), | ||
| 120 | - Padding( | ||
| 121 | - padding: EdgeInsets.only( | ||
| 122 | - left: w(16), top: w(12), bottom: w(12), right: w(12)), | ||
| 123 | - child: Row( | ||
| 124 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 125 | - children: [ | ||
| 126 | - Text( | ||
| 127 | - '预订安排通知定制', | ||
| 128 | - style: TextStyle( | ||
| 129 | - color: MyColours.color_515151, | ||
| 130 | - fontSize: ScreenUtil().setWidth(32)), | ||
| 131 | - ), | ||
| 132 | - RoundButton( | ||
| 133 | - text: '预览', | ||
| 134 | - gradientStart: MyColours.color_ffffff, | ||
| 135 | - gradientEnd: MyColours.color_ffffff, | ||
| 136 | - borderColor: MyColours.color_438E93, | ||
| 137 | - textColor: MyColours.color_438E93, | ||
| 138 | - radius: ScreenUtil().setWidth(22), | ||
| 139 | - fontSize: 24, | ||
| 140 | - width: w(72), | ||
| 141 | - height: ScreenUtil().setWidth(44), | ||
| 142 | - isBold: true, | ||
| 143 | - onPressed: () { | ||
| 144 | - NavigatorUtil.goMarkingPreviewPage(context); | ||
| 145 | - }, | ||
| 146 | - ), | ||
| 147 | - ])), | ||
| 148 | - _item('首图形象展示', onTap: () { | ||
| 149 | - NavigatorUtil.goFirstImagePage(context); | ||
| 150 | - }), | ||
| 151 | - _item('预订信息模块', onTap: () { | ||
| 152 | - NavigatorUtil.goBookInfoPage(context); | ||
| 153 | - }), | ||
| 154 | - _item('店铺介绍展示', onTap: () { | ||
| 155 | - NavigatorUtil.goStoreIntroducePage(context); | ||
| 156 | - }), | ||
| 157 | - _item('主厨介绍展示', onTap: () { | ||
| 158 | - NavigatorUtil.goChefIntroducePage(context); | ||
| 159 | - }), | ||
| 160 | - _item('招牌菜展示', onTap: () { | ||
| 161 | - NavigatorUtil.goDishShowPage(context); | ||
| 162 | - }), | ||
| 163 | - _item('营销及客户互动功能', onTap: () { | ||
| 164 | - NavigatorUtil.goMarkingInteractionPage(context); | ||
| 165 | - }), | ||
| 166 | - ], | ||
| 167 | - ), | 104 | + child: Column( |
| 105 | + children: [ | ||
| 106 | + Expanded( | ||
| 107 | + child: SingleChildScrollView( | ||
| 108 | + child: Column( | ||
| 109 | + children: [ | ||
| 110 | + // InkWell( | ||
| 111 | + // onTap: () { | ||
| 112 | + // // NavigatorUtil.goWebPage(context, '隐私政策', "zc", | ||
| 113 | + // // need: true); | ||
| 114 | + // }, | ||
| 115 | + // child: Padding( | ||
| 116 | + // padding: EdgeInsets.only( | ||
| 117 | + // left: w(16), | ||
| 118 | + // top: w(12), | ||
| 119 | + // bottom: w(12), | ||
| 120 | + // right: w(12)), | ||
| 121 | + // child: Row( | ||
| 122 | + // children: [ | ||
| 123 | + // Text( | ||
| 124 | + // '会员充值优惠活动', | ||
| 125 | + // style: TextStyle( | ||
| 126 | + // color: MyColours.color_515151, | ||
| 127 | + // fontSize: ScreenUtil().setWidth(32)), | ||
| 128 | + // ), | ||
| 129 | + // Spacer(), | ||
| 130 | + // Container( | ||
| 131 | + // padding: EdgeInsets.symmetric( | ||
| 132 | + // horizontal: w(7), vertical: w(4)), | ||
| 133 | + // child: Image.asset( | ||
| 134 | + // "assets/arrow_right_new.png", | ||
| 135 | + // width: ScreenUtil().setWidth(18), | ||
| 136 | + // height: ScreenUtil().setWidth(32), | ||
| 137 | + // ), | ||
| 138 | + // ) | ||
| 139 | + // ], | ||
| 140 | + // ))), | ||
| 141 | + // Padding( | ||
| 142 | + // padding: EdgeInsets.only(left: w(16)), | ||
| 143 | + // child: MyDivider(double.infinity, w(0.5), | ||
| 144 | + // color: MyColours.color_E7E7E7)), | ||
| 145 | + // VEmptyView(24), | ||
| 146 | + InkWell( | ||
| 147 | + onTap: () { | ||
| 148 | + setState(() { | ||
| 149 | + select = !select; | ||
| 150 | + }); | ||
| 151 | + }, | ||
| 152 | + child: Padding( | ||
| 153 | + padding: EdgeInsets.only( | ||
| 154 | + left: w(16), | ||
| 155 | + top: w(12), | ||
| 156 | + bottom: w(12), | ||
| 157 | + right: w(12)), | ||
| 158 | + child: Row( | ||
| 159 | + mainAxisAlignment: | ||
| 160 | + MainAxisAlignment.spaceBetween, | ||
| 161 | + children: [ | ||
| 162 | + Text( | ||
| 163 | + '启用预订安排通知图文模式', | ||
| 164 | + style: TextStyle( | ||
| 165 | + color: MyColours.color_515151, | ||
| 166 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 167 | + ), | ||
| 168 | + Spacer(), | ||
| 169 | + Container( | ||
| 170 | + padding: EdgeInsets.symmetric( | ||
| 171 | + horizontal: w(7), vertical: w(4)), | ||
| 172 | + child: Image.asset( | ||
| 173 | + Utils.getImgPath( | ||
| 174 | + select ? 'swich_on' : 'swich_off'), | ||
| 175 | + width: w(44), | ||
| 176 | + ), | ||
| 177 | + ) | ||
| 178 | + // RoundButton( | ||
| 179 | + // text: '预览', | ||
| 180 | + // gradientStart: MyColours.color_ffffff, | ||
| 181 | + // gradientEnd: MyColours.color_ffffff, | ||
| 182 | + // borderColor: MyColours.color_438E93, | ||
| 183 | + // textColor: MyColours.color_438E93, | ||
| 184 | + // radius: ScreenUtil().setWidth(22), | ||
| 185 | + // fontSize: 24, | ||
| 186 | + // width: w(72), | ||
| 187 | + // height: ScreenUtil().setWidth(44), | ||
| 188 | + // isBold: true, | ||
| 189 | + // onPressed: () { | ||
| 190 | + // NavigatorUtil.goMarkingPreviewPage(context); | ||
| 191 | + // }, | ||
| 192 | + // ), | ||
| 193 | + ]))), | ||
| 194 | + _item('首图形象展示', onTap: () { | ||
| 195 | + NavigatorUtil.goFirstImagePage(context); | ||
| 196 | + }), | ||
| 197 | + _item('预订信息模块', onTap: () { | ||
| 198 | + NavigatorUtil.goBookInfoPage(context); | ||
| 199 | + }), | ||
| 200 | + _item('店铺介绍展示', onTap: () { | ||
| 201 | + NavigatorUtil.goStoreIntroducePage(context); | ||
| 202 | + }), | ||
| 203 | + _item('主厨介绍展示', onTap: () { | ||
| 204 | + NavigatorUtil.goChefIntroducePage(context); | ||
| 205 | + }), | ||
| 206 | + _item('招牌菜展示', onTap: () { | ||
| 207 | + NavigatorUtil.goDishShowPage(context); | ||
| 208 | + }), | ||
| 209 | + _item('营销及客户互动功能', onTap: () { | ||
| 210 | + NavigatorUtil.goMarkingInteractionPage(context); | ||
| 211 | + }), | ||
| 212 | + ], | ||
| 213 | + ), | ||
| 214 | + )), | ||
| 215 | + Container( | ||
| 216 | + color: MyColours.color_ffffff, | ||
| 217 | + padding: EdgeInsets.only( | ||
| 218 | + left: w(23), right: w(23), top: w(12), bottom: w(25)), | ||
| 219 | + child: Row( | ||
| 220 | + children: [ | ||
| 221 | + RoundButton( | ||
| 222 | + text: '图文预览', | ||
| 223 | + width: w(100), | ||
| 224 | + gradientStart: MyColours.color_ffffff, | ||
| 225 | + gradientEnd: MyColours.color_ffffff, | ||
| 226 | + borderColor: MyColours.color_438E93, | ||
| 227 | + radius: r(5), | ||
| 228 | + fontSize: 32, | ||
| 229 | + height: w(40), | ||
| 230 | + textColor: MyColours.color_438E93, | ||
| 231 | + isBold: true, | ||
| 232 | + onPressed: () async { | ||
| 233 | + NavigatorUtil.goMarkingPreviewPage(context); | ||
| 234 | + }), | ||
| 235 | + HEmptyView(30), | ||
| 236 | + Expanded( | ||
| 237 | + child: RoundButton( | ||
| 238 | + text: '保存', | ||
| 239 | + gradientStart: MyColours.color_199095, | ||
| 240 | + gradientEnd: MyColours.color_199095, | ||
| 241 | + // borderColor: MyColours.color_999999, | ||
| 242 | + radius: r(5), | ||
| 243 | + fontSize: 32, | ||
| 244 | + height: w(40), | ||
| 245 | + isBold: true, | ||
| 246 | + onPressed: () async { | ||
| 247 | + //调用接口 | ||
| 248 | + Map<String, String> params = { | ||
| 249 | + 'sid': Provider.of<UserModel>(context, | ||
| 250 | + listen: false) | ||
| 251 | + .user | ||
| 252 | + .sellerid, | ||
| 253 | + 'key': 'is_new_template', | ||
| 254 | + 'value': select ? '1' : '0' | ||
| 255 | + }; | ||
| 256 | + | ||
| 257 | + bool success = await marketingCenterProvider | ||
| 258 | + .setConfing(context, params); | ||
| 259 | + if (success) {} | ||
| 260 | + })) | ||
| 261 | + ], | ||
| 262 | + )) | ||
| 263 | + ], | ||
| 168 | ))); | 264 | ))); |
| 169 | } | 265 | } |
| 170 | } | 266 | } |
| @@ -345,7 +345,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | @@ -345,7 +345,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | ||
| 345 | // 当前的任务状态 | 345 | // 当前的任务状态 |
| 346 | ///#相机拍照,单图选择 | 346 | ///#相机拍照,单图选择 |
| 347 | _getFromPictureOrCamera(imageSource) async { | 347 | _getFromPictureOrCamera(imageSource) async { |
| 348 | - final pickedFile = await picker.getImage(source: imageSource); | 348 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 349 | File compressedFile = await FlutterNativeImage.compressImage( | 349 | File compressedFile = await FlutterNativeImage.compressImage( |
| 350 | pickedFile.path, | 350 | pickedFile.path, |
| 351 | quality: 50, | 351 | quality: 50, |
| @@ -363,9 +363,13 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | @@ -363,9 +363,13 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> { | ||
| 363 | if (pickedFile != null) { | 363 | if (pickedFile != null) { |
| 364 | uploadImageProvider.dish.process = 0.01; | 364 | uploadImageProvider.dish.process = 0.01; |
| 365 | uploadImageProvider.dish.qiniuUrl = null; | 365 | uploadImageProvider.dish.qiniuUrl = null; |
| 366 | - | ||
| 367 | - UploadImageUtil().startUploadOnly( | ||
| 368 | - context, File(pickedFile.path), 3, true, uploadImageProvider); | 366 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 367 | + File file = File(pickedFile.path); | ||
| 368 | + if (need) { | ||
| 369 | + file = File(compressedFile.absolute.path); | ||
| 370 | + } | ||
| 371 | + UploadImageUtil() | ||
| 372 | + .startUploadOnly(context, file, 3, true, uploadImageProvider); | ||
| 369 | } | 373 | } |
| 370 | } | 374 | } |
| 371 | 375 |
| @@ -6,6 +6,7 @@ import 'package:cached_network_image/cached_network_image.dart'; | @@ -6,6 +6,7 @@ import 'package:cached_network_image/cached_network_image.dart'; | ||
| 6 | import 'package:dio/dio.dart'; | 6 | import 'package:dio/dio.dart'; |
| 7 | import 'package:flutter/material.dart'; | 7 | import 'package:flutter/material.dart'; |
| 8 | import 'package:flutter/services.dart'; | 8 | import 'package:flutter/services.dart'; |
| 9 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 9 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 10 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 10 | import 'package:one_key/models/get_seller_info_model.dart'; | 11 | import 'package:one_key/models/get_seller_info_model.dart'; |
| 11 | import 'package:one_key/models/seller_info.dart'; | 12 | import 'package:one_key/models/seller_info.dart'; |
| @@ -601,7 +602,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | @@ -601,7 +602,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | ||
| 601 | ///#相机拍照,单图选择 | 602 | ///#相机拍照,单图选择 |
| 602 | Future _getFromPictureOrCamera( | 603 | Future _getFromPictureOrCamera( |
| 603 | String title, UploadImgModel imgModel, imageSource) async { | 604 | String title, UploadImgModel imgModel, imageSource) async { |
| 604 | - final pickedFile = await picker.getImage(source: imageSource); | 605 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 605 | 606 | ||
| 606 | //从相册选取照片后进行裁剪压缩 | 607 | //从相册选取照片后进行裁剪压缩 |
| 607 | File yourFile = File(pickedFile.path); | 608 | File yourFile = File(pickedFile.path); |
| @@ -609,7 +610,11 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | @@ -609,7 +610,11 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | ||
| 609 | Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg); | 610 | Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg); |
| 610 | String path = await Utils.saveImage(newImg); | 611 | String path = await Utils.saveImage(newImg); |
| 611 | if (path == null) { | 612 | if (path == null) { |
| 612 | - path = pickedFile.path; | 613 | + File compressedFile = await FlutterNativeImage.compressImage( |
| 614 | + pickedFile.path, | ||
| 615 | + quality: 50, | ||
| 616 | + percentage: 50); | ||
| 617 | + path = compressedFile.path; | ||
| 613 | } | 618 | } |
| 614 | //更新本地存储,上传中展示 | 619 | //更新本地存储,上传中展示 |
| 615 | setState(() { | 620 | setState(() { |
| @@ -261,7 +261,7 @@ | @@ -261,7 +261,7 @@ | ||
| 261 | // ///#相机拍照,单图选择 | 261 | // ///#相机拍照,单图选择 |
| 262 | // Future _getFromPictureOrCamera( | 262 | // Future _getFromPictureOrCamera( |
| 263 | // String title, UploadImgModel imgModel, imageSource) async { | 263 | // String title, UploadImgModel imgModel, imageSource) async { |
| 264 | -// final pickedFile = await picker.getImage(source: imageSource); | 264 | +// final pickedFile = await picker.pickImage(source: imageSource); |
| 265 | // setState(() { | 265 | // setState(() { |
| 266 | // if (pickedFile != null) { | 266 | // if (pickedFile != null) { |
| 267 | // imgModel.file = File(pickedFile.path); | 267 | // imgModel.file = File(pickedFile.path); |
| @@ -70,6 +70,13 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | @@ -70,6 +70,13 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | ||
| 70 | }); | 70 | }); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | + @override | ||
| 74 | + void dispose() { | ||
| 75 | + super.dispose(); | ||
| 76 | + | ||
| 77 | + _uploadImageProvider.qiniuInfoSunModel.token = null; | ||
| 78 | + } | ||
| 79 | + | ||
| 73 | ///获取七牛云token | 80 | ///获取七牛云token |
| 74 | /// | 81 | /// |
| 75 | _getQiniuInfo() async { | 82 | _getQiniuInfo() async { |
| @@ -531,7 +531,7 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | @@ -531,7 +531,7 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | ||
| 531 | ])), | 531 | ])), |
| 532 | 532 | ||
| 533 | Container( | 533 | Container( |
| 534 | - height: ScreenUtil().setWidth(91 * 2), | 534 | + // height: ScreenUtil().setWidth(91 * 2), |
| 535 | width: double.infinity, | 535 | width: double.infinity, |
| 536 | padding: EdgeInsets.only( | 536 | padding: EdgeInsets.only( |
| 537 | top: ScreenUtil().setWidth(12 * 2), | 537 | top: ScreenUtil().setWidth(12 * 2), |
| @@ -94,7 +94,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -94,7 +94,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 94 | 94 | ||
| 95 | ///#相机拍照,单图选择 | 95 | ///#相机拍照,单图选择 |
| 96 | Future _getFromPictureOrCamera(imageSource) async { | 96 | Future _getFromPictureOrCamera(imageSource) async { |
| 97 | - final pickedFile = await picker.getImage(source: imageSource); | 97 | + final pickedFile = await picker.pickImage( |
| 98 | + source: imageSource, preferredCameraDevice: CameraDevice.rear); | ||
| 98 | File compressedFile = await FlutterNativeImage.compressImage( | 99 | File compressedFile = await FlutterNativeImage.compressImage( |
| 99 | pickedFile.path, | 100 | pickedFile.path, |
| 100 | quality: 50, | 101 | quality: 50, |
| @@ -133,9 +134,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -133,9 +134,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 133 | } else if (widget.uploadType == UploadType.WineManageType) { | 134 | } else if (widget.uploadType == UploadType.WineManageType) { |
| 134 | temp = widget.imageList; | 135 | temp = widget.imageList; |
| 135 | } | 136 | } |
| 136 | - | ||
| 137 | - UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 138 | - temp.length - 1, true, widget.model, widget.uploadType, | 137 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 138 | + File file = File(pickedFile.path); | ||
| 139 | + if (need) { | ||
| 140 | + file = File(compressedFile.absolute.path); | ||
| 141 | + } | ||
| 142 | + UploadImageUtil().startUpload( | ||
| 143 | + context, file, temp.length - 1, true, widget.model, widget.uploadType, | ||
| 139 | callback: widget.callback, countAll: 1, imageList: widget.imageList); | 144 | callback: widget.callback, countAll: 1, imageList: widget.imageList); |
| 140 | } | 145 | } |
| 141 | } | 146 | } |
| @@ -220,8 +225,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -220,8 +225,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 220 | 225 | ||
| 221 | temp.add(imgModel); | 226 | temp.add(imgModel); |
| 222 | }); | 227 | }); |
| 223 | - UploadImageUtil().startUpload(context, File(file.absolute.path), | ||
| 224 | - temp.length - 1, false, widget.model, widget.uploadType, | 228 | + bool need = await Utils.sizeNeed(file); |
| 229 | + | ||
| 230 | + if (need) { | ||
| 231 | + file = File(compressedFile.absolute.path); | ||
| 232 | + } | ||
| 233 | + UploadImageUtil().startUpload(context, file, temp.length - 1, false, | ||
| 234 | + widget.model, widget.uploadType, | ||
| 225 | countAll: imgList.length, | 235 | countAll: imgList.length, |
| 226 | callback: widget.callback, | 236 | callback: widget.callback, |
| 227 | imageList: widget.imageList); | 237 | imageList: widget.imageList); |
| @@ -103,7 +103,7 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | @@ -103,7 +103,7 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | ||
| 103 | 103 | ||
| 104 | ///#相机拍照,单图选择 | 104 | ///#相机拍照,单图选择 |
| 105 | Future _getFromPictureOrCamera(imageSource) async { | 105 | Future _getFromPictureOrCamera(imageSource) async { |
| 106 | - final pickedFile = await picker.getImage(source: imageSource); | 106 | + final pickedFile = await picker.pickImage(source: imageSource); |
| 107 | File compressedFile = await FlutterNativeImage.compressImage( | 107 | File compressedFile = await FlutterNativeImage.compressImage( |
| 108 | pickedFile.path, | 108 | pickedFile.path, |
| 109 | quality: 50, | 109 | quality: 50, |
| @@ -158,8 +158,13 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | @@ -158,8 +158,13 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | ||
| 158 | } else if (widget.uploadType == UploadType.FeastRemarkInvoiceType) { | 158 | } else if (widget.uploadType == UploadType.FeastRemarkInvoiceType) { |
| 159 | temp = widget.model.feastRemarkInvoiceImageList; | 159 | temp = widget.model.feastRemarkInvoiceImageList; |
| 160 | } | 160 | } |
| 161 | - UploadImageUtil().startUpload(context, File(pickedFile.path), | ||
| 162 | - temp.length - 1, true, widget.model, widget.uploadType, | 161 | + bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 162 | + File file = File(pickedFile.path); | ||
| 163 | + if (need) { | ||
| 164 | + file = File(compressedFile.absolute.path); | ||
| 165 | + } | ||
| 166 | + UploadImageUtil().startUpload( | ||
| 167 | + context, file, temp.length - 1, true, widget.model, widget.uploadType, | ||
| 163 | callback: widget.callback, | 168 | callback: widget.callback, |
| 164 | countAll: 1, | 169 | countAll: 1, |
| 165 | feastRemarkXtImageList: widget.feastRemarkXtImageList); | 170 | feastRemarkXtImageList: widget.feastRemarkXtImageList); |
| @@ -254,8 +259,17 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | @@ -254,8 +259,17 @@ class _ImgPickerFWidgetState extends DisposableState<ImgPickerFWidget> { | ||
| 254 | 259 | ||
| 255 | temp.add(imgModel); | 260 | temp.add(imgModel); |
| 256 | }); | 261 | }); |
| 257 | - UploadImageUtil().startUpload(context, File(file.absolute.path), | ||
| 258 | - temp.length - 1, false, widget.model, widget.uploadType, | 262 | + bool need = await Utils.sizeNeed(file); |
| 263 | + if (need) { | ||
| 264 | + file = File(compressedFile.absolute.path); | ||
| 265 | + } | ||
| 266 | + UploadImageUtil().startUpload( | ||
| 267 | + context, | ||
| 268 | + file, | ||
| 269 | + temp.length - 1, | ||
| 270 | + false, | ||
| 271 | + widget.model, | ||
| 272 | + widget.uploadType, | ||
| 259 | countAll: imgList.length, | 273 | countAll: imgList.length, |
| 260 | callback: widget.callback, | 274 | callback: widget.callback, |
| 261 | feastRemarkXtImageList: temp); | 275 | feastRemarkXtImageList: temp); |
| @@ -52,6 +52,30 @@ class MarketingCenterProvider extends ChangeNotifier { | @@ -52,6 +52,30 @@ class MarketingCenterProvider extends ChangeNotifier { | ||
| 52 | return false; | 52 | return false; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | + // 设置订座商家配置信息 | ||
| 56 | + Future<bool> setConfing(BuildContext context, Map<String, String> params, | ||
| 57 | + {bool showLoading = true}) async { | ||
| 58 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 59 | + .request<dynamic>(context, Method.get, HttpUrl.set_confing, | ||
| 60 | + data: params, showLoading: showLoading) | ||
| 61 | + .catchError((error) { | ||
| 62 | + print(error.toString()); | ||
| 63 | + Utils.showToast('设置失败,请重试'); | ||
| 64 | + return false; | ||
| 65 | + }); | ||
| 66 | + if (baseResp.code == Constant.status_success) { | ||
| 67 | + if (baseResp.data == 0 || baseResp.data == 1) { | ||
| 68 | + Utils.showToast('设置成功'); | ||
| 69 | + return true; | ||
| 70 | + } else { | ||
| 71 | + Utils.showToast('设置失败,请重试'); | ||
| 72 | + } | ||
| 73 | + } else { | ||
| 74 | + Utils.showToast(baseResp.msg ?? '设置失败,请重试'); | ||
| 75 | + } | ||
| 76 | + return false; | ||
| 77 | + } | ||
| 78 | + | ||
| 55 | // 获取商家获取预订安排模板页面 | 79 | // 获取商家获取预订安排模板页面 |
| 56 | Future<bool> getSellerTemplateConf(BuildContext context, | 80 | Future<bool> getSellerTemplateConf(BuildContext context, |
| 57 | {bool showLoading = true}) async { | 81 | {bool showLoading = true}) async { |
| @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; | @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; | ||
| 5 | import 'package:image_picker/image_picker.dart'; | 5 | import 'package:image_picker/image_picker.dart'; |
| 6 | 6 | ||
| 7 | import 'package:one_key/provider/upload_img_provider.dart'; | 7 | import 'package:one_key/provider/upload_img_provider.dart'; |
| 8 | +import 'package:one_key/utils/utils.dart'; | ||
| 8 | 9 | ||
| 9 | // import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; | 10 | // import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; |
| 10 | import 'package:qiniu_flutter_sdk_diox/qiniu_flutter_sdk_diox.dart'; | 11 | import 'package:qiniu_flutter_sdk_diox/qiniu_flutter_sdk_diox.dart'; |
| @@ -124,6 +125,7 @@ class UploadImageUtil { | @@ -124,6 +125,7 @@ class UploadImageUtil { | ||
| 124 | selectedFile, | 125 | selectedFile, |
| 125 | usedToken, | 126 | usedToken, |
| 126 | options: PutOptions( | 127 | options: PutOptions( |
| 128 | + // forceBySingle: | ||
| 127 | key: key, | 129 | key: key, |
| 128 | partSize: partSize, | 130 | partSize: partSize, |
| 129 | controller: putController, | 131 | controller: putController, |
| @@ -191,40 +193,88 @@ class UploadImageUtil { | @@ -191,40 +193,88 @@ class UploadImageUtil { | ||
| 191 | } | 193 | } |
| 192 | 194 | ||
| 193 | // 取消当前任务 | 195 | // 取消当前任务 |
| 194 | - putController.cancel(); | 196 | + // putController.cancel(); |
| 195 | // _image | 197 | // _image |
| 196 | uploadImageProvider.notifyListeners(); | 198 | uploadImageProvider.notifyListeners(); |
| 197 | }) | 199 | }) |
| 198 | ..catchError((dynamic error) { | 200 | ..catchError((dynamic error) { |
| 201 | + if (uploadType == UploadType.StoreFrontUploadType) { | ||
| 202 | + //门头 | ||
| 203 | + uploadImageProvider.imageListFront.removeAt(index); | ||
| 204 | + } else if (uploadType == UploadType.EnvironmentUploadType) { | ||
| 205 | + uploadImageProvider.imageListDenvironment.removeAt(index); | ||
| 206 | + } else if (uploadType == UploadType.ConsumptionUploadType) { | ||
| 207 | + //消费清单 | ||
| 208 | + uploadImageProvider.imageList.removeAt(index); | ||
| 209 | + } else if (uploadType == UploadType.TableManagerType) { | ||
| 210 | + //桌面照片管理 | ||
| 211 | + uploadImageProvider.tableImageList.removeAt(index); | ||
| 212 | + } else if (uploadType == UploadType.FeastRemarkType) { | ||
| 213 | + //宴会备注---意向 | ||
| 214 | + uploadImageProvider.feastRemarkImageList.removeAt(index); | ||
| 215 | + } else if (uploadType == UploadType.FeastRemarkXtType) { | ||
| 216 | + //宴会备注---选台 | ||
| 217 | + feastRemarkXtImageList.removeAt(index); | ||
| 218 | + } else if (uploadType == UploadType.FeastRemarkDjType) { | ||
| 219 | + //宴会备注---定金 | ||
| 220 | + uploadImageProvider.feastRemarkDjImageList.removeAt(index); | ||
| 221 | + } else if (uploadType == UploadType.FeastRemarkContractType) { | ||
| 222 | + //宴会备注 ---合同 | ||
| 223 | + uploadImageProvider.feastRemarkContractImageList.removeAt(index); | ||
| 224 | + } else if (uploadType == UploadType.FeastRemarkInvoiceType) { | ||
| 225 | + //宴会备注 ---发票 | ||
| 226 | + uploadImageProvider.feastRemarkInvoiceImageList.removeAt(index); | ||
| 227 | + } else if (uploadType == UploadType.InvitationStoreType) { | ||
| 228 | + //宴会备注 ---发票 | ||
| 229 | + uploadImageProvider.feastRemarkInvoiceImageList.removeAt(index); | ||
| 230 | + } else if (uploadType == UploadType.WineManageType) { | ||
| 231 | + //新建存酒 | ||
| 232 | + imageList.removeAt(index); | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + // 取消当前任务 | ||
| 236 | + putController.cancel(); | ||
| 237 | + uploadImageProvider.notifyListeners(); | ||
| 199 | if (error is StorageError) { | 238 | if (error is StorageError) { |
| 200 | switch (error.type) { | 239 | switch (error.type) { |
| 201 | case StorageErrorType.CONNECT_TIMEOUT: | 240 | case StorageErrorType.CONNECT_TIMEOUT: |
| 202 | - print('发生错误: 连接超时'); | 241 | + Utils.showToast('发生错误: 连接超时'); |
| 203 | break; | 242 | break; |
| 204 | case StorageErrorType.SEND_TIMEOUT: | 243 | case StorageErrorType.SEND_TIMEOUT: |
| 205 | print('发生错误: 发送数据超时'); | 244 | print('发生错误: 发送数据超时'); |
| 245 | + Utils.showToast('发生错误: 发送数据超时'); | ||
| 206 | break; | 246 | break; |
| 207 | case StorageErrorType.RECEIVE_TIMEOUT: | 247 | case StorageErrorType.RECEIVE_TIMEOUT: |
| 208 | print('发生错误: 响应数据超时'); | 248 | print('发生错误: 响应数据超时'); |
| 249 | + Utils.showToast('发生错误: 响应数据超时'); | ||
| 209 | break; | 250 | break; |
| 210 | case StorageErrorType.RESPONSE: | 251 | case StorageErrorType.RESPONSE: |
| 211 | print('发生错误: ${error.message}'); | 252 | print('发生错误: ${error.message}'); |
| 253 | + Utils.showToast('发生错误: ${error.message}'); | ||
| 254 | + // Utils.showToast('发生错误000: ${error}'); | ||
| 255 | + // Utils.showToast('发生错误000: ${error.code}'); | ||
| 256 | + // Utils.showToast('发生错误000: ${error.message}'); | ||
| 212 | break; | 257 | break; |
| 213 | case StorageErrorType.CANCEL: | 258 | case StorageErrorType.CANCEL: |
| 214 | print('发生错误: 请求取消'); | 259 | print('发生错误: 请求取消'); |
| 260 | + Utils.showToast('发生错误: 请求取消'); | ||
| 215 | break; | 261 | break; |
| 216 | case StorageErrorType.UNKNOWN: | 262 | case StorageErrorType.UNKNOWN: |
| 217 | - print('发生错误: 未知错误'); | 263 | + print('发生错误: '); |
| 264 | + Utils.showToast('发生错误: 未知错误'); | ||
| 218 | break; | 265 | break; |
| 219 | case StorageErrorType.NO_AVAILABLE_HOST: | 266 | case StorageErrorType.NO_AVAILABLE_HOST: |
| 220 | print('发生错误: 无可用 Host'); | 267 | print('发生错误: 无可用 Host'); |
| 268 | + Utils.showToast('发生错误: 无可用 Host'); | ||
| 221 | break; | 269 | break; |
| 222 | case StorageErrorType.IN_PROGRESS: | 270 | case StorageErrorType.IN_PROGRESS: |
| 223 | print('发生错误: 已在队列中'); | 271 | print('发生错误: 已在队列中'); |
| 272 | + Utils.showToast('发生错误: 已在队列中'); | ||
| 224 | break; | 273 | break; |
| 225 | } | 274 | } |
| 226 | } else { | 275 | } else { |
| 227 | print('发生错误: ${error.toString()}'); | 276 | print('发生错误: ${error.toString()}'); |
| 277 | + Utils.showToast('发生错误: ${error.toString()}'); | ||
| 228 | } | 278 | } |
| 229 | 279 | ||
| 230 | print('------------------------'); | 280 | print('------------------------'); |
| @@ -306,7 +356,7 @@ class UploadImageUtil { | @@ -306,7 +356,7 @@ class UploadImageUtil { | ||
| 306 | response.rawData['key']; | 356 | response.rawData['key']; |
| 307 | 357 | ||
| 308 | // 取消当前任务 | 358 | // 取消当前任务 |
| 309 | - putController.cancel(); | 359 | + // putController.cancel(); |
| 310 | if (index == 0) { | 360 | if (index == 0) { |
| 311 | uploadImageProvider.touxiang.process = 1; | 361 | uploadImageProvider.touxiang.process = 1; |
| 312 | uploadImageProvider.touxiang.qiniuUrl = imgUrl; | 362 | uploadImageProvider.touxiang.qiniuUrl = imgUrl; |
| @@ -355,35 +405,94 @@ class UploadImageUtil { | @@ -355,35 +405,94 @@ class UploadImageUtil { | ||
| 355 | } | 405 | } |
| 356 | }) | 406 | }) |
| 357 | ..catchError((dynamic error) { | 407 | ..catchError((dynamic error) { |
| 408 | + if (index == 0) { | ||
| 409 | + uploadImageProvider.touxiang.process = 0; | ||
| 410 | + uploadImageProvider.touxiang.qiniuUrl = null; | ||
| 411 | + uploadImageProvider.touxiang.file = null; | ||
| 412 | + uploadImageProvider.notifyListeners(); | ||
| 413 | + } else if (index == 1) { | ||
| 414 | + uploadImageProvider.erweima.process = 0; | ||
| 415 | + uploadImageProvider.erweima.qiniuUrl = null; | ||
| 416 | + uploadImageProvider.erweima.file = null; | ||
| 417 | + uploadImageProvider.notifyListeners(); | ||
| 418 | + } else if (index == 2) { | ||
| 419 | + uploadImageProvider.mentou.process = 0; | ||
| 420 | + uploadImageProvider.mentou.qiniuUrl = null; | ||
| 421 | + uploadImageProvider.mentou.file = null; | ||
| 422 | + uploadImageProvider.notifyListeners(); | ||
| 423 | + } else if (index == 3) { | ||
| 424 | + uploadImageProvider.dish.process = 0; | ||
| 425 | + uploadImageProvider.dish.qiniuUrl = null; | ||
| 426 | + uploadImageProvider.dish.file = null; | ||
| 427 | + uploadImageProvider.notifyListeners(); | ||
| 428 | + } else if (index == 4) { | ||
| 429 | + uploadImageProvider.firstImage.process = 0; | ||
| 430 | + uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 431 | + uploadImageProvider.firstImage.file = null; | ||
| 432 | + uploadImageProvider.notifyListeners(); | ||
| 433 | + } else if (index == 5) { | ||
| 434 | + uploadImageProvider.storeImage1.process = 0; | ||
| 435 | + uploadImageProvider.storeImage1.qiniuUrl = null; | ||
| 436 | + uploadImageProvider.storeImage1.file = null; | ||
| 437 | + uploadImageProvider.notifyListeners(); | ||
| 438 | + } else if (index == 6) { | ||
| 439 | + uploadImageProvider.storeImage2.process = 0; | ||
| 440 | + uploadImageProvider.storeImage2.qiniuUrl = null; | ||
| 441 | + uploadImageProvider.storeImage2.file = null; | ||
| 442 | + uploadImageProvider.notifyListeners(); | ||
| 443 | + } else if (index == 7) { | ||
| 444 | + uploadImageProvider.storeImage3.process = 0; | ||
| 445 | + uploadImageProvider.storeImage3.qiniuUrl = null; | ||
| 446 | + uploadImageProvider.storeImage3.file = null; | ||
| 447 | + uploadImageProvider.notifyListeners(); | ||
| 448 | + } else if (index == 8) { | ||
| 449 | + uploadImageProvider.storeImage4.process = 0; | ||
| 450 | + uploadImageProvider.storeImage4.qiniuUrl = null; | ||
| 451 | + uploadImageProvider.storeImage4.file = null; | ||
| 452 | + uploadImageProvider.notifyListeners(); | ||
| 453 | + } | ||
| 454 | + // 取消当前任务 | ||
| 455 | + putController.cancel(); | ||
| 456 | + uploadImageProvider.notifyListeners(); | ||
| 358 | if (error is StorageError) { | 457 | if (error is StorageError) { |
| 359 | switch (error.type) { | 458 | switch (error.type) { |
| 360 | case StorageErrorType.CONNECT_TIMEOUT: | 459 | case StorageErrorType.CONNECT_TIMEOUT: |
| 361 | - print('发生错误: 连接超时'); | 460 | + Utils.showToast('发生错误: 连接超时'); |
| 362 | break; | 461 | break; |
| 363 | case StorageErrorType.SEND_TIMEOUT: | 462 | case StorageErrorType.SEND_TIMEOUT: |
| 364 | print('发生错误: 发送数据超时'); | 463 | print('发生错误: 发送数据超时'); |
| 464 | + Utils.showToast('发生错误: 发送数据超时'); | ||
| 365 | break; | 465 | break; |
| 366 | case StorageErrorType.RECEIVE_TIMEOUT: | 466 | case StorageErrorType.RECEIVE_TIMEOUT: |
| 367 | print('发生错误: 响应数据超时'); | 467 | print('发生错误: 响应数据超时'); |
| 468 | + Utils.showToast('发生错误: 响应数据超时'); | ||
| 368 | break; | 469 | break; |
| 369 | case StorageErrorType.RESPONSE: | 470 | case StorageErrorType.RESPONSE: |
| 370 | print('发生错误: ${error.message}'); | 471 | print('发生错误: ${error.message}'); |
| 472 | + // Utils.showToast('发生错误000: ${error}'); | ||
| 473 | + // Utils.showToast('发生错误000: ${error.code}'); | ||
| 474 | + Utils.showToast('发生错误: ${error.message}'); | ||
| 371 | break; | 475 | break; |
| 372 | case StorageErrorType.CANCEL: | 476 | case StorageErrorType.CANCEL: |
| 373 | print('发生错误: 请求取消'); | 477 | print('发生错误: 请求取消'); |
| 478 | + Utils.showToast('发生错误: 请求取消'); | ||
| 374 | break; | 479 | break; |
| 375 | case StorageErrorType.UNKNOWN: | 480 | case StorageErrorType.UNKNOWN: |
| 376 | - print('发生错误: 未知错误'); | 481 | + print('发生错误: '); |
| 482 | + Utils.showToast('发生错误: 未知错误'); | ||
| 377 | break; | 483 | break; |
| 378 | case StorageErrorType.NO_AVAILABLE_HOST: | 484 | case StorageErrorType.NO_AVAILABLE_HOST: |
| 379 | print('发生错误: 无可用 Host'); | 485 | print('发生错误: 无可用 Host'); |
| 486 | + Utils.showToast('发生错误: 无可用 Host'); | ||
| 380 | break; | 487 | break; |
| 381 | case StorageErrorType.IN_PROGRESS: | 488 | case StorageErrorType.IN_PROGRESS: |
| 382 | print('发生错误: 已在队列中'); | 489 | print('发生错误: 已在队列中'); |
| 490 | + Utils.showToast('发生错误: 已在队列中'); | ||
| 383 | break; | 491 | break; |
| 384 | } | 492 | } |
| 385 | } else { | 493 | } else { |
| 386 | print('发生错误: ${error.toString()}'); | 494 | print('发生错误: ${error.toString()}'); |
| 495 | + Utils.showToast('发生错误: ${error.toString()}'); | ||
| 387 | } | 496 | } |
| 388 | 497 | ||
| 389 | print('------------------------'); | 498 | print('------------------------'); |
| @@ -1415,6 +1415,7 @@ class Utils { | @@ -1415,6 +1415,7 @@ class Utils { | ||
| 1415 | //image_cropper插件,中心点裁剪固定比例的图片 | 1415 | //image_cropper插件,中心点裁剪固定比例的图片 |
| 1416 | String imgPath = await saveImage(data); | 1416 | String imgPath = await saveImage(data); |
| 1417 | Uint8List afterImg = data; | 1417 | Uint8List afterImg = data; |
| 1418 | + | ||
| 1418 | if (imgPath != null) { | 1419 | if (imgPath != null) { |
| 1419 | final croppedImage = await ImageCropper().cropImage( | 1420 | final croppedImage = await ImageCropper().cropImage( |
| 1420 | sourcePath: imgPath, | 1421 | sourcePath: imgPath, |
| @@ -1501,6 +1502,23 @@ class Utils { | @@ -1501,6 +1502,23 @@ class Utils { | ||
| 1501 | return res; | 1502 | return res; |
| 1502 | } | 1503 | } |
| 1503 | 1504 | ||
| 1505 | + /// 大于3.99 压缩 | ||
| 1506 | + static Future<bool> sizeNeed(File file) async{ | ||
| 1507 | + Uint8List afterImg = await file.readAsBytes(); | ||
| 1508 | + String res = ""; | ||
| 1509 | + final int unit = 1024; | ||
| 1510 | + final int m = unit * unit; // 1M | ||
| 1511 | + // 如果小于 1 兆,显示 KB | ||
| 1512 | + // if (length < 1 * m) { | ||
| 1513 | + // res = (length / unit).toStringAsFixed(0) + " KB"; | ||
| 1514 | + // } | ||
| 1515 | + // 如果大于 1 兆,显示 MB,并保留一位小数 | ||
| 1516 | + if (afterImg.length / m > 3.99) { | ||
| 1517 | + return true; | ||
| 1518 | + } | ||
| 1519 | + return false; | ||
| 1520 | + } | ||
| 1521 | + | ||
| 1504 | /// Uint8List 转 Image 方式一 | 1522 | /// Uint8List 转 Image 方式一 |
| 1505 | 1523 | ||
| 1506 | /// Uint8List 转 Image 方式二 | 1524 | /// Uint8List 转 Image 方式二 |
| @@ -1543,7 +1561,7 @@ class Utils { | @@ -1543,7 +1561,7 @@ class Utils { | ||
| 1543 | title: _title, | 1561 | title: _title, |
| 1544 | path: _path, | 1562 | path: _path, |
| 1545 | description: _description, | 1563 | description: _description, |
| 1546 | - miniProgramType: WXMiniProgramType.PREVIEW, //体验版 | 1564 | + // miniProgramType: WXMiniProgramType.PREVIEW, //体验版 |
| 1547 | // miniProgramType: WXMiniProgramType.RELEASE //正式版 | 1565 | // miniProgramType: WXMiniProgramType.RELEASE //正式版 |
| 1548 | // miniProgramType: WXMiniProgramType.TEST //开发版 | 1566 | // miniProgramType: WXMiniProgramType.TEST //开发版 |
| 1549 | // thumbnail: WeChatImage.binary(source) | 1567 | // thumbnail: WeChatImage.binary(source) |
| @@ -322,7 +322,7 @@ packages: | @@ -322,7 +322,7 @@ packages: | ||
| 322 | name: dio | 322 | name: dio |
| 323 | url: "https://pub.flutter-io.cn" | 323 | url: "https://pub.flutter-io.cn" |
| 324 | source: hosted | 324 | source: hosted |
| 325 | - version: "5.0.0" | 325 | + version: "5.1.0" |
| 326 | diox: | 326 | diox: |
| 327 | dependency: transitive | 327 | dependency: transitive |
| 328 | description: | 328 | description: |
| @@ -474,7 +474,7 @@ packages: | @@ -474,7 +474,7 @@ packages: | ||
| 474 | name: flutter_inappwebview | 474 | name: flutter_inappwebview |
| 475 | url: "https://pub.flutter-io.cn" | 475 | url: "https://pub.flutter-io.cn" |
| 476 | source: hosted | 476 | source: hosted |
| 477 | - version: "5.3.2" | 477 | + version: "5.7.2+3" |
| 478 | flutter_keyboard_visibility: | 478 | flutter_keyboard_visibility: |
| 479 | dependency: "direct main" | 479 | dependency: "direct main" |
| 480 | description: | 480 | description: |
| @@ -40,7 +40,8 @@ dependencies: | @@ -40,7 +40,8 @@ dependencies: | ||
| 40 | # 网络 | 40 | # 网络 |
| 41 | # dio: ^3.0.10 | 41 | # dio: ^3.0.10 |
| 42 | # dio: ^4.0.6 | 42 | # dio: ^4.0.6 |
| 43 | - dio: ^5.0.0 | 43 | + # dio: ^5.0.0 |
| 44 | + dio: ^5.1.0 | ||
| 44 | # 屏幕适配 | 45 | # 屏幕适配 |
| 45 | flutter_screenutil: ^5.5.3+2 | 46 | flutter_screenutil: ^5.5.3+2 |
| 46 | # 路由管理 | 47 | # 路由管理 |
| @@ -118,6 +119,7 @@ dependencies: | @@ -118,6 +119,7 @@ dependencies: | ||
| 118 | #七牛云sdk | 119 | #七牛云sdk |
| 119 | # qiniu_flutter_sdk: ^0.2.0 | 120 | # qiniu_flutter_sdk: ^0.2.0 |
| 120 | # qiniu_flutter_sdk: ^0.4.0 | 121 | # qiniu_flutter_sdk: ^0.4.0 |
| 122 | + # qiniu_flutter_sdk: ^0.4.0 | ||
| 121 | qiniu_flutter_sdk_diox: ^0.4.1 | 123 | qiniu_flutter_sdk_diox: ^0.4.1 |
| 122 | #相机拍照,单图选择 | 124 | #相机拍照,单图选择 |
| 123 | # image_picker: ^0.6.7+21 | 125 | # image_picker: ^0.6.7+21 |
| @@ -159,7 +161,8 @@ dependencies: | @@ -159,7 +161,8 @@ dependencies: | ||
| 159 | flutter_staggered_grid_view: ^0.4.1 | 161 | flutter_staggered_grid_view: ^0.4.1 |
| 160 | # webview | 162 | # webview |
| 161 | # webview_flutter: ^2.0.13 | 163 | # webview_flutter: ^2.0.13 |
| 162 | - flutter_inappwebview: ^5.3.2 | 164 | + # flutter_inappwebview: ^5.3.2 |
| 165 | + flutter_inappwebview: ^5.7.2+3 | ||
| 163 | # flutter_downloader: ^1.7.1 | 166 | # flutter_downloader: ^1.7.1 |
| 164 | # open_file: ^3.2.1 | 167 | # open_file: ^3.2.1 |
| 165 | 168 |
-
Please register or login to post a comment