Commit d11a596b85ca3448de55ffea97840110979e21cd

Authored by wdn127929
1 parent 9d146b22

预订信息语音播报内容设置

... ... @@ -18,19 +18,19 @@ if (flutterRoot == null) {
def flutterVersionCode = "523"
def flutterVersionCode = "524"
if (flutterVersionCode == null) {
flutterVersionCode = '523'
flutterVersionCode = '524'
}
def flutterVersionName = "5.2.3"
def flutterVersionName = "5.2.4"
if (flutterVersionName == null) {
flutterVersionName = '5.2.3'
flutterVersionName = '5.2.4'
}
... ...
... ... @@ -115,7 +115,12 @@ class MarkReserveModel {
String swichPhone; //
String swichManager; //
String swichPark; //
String swichBooking; //
String swichVoiceInfo;
String parkInfo; //
String bookingInfo; //
String voiceInco;
String sellerName; //
String date; //
... ... @@ -137,7 +142,11 @@ class MarkReserveModel {
{this.swichPhone,
this.swichManager,
this.swichPark,
this.swichBooking,
this.swichVoiceInfo,
this.parkInfo,
this.bookingInfo,
this.voiceInco,
this.sellerName,
this.date,
this.dsolt,
... ... @@ -157,7 +166,14 @@ class MarkReserveModel {
swichManager = json['swich_manager'];
swichPark = json['swich_park'];
swichBooking = json['swich_booking'];
swichVoiceInfo = json['swich_voice'];
parkInfo = json['park_info'];
bookingInfo = json['book_info'];
voiceInco = json['voice_info'];
sellerName = json['seller_name'];
date = json['date'];
... ... @@ -184,7 +200,13 @@ class MarkReserveModel {
data['swich_phone'] = this.swichPhone;
data['swich_manager'] = this.swichManager;
data['swich_park'] = this.swichPark;
data['swich_booking'] = this.swichBooking;
data['swich_voice'] = this.swichVoiceInfo;
data['park_info'] = this.parkInfo;
data['book_info'] = this.bookingInfo;
data['voice_info'] = this.voiceInco;
data['seller_name'] = this.sellerName;
data['date'] = this.date;
data['dsolt'] = this.dsolt;
... ...
... ... @@ -17,6 +17,7 @@ import 'package:provider/provider.dart';
import '../../../../constant/state.dart';
import '../../../../models/get_seller_info_model.dart';
import '../../../../models/mark_data_model.dart';
import '../../../../models/sms_change_field_model.dart';
import '../../../../models/upload_img_model.dart';
import '../../../../provider/base_info_provider.dart';
import '../../../../provider/marketing_center_provider.dart';
... ... @@ -47,6 +48,12 @@ class _BookInfoPageState extends State<BookInfoPage> {
TextEditingController parkingIncoC = TextEditingController();
FocusNode parkingIncoNode = FocusNode();
TextEditingController bookingIncoC = TextEditingController();
FocusNode bookingIncoNode = FocusNode();
TextEditingController voiceIncoC = TextEditingController();
FocusNode voiceIncoNode = FocusNode();
String date; //日期
String dsolt; //餐段
String pnum; //人数
... ... @@ -62,6 +69,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
bool addManager = false;
bool addParking = false;
bool addPhone = true;
bool addBookingInfo = false; //预订信息致辞
bool addVoiceInfo = false; //附加语音欢迎致辞
bool addFirstImage = false; //附加餐厅首图
bool addLogo = false; //logo是否展示
... ... @@ -77,12 +86,55 @@ class _BookInfoPageState extends State<BookInfoPage> {
final picker = ImagePicker();
UploadImageProvider _uploadImageProvider;
List<SmsChangeFieldSunModel> changeFieldData = []; //
@override
void initState() {
super.initState();
SmsChangeFieldSunModel smsChangeFieldSunModel1 = SmsChangeFieldSunModel();
smsChangeFieldSunModel1.name = '年月日';
smsChangeFieldSunModel1.show = '{年月日}';
changeFieldData.add(smsChangeFieldSunModel1);
SmsChangeFieldSunModel smsChangeFieldSunModel2 = SmsChangeFieldSunModel();
smsChangeFieldSunModel2.name = '月日';
smsChangeFieldSunModel2.show = '{月日}';
changeFieldData.add(smsChangeFieldSunModel2);
SmsChangeFieldSunModel smsChangeFieldSunModel3 = SmsChangeFieldSunModel();
smsChangeFieldSunModel3.name = '餐段';
smsChangeFieldSunModel3.show = '{餐段}';
changeFieldData.add(smsChangeFieldSunModel3);
SmsChangeFieldSunModel smsChangeFieldSunModel4 = SmsChangeFieldSunModel();
smsChangeFieldSunModel4.name = '就餐时间';
smsChangeFieldSunModel4.show = '{就餐时间}';
changeFieldData.add(smsChangeFieldSunModel4);
SmsChangeFieldSunModel smsChangeFieldSunModel5 = SmsChangeFieldSunModel();
smsChangeFieldSunModel5.name = '包间名';
smsChangeFieldSunModel5.show = '{包间名}';
changeFieldData.add(smsChangeFieldSunModel5);
SmsChangeFieldSunModel smsChangeFieldSunModel6 = SmsChangeFieldSunModel();
smsChangeFieldSunModel6.name = '区域名+包间名';
smsChangeFieldSunModel6.show = '{区域名+包间名}';
changeFieldData.add(smsChangeFieldSunModel6);
SmsChangeFieldSunModel smsChangeFieldSunModel7 = SmsChangeFieldSunModel();
smsChangeFieldSunModel7.name = '经理名字';
smsChangeFieldSunModel7.show = '{经理名字}';
changeFieldData.add(smsChangeFieldSunModel7);
SmsChangeFieldSunModel smsChangeFieldSunModel8 = SmsChangeFieldSunModel();
smsChangeFieldSunModel8.name = '客人姓名';
smsChangeFieldSunModel8.show = '{客人姓名}';
changeFieldData.add(smsChangeFieldSunModel8);
WidgetsBinding.instance.addPostFrameCallback((_) async {
voiceIncoC.text =
'尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!';
_getQiniuInfo();
await getSellerTemplateConf();
... ... @@ -133,6 +185,20 @@ class _BookInfoPageState extends State<BookInfoPage> {
: false;
parkingIncoC.text =
marketingCenterProvider.markDataModel.reserve.parkInfo ?? '';
addBookingInfo =
marketingCenterProvider.markDataModel.reserve.swichBooking == '1'
? true
: false;
bookingIncoC.text =
marketingCenterProvider.markDataModel.reserve.bookingInfo ?? '';
addVoiceInfo =
marketingCenterProvider.markDataModel.reserve.swichVoiceInfo == '1'
? true
: false;
voiceIncoC.text =
marketingCenterProvider.markDataModel.reserve.voiceInco ?? '';
}
if (marketingCenterProvider.markDataModel.marketing != null) {
welcomeC.text =
... ... @@ -167,9 +233,20 @@ class _BookInfoPageState extends State<BookInfoPage> {
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_E7E7E7, width: w(0.5)))),
color: title == '附加停车信息' ||
title == '预订信息致辞' ||
title == '附加语音欢迎致辞'
? MyColours.color_ffffff
: MyColours.color_E7E7E7,
width: w(0.5)))),
margin: EdgeInsets.only(left: w(16)),
padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
padding: EdgeInsets.only(
top: w(12),
bottom:
title == '附加停车信息' || title == '预订信息致辞' || title == '附加语音欢迎致辞'
? w(0)
: w(12),
right: w(16)),
child: Row(
children: [
Text(
... ... @@ -416,6 +493,54 @@ class _BookInfoPageState extends State<BookInfoPage> {
});
}
List<Widget> btnWidgets() {
List<Widget> data = [];
for (var i = 0; i < changeFieldData.length; i++) {
data.add(btnItem(changeFieldData[i].name, true, onTap: () {
changeFieldData[i].times++;
print(voiceIncoC.text);
// 获取当前光标位置
// int cursorPosition = _cursorPosition;
int cursorPosition = voiceIncoC.selection.baseOffset;
if (cursorPosition != -1) {
// 插入文本
voiceIncoC.text = voiceIncoC.text.substring(0, cursorPosition) +
changeFieldData[i].show +
voiceIncoC.text.substring(cursorPosition);
print(voiceIncoC.text);
// 设置新的光标位置
voiceIncoC.selection = TextSelection.fromPosition(TextPosition(
offset: cursorPosition + changeFieldData[i].show.length,
affinity: TextAffinity.downstream));
} else {
voiceIncoC.text += changeFieldData[i].show;
}
}));
}
return data;
}
Widget btnItem(String title, bool select, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Container(
padding: EdgeInsets.all(w(3)),
decoration: BoxDecoration(
color: select ? MyColours.color_438E93 : MyColours.color_ffffff,
borderRadius: BorderRadius.circular(r(5)),
border: Border.all(width: w(1), color: MyColours.color_438E93)),
child: Text(title,
style: TextStyle(
color: select ? MyColours.color_ffffff : MyColours.color_438E93,
fontSize: font(12),
fontWeight: FontWeight.bold)),
),
);
}
/// 高级筛选输入框
Widget _textFeildWidget(
TextEditingController controller, String name, String hintText) {
... ... @@ -516,450 +641,249 @@ class _BookInfoPageState extends State<BookInfoPage> {
children: [
Expanded(
child: SingleChildScrollView(
child: Column(children: [
VEmptyView(24),
_textFeildWidget(welcomeC, '餐厅欢迎语', '点击输入欢迎语'),
VEmptyView(24),
_textFeildWidget(sloganC, '餐厅广告语', '点击输入广告语'),
_item(
'附加餐厅首图',
select: addFirstImage,
onTap: () {
setState(() {
addFirstImage = !addFirstImage;
});
},
),
VEmptyView(24),
_uploadImageProvider.firstImage.file != null ||
(_uploadImageProvider.firstImage.qiniuUrl != null &&
_uploadImageProvider.firstImage.qiniuUrl != '')
? InkWell(
onTap: () {
double process;
String qiniuUrl;
List<String> tempList = [];
// if (title == '头像') {
process = _uploadImageProvider.firstImage.process;
qiniuUrl =
_uploadImageProvider.firstImage.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// _uploadImageProvider.firstImage.qiniuUrl = null;
// _uploadImageProvider.firstImage.process = 0;
// setState(() {});
_openModalBottomSheet(
context, _uploadImageProvider.firstImage, 4,
needResize: true);
// 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.firstImage.qiniuUrl !=
null &&
_uploadImageProvider
.firstImage.qiniuUrl !=
''
? Image.network(
_uploadImageProvider
.firstImage.qiniuUrl,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider
.imgSizefirstImage *
2),
)
: Image.file(
_uploadImageProvider
.firstImage.file,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider
.imgSizefirstImage *
2),
),
Positioned(
left: 0,
top: 0,
child: (_uploadImageProvider
.firstImage.file !=
null) &&
_uploadImageProvider
.firstImage.process !=
1 &&
_uploadImageProvider
.firstImage.process !=
0.01
? Container(
width: ScreenUtil().screenWidth,
height: w(_uploadImageProvider
.imgSizefirstImage),
color: MyColours.color_4D000000,
child: Center(
child: Text('上传中',
style: TextStyle(
color: MyColours
.color_F8F9FD)),
),
)
: Container()),
if (_uploadImageProvider
.firstImage.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
.firstImage.qiniuUrl = null;
_uploadImageProvider
.firstImage.file = null;
_uploadImageProvider.firstImage
.isUpload = false;
_uploadImageProvider
.firstImage.process = 0;
setState(() {});
});
},
)),
]),
_uploadImageProvider.firstImage.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 != '') {
// 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.firstImage, 4,
needResize: true);
},
child: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(_uploadImageProvider.imgSizefirstImage),
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(
'点击上传照片\n为了更好的效果\n建议上传16:9照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
color: MyColours.color_ffffff,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
],
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(24),
_textFeildWidget(welcomeC, '餐厅欢迎语', '点击输入欢迎语'),
VEmptyView(24),
_textFeildWidget(sloganC, '餐厅口号', '点击输入店铺口号'),
VEmptyView(24),
_item('预订信息致辞', select: addBookingInfo, onTap: () {
setState(() {
addBookingInfo = !addBookingInfo;
});
}),
VEmptyView(24),
//输入框
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(20)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
color: MyColours.color_DBDBDB,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(20))),
child: TextField(
controller: bookingIncoC,
focusNode: bookingIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 50,
decoration: InputDecoration(
hintText: "点击录入致辞文字,在预订详情顶部展示。最多50个汉字。",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
)),
VEmptyView(24),
_item('附加餐厅前台电话号码', select: addPhone, onTap: () {
setState(() {
addPhone = !addPhone;
});
}),
VEmptyView(24),
_item('附加餐厅经理名片', select: addManager, onTap: () {
setState(() {
addManager = !addManager;
});
}),
VEmptyView(24),
_item('附加停车信息', select: addParking, onTap: () {
setState(() {
addParking = !addParking;
});
}),
VEmptyView(24),
//输入框
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(20)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
keyboardType: TextInputType.text,
onChanged: (value) {
setState(() {
// currentRemark = value ?? "";
});
}),
),
VEmptyView(24),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_DBDBDB,
width: ScreenUtil().setWidth(2)),
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(20))),
child: TextField(
controller: parkingIncoC,
focusNode: parkingIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 38,
decoration: InputDecoration(
hintText: "点击录入停车信息,最多38个汉字。",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border:
OutlineInputBorder(borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
)),
VEmptyView(24),
_item(
'附加餐厅首图',
select: addFirstImage,
onTap: () {
setState(() {
// currentRemark = value ?? "";
addFirstImage = !addFirstImage;
});
}),
),
VEmptyView(24),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_DBDBDB,
)),
VEmptyView(24),
_item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
setState(() {
addLogo = !addLogo;
});
}),
_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 != '') {
// _uploadImageProvider.logo.process = 0;
// setState(() {
// });
// setState(() {});
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// _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 !=
''
? 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) &&
},
),
VEmptyView(24),
_uploadImageProvider.firstImage.file != null ||
(_uploadImageProvider.firstImage.qiniuUrl !=
null &&
_uploadImageProvider.firstImage.qiniuUrl !=
'')
? InkWell(
onTap: () {
double process;
String qiniuUrl;
List<String> tempList = [];
// if (title == '头像') {
process =
_uploadImageProvider.firstImage.process;
qiniuUrl =
_uploadImageProvider.firstImage.qiniuUrl;
// } else {
// process = _uploadImageProvider.erweima.process;
// qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
// }
if (qiniuUrl != null && qiniuUrl != '') {
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// _uploadImageProvider.firstImage.qiniuUrl = null;
// _uploadImageProvider.firstImage.process = 0;
// setState(() {});
_openModalBottomSheet(context,
_uploadImageProvider.firstImage, 4,
needResize: true);
// 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
.firstImage.qiniuUrl !=
null &&
_uploadImageProvider
.logo.process !=
1 &&
.firstImage.qiniuUrl !=
''
? Image.network(
_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)),
),
.firstImage.qiniuUrl,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider
.imgSizefirstImage *
2),
)
: 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;
: Image.file(
_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(
.firstImage.file,
fit: BoxFit.cover,
width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
height: ScreenUtil().setWidth(
_uploadImageProvider
.imgSizefirstImage *
2),
),
Positioned(
left: 0,
top: 0,
child: (_uploadImageProvider
.firstImage.file !=
null) &&
_uploadImageProvider
.firstImage
.process !=
1 &&
_uploadImageProvider
.firstImage
.process !=
0.01
? Container(
width: ScreenUtil()
.screenWidth,
height: w(
_uploadImageProvider
.imgSizefirstImage),
color: MyColours
.color_4D000000,
child: Center(
child: Text('上传中',
style: TextStyle(
color: MyColours
.color_F8F9FD)),
),
)
: Container()),
if (_uploadImageProvider
.firstImage.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
.firstImage
.qiniuUrl = null;
_uploadImageProvider
.firstImage.file = null;
_uploadImageProvider
.firstImage
.isUpload = false;
_uploadImageProvider
.firstImage.process = 0;
setState(() {});
});
},
)),
]),
_uploadImageProvider.firstImage.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;
... ... @@ -986,13 +910,15 @@ class _BookInfoPageState extends State<BookInfoPage> {
// Platform.isAndroid
// ? Permission.storage
// : Permission.photos);
_openModalBottomSheet(
context, _uploadImageProvider.logo, 9);
_openModalBottomSheet(context,
_uploadImageProvider.firstImage, 4,
needResize: true);
},
child: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(180),
height:
w(_uploadImageProvider.imgSizefirstImage),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
... ... @@ -1006,7 +932,7 @@ class _BookInfoPageState extends State<BookInfoPage> {
width: w(139),
height: w(60),
child: Text(
'点击上传照片',
'点击上传照片\n为了更好的效果\n建议上传16:9照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
... ... @@ -1017,10 +943,390 @@ class _BookInfoPageState extends State<BookInfoPage> {
],
),
)),
),
VEmptyView(24),
_item('附加餐厅前台电话号码', select: addPhone, onTap: () {
setState(() {
addPhone = !addPhone;
});
}),
VEmptyView(24),
_item('附加餐厅经理名片', select: addManager, onTap: () {
setState(() {
addManager = !addManager;
});
}),
VEmptyView(24),
_item('附加停车信息', select: addParking, onTap: () {
setState(() {
addParking = !addParking;
});
}),
VEmptyView(24),
//输入框
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(20)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
color: MyColours.color_DBDBDB,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(20))),
child: TextField(
controller: parkingIncoC,
focusNode: parkingIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 38,
decoration: InputDecoration(
hintText: "点击录入停车信息,最多38个汉字。",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
setState(() {
// currentRemark = value ?? "";
});
}),
),
VEmptyView(24),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_DBDBDB,
)),
VEmptyView(24),
_item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () {
setState(() {
addVoiceInfo = !addVoiceInfo;
});
}),
VEmptyView(24),
//输入框
Container(
width: double.infinity,
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(20)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
color: MyColours.color_DBDBDB,
width: ScreenUtil().setWidth(2)),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(20))),
child: TextField(
controller: voiceIncoC,
focusNode: voiceIncoNode,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
// maxLength: 50,
decoration: InputDecoration(
hintText: "点击录入语音欢迎致辞",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
setState(() {
// currentRemark = value ?? "";
});
}),
),
VEmptyView(24),
Container(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Text(
'*{预定日期}、{餐段}、{桌位}不能修改,可以删除。',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14)),
)),
VEmptyView(24),
Container(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.start,
alignment: WrapAlignment.start,
spacing: w(10),
runSpacing: w(10),
children: btnWidgets(),
)),
VEmptyView(24),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_DBDBDB,
)),
VEmptyView(16)
]),
// Padding(
// padding: EdgeInsets.symmetric(horizontal: w(20)),
// child: MyDivider(
// double.infinity,
// w(0.5),
// color: MyColours.color_DBDBDB,
// )),
VEmptyView(24),
_item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
setState(() {
addLogo = !addLogo;
});
}),
_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 != '') {
// _uploadImageProvider.logo.process = 0;
// setState(() {
// });
// setState(() {});
// tempList.add(qiniuUrl);
// ///没有上传完成的不可以点击
// _showPhotoView(context, 0, tempList);
// _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 !=
''
? 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)
]),
)),
Container(
color: MyColours.color_ffffff,
... ... @@ -1043,13 +1349,22 @@ class _BookInfoPageState extends State<BookInfoPage> {
// return false;
// }
if (addBookingInfo &&
bookingIncoC.text.trim().length == 0) {
Utils.showToast('请输入预订信息致辞!');
return false;
}
if (addParking && parkingIncoC.text.trim().length == 0) {
Utils.showToast('请输入停车信息!');
return false;
}
if (addFirstImage &&
_uploadImageProvider.firstImage.qiniuUrl == null) {
Utils.showToast('请上传餐厅首图!');
if (addVoiceInfo && voiceIncoC.text.trim().length == 0) {
Utils.showToast('请输入语音欢迎致辞!');
return false;
}
if (addParking && parkingIncoC.text.trim().length == 0) {
Utils.showToast('请输入停车信息!');
return false;
}
... ... @@ -1075,7 +1390,11 @@ class _BookInfoPageState extends State<BookInfoPage> {
'swich_phone': addPhone ? '1' : '0',
'swich_manager': addManager ? '1' : '0',
'swich_park': addParking ? '1' : '0',
'swich_booking': addBookingInfo ? '1' : '0',
'swich_voice': addBookingInfo ? '1' : '0',
'park_info': parkingIncoC.text,
'book_info': bookingIncoC.text,
'voice_info': voiceIncoC.text,
// 'seller_name': sellername,
// 'date': dateValue,
// 'dsolt': dsolt,
... ...