|
@@ -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 = {
|