Commit 5eec861b947084e4d44a0b22619bcfbce9e8e447
1 parent
430c0db0
营销中心图片显示高度自适应,宽度充满整个屏幕&&隐藏企业微信通知按钮
Showing
14 changed files
with
343 additions
and
305 deletions
| @@ -136,6 +136,6 @@ class Table { | @@ -136,6 +136,6 @@ class Table { | ||
| 136 | 136 | ||
| 137 | @override | 137 | @override |
| 138 | String toString() { | 138 | String toString() { |
| 139 | - return 'Table{id: $id,isPhoto:$isPhoto rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, isExitsClass:$isExitsClass,max: $max, low: $low, is_lock: $isLock, is_merge: $isMerge,tids:$tids,lock_tname:$lockTname,reserveCount:$reserveCount,phone:$phone,lock_tid:$lockTid,rname:$rname,}'; | 139 | + return 'Table{id: $id,is_photo:$isPhoto rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, isExitsClass:$isExitsClass,max: $max, low: $low, is_lock: $isLock, is_merge: $isMerge,tids:$tids,lock_tname:$lockTname,reserveCount:$reserveCount,phone:$phone,lock_tid:$lockTid,rname:$rname,}'; |
| 140 | } | 140 | } |
| 141 | } | 141 | } |
| @@ -34,7 +34,7 @@ Table _$TableFromJson(Map<String, dynamic> json) { | @@ -34,7 +34,7 @@ Table _$TableFromJson(Map<String, dynamic> json) { | ||
| 34 | ..tidsCancel = json['tids'] as String | 34 | ..tidsCancel = json['tids'] as String |
| 35 | ..lockTname = json['lock_tname'] as String | 35 | ..lockTname = json['lock_tname'] as String |
| 36 | ..reserveCount = json['reserveCount'] as String | 36 | ..reserveCount = json['reserveCount'] as String |
| 37 | - ..phone=json['phone'] as String | 37 | + ..phone = json['phone'] as String |
| 38 | ..lockTid = json['lock_tid'] as String; | 38 | ..lockTid = json['lock_tid'] as String; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -43,7 +43,7 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{ | @@ -43,7 +43,7 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{ | ||
| 43 | 'rid': instance.rid, | 43 | 'rid': instance.rid, |
| 44 | 'tid': instance.tid, | 44 | 'tid': instance.tid, |
| 45 | 'name': instance.name, | 45 | 'name': instance.name, |
| 46 | - 'isPhoto': instance.isPhoto, | 46 | + 'is_photo': instance.isPhoto, |
| 47 | 'table_pnum': instance.table_pnum, | 47 | 'table_pnum': instance.table_pnum, |
| 48 | 'most_pnum': instance.most_pnum, | 48 | 'most_pnum': instance.most_pnum, |
| 49 | 'order_o': instance.order_o, | 49 | 'order_o': instance.order_o, |
| @@ -65,5 +65,5 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{ | @@ -65,5 +65,5 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{ | ||
| 65 | 'lock_tname': instance.lockTname, | 65 | 'lock_tname': instance.lockTname, |
| 66 | 'lock_tid': instance.lockTid, | 66 | 'lock_tid': instance.lockTid, |
| 67 | 'reserveCount': instance.reserveCount, | 67 | 'reserveCount': instance.reserveCount, |
| 68 | - 'phone':instance.phone | 68 | + 'phone': instance.phone |
| 69 | }; | 69 | }; |
| @@ -192,7 +192,7 @@ class _CreateStorePageState extends State<CreateStorePage> { | @@ -192,7 +192,7 @@ class _CreateStorePageState extends State<CreateStorePage> { | ||
| 192 | final pickedFile = await picker.pickImage(source: imageSource); | 192 | final pickedFile = await picker.pickImage(source: imageSource); |
| 193 | File compressedFile = await FlutterNativeImage.compressImage( | 193 | File compressedFile = await FlutterNativeImage.compressImage( |
| 194 | pickedFile.path, | 194 | pickedFile.path, |
| 195 | - quality: 50, | 195 | + quality: 70, |
| 196 | percentage: 50); | 196 | percentage: 50); |
| 197 | setState(() { | 197 | setState(() { |
| 198 | if (pickedFile != null) { | 198 | if (pickedFile != null) { |
| @@ -79,7 +79,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -79,7 +79,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 79 | // print(ddd); | 79 | // print(ddd); |
| 80 | File compressedFile = await FlutterNativeImage.compressImage( | 80 | File compressedFile = await FlutterNativeImage.compressImage( |
| 81 | pickedFile.path, | 81 | pickedFile.path, |
| 82 | - quality: 50, | 82 | + quality: 70, |
| 83 | percentage: 50); | 83 | percentage: 50); |
| 84 | setState(() { | 84 | setState(() { |
| 85 | if (pickedFile != null) { | 85 | if (pickedFile != null) { |
| @@ -132,7 +132,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | @@ -132,7 +132,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> { | ||
| 132 | if (pickedFile != null) { | 132 | if (pickedFile != null) { |
| 133 | File compressedFile = await FlutterNativeImage.compressImage( | 133 | File compressedFile = await FlutterNativeImage.compressImage( |
| 134 | pickedFile.path, | 134 | pickedFile.path, |
| 135 | - quality: 50, | 135 | + quality: 70, |
| 136 | percentage: 50); | 136 | percentage: 50); |
| 137 | UploadImgModel imgModel = UploadImgModel(); | 137 | UploadImgModel imgModel = UploadImgModel(); |
| 138 | imgModel.file = File(pickedFile.path); | 138 | imgModel.file = File(pickedFile.path); |
| @@ -4699,29 +4699,29 @@ class InvicationPageState extends State<InvicationPage> | @@ -4699,29 +4699,29 @@ class InvicationPageState extends State<InvicationPage> | ||
| 4699 | } | 4699 | } |
| 4700 | }), | 4700 | }), |
| 4701 | HEmptyView(20), | 4701 | HEmptyView(20), |
| 4702 | - RoundButton( | ||
| 4703 | - text: '企业微信通知', | ||
| 4704 | - width: ScreenUtil().setWidth(110 * 2), | ||
| 4705 | - height: ScreenUtil().setWidth(96), | ||
| 4706 | - fontSize: 30, | ||
| 4707 | - textColor: MyColours.color_999999, | ||
| 4708 | - gradientStart: MyColours.color_f3f3f3, | ||
| 4709 | - gradientEnd: MyColours.color_f3f3f3, | ||
| 4710 | - radius: ScreenUtil().setWidth(8), | ||
| 4711 | - isBold: false, | ||
| 4712 | - onPressed: () async { | ||
| 4713 | - dynamic isSuccess = await Utils.goShareInvicationToWeChat( | ||
| 4714 | - context, | ||
| 4715 | - widget.rid, | ||
| 4716 | - Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 4717 | - isWechat: false); | ||
| 4718 | - print(isSuccess); | ||
| 4719 | - // if (isSuccess) { | ||
| 4720 | - // // _addForward(); | ||
| 4721 | - // } | ||
| 4722 | - }, | ||
| 4723 | - ), | ||
| 4724 | - HEmptyView(20), | 4702 | + // RoundButton( |
| 4703 | + // text: '企业微信通知', | ||
| 4704 | + // width: ScreenUtil().setWidth(110 * 2), | ||
| 4705 | + // height: ScreenUtil().setWidth(96), | ||
| 4706 | + // fontSize: 30, | ||
| 4707 | + // textColor: MyColours.color_999999, | ||
| 4708 | + // gradientStart: MyColours.color_f3f3f3, | ||
| 4709 | + // gradientEnd: MyColours.color_f3f3f3, | ||
| 4710 | + // radius: ScreenUtil().setWidth(8), | ||
| 4711 | + // isBold: false, | ||
| 4712 | + // onPressed: () async { | ||
| 4713 | + // dynamic isSuccess = await Utils.goShareInvicationToWeChat( | ||
| 4714 | + // context, | ||
| 4715 | + // widget.rid, | ||
| 4716 | + // Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 4717 | + // isWechat: false); | ||
| 4718 | + // print(isSuccess); | ||
| 4719 | + // // if (isSuccess) { | ||
| 4720 | + // // // _addForward(); | ||
| 4721 | + // // } | ||
| 4722 | + // }, | ||
| 4723 | + // ), | ||
| 4724 | + // HEmptyView(20), | ||
| 4725 | Expanded( | 4725 | Expanded( |
| 4726 | child: Stack(children: [ | 4726 | child: Stack(children: [ |
| 4727 | Row( | 4727 | Row( |
| @@ -405,7 +405,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | @@ -405,7 +405,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { | ||
| 405 | final pickedFile = await picker.pickImage(source: imageSource); | 405 | final pickedFile = await picker.pickImage(source: imageSource); |
| 406 | File compressedFile = await FlutterNativeImage.compressImage( | 406 | File compressedFile = await FlutterNativeImage.compressImage( |
| 407 | pickedFile.path, | 407 | pickedFile.path, |
| 408 | - quality: 50, | 408 | + quality: 70, |
| 409 | percentage: 50); | 409 | percentage: 50); |
| 410 | setState(() { | 410 | setState(() { |
| 411 | if (pickedFile != null) { | 411 | if (pickedFile != null) { |
| @@ -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/services.dart'; | ||
| 5 | import 'package:flutter_native_image/flutter_native_image.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'; |
| @@ -207,13 +208,32 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -207,13 +208,32 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 207 | } | 208 | } |
| 208 | 209 | ||
| 209 | ///#相机拍照,单图选择 | 210 | ///#相机拍照,单图选择 |
| 210 | - Future _getFromPictureOrCamera( | ||
| 211 | - UploadImgModel imgModel, imageSource, int type) async { | 211 | + Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource, int type, |
| 212 | + {bool needResize = false}) async { | ||
| 212 | final pickedFile = await picker.pickImage(source: imageSource); | 213 | final pickedFile = await picker.pickImage(source: imageSource); |
| 213 | - File compressedFile = await FlutterNativeImage.compressImage( | ||
| 214 | - pickedFile.path, | ||
| 215 | - quality: 50, | ||
| 216 | - percentage: 50); | 214 | +//从相册选取照片后进行裁剪压缩 |
| 215 | + String path; | ||
| 216 | + if (needResize) { | ||
| 217 | + File yourFile = File(pickedFile.path); | ||
| 218 | + Uint8List afterImg = await yourFile.readAsBytes(); | ||
| 219 | + Uint8List newImg = await Utils.testFromFileComporessList( | ||
| 220 | + context, afterImg, | ||
| 221 | + needResize: true); | ||
| 222 | + path = await Utils.saveImage(newImg); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + if (path == null) { | ||
| 226 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 227 | + pickedFile.path, | ||
| 228 | + quality: 70, | ||
| 229 | + percentage: 50); | ||
| 230 | + path = compressedFile.path; | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + // File compressedFile = await FlutterNativeImage.compressImage( | ||
| 234 | + // pickedFile.path, | ||
| 235 | + // quality: 50, | ||
| 236 | + // percentage: 50); | ||
| 217 | setState(() { | 237 | setState(() { |
| 218 | if (pickedFile != null) { | 238 | if (pickedFile != null) { |
| 219 | imgModel.file = File(pickedFile.path); | 239 | imgModel.file = File(pickedFile.path); |
| @@ -234,7 +254,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -234,7 +254,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 234 | bool need = await Utils.sizeNeed(File(pickedFile.path)); | 254 | bool need = await Utils.sizeNeed(File(pickedFile.path)); |
| 235 | File file = File(pickedFile.path); | 255 | File file = File(pickedFile.path); |
| 236 | if (need) { | 256 | if (need) { |
| 237 | - file = File(compressedFile.absolute.path); | 257 | + file = File(path); |
| 238 | } | 258 | } |
| 239 | UploadImageUtil() | 259 | UploadImageUtil() |
| 240 | .startUploadOnly(context, file, type, true, _uploadImageProvider); | 260 | .startUploadOnly(context, file, type, true, _uploadImageProvider); |
| @@ -243,7 +263,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -243,7 +263,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 243 | 263 | ||
| 244 | ///添加图片UI弹出 | 264 | ///添加图片UI弹出 |
| 245 | Future _openModalBottomSheet( | 265 | Future _openModalBottomSheet( |
| 246 | - context, UploadImgModel uploadImageModel, int type) async { | 266 | + context, UploadImgModel uploadImageModel, int type, |
| 267 | + {bool needResize = false}) async { | ||
| 247 | final option = await showModalBottomSheet( | 268 | final option = await showModalBottomSheet( |
| 248 | context: context, | 269 | context: context, |
| 249 | backgroundColor: Colors.transparent, | 270 | backgroundColor: Colors.transparent, |
| @@ -269,7 +290,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -269,7 +290,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 269 | // }, Permission.camera); | 290 | // }, Permission.camera); |
| 270 | Utils.getPickPermission(context, () { | 291 | Utils.getPickPermission(context, () { |
| 271 | _getFromPictureOrCamera( | 292 | _getFromPictureOrCamera( |
| 272 | - uploadImageModel, ImageSource.camera, type); | 293 | + uploadImageModel, ImageSource.camera, type, |
| 294 | + needResize: needResize); | ||
| 273 | Navigator.pop(context); | 295 | Navigator.pop(context); |
| 274 | }, | 296 | }, |
| 275 | Platform.isAndroid | 297 | Platform.isAndroid |
| @@ -307,7 +329,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -307,7 +329,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 307 | // : Permission.photos); | 329 | // : Permission.photos); |
| 308 | Utils.getPickPermission(context, () { | 330 | Utils.getPickPermission(context, () { |
| 309 | _getFromPictureOrCamera( | 331 | _getFromPictureOrCamera( |
| 310 | - uploadImageModel, ImageSource.gallery, type); | 332 | + uploadImageModel, ImageSource.gallery, type, |
| 333 | + needResize: needResize); | ||
| 311 | Navigator.pop(context); | 334 | Navigator.pop(context); |
| 312 | }, | 335 | }, |
| 313 | Platform.isAndroid | 336 | Platform.isAndroid |
| @@ -496,8 +519,9 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -496,8 +519,9 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 496 | // _uploadImageProvider.firstImage.qiniuUrl = null; | 519 | // _uploadImageProvider.firstImage.qiniuUrl = null; |
| 497 | // _uploadImageProvider.firstImage.process = 0; | 520 | // _uploadImageProvider.firstImage.process = 0; |
| 498 | // setState(() {}); | 521 | // setState(() {}); |
| 499 | - _openModalBottomSheet(context, | ||
| 500 | - _uploadImageProvider.firstImage, 4); | 522 | + _openModalBottomSheet( |
| 523 | + context, _uploadImageProvider.firstImage, 4, | ||
| 524 | + needResize: true); | ||
| 501 | // Utils.getPickPermission(context, () { | 525 | // Utils.getPickPermission(context, () { |
| 502 | // _getFromPictureOrCamera( | 526 | // _getFromPictureOrCamera( |
| 503 | // _uploadImageProvider.firstImage, | 527 | // _uploadImageProvider.firstImage, |
| @@ -644,7 +668,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -644,7 +668,8 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 644 | // ? Permission.storage | 668 | // ? Permission.storage |
| 645 | // : Permission.photos); | 669 | // : Permission.photos); |
| 646 | _openModalBottomSheet( | 670 | _openModalBottomSheet( |
| 647 | - context, _uploadImageProvider.firstImage, 4); | 671 | + context, _uploadImageProvider.firstImage, 4, |
| 672 | + needResize: true); | ||
| 648 | }, | 673 | }, |
| 649 | child: Container( | 674 | child: Container( |
| 650 | color: MyColours.color_d9d9d9, | 675 | color: MyColours.color_d9d9d9, |
| @@ -750,168 +775,38 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -750,168 +775,38 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 750 | addLogo = !addLogo; | 775 | addLogo = !addLogo; |
| 751 | }); | 776 | }); |
| 752 | }), | 777 | }), |
| 753 | - Container( | ||
| 754 | - height: w(210), | ||
| 755 | - child: _uploadImageProvider.logo.file != null || | ||
| 756 | - (_uploadImageProvider.logo.qiniuUrl != null && | ||
| 757 | - _uploadImageProvider.logo.qiniuUrl != '') | ||
| 758 | - ? InkWell( | ||
| 759 | - onTap: () { | ||
| 760 | - double process; | ||
| 761 | - String qiniuUrl; | ||
| 762 | - List<String> tempList = []; | ||
| 763 | - // if (title == '头像') { | ||
| 764 | - process = _uploadImageProvider.logo.process; | ||
| 765 | - qiniuUrl = _uploadImageProvider.logo.qiniuUrl; | ||
| 766 | - // } else { | ||
| 767 | - // process = _uploadImageProvider.erweima.process; | ||
| 768 | - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 769 | - // } | ||
| 770 | - | ||
| 771 | - if (qiniuUrl != null && qiniuUrl != '') { | ||
| 772 | - // tempList.add(qiniuUrl); | ||
| 773 | - | ||
| 774 | - // ///没有上传完成的不可以点击 | ||
| 775 | - // _showPhotoView(context, 0, tempList); | 778 | + _uploadImageProvider.logo.file != null || |
| 779 | + (_uploadImageProvider.logo.qiniuUrl != null && | ||
| 780 | + _uploadImageProvider.logo.qiniuUrl != '') | ||
| 781 | + ? InkWell( | ||
| 782 | + onTap: () { | ||
| 783 | + // double process; | ||
| 784 | + String qiniuUrl; | ||
| 785 | + List<String> tempList = []; | ||
| 786 | + // if (title == '头像') { | ||
| 787 | + // process = _uploadImageProvider.logo.process; | ||
| 788 | + qiniuUrl = _uploadImageProvider.logo.qiniuUrl; | ||
| 789 | + // } else { | ||
| 790 | + // process = _uploadImageProvider.erweima.process; | ||
| 791 | + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 792 | + // } | ||
| 776 | 793 | ||
| 777 | - // _uploadImageProvider.firstImage.qiniuUrl = null; | ||
| 778 | - // _uploadImageProvider.firstImage.process = 0; | ||
| 779 | - // setState(() {}); | ||
| 780 | - _openModalBottomSheet( | ||
| 781 | - context, _uploadImageProvider.logo, 9); | ||
| 782 | - // Utils.getPickPermission(context, () { | ||
| 783 | - // _getFromPictureOrCamera( | ||
| 784 | - // _uploadImageProvider.firstImage, | ||
| 785 | - // ImageSource.gallery); | ||
| 786 | - // }, | ||
| 787 | - // Platform.isAndroid | ||
| 788 | - // ? Permission.storage | ||
| 789 | - // : Permission.photos); | ||
| 790 | - } | ||
| 791 | - }, | ||
| 792 | - child: Stack( | ||
| 793 | - alignment: Alignment.bottomCenter, | ||
| 794 | - children: [ | ||
| 795 | - Stack(clipBehavior: Clip.none, children: [ | ||
| 796 | - _uploadImageProvider.logo.qiniuUrl != | ||
| 797 | - null && | ||
| 798 | - _uploadImageProvider | ||
| 799 | - .logo.qiniuUrl != | ||
| 800 | - '' | ||
| 801 | - ? Image.network( | ||
| 802 | - _uploadImageProvider | ||
| 803 | - .logo.qiniuUrl, | ||
| 804 | - fit: BoxFit.cover, | ||
| 805 | - width: double.infinity, | ||
| 806 | - // width: ScreenUtil() | ||
| 807 | - // .setWidth(imgSize * 2), | ||
| 808 | - height: w(210), | ||
| 809 | - ) | ||
| 810 | - : Image.file( | ||
| 811 | - _uploadImageProvider.logo.file, | ||
| 812 | - fit: BoxFit.cover, | ||
| 813 | - width: double.infinity, | ||
| 814 | - // width: ScreenUtil() | ||
| 815 | - // .setWidth(imgSize * 2), | ||
| 816 | - height: w(210), | ||
| 817 | - ), | ||
| 818 | - Positioned( | ||
| 819 | - left: 0, | ||
| 820 | - top: 0, | ||
| 821 | - right: 0, | ||
| 822 | - child: (_uploadImageProvider | ||
| 823 | - .logo.file != | ||
| 824 | - null) && | ||
| 825 | - _uploadImageProvider | ||
| 826 | - .logo.process != | ||
| 827 | - 1 && | ||
| 828 | - _uploadImageProvider | ||
| 829 | - .logo.process != | ||
| 830 | - 0.01 | ||
| 831 | - ? Container( | ||
| 832 | - width: | ||
| 833 | - ScreenUtil().screenWidth, | ||
| 834 | - height: w(210), | ||
| 835 | - color: | ||
| 836 | - MyColours.color_4D000000, | ||
| 837 | - child: Center( | ||
| 838 | - child: Text('上传中', | ||
| 839 | - style: TextStyle( | ||
| 840 | - color: MyColours | ||
| 841 | - .color_F8F9FD)), | ||
| 842 | - ), | ||
| 843 | - ) | ||
| 844 | - : Container()), | ||
| 845 | - if (_uploadImageProvider.logo.process == | ||
| 846 | - 1) | ||
| 847 | - Positioned( | ||
| 848 | - top: 0, | ||
| 849 | - right: 0, | ||
| 850 | - child: GestureDetector( | ||
| 851 | - child: Image.asset( | ||
| 852 | - Utils.getImgPath("delete"), | ||
| 853 | - width: | ||
| 854 | - ScreenUtil().setWidth(40), | ||
| 855 | - height: | ||
| 856 | - ScreenUtil().setWidth(40), | ||
| 857 | - ), | ||
| 858 | - onTap: () { | ||
| 859 | - //已经传到服务器,弹提醒窗口,是否删除 | ||
| 860 | - //修改之前有内容,则弹框 | ||
| 861 | - DialogUtil.cupertinoAlertDialog( | ||
| 862 | - context, | ||
| 863 | - title: "", | ||
| 864 | - content: "是否确定删除该照片?", | ||
| 865 | - lCallback: () { | ||
| 866 | - print("取消"); | ||
| 867 | - }, rCallback: () { | ||
| 868 | - _uploadImageProvider | ||
| 869 | - .logo.qiniuUrl = null; | ||
| 870 | - _uploadImageProvider | ||
| 871 | - .logo.file = null; | ||
| 872 | - _uploadImageProvider | ||
| 873 | - .logo.isUpload = false; | ||
| 874 | - _uploadImageProvider | ||
| 875 | - .logo.process = 0.01; | ||
| 876 | - setState(() {}); | ||
| 877 | - }); | ||
| 878 | - }, | ||
| 879 | - )), | ||
| 880 | - ]), | ||
| 881 | - _uploadImageProvider.logo.process == 1 | ||
| 882 | - ? Container( | ||
| 883 | - width: w(150), | ||
| 884 | - height: w(30), | ||
| 885 | - color: MyColours.color_4D000000, | ||
| 886 | - alignment: Alignment.center, | ||
| 887 | - child: Text( | ||
| 888 | - '点击图片可以更换', | ||
| 889 | - style: TextStyle( | ||
| 890 | - color: MyColours.color_F8F9FD, | ||
| 891 | - fontSize: font(14), | ||
| 892 | - fontWeight: FontWeight.bold), | ||
| 893 | - )) | ||
| 894 | - : SizedBox(), | ||
| 895 | - ])) | ||
| 896 | - : InkWell( | ||
| 897 | - onTap: () { | ||
| 898 | - // double process; | ||
| 899 | - // String qiniuUrl; | ||
| 900 | - // List<String> tempList = []; | ||
| 901 | - // if (title == '头像') { | ||
| 902 | - // process = _uploadImageProvider.touxiang.process; | ||
| 903 | - // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl; | ||
| 904 | - // } else { | ||
| 905 | - // process = _uploadImageProvider.erweima.process; | ||
| 906 | - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 907 | - // } | 794 | + if (qiniuUrl != null && qiniuUrl != '') { |
| 795 | + // _uploadImageProvider.logo.process = 0; | ||
| 796 | + // setState(() { | ||
| 797 | + | ||
| 798 | + // }); | ||
| 799 | + // setState(() {}); | ||
| 800 | + // tempList.add(qiniuUrl); | ||
| 908 | 801 | ||
| 909 | - // if (qiniuUrl != null && qiniuUrl != '') { | ||
| 910 | - // tempList.add(qiniuUrl); | 802 | + // ///没有上传完成的不可以点击 |
| 803 | + // _showPhotoView(context, 0, tempList); | ||
| 911 | 804 | ||
| 912 | - // ///没有上传完成的不可以点击 | ||
| 913 | - // _showPhotoView(context, 0, tempList); | ||
| 914 | - // } else { | 805 | + // _uploadImageProvider.firstImage.qiniuUrl = null; |
| 806 | + // _uploadImageProvider.firstImage.process = 0; | ||
| 807 | + // setState(() {}); | ||
| 808 | + _openModalBottomSheet( | ||
| 809 | + context, _uploadImageProvider.logo, 9); | ||
| 915 | // Utils.getPickPermission(context, () { | 810 | // Utils.getPickPermission(context, () { |
| 916 | // _getFromPictureOrCamera( | 811 | // _getFromPictureOrCamera( |
| 917 | // _uploadImageProvider.firstImage, | 812 | // _uploadImageProvider.firstImage, |
| @@ -920,38 +815,170 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -920,38 +815,170 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 920 | // Platform.isAndroid | 815 | // Platform.isAndroid |
| 921 | // ? Permission.storage | 816 | // ? Permission.storage |
| 922 | // : Permission.photos); | 817 | // : Permission.photos); |
| 923 | - _openModalBottomSheet( | ||
| 924 | - context, _uploadImageProvider.logo, 9); | ||
| 925 | - }, | ||
| 926 | - child: Container( | ||
| 927 | - color: MyColours.color_d9d9d9, | ||
| 928 | - width: double.infinity, | ||
| 929 | - height: w(180), | ||
| 930 | - child: Column( | ||
| 931 | - mainAxisAlignment: MainAxisAlignment.center, | ||
| 932 | - children: [ | ||
| 933 | - // VEmptyView(80), | ||
| 934 | - Image.asset( | ||
| 935 | - Utils.getImgPath('add_img'), | ||
| 936 | - width: w(63), | ||
| 937 | - ), | ||
| 938 | - VEmptyView(28), | ||
| 939 | - Container( | ||
| 940 | - width: w(139), | ||
| 941 | - height: w(60), | ||
| 942 | - child: Text( | ||
| 943 | - '点击上传照片', | ||
| 944 | - textAlign: TextAlign.center, | ||
| 945 | - style: TextStyle( | ||
| 946 | - height: 1.4, | ||
| 947 | - color: MyColours.color_ffffff, | ||
| 948 | - fontSize: font(14), | ||
| 949 | - fontWeight: FontWeight.bold), | ||
| 950 | - )) | ||
| 951 | - ], | ||
| 952 | - ), | ||
| 953 | - )), | ||
| 954 | - ), | 818 | + } |
| 819 | + }, | ||
| 820 | + child: Stack( | ||
| 821 | + alignment: Alignment.bottomCenter, | ||
| 822 | + children: [ | ||
| 823 | + Stack(clipBehavior: Clip.none, children: [ | ||
| 824 | + _uploadImageProvider.logo.qiniuUrl != | ||
| 825 | + null && | ||
| 826 | + _uploadImageProvider | ||
| 827 | + .logo.qiniuUrl != | ||
| 828 | + '' | ||
| 829 | + ? Center( | ||
| 830 | + child: Image.network( | ||
| 831 | + _uploadImageProvider.logo.qiniuUrl, | ||
| 832 | + fit: BoxFit.contain, | ||
| 833 | + | ||
| 834 | + // width: double.infinity, | ||
| 835 | + // width: ScreenUtil() | ||
| 836 | + // .setWidth(imgSize * 2), | ||
| 837 | + // height: w(210), | ||
| 838 | + )) | ||
| 839 | + : Center( | ||
| 840 | + child: Image.file( | ||
| 841 | + _uploadImageProvider.logo.file, | ||
| 842 | + fit: BoxFit.contain, | ||
| 843 | + // width: double.infinity, | ||
| 844 | + // width: ScreenUtil() | ||
| 845 | + // .setWidth(imgSize * 2), | ||
| 846 | + // height: w(210), | ||
| 847 | + )), | ||
| 848 | + Positioned( | ||
| 849 | + left: 0, | ||
| 850 | + top: 0, | ||
| 851 | + right: 0, | ||
| 852 | + child: (_uploadImageProvider | ||
| 853 | + .logo.file != | ||
| 854 | + null) && | ||
| 855 | + _uploadImageProvider | ||
| 856 | + .logo.process != | ||
| 857 | + 1 && | ||
| 858 | + _uploadImageProvider | ||
| 859 | + .logo.process != | ||
| 860 | + 0.01 | ||
| 861 | + ? Container( | ||
| 862 | + width: ScreenUtil().screenWidth, | ||
| 863 | + height: w(210), | ||
| 864 | + color: MyColours.color_4D000000, | ||
| 865 | + child: Center( | ||
| 866 | + child: Text('上传中', | ||
| 867 | + style: TextStyle( | ||
| 868 | + color: MyColours | ||
| 869 | + .color_F8F9FD)), | ||
| 870 | + ), | ||
| 871 | + ) | ||
| 872 | + : Container()), | ||
| 873 | + if (_uploadImageProvider.logo.process == 1) | ||
| 874 | + Positioned( | ||
| 875 | + top: 0, | ||
| 876 | + right: 0, | ||
| 877 | + child: GestureDetector( | ||
| 878 | + child: Image.asset( | ||
| 879 | + Utils.getImgPath("delete"), | ||
| 880 | + width: ScreenUtil().setWidth(40), | ||
| 881 | + height: ScreenUtil().setWidth(40), | ||
| 882 | + ), | ||
| 883 | + onTap: () { | ||
| 884 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 885 | + //修改之前有内容,则弹框 | ||
| 886 | + DialogUtil.cupertinoAlertDialog( | ||
| 887 | + context, | ||
| 888 | + title: "", | ||
| 889 | + content: "是否确定删除该照片?", | ||
| 890 | + lCallback: () { | ||
| 891 | + print("取消"); | ||
| 892 | + }, rCallback: () { | ||
| 893 | + _uploadImageProvider | ||
| 894 | + .logo.qiniuUrl = null; | ||
| 895 | + _uploadImageProvider.logo.file = | ||
| 896 | + null; | ||
| 897 | + _uploadImageProvider | ||
| 898 | + .logo.isUpload = false; | ||
| 899 | + _uploadImageProvider | ||
| 900 | + .logo.process = 0.01; | ||
| 901 | + setState(() {}); | ||
| 902 | + }); | ||
| 903 | + }, | ||
| 904 | + )), | ||
| 905 | + ]), | ||
| 906 | + _uploadImageProvider.logo.process == 1 | ||
| 907 | + ? Container( | ||
| 908 | + width: w(150), | ||
| 909 | + height: w(30), | ||
| 910 | + color: MyColours.color_4D000000, | ||
| 911 | + alignment: Alignment.center, | ||
| 912 | + child: Text( | ||
| 913 | + '点击图片可以更换', | ||
| 914 | + style: TextStyle( | ||
| 915 | + color: MyColours.color_F8F9FD, | ||
| 916 | + fontSize: font(14), | ||
| 917 | + fontWeight: FontWeight.bold), | ||
| 918 | + )) | ||
| 919 | + : SizedBox(), | ||
| 920 | + ])) | ||
| 921 | + : Container( | ||
| 922 | + height: w(210), | ||
| 923 | + child: InkWell( | ||
| 924 | + onTap: () { | ||
| 925 | + // double process; | ||
| 926 | + // String qiniuUrl; | ||
| 927 | + // List<String> tempList = []; | ||
| 928 | + // if (title == '头像') { | ||
| 929 | + // process = _uploadImageProvider.touxiang.process; | ||
| 930 | + // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl; | ||
| 931 | + // } else { | ||
| 932 | + // process = _uploadImageProvider.erweima.process; | ||
| 933 | + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl; | ||
| 934 | + // } | ||
| 935 | + | ||
| 936 | + // if (qiniuUrl != null && qiniuUrl != '') { | ||
| 937 | + // tempList.add(qiniuUrl); | ||
| 938 | + | ||
| 939 | + // ///没有上传完成的不可以点击 | ||
| 940 | + // _showPhotoView(context, 0, tempList); | ||
| 941 | + // } else { | ||
| 942 | + // Utils.getPickPermission(context, () { | ||
| 943 | + // _getFromPictureOrCamera( | ||
| 944 | + // _uploadImageProvider.firstImage, | ||
| 945 | + // ImageSource.gallery); | ||
| 946 | + // }, | ||
| 947 | + // Platform.isAndroid | ||
| 948 | + // ? Permission.storage | ||
| 949 | + // : Permission.photos); | ||
| 950 | + _openModalBottomSheet( | ||
| 951 | + context, _uploadImageProvider.logo, 9); | ||
| 952 | + }, | ||
| 953 | + child: Container( | ||
| 954 | + color: MyColours.color_d9d9d9, | ||
| 955 | + width: double.infinity, | ||
| 956 | + height: w(180), | ||
| 957 | + child: Column( | ||
| 958 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 959 | + children: [ | ||
| 960 | + // VEmptyView(80), | ||
| 961 | + Image.asset( | ||
| 962 | + Utils.getImgPath('add_img'), | ||
| 963 | + width: w(63), | ||
| 964 | + ), | ||
| 965 | + VEmptyView(28), | ||
| 966 | + Container( | ||
| 967 | + width: w(139), | ||
| 968 | + height: w(60), | ||
| 969 | + child: Text( | ||
| 970 | + '点击上传照片', | ||
| 971 | + textAlign: TextAlign.center, | ||
| 972 | + style: TextStyle( | ||
| 973 | + height: 1.4, | ||
| 974 | + color: MyColours.color_ffffff, | ||
| 975 | + fontSize: font(14), | ||
| 976 | + fontWeight: FontWeight.bold), | ||
| 977 | + )) | ||
| 978 | + ], | ||
| 979 | + ), | ||
| 980 | + )), | ||
| 981 | + ), | ||
| 955 | 982 | ||
| 956 | VEmptyView(16) | 983 | VEmptyView(16) |
| 957 | ]), | 984 | ]), |
| @@ -302,24 +302,26 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | @@ -302,24 +302,26 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> { | ||
| 302 | Stack(clipBehavior: Clip.none, children: [ | 302 | Stack(clipBehavior: Clip.none, children: [ |
| 303 | _uploadImageProvider.firstImage.qiniuUrl != null && | 303 | _uploadImageProvider.firstImage.qiniuUrl != null && |
| 304 | _uploadImageProvider.firstImage.qiniuUrl != '' | 304 | _uploadImageProvider.firstImage.qiniuUrl != '' |
| 305 | - ? Image.network( | 305 | + ? Center( |
| 306 | + child: Image.network( | ||
| 306 | _uploadImageProvider.firstImage.qiniuUrl, | 307 | _uploadImageProvider.firstImage.qiniuUrl, |
| 307 | - fit: BoxFit.cover, | ||
| 308 | - width: double.infinity, | 308 | + fit: BoxFit.contain, |
| 309 | + // width: double.infinity, | ||
| 309 | // width: ScreenUtil() | 310 | // width: ScreenUtil() |
| 310 | // .setWidth(imgSize * 2), | 311 | // .setWidth(imgSize * 2), |
| 311 | - height: ScreenUtil().setWidth( | ||
| 312 | - _uploadImageProvider.imgSizefirstImage * 2), | ||
| 313 | - ) | ||
| 314 | - : Image.file( | 312 | + // height: ScreenUtil().setWidth( |
| 313 | + // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 314 | + )) | ||
| 315 | + : Center( | ||
| 316 | + child: Image.file( | ||
| 315 | _uploadImageProvider.firstImage.file, | 317 | _uploadImageProvider.firstImage.file, |
| 316 | - fit: BoxFit.cover, | ||
| 317 | - width: double.infinity, | 318 | + fit: BoxFit.contain, |
| 319 | + // width: double.infinity, | ||
| 318 | // width: ScreenUtil() | 320 | // width: ScreenUtil() |
| 319 | // .setWidth(imgSize * 2), | 321 | // .setWidth(imgSize * 2), |
| 320 | - height: ScreenUtil().setWidth( | ||
| 321 | - _uploadImageProvider.imgSizefirstImage * 2), | ||
| 322 | - ), | 322 | + // height: ScreenUtil().setWidth( |
| 323 | + // _uploadImageProvider.imgSizefirstImage * 2), | ||
| 324 | + )), | ||
| 323 | Positioned( | 325 | Positioned( |
| 324 | left: 0, | 326 | left: 0, |
| 325 | top: 0, | 327 | top: 0, |
| @@ -107,7 +107,7 @@ class _ImgPickerInvitationWidgetState | @@ -107,7 +107,7 @@ class _ImgPickerInvitationWidgetState | ||
| 107 | final pickedFile = await picker.pickImage(source: imageSource); | 107 | final pickedFile = await picker.pickImage(source: imageSource); |
| 108 | File compressedFile = await FlutterNativeImage.compressImage( | 108 | File compressedFile = await FlutterNativeImage.compressImage( |
| 109 | pickedFile.path, | 109 | pickedFile.path, |
| 110 | - quality: 50, | 110 | + quality: 70, |
| 111 | percentage: 50); | 111 | percentage: 50); |
| 112 | setState(() { | 112 | setState(() { |
| 113 | if (pickedFile != null) { | 113 | if (pickedFile != null) { |
| @@ -480,22 +480,24 @@ class _ImgPickerInvitationWidgetState | @@ -480,22 +480,24 @@ class _ImgPickerInvitationWidgetState | ||
| 480 | child: Stack(alignment: Alignment.bottomCenter, children: [ | 480 | child: Stack(alignment: Alignment.bottomCenter, children: [ |
| 481 | Stack(clipBehavior: Clip.none, children: [ | 481 | Stack(clipBehavior: Clip.none, children: [ |
| 482 | imageModel.qiniuUrl != null && imageModel.qiniuUrl != '' | 482 | imageModel.qiniuUrl != null && imageModel.qiniuUrl != '' |
| 483 | - ? Image.network( | 483 | + ? Center( |
| 484 | + child: Image.network( | ||
| 484 | imageModel.qiniuUrl, | 485 | imageModel.qiniuUrl, |
| 485 | - fit: BoxFit.cover, | ||
| 486 | - width: double.infinity, | 486 | + fit: BoxFit.contain, |
| 487 | + // width: double.infinity, | ||
| 487 | // width: ScreenUtil() | 488 | // width: ScreenUtil() |
| 488 | // .setWidth(imgSize * 2), | 489 | // .setWidth(imgSize * 2), |
| 489 | - height: ScreenUtil().setWidth(281 * 2), | ||
| 490 | - ) | ||
| 491 | - : Image.file( | 490 | + // height: ScreenUtil().setWidth(281 * 2), |
| 491 | + )) | ||
| 492 | + : Center( | ||
| 493 | + child: Image.file( | ||
| 492 | imageModel.file, | 494 | imageModel.file, |
| 493 | - fit: BoxFit.cover, | ||
| 494 | - width: double.infinity, | 495 | + fit: BoxFit.contain, |
| 496 | + // width: double.infinity, | ||
| 495 | // width: ScreenUtil() | 497 | // width: ScreenUtil() |
| 496 | // .setWidth(imgSize * 2), | 498 | // .setWidth(imgSize * 2), |
| 497 | - height: ScreenUtil().setWidth(281 * 2), | ||
| 498 | - ), | 499 | + // height: ScreenUtil().setWidth(281 * 2), |
| 500 | + )), | ||
| 499 | Positioned( | 501 | Positioned( |
| 500 | left: 0, | 502 | left: 0, |
| 501 | top: 0, | 503 | top: 0, |
| @@ -285,7 +285,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | @@ -285,7 +285,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | ||
| 285 | 285 | ||
| 286 | ///获取二维码 | 286 | ///获取二维码 |
| 287 | _getWechatQrcode({bool need = false}) async { | 287 | _getWechatQrcode({bool need = false}) async { |
| 288 | - if (timer != null && timer.isActive ) { | 288 | + if (timer != null && timer.isActive) { |
| 289 | timer.cancel(); | 289 | timer.cancel(); |
| 290 | } | 290 | } |
| 291 | 291 | ||
| @@ -476,46 +476,47 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | @@ -476,46 +476,47 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | ||
| 476 | ), | 476 | ), |
| 477 | VEmptyView(114), | 477 | VEmptyView(114), |
| 478 | 478 | ||
| 479 | - data?.openid == null || data?.openid == 'null' | ||
| 480 | - ? RoundButton( | ||
| 481 | - text: '绑定微信', | ||
| 482 | - gradientStart: wechatColor, | ||
| 483 | - gradientEnd: wechatColor, | ||
| 484 | - borderColor: wechatColor, | ||
| 485 | - width: ScreenUtil().setWidth(80 * 2), | ||
| 486 | - height: ScreenUtil().setWidth(30 * 2), | ||
| 487 | - fontSize: 32, | ||
| 488 | - isBold: true, | ||
| 489 | - textColor: MyColours.color_ffffff, | ||
| 490 | - radius: ScreenUtil().setWidth(12), | ||
| 491 | - onPressed: () { | ||
| 492 | - if (dcAdduserCode != '' && dcAdduserCode != null) { | ||
| 493 | - DialogUtil.openAlertDialogImage( | ||
| 494 | - context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660); | ||
| 495 | - } else { | ||
| 496 | - _getWechatQrcode(need: true); | ||
| 497 | - } | ||
| 498 | - }) | ||
| 499 | - : RoundButton( | ||
| 500 | - text: '更换微信', | ||
| 501 | - gradientStart: wechatColor, | ||
| 502 | - gradientEnd: wechatColor, | ||
| 503 | - borderColor: wechatColor, | ||
| 504 | - width: ScreenUtil().setWidth(80 * 2), | ||
| 505 | - height: ScreenUtil().setWidth(30 * 2), | ||
| 506 | - fontSize: 32, | ||
| 507 | - isBold: true, | ||
| 508 | - textColor: MyColours.color_ffffff, | ||
| 509 | - radius: ScreenUtil().setWidth(12), | ||
| 510 | - onPressed: () { | ||
| 511 | - if (dcAdduserCode != '' && dcAdduserCode != null) { | ||
| 512 | - DialogUtil.openAlertDialogImage( | ||
| 513 | - context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660); | ||
| 514 | - } else { | ||
| 515 | - _getWechatQrcode(need: true); | ||
| 516 | - } | ||
| 517 | - }), | ||
| 518 | - VEmptyView(48), | 479 | + if (data?.openid == null || data?.openid == 'null') |
| 480 | + RoundButton( | ||
| 481 | + text: '绑定微信', | ||
| 482 | + gradientStart: wechatColor, | ||
| 483 | + gradientEnd: wechatColor, | ||
| 484 | + borderColor: wechatColor, | ||
| 485 | + width: ScreenUtil().setWidth(80 * 2), | ||
| 486 | + height: ScreenUtil().setWidth(30 * 2), | ||
| 487 | + fontSize: 32, | ||
| 488 | + isBold: true, | ||
| 489 | + textColor: MyColours.color_ffffff, | ||
| 490 | + radius: ScreenUtil().setWidth(12), | ||
| 491 | + onPressed: () { | ||
| 492 | + if (dcAdduserCode != '' && dcAdduserCode != null) { | ||
| 493 | + DialogUtil.openAlertDialogImage( | ||
| 494 | + context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660); | ||
| 495 | + } else { | ||
| 496 | + _getWechatQrcode(need: true); | ||
| 497 | + } | ||
| 498 | + }), | ||
| 499 | + // : RoundButton( | ||
| 500 | + // text: '更换微信', | ||
| 501 | + // gradientStart: wechatColor, | ||
| 502 | + // gradientEnd: wechatColor, | ||
| 503 | + // borderColor: wechatColor, | ||
| 504 | + // width: ScreenUtil().setWidth(80 * 2), | ||
| 505 | + // height: ScreenUtil().setWidth(30 * 2), | ||
| 506 | + // fontSize: 32, | ||
| 507 | + // isBold: true, | ||
| 508 | + // textColor: MyColours.color_ffffff, | ||
| 509 | + // radius: ScreenUtil().setWidth(12), | ||
| 510 | + // onPressed: () { | ||
| 511 | + // if (dcAdduserCode != '' && dcAdduserCode != null) { | ||
| 512 | + // DialogUtil.openAlertDialogImage( | ||
| 513 | + // context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660); | ||
| 514 | + // } else { | ||
| 515 | + // _getWechatQrcode(need: true); | ||
| 516 | + // } | ||
| 517 | + // }), | ||
| 518 | + if (data?.openid == null || data?.openid == 'null') | ||
| 519 | + VEmptyView(48), | ||
| 519 | InkWell( | 520 | InkWell( |
| 520 | onTap: () { | 521 | onTap: () { |
| 521 | NavigatorUtil.goPersonnelPasswordEditPage(context, | 522 | NavigatorUtil.goPersonnelPasswordEditPage(context, |
| @@ -633,12 +633,13 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | @@ -633,12 +633,13 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | ||
| 633 | //从相册选取照片后进行裁剪压缩 | 633 | //从相册选取照片后进行裁剪压缩 |
| 634 | File yourFile = File(pickedFile.path); | 634 | File yourFile = File(pickedFile.path); |
| 635 | Uint8List afterImg = await yourFile.readAsBytes(); | 635 | Uint8List afterImg = await yourFile.readAsBytes(); |
| 636 | - Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg); | 636 | + Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg, |
| 637 | + needResize: true); | ||
| 637 | String path = await Utils.saveImage(newImg); | 638 | String path = await Utils.saveImage(newImg); |
| 638 | if (path == null) { | 639 | if (path == null) { |
| 639 | File compressedFile = await FlutterNativeImage.compressImage( | 640 | File compressedFile = await FlutterNativeImage.compressImage( |
| 640 | pickedFile.path, | 641 | pickedFile.path, |
| 641 | - quality: 50, | 642 | + quality: 70, |
| 642 | percentage: 50); | 643 | percentage: 50); |
| 643 | path = compressedFile.path; | 644 | path = compressedFile.path; |
| 644 | } | 645 | } |
| @@ -1774,7 +1775,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | @@ -1774,7 +1775,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { | ||
| 1774 | onTap: () { | 1775 | onTap: () { |
| 1775 | Utils.getPickPermission(context, | 1776 | Utils.getPickPermission(context, |
| 1776 | () async { | 1777 | () async { |
| 1777 | - Map temp = await NavigatorUtil | 1778 | + Map temp = await NavigatorUtil |
| 1778 | .goMapChoicePointPage(context); | 1779 | .goMapChoicePointPage(context); |
| 1779 | if (temp != null) { | 1780 | if (temp != null) { |
| 1780 | mapAddress = temp; | 1781 | mapAddress = temp; |
| @@ -106,7 +106,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -106,7 +106,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 106 | if (path == null) { | 106 | if (path == null) { |
| 107 | File compressedFile = await FlutterNativeImage.compressImage( | 107 | File compressedFile = await FlutterNativeImage.compressImage( |
| 108 | yourFile.path, | 108 | yourFile.path, |
| 109 | - quality: 50, | 109 | + quality: 70, |
| 110 | percentage: 50); | 110 | percentage: 50); |
| 111 | path = compressedFile.path; | 111 | path = compressedFile.path; |
| 112 | } | 112 | } |
| @@ -185,6 +185,7 @@ class MyTableManageHomeModel with ChangeNotifier { | @@ -185,6 +185,7 @@ class MyTableManageHomeModel with ChangeNotifier { | ||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | App.sp.setString('table_list', json.encode(tableOuterList)); | 187 | App.sp.setString('table_list', json.encode(tableOuterList)); |
| 188 | + | ||
| 188 | 189 | ||
| 189 | return tableOuterList; | 190 | return tableOuterList; |
| 190 | } | 191 | } |
| @@ -1577,10 +1577,14 @@ class Utils { | @@ -1577,10 +1577,14 @@ class Utils { | ||
| 1577 | 1577 | ||
| 1578 | ///本地选择 图片压缩 Uint8List -> Uint8List | 1578 | ///本地选择 图片压缩 Uint8List -> Uint8List |
| 1579 | static Future<Uint8List> testFromFileComporessList( | 1579 | static Future<Uint8List> testFromFileComporessList( |
| 1580 | - BuildContext context, Uint8List list) async { | 1580 | + BuildContext context, Uint8List list, |
| 1581 | + {bool needResize = false}) async { | ||
| 1581 | Loading.showLoading(context); | 1582 | Loading.showLoading(context); |
| 1582 | 1583 | ||
| 1583 | - Uint8List result = await resizeImage(list); //重置图片尺寸 | 1584 | + Uint8List result = list; |
| 1585 | + if (needResize) { | ||
| 1586 | + result = await resizeImage(list); //重置图片尺寸 | ||
| 1587 | + } | ||
| 1584 | Uint8List resultnew = await realComporessList(result); //压缩图片 | 1588 | Uint8List resultnew = await realComporessList(result); //压缩图片 |
| 1585 | 1589 | ||
| 1586 | Loading.hideLoading(context); | 1590 | Loading.hideLoading(context); |
-
Please register or login to post a comment