Commit d11a596b85ca3448de55ffea97840110979e21cd

Authored by wdn127929
1 parent 9d146b22

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

@@ -18,19 +18,19 @@ if (flutterRoot == null) { @@ -18,19 +18,19 @@ if (flutterRoot == null) {
18 18
19 19
20 20
21 -def flutterVersionCode = "523" 21 +def flutterVersionCode = "524"
22 if (flutterVersionCode == null) { 22 if (flutterVersionCode == null) {
23 - flutterVersionCode = '523' 23 + flutterVersionCode = '524'
24 24
25 25
26 26
27 } 27 }
28 28
29 29
30 -def flutterVersionName = "5.2.3" 30 +def flutterVersionName = "5.2.4"
31 31
32 if (flutterVersionName == null) { 32 if (flutterVersionName == null) {
33 - flutterVersionName = '5.2.3' 33 + flutterVersionName = '5.2.4'
34 34
35 35
36 } 36 }
@@ -115,7 +115,12 @@ class MarkReserveModel { @@ -115,7 +115,12 @@ class MarkReserveModel {
115 String swichPhone; // 115 String swichPhone; //
116 String swichManager; // 116 String swichManager; //
117 String swichPark; // 117 String swichPark; //
  118 + String swichBooking; //
  119 + String swichVoiceInfo;
118 String parkInfo; // 120 String parkInfo; //
  121 + String bookingInfo; //
  122 + String voiceInco;
  123 +
119 String sellerName; // 124 String sellerName; //
120 125
121 String date; // 126 String date; //
@@ -137,7 +142,11 @@ class MarkReserveModel { @@ -137,7 +142,11 @@ class MarkReserveModel {
137 {this.swichPhone, 142 {this.swichPhone,
138 this.swichManager, 143 this.swichManager,
139 this.swichPark, 144 this.swichPark,
  145 + this.swichBooking,
  146 + this.swichVoiceInfo,
140 this.parkInfo, 147 this.parkInfo,
  148 + this.bookingInfo,
  149 + this.voiceInco,
141 this.sellerName, 150 this.sellerName,
142 this.date, 151 this.date,
143 this.dsolt, 152 this.dsolt,
@@ -157,7 +166,14 @@ class MarkReserveModel { @@ -157,7 +166,14 @@ class MarkReserveModel {
157 swichManager = json['swich_manager']; 166 swichManager = json['swich_manager'];
158 swichPark = json['swich_park']; 167 swichPark = json['swich_park'];
159 168
  169 + swichBooking = json['swich_booking'];
  170 +
  171 + swichVoiceInfo = json['swich_voice'];
  172 +
160 parkInfo = json['park_info']; 173 parkInfo = json['park_info'];
  174 + bookingInfo = json['book_info'];
  175 + voiceInco = json['voice_info'];
  176 +
161 sellerName = json['seller_name']; 177 sellerName = json['seller_name'];
162 178
163 date = json['date']; 179 date = json['date'];
@@ -184,7 +200,13 @@ class MarkReserveModel { @@ -184,7 +200,13 @@ class MarkReserveModel {
184 data['swich_phone'] = this.swichPhone; 200 data['swich_phone'] = this.swichPhone;
185 data['swich_manager'] = this.swichManager; 201 data['swich_manager'] = this.swichManager;
186 data['swich_park'] = this.swichPark; 202 data['swich_park'] = this.swichPark;
  203 + data['swich_booking'] = this.swichBooking;
  204 + data['swich_voice'] = this.swichVoiceInfo;
  205 +
187 data['park_info'] = this.parkInfo; 206 data['park_info'] = this.parkInfo;
  207 +
  208 + data['book_info'] = this.bookingInfo;
  209 + data['voice_info'] = this.voiceInco;
188 data['seller_name'] = this.sellerName; 210 data['seller_name'] = this.sellerName;
189 data['date'] = this.date; 211 data['date'] = this.date;
190 data['dsolt'] = this.dsolt; 212 data['dsolt'] = this.dsolt;
@@ -17,6 +17,7 @@ import 'package:provider/provider.dart'; @@ -17,6 +17,7 @@ import 'package:provider/provider.dart';
17 import '../../../../constant/state.dart'; 17 import '../../../../constant/state.dart';
18 import '../../../../models/get_seller_info_model.dart'; 18 import '../../../../models/get_seller_info_model.dart';
19 import '../../../../models/mark_data_model.dart'; 19 import '../../../../models/mark_data_model.dart';
  20 +import '../../../../models/sms_change_field_model.dart';
20 import '../../../../models/upload_img_model.dart'; 21 import '../../../../models/upload_img_model.dart';
21 import '../../../../provider/base_info_provider.dart'; 22 import '../../../../provider/base_info_provider.dart';
22 import '../../../../provider/marketing_center_provider.dart'; 23 import '../../../../provider/marketing_center_provider.dart';
@@ -47,6 +48,12 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -47,6 +48,12 @@ class _BookInfoPageState extends State<BookInfoPage> {
47 TextEditingController parkingIncoC = TextEditingController(); 48 TextEditingController parkingIncoC = TextEditingController();
48 FocusNode parkingIncoNode = FocusNode(); 49 FocusNode parkingIncoNode = FocusNode();
49 50
  51 + TextEditingController bookingIncoC = TextEditingController();
  52 + FocusNode bookingIncoNode = FocusNode();
  53 +
  54 + TextEditingController voiceIncoC = TextEditingController();
  55 + FocusNode voiceIncoNode = FocusNode();
  56 +
50 String date; //日期 57 String date; //日期
51 String dsolt; //餐段 58 String dsolt; //餐段
52 String pnum; //人数 59 String pnum; //人数
@@ -62,6 +69,8 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -62,6 +69,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
62 bool addManager = false; 69 bool addManager = false;
63 bool addParking = false; 70 bool addParking = false;
64 bool addPhone = true; 71 bool addPhone = true;
  72 + bool addBookingInfo = false; //预订信息致辞
  73 + bool addVoiceInfo = false; //附加语音欢迎致辞
65 74
66 bool addFirstImage = false; //附加餐厅首图 75 bool addFirstImage = false; //附加餐厅首图
67 bool addLogo = false; //logo是否展示 76 bool addLogo = false; //logo是否展示
@@ -77,12 +86,55 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -77,12 +86,55 @@ class _BookInfoPageState extends State<BookInfoPage> {
77 final picker = ImagePicker(); 86 final picker = ImagePicker();
78 87
79 UploadImageProvider _uploadImageProvider; 88 UploadImageProvider _uploadImageProvider;
  89 + List<SmsChangeFieldSunModel> changeFieldData = []; //
80 90
81 @override 91 @override
82 void initState() { 92 void initState() {
83 super.initState(); 93 super.initState();
84 94
  95 + SmsChangeFieldSunModel smsChangeFieldSunModel1 = SmsChangeFieldSunModel();
  96 + smsChangeFieldSunModel1.name = '年月日';
  97 + smsChangeFieldSunModel1.show = '{年月日}';
  98 + changeFieldData.add(smsChangeFieldSunModel1);
  99 +
  100 + SmsChangeFieldSunModel smsChangeFieldSunModel2 = SmsChangeFieldSunModel();
  101 + smsChangeFieldSunModel2.name = '月日';
  102 + smsChangeFieldSunModel2.show = '{月日}';
  103 + changeFieldData.add(smsChangeFieldSunModel2);
  104 +
  105 + SmsChangeFieldSunModel smsChangeFieldSunModel3 = SmsChangeFieldSunModel();
  106 + smsChangeFieldSunModel3.name = '餐段';
  107 + smsChangeFieldSunModel3.show = '{餐段}';
  108 + changeFieldData.add(smsChangeFieldSunModel3);
  109 +
  110 + SmsChangeFieldSunModel smsChangeFieldSunModel4 = SmsChangeFieldSunModel();
  111 + smsChangeFieldSunModel4.name = '就餐时间';
  112 + smsChangeFieldSunModel4.show = '{就餐时间}';
  113 + changeFieldData.add(smsChangeFieldSunModel4);
  114 +
  115 + SmsChangeFieldSunModel smsChangeFieldSunModel5 = SmsChangeFieldSunModel();
  116 + smsChangeFieldSunModel5.name = '包间名';
  117 + smsChangeFieldSunModel5.show = '{包间名}';
  118 + changeFieldData.add(smsChangeFieldSunModel5);
  119 +
  120 + SmsChangeFieldSunModel smsChangeFieldSunModel6 = SmsChangeFieldSunModel();
  121 + smsChangeFieldSunModel6.name = '区域名+包间名';
  122 + smsChangeFieldSunModel6.show = '{区域名+包间名}';
  123 + changeFieldData.add(smsChangeFieldSunModel6);
  124 +
  125 + SmsChangeFieldSunModel smsChangeFieldSunModel7 = SmsChangeFieldSunModel();
  126 + smsChangeFieldSunModel7.name = '经理名字';
  127 + smsChangeFieldSunModel7.show = '{经理名字}';
  128 + changeFieldData.add(smsChangeFieldSunModel7);
  129 +
  130 + SmsChangeFieldSunModel smsChangeFieldSunModel8 = SmsChangeFieldSunModel();
  131 + smsChangeFieldSunModel8.name = '客人姓名';
  132 + smsChangeFieldSunModel8.show = '{客人姓名}';
  133 + changeFieldData.add(smsChangeFieldSunModel8);
  134 +
85 WidgetsBinding.instance.addPostFrameCallback((_) async { 135 WidgetsBinding.instance.addPostFrameCallback((_) async {
  136 + voiceIncoC.text =
  137 + '尊敬的贵宾,您好!\n感谢您选择${Provider.of<UserModel>(context, listen: false).user.sellername}!\n您的就餐安排在{预订日期},{餐段},坐席位于{桌位}。预祝您用餐愉快,期待您的光临!';
86 _getQiniuInfo(); 138 _getQiniuInfo();
87 139
88 await getSellerTemplateConf(); 140 await getSellerTemplateConf();
@@ -133,6 +185,20 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -133,6 +185,20 @@ class _BookInfoPageState extends State<BookInfoPage> {
133 : false; 185 : false;
134 parkingIncoC.text = 186 parkingIncoC.text =
135 marketingCenterProvider.markDataModel.reserve.parkInfo ?? ''; 187 marketingCenterProvider.markDataModel.reserve.parkInfo ?? '';
  188 +
  189 + addBookingInfo =
  190 + marketingCenterProvider.markDataModel.reserve.swichBooking == '1'
  191 + ? true
  192 + : false;
  193 + bookingIncoC.text =
  194 + marketingCenterProvider.markDataModel.reserve.bookingInfo ?? '';
  195 +
  196 + addVoiceInfo =
  197 + marketingCenterProvider.markDataModel.reserve.swichVoiceInfo == '1'
  198 + ? true
  199 + : false;
  200 + voiceIncoC.text =
  201 + marketingCenterProvider.markDataModel.reserve.voiceInco ?? '';
136 } 202 }
137 if (marketingCenterProvider.markDataModel.marketing != null) { 203 if (marketingCenterProvider.markDataModel.marketing != null) {
138 welcomeC.text = 204 welcomeC.text =
@@ -167,9 +233,20 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -167,9 +233,20 @@ class _BookInfoPageState extends State<BookInfoPage> {
167 decoration: BoxDecoration( 233 decoration: BoxDecoration(
168 border: Border( 234 border: Border(
169 bottom: BorderSide( 235 bottom: BorderSide(
170 - color: MyColours.color_E7E7E7, width: w(0.5)))), 236 + color: title == '附加停车信息' ||
  237 + title == '预订信息致辞' ||
  238 + title == '附加语音欢迎致辞'
  239 + ? MyColours.color_ffffff
  240 + : MyColours.color_E7E7E7,
  241 + width: w(0.5)))),
171 margin: EdgeInsets.only(left: w(16)), 242 margin: EdgeInsets.only(left: w(16)),
172 - padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)), 243 + padding: EdgeInsets.only(
  244 + top: w(12),
  245 + bottom:
  246 + title == '附加停车信息' || title == '预订信息致辞' || title == '附加语音欢迎致辞'
  247 + ? w(0)
  248 + : w(12),
  249 + right: w(16)),
173 child: Row( 250 child: Row(
174 children: [ 251 children: [
175 Text( 252 Text(
@@ -416,6 +493,54 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -416,6 +493,54 @@ class _BookInfoPageState extends State<BookInfoPage> {
416 }); 493 });
417 } 494 }
418 495
  496 + List<Widget> btnWidgets() {
  497 + List<Widget> data = [];
  498 + for (var i = 0; i < changeFieldData.length; i++) {
  499 + data.add(btnItem(changeFieldData[i].name, true, onTap: () {
  500 + changeFieldData[i].times++;
  501 + print(voiceIncoC.text);
  502 +
  503 + // 获取当前光标位置
  504 + // int cursorPosition = _cursorPosition;
  505 + int cursorPosition = voiceIncoC.selection.baseOffset;
  506 + if (cursorPosition != -1) {
  507 + // 插入文本
  508 + voiceIncoC.text = voiceIncoC.text.substring(0, cursorPosition) +
  509 + changeFieldData[i].show +
  510 + voiceIncoC.text.substring(cursorPosition);
  511 +
  512 + print(voiceIncoC.text);
  513 +
  514 + // 设置新的光标位置
  515 + voiceIncoC.selection = TextSelection.fromPosition(TextPosition(
  516 + offset: cursorPosition + changeFieldData[i].show.length,
  517 + affinity: TextAffinity.downstream));
  518 + } else {
  519 + voiceIncoC.text += changeFieldData[i].show;
  520 + }
  521 + }));
  522 + }
  523 + return data;
  524 + }
  525 +
  526 + Widget btnItem(String title, bool select, {GestureTapCallback onTap}) {
  527 + return InkWell(
  528 + onTap: onTap,
  529 + child: Container(
  530 + padding: EdgeInsets.all(w(3)),
  531 + decoration: BoxDecoration(
  532 + color: select ? MyColours.color_438E93 : MyColours.color_ffffff,
  533 + borderRadius: BorderRadius.circular(r(5)),
  534 + border: Border.all(width: w(1), color: MyColours.color_438E93)),
  535 + child: Text(title,
  536 + style: TextStyle(
  537 + color: select ? MyColours.color_ffffff : MyColours.color_438E93,
  538 + fontSize: font(12),
  539 + fontWeight: FontWeight.bold)),
  540 + ),
  541 + );
  542 + }
  543 +
419 /// 高级筛选输入框 544 /// 高级筛选输入框
420 Widget _textFeildWidget( 545 Widget _textFeildWidget(
421 TextEditingController controller, String name, String hintText) { 546 TextEditingController controller, String name, String hintText) {
@@ -516,450 +641,249 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -516,450 +641,249 @@ class _BookInfoPageState extends State<BookInfoPage> {
516 children: [ 641 children: [
517 Expanded( 642 Expanded(
518 child: SingleChildScrollView( 643 child: SingleChildScrollView(
519 - child: Column(children: [  
520 - VEmptyView(24),  
521 - _textFeildWidget(welcomeC, '餐厅欢迎语', '点击输入欢迎语'),  
522 - VEmptyView(24),  
523 - _textFeildWidget(sloganC, '餐厅广告语', '点击输入广告语'),  
524 -  
525 - _item(  
526 - '附加餐厅首图',  
527 - select: addFirstImage,  
528 - onTap: () {  
529 - setState(() {  
530 - addFirstImage = !addFirstImage;  
531 - });  
532 - },  
533 - ),  
534 - VEmptyView(24),  
535 - _uploadImageProvider.firstImage.file != null ||  
536 - (_uploadImageProvider.firstImage.qiniuUrl != null &&  
537 - _uploadImageProvider.firstImage.qiniuUrl != '')  
538 - ? InkWell(  
539 - onTap: () {  
540 - double process;  
541 - String qiniuUrl;  
542 - List<String> tempList = [];  
543 - // if (title == '头像') {  
544 - process = _uploadImageProvider.firstImage.process;  
545 - qiniuUrl =  
546 - _uploadImageProvider.firstImage.qiniuUrl;  
547 - // } else {  
548 - // process = _uploadImageProvider.erweima.process;  
549 - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;  
550 - // }  
551 -  
552 - if (qiniuUrl != null && qiniuUrl != '') {  
553 - // tempList.add(qiniuUrl);  
554 -  
555 - // ///没有上传完成的不可以点击  
556 - // _showPhotoView(context, 0, tempList);  
557 -  
558 - // _uploadImageProvider.firstImage.qiniuUrl = null;  
559 - // _uploadImageProvider.firstImage.process = 0;  
560 - // setState(() {});  
561 - _openModalBottomSheet(  
562 - context, _uploadImageProvider.firstImage, 4,  
563 - needResize: true);  
564 - // Utils.getPickPermission(context, () {  
565 - // _getFromPictureOrCamera(  
566 - // _uploadImageProvider.firstImage,  
567 - // ImageSource.gallery);  
568 - // },  
569 - // Platform.isAndroid  
570 - // ? Permission.storage  
571 - // : Permission.photos);  
572 - }  
573 - },  
574 - child: Stack(  
575 - alignment: Alignment.bottomCenter,  
576 - children: [  
577 - Stack(clipBehavior: Clip.none, children: [  
578 - _uploadImageProvider.firstImage.qiniuUrl !=  
579 - null &&  
580 - _uploadImageProvider  
581 - .firstImage.qiniuUrl !=  
582 - ''  
583 - ? Image.network(  
584 - _uploadImageProvider  
585 - .firstImage.qiniuUrl,  
586 - fit: BoxFit.cover,  
587 - width: double.infinity,  
588 - // width: ScreenUtil()  
589 - // .setWidth(imgSize * 2),  
590 - height: ScreenUtil().setWidth(  
591 - _uploadImageProvider  
592 - .imgSizefirstImage *  
593 - 2),  
594 - )  
595 - : Image.file(  
596 - _uploadImageProvider  
597 - .firstImage.file,  
598 - fit: BoxFit.cover,  
599 - width: double.infinity,  
600 - // width: ScreenUtil()  
601 - // .setWidth(imgSize * 2),  
602 - height: ScreenUtil().setWidth(  
603 - _uploadImageProvider  
604 - .imgSizefirstImage *  
605 - 2),  
606 - ),  
607 - Positioned(  
608 - left: 0,  
609 - top: 0,  
610 - child: (_uploadImageProvider  
611 - .firstImage.file !=  
612 - null) &&  
613 - _uploadImageProvider  
614 - .firstImage.process !=  
615 - 1 &&  
616 - _uploadImageProvider  
617 - .firstImage.process !=  
618 - 0.01  
619 - ? Container(  
620 - width: ScreenUtil().screenWidth,  
621 - height: w(_uploadImageProvider  
622 - .imgSizefirstImage),  
623 - color: MyColours.color_4D000000,  
624 - child: Center(  
625 - child: Text('上传中',  
626 - style: TextStyle(  
627 - color: MyColours  
628 - .color_F8F9FD)),  
629 - ),  
630 - )  
631 - : Container()),  
632 - if (_uploadImageProvider  
633 - .firstImage.process ==  
634 - 1)  
635 - Positioned(  
636 - top: 0,  
637 - right: 0,  
638 - child: GestureDetector(  
639 - child: Image.asset(  
640 - Utils.getImgPath("delete"),  
641 - width: ScreenUtil().setWidth(40),  
642 - height: ScreenUtil().setWidth(40),  
643 - ),  
644 - onTap: () {  
645 - //已经传到服务器,弹提醒窗口,是否删除  
646 - //修改之前有内容,则弹框  
647 - DialogUtil.cupertinoAlertDialog(  
648 - context,  
649 - title: "",  
650 - content: "是否确定删除该照片?",  
651 - lCallback: () {  
652 - print("取消");  
653 - }, rCallback: () {  
654 - _uploadImageProvider  
655 - .firstImage.qiniuUrl = null;  
656 - _uploadImageProvider  
657 - .firstImage.file = null;  
658 - _uploadImageProvider.firstImage  
659 - .isUpload = false;  
660 - _uploadImageProvider  
661 - .firstImage.process = 0;  
662 - setState(() {});  
663 - });  
664 - },  
665 - )),  
666 - ]),  
667 - _uploadImageProvider.firstImage.process == 1  
668 - ? Container(  
669 - width: w(150),  
670 - height: w(30),  
671 - color: MyColours.color_4D000000,  
672 - alignment: Alignment.center,  
673 - child: Text(  
674 - '点击图片可以更换',  
675 - style: TextStyle(  
676 - color: MyColours.color_F8F9FD,  
677 - fontSize: font(14),  
678 - fontWeight: FontWeight.bold),  
679 - ))  
680 - : SizedBox(),  
681 - ]))  
682 - : InkWell(  
683 - onTap: () {  
684 - // double process;  
685 - // String qiniuUrl;  
686 - // List<String> tempList = [];  
687 - // if (title == '头像') {  
688 - // process = _uploadImageProvider.touxiang.process;  
689 - // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;  
690 - // } else {  
691 - // process = _uploadImageProvider.erweima.process;  
692 - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;  
693 - // }  
694 -  
695 - // if (qiniuUrl != null && qiniuUrl != '') {  
696 - // tempList.add(qiniuUrl);  
697 -  
698 - // ///没有上传完成的不可以点击  
699 - // _showPhotoView(context, 0, tempList);  
700 - // } else {  
701 - // Utils.getPickPermission(context, () {  
702 - // _getFromPictureOrCamera(  
703 - // _uploadImageProvider.firstImage,  
704 - // ImageSource.gallery);  
705 - // },  
706 - // Platform.isAndroid  
707 - // ? Permission.storage  
708 - // : Permission.photos);  
709 - _openModalBottomSheet(  
710 - context, _uploadImageProvider.firstImage, 4,  
711 - needResize: true);  
712 - },  
713 - child: Container(  
714 - color: MyColours.color_d9d9d9,  
715 - width: double.infinity,  
716 - height: w(_uploadImageProvider.imgSizefirstImage),  
717 - child: Column(  
718 - mainAxisAlignment: MainAxisAlignment.center,  
719 - children: [  
720 - // VEmptyView(80),  
721 - Image.asset(  
722 - Utils.getImgPath('add_img'),  
723 - width: w(63),  
724 - ),  
725 - VEmptyView(28),  
726 - Container(  
727 - width: w(139),  
728 - height: w(60),  
729 - child: Text(  
730 - '点击上传照片\n为了更好的效果\n建议上传16:9照片',  
731 - textAlign: TextAlign.center,  
732 - style: TextStyle(  
733 - height: 1.4,  
734 - color: MyColours.color_ffffff,  
735 - fontSize: font(14),  
736 - fontWeight: FontWeight.bold),  
737 - ))  
738 - ], 644 + child: Column(
  645 + crossAxisAlignment: CrossAxisAlignment.start,
  646 + children: [
  647 + VEmptyView(24),
  648 + _textFeildWidget(welcomeC, '餐厅欢迎语', '点击输入欢迎语'),
  649 + VEmptyView(24),
  650 + _textFeildWidget(sloganC, '餐厅口号', '点击输入店铺口号'),
  651 +
  652 + VEmptyView(24),
  653 + _item('预订信息致辞', select: addBookingInfo, onTap: () {
  654 + setState(() {
  655 + addBookingInfo = !addBookingInfo;
  656 + });
  657 + }),
  658 + VEmptyView(24),
  659 + //输入框
  660 + Container(
  661 + width: double.infinity,
  662 + margin: EdgeInsets.symmetric(
  663 + horizontal: ScreenUtil().setWidth(40)),
  664 + padding: EdgeInsets.symmetric(
  665 + horizontal: ScreenUtil().setWidth(40),
  666 + vertical: ScreenUtil().setWidth(20)),
  667 + alignment: Alignment.topLeft,
  668 + decoration: BoxDecoration(
  669 + color: MyColours.color_ffffff,
  670 + border: Border.all(
  671 + color: MyColours.color_DBDBDB,
  672 + width: ScreenUtil().setWidth(2)),
  673 + borderRadius: BorderRadius.circular(
  674 + ScreenUtil().setWidth(20))),
  675 + child: TextField(
  676 + controller: bookingIncoC,
  677 + focusNode: bookingIncoNode,
  678 + style: TextStyle(
  679 + color: MyColours.color_515151,
  680 + fontSize: ScreenUtil().setSp(28),
  681 + textBaseline: TextBaseline.alphabetic),
  682 + textAlignVertical: TextAlignVertical.center,
  683 + maxLines: 5,
  684 + maxLength: 50,
  685 + decoration: InputDecoration(
  686 + hintText: "点击录入致辞文字,在预订详情顶部展示。最多50个汉字。",
  687 + hintStyle: TextStyle(
  688 + color: MyColours.color_999999,
  689 + fontSize: ScreenUtil().setSp(28),
  690 + ),
  691 + contentPadding: EdgeInsets.zero,
  692 + border: OutlineInputBorder(
  693 + borderSide: BorderSide.none),
739 ), 694 ),
740 - )),  
741 - VEmptyView(24),  
742 - _item('附加餐厅前台电话号码', select: addPhone, onTap: () {  
743 - setState(() {  
744 - addPhone = !addPhone;  
745 - });  
746 - }),  
747 - VEmptyView(24),  
748 - _item('附加餐厅经理名片', select: addManager, onTap: () {  
749 - setState(() {  
750 - addManager = !addManager;  
751 - });  
752 - }),  
753 - VEmptyView(24),  
754 - _item('附加停车信息', select: addParking, onTap: () {  
755 - setState(() {  
756 - addParking = !addParking;  
757 - });  
758 - }),  
759 - VEmptyView(24),  
760 - //输入框  
761 - Container(  
762 - width: double.infinity,  
763 - margin: EdgeInsets.symmetric(  
764 - horizontal: ScreenUtil().setWidth(40)),  
765 - padding: EdgeInsets.symmetric(  
766 - horizontal: ScreenUtil().setWidth(40),  
767 - vertical: ScreenUtil().setWidth(20)),  
768 - alignment: Alignment.topLeft,  
769 - decoration: BoxDecoration(  
770 - color: MyColours.color_ffffff,  
771 - border: Border.all( 695 + keyboardType: TextInputType.text,
  696 + onChanged: (value) {
  697 + setState(() {
  698 + // currentRemark = value ?? "";
  699 + });
  700 + }),
  701 + ),
  702 + VEmptyView(24),
  703 + Padding(
  704 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  705 + child: MyDivider(
  706 + double.infinity,
  707 + w(0.5),
772 color: MyColours.color_DBDBDB, 708 color: MyColours.color_DBDBDB,
773 - width: ScreenUtil().setWidth(2)),  
774 - borderRadius:  
775 - BorderRadius.circular(ScreenUtil().setWidth(20))),  
776 - child: TextField(  
777 - controller: parkingIncoC,  
778 - focusNode: parkingIncoNode,  
779 - style: TextStyle(  
780 - color: MyColours.color_515151,  
781 - fontSize: ScreenUtil().setSp(28),  
782 - textBaseline: TextBaseline.alphabetic),  
783 - textAlignVertical: TextAlignVertical.center,  
784 - maxLines: 5,  
785 - maxLength: 38,  
786 - decoration: InputDecoration(  
787 - hintText: "点击录入停车信息,最多38个汉字。",  
788 - hintStyle: TextStyle(  
789 - color: MyColours.color_999999,  
790 - fontSize: ScreenUtil().setSp(28),  
791 - ),  
792 - contentPadding: EdgeInsets.zero,  
793 - border:  
794 - OutlineInputBorder(borderSide: BorderSide.none),  
795 - ),  
796 - keyboardType: TextInputType.text,  
797 - onChanged: (value) { 709 + )),
  710 + VEmptyView(24),
  711 +
  712 + _item(
  713 + '附加餐厅首图',
  714 + select: addFirstImage,
  715 + onTap: () {
798 setState(() { 716 setState(() {
799 - // currentRemark = value ?? ""; 717 + addFirstImage = !addFirstImage;
800 }); 718 });
801 - }),  
802 - ),  
803 - VEmptyView(24),  
804 - Padding(  
805 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
806 - child: MyDivider(  
807 - double.infinity,  
808 - w(0.5),  
809 - color: MyColours.color_DBDBDB,  
810 - )),  
811 - VEmptyView(24),  
812 - _item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {  
813 - setState(() {  
814 - addLogo = !addLogo;  
815 - });  
816 - }),  
817 - _uploadImageProvider.logo.file != null ||  
818 - (_uploadImageProvider.logo.qiniuUrl != null &&  
819 - _uploadImageProvider.logo.qiniuUrl != '')  
820 - ? InkWell(  
821 - onTap: () {  
822 - // double process;  
823 - String qiniuUrl;  
824 - List<String> tempList = [];  
825 - // if (title == '头像') {  
826 - // process = _uploadImageProvider.logo.process;  
827 - qiniuUrl = _uploadImageProvider.logo.qiniuUrl;  
828 - // } else {  
829 - // process = _uploadImageProvider.erweima.process;  
830 - // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;  
831 - // }  
832 -  
833 - if (qiniuUrl != null && qiniuUrl != '') {  
834 - // _uploadImageProvider.logo.process = 0;  
835 - // setState(() {  
836 -  
837 - // });  
838 - // setState(() {});  
839 - // tempList.add(qiniuUrl);  
840 -  
841 - // ///没有上传完成的不可以点击  
842 - // _showPhotoView(context, 0, tempList);  
843 -  
844 - // _uploadImageProvider.firstImage.qiniuUrl = null;  
845 - // _uploadImageProvider.firstImage.process = 0;  
846 - // setState(() {});  
847 - _openModalBottomSheet(  
848 - context, _uploadImageProvider.logo, 9);  
849 - // Utils.getPickPermission(context, () {  
850 - // _getFromPictureOrCamera(  
851 - // _uploadImageProvider.firstImage,  
852 - // ImageSource.gallery);  
853 - // },  
854 - // Platform.isAndroid  
855 - // ? Permission.storage  
856 - // : Permission.photos);  
857 - }  
858 - },  
859 - child: Stack(  
860 - alignment: Alignment.bottomCenter,  
861 - children: [  
862 - Stack(clipBehavior: Clip.none, children: [  
863 - _uploadImageProvider.logo.qiniuUrl !=  
864 - null &&  
865 - _uploadImageProvider  
866 - .logo.qiniuUrl !=  
867 - ''  
868 - ? Center(  
869 - child: Image.network(  
870 - _uploadImageProvider.logo.qiniuUrl,  
871 - fit: BoxFit.contain,  
872 -  
873 - // width: double.infinity,  
874 - // width: ScreenUtil()  
875 - // .setWidth(imgSize * 2),  
876 - // height: w(210),  
877 - ))  
878 - : Center(  
879 - child: Image.file(  
880 - _uploadImageProvider.logo.file,  
881 - fit: BoxFit.contain,  
882 - // width: double.infinity,  
883 - // width: ScreenUtil()  
884 - // .setWidth(imgSize * 2),  
885 - // height: w(210),  
886 - )),  
887 - Positioned(  
888 - left: 0,  
889 - top: 0,  
890 - right: 0,  
891 - child: (_uploadImageProvider  
892 - .logo.file !=  
893 - null) && 719 + },
  720 + ),
  721 + VEmptyView(24),
  722 + _uploadImageProvider.firstImage.file != null ||
  723 + (_uploadImageProvider.firstImage.qiniuUrl !=
  724 + null &&
  725 + _uploadImageProvider.firstImage.qiniuUrl !=
  726 + '')
  727 + ? InkWell(
  728 + onTap: () {
  729 + double process;
  730 + String qiniuUrl;
  731 + List<String> tempList = [];
  732 + // if (title == '头像') {
  733 + process =
  734 + _uploadImageProvider.firstImage.process;
  735 + qiniuUrl =
  736 + _uploadImageProvider.firstImage.qiniuUrl;
  737 + // } else {
  738 + // process = _uploadImageProvider.erweima.process;
  739 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  740 + // }
  741 +
  742 + if (qiniuUrl != null && qiniuUrl != '') {
  743 + // tempList.add(qiniuUrl);
  744 +
  745 + // ///没有上传完成的不可以点击
  746 + // _showPhotoView(context, 0, tempList);
  747 +
  748 + // _uploadImageProvider.firstImage.qiniuUrl = null;
  749 + // _uploadImageProvider.firstImage.process = 0;
  750 + // setState(() {});
  751 + _openModalBottomSheet(context,
  752 + _uploadImageProvider.firstImage, 4,
  753 + needResize: true);
  754 + // Utils.getPickPermission(context, () {
  755 + // _getFromPictureOrCamera(
  756 + // _uploadImageProvider.firstImage,
  757 + // ImageSource.gallery);
  758 + // },
  759 + // Platform.isAndroid
  760 + // ? Permission.storage
  761 + // : Permission.photos);
  762 + }
  763 + },
  764 + child: Stack(
  765 + alignment: Alignment.bottomCenter,
  766 + children: [
  767 + Stack(clipBehavior: Clip.none, children: [
  768 + _uploadImageProvider
  769 + .firstImage.qiniuUrl !=
  770 + null &&
894 _uploadImageProvider 771 _uploadImageProvider
895 - .logo.process !=  
896 - 1 && 772 + .firstImage.qiniuUrl !=
  773 + ''
  774 + ? Image.network(
897 _uploadImageProvider 775 _uploadImageProvider
898 - .logo.process !=  
899 - 0.01  
900 - ? Container(  
901 - width: ScreenUtil().screenWidth,  
902 - height: w(210),  
903 - color: MyColours.color_4D000000,  
904 - child: Center(  
905 - child: Text('上传中',  
906 - style: TextStyle(  
907 - color: MyColours  
908 - .color_F8F9FD)),  
909 - ), 776 + .firstImage.qiniuUrl,
  777 + fit: BoxFit.cover,
  778 + width: double.infinity,
  779 + // width: ScreenUtil()
  780 + // .setWidth(imgSize * 2),
  781 + height: ScreenUtil().setWidth(
  782 + _uploadImageProvider
  783 + .imgSizefirstImage *
  784 + 2),
910 ) 785 )
911 - : Container()),  
912 - if (_uploadImageProvider.logo.process == 1)  
913 - Positioned(  
914 - top: 0,  
915 - right: 0,  
916 - child: GestureDetector(  
917 - child: Image.asset(  
918 - Utils.getImgPath("delete"),  
919 - width: ScreenUtil().setWidth(40),  
920 - height: ScreenUtil().setWidth(40),  
921 - ),  
922 - onTap: () {  
923 - //已经传到服务器,弹提醒窗口,是否删除  
924 - //修改之前有内容,则弹框  
925 - DialogUtil.cupertinoAlertDialog(  
926 - context,  
927 - title: "",  
928 - content: "是否确定删除该照片?",  
929 - lCallback: () {  
930 - print("取消");  
931 - }, rCallback: () {  
932 - _uploadImageProvider  
933 - .logo.qiniuUrl = null;  
934 - _uploadImageProvider.logo.file =  
935 - null; 786 + : Image.file(
936 _uploadImageProvider 787 _uploadImageProvider
937 - .logo.isUpload = false;  
938 - _uploadImageProvider  
939 - .logo.process = 0.01;  
940 - setState(() {});  
941 - });  
942 - },  
943 - )),  
944 - ]),  
945 - _uploadImageProvider.logo.process == 1  
946 - ? Container(  
947 - width: w(150),  
948 - height: w(30),  
949 - color: MyColours.color_4D000000,  
950 - alignment: Alignment.center,  
951 - child: Text(  
952 - '点击图片可以更换',  
953 - style: TextStyle(  
954 - color: MyColours.color_F8F9FD,  
955 - fontSize: font(14),  
956 - fontWeight: FontWeight.bold),  
957 - ))  
958 - : SizedBox(),  
959 - ]))  
960 - : Container(  
961 - height: w(210),  
962 - child: InkWell( 788 + .firstImage.file,
  789 + fit: BoxFit.cover,
  790 + width: double.infinity,
  791 + // width: ScreenUtil()
  792 + // .setWidth(imgSize * 2),
  793 + height: ScreenUtil().setWidth(
  794 + _uploadImageProvider
  795 + .imgSizefirstImage *
  796 + 2),
  797 + ),
  798 + Positioned(
  799 + left: 0,
  800 + top: 0,
  801 + child: (_uploadImageProvider
  802 + .firstImage.file !=
  803 + null) &&
  804 + _uploadImageProvider
  805 + .firstImage
  806 + .process !=
  807 + 1 &&
  808 + _uploadImageProvider
  809 + .firstImage
  810 + .process !=
  811 + 0.01
  812 + ? Container(
  813 + width: ScreenUtil()
  814 + .screenWidth,
  815 + height: w(
  816 + _uploadImageProvider
  817 + .imgSizefirstImage),
  818 + color: MyColours
  819 + .color_4D000000,
  820 + child: Center(
  821 + child: Text('上传中',
  822 + style: TextStyle(
  823 + color: MyColours
  824 + .color_F8F9FD)),
  825 + ),
  826 + )
  827 + : Container()),
  828 + if (_uploadImageProvider
  829 + .firstImage.process ==
  830 + 1)
  831 + Positioned(
  832 + top: 0,
  833 + right: 0,
  834 + child: GestureDetector(
  835 + child: Image.asset(
  836 + Utils.getImgPath("delete"),
  837 + width:
  838 + ScreenUtil().setWidth(40),
  839 + height:
  840 + ScreenUtil().setWidth(40),
  841 + ),
  842 + onTap: () {
  843 + //已经传到服务器,弹提醒窗口,是否删除
  844 + //修改之前有内容,则弹框
  845 + DialogUtil
  846 + .cupertinoAlertDialog(
  847 + context,
  848 + title: "",
  849 + content: "是否确定删除该照片?",
  850 + lCallback: () {
  851 + print("取消");
  852 + }, rCallback: () {
  853 + _uploadImageProvider
  854 + .firstImage
  855 + .qiniuUrl = null;
  856 + _uploadImageProvider
  857 + .firstImage.file = null;
  858 + _uploadImageProvider
  859 + .firstImage
  860 + .isUpload = false;
  861 + _uploadImageProvider
  862 + .firstImage.process = 0;
  863 + setState(() {});
  864 + });
  865 + },
  866 + )),
  867 + ]),
  868 + _uploadImageProvider.firstImage.process ==
  869 + 1
  870 + ? Container(
  871 + width: w(150),
  872 + height: w(30),
  873 + color: MyColours.color_4D000000,
  874 + alignment: Alignment.center,
  875 + child: Text(
  876 + '点击图片可以更换',
  877 + style: TextStyle(
  878 + color:
  879 + MyColours.color_F8F9FD,
  880 + fontSize: font(14),
  881 + fontWeight:
  882 + FontWeight.bold),
  883 + ))
  884 + : SizedBox(),
  885 + ]))
  886 + : InkWell(
963 onTap: () { 887 onTap: () {
964 // double process; 888 // double process;
965 // String qiniuUrl; 889 // String qiniuUrl;
@@ -986,13 +910,15 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -986,13 +910,15 @@ class _BookInfoPageState extends State<BookInfoPage> {
986 // Platform.isAndroid 910 // Platform.isAndroid
987 // ? Permission.storage 911 // ? Permission.storage
988 // : Permission.photos); 912 // : Permission.photos);
989 - _openModalBottomSheet(  
990 - context, _uploadImageProvider.logo, 9); 913 + _openModalBottomSheet(context,
  914 + _uploadImageProvider.firstImage, 4,
  915 + needResize: true);
991 }, 916 },
992 child: Container( 917 child: Container(
993 color: MyColours.color_d9d9d9, 918 color: MyColours.color_d9d9d9,
994 width: double.infinity, 919 width: double.infinity,
995 - height: w(180), 920 + height:
  921 + w(_uploadImageProvider.imgSizefirstImage),
996 child: Column( 922 child: Column(
997 mainAxisAlignment: MainAxisAlignment.center, 923 mainAxisAlignment: MainAxisAlignment.center,
998 children: [ 924 children: [
@@ -1006,7 +932,7 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1006,7 +932,7 @@ class _BookInfoPageState extends State<BookInfoPage> {
1006 width: w(139), 932 width: w(139),
1007 height: w(60), 933 height: w(60),
1008 child: Text( 934 child: Text(
1009 - '点击上传照片', 935 + '点击上传照片\n为了更好的效果\n建议上传16:9照片',
1010 textAlign: TextAlign.center, 936 textAlign: TextAlign.center,
1011 style: TextStyle( 937 style: TextStyle(
1012 height: 1.4, 938 height: 1.4,
@@ -1017,10 +943,390 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1017,10 +943,390 @@ class _BookInfoPageState extends State<BookInfoPage> {
1017 ], 943 ],
1018 ), 944 ),
1019 )), 945 )),
1020 - ), 946 + VEmptyView(24),
  947 + _item('附加餐厅前台电话号码', select: addPhone, onTap: () {
  948 + setState(() {
  949 + addPhone = !addPhone;
  950 + });
  951 + }),
  952 + VEmptyView(24),
  953 + _item('附加餐厅经理名片', select: addManager, onTap: () {
  954 + setState(() {
  955 + addManager = !addManager;
  956 + });
  957 + }),
  958 + VEmptyView(24),
  959 + _item('附加停车信息', select: addParking, onTap: () {
  960 + setState(() {
  961 + addParking = !addParking;
  962 + });
  963 + }),
  964 + VEmptyView(24),
  965 + //输入框
  966 + Container(
  967 + width: double.infinity,
  968 + margin: EdgeInsets.symmetric(
  969 + horizontal: ScreenUtil().setWidth(40)),
  970 + padding: EdgeInsets.symmetric(
  971 + horizontal: ScreenUtil().setWidth(40),
  972 + vertical: ScreenUtil().setWidth(20)),
  973 + alignment: Alignment.topLeft,
  974 + decoration: BoxDecoration(
  975 + color: MyColours.color_ffffff,
  976 + border: Border.all(
  977 + color: MyColours.color_DBDBDB,
  978 + width: ScreenUtil().setWidth(2)),
  979 + borderRadius: BorderRadius.circular(
  980 + ScreenUtil().setWidth(20))),
  981 + child: TextField(
  982 + controller: parkingIncoC,
  983 + focusNode: parkingIncoNode,
  984 + style: TextStyle(
  985 + color: MyColours.color_515151,
  986 + fontSize: ScreenUtil().setSp(28),
  987 + textBaseline: TextBaseline.alphabetic),
  988 + textAlignVertical: TextAlignVertical.center,
  989 + maxLines: 5,
  990 + maxLength: 38,
  991 + decoration: InputDecoration(
  992 + hintText: "点击录入停车信息,最多38个汉字。",
  993 + hintStyle: TextStyle(
  994 + color: MyColours.color_999999,
  995 + fontSize: ScreenUtil().setSp(28),
  996 + ),
  997 + contentPadding: EdgeInsets.zero,
  998 + border: OutlineInputBorder(
  999 + borderSide: BorderSide.none),
  1000 + ),
  1001 + keyboardType: TextInputType.text,
  1002 + onChanged: (value) {
  1003 + setState(() {
  1004 + // currentRemark = value ?? "";
  1005 + });
  1006 + }),
  1007 + ),
  1008 + VEmptyView(24),
  1009 + Padding(
  1010 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  1011 + child: MyDivider(
  1012 + double.infinity,
  1013 + w(0.5),
  1014 + color: MyColours.color_DBDBDB,
  1015 + )),
  1016 +
  1017 + VEmptyView(24),
  1018 + _item('附加语音欢迎致辞', select: addVoiceInfo, onTap: () {
  1019 + setState(() {
  1020 + addVoiceInfo = !addVoiceInfo;
  1021 + });
  1022 + }),
  1023 + VEmptyView(24),
  1024 + //输入框
  1025 + Container(
  1026 + width: double.infinity,
  1027 + margin: EdgeInsets.symmetric(
  1028 + horizontal: ScreenUtil().setWidth(40)),
  1029 + padding: EdgeInsets.symmetric(
  1030 + horizontal: ScreenUtil().setWidth(40),
  1031 + vertical: ScreenUtil().setWidth(20)),
  1032 + alignment: Alignment.topLeft,
  1033 + decoration: BoxDecoration(
  1034 + color: MyColours.color_ffffff,
  1035 + border: Border.all(
  1036 + color: MyColours.color_DBDBDB,
  1037 + width: ScreenUtil().setWidth(2)),
  1038 + borderRadius: BorderRadius.circular(
  1039 + ScreenUtil().setWidth(20))),
  1040 + child: TextField(
  1041 + controller: voiceIncoC,
  1042 + focusNode: voiceIncoNode,
  1043 + style: TextStyle(
  1044 + color: MyColours.color_515151,
  1045 + fontSize: ScreenUtil().setSp(28),
  1046 + textBaseline: TextBaseline.alphabetic),
  1047 + textAlignVertical: TextAlignVertical.center,
  1048 + maxLines: 5,
  1049 + // maxLength: 50,
  1050 + decoration: InputDecoration(
  1051 + hintText: "点击录入语音欢迎致辞",
  1052 + hintStyle: TextStyle(
  1053 + color: MyColours.color_999999,
  1054 + fontSize: ScreenUtil().setSp(28),
  1055 + ),
  1056 + contentPadding: EdgeInsets.zero,
  1057 + border: OutlineInputBorder(
  1058 + borderSide: BorderSide.none),
  1059 + ),
  1060 + keyboardType: TextInputType.text,
  1061 + onChanged: (value) {
  1062 + setState(() {
  1063 + // currentRemark = value ?? "";
  1064 + });
  1065 + }),
  1066 + ),
  1067 + VEmptyView(24),
  1068 +
  1069 + Container(
  1070 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  1071 + child: Text(
  1072 + '*{预定日期}、{餐段}、{桌位}不能修改,可以删除。',
  1073 + style: TextStyle(
  1074 + color: MyColours.color_999999,
  1075 + fontSize: font(14)),
  1076 + )),
  1077 + VEmptyView(24),
  1078 +
  1079 + Container(
  1080 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  1081 + child: Wrap(
  1082 + crossAxisAlignment: WrapCrossAlignment.start,
  1083 + alignment: WrapAlignment.start,
  1084 + spacing: w(10),
  1085 + runSpacing: w(10),
  1086 + children: btnWidgets(),
  1087 + )),
  1088 + VEmptyView(24),
  1089 + Padding(
  1090 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  1091 + child: MyDivider(
  1092 + double.infinity,
  1093 + w(0.5),
  1094 + color: MyColours.color_DBDBDB,
  1095 + )),
1021 1096
1022 - VEmptyView(16)  
1023 - ]), 1097 + // Padding(
  1098 + // padding: EdgeInsets.symmetric(horizontal: w(20)),
  1099 + // child: MyDivider(
  1100 + // double.infinity,
  1101 + // w(0.5),
  1102 + // color: MyColours.color_DBDBDB,
  1103 + // )),
  1104 + VEmptyView(24),
  1105 + _item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
  1106 + setState(() {
  1107 + addLogo = !addLogo;
  1108 + });
  1109 + }),
  1110 + _uploadImageProvider.logo.file != null ||
  1111 + (_uploadImageProvider.logo.qiniuUrl != null &&
  1112 + _uploadImageProvider.logo.qiniuUrl != '')
  1113 + ? InkWell(
  1114 + onTap: () {
  1115 + // double process;
  1116 + String qiniuUrl;
  1117 + List<String> tempList = [];
  1118 + // if (title == '头像') {
  1119 + // process = _uploadImageProvider.logo.process;
  1120 + qiniuUrl = _uploadImageProvider.logo.qiniuUrl;
  1121 + // } else {
  1122 + // process = _uploadImageProvider.erweima.process;
  1123 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  1124 + // }
  1125 +
  1126 + if (qiniuUrl != null && qiniuUrl != '') {
  1127 + // _uploadImageProvider.logo.process = 0;
  1128 + // setState(() {
  1129 +
  1130 + // });
  1131 + // setState(() {});
  1132 + // tempList.add(qiniuUrl);
  1133 +
  1134 + // ///没有上传完成的不可以点击
  1135 + // _showPhotoView(context, 0, tempList);
  1136 +
  1137 + // _uploadImageProvider.firstImage.qiniuUrl = null;
  1138 + // _uploadImageProvider.firstImage.process = 0;
  1139 + // setState(() {});
  1140 + _openModalBottomSheet(
  1141 + context, _uploadImageProvider.logo, 9);
  1142 + // Utils.getPickPermission(context, () {
  1143 + // _getFromPictureOrCamera(
  1144 + // _uploadImageProvider.firstImage,
  1145 + // ImageSource.gallery);
  1146 + // },
  1147 + // Platform.isAndroid
  1148 + // ? Permission.storage
  1149 + // : Permission.photos);
  1150 + }
  1151 + },
  1152 + child: Stack(
  1153 + alignment: Alignment.bottomCenter,
  1154 + children: [
  1155 + Stack(clipBehavior: Clip.none, children: [
  1156 + _uploadImageProvider.logo.qiniuUrl !=
  1157 + null &&
  1158 + _uploadImageProvider
  1159 + .logo.qiniuUrl !=
  1160 + ''
  1161 + ? Center(
  1162 + child: Image.network(
  1163 + _uploadImageProvider
  1164 + .logo.qiniuUrl,
  1165 + fit: BoxFit.contain,
  1166 +
  1167 + // width: double.infinity,
  1168 + // width: ScreenUtil()
  1169 + // .setWidth(imgSize * 2),
  1170 + // height: w(210),
  1171 + ))
  1172 + : Center(
  1173 + child: Image.file(
  1174 + _uploadImageProvider.logo.file,
  1175 + fit: BoxFit.contain,
  1176 + // width: double.infinity,
  1177 + // width: ScreenUtil()
  1178 + // .setWidth(imgSize * 2),
  1179 + // height: w(210),
  1180 + )),
  1181 + Positioned(
  1182 + left: 0,
  1183 + top: 0,
  1184 + right: 0,
  1185 + child:
  1186 + (_uploadImageProvider
  1187 + .logo.file !=
  1188 + null) &&
  1189 + _uploadImageProvider
  1190 + .logo.process !=
  1191 + 1 &&
  1192 + _uploadImageProvider
  1193 + .logo.process !=
  1194 + 0.01
  1195 + ? Container(
  1196 + width: ScreenUtil()
  1197 + .screenWidth,
  1198 + height: w(210),
  1199 + color: MyColours
  1200 + .color_4D000000,
  1201 + child: Center(
  1202 + child: Text('上传中',
  1203 + style: TextStyle(
  1204 + color: MyColours
  1205 + .color_F8F9FD)),
  1206 + ),
  1207 + )
  1208 + : Container()),
  1209 + if (_uploadImageProvider.logo.process ==
  1210 + 1)
  1211 + Positioned(
  1212 + top: 0,
  1213 + right: 0,
  1214 + child: GestureDetector(
  1215 + child: Image.asset(
  1216 + Utils.getImgPath("delete"),
  1217 + width:
  1218 + ScreenUtil().setWidth(40),
  1219 + height:
  1220 + ScreenUtil().setWidth(40),
  1221 + ),
  1222 + onTap: () {
  1223 + //已经传到服务器,弹提醒窗口,是否删除
  1224 + //修改之前有内容,则弹框
  1225 + DialogUtil
  1226 + .cupertinoAlertDialog(
  1227 + context,
  1228 + title: "",
  1229 + content: "是否确定删除该照片?",
  1230 + lCallback: () {
  1231 + print("取消");
  1232 + }, rCallback: () {
  1233 + _uploadImageProvider
  1234 + .logo.qiniuUrl = null;
  1235 + _uploadImageProvider
  1236 + .logo.file = null;
  1237 + _uploadImageProvider
  1238 + .logo.isUpload = false;
  1239 + _uploadImageProvider
  1240 + .logo.process = 0.01;
  1241 + setState(() {});
  1242 + });
  1243 + },
  1244 + )),
  1245 + ]),
  1246 + _uploadImageProvider.logo.process == 1
  1247 + ? Container(
  1248 + width: w(150),
  1249 + height: w(30),
  1250 + color: MyColours.color_4D000000,
  1251 + alignment: Alignment.center,
  1252 + child: Text(
  1253 + '点击图片可以更换',
  1254 + style: TextStyle(
  1255 + color:
  1256 + MyColours.color_F8F9FD,
  1257 + fontSize: font(14),
  1258 + fontWeight:
  1259 + FontWeight.bold),
  1260 + ))
  1261 + : SizedBox(),
  1262 + ]))
  1263 + : Container(
  1264 + height: w(210),
  1265 + child: InkWell(
  1266 + onTap: () {
  1267 + // double process;
  1268 + // String qiniuUrl;
  1269 + // List<String> tempList = [];
  1270 + // if (title == '头像') {
  1271 + // process = _uploadImageProvider.touxiang.process;
  1272 + // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;
  1273 + // } else {
  1274 + // process = _uploadImageProvider.erweima.process;
  1275 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  1276 + // }
  1277 +
  1278 + // if (qiniuUrl != null && qiniuUrl != '') {
  1279 + // tempList.add(qiniuUrl);
  1280 +
  1281 + // ///没有上传完成的不可以点击
  1282 + // _showPhotoView(context, 0, tempList);
  1283 + // } else {
  1284 + // Utils.getPickPermission(context, () {
  1285 + // _getFromPictureOrCamera(
  1286 + // _uploadImageProvider.firstImage,
  1287 + // ImageSource.gallery);
  1288 + // },
  1289 + // Platform.isAndroid
  1290 + // ? Permission.storage
  1291 + // : Permission.photos);
  1292 + _openModalBottomSheet(context,
  1293 + _uploadImageProvider.logo, 9);
  1294 + },
  1295 + child: Container(
  1296 + color: MyColours.color_d9d9d9,
  1297 + width: double.infinity,
  1298 + height: w(180),
  1299 + child: Column(
  1300 + mainAxisAlignment:
  1301 + MainAxisAlignment.center,
  1302 + children: [
  1303 + // VEmptyView(80),
  1304 + Image.asset(
  1305 + Utils.getImgPath('add_img'),
  1306 + width: w(63),
  1307 + ),
  1308 + VEmptyView(28),
  1309 + Container(
  1310 + width: w(139),
  1311 + height: w(60),
  1312 + child: Text(
  1313 + '点击上传照片',
  1314 + textAlign: TextAlign.center,
  1315 + style: TextStyle(
  1316 + height: 1.4,
  1317 + color:
  1318 + MyColours.color_ffffff,
  1319 + fontSize: font(14),
  1320 + fontWeight:
  1321 + FontWeight.bold),
  1322 + ))
  1323 + ],
  1324 + ),
  1325 + )),
  1326 + ),
  1327 +
  1328 + VEmptyView(16)
  1329 + ]),
1024 )), 1330 )),
1025 Container( 1331 Container(
1026 color: MyColours.color_ffffff, 1332 color: MyColours.color_ffffff,
@@ -1043,13 +1349,22 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1043,13 +1349,22 @@ class _BookInfoPageState extends State<BookInfoPage> {
1043 // return false; 1349 // return false;
1044 // } 1350 // }
1045 1351
  1352 + if (addBookingInfo &&
  1353 + bookingIncoC.text.trim().length == 0) {
  1354 + Utils.showToast('请输入预订信息致辞!');
  1355 + return false;
  1356 + }
  1357 +
1046 if (addParking && parkingIncoC.text.trim().length == 0) { 1358 if (addParking && parkingIncoC.text.trim().length == 0) {
1047 Utils.showToast('请输入停车信息!'); 1359 Utils.showToast('请输入停车信息!');
1048 return false; 1360 return false;
1049 } 1361 }
1050 - if (addFirstImage &&  
1051 - _uploadImageProvider.firstImage.qiniuUrl == null) {  
1052 - Utils.showToast('请上传餐厅首图!'); 1362 + if (addVoiceInfo && voiceIncoC.text.trim().length == 0) {
  1363 + Utils.showToast('请输入语音欢迎致辞!');
  1364 + return false;
  1365 + }
  1366 + if (addParking && parkingIncoC.text.trim().length == 0) {
  1367 + Utils.showToast('请输入停车信息!');
1053 return false; 1368 return false;
1054 } 1369 }
1055 1370
@@ -1075,7 +1390,11 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -1075,7 +1390,11 @@ class _BookInfoPageState extends State<BookInfoPage> {
1075 'swich_phone': addPhone ? '1' : '0', 1390 'swich_phone': addPhone ? '1' : '0',
1076 'swich_manager': addManager ? '1' : '0', 1391 'swich_manager': addManager ? '1' : '0',
1077 'swich_park': addParking ? '1' : '0', 1392 'swich_park': addParking ? '1' : '0',
  1393 + 'swich_booking': addBookingInfo ? '1' : '0',
  1394 + 'swich_voice': addBookingInfo ? '1' : '0',
1078 'park_info': parkingIncoC.text, 1395 'park_info': parkingIncoC.text,
  1396 + 'book_info': bookingIncoC.text,
  1397 + 'voice_info': voiceIncoC.text,
1079 // 'seller_name': sellername, 1398 // 'seller_name': sellername,
1080 // 'date': dateValue, 1399 // 'date': dateValue,
1081 // 'dsolt': dsolt, 1400 // 'dsolt': dsolt,