Commit 419c492672a36e536a1fcdfa71b8adc87793ca87

Authored by wdn127929
1 parent 54fb1310

桌位图片all

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "283"
def flutterVersionCode = "285"
if (flutterVersionCode == null) {
flutterVersionCode = '283'
flutterVersionCode = '285'
}
def flutterVersionName = "2.8.3"
def flutterVersionName = "2.8.5"
if (flutterVersionName == null) {
flutterVersionName = '2.8.3'
flutterVersionName = '2.8.5'
}
apply plugin: 'com.android.application'
... ...
... ... @@ -114,6 +114,9 @@ class HttpUrl {
"?service=App.Tables.SetTablePhoto"; // App设置桌位关联图片
static const String get_table_photo =
"?service=App.Tables.GetTablePhoto"; // App获取桌位关联图片
static const String get_tables_photo =
"?service=App.Tables.GetTablesPhoto"; // App获取所传多个桌位关联图片
static const String del_table_photo =
"?service=App.Tables.DelTablePhoto"; // Apps删除桌位关联图片
... ...
... ... @@ -614,7 +614,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
setState(() {
showPhoneHistory = true;
});
Future.delayed(Duration(milliseconds: 300),(){
Future.delayed(Duration(milliseconds: 300), () {
_controller.jumpTo(_controller.position.maxScrollExtent);
});
},
... ... @@ -702,7 +702,8 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
context, remarkManagerModel.ofenRemarks, (item) {
int index =
remarkManagerModel.ofenRemarks.indexOf(item);
_refreshRemark(remarkManagerModel.ofenRemarks, index);
_refreshRemark(
remarkManagerModel.ofenRemarks, index);
});
},
child: Container(
... ... @@ -742,72 +743,80 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
blurRadius: ScreenUtil().setWidth(20))
]),
width: ScreenUtil().setWidth(440),
height: _notebookDetailChangeModel.userHistorys.length>1?ScreenUtil().setWidth(208):ScreenUtil().setWidth(104),
height: _notebookDetailChangeModel.userHistorys.length > 1
? ScreenUtil().setWidth(208)
: ScreenUtil().setWidth(104),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30)),
child: Align(
alignment: Alignment.topCenter,
child: MediaQuery.removePadding(context: context, removeTop:true,child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.phoneController.text =
_notebookDetailChangeModel
.userHistorys[index].phone;
_notebookDetailChangeModel.nameController.text =
_notebookDetailChangeModel
.userHistorys[index].rname;
_phoneNode.unfocus();
_notebookDetailChangeModel.userHistorys.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.userHistorys.length -
1) &&
alignment: Alignment.topCenter,
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
showPhoneHistory = false;
_notebookDetailChangeModel
.phoneController.text =
_notebookDetailChangeModel
.userHistorys.length >
1)
? BorderSide(
color: MyColours.color_e5e5e5,
width: ScreenUtil().setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index].phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
.userHistorys[index].phone;
_notebookDetailChangeModel
.nameController.text =
_notebookDetailChangeModel
.userHistorys[index].rname;
_phoneNode.unfocus();
_notebookDetailChangeModel.userHistorys
.clear();
});
},
child: Container(
width: double.infinity,
height: ScreenUtil().setWidth(102),
decoration: BoxDecoration(
border: Border(
bottom: (index !=
(_notebookDetailChangeModel
.userHistorys
.length -
1) &&
_notebookDetailChangeModel
.userHistorys.length >
1)
? BorderSide(
color: MyColours.color_e5e5e5,
width:
ScreenUtil().setWidth(2))
: BorderSide.none)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
_notebookDetailChangeModel
.userHistorys[index].phone,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
),
Text(
_notebookDetailChangeModel
.userHistorys[index].rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
)
],
),
),
Text(
_notebookDetailChangeModel
.userHistorys[index].rname,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(32)),
)
],
),
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_notebookDetailChangeModel.userHistorys.length,
))
),
);
},
itemExtent: ScreenUtil().setWidth(104),
itemCount:
_notebookDetailChangeModel.userHistorys.length,
))),
),
)
],
... ... @@ -1165,10 +1174,18 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
convert.jsonDecode(_model.row.tableinfo);
print(tableinfo);
String _nameStr = t.TableList.fromJson(tableinfo[0]).name;
if (tableinfo.length > 1) {
_nameStr = t.TableList.fromJson(tableinfo[0]).name +
'等${tableinfo.length}桌';
}
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_tid += '${t.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
LogUtil.v(_nameStr);
NavigatorUtil.goInvicationPage(
context,
... ... @@ -1178,7 +1195,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> {
ddate_solt,
_model.row.phone,
_model.row.ddateSolt,
tid:t.TableList.fromJson(tableinfo[0]).id,
tid: _tid,
replace: true);
EventBus().emit("refresh_tablemanager"); //刷新桌位
} else {
... ...
... ... @@ -1057,6 +1057,19 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
?.then((value) {
switch (value) {
case 1: //微信
String _tid = '';
for (int i = 0;
i <
detailEntity
.tables.length;
i++) {
_tid +=
'${detailEntity.tables[i].id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(
0, _tid.length - 1);
}
NavigatorUtil
.goInvicationPage(
context,
... ... @@ -1068,8 +1081,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
detailEntity.phone,
detailEntity
.ddate_solt,
tid: detailEntity
.tables[0].id);
tid: _tid);
break;
case 2: //短信
if (detailEntity.phone ==
... ...
... ... @@ -778,6 +778,13 @@ class _EnterPageState extends State<EnterPage> {
if (tableinfo.length > 1) {
_nameStr = _model.row.name + '等${tableinfo.length}桌';
}
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_tid += '${t.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
NavigatorUtil.goInvicationPage(
context,
_model.row.id,
... ... @@ -786,7 +793,7 @@ class _EnterPageState extends State<EnterPage> {
ddate_solt,
_model.row.phone,
_model.row.ddateSolt,
tid:t.TableList.fromJson(tableinfo[0]).id,
tid: _tid,
replace: true);
} else {
Utils.showToast("录入预订订单失败,请重试!");
... ...
... ... @@ -1364,6 +1364,13 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
'等${tableinfo.length}桌';
}
LogUtil.v(_nameStr);
String _tid = '';
for (int i = 0; i < tableinfo.length; i++) {
_tid += '${t.TableList.fromJson(tableinfo[i]).id},';
}
if (_tid.endsWith(',')) {
_tid = _tid.substring(0, _tid.length - 1);
}
NavigatorUtil.goInvicationPage(
context,
_model.row.id,
... ... @@ -1372,7 +1379,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
ddate_solt,
_model.row.phone,
_model.row.ddateSolt,
tid: t.TableList.fromJson(tableinfo[0]).id,
tid: _tid,
replace: false);
//今天 明天 其他天
String tempTime = _homeEnterModel.ddateStr;
... ...
... ... @@ -68,7 +68,7 @@ class InvicationPageState extends State<InvicationPage> {
couponProvider.sendSMS = false;
_getActivityByRid();
_getCustomerActivityBaseinfo();
_getTablePhoto();
_getTablesPhoto();
});
bus.on("refresh_coupon_invitation", (args) {
_couponNetworkData(isShowLoading: false);
... ... @@ -90,12 +90,12 @@ class InvicationPageState extends State<InvicationPage> {
super.dispose();
}
_getTablePhoto() async {
_getTablesPhoto() async {
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"tableid": widget.tid,
"tableids": widget.tid,
};
bool success = await _baseIndoProvider.getTablePhoto(context, params);
bool success = await _baseIndoProvider.getTablesPhoto(context, params);
}
//客户经理添加/修改基本信息
... ...
... ... @@ -31,7 +31,7 @@ class NotebookItemState extends State<NoteBookItem> {
widget.notebook.ddateStr,
widget.notebook.phone,
widget.notebook.ddate_solt,
tid: widget.notebook.tid.split(',')[0]);
tid: widget.notebook.tid);
}
}
... ...
... ... @@ -27,6 +27,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
import './dispose.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:flutter_native_image/flutter_native_image.dart';
typedef void OnPickImageCallback(
double maxWidth, double maxHeight, int quality);
... ... @@ -88,10 +89,14 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
///#相机拍照,单图选择
Future _getFromPictureOrCamera(imageSource) async {
final pickedFile = await picker.getImage(source: imageSource);
File compressedFile = await FlutterNativeImage.compressImage(
pickedFile.path,
quality: 50,
percentage: 50);
setState(() {
if (pickedFile != null) {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(pickedFile.path);
imgModel.file = compressedFile;
imgModel.process = 0.01;
if (widget.uploadType == UploadType.ConsumptionUploadType) {
widget.model.imageList.add(imgModel);
... ... @@ -185,9 +190,13 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
} else {
for (int i = 0; i < imgList.length; i++) {
var file = await imgList[i].file;
File compressedFile = await FlutterNativeImage.compressImage(
file.absolute.path,
quality: 50,
percentage: 50);
setState(() {
UploadImgModel imgModel = UploadImgModel();
imgModel.file = File(file.absolute.path);
imgModel.file = compressedFile;
imgModel.process = 0.01;
temp.add(imgModel);
... ... @@ -521,8 +530,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
height: ScreenUtil().setWidth(100 * 2),
),
)
: Image.network(
temp[index].qiniuUrl,
: CachedNetworkImage(
imageUrl: temp[index].qiniuUrl,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(100 * 2),
height: ScreenUtil().setWidth(100 * 2),
... ...
... ... @@ -116,12 +116,12 @@ class BaseIndoProvider with ChangeNotifier {
// }
// }
///App获取桌位关联图片
Future<dynamic> getTablePhoto(
///App获取多个桌位关联图片
Future<dynamic> getTablesPhoto(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_table_photo,
.request<dynamic>(context, Method.get, HttpUrl.get_tables_photo,
data: params, showLoading: isShowLoading)
.catchError((error) {
print(error.toString());
... ...
... ... @@ -215,29 +215,45 @@ class TableItemState extends State<TableItem> {
right: 0,
child: signStr.isEmpty
? Container()
: Container(
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setHeight(34),
: Stack(
alignment: Alignment.center,
decoration: BoxDecoration(
color: signStr == '已停用'
? MyColours.color_777777
: signStr == '已买单'
? MyColours.color_F59A23
: MyColours.color_E95750,
borderRadius: BorderRadius.only(
bottomLeft:
Radius.circular(ScreenUtil().setWidth(8)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(8)))),
child: Text(
signStr,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
children: [
Container(
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(40),
alignment: Alignment.center,
decoration: BoxDecoration(
color: signStr == '已停用'
? MyColours.color_777777
: signStr == '已买单'
? MyColours.color_F59A23
: MyColours.color_E95750,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(8)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(8)))),
child: Text(
signStr,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24),
decoration: TextDecoration.none,
fontWeight: FontWeight.normal),
),
),
Positioned(
left: 0,
bottom: 0,
top: 0,
child: table.isPhoto == 1
? Image.asset(
"assets/photo.png",
width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
)
: Container())
],
),
),
],
... ... @@ -253,16 +269,18 @@ class TableItemState extends State<TableItem> {
height: ScreenUtil().setWidth(40),
)
: Container()),
Positioned(
left: ScreenUtil().setWidth(8),
bottom: ScreenUtil().setWidth(10),
child: table.isPhoto == 1
? Image.asset(
"assets/photo.png",
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(50),
)
: Container())
signStr.isEmpty
? Positioned(
left: ScreenUtil().setWidth(8),
bottom: ScreenUtil().setWidth(16),
child: table.isPhoto == 1
? Image.asset(
"assets/photo.png",
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
)
: Container())
: Container()
],
),
);
... ...
... ... @@ -384,6 +384,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.1"
flutter_native_image:
dependency: "direct main"
description:
name: flutter_native_image
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.6+1"
flutter_picker:
dependency: "direct main"
description:
... ...
... ... @@ -118,6 +118,8 @@ dependencies:
#汉字转拼音
lpinyin: ^2.0.3
#图片压缩
flutter_native_image: ^0.0.6+1
... ...