Commit 292681d6cf94f78719f413b973bcef771f37ed0e

Authored by wdn127929
1 parent f507313c

店铺介绍设置OK

@@ -209,13 +209,18 @@ class MarkStoreModel { @@ -209,13 +209,18 @@ class MarkStoreModel {
209 String sellerName; // 209 String sellerName; //
210 String introduce; 210 String introduce;
211 List<String> images; 211 List<String> images;
  212 + String isIntroduce;
  213 + String isAbove;
  214 + String isImages;
212 215
213 - MarkStoreModel({  
214 - this.style,  
215 - this.sellerName,  
216 - this.introduce,  
217 - this.images,  
218 - }); 216 + MarkStoreModel(
  217 + {this.style,
  218 + this.sellerName,
  219 + this.introduce,
  220 + this.images,
  221 + this.isIntroduce,
  222 + this.isAbove,
  223 + this.isImages});
219 224
220 MarkStoreModel.fromJson(Map<String, dynamic> json) { 225 MarkStoreModel.fromJson(Map<String, dynamic> json) {
221 style = json['style']; 226 style = json['style'];
@@ -234,6 +239,10 @@ class MarkStoreModel { @@ -234,6 +239,10 @@ class MarkStoreModel {
234 }); 239 });
235 } 240 }
236 } 241 }
  242 +
  243 + isIntroduce = json['is_introduce'];
  244 + isAbove = json['is_above'];
  245 + isImages = json['is_images'];
237 } 246 }
238 247
239 Map<String, dynamic> toJson() { 248 Map<String, dynamic> toJson() {
@@ -242,6 +251,10 @@ class MarkStoreModel { @@ -242,6 +251,10 @@ class MarkStoreModel {
242 data['seller_name'] = this.sellerName; 251 data['seller_name'] = this.sellerName;
243 data['introduce'] = this.introduce; 252 data['introduce'] = this.introduce;
244 data['images'] = this.images; 253 data['images'] = this.images;
  254 + data['is_introduce'] = this.isIntroduce;
  255 + data['is_above'] = this.isAbove;
  256 + data['is_images'] = this.isImages;
  257 +
245 return data; 258 return data;
246 } 259 }
247 } 260 }
@@ -61,8 +61,8 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -61,8 +61,8 @@ class _BookInfoPageState extends State<BookInfoPage> {
61 bool addParking = false; 61 bool addParking = false;
62 bool addPhone = true; 62 bool addPhone = true;
63 63
64 - bool addFirstImage = true; //附加餐厅首图  
65 - bool addLogo = true; //logo是否展示 64 + bool addFirstImage = false; //附加餐厅首图
  65 + bool addLogo = false; //logo是否展示
66 66
67 String dateValue; 67 String dateValue;
68 BaseIndoProvider _baseIndoProvider; 68 BaseIndoProvider _baseIndoProvider;
@@ -645,60 +645,56 @@ class _BookInfoPageState extends State<BookInfoPage> { @@ -645,60 +645,56 @@ class _BookInfoPageState extends State<BookInfoPage> {
645 }), 645 }),
646 VEmptyView(24), 646 VEmptyView(24),
647 //输入框 647 //输入框
648 - addParking  
649 - ? Container(  
650 - width: double.infinity,  
651 - margin: EdgeInsets.symmetric(  
652 - horizontal: ScreenUtil().setWidth(40)),  
653 - padding: EdgeInsets.symmetric(  
654 - horizontal: ScreenUtil().setWidth(40),  
655 - vertical: ScreenUtil().setWidth(20)),  
656 - alignment: Alignment.topLeft,  
657 - decoration: BoxDecoration(  
658 - color: MyColours.color_ffffff,  
659 - border: Border.all(  
660 - color: MyColours.color_DBDBDB,  
661 - width: ScreenUtil().setWidth(2)),  
662 - borderRadius: BorderRadius.circular(  
663 - ScreenUtil().setWidth(20))),  
664 - child: TextField(  
665 - controller: parkingIncoC,  
666 - focusNode: parkingIncoNode,  
667 - style: TextStyle(  
668 - color: MyColours.color_515151,  
669 - fontSize: ScreenUtil().setSp(28),  
670 - textBaseline: TextBaseline.alphabetic),  
671 - textAlignVertical: TextAlignVertical.center,  
672 - maxLines: 5,  
673 - maxLength: 38,  
674 - decoration: InputDecoration(  
675 - hintText: "点击录入停车信息,最多38个汉字。",  
676 - hintStyle: TextStyle(  
677 - color: MyColours.color_999999,  
678 - fontSize: ScreenUtil().setSp(28),  
679 - ),  
680 - contentPadding: EdgeInsets.zero,  
681 - border: OutlineInputBorder(  
682 - borderSide: BorderSide.none),  
683 - ),  
684 - keyboardType: TextInputType.text,  
685 - onChanged: (value) {  
686 - setState(() {  
687 - // currentRemark = value ?? "";  
688 - });  
689 - }),  
690 - )  
691 - : SizedBox(),  
692 - addParking ? VEmptyView(24) : SizedBox(),  
693 - addParking  
694 - ? Padding(  
695 - padding: EdgeInsets.symmetric(horizontal: w(20)),  
696 - child: MyDivider(  
697 - double.infinity,  
698 - w(0.5), 648 + Container(
  649 + width: double.infinity,
  650 + margin: EdgeInsets.symmetric(
  651 + horizontal: ScreenUtil().setWidth(40)),
  652 + padding: EdgeInsets.symmetric(
  653 + horizontal: ScreenUtil().setWidth(40),
  654 + vertical: ScreenUtil().setWidth(20)),
  655 + alignment: Alignment.topLeft,
  656 + decoration: BoxDecoration(
  657 + color: MyColours.color_ffffff,
  658 + border: Border.all(
699 color: MyColours.color_DBDBDB, 659 color: MyColours.color_DBDBDB,
700 - ))  
701 - : SizedBox(), 660 + width: ScreenUtil().setWidth(2)),
  661 + borderRadius:
  662 + BorderRadius.circular(ScreenUtil().setWidth(20))),
  663 + child: TextField(
  664 + controller: parkingIncoC,
  665 + focusNode: parkingIncoNode,
  666 + style: TextStyle(
  667 + color: MyColours.color_515151,
  668 + fontSize: ScreenUtil().setSp(28),
  669 + textBaseline: TextBaseline.alphabetic),
  670 + textAlignVertical: TextAlignVertical.center,
  671 + maxLines: 5,
  672 + maxLength: 38,
  673 + decoration: InputDecoration(
  674 + hintText: "点击录入停车信息,最多38个汉字。",
  675 + hintStyle: TextStyle(
  676 + color: MyColours.color_999999,
  677 + fontSize: ScreenUtil().setSp(28),
  678 + ),
  679 + contentPadding: EdgeInsets.zero,
  680 + border:
  681 + OutlineInputBorder(borderSide: BorderSide.none),
  682 + ),
  683 + keyboardType: TextInputType.text,
  684 + onChanged: (value) {
  685 + setState(() {
  686 + // currentRemark = value ?? "";
  687 + });
  688 + }),
  689 + ),
  690 + VEmptyView(24),
  691 + Padding(
  692 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  693 + child: MyDivider(
  694 + double.infinity,
  695 + w(0.5),
  696 + color: MyColours.color_DBDBDB,
  697 + )),
702 VEmptyView(24), 698 VEmptyView(24),
703 _item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () { 699 _item('预订安排通知中附加餐厅Logo图片', select: addLogo, onTap: () {
704 setState(() { 700 setState(() {
@@ -47,6 +47,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -47,6 +47,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
47 47
48 UploadImageProvider _uploadImageProvider; 48 UploadImageProvider _uploadImageProvider;
49 ScrollController controller = ScrollController(); 49 ScrollController controller = ScrollController();
  50 + bool addStoreIntroduce = false; //预订安排通知中附加餐厅文字介绍
  51 + bool addStoreImge = false; //预订安排通知中附加餐厅文字图片
  52 + bool addAbove = false; //餐厅介绍文字显示在第一张图片上
50 53
51 @override 54 @override
52 void initState() { 55 void initState() {
@@ -80,7 +83,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -80,7 +83,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
80 getSellerTemplateConf() async { 83 getSellerTemplateConf() async {
81 bool success = await marketingCenterProvider.getSellerTemplateConf(context); 84 bool success = await marketingCenterProvider.getSellerTemplateConf(context);
82 if (success && marketingCenterProvider.markDataModel.store != null) { 85 if (success && marketingCenterProvider.markDataModel.store != null) {
83 - currIndex = int.parse(marketingCenterProvider.markDataModel.store.style); 86 + // currIndex = int.parse(marketingCenterProvider.markDataModel.store.style);
84 87
85 _uploadImageProvider.storeImage1.qiniuUrl = 88 _uploadImageProvider.storeImage1.qiniuUrl =
86 marketingCenterProvider.markDataModel.store.images.length > 0 89 marketingCenterProvider.markDataModel.store.images.length > 0
@@ -121,6 +124,17 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -121,6 +124,17 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
121 124
122 storeIntroduceC.text = 125 storeIntroduceC.text =
123 marketingCenterProvider.markDataModel.store.introduce; 126 marketingCenterProvider.markDataModel.store.introduce;
  127 + addStoreIntroduce =
  128 + marketingCenterProvider.markDataModel.store.isIntroduce == '1'
  129 + ? true
  130 + : false;
  131 + addStoreImge = marketingCenterProvider.markDataModel.store.isImages == '1'
  132 + ? true
  133 + : false;
  134 + addAbove = marketingCenterProvider.markDataModel.store.isAbove == '1'
  135 + ? true
  136 + : false;
  137 +
124 setState(() {}); 138 setState(() {});
125 } 139 }
126 } 140 }
@@ -405,9 +419,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -405,9 +419,9 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
405 return Column( 419 return Column(
406 crossAxisAlignment: CrossAxisAlignment.start, 420 crossAxisAlignment: CrossAxisAlignment.start,
407 children: [ 421 children: [
408 - _introduceWidget(EdgeInsets.all(w(15)),  
409 - boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),  
410 - VEmptyView(18), 422 + // _introduceWidget(EdgeInsets.all(w(15)),
  423 + // boxDecoration: BoxDecoration(color: MyColours.color_ffffff)),
  424 + // VEmptyView(18),
411 ImgPickerInvitationWidget( 425 ImgPickerInvitationWidget(
412 scrollController: controller, 426 scrollController: controller,
413 uploadType: UploadType.InvitationStoreType, 427 uploadType: UploadType.InvitationStoreType,
@@ -439,6 +453,37 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -439,6 +453,37 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
439 ); 453 );
440 } 454 }
441 455
  456 + Widget _item(String title, {bool select, GestureTapCallback onTap}) {
  457 + return InkWell(
  458 + onTap: onTap,
  459 + child: Container(
  460 + decoration: BoxDecoration(
  461 + border: Border(
  462 + bottom: BorderSide(
  463 + color: MyColours.color_E7E7E7, width: w(0.5)))),
  464 + margin: EdgeInsets.only(left: w(16)),
  465 + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(16)),
  466 + child: Row(
  467 + children: [
  468 + Text(
  469 + title,
  470 + style: TextStyle(
  471 + color: MyColours.color_515151,
  472 + fontSize: ScreenUtil().setWidth(32)),
  473 + ),
  474 + Spacer(),
  475 + Container(
  476 + padding:
  477 + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
  478 + child: Image.asset(
  479 + Utils.getImgPath(select ? 'swich_on' : 'swich_off'),
  480 + width: w(44),
  481 + ),
  482 + )
  483 + ],
  484 + )));
  485 + }
  486 +
442 @override 487 @override
443 Widget build(BuildContext context) { 488 Widget build(BuildContext context) {
444 _uploadImageProvider = 489 _uploadImageProvider =
@@ -461,26 +506,100 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -461,26 +506,100 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
461 controller: controller, 506 controller: controller,
462 child: Column( 507 child: Column(
463 children: [ 508 children: [
464 - _selectBtnWidget(), 509 + _item('预订安排通知中附加餐厅文字介绍', select: addStoreIntroduce,
  510 + onTap: () {
  511 + setState(() {
  512 + addStoreIntroduce = !addStoreIntroduce;
  513 + });
  514 + }),
  515 +
465 VEmptyView(24), 516 VEmptyView(24),
  517 + //输入框
466 Container( 518 Container(
467 - alignment: Alignment.centerLeft,  
468 - padding: EdgeInsets.only(left: w(16)),  
469 - height: w(48),  
470 - child: Text(  
471 - '效果预览',  
472 - style: TextStyle(  
473 - fontSize: font(16),  
474 - color: MyColours.color_515151),  
475 - ), 519 + width: double.infinity,
  520 + margin: EdgeInsets.symmetric(
  521 + horizontal: ScreenUtil().setWidth(40)),
  522 + padding: EdgeInsets.symmetric(
  523 + horizontal: ScreenUtil().setWidth(40),
  524 + vertical: ScreenUtil().setWidth(20)),
  525 + alignment: Alignment.topLeft,
  526 + decoration: BoxDecoration(
  527 + color: MyColours.color_ffffff,
  528 + border: Border.all(
  529 + color: MyColours.color_DBDBDB,
  530 + width: ScreenUtil().setWidth(2)),
  531 + borderRadius: BorderRadius.circular(
  532 + ScreenUtil().setWidth(20))),
  533 + child: TextField(
  534 + controller: storeIntroduceC,
  535 + focusNode: storeIntroduceNode,
  536 + style: TextStyle(
  537 + color: MyColours.color_515151,
  538 + fontSize: ScreenUtil().setSp(28),
  539 + textBaseline: TextBaseline.alphabetic),
  540 + textAlignVertical: TextAlignVertical.center,
  541 + maxLines: 5,
  542 + maxLength: 100,
  543 + decoration: InputDecoration(
  544 + hintText: "点击录入餐厅介绍文字信息,最多100个汉字。",
  545 + hintStyle: TextStyle(
  546 + color: MyColours.color_999999,
  547 + fontSize: ScreenUtil().setSp(28),
  548 + ),
  549 + contentPadding: EdgeInsets.zero,
  550 + border: OutlineInputBorder(
  551 + borderSide: BorderSide.none),
  552 + ),
  553 + keyboardType: TextInputType.text,
  554 + onChanged: (value) {
  555 + setState(() {
  556 + // currentRemark = value ?? "";
  557 + });
  558 + }),
476 ), 559 ),
477 VEmptyView(24), 560 VEmptyView(24),
478 - currIndex == 0  
479 - ? _noTextWidget()  
480 - : currIndex == 1  
481 - ? _mergingWidget()  
482 - : _separateWidget(),  
483 - VEmptyView(18), 561 + Padding(
  562 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  563 + child: MyDivider(
  564 + double.infinity,
  565 + w(0.5),
  566 + color: MyColours.color_DBDBDB,
  567 + )),
  568 + VEmptyView(24),
  569 + // _selectBtnWidget(),
  570 + _item('预订安排通知中附加餐厅介绍图片', select: addStoreImge, onTap: () {
  571 + setState(() {
  572 + addStoreImge = !addStoreImge;
  573 + });
  574 + }),
  575 +
  576 + VEmptyView(24),
  577 + // Container(
  578 + // alignment: Alignment.centerLeft,
  579 + // padding: EdgeInsets.only(left: w(16)),
  580 + // height: w(48),
  581 + // child: Text(
  582 + // '效果预览',
  583 + // style: TextStyle(
  584 + // fontSize: font(16),
  585 + // color: MyColours.color_515151),
  586 + // ),
  587 + // ),
  588 + // VEmptyView(24),
  589 + // currIndex == 0
  590 + // ? _noTextWidget()
  591 + // : currIndex == 1
  592 + // ? _mergingWidget()
  593 + // :
  594 + _separateWidget(),
  595 + VEmptyView(24),
  596 + _item('餐厅介绍文字显示在第一张图片上', select: addAbove, onTap: () {
  597 + setState(() {
  598 + addAbove = !addAbove;
  599 + });
  600 + }),
  601 +
  602 + VEmptyView(24),
484 ], 603 ],
485 ), 604 ),
486 )), 605 )),
@@ -501,7 +620,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -501,7 +620,7 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
501 FocusScope.of(context) 620 FocusScope.of(context)
502 .requestFocus(FocusNode()); //点击空白处隐藏键盘 621 .requestFocus(FocusNode()); //点击空白处隐藏键盘
503 622
504 - if ((currIndex == 1 || currIndex == 2) && 623 + if (addStoreIntroduce &&
505 storeIntroduceC.text.trim().length == 0) { 624 storeIntroduceC.text.trim().length == 0) {
506 Utils.showToast('请输入餐厅介绍文字!'); 625 Utils.showToast('请输入餐厅介绍文字!');
507 return false; 626 return false;
@@ -531,10 +650,13 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> { @@ -531,10 +650,13 @@ class _StoreIntroducePageState extends State<StoreIntroducePage> {
531 650
532 //接口 651 //接口
533 Map storeData = { 652 Map storeData = {
534 - 'style': currIndex.toString(),  
535 - 'seller_name': sellername, 653 + // 'style': currIndex.toString(),
  654 + // 'seller_name': sellername,
536 'introduce': storeIntroduceC.text, 655 'introduce': storeIntroduceC.text,
537 - 'images': json.encode(images) 656 + 'images': json.encode(images),
  657 + 'is_introduce': addStoreIntroduce ? '1' : '0',
  658 + 'is_images': addStoreImge ? '1' : '0',
  659 + 'is_above': addAbove ? '1' : '0'
538 }; 660 };
539 661
540 Map<String, String> params = { 662 Map<String, String> params = {