Showing
13 changed files
with
198 additions
and
116 deletions
| @@ -11,14 +11,14 @@ if (flutterRoot == null) { | @@ -11,14 +11,14 @@ if (flutterRoot == null) { | ||
| 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | -def flutterVersionCode = "283" | 14 | +def flutterVersionCode = "285" |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '283' | 16 | + flutterVersionCode = '285' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | -def flutterVersionName = "2.8.3" | 19 | +def flutterVersionName = "2.8.5" |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '2.8.3' | 21 | + flutterVersionName = '2.8.5' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -114,6 +114,9 @@ class HttpUrl { | @@ -114,6 +114,9 @@ class HttpUrl { | ||
| 114 | "?service=App.Tables.SetTablePhoto"; // App设置桌位关联图片 | 114 | "?service=App.Tables.SetTablePhoto"; // App设置桌位关联图片 |
| 115 | static const String get_table_photo = | 115 | static const String get_table_photo = |
| 116 | "?service=App.Tables.GetTablePhoto"; // App获取桌位关联图片 | 116 | "?service=App.Tables.GetTablePhoto"; // App获取桌位关联图片 |
| 117 | + static const String get_tables_photo = | ||
| 118 | + "?service=App.Tables.GetTablesPhoto"; // App获取所传多个桌位关联图片 | ||
| 119 | + | ||
| 117 | static const String del_table_photo = | 120 | static const String del_table_photo = |
| 118 | "?service=App.Tables.DelTablePhoto"; // Apps删除桌位关联图片 | 121 | "?service=App.Tables.DelTablePhoto"; // Apps删除桌位关联图片 |
| 119 | 122 |
| @@ -614,7 +614,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -614,7 +614,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 614 | setState(() { | 614 | setState(() { |
| 615 | showPhoneHistory = true; | 615 | showPhoneHistory = true; |
| 616 | }); | 616 | }); |
| 617 | - Future.delayed(Duration(milliseconds: 300),(){ | 617 | + Future.delayed(Duration(milliseconds: 300), () { |
| 618 | _controller.jumpTo(_controller.position.maxScrollExtent); | 618 | _controller.jumpTo(_controller.position.maxScrollExtent); |
| 619 | }); | 619 | }); |
| 620 | }, | 620 | }, |
| @@ -702,7 +702,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -702,7 +702,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 702 | context, remarkManagerModel.ofenRemarks, (item) { | 702 | context, remarkManagerModel.ofenRemarks, (item) { |
| 703 | int index = | 703 | int index = |
| 704 | remarkManagerModel.ofenRemarks.indexOf(item); | 704 | remarkManagerModel.ofenRemarks.indexOf(item); |
| 705 | - _refreshRemark(remarkManagerModel.ofenRemarks, index); | 705 | + _refreshRemark( |
| 706 | + remarkManagerModel.ofenRemarks, index); | ||
| 706 | }); | 707 | }); |
| 707 | }, | 708 | }, |
| 708 | child: Container( | 709 | child: Container( |
| @@ -742,72 +743,80 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -742,72 +743,80 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 742 | blurRadius: ScreenUtil().setWidth(20)) | 743 | blurRadius: ScreenUtil().setWidth(20)) |
| 743 | ]), | 744 | ]), |
| 744 | width: ScreenUtil().setWidth(440), | 745 | width: ScreenUtil().setWidth(440), |
| 745 | - height: _notebookDetailChangeModel.userHistorys.length>1?ScreenUtil().setWidth(208):ScreenUtil().setWidth(104), | 746 | + height: _notebookDetailChangeModel.userHistorys.length > 1 |
| 747 | + ? ScreenUtil().setWidth(208) | ||
| 748 | + : ScreenUtil().setWidth(104), | ||
| 746 | padding: EdgeInsets.symmetric( | 749 | padding: EdgeInsets.symmetric( |
| 747 | horizontal: ScreenUtil().setWidth(30)), | 750 | horizontal: ScreenUtil().setWidth(30)), |
| 748 | child: Align( | 751 | child: Align( |
| 749 | - alignment: Alignment.topCenter, | ||
| 750 | - child: MediaQuery.removePadding(context: context, removeTop:true,child: ListView.builder( | ||
| 751 | - itemBuilder: (context, index) { | ||
| 752 | - return GestureDetector( | ||
| 753 | - onTap: () { | ||
| 754 | - setState(() { | ||
| 755 | - showPhoneHistory = false; | ||
| 756 | - _notebookDetailChangeModel | ||
| 757 | - .phoneController.text = | ||
| 758 | - _notebookDetailChangeModel | ||
| 759 | - .userHistorys[index].phone; | ||
| 760 | - _notebookDetailChangeModel.nameController.text = | ||
| 761 | - _notebookDetailChangeModel | ||
| 762 | - .userHistorys[index].rname; | ||
| 763 | - _phoneNode.unfocus(); | ||
| 764 | - _notebookDetailChangeModel.userHistorys.clear(); | ||
| 765 | - }); | ||
| 766 | - }, | ||
| 767 | - child: Container( | ||
| 768 | - width: double.infinity, | ||
| 769 | - height: ScreenUtil().setWidth(102), | ||
| 770 | - decoration: BoxDecoration( | ||
| 771 | - border: Border( | ||
| 772 | - bottom: (index != | ||
| 773 | - (_notebookDetailChangeModel | ||
| 774 | - .userHistorys.length - | ||
| 775 | - 1) && | 752 | + alignment: Alignment.topCenter, |
| 753 | + child: MediaQuery.removePadding( | ||
| 754 | + context: context, | ||
| 755 | + removeTop: true, | ||
| 756 | + child: ListView.builder( | ||
| 757 | + itemBuilder: (context, index) { | ||
| 758 | + return GestureDetector( | ||
| 759 | + onTap: () { | ||
| 760 | + setState(() { | ||
| 761 | + showPhoneHistory = false; | ||
| 762 | + _notebookDetailChangeModel | ||
| 763 | + .phoneController.text = | ||
| 776 | _notebookDetailChangeModel | 764 | _notebookDetailChangeModel |
| 777 | - .userHistorys.length > | ||
| 778 | - 1) | ||
| 779 | - ? BorderSide( | ||
| 780 | - color: MyColours.color_e5e5e5, | ||
| 781 | - width: ScreenUtil().setWidth(2)) | ||
| 782 | - : BorderSide.none)), | ||
| 783 | - child: Row( | ||
| 784 | - mainAxisAlignment: | ||
| 785 | - MainAxisAlignment.spaceBetween, | ||
| 786 | - children: [ | ||
| 787 | - Text( | ||
| 788 | - _notebookDetailChangeModel | ||
| 789 | - .userHistorys[index].phone, | ||
| 790 | - style: TextStyle( | ||
| 791 | - color: MyColours.color_333333, | ||
| 792 | - fontSize: ScreenUtil().setSp(32)), | 765 | + .userHistorys[index].phone; |
| 766 | + _notebookDetailChangeModel | ||
| 767 | + .nameController.text = | ||
| 768 | + _notebookDetailChangeModel | ||
| 769 | + .userHistorys[index].rname; | ||
| 770 | + _phoneNode.unfocus(); | ||
| 771 | + _notebookDetailChangeModel.userHistorys | ||
| 772 | + .clear(); | ||
| 773 | + }); | ||
| 774 | + }, | ||
| 775 | + child: Container( | ||
| 776 | + width: double.infinity, | ||
| 777 | + height: ScreenUtil().setWidth(102), | ||
| 778 | + decoration: BoxDecoration( | ||
| 779 | + border: Border( | ||
| 780 | + bottom: (index != | ||
| 781 | + (_notebookDetailChangeModel | ||
| 782 | + .userHistorys | ||
| 783 | + .length - | ||
| 784 | + 1) && | ||
| 785 | + _notebookDetailChangeModel | ||
| 786 | + .userHistorys.length > | ||
| 787 | + 1) | ||
| 788 | + ? BorderSide( | ||
| 789 | + color: MyColours.color_e5e5e5, | ||
| 790 | + width: | ||
| 791 | + ScreenUtil().setWidth(2)) | ||
| 792 | + : BorderSide.none)), | ||
| 793 | + child: Row( | ||
| 794 | + mainAxisAlignment: | ||
| 795 | + MainAxisAlignment.spaceBetween, | ||
| 796 | + children: [ | ||
| 797 | + Text( | ||
| 798 | + _notebookDetailChangeModel | ||
| 799 | + .userHistorys[index].phone, | ||
| 800 | + style: TextStyle( | ||
| 801 | + color: MyColours.color_333333, | ||
| 802 | + fontSize: ScreenUtil().setSp(32)), | ||
| 803 | + ), | ||
| 804 | + Text( | ||
| 805 | + _notebookDetailChangeModel | ||
| 806 | + .userHistorys[index].rname, | ||
| 807 | + style: TextStyle( | ||
| 808 | + color: MyColours.color_333333, | ||
| 809 | + fontSize: ScreenUtil().setSp(32)), | ||
| 810 | + ) | ||
| 811 | + ], | ||
| 812 | + ), | ||
| 793 | ), | 813 | ), |
| 794 | - Text( | ||
| 795 | - _notebookDetailChangeModel | ||
| 796 | - .userHistorys[index].rname, | ||
| 797 | - style: TextStyle( | ||
| 798 | - color: MyColours.color_333333, | ||
| 799 | - fontSize: ScreenUtil().setSp(32)), | ||
| 800 | - ) | ||
| 801 | - ], | ||
| 802 | - ), | ||
| 803 | - ), | ||
| 804 | - ); | ||
| 805 | - }, | ||
| 806 | - itemExtent: ScreenUtil().setWidth(104), | ||
| 807 | - itemCount: | ||
| 808 | - _notebookDetailChangeModel.userHistorys.length, | ||
| 809 | - )) | ||
| 810 | - ), | 814 | + ); |
| 815 | + }, | ||
| 816 | + itemExtent: ScreenUtil().setWidth(104), | ||
| 817 | + itemCount: | ||
| 818 | + _notebookDetailChangeModel.userHistorys.length, | ||
| 819 | + ))), | ||
| 811 | ), | 820 | ), |
| 812 | ) | 821 | ) |
| 813 | ], | 822 | ], |
| @@ -1165,10 +1174,18 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -1165,10 +1174,18 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 1165 | convert.jsonDecode(_model.row.tableinfo); | 1174 | convert.jsonDecode(_model.row.tableinfo); |
| 1166 | print(tableinfo); | 1175 | print(tableinfo); |
| 1167 | String _nameStr = t.TableList.fromJson(tableinfo[0]).name; | 1176 | String _nameStr = t.TableList.fromJson(tableinfo[0]).name; |
| 1177 | + | ||
| 1168 | if (tableinfo.length > 1) { | 1178 | if (tableinfo.length > 1) { |
| 1169 | _nameStr = t.TableList.fromJson(tableinfo[0]).name + | 1179 | _nameStr = t.TableList.fromJson(tableinfo[0]).name + |
| 1170 | '等${tableinfo.length}桌'; | 1180 | '等${tableinfo.length}桌'; |
| 1171 | } | 1181 | } |
| 1182 | + String _tid = ''; | ||
| 1183 | + for (int i = 0; i < tableinfo.length; i++) { | ||
| 1184 | + _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1185 | + } | ||
| 1186 | + if (_tid.endsWith(',')) { | ||
| 1187 | + _tid = _tid.substring(0, _tid.length - 1); | ||
| 1188 | + } | ||
| 1172 | LogUtil.v(_nameStr); | 1189 | LogUtil.v(_nameStr); |
| 1173 | NavigatorUtil.goInvicationPage( | 1190 | NavigatorUtil.goInvicationPage( |
| 1174 | context, | 1191 | context, |
| @@ -1178,7 +1195,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -1178,7 +1195,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 1178 | ddate_solt, | 1195 | ddate_solt, |
| 1179 | _model.row.phone, | 1196 | _model.row.phone, |
| 1180 | _model.row.ddateSolt, | 1197 | _model.row.ddateSolt, |
| 1181 | - tid:t.TableList.fromJson(tableinfo[0]).id, | 1198 | + tid: _tid, |
| 1182 | replace: true); | 1199 | replace: true); |
| 1183 | EventBus().emit("refresh_tablemanager"); //刷新桌位 | 1200 | EventBus().emit("refresh_tablemanager"); //刷新桌位 |
| 1184 | } else { | 1201 | } else { |
| @@ -1057,6 +1057,19 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1057,6 +1057,19 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1057 | ?.then((value) { | 1057 | ?.then((value) { |
| 1058 | switch (value) { | 1058 | switch (value) { |
| 1059 | case 1: //微信 | 1059 | case 1: //微信 |
| 1060 | + String _tid = ''; | ||
| 1061 | + for (int i = 0; | ||
| 1062 | + i < | ||
| 1063 | + detailEntity | ||
| 1064 | + .tables.length; | ||
| 1065 | + i++) { | ||
| 1066 | + _tid += | ||
| 1067 | + '${detailEntity.tables[i].id},'; | ||
| 1068 | + } | ||
| 1069 | + if (_tid.endsWith(',')) { | ||
| 1070 | + _tid = _tid.substring( | ||
| 1071 | + 0, _tid.length - 1); | ||
| 1072 | + } | ||
| 1060 | NavigatorUtil | 1073 | NavigatorUtil |
| 1061 | .goInvicationPage( | 1074 | .goInvicationPage( |
| 1062 | context, | 1075 | context, |
| @@ -1068,8 +1081,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1068,8 +1081,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1068 | detailEntity.phone, | 1081 | detailEntity.phone, |
| 1069 | detailEntity | 1082 | detailEntity |
| 1070 | .ddate_solt, | 1083 | .ddate_solt, |
| 1071 | - tid: detailEntity | ||
| 1072 | - .tables[0].id); | 1084 | + tid: _tid); |
| 1073 | break; | 1085 | break; |
| 1074 | case 2: //短信 | 1086 | case 2: //短信 |
| 1075 | if (detailEntity.phone == | 1087 | if (detailEntity.phone == |
| @@ -778,6 +778,13 @@ class _EnterPageState extends State<EnterPage> { | @@ -778,6 +778,13 @@ class _EnterPageState extends State<EnterPage> { | ||
| 778 | if (tableinfo.length > 1) { | 778 | if (tableinfo.length > 1) { |
| 779 | _nameStr = _model.row.name + '等${tableinfo.length}桌'; | 779 | _nameStr = _model.row.name + '等${tableinfo.length}桌'; |
| 780 | } | 780 | } |
| 781 | + String _tid = ''; | ||
| 782 | + for (int i = 0; i < tableinfo.length; i++) { | ||
| 783 | + _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 784 | + } | ||
| 785 | + if (_tid.endsWith(',')) { | ||
| 786 | + _tid = _tid.substring(0, _tid.length - 1); | ||
| 787 | + } | ||
| 781 | NavigatorUtil.goInvicationPage( | 788 | NavigatorUtil.goInvicationPage( |
| 782 | context, | 789 | context, |
| 783 | _model.row.id, | 790 | _model.row.id, |
| @@ -786,7 +793,7 @@ class _EnterPageState extends State<EnterPage> { | @@ -786,7 +793,7 @@ class _EnterPageState extends State<EnterPage> { | ||
| 786 | ddate_solt, | 793 | ddate_solt, |
| 787 | _model.row.phone, | 794 | _model.row.phone, |
| 788 | _model.row.ddateSolt, | 795 | _model.row.ddateSolt, |
| 789 | - tid:t.TableList.fromJson(tableinfo[0]).id, | 796 | + tid: _tid, |
| 790 | replace: true); | 797 | replace: true); |
| 791 | } else { | 798 | } else { |
| 792 | Utils.showToast("录入预订订单失败,请重试!"); | 799 | Utils.showToast("录入预订订单失败,请重试!"); |
| @@ -1364,6 +1364,13 @@ class _HomeEnterPageState extends State<HomeEnterPage> { | @@ -1364,6 +1364,13 @@ class _HomeEnterPageState extends State<HomeEnterPage> { | ||
| 1364 | '等${tableinfo.length}桌'; | 1364 | '等${tableinfo.length}桌'; |
| 1365 | } | 1365 | } |
| 1366 | LogUtil.v(_nameStr); | 1366 | LogUtil.v(_nameStr); |
| 1367 | + String _tid = ''; | ||
| 1368 | + for (int i = 0; i < tableinfo.length; i++) { | ||
| 1369 | + _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1370 | + } | ||
| 1371 | + if (_tid.endsWith(',')) { | ||
| 1372 | + _tid = _tid.substring(0, _tid.length - 1); | ||
| 1373 | + } | ||
| 1367 | NavigatorUtil.goInvicationPage( | 1374 | NavigatorUtil.goInvicationPage( |
| 1368 | context, | 1375 | context, |
| 1369 | _model.row.id, | 1376 | _model.row.id, |
| @@ -1372,7 +1379,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> { | @@ -1372,7 +1379,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> { | ||
| 1372 | ddate_solt, | 1379 | ddate_solt, |
| 1373 | _model.row.phone, | 1380 | _model.row.phone, |
| 1374 | _model.row.ddateSolt, | 1381 | _model.row.ddateSolt, |
| 1375 | - tid: t.TableList.fromJson(tableinfo[0]).id, | 1382 | + tid: _tid, |
| 1376 | replace: false); | 1383 | replace: false); |
| 1377 | //今天 明天 其他天 | 1384 | //今天 明天 其他天 |
| 1378 | String tempTime = _homeEnterModel.ddateStr; | 1385 | String tempTime = _homeEnterModel.ddateStr; |
| @@ -68,7 +68,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -68,7 +68,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 68 | couponProvider.sendSMS = false; | 68 | couponProvider.sendSMS = false; |
| 69 | _getActivityByRid(); | 69 | _getActivityByRid(); |
| 70 | _getCustomerActivityBaseinfo(); | 70 | _getCustomerActivityBaseinfo(); |
| 71 | - _getTablePhoto(); | 71 | + _getTablesPhoto(); |
| 72 | }); | 72 | }); |
| 73 | bus.on("refresh_coupon_invitation", (args) { | 73 | bus.on("refresh_coupon_invitation", (args) { |
| 74 | _couponNetworkData(isShowLoading: false); | 74 | _couponNetworkData(isShowLoading: false); |
| @@ -90,12 +90,12 @@ class InvicationPageState extends State<InvicationPage> { | @@ -90,12 +90,12 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 90 | super.dispose(); | 90 | super.dispose(); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | - _getTablePhoto() async { | 93 | + _getTablesPhoto() async { |
| 94 | Map<String, String> params = { | 94 | Map<String, String> params = { |
| 95 | "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, | 95 | "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, |
| 96 | - "tableid": widget.tid, | 96 | + "tableids": widget.tid, |
| 97 | }; | 97 | }; |
| 98 | - bool success = await _baseIndoProvider.getTablePhoto(context, params); | 98 | + bool success = await _baseIndoProvider.getTablesPhoto(context, params); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | //客户经理添加/修改基本信息 | 101 | //客户经理添加/修改基本信息 |
| @@ -31,7 +31,7 @@ class NotebookItemState extends State<NoteBookItem> { | @@ -31,7 +31,7 @@ class NotebookItemState extends State<NoteBookItem> { | ||
| 31 | widget.notebook.ddateStr, | 31 | widget.notebook.ddateStr, |
| 32 | widget.notebook.phone, | 32 | widget.notebook.phone, |
| 33 | widget.notebook.ddate_solt, | 33 | widget.notebook.ddate_solt, |
| 34 | - tid: widget.notebook.tid.split(',')[0]); | 34 | + tid: widget.notebook.tid); |
| 35 | } | 35 | } |
| 36 | } | 36 | } |
| 37 | 37 |
| @@ -27,6 +27,7 @@ import 'package:image_picker/image_picker.dart'; | @@ -27,6 +27,7 @@ import 'package:image_picker/image_picker.dart'; | ||
| 27 | import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; | 27 | import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart'; |
| 28 | import './dispose.dart'; | 28 | import './dispose.dart'; |
| 29 | import 'package:photo_manager/photo_manager.dart'; | 29 | import 'package:photo_manager/photo_manager.dart'; |
| 30 | +import 'package:flutter_native_image/flutter_native_image.dart'; | ||
| 30 | 31 | ||
| 31 | typedef void OnPickImageCallback( | 32 | typedef void OnPickImageCallback( |
| 32 | double maxWidth, double maxHeight, int quality); | 33 | double maxWidth, double maxHeight, int quality); |
| @@ -88,10 +89,14 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -88,10 +89,14 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 88 | ///#相机拍照,单图选择 | 89 | ///#相机拍照,单图选择 |
| 89 | Future _getFromPictureOrCamera(imageSource) async { | 90 | Future _getFromPictureOrCamera(imageSource) async { |
| 90 | final pickedFile = await picker.getImage(source: imageSource); | 91 | final pickedFile = await picker.getImage(source: imageSource); |
| 92 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 93 | + pickedFile.path, | ||
| 94 | + quality: 50, | ||
| 95 | + percentage: 50); | ||
| 91 | setState(() { | 96 | setState(() { |
| 92 | if (pickedFile != null) { | 97 | if (pickedFile != null) { |
| 93 | UploadImgModel imgModel = UploadImgModel(); | 98 | UploadImgModel imgModel = UploadImgModel(); |
| 94 | - imgModel.file = File(pickedFile.path); | 99 | + imgModel.file = compressedFile; |
| 95 | imgModel.process = 0.01; | 100 | imgModel.process = 0.01; |
| 96 | if (widget.uploadType == UploadType.ConsumptionUploadType) { | 101 | if (widget.uploadType == UploadType.ConsumptionUploadType) { |
| 97 | widget.model.imageList.add(imgModel); | 102 | widget.model.imageList.add(imgModel); |
| @@ -185,9 +190,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -185,9 +190,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 185 | } else { | 190 | } else { |
| 186 | for (int i = 0; i < imgList.length; i++) { | 191 | for (int i = 0; i < imgList.length; i++) { |
| 187 | var file = await imgList[i].file; | 192 | var file = await imgList[i].file; |
| 193 | + File compressedFile = await FlutterNativeImage.compressImage( | ||
| 194 | + file.absolute.path, | ||
| 195 | + quality: 50, | ||
| 196 | + percentage: 50); | ||
| 188 | setState(() { | 197 | setState(() { |
| 189 | UploadImgModel imgModel = UploadImgModel(); | 198 | UploadImgModel imgModel = UploadImgModel(); |
| 190 | - imgModel.file = File(file.absolute.path); | 199 | + imgModel.file = compressedFile; |
| 191 | imgModel.process = 0.01; | 200 | imgModel.process = 0.01; |
| 192 | 201 | ||
| 193 | temp.add(imgModel); | 202 | temp.add(imgModel); |
| @@ -521,8 +530,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | @@ -521,8 +530,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { | ||
| 521 | height: ScreenUtil().setWidth(100 * 2), | 530 | height: ScreenUtil().setWidth(100 * 2), |
| 522 | ), | 531 | ), |
| 523 | ) | 532 | ) |
| 524 | - : Image.network( | ||
| 525 | - temp[index].qiniuUrl, | 533 | + : CachedNetworkImage( |
| 534 | + imageUrl: temp[index].qiniuUrl, | ||
| 526 | fit: BoxFit.cover, | 535 | fit: BoxFit.cover, |
| 527 | width: ScreenUtil().setWidth(100 * 2), | 536 | width: ScreenUtil().setWidth(100 * 2), |
| 528 | height: ScreenUtil().setWidth(100 * 2), | 537 | height: ScreenUtil().setWidth(100 * 2), |
| @@ -116,12 +116,12 @@ class BaseIndoProvider with ChangeNotifier { | @@ -116,12 +116,12 @@ class BaseIndoProvider with ChangeNotifier { | ||
| 116 | // } | 116 | // } |
| 117 | // } | 117 | // } |
| 118 | 118 | ||
| 119 | - ///App获取桌位关联图片 | ||
| 120 | - Future<dynamic> getTablePhoto( | 119 | + ///App获取多个桌位关联图片 |
| 120 | + Future<dynamic> getTablesPhoto( | ||
| 121 | BuildContext context, Map<String, String> params, | 121 | BuildContext context, Map<String, String> params, |
| 122 | {isShowLoading = true}) async { | 122 | {isShowLoading = true}) async { |
| 123 | BaseResp<dynamic> baseResp = await DioUtil() | 123 | BaseResp<dynamic> baseResp = await DioUtil() |
| 124 | - .request<dynamic>(context, Method.get, HttpUrl.get_table_photo, | 124 | + .request<dynamic>(context, Method.get, HttpUrl.get_tables_photo, |
| 125 | data: params, showLoading: isShowLoading) | 125 | data: params, showLoading: isShowLoading) |
| 126 | .catchError((error) { | 126 | .catchError((error) { |
| 127 | print(error.toString()); | 127 | print(error.toString()); |
| @@ -215,29 +215,45 @@ class TableItemState extends State<TableItem> { | @@ -215,29 +215,45 @@ class TableItemState extends State<TableItem> { | ||
| 215 | right: 0, | 215 | right: 0, |
| 216 | child: signStr.isEmpty | 216 | child: signStr.isEmpty |
| 217 | ? Container() | 217 | ? Container() |
| 218 | - : Container( | ||
| 219 | - width: ScreenUtil().setWidth(160), | ||
| 220 | - height: ScreenUtil().setHeight(34), | 218 | + : Stack( |
| 221 | alignment: Alignment.center, | 219 | alignment: Alignment.center, |
| 222 | - decoration: BoxDecoration( | ||
| 223 | - color: signStr == '已停用' | ||
| 224 | - ? MyColours.color_777777 | ||
| 225 | - : signStr == '已买单' | ||
| 226 | - ? MyColours.color_F59A23 | ||
| 227 | - : MyColours.color_E95750, | ||
| 228 | - borderRadius: BorderRadius.only( | ||
| 229 | - bottomLeft: | ||
| 230 | - Radius.circular(ScreenUtil().setWidth(8)), | ||
| 231 | - bottomRight: Radius.circular( | ||
| 232 | - ScreenUtil().setWidth(8)))), | ||
| 233 | - child: Text( | ||
| 234 | - signStr, | ||
| 235 | - style: TextStyle( | ||
| 236 | - color: MyColours.color_ffffff, | ||
| 237 | - fontSize: ScreenUtil().setSp(24), | ||
| 238 | - decoration: TextDecoration.none, | ||
| 239 | - fontWeight: FontWeight.normal), | ||
| 240 | - ), | 220 | + children: [ |
| 221 | + Container( | ||
| 222 | + width: ScreenUtil().setWidth(160), | ||
| 223 | + height: ScreenUtil().setWidth(40), | ||
| 224 | + alignment: Alignment.center, | ||
| 225 | + decoration: BoxDecoration( | ||
| 226 | + color: signStr == '已停用' | ||
| 227 | + ? MyColours.color_777777 | ||
| 228 | + : signStr == '已买单' | ||
| 229 | + ? MyColours.color_F59A23 | ||
| 230 | + : MyColours.color_E95750, | ||
| 231 | + borderRadius: BorderRadius.only( | ||
| 232 | + bottomLeft: Radius.circular( | ||
| 233 | + ScreenUtil().setWidth(8)), | ||
| 234 | + bottomRight: Radius.circular( | ||
| 235 | + ScreenUtil().setWidth(8)))), | ||
| 236 | + child: Text( | ||
| 237 | + signStr, | ||
| 238 | + style: TextStyle( | ||
| 239 | + color: MyColours.color_ffffff, | ||
| 240 | + fontSize: ScreenUtil().setSp(24), | ||
| 241 | + decoration: TextDecoration.none, | ||
| 242 | + fontWeight: FontWeight.normal), | ||
| 243 | + ), | ||
| 244 | + ), | ||
| 245 | + Positioned( | ||
| 246 | + left: 0, | ||
| 247 | + bottom: 0, | ||
| 248 | + top: 0, | ||
| 249 | + child: table.isPhoto == 1 | ||
| 250 | + ? Image.asset( | ||
| 251 | + "assets/photo.png", | ||
| 252 | + width: ScreenUtil().setWidth(40), | ||
| 253 | + // height: ScreenUtil().setWidth(40), | ||
| 254 | + ) | ||
| 255 | + : Container()) | ||
| 256 | + ], | ||
| 241 | ), | 257 | ), |
| 242 | ), | 258 | ), |
| 243 | ], | 259 | ], |
| @@ -253,16 +269,18 @@ class TableItemState extends State<TableItem> { | @@ -253,16 +269,18 @@ class TableItemState extends State<TableItem> { | ||
| 253 | height: ScreenUtil().setWidth(40), | 269 | height: ScreenUtil().setWidth(40), |
| 254 | ) | 270 | ) |
| 255 | : Container()), | 271 | : Container()), |
| 256 | - Positioned( | ||
| 257 | - left: ScreenUtil().setWidth(8), | ||
| 258 | - bottom: ScreenUtil().setWidth(10), | ||
| 259 | - child: table.isPhoto == 1 | ||
| 260 | - ? Image.asset( | ||
| 261 | - "assets/photo.png", | ||
| 262 | - width: ScreenUtil().setWidth(40), | ||
| 263 | - height: ScreenUtil().setWidth(50), | ||
| 264 | - ) | ||
| 265 | - : Container()) | 272 | + signStr.isEmpty |
| 273 | + ? Positioned( | ||
| 274 | + left: ScreenUtil().setWidth(8), | ||
| 275 | + bottom: ScreenUtil().setWidth(16), | ||
| 276 | + child: table.isPhoto == 1 | ||
| 277 | + ? Image.asset( | ||
| 278 | + "assets/photo.png", | ||
| 279 | + width: ScreenUtil().setWidth(40), | ||
| 280 | + height: ScreenUtil().setWidth(40), | ||
| 281 | + ) | ||
| 282 | + : Container()) | ||
| 283 | + : Container() | ||
| 266 | ], | 284 | ], |
| 267 | ), | 285 | ), |
| 268 | ); | 286 | ); |
| @@ -384,6 +384,13 @@ packages: | @@ -384,6 +384,13 @@ packages: | ||
| 384 | url: "https://pub.flutter-io.cn" | 384 | url: "https://pub.flutter-io.cn" |
| 385 | source: hosted | 385 | source: hosted |
| 386 | version: "2.2.1" | 386 | version: "2.2.1" |
| 387 | + flutter_native_image: | ||
| 388 | + dependency: "direct main" | ||
| 389 | + description: | ||
| 390 | + name: flutter_native_image | ||
| 391 | + url: "https://pub.flutter-io.cn" | ||
| 392 | + source: hosted | ||
| 393 | + version: "0.0.6+1" | ||
| 387 | flutter_picker: | 394 | flutter_picker: |
| 388 | dependency: "direct main" | 395 | dependency: "direct main" |
| 389 | description: | 396 | description: |
-
Please register or login to post a comment