Commit 5eec861b947084e4d44a0b22619bcfbce9e8e447

Authored by wdn127929
1 parent 430c0db0

营销中心图片显示高度自适应,宽度充满整个屏幕&&隐藏企业微信通知按钮

... ... @@ -136,6 +136,6 @@ class Table {
@override
String toString() {
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,}';
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,}';
}
}
... ...
... ... @@ -34,7 +34,7 @@ Table _$TableFromJson(Map<String, dynamic> json) {
..tidsCancel = json['tids'] as String
..lockTname = json['lock_tname'] as String
..reserveCount = json['reserveCount'] as String
..phone=json['phone'] as String
..phone = json['phone'] as String
..lockTid = json['lock_tid'] as String;
}
... ... @@ -43,7 +43,7 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{
'rid': instance.rid,
'tid': instance.tid,
'name': instance.name,
'isPhoto': instance.isPhoto,
'is_photo': instance.isPhoto,
'table_pnum': instance.table_pnum,
'most_pnum': instance.most_pnum,
'order_o': instance.order_o,
... ... @@ -65,5 +65,5 @@ Map<String, dynamic> _$TableToJson(Table instance) => <String, dynamic>{
'lock_tname': instance.lockTname,
'lock_tid': instance.lockTid,
'reserveCount': instance.reserveCount,
'phone':instance.phone
'phone': instance.phone
};
... ...
... ... @@ -192,7 +192,7 @@ class _CreateStorePageState extends State<CreateStorePage> {
final pickedFile = await picker.pickImage(source: imageSource);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
setState(() {
if (pickedFile != null) {
... ...
... ... @@ -79,7 +79,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> {
// print(ddd);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
setState(() {
if (pickedFile != null) {
... ... @@ -132,7 +132,7 @@ class _VideoPickerWidgetState extends DisposableState<VideoPickerWidget> {
if (pickedFile != null) {
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(pickedFile.path);
... ...
... ... @@ -4699,29 +4699,29 @@ class InvicationPageState extends State<InvicationPage>
}
}),
HEmptyView(20),
RoundButton(
text: '企业微信通知',
width: ScreenUtil().setWidth(110 * 2),
height: ScreenUtil().setWidth(96),
fontSize: 30,
textColor: MyColours.color_999999,
gradientStart: MyColours.color_f3f3f3,
gradientEnd: MyColours.color_f3f3f3,
radius: ScreenUtil().setWidth(8),
isBold: false,
onPressed: () async {
dynamic isSuccess = await Utils.goShareInvicationToWeChat(
context,
widget.rid,
Provider.of<UserModel>(context, listen: false).user.openid,
isWechat: false);
print(isSuccess);
// if (isSuccess) {
// // _addForward();
// }
},
),
HEmptyView(20),
// RoundButton(
// text: '企业微信通知',
// width: ScreenUtil().setWidth(110 * 2),
// height: ScreenUtil().setWidth(96),
// fontSize: 30,
// textColor: MyColours.color_999999,
// gradientStart: MyColours.color_f3f3f3,
// gradientEnd: MyColours.color_f3f3f3,
// radius: ScreenUtil().setWidth(8),
// isBold: false,
// onPressed: () async {
// dynamic isSuccess = await Utils.goShareInvicationToWeChat(
// context,
// widget.rid,
// Provider.of<UserModel>(context, listen: false).user.openid,
// isWechat: false);
// print(isSuccess);
// // if (isSuccess) {
// // // _addForward();
// // }
// },
// ),
// HEmptyView(20),
Expanded(
child: Stack(children: [
Row(
... ...
... ... @@ -405,7 +405,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
final pickedFile = await picker.pickImage(source: imageSource);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
setState(() {
if (pickedFile != null) {
... ...
... ... @@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:image_picker/image_picker.dart';
... ... @@ -207,13 +208,32 @@ class _BookInfoPageState extends State<BookInfoPage> {
}
///#相机拍照,单图选择
Future _getFromPictureOrCamera(
UploadImgModel imgModel, imageSource, int type) async {
Future _getFromPictureOrCamera(UploadImgModel imgModel, imageSource, int type,
{bool needResize = false}) async {
final pickedFile = await picker.pickImage(source: imageSource);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
percentage: 50);
//从相册选取照片后进行裁剪压缩
String path;
if (needResize) {
File yourFile = File(pickedFile.path);
Uint8List afterImg = await yourFile.readAsBytes();
Uint8List newImg = await Utils.testFromFileComporessList(
context, afterImg,
needResize: true);
path = await Utils.saveImage(newImg);
}
if (path == null) {
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 70,
percentage: 50);
path = compressedFile.path;
}
// File compressedFile = await FlutterNativeImage.compressImage(
// pickedFile.path,
// quality: 50,
// percentage: 50);
setState(() {
if (pickedFile != null) {
imgModel.file = File(pickedFile.path);
... ... @@ -234,7 +254,7 @@ class _BookInfoPageState extends State<BookInfoPage> {
bool need = await Utils.sizeNeed(File(pickedFile.path));
File file = File(pickedFile.path);
if (need) {
file = File(compressedFile.absolute.path);
file = File(path);
}
UploadImageUtil()
.startUploadOnly(context, file, type, true, _uploadImageProvider);
... ... @@ -243,7 +263,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
///添加图片UI弹出
Future _openModalBottomSheet(
context, UploadImgModel uploadImageModel, int type) async {
context, UploadImgModel uploadImageModel, int type,
{bool needResize = false}) async {
final option = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
... ... @@ -269,7 +290,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
// }, Permission.camera);
Utils.getPickPermission(context, () {
_getFromPictureOrCamera(
uploadImageModel, ImageSource.camera, type);
uploadImageModel, ImageSource.camera, type,
needResize: needResize);
Navigator.pop(context);
},
Platform.isAndroid
... ... @@ -307,7 +329,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
// : Permission.photos);
Utils.getPickPermission(context, () {
_getFromPictureOrCamera(
uploadImageModel, ImageSource.gallery, type);
uploadImageModel, ImageSource.gallery, type,
needResize: needResize);
Navigator.pop(context);
},
Platform.isAndroid
... ... @@ -496,8 +519,9 @@ class _BookInfoPageState extends State<BookInfoPage> {
// _uploadImageProvider.firstImage.qiniuUrl = null;
// _uploadImageProvider.firstImage.process = 0;
// setState(() {});
_openModalBottomSheet(context,
_uploadImageProvider.firstImage, 4);
_openModalBottomSheet(
context, _uploadImageProvider.firstImage, 4,
needResize: true);
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(
// _uploadImageProvider.firstImage,
... ... @@ -644,7 +668,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
// ? Permission.storage
// : Permission.photos);
_openModalBottomSheet(
context, _uploadImageProvider.firstImage, 4);
context, _uploadImageProvider.firstImage, 4,
needResize: true);
},
child: Container(
color: MyColours.color_d9d9d9,
... ... @@ -750,168 +775,38 @@ class _BookInfoPageState extends State<BookInfoPage> {
addLogo = !addLogo;
});
}),
Container(
height: w(210),
child: _uploadImageProvider.logo.file != null ||
(_uploadImageProvider.logo.qiniuUrl != null &&
_uploadImageProvider.logo.qiniuUrl != '')
? InkWell(
onTap: () {
double process;
String qiniuUrl;
List<String> tempList = [];
// if (title == '头像') {
process = _uploadImageProvider.logo.process;
qiniuUrl = _uploadImageProvider.logo.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
_uploadImageProvider.logo.file != null ||
(_uploadImageProvider.logo.qiniuUrl != null &&
_uploadImageProvider.logo.qiniuUrl != '')
? InkWell(
onTap: () {
// double process;
String qiniuUrl;
List<String> tempList = [];
// if (title == '头像') {
// process = _uploadImageProvider.logo.process;
qiniuUrl = _uploadImageProvider.logo.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
// _uploadImageProvider.firstImage.qiniuUrl = null;
// _uploadImageProvider.firstImage.process = 0;
// setState(() {});
_openModalBottomSheet(
context, _uploadImageProvider.logo, 9);
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(
// _uploadImageProvider.firstImage,
// ImageSource.gallery);
// },
// Platform.isAndroid
// ? Permission.storage
// : Permission.photos);
}
},
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Stack(clipBehavior: Clip.none, children: [
_uploadImageProvider.logo.qiniuUrl !=
null &&
_uploadImageProvider
.logo.qiniuUrl !=
''
? Image.network(
_uploadImageProvider
.logo.qiniuUrl,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: w(210),
)
: Image.file(
_uploadImageProvider.logo.file,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: w(210),
),
Positioned(
left: 0,
top: 0,
right: 0,
child: (_uploadImageProvider
.logo.file !=
null) &&
_uploadImageProvider
.logo.process !=
1 &&
_uploadImageProvider
.logo.process !=
0.01
? Container(
width:
ScreenUtil().screenWidth,
height: w(210),
color:
MyColours.color_4D000000,
child: Center(
child: Text('上传中',
style: TextStyle(
color: MyColours
.color_F8F9FD)),
),
)
: Container()),
if (_uploadImageProvider.logo.process ==
1)
Positioned(
top: 0,
right: 0,
child: GestureDetector(
child: Image.asset(
Utils.getImgPath("delete"),
width:
ScreenUtil().setWidth(40),
height:
ScreenUtil().setWidth(40),
),
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(
context,
title: "",
content: "是否确定删除该照片?",
lCallback: () {
print("取消");
}, rCallback: () {
_uploadImageProvider
.logo.qiniuUrl = null;
_uploadImageProvider
.logo.file = null;
_uploadImageProvider
.logo.isUpload = false;
_uploadImageProvider
.logo.process = 0.01;
setState(() {});
});
},
)),
]),
_uploadImageProvider.logo.process == 1
? Container(
width: w(150),
height: w(30),
color: MyColours.color_4D000000,
alignment: Alignment.center,
child: Text(
'点击图片可以更换',
style: TextStyle(
color: MyColours.color_F8F9FD,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
: SizedBox(),
]))
: InkWell(
onTap: () {
// double process;
// String qiniuUrl;
// List<String> tempList = [];
// if (title == '头像') {
// process = _uploadImageProvider.touxiang.process;
// qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
if (qiniuUrl != null && qiniuUrl != '') {
// _uploadImageProvider.logo.process = 0;
// setState(() {
// });
// setState(() {});
// tempList.add(qiniuUrl);
// if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// } else {
// _uploadImageProvider.firstImage.qiniuUrl = null;
// _uploadImageProvider.firstImage.process = 0;
// setState(() {});
_openModalBottomSheet(
context, _uploadImageProvider.logo, 9);
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(
// _uploadImageProvider.firstImage,
... ... @@ -920,38 +815,170 @@ class _BookInfoPageState extends State<BookInfoPage> {
// Platform.isAndroid
// ? Permission.storage
// : Permission.photos);
_openModalBottomSheet(
context, _uploadImageProvider.logo, 9);
},
child: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(180),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// VEmptyView(80),
Image.asset(
Utils.getImgPath('add_img'),
width: w(63),
),
VEmptyView(28),
Container(
width: w(139),
height: w(60),
child: Text(
'点击上传照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
color: MyColours.color_ffffff,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
],
),
)),
),
}
},
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Stack(clipBehavior: Clip.none, children: [
_uploadImageProvider.logo.qiniuUrl !=
null &&
_uploadImageProvider
.logo.qiniuUrl !=
''
? Center(
child: Image.network(
_uploadImageProvider.logo.qiniuUrl,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
// height: w(210),
))
: Center(
child: Image.file(
_uploadImageProvider.logo.file,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
// height: w(210),
)),
Positioned(
left: 0,
top: 0,
right: 0,
child: (_uploadImageProvider
.logo.file !=
null) &&
_uploadImageProvider
.logo.process !=
1 &&
_uploadImageProvider
.logo.process !=
0.01
? Container(
width: ScreenUtil().screenWidth,
height: w(210),
color: MyColours.color_4D000000,
child: Center(
child: Text('上传中',
style: TextStyle(
color: MyColours
.color_F8F9FD)),
),
)
: Container()),
if (_uploadImageProvider.logo.process == 1)
Positioned(
top: 0,
right: 0,
child: GestureDetector(
child: Image.asset(
Utils.getImgPath("delete"),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
),
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(
context,
title: "",
content: "是否确定删除该照片?",
lCallback: () {
print("取消");
}, rCallback: () {
_uploadImageProvider
.logo.qiniuUrl = null;
_uploadImageProvider.logo.file =
null;
_uploadImageProvider
.logo.isUpload = false;
_uploadImageProvider
.logo.process = 0.01;
setState(() {});
});
},
)),
]),
_uploadImageProvider.logo.process == 1
? Container(
width: w(150),
height: w(30),
color: MyColours.color_4D000000,
alignment: Alignment.center,
child: Text(
'点击图片可以更换',
style: TextStyle(
color: MyColours.color_F8F9FD,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
: SizedBox(),
]))
: Container(
height: w(210),
child: InkWell(
onTap: () {
// double process;
// String qiniuUrl;
// List<String> tempList = [];
// if (title == '头像') {
// process = _uploadImageProvider.touxiang.process;
// qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
// if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// } else {
// Utils.getPickPermission(context, () {
// _getFromPictureOrCamera(
// _uploadImageProvider.firstImage,
// ImageSource.gallery);
// },
// Platform.isAndroid
// ? Permission.storage
// : Permission.photos);
_openModalBottomSheet(
context, _uploadImageProvider.logo, 9);
},
child: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(180),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// VEmptyView(80),
Image.asset(
Utils.getImgPath('add_img'),
width: w(63),
),
VEmptyView(28),
Container(
width: w(139),
height: w(60),
child: Text(
'点击上传照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
color: MyColours.color_ffffff,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
],
),
)),
),
VEmptyView(16)
]),
... ...
... ... @@ -302,24 +302,26 @@ class _ChefIntroducePageState extends State<ChefIntroducePage> {
Stack(clipBehavior: Clip.none, children: [
_uploadImageProvider.firstImage.qiniuUrl != null &&
_uploadImageProvider.firstImage.qiniuUrl != ''
? Image.network(
? Center(
child: Image.network(
_uploadImageProvider.firstImage.qiniuUrl,
fit: BoxFit.cover,
width: double.infinity,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider.imgSizefirstImage * 2),
)
: Image.file(
// height: ScreenUtil().setWidth(
// _uploadImageProvider.imgSizefirstImage * 2),
))
: Center(
child: Image.file(
_uploadImageProvider.firstImage.file,
fit: BoxFit.cover,
width: double.infinity,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider.imgSizefirstImage * 2),
),
// height: ScreenUtil().setWidth(
// _uploadImageProvider.imgSizefirstImage * 2),
)),
Positioned(
left: 0,
top: 0,
... ...
... ... @@ -107,7 +107,7 @@ class _ImgPickerInvitationWidgetState
final pickedFile = await picker.pickImage(source: imageSource);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
setState(() {
if (pickedFile != null) {
... ... @@ -480,22 +480,24 @@ class _ImgPickerInvitationWidgetState
child: Stack(alignment: Alignment.bottomCenter, children: [
Stack(clipBehavior: Clip.none, children: [
imageModel.qiniuUrl != null && imageModel.qiniuUrl != ''
? Image.network(
? Center(
child: Image.network(
imageModel.qiniuUrl,
fit: BoxFit.cover,
width: double.infinity,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(281 * 2),
)
: Image.file(
// height: ScreenUtil().setWidth(281 * 2),
))
: Center(
child: Image.file(
imageModel.file,
fit: BoxFit.cover,
width: double.infinity,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(281 * 2),
),
// height: ScreenUtil().setWidth(281 * 2),
)),
Positioned(
left: 0,
top: 0,
... ...
... ... @@ -285,7 +285,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
///获取二维码
_getWechatQrcode({bool need = false}) async {
if (timer != null && timer.isActive ) {
if (timer != null && timer.isActive) {
timer.cancel();
}
... ... @@ -476,46 +476,47 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
),
VEmptyView(114),
data?.openid == null || data?.openid == 'null'
? RoundButton(
text: '绑定微信',
gradientStart: wechatColor,
gradientEnd: wechatColor,
borderColor: wechatColor,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(30 * 2),
fontSize: 32,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(12),
onPressed: () {
if (dcAdduserCode != '' && dcAdduserCode != null) {
DialogUtil.openAlertDialogImage(
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
} else {
_getWechatQrcode(need: true);
}
})
: RoundButton(
text: '更换微信',
gradientStart: wechatColor,
gradientEnd: wechatColor,
borderColor: wechatColor,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(30 * 2),
fontSize: 32,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(12),
onPressed: () {
if (dcAdduserCode != '' && dcAdduserCode != null) {
DialogUtil.openAlertDialogImage(
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
} else {
_getWechatQrcode(need: true);
}
}),
VEmptyView(48),
if (data?.openid == null || data?.openid == 'null')
RoundButton(
text: '绑定微信',
gradientStart: wechatColor,
gradientEnd: wechatColor,
borderColor: wechatColor,
width: ScreenUtil().setWidth(80 * 2),
height: ScreenUtil().setWidth(30 * 2),
fontSize: 32,
isBold: true,
textColor: MyColours.color_ffffff,
radius: ScreenUtil().setWidth(12),
onPressed: () {
if (dcAdduserCode != '' && dcAdduserCode != null) {
DialogUtil.openAlertDialogImage(
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
} else {
_getWechatQrcode(need: true);
}
}),
// : RoundButton(
// text: '更换微信',
// gradientStart: wechatColor,
// gradientEnd: wechatColor,
// borderColor: wechatColor,
// width: ScreenUtil().setWidth(80 * 2),
// height: ScreenUtil().setWidth(30 * 2),
// fontSize: 32,
// isBold: true,
// textColor: MyColours.color_ffffff,
// radius: ScreenUtil().setWidth(12),
// onPressed: () {
// if (dcAdduserCode != '' && dcAdduserCode != null) {
// DialogUtil.openAlertDialogImage(
// context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
// } else {
// _getWechatQrcode(need: true);
// }
// }),
if (data?.openid == null || data?.openid == 'null')
VEmptyView(48),
InkWell(
onTap: () {
NavigatorUtil.goPersonnelPasswordEditPage(context,
... ...
... ... @@ -633,12 +633,13 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
//从相册选取照片后进行裁剪压缩
File yourFile = File(pickedFile.path);
Uint8List afterImg = await yourFile.readAsBytes();
Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg);
Uint8List newImg = await Utils.testFromFileComporessList(context, afterImg,
needResize: true);
String path = await Utils.saveImage(newImg);
if (path == null) {
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
quality: 70,
percentage: 50);
path = compressedFile.path;
}
... ... @@ -1774,7 +1775,7 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
onTap: () {
Utils.getPickPermission(context,
() async {
Map temp = await NavigatorUtil
Map temp = await NavigatorUtil
.goMapChoicePointPage(context);
if (temp != null) {
mapAddress = temp;
... ...
... ... @@ -106,7 +106,7 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
if (path == null) {
File compressedFile = await FlutterNativeImage.compressImage(
yourFile.path,
quality: 50,
quality: 70,
percentage: 50);
path = compressedFile.path;
}
... ...
... ... @@ -185,6 +185,7 @@ class MyTableManageHomeModel with ChangeNotifier {
}
App.sp.setString('table_list', json.encode(tableOuterList));
return tableOuterList;
}
... ...
... ... @@ -1577,10 +1577,14 @@ class Utils {
///本地选择 图片压缩 Uint8List -> Uint8List
static Future<Uint8List> testFromFileComporessList(
BuildContext context, Uint8List list) async {
BuildContext context, Uint8List list,
{bool needResize = false}) async {
Loading.showLoading(context);
Uint8List result = await resizeImage(list); //重置图片尺寸
Uint8List result = list;
if (needResize) {
result = await resizeImage(list); //重置图片尺寸
}
Uint8List resultnew = await realComporessList(result); //压缩图片
Loading.hideLoading(context);
... ...