Commit f507313cb2b5808ef50e1373840bc00374b3b23c

Authored by wdn127929
1 parent 41c53bf0

预订信息模块OK

@@ -83,19 +83,21 @@ class MarkHomeModel { @@ -83,19 +83,21 @@ class MarkHomeModel {
83 String title; // 83 String title; //
84 String slogan; // 84 String slogan; //
85 String image; // 85 String image; //
  86 + String isFirstImage;
86 87
87 - MarkHomeModel({  
88 - this.themeColor,  
89 - this.title,  
90 - this.slogan,  
91 - this.image,  
92 - }); 88 + MarkHomeModel(
  89 + {this.themeColor,
  90 + this.title,
  91 + this.slogan,
  92 + this.image,
  93 + this.isFirstImage});
93 94
94 MarkHomeModel.fromJson(Map<String, dynamic> json) { 95 MarkHomeModel.fromJson(Map<String, dynamic> json) {
95 themeColor = json['theme_color']; 96 themeColor = json['theme_color'];
96 title = json['title']; 97 title = json['title'];
97 slogan = json['slogan']; 98 slogan = json['slogan'];
98 image = json['image']; 99 image = json['image'];
  100 + isFirstImage = json['id_first_image'];
99 } 101 }
100 102
101 Map<String, dynamic> toJson() { 103 Map<String, dynamic> toJson() {
@@ -104,6 +106,7 @@ class MarkHomeModel { @@ -104,6 +106,7 @@ class MarkHomeModel {
104 data['title'] = this.title; 106 data['title'] = this.title;
105 data['slogan'] = this.slogan; 107 data['slogan'] = this.slogan;
106 data['image'] = this.image; 108 data['image'] = this.image;
  109 + data['id_first_image'] = this.isFirstImage;
107 return data; 110 return data;
108 } 111 }
109 } 112 }
@@ -330,6 +333,8 @@ class MarkMarketingModel { @@ -330,6 +333,8 @@ class MarkMarketingModel {
330 String isCommentsCoupon; 333 String isCommentsCoupon;
331 List<CouponSunModel> couponDataListComments; 334 List<CouponSunModel> couponDataListComments;
332 335
  336 + String isLogo; //
  337 +
333 MarkMarketingModel( 338 MarkMarketingModel(
334 {this.isArrival, 339 {this.isArrival,
335 this.isLink, 340 this.isLink,
@@ -344,7 +349,8 @@ class MarkMarketingModel { @@ -344,7 +349,8 @@ class MarkMarketingModel {
344 this.couponDataList, 349 this.couponDataList,
345 this.isComments, 350 this.isComments,
346 this.isCommentsCoupon, 351 this.isCommentsCoupon,
347 - this.couponDataListComments}); 352 + this.couponDataListComments,
  353 + this.isLogo});
348 354
349 MarkMarketingModel.fromJson(Map<String, dynamic> json) { 355 MarkMarketingModel.fromJson(Map<String, dynamic> json) {
350 isTranspond = json['is_transpond']; 356 isTranspond = json['is_transpond'];
@@ -365,7 +371,13 @@ class MarkMarketingModel { @@ -365,7 +371,13 @@ class MarkMarketingModel {
365 //旧数据map 371 //旧数据map
366 couponDataList.add(CouponSunModel.fromJson(json['coupon_data'])); 372 couponDataList.add(CouponSunModel.fromJson(json['coupon_data']));
367 } else { 373 } else {
368 - var couponData = convert.jsonDecode(json['coupon_data']); 374 + var couponData;
  375 + if (json['coupon_data'] is String) {
  376 + couponData = convert.jsonDecode(json['coupon_data']);
  377 + } else {
  378 + couponData = json['coupon_data'];
  379 + }
  380 +
369 if (couponData is List) { 381 if (couponData is List) {
370 couponData.forEach((v) { 382 couponData.forEach((v) {
371 couponDataList.add(CouponSunModel.fromJson(v)); 383 couponDataList.add(CouponSunModel.fromJson(v));
@@ -382,6 +394,7 @@ class MarkMarketingModel { @@ -382,6 +394,7 @@ class MarkMarketingModel {
382 } 394 }
383 } 395 }
384 isComments = json['is_comments']; 396 isComments = json['is_comments'];
  397 + isLogo = json['is_logo'];
385 398
386 isCommentsCoupon = json['is_comments_coupon']; 399 isCommentsCoupon = json['is_comments_coupon'];
387 if (json['coupon_data_comments'] != null) { 400 if (json['coupon_data_comments'] != null) {
@@ -391,7 +404,13 @@ class MarkMarketingModel { @@ -391,7 +404,13 @@ class MarkMarketingModel {
391 couponDataListComments 404 couponDataListComments
392 .add(CouponSunModel.fromJson(json['coupon_data_comments'])); 405 .add(CouponSunModel.fromJson(json['coupon_data_comments']));
393 } else { 406 } else {
394 - var couponData = convert.jsonDecode(json['coupon_data_comments']); 407 + var couponData;
  408 + if (json['coupon_data_comments'] is String) {
  409 + couponData = convert.jsonDecode(json['coupon_data_comments']);
  410 + } else {
  411 + couponData = json['coupon_data_comments'];
  412 + }
  413 +
395 if (couponData is List) { 414 if (couponData is List) {
396 couponData.forEach((v) { 415 couponData.forEach((v) {
397 couponDataListComments.add(CouponSunModel.fromJson(v)); 416 couponDataListComments.add(CouponSunModel.fromJson(v));
1 import 'dart:convert'; 1 import 'dart:convert';
  2 +import 'dart:io';
2 3
3 import 'package:flutter/material.dart'; 4 import 'package:flutter/material.dart';
  5 +import 'package:flutter_native_image/flutter_native_image.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 6 import 'package:flutter_screenutil/flutter_screenutil.dart';
  7 +import 'package:image_picker/image_picker.dart';
5 import 'package:one_key/utils/utils.dart'; 8 import 'package:one_key/utils/utils.dart';
6 import 'package:one_key/widgets/MyDivider.dart'; 9 import 'package:one_key/widgets/MyDivider.dart';
7 import 'package:one_key/widgets/h_empty_view.dart'; 10 import 'package:one_key/widgets/h_empty_view.dart';
8 import 'package:one_key/widgets/system_app_bar.dart'; 11 import 'package:one_key/widgets/system_app_bar.dart';
9 import 'package:one_key/widgets/v_empty_view.dart'; 12 import 'package:one_key/widgets/v_empty_view.dart';
  13 +import 'package:permission_handler/permission_handler.dart';
10 import 'package:provider/provider.dart'; 14 import 'package:provider/provider.dart';
11 15
12 import '../../../../constant/state.dart'; 16 import '../../../../constant/state.dart';
13 import '../../../../models/get_seller_info_model.dart'; 17 import '../../../../models/get_seller_info_model.dart';
14 import '../../../../models/mark_data_model.dart'; 18 import '../../../../models/mark_data_model.dart';
  19 +import '../../../../models/upload_img_model.dart';
15 import '../../../../provider/base_info_provider.dart'; 20 import '../../../../provider/base_info_provider.dart';
16 import '../../../../provider/marketing_center_provider.dart'; 21 import '../../../../provider/marketing_center_provider.dart';
17 import '../../../../provider/store_base_info_provider.dart'; 22 import '../../../../provider/store_base_info_provider.dart';
  23 +import '../../../../provider/upload_img_provider.dart';
18 import '../../../../provider/user_model.dart'; 24 import '../../../../provider/user_model.dart';
19 import '../../../../res/colors.dart'; 25 import '../../../../res/colors.dart';
20 import '../../../../utils/screen_util.dart'; 26 import '../../../../utils/screen_util.dart';
  27 +import '../../../../utils/upload_image_util.dart';
21 import '../../../../widgets/page_exception.dart'; 28 import '../../../../widgets/page_exception.dart';
22 import '../../../../widgets/round_button.dart'; 29 import '../../../../widgets/round_button.dart';
23 import '../../personnel_type/base_info_personnal_page.dart'; 30 import '../../personnel_type/base_info_personnal_page.dart';
@@ -54,77 +61,90 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -54,77 +61,90 @@ class _BookInfoPageState extends State<BookInfoPage> {
54 bool addParking = false; 61 bool addParking = false;
55 bool addPhone = true; 62 bool addPhone = true;
56 63
  64 + bool addFirstImage = true; //附加餐厅首图
  65 + bool addLogo = true; //logo是否展示
  66 +
57 String dateValue; 67 String dateValue;
58 BaseIndoProvider _baseIndoProvider; 68 BaseIndoProvider _baseIndoProvider;
59 String lat; 69 String lat;
60 String long; 70 String long;
61 71
  72 + TextEditingController welcomeC = TextEditingController();
  73 + TextEditingController sloganC = TextEditingController();
  74 + FocusNode sloganNode = FocusNode();
  75 + final picker = ImagePicker();
  76 +
  77 + UploadImageProvider _uploadImageProvider;
  78 +
62 @override 79 @override
63 void initState() { 80 void initState() {
64 super.initState(); 81 super.initState();
65 82
66 WidgetsBinding.instance.addPostFrameCallback((_) async { 83 WidgetsBinding.instance.addPostFrameCallback((_) async {
67 - _initData(context);  
68 -  
69 - await marketingCenterProvider.getTableList(context);  
70 - _getStoreBaseinfo();  
71 - _getCustomerActivityBaseinfo(); 84 + _getQiniuInfo();
72 85
73 await getSellerTemplateConf(); 86 await getSellerTemplateConf();
74 }); 87 });
75 } 88 }
76 89
77 - getSellerTemplateConf() async {  
78 - bool success = await marketingCenterProvider.getSellerTemplateConf(context);  
79 - if (success && marketingCenterProvider.markDataModel.reserve != null) {  
80 - addPhone = marketingCenterProvider.markDataModel.reserve.swichPhone == '0'  
81 - ? false  
82 - : true;  
83 - addManager =  
84 - marketingCenterProvider.markDataModel.reserve.swichManager == '1'  
85 - ? true  
86 - : false;  
87 - addParking =  
88 - marketingCenterProvider.markDataModel.reserve.swichPark == '1'  
89 - ? true  
90 - : false;  
91 - parkingIncoC.text =  
92 - marketingCenterProvider.markDataModel.reserve.parkInfo;  
93 -  
94 - setState(() {});  
95 - } 90 + ///获取七牛云token
  91 + ///
  92 + _getQiniuInfo() async {
  93 + await _uploadImageProvider.getQiniuInfo(context, {});
96 } 94 }
97 95
98 - _getCustomerActivityBaseinfo() async {  
99 - Map<String, String> params = {  
100 - 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,  
101 - "uid": Provider.of<UserModel>(context, listen: false).user.openid,  
102 - };  
103 -  
104 - bool success =  
105 - await _baseIndoProvider.getCustomerActivityBaseinfo(context, params); 96 + getSellerTemplateConf() async {
  97 + bool success = await marketingCenterProvider.getSellerTemplateConf(context);
106 if (success) { 98 if (success) {
107 - // _nameController.text = _baseIndoProvider.baseInfoSunModel.name;  
108 - // nameStr = _baseIndoProvider.baseInfoSunModel.name;  
109 - // _uploadImageProvider.touxiang.qiniuUrl =  
110 - // _baseIndoProvider.baseInfoSunModel.photo;  
111 - // _uploadImageProvider.erweima.qiniuUrl =  
112 - // _baseIndoProvider.baseInfoSunModel.qrcode;  
113 - // _phoneController.text = _baseIndoProvider.baseInfoSunModel.phone;  
114 - // phoneStr = _baseIndoProvider.baseInfoSunModel.phone ?? '';  
115 - // _wechatController.text = _baseIndoProvider.baseInfoSunModel.wechat;  
116 - // if (_baseIndoProvider.baseInfoSunModel.wechat != null &&  
117 - // _baseIndoProvider.baseInfoSunModel.wechat != '' &&  
118 - // phoneStr != '' &&  
119 - // _baseIndoProvider.baseInfoSunModel.wechat == phoneStr) {  
120 - // isSelect = true;  
121 - // } else {  
122 - // isSelect = false;  
123 - // }  
124 - // _positionController.text = _baseIndoProvider.baseInfoSunModel.position;  
125 - // _uploadImageProvider.imgSizeErweima = 64;  
126 - // // setState(() {});  
127 - // _uploadImageProvider.notifyListeners(); 99 + if (marketingCenterProvider.markDataModel.home != null) {
  100 + sloganC.text = marketingCenterProvider.markDataModel.home.slogan ?? '';
  101 + _uploadImageProvider.firstImage.qiniuUrl =
  102 + marketingCenterProvider.markDataModel.home.image ?? null;
  103 + _uploadImageProvider.firstImage.process =
  104 + marketingCenterProvider.markDataModel.home.image != null &&
  105 + marketingCenterProvider.markDataModel.home.image != ''
  106 + ? 1
  107 + : null;
  108 + addFirstImage =
  109 + marketingCenterProvider.markDataModel.home.isFirstImage == '1'
  110 + ? true
  111 + : false;
  112 + }
  113 +
  114 + if (marketingCenterProvider.markDataModel.reserve != null) {
  115 + addPhone =
  116 + marketingCenterProvider.markDataModel.reserve.swichPhone == '0'
  117 + ? false
  118 + : true;
  119 + addManager =
  120 + marketingCenterProvider.markDataModel.reserve.swichManager == '1'
  121 + ? true
  122 + : false;
  123 + addParking =
  124 + marketingCenterProvider.markDataModel.reserve.swichPark == '1'
  125 + ? true
  126 + : false;
  127 + parkingIncoC.text =
  128 + marketingCenterProvider.markDataModel.reserve.parkInfo ?? '';
  129 + }
  130 + if (marketingCenterProvider.markDataModel.marketing != null) {
  131 + welcomeC.text =
  132 + marketingCenterProvider.markDataModel.marketing.wecomle ?? '';
  133 + addLogo = marketingCenterProvider.markDataModel.marketing.isLogo == '1'
  134 + ? true
  135 + : false;
  136 + _uploadImageProvider.logo.qiniuUrl =
  137 + marketingCenterProvider.markDataModel.marketing.logo ?? null;
  138 +
  139 + _uploadImageProvider.logo.process =
  140 + marketingCenterProvider.markDataModel.marketing.logo != null &&
  141 + marketingCenterProvider.markDataModel.marketing.logo != ''
  142 + ? 1
  143 + : 0;
  144 + }
  145 +
  146 + marketingCenterProvider.pageStateBookInfo = PageState.Success;
  147 + setState(() {});
128 } 148 }
129 } 149 }
130 150
@@ -159,132 +179,6 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -159,132 +179,6 @@ class _BookInfoPageState extends State<BookInfoPage> {
159 ))); 179 )));
160 } 180 }
161 181
162 - //初始化时间  
163 - _initData(BuildContext context) async {  
164 - UserModel userModel = Provider.of<UserModel>(context, listen: false);  
165 - sellername = userModel.user.sellername;  
166 - address = userModel.user.sellerAddr;  
167 - userphone = userModel.user.userphone;  
168 - sellerphone = userModel.user.sellerphone;  
169 - username = userModel.user.nickName ?? userModel.user.account;  
170 -  
171 - DateTime dateTime = DateTime.now();  
172 -  
173 - dateValue = ((dateTime.millisecondsSinceEpoch) / 1000).floor().toString();  
174 -  
175 - date = Utils.returnYMDandLunarCalendar(DateTime.now(), context);  
176 -  
177 - String morning =  
178 - userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;  
179 - String noon =  
180 - userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;  
181 - String night =  
182 - userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;  
183 -  
184 - if (dateTime.isBefore(DateTime.parse(dateTime.year.toString() +  
185 - "-" +  
186 - Utils.addZeroNumber(dateTime.month) +  
187 - "-" +  
188 - Utils.addZeroNumber(dateTime.day) +  
189 - " " +  
190 - morning.split("-")[1] +  
191 - ":00"))) {  
192 - //未过早市  
193 - dsolt = '午餐';  
194 - } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +  
195 - "-" +  
196 - Utils.addZeroNumber(dateTime.month) +  
197 - "-" +  
198 - Utils.addZeroNumber(dateTime.day) +  
199 - " " +  
200 - morning.split("-")[1] +  
201 - ":00")) &&  
202 - dateTime.isBefore(DateTime.parse(dateTime.year.toString() +  
203 - "-" +  
204 - Utils.addZeroNumber(dateTime.month) +  
205 - "-" +  
206 - Utils.addZeroNumber(dateTime.day) +  
207 - " " +  
208 - noon.split("-")[1] +  
209 - ":00"))) {  
210 - //过了早市,未过午市  
211 - dsolt = '晚餐';  
212 - } else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +  
213 - "-" +  
214 - Utils.addZeroNumber(dateTime.month) +  
215 - "-" +  
216 - Utils.addZeroNumber(dateTime.day) +  
217 - " " +  
218 - noon.split("-")[1] +  
219 - ":00")) &&  
220 - dateTime.isBefore(DateTime.parse(dateTime.year.toString() +  
221 - "-" +  
222 - Utils.addZeroNumber(dateTime.month) +  
223 - "-" +  
224 - Utils.addZeroNumber(dateTime.day) +  
225 - " " +  
226 - night.split("-")[1] +  
227 - ":00"))) {  
228 - //过了午市,未过晚市  
229 - dsolt = '早餐';  
230 -  
231 - //日期增加一天  
232 - date = Utils.returnYMDandLunarCalendar(  
233 - dateTime.add(Duration(days: 1)), context);  
234 -  
235 - dateValue =  
236 - ((dateTime.add(Duration(days: 1)).millisecondsSinceEpoch) / 1000)  
237 - .floor()  
238 - .toString();  
239 - ;  
240 - } else {  
241 - //过了晚市  
242 - dsolt = '早餐';  
243 - //日期增加一天  
244 - date = Utils.returnYMDandLunarCalendar(  
245 - dateTime.add(Duration(days: 1)), context);  
246 - }  
247 - setState(() {});  
248 - }  
249 -  
250 - ///获取店铺信息  
251 - _getStoreBaseinfo() async {  
252 - GetSellerInfoSunModel itemModel =  
253 - await _storeBaseIndoProvider.getSellerById(context);  
254 - if (itemModel != null) {  
255 - lat = itemModel.data.lat;  
256 - long = itemModel.data.long;  
257 - address = itemModel.data.mapAddress??'' + itemModel.data.realAddress??'';  
258 - setState(() {});  
259 - // _introductionController.text = itemModel.data.sellerdesc;  
260 -  
261 - // // _uploadImageProvider.notifyListeners();  
262 - // _countName = _nameController.text.trim().length;  
263 - // _countAddress = _addressController.text.trim().length;  
264 - // if (itemModel.data.sellerTel.contains(',')) {  
265 - // List<String> list = itemModel.data.sellerTel.split(',');  
266 - // if (list.length == 2) {  
267 - // _phoneController.text = list[0];  
268 - // _phoneController2.text = list[1];  
269 - // onePhone = false;  
270 - // } else {  
271 - // _phoneController.text = '';  
272 - // _phoneController2.text = '';  
273 - // onePhone = true;  
274 - // }  
275 - // } else {  
276 - // _phoneController.text = itemModel.data.sellerTel;  
277 - // onePhone = true;  
278 - // }  
279 - // mapAddress = {  
280 - // "address": itemModel.data.mapAddress,  
281 - // 'lat': itemModel.data.lat,  
282 - // 'lng': itemModel.data.long,  
283 - // };  
284 - // setState(() {});  
285 - }  
286 - }  
287 -  
288 _itemTitleAndSubTtile(String title, String subtitle) { 182 _itemTitleAndSubTtile(String title, String subtitle) {
289 return Row( 183 return Row(
290 crossAxisAlignment: CrossAxisAlignment.start, 184 crossAxisAlignment: CrossAxisAlignment.start,
@@ -301,6 +195,223 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -301,6 +195,223 @@ class _BookInfoPageState extends State<BookInfoPage> {
301 ); 195 );
302 } 196 }
303 197
  198 + ///#相机拍照,单图选择
  199 + Future _getFromPictureOrCamera(
  200 + UploadImgModel imgModel, imageSource, int type) async {
  201 + final pickedFile = await picker.pickImage(source: imageSource);
  202 + File compressedFile = await FlutterNativeImage.compressImage(
  203 + pickedFile.path,
  204 + quality: 50,
  205 + percentage: 50);
  206 + setState(() {
  207 + if (pickedFile != null) {
  208 + imgModel.file = File(pickedFile.path);
  209 + imgModel.process = 0.01;
  210 + } else {
  211 + print('No image selected.');
  212 + }
  213 + });
  214 + if (pickedFile != null) {
  215 + // if (title == '头像') {
  216 + // _uploadImageProvider.imgSizeTouxiang = 76;
  217 + // _uploadImageProvider.touxiang.qiniuUrl = null;
  218 + // } else {
  219 + // _uploadImageProvider.imgSizeErweima = 76;
  220 + // _uploadImageProvider.firstImage.qiniuUrl = null;
  221 + imgModel.qiniuUrl = null;
  222 + // }
  223 + bool need = await Utils.sizeNeed(File(pickedFile.path));
  224 + File file = File(pickedFile.path);
  225 + if (need) {
  226 + file = File(compressedFile.absolute.path);
  227 + }
  228 + UploadImageUtil()
  229 + .startUploadOnly(context, file, type, true, _uploadImageProvider);
  230 + }
  231 + }
  232 +
  233 + ///添加图片UI弹出
  234 + Future _openModalBottomSheet(
  235 + context, UploadImgModel uploadImageModel, int type) async {
  236 + final option = await showModalBottomSheet(
  237 + context: context,
  238 + backgroundColor: Colors.transparent,
  239 + isDismissible: false,
  240 + builder: (BuildContext context) {
  241 + return Container(
  242 + // height: ScreenUtil().setWidth(180 * 2),
  243 + decoration: BoxDecoration(
  244 + color: MyColours.color_ffffff,
  245 + borderRadius: BorderRadius.only(
  246 + topLeft: Radius.circular(ScreenUtil().setWidth(24)),
  247 + topRight: Radius.circular(ScreenUtil().setWidth(24)))),
  248 + child: Column(
  249 + mainAxisSize: MainAxisSize.min,
  250 + children: <Widget>[
  251 + InkWell(
  252 + onTap: () {
  253 + // Utils.getPickPermission(context, () {
  254 + // _getFromPictureOrCamera(
  255 + // _uploadImageProvider.firstImage, ImageSource.camera);
  256 +
  257 + // Navigator.pop(context);
  258 + // }, Permission.camera);
  259 + Utils.getPickPermission(context, () {
  260 + _getFromPictureOrCamera(
  261 + uploadImageModel, ImageSource.camera, type);
  262 + Navigator.pop(context);
  263 + },
  264 + Platform.isAndroid
  265 + ? Permission.storage
  266 + : Permission.photos);
  267 + },
  268 + child: Container(
  269 + width: double.infinity,
  270 + height: ScreenUtil().setWidth(58 * 2),
  271 + child: Center(
  272 + child: Text(
  273 + '拍摄',
  274 + style: TextStyle(
  275 + fontSize: ScreenUtil().setSp(32),
  276 + color: MyColours.color_353535,
  277 + fontWeight: FontWeight.bold),
  278 + ),
  279 + )),
  280 + ),
  281 + MyDivider(
  282 + double.infinity,
  283 + ScreenUtil().setWidth(2),
  284 + color: MyColours.color_EEEEEE,
  285 + ),
  286 + InkWell(
  287 + onTap: () {
  288 + // Utils.getPickPermission(context, () {
  289 + // // pickAsset(RequestType.image);
  290 + // _getFromPictureOrCamera(
  291 + // _uploadImageProvider.firstImage, ImageSource.gallery);
  292 + // Navigator.pop(context);
  293 + // },
  294 + // Platform.isAndroid
  295 + // ? Permission.storage
  296 + // : Permission.photos);
  297 + Utils.getPickPermission(context, () {
  298 + _getFromPictureOrCamera(
  299 + uploadImageModel, ImageSource.gallery, type);
  300 + Navigator.pop(context);
  301 + },
  302 + Platform.isAndroid
  303 + ? Permission.storage
  304 + : Permission.photos);
  305 + },
  306 + child: Container(
  307 + width: double.infinity,
  308 + height: ScreenUtil().setWidth(58 * 2),
  309 + child: Center(
  310 + child: Text(
  311 + '从相册选择',
  312 + style: TextStyle(
  313 + fontSize: ScreenUtil().setSp(32),
  314 + color: MyColours.color_353535,
  315 + fontWeight: FontWeight.bold),
  316 + ),
  317 + )),
  318 + ),
  319 + MyDivider(
  320 + double.infinity,
  321 + ScreenUtil().setWidth(10),
  322 + color: MyColours.color_EEEEEE,
  323 + ),
  324 + InkWell(
  325 + onTap: () {
  326 + Navigator.pop(context, '取消');
  327 + },
  328 + child: Container(
  329 + width: double.infinity,
  330 + height: ScreenUtil().setWidth(58 * 2),
  331 + child: Center(
  332 + child: Text(
  333 + '取消',
  334 + style: TextStyle(
  335 + fontSize: ScreenUtil().setSp(32),
  336 + color: MyColours.color_353535,
  337 + fontWeight: FontWeight.bold),
  338 + ),
  339 + )))
  340 + ],
  341 + ),
  342 + );
  343 + });
  344 + }
  345 +
  346 + /// 高级筛选输入框
  347 + Widget _textFeildWidget(
  348 + TextEditingController controller, String name, String hintText) {
  349 + return Container(
  350 + padding: EdgeInsets.only(
  351 + right: ScreenUtil().setWidth(32),
  352 + ),
  353 + margin: EdgeInsets.only(
  354 + left: ScreenUtil().setWidth(32),
  355 + ),
  356 + decoration: BoxDecoration(
  357 + border: Border(
  358 + bottom:
  359 + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  360 + height: w(48),
  361 + alignment: Alignment.center,
  362 + child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
  363 + _textWidget(name, MyColours.color_515151, FontWeight.normal, 32),
  364 + Expanded(
  365 + child: TextField(
  366 + maxLines: 1,
  367 + controller: controller,
  368 + // focusNode: _focusNode,
  369 + // autofocus: true,
  370 + textAlign: TextAlign.right,
  371 + style: TextStyle(
  372 + color: MyColours.color_515151,
  373 + fontSize: ScreenUtil().setSp(32)),
  374 + // textAlignVertical: TextAlignVertical.center,
  375 + decoration: InputDecoration(
  376 + hintText: hintText,
  377 + hintStyle: TextStyle(
  378 + color: MyColours.color_999999,
  379 + fontSize: ScreenUtil().setSp(32),
  380 + ),
  381 + isCollapsed: true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  382 + border: OutlineInputBorder(borderSide: BorderSide.none),
  383 + contentPadding: EdgeInsets.zero,
  384 + ),
  385 + keyboardType: TextInputType.text,
  386 + textInputAction: TextInputAction.done,
  387 +
  388 + onChanged: (value) {
  389 + // setState(() {});
  390 + // _searchSellerLocation();
  391 + // customerProvider.searchData(value);
  392 + },
  393 + onEditingComplete: () {
  394 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  395 + // contantShowModel.searchData(
  396 + // contantShowModel.controller.text);
  397 + // _searchSellerLocation();
  398 + // _focusNode.unfocus();
  399 + },
  400 + ),
  401 + ),
  402 + ]));
  403 + }
  404 +
  405 + ///弹框text
  406 + _textWidget(String title, Color textColor, FontWeight fontWeight, int size) {
  407 + return Text(title,
  408 + style: TextStyle(
  409 + color: textColor,
  410 + decoration: TextDecoration.none,
  411 + fontWeight: fontWeight,
  412 + fontSize: ScreenUtil().setSp(size)));
  413 + }
  414 +
304 @override 415 @override
305 Widget build(BuildContext context) { 416 Widget build(BuildContext context) {
306 _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true); 417 _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
@@ -308,6 +419,8 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -308,6 +419,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
308 Provider.of<MarketingCenterProvider>(context, listen: true); 419 Provider.of<MarketingCenterProvider>(context, listen: true);
309 _storeBaseIndoProvider = 420 _storeBaseIndoProvider =
310 Provider.of<StoreBaseIndoProvider>(context, listen: false); 421 Provider.of<StoreBaseIndoProvider>(context, listen: false);
  422 + _uploadImageProvider =
  423 + Provider.of<UploadImageProvider>(context, listen: true);
311 return Scaffold( 424 return Scaffold(
312 backgroundColor: MyColours.color_ffffff, 425 backgroundColor: MyColours.color_ffffff,
313 appBar: SystemAppBar( 426 appBar: SystemAppBar(
@@ -331,7 +444,189 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -331,7 +444,189 @@ class _BookInfoPageState extends State<BookInfoPage> {
331 Expanded( 444 Expanded(
332 child: SingleChildScrollView( 445 child: SingleChildScrollView(
333 child: Column(children: [ 446 child: Column(children: [
334 - _item('展示餐厅前台电话号码', select: addPhone, onTap: () { 447 + VEmptyView(24),
  448 + _textFeildWidget(welcomeC, '餐厅欢迎语', '点击输入欢迎语'),
  449 + VEmptyView(24),
  450 + _textFeildWidget(sloganC, '餐厅广告语', '点击输入广告语'),
  451 +
  452 + _item('附加餐厅首图', select: addFirstImage, onTap: () {
  453 + setState(() {
  454 + addFirstImage = !addFirstImage;
  455 + });
  456 + }),
  457 + VEmptyView(24),
  458 + _uploadImageProvider.firstImage.file != null ||
  459 + (_uploadImageProvider.firstImage.qiniuUrl != null &&
  460 + _uploadImageProvider.firstImage.qiniuUrl != '')
  461 + ? InkWell(
  462 + onTap: () {
  463 + double process;
  464 + String qiniuUrl;
  465 + List<String> tempList = [];
  466 + // if (title == '头像') {
  467 + process = _uploadImageProvider.firstImage.process;
  468 + qiniuUrl =
  469 + _uploadImageProvider.firstImage.qiniuUrl;
  470 + // } else {
  471 + // process = _uploadImageProvider.erweima.process;
  472 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  473 + // }
  474 +
  475 + if (qiniuUrl != null && qiniuUrl != '') {
  476 + // tempList.add(qiniuUrl);
  477 +
  478 + // ///没有上传完成的不可以点击
  479 + // _showPhotoView(context, 0, tempList);
  480 +
  481 + // _uploadImageProvider.firstImage.qiniuUrl = null;
  482 + // _uploadImageProvider.firstImage.process = 0;
  483 + // setState(() {});
  484 + _openModalBottomSheet(context,
  485 + _uploadImageProvider.firstImage, 4);
  486 + // Utils.getPickPermission(context, () {
  487 + // _getFromPictureOrCamera(
  488 + // _uploadImageProvider.firstImage,
  489 + // ImageSource.gallery);
  490 + // },
  491 + // Platform.isAndroid
  492 + // ? Permission.storage
  493 + // : Permission.photos);
  494 + }
  495 + },
  496 + child: Stack(
  497 + alignment: Alignment.bottomCenter,
  498 + children: [
  499 + Stack(clipBehavior: Clip.none, children: [
  500 + _uploadImageProvider.firstImage.qiniuUrl !=
  501 + null &&
  502 + _uploadImageProvider
  503 + .firstImage.qiniuUrl !=
  504 + ''
  505 + ? Image.network(
  506 + _uploadImageProvider
  507 + .firstImage.qiniuUrl,
  508 + fit: BoxFit.cover,
  509 + width: double.infinity,
  510 + // width: ScreenUtil()
  511 + // .setWidth(imgSize * 2),
  512 + height: ScreenUtil().setWidth(
  513 + _uploadImageProvider
  514 + .imgSizefirstImage *
  515 + 2),
  516 + )
  517 + : Image.file(
  518 + _uploadImageProvider
  519 + .firstImage.file,
  520 + fit: BoxFit.cover,
  521 + width: double.infinity,
  522 + // width: ScreenUtil()
  523 + // .setWidth(imgSize * 2),
  524 + height: ScreenUtil().setWidth(
  525 + _uploadImageProvider
  526 + .imgSizefirstImage *
  527 + 2),
  528 + ),
  529 + Positioned(
  530 + left: 0,
  531 + top: 0,
  532 + child: (_uploadImageProvider
  533 + .firstImage.file !=
  534 + null) &&
  535 + _uploadImageProvider
  536 + .firstImage.process !=
  537 + 1 &&
  538 + _uploadImageProvider
  539 + .firstImage.process !=
  540 + 0.01
  541 + ? Container(
  542 + width: ScreenUtil().screenWidth,
  543 + height: w(_uploadImageProvider
  544 + .imgSizefirstImage),
  545 + color: MyColours.color_4D000000,
  546 + child: Center(
  547 + child: Text('上传中',
  548 + style: TextStyle(
  549 + color: MyColours
  550 + .color_F8F9FD)),
  551 + ),
  552 + )
  553 + : Container()),
  554 + ]),
  555 + _uploadImageProvider.firstImage.process == 1
  556 + ? Container(
  557 + width: w(150),
  558 + height: w(30),
  559 + color: MyColours.color_4D000000,
  560 + alignment: Alignment.center,
  561 + child: Text(
  562 + '点击图片可以更换',
  563 + style: TextStyle(
  564 + color: MyColours.color_F8F9FD,
  565 + fontSize: font(14),
  566 + fontWeight: FontWeight.bold),
  567 + ))
  568 + : SizedBox(),
  569 + ]))
  570 + : InkWell(
  571 + onTap: () {
  572 + // double process;
  573 + // String qiniuUrl;
  574 + // List<String> tempList = [];
  575 + // if (title == '头像') {
  576 + // process = _uploadImageProvider.touxiang.process;
  577 + // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;
  578 + // } else {
  579 + // process = _uploadImageProvider.erweima.process;
  580 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  581 + // }
  582 +
  583 + // if (qiniuUrl != null && qiniuUrl != '') {
  584 + // tempList.add(qiniuUrl);
  585 +
  586 + // ///没有上传完成的不可以点击
  587 + // _showPhotoView(context, 0, tempList);
  588 + // } else {
  589 + // Utils.getPickPermission(context, () {
  590 + // _getFromPictureOrCamera(
  591 + // _uploadImageProvider.firstImage,
  592 + // ImageSource.gallery);
  593 + // },
  594 + // Platform.isAndroid
  595 + // ? Permission.storage
  596 + // : Permission.photos);
  597 + _openModalBottomSheet(
  598 + context, _uploadImageProvider.firstImage, 4);
  599 + },
  600 + child: Container(
  601 + color: MyColours.color_d9d9d9,
  602 + width: double.infinity,
  603 + height: w(_uploadImageProvider.imgSizefirstImage),
  604 + child: Column(
  605 + mainAxisAlignment: MainAxisAlignment.center,
  606 + children: [
  607 + // VEmptyView(80),
  608 + Image.asset(
  609 + Utils.getImgPath('add_img'),
  610 + width: w(63),
  611 + ),
  612 + VEmptyView(28),
  613 + Container(
  614 + width: w(139),
  615 + height: w(60),
  616 + child: Text(
  617 + '点击上传照片\n为了更好的效果\n建议上传16:9照片',
  618 + textAlign: TextAlign.center,
  619 + style: TextStyle(
  620 + height: 1.4,
  621 + color: MyColours.color_ffffff,
  622 + fontSize: font(14),
  623 + fontWeight: FontWeight.bold),
  624 + ))
  625 + ],
  626 + ),
  627 + )),
  628 + VEmptyView(24),
  629 + _item('附加餐厅前台电话号码', select: addPhone, onTap: () {
335 setState(() { 630 setState(() {
336 addPhone = !addPhone; 631 addPhone = !addPhone;
337 }); 632 });
@@ -405,202 +700,178 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -405,202 +700,178 @@ class _BookInfoPageState extends State<BookInfoPage> {
405 )) 700 ))
406 : SizedBox(), 701 : SizedBox(),
407 VEmptyView(24), 702 VEmptyView(24),
  703 + _item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
  704 + setState(() {
  705 + addLogo = !addLogo;
  706 + });
  707 + }),
408 Container( 708 Container(
409 - alignment: Alignment.centerLeft,  
410 - padding: EdgeInsets.only(  
411 - left: w(16), top: w(12), bottom: w(12), right: w(16)),  
412 - child: Text(  
413 - '效果预览',  
414 - style: TextStyle(  
415 - color: MyColours.color_515151,  
416 - fontSize: ScreenUtil().setWidth(32)),  
417 - ),  
418 - ),  
419 - VEmptyView(24),  
420 - Container(  
421 - width: double.infinity,  
422 - margin: EdgeInsets.symmetric(horizontal: w(10)),  
423 - padding: EdgeInsets.symmetric(horizontal: w(8)),  
424 - decoration: BoxDecoration(  
425 - border: Border(  
426 - left: BorderSide(  
427 - width: w(2), color: MyColours.color_EEAE74))),  
428 - child: Column(  
429 - crossAxisAlignment: CrossAxisAlignment.start,  
430 - children: [  
431 - Text(  
432 - '尊敬的贵宾,您好!',  
433 - style: TextStyle(  
434 - color: MyColours.color_000000,  
435 - fontSize: font(14)),  
436 - ),  
437 - VEmptyView(10),  
438 - Text('非常感谢您选择【${sellername}】!',  
439 - style: TextStyle(  
440 - color: MyColours.color_000000,  
441 - fontSize: font(14))),  
442 - VEmptyView(30),  
443 - _itemTitleAndSubTtile('日期', '${date}'),  
444 - VEmptyView(10),  
445 - _itemTitleAndSubTtile('餐段', '${dsolt}'),  
446 - VEmptyView(10),  
447 - marketingCenterProvider.tableOuterList.length > 0 &&  
448 - marketingCenterProvider  
449 - .tableOuterList[0].list.length >  
450 - 0  
451 - ? _itemTitleAndSubTtile('包间',  
452 - '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}')  
453 - : SizedBox(),  
454 - VEmptyView(10),  
455 - marketingCenterProvider.tableOuterList.length > 0 &&  
456 - marketingCenterProvider  
457 - .tableOuterList[0].list.length >  
458 - 0  
459 - ? _itemTitleAndSubTtile('人数',  
460 - '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}')  
461 - : SizedBox(),  
462 - VEmptyView(10),  
463 - // _itemTitleAndSubTtile('地址', '${address}'),  
464 - // VEmptyView(10),  
465 - addParking  
466 - ? _itemTitleAndSubTtile(  
467 - '停车', '${parkingIncoC.text}')  
468 - : SizedBox(),  
469 - addParking ? VEmptyView(10) : SizedBox(),  
470 - if (addPhone)  
471 - _itemTitleAndSubTtile('联系', '${sellerphone}'),  
472 - VEmptyView(20),  
473 - addManager  
474 - ? Row( 709 + height: w(210),
  710 + child: _uploadImageProvider.logo.file != null ||
  711 + (_uploadImageProvider.logo.qiniuUrl != null &&
  712 + _uploadImageProvider.logo.qiniuUrl != '')
  713 + ? InkWell(
  714 + onTap: () {
  715 + double process;
  716 + String qiniuUrl;
  717 + List<String> tempList = [];
  718 + // if (title == '头像') {
  719 + process = _uploadImageProvider.logo.process;
  720 + qiniuUrl = _uploadImageProvider.logo.qiniuUrl;
  721 + // } else {
  722 + // process = _uploadImageProvider.erweima.process;
  723 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  724 + // }
  725 +
  726 + if (qiniuUrl != null && qiniuUrl != '') {
  727 + // tempList.add(qiniuUrl);
  728 +
  729 + // ///没有上传完成的不可以点击
  730 + // _showPhotoView(context, 0, tempList);
  731 +
  732 + // _uploadImageProvider.firstImage.qiniuUrl = null;
  733 + // _uploadImageProvider.firstImage.process = 0;
  734 + // setState(() {});
  735 + _openModalBottomSheet(
  736 + context, _uploadImageProvider.logo, 9);
  737 + // Utils.getPickPermission(context, () {
  738 + // _getFromPictureOrCamera(
  739 + // _uploadImageProvider.firstImage,
  740 + // ImageSource.gallery);
  741 + // },
  742 + // Platform.isAndroid
  743 + // ? Permission.storage
  744 + // : Permission.photos);
  745 + }
  746 + },
  747 + child: Stack(
  748 + alignment: Alignment.bottomCenter,
475 children: [ 749 children: [
476 - HEmptyView(20),  
477 - ClipRRect(  
478 - borderRadius:  
479 - BorderRadius.circular(r(35)),  
480 - child: Image.network(  
481 - _baseIndoProvider.baseInfoSunModel ==  
482 - null ||  
483 - _baseIndoProvider  
484 - .baseInfoSunModel  
485 - .photo ==  
486 - null ||  
487 - _baseIndoProvider  
488 - .baseInfoSunModel  
489 - .photo ==  
490 - ''  
491 - ? 'http://nosqn.colorcun.com/yd_person.png'  
492 - : _baseIndoProvider  
493 - .baseInfoSunModel.photo,  
494 - fit: BoxFit.cover,  
495 - width: w(70),  
496 - height: w(70),  
497 - ), 750 + Stack(clipBehavior: Clip.none, children: [
  751 + _uploadImageProvider.logo.qiniuUrl !=
  752 + null &&
  753 + _uploadImageProvider
  754 + .logo.qiniuUrl !=
  755 + ''
  756 + ? Image.network(
  757 + _uploadImageProvider
  758 + .logo.qiniuUrl,
  759 + fit: BoxFit.cover,
  760 + width: double.infinity,
  761 + // width: ScreenUtil()
  762 + // .setWidth(imgSize * 2),
  763 + height: w(210),
  764 + )
  765 + : Image.file(
  766 + _uploadImageProvider.logo.file,
  767 + fit: BoxFit.cover,
  768 + width: double.infinity,
  769 + // width: ScreenUtil()
  770 + // .setWidth(imgSize * 2),
  771 + height: w(210),
  772 + ),
  773 + Positioned(
  774 + left: 0,
  775 + top: 0,
  776 + right: 0,
  777 + child: (_uploadImageProvider
  778 + .logo.file !=
  779 + null) &&
  780 + _uploadImageProvider
  781 + .logo.process !=
  782 + 1 &&
  783 + _uploadImageProvider
  784 + .logo.process !=
  785 + 0.01
  786 + ? Container(
  787 + width:
  788 + ScreenUtil().screenWidth,
  789 + height: w(210),
  790 + color:
  791 + MyColours.color_4D000000,
  792 + child: Center(
  793 + child: Text('上传中',
  794 + style: TextStyle(
  795 + color: MyColours
  796 + .color_F8F9FD)),
  797 + ),
  798 + )
  799 + : Container()),
  800 + ]),
  801 + _uploadImageProvider.logo.process == 1
  802 + ? Container(
  803 + width: w(150),
  804 + height: w(30),
  805 + color: MyColours.color_4D000000,
  806 + alignment: Alignment.center,
  807 + child: Text(
  808 + '点击图片可以更换',
  809 + style: TextStyle(
  810 + color: MyColours.color_F8F9FD,
  811 + fontSize: font(14),
  812 + fontWeight: FontWeight.bold),
  813 + ))
  814 + : SizedBox(),
  815 + ]))
  816 + : InkWell(
  817 + onTap: () {
  818 + // double process;
  819 + // String qiniuUrl;
  820 + // List<String> tempList = [];
  821 + // if (title == '头像') {
  822 + // process = _uploadImageProvider.touxiang.process;
  823 + // qiniuUrl = _uploadImageProvider.touxiang.qiniuUrl;
  824 + // } else {
  825 + // process = _uploadImageProvider.erweima.process;
  826 + // qiniuUrl = _uploadImageProvider.erweima.qiniuUrl;
  827 + // }
  828 +
  829 + // if (qiniuUrl != null && qiniuUrl != '') {
  830 + // tempList.add(qiniuUrl);
  831 +
  832 + // ///没有上传完成的不可以点击
  833 + // _showPhotoView(context, 0, tempList);
  834 + // } else {
  835 + // Utils.getPickPermission(context, () {
  836 + // _getFromPictureOrCamera(
  837 + // _uploadImageProvider.firstImage,
  838 + // ImageSource.gallery);
  839 + // },
  840 + // Platform.isAndroid
  841 + // ? Permission.storage
  842 + // : Permission.photos);
  843 + _openModalBottomSheet(
  844 + context, _uploadImageProvider.logo, 9);
  845 + },
  846 + child: Container(
  847 + // color: MyColours.color_d9d9d9,
  848 + width: double.infinity,
  849 + height: w(180),
  850 + child: Column(
  851 + mainAxisAlignment: MainAxisAlignment.center,
  852 + children: [
  853 + Image.asset(
  854 + Utils.getImgPath('add_img_grey'),
  855 + width: w(63),
498 ), 856 ),
499 - HEmptyView(20),  
500 - // Spacer(),  
501 - Expanded(  
502 - child: Column(  
503 - crossAxisAlignment:  
504 - CrossAxisAlignment.start,  
505 - children: [  
506 - Text(  
507 - '专属服务:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.name == null ? Provider.of<UserModel>(context, listen: false).user.nickName : _baseIndoProvider.baseInfoSunModel.name}',  
508 - style: TextStyle(  
509 - color: MyColours.color_999999,  
510 - fontWeight: FontWeight.bold,  
511 - fontSize: font(12)),  
512 - ),  
513 - VEmptyView(16),  
514 - Text(  
515 - '服务电话:${_baseIndoProvider.baseInfoSunModel == null || _baseIndoProvider.baseInfoSunModel.phone == null ? Provider.of<UserModel>(context, listen: false).user.userphone : _baseIndoProvider.baseInfoSunModel.phone}',  
516 - style: TextStyle(  
517 - color: MyColours.color_999999,  
518 - fontWeight: FontWeight.bold,  
519 - fontSize: font(12)),  
520 - ),  
521 - ],  
522 - )),  
523 - HEmptyView(10),  
524 - Column(  
525 - crossAxisAlignment:  
526 - CrossAxisAlignment.start,  
527 - children: [  
528 - RoundButton(  
529 - width: w(72),  
530 - height: w(22),  
531 - text: '拨打电话',  
532 - gradientStart: MyColours.color_ffffff,  
533 - gradientEnd: MyColours.color_ffffff,  
534 - borderColor: MyColours.color_0143A3,  
535 - textColor: MyColours.color_0143A3,  
536 - radius: r(11),  
537 - fontSize: 24,  
538 - isBold: true,  
539 - onPressed: () {},  
540 - ),  
541 - VEmptyView(16),  
542 - RoundButton(  
543 - width: w(72),  
544 - height: w(22),  
545 - text: '复制微信号',  
546 - gradientStart: MyColours.color_ffffff,  
547 - gradientEnd: MyColours.color_ffffff,  
548 - borderColor: MyColours.color_0143A3,  
549 - textColor: MyColours.color_0143A3,  
550 - radius: r(11),  
551 - fontSize: 24,  
552 - isBold: true,  
553 - onPressed: () {},  
554 - ),  
555 - ], 857 + VEmptyView(28),
  858 + Padding(
  859 + padding: EdgeInsets.symmetric(
  860 + vertical: w(10),
  861 + ),
  862 + child: Text(
  863 + '点击上传餐厅logo',
  864 + style: TextStyle(
  865 + color: MyColours.color_999999,
  866 + fontSize: font(14),
  867 + fontWeight: FontWeight.bold),
  868 + ),
556 ) 869 )
557 ], 870 ],
558 - )  
559 - : SizedBox(),  
560 - addManager ? VEmptyView(10) : SizedBox(),  
561 - Text('欢迎垂询,恭候光临!',  
562 - style: TextStyle(  
563 - color: MyColours.color_000000,  
564 - fontSize: font(14))),  
565 - ],  
566 - ),  
567 - ),  
568 - VEmptyView(20),  
569 - Container(  
570 - width: double.infinity,  
571 - margin: EdgeInsets.symmetric(horizontal: w(20)),  
572 - padding: EdgeInsets.symmetric(  
573 - horizontal: w(15), vertical: w(12)),  
574 - decoration: BoxDecoration(  
575 - color: MyColours.color_d9d9d9,  
576 - borderRadius: BorderRadius.circular(r(5))),  
577 - child: Row(  
578 - children: [  
579 - Image.asset(  
580 - Utils.getImgPath('location_blue'),  
581 - width: w(16),  
582 - ),  
583 - HEmptyView(28),  
584 - Expanded(  
585 - child: Column(  
586 - crossAxisAlignment: CrossAxisAlignment.start,  
587 - children: [  
588 - Text('${sellername}',  
589 - style: TextStyle(  
590 - color: MyColours.color_000000,  
591 - fontWeight: FontWeight.bold,  
592 - fontSize: font(14))),  
593 - VEmptyView(10),  
594 - Text('${address ?? ''}',  
595 - style: TextStyle(  
596 - height: 1.3,  
597 - color: MyColours.color_000000,  
598 - fontSize: font(14))),  
599 - ],  
600 - ))  
601 - ],  
602 - ), 871 + ),
  872 + )),
603 ), 873 ),
  874 +
604 VEmptyView(16) 875 VEmptyView(16)
605 ]), 876 ]),
606 )), 877 )),
@@ -620,11 +891,36 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -620,11 +891,36 @@ class _BookInfoPageState extends State<BookInfoPage> {
620 onPressed: () async { 891 onPressed: () async {
621 FocusScope.of(context) 892 FocusScope.of(context)
622 .requestFocus(FocusNode()); //点击空白处隐藏键盘 893 .requestFocus(FocusNode()); //点击空白处隐藏键盘
  894 + // if (sloganC.text.trim().length == 0) {
  895 + // Utils.showToast('请输入店铺slogan!');
  896 + // return false;
  897 + // }
623 898
624 if (addParking && parkingIncoC.text.trim().length == 0) { 899 if (addParking && parkingIncoC.text.trim().length == 0) {
625 Utils.showToast('请输入停车信息!'); 900 Utils.showToast('请输入停车信息!');
626 return false; 901 return false;
627 } 902 }
  903 + if (addFirstImage &&
  904 + _uploadImageProvider.firstImage.qiniuUrl == null) {
  905 + Utils.showToast('请上传餐厅首图!');
  906 + return false;
  907 + }
  908 +
  909 + if (_uploadImageProvider.firstImage.process < 1 &&
  910 + _uploadImageProvider.firstImage.process > 0) {
  911 + Utils.showToast('正在上传餐厅首图!,请稍等');
  912 + return false;
  913 + }
  914 + if (addLogo &&
  915 + _uploadImageProvider.logo.qiniuUrl == null) {
  916 + Utils.showToast('请上传餐厅logo!');
  917 + return false;
  918 + }
  919 +
  920 + if (_uploadImageProvider.logo.process < 1) {
  921 + Utils.showToast('正在上传餐厅logo!,请稍等');
  922 + return false;
  923 + }
628 924
629 //接口 925 //接口
630 Map reserveData = { 926 Map reserveData = {
@@ -632,46 +928,63 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -632,46 +928,63 @@ class _BookInfoPageState extends State<BookInfoPage> {
632 'swich_manager': addManager ? '1' : '0', 928 'swich_manager': addManager ? '1' : '0',
633 'swich_park': addParking ? '1' : '0', 929 'swich_park': addParking ? '1' : '0',
634 'park_info': parkingIncoC.text, 930 'park_info': parkingIncoC.text,
635 - 'seller_name': sellername,  
636 - 'date': dateValue,  
637 - 'dsolt': dsolt,  
638 - 'room': marketingCenterProvider.tableOuterList.length >  
639 - 0 &&  
640 - marketingCenterProvider  
641 - .tableOuterList[0].list.length >  
642 - 0  
643 - ? '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}'  
644 - : '',  
645 - 'pnum': marketingCenterProvider.tableOuterList.length >  
646 - 0 &&  
647 - marketingCenterProvider  
648 - .tableOuterList[0].list.length >  
649 - 0  
650 - ? '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}'  
651 - : '',  
652 - 'address': '${address}',  
653 - 'seller_phone': '${sellerphone}',  
654 - 'manager_image':  
655 - _baseIndoProvider.baseInfoSunModel.photo == null ||  
656 - _baseIndoProvider.baseInfoSunModel.photo ==  
657 - ''  
658 - ? 'http://nosqn.colorcun.com/yd_person.png'  
659 - : _baseIndoProvider.baseInfoSunModel.photo,  
660 - 'manager_name':  
661 - '${_baseIndoProvider.baseInfoSunModel.name}',  
662 - 'manager_phone':  
663 - '${_baseIndoProvider.baseInfoSunModel.phone}',  
664 - 'manager_wechat':  
665 - '${_baseIndoProvider.baseInfoSunModel.wechat}',  
666 - 'long': long,  
667 - 'lat': lat 931 + // 'seller_name': sellername,
  932 + // 'date': dateValue,
  933 + // 'dsolt': dsolt,
  934 + // 'room': marketingCenterProvider.tableOuterList.length >
  935 + // 0 &&
  936 + // marketingCenterProvider
  937 + // .tableOuterList[0].list.length >
  938 + // 0
  939 + // ? '${marketingCenterProvider.tableOuterList[0].name}${marketingCenterProvider.tableOuterList[0].list[0].name}'
  940 + // : '',
  941 + // 'pnum': marketingCenterProvider.tableOuterList.length >
  942 + // 0 &&
  943 + // marketingCenterProvider
  944 + // .tableOuterList[0].list.length >
  945 + // 0
  946 + // ? '${marketingCenterProvider.tableOuterList[0].list[0].tableNum}'
  947 + // : '',
  948 + // 'address': '${address}',
  949 + // 'seller_phone': '${sellerphone}',
  950 + // 'manager_image':
  951 + // _baseIndoProvider.baseInfoSunModel.photo == null ||
  952 + // _baseIndoProvider.baseInfoSunModel.photo ==
  953 + // ''
  954 + // ? 'http://nosqn.colorcun.com/yd_person.png'
  955 + // : _baseIndoProvider.baseInfoSunModel.photo,
  956 + // 'manager_name':
  957 + // '${_baseIndoProvider.baseInfoSunModel.name}',
  958 + // 'manager_phone':
  959 + // '${_baseIndoProvider.baseInfoSunModel.phone}',
  960 + // 'manager_wechat':
  961 + // '${_baseIndoProvider.baseInfoSunModel.wechat}',
  962 + // 'long': long,
  963 + // 'lat': lat
668 }; 964 };
669 965
  966 + Map marketing = marketingCenterProvider
  967 + .markDataModel.marketing
  968 + .toJson();
  969 + print(marketing);
  970 + marketing['is_logo'] = addLogo ? '1' : '0';
  971 + marketing['logo'] = _uploadImageProvider.logo.qiniuUrl;
  972 + marketing['wecomle'] = welcomeC.text ?? '';
  973 +
  974 + Map home =
  975 + marketingCenterProvider.markDataModel.home.toJson();
  976 + print(home);
  977 + home['slogan'] = sloganC.text;
  978 + home['id_first_image'] = addFirstImage ? '1' : '0';
  979 + home['image'] = _uploadImageProvider.firstImage.qiniuUrl;
  980 +
670 Map<String, String> params = { 981 Map<String, String> params = {
671 'sid': Provider.of<UserModel>(context, listen: false) 982 'sid': Provider.of<UserModel>(context, listen: false)
672 .user 983 .user
673 .sellerid, 984 .sellerid,
674 - 'reserve': json.encode(reserveData) 985 + 'reserve': json.encode(reserveData),
  986 + 'marketing': json.encode(marketing),
  987 + 'home': json.encode(home)
675 }; 988 };
676 989
677 bool success = await marketingCenterProvider 990 bool success = await marketingCenterProvider
@@ -397,9 +397,9 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> { @@ -397,9 +397,9 @@ class _CustomerNoticeSettingPageState extends State<CustomerNoticeSettingPage> {
397 padding: EdgeInsets.only(left: w(16)), 397 padding: EdgeInsets.only(left: w(16)),
398 child: MyDivider(double.infinity, w(0.5), 398 child: MyDivider(double.infinity, w(0.5),
399 color: MyColours.color_E7E7E7)), 399 color: MyColours.color_E7E7E7)),
400 - // _item('首图形象展示', onTap: () {  
401 - // NavigatorUtil.goFirstImagePage(context);  
402 - // }), 400 + _item('首图形象展示', onTap: () {
  401 + NavigatorUtil.goFirstImagePage(context);
  402 + }),
403 _item('预订信息模块设置', onTap: () { 403 _item('预订信息模块设置', onTap: () {
404 NavigatorUtil.goBookInfoPage(context); 404 NavigatorUtil.goBookInfoPage(context);
405 }), 405 }),
@@ -20,6 +20,7 @@ class UploadImageProvider extends ChangeNotifier { @@ -20,6 +20,7 @@ class UploadImageProvider extends ChangeNotifier {
20 UploadImgModel mentou = UploadImgModel(); //店铺信息----门头照片 20 UploadImgModel mentou = UploadImgModel(); //店铺信息----门头照片
21 UploadImgModel dish = UploadImgModel(); //菜品 21 UploadImgModel dish = UploadImgModel(); //菜品
22 UploadImgModel firstImage = UploadImgModel(); //预订安排首图 22 UploadImgModel firstImage = UploadImgModel(); //预订安排首图
  23 + UploadImgModel logo = UploadImgModel(); //预订安排logo
23 24
24 double imgSizefirstImage = 282; 25 double imgSizefirstImage = 282;
25 double imgSizeTouxiang = 76; 26 double imgSizeTouxiang = 76;
@@ -329,6 +329,9 @@ class UploadImageUtil { @@ -329,6 +329,9 @@ class UploadImageUtil {
329 } else if (index == 8) { 329 } else if (index == 8) {
330 //4 预订安排首图 330 //4 预订安排首图
331 uploadImageProvider.storeImage4.process = percent; 331 uploadImageProvider.storeImage4.process = percent;
  332 + } else if (index == 9) {
  333 + //9 预订安排logo
  334 + uploadImageProvider.logo.process = percent;
332 } else { 335 } else {
333 //1 二维码 336 //1 二维码
334 uploadImageProvider.erweima.process = percent; 337 uploadImageProvider.erweima.process = percent;
@@ -413,6 +416,11 @@ class UploadImageUtil { @@ -413,6 +416,11 @@ class UploadImageUtil {
413 uploadImageProvider.storeImage4.qiniuUrl = imgUrl; 416 uploadImageProvider.storeImage4.qiniuUrl = imgUrl;
414 uploadImageProvider.storeImage4.file = null; 417 uploadImageProvider.storeImage4.file = null;
415 uploadImageProvider.notifyListeners(); 418 uploadImageProvider.notifyListeners();
  419 + } else if (index == 9) {
  420 + uploadImageProvider.logo.process = 1;
  421 + uploadImageProvider.logo.qiniuUrl = imgUrl;
  422 + uploadImageProvider.logo.file = null;
  423 + uploadImageProvider.notifyListeners();
416 } 424 }
417 }) 425 })
418 ..catchError((dynamic error) { 426 ..catchError((dynamic error) {
@@ -461,6 +469,11 @@ class UploadImageUtil { @@ -461,6 +469,11 @@ class UploadImageUtil {
461 uploadImageProvider.storeImage4.qiniuUrl = null; 469 uploadImageProvider.storeImage4.qiniuUrl = null;
462 uploadImageProvider.storeImage4.file = null; 470 uploadImageProvider.storeImage4.file = null;
463 uploadImageProvider.notifyListeners(); 471 uploadImageProvider.notifyListeners();
  472 + } else if (index == 9) {
  473 + uploadImageProvider.logo.process = 0;
  474 + uploadImageProvider.logo.qiniuUrl = null;
  475 + uploadImageProvider.logo.file = null;
  476 + uploadImageProvider.notifyListeners();
464 } 477 }
465 // 取消当前任务 478 // 取消当前任务
466 putController.cancel(); 479 putController.cancel();