|
1
|
import 'dart:convert';
|
1
|
import 'dart:convert';
|
|
2
|
|
2
|
|
|
3
|
import 'package:flutter/material.dart';
|
3
|
import 'package:flutter/material.dart';
|
|
|
|
4
|
+import 'package:flutter/services.dart';
|
|
4
|
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
5
|
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
|
5
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
6
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
6
|
import 'package:one_key/models/customer_label_model.dart';
|
7
|
import 'package:one_key/models/customer_label_model.dart';
|
|
@@ -34,6 +35,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -34,6 +35,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
34
|
bool showLabel = false;
|
35
|
bool showLabel = false;
|
|
35
|
|
36
|
|
|
36
|
MarketingCenterProvider marketingCenterProvider;
|
37
|
MarketingCenterProvider marketingCenterProvider;
|
|
|
|
38
|
+ TextEditingController controllerDay = TextEditingController();
|
|
37
|
|
39
|
|
|
38
|
@override
|
40
|
@override
|
|
39
|
void initState() {
|
41
|
void initState() {
|
|
@@ -64,6 +66,23 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -64,6 +66,23 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
64
|
marketingCenterProvider.dzSellerConfModel.isReserveOver == '1'
|
66
|
marketingCenterProvider.dzSellerConfModel.isReserveOver == '1'
|
|
65
|
? true
|
67
|
? true
|
|
66
|
: false;
|
68
|
: false;
|
|
|
|
69
|
+ customerProvider.ispcphone =
|
|
|
|
70
|
+ marketingCenterProvider.dzSellerConfModel.pcNotPhone == '1'
|
|
|
|
71
|
+ ? true
|
|
|
|
72
|
+ : false;
|
|
|
|
73
|
+ controllerDay.text = marketingCenterProvider.dzSellerConfModel.cancelDay;
|
|
|
|
74
|
+ customerProvider.cancelOrderdayShopowner =
|
|
|
|
75
|
+ marketingCenterProvider.dzSellerConfModel.cancelShopowner == '1'
|
|
|
|
76
|
+ ? true
|
|
|
|
77
|
+ : false;
|
|
|
|
78
|
+ customerProvider.cancelOrderdayManager =
|
|
|
|
79
|
+ marketingCenterProvider.dzSellerConfModel.cancelManager == '1'
|
|
|
|
80
|
+ ? true
|
|
|
|
81
|
+ : false;
|
|
|
|
82
|
+ customerProvider.cancelOrderdayOther =
|
|
|
|
83
|
+ marketingCenterProvider.dzSellerConfModel.cancelOther == '1'
|
|
|
|
84
|
+ ? true
|
|
|
|
85
|
+ : false;
|
|
67
|
}
|
86
|
}
|
|
68
|
setState(() {});
|
87
|
setState(() {});
|
|
69
|
}
|
88
|
}
|
|
@@ -108,9 +127,14 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -108,9 +127,14 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
108
|
Future<bool> _setConfings() async {
|
127
|
Future<bool> _setConfings() async {
|
|
109
|
Map<String, dynamic> data = {
|
128
|
Map<String, dynamic> data = {
|
|
110
|
"pc_not_phone": customerProvider.ispcphone ? '1' : '0',
|
129
|
"pc_not_phone": customerProvider.ispcphone ? '1' : '0',
|
|
111
|
- "is_add_over": customerProvider.isAddOver?'1':'0',
|
130
|
+ "is_add_over": customerProvider.isAddOver ? '1' : '0',
|
|
112
|
"is_set_over": customerProvider.isSetOver ? '1' : '0',
|
131
|
"is_set_over": customerProvider.isSetOver ? '1' : '0',
|
|
113
|
- "is_reserve_over": customerProvider.isReserveOver ? '1' : '0'
|
132
|
+ "is_reserve_over": customerProvider.isReserveOver ? '1' : '0',
|
|
|
|
133
|
+ 'temp_cancel_day': controllerDay.text,
|
|
|
|
134
|
+ 'temp_for_shopowner':
|
|
|
|
135
|
+ customerProvider.cancelOrderdayShopowner ? '1' : '0',
|
|
|
|
136
|
+ 'temp_for_manager': customerProvider.cancelOrderdayManager ? '1' : '0',
|
|
|
|
137
|
+ 'temp_for_other': customerProvider.cancelOrderdayOther ? '1' : '0',
|
|
114
|
};
|
138
|
};
|
|
115
|
Map<String, String> params = {
|
139
|
Map<String, String> params = {
|
|
116
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
140
|
'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
@@ -397,7 +421,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -397,7 +421,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
397
|
InkWell(
|
421
|
InkWell(
|
|
398
|
onTap: () {
|
422
|
onTap: () {
|
|
399
|
setState(() {
|
423
|
setState(() {
|
|
400
|
- customerProvider.ispcphone = !customerProvider.ispcphone;
|
424
|
+ customerProvider.ispcphone =
|
|
|
|
425
|
+ !customerProvider.ispcphone;
|
|
401
|
});
|
426
|
});
|
|
402
|
},
|
427
|
},
|
|
403
|
child: Container(
|
428
|
child: Container(
|
|
@@ -550,6 +575,179 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -550,6 +575,179 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
550
|
color: MyColours.color_E7E7E7,
|
575
|
color: MyColours.color_E7E7E7,
|
|
551
|
)),
|
576
|
)),
|
|
552
|
VEmptyView(48),
|
577
|
VEmptyView(48),
|
|
|
|
578
|
+ Row(
|
|
|
|
579
|
+ children: [
|
|
|
|
580
|
+ Container(
|
|
|
|
581
|
+ padding: EdgeInsets.symmetric(vertical: w(8)),
|
|
|
|
582
|
+ child: Text('临餐取消预订限制(前台及管理员除外)',
|
|
|
|
583
|
+ style: TextStyle(
|
|
|
|
584
|
+ color: MyColours.color_515151,
|
|
|
|
585
|
+ fontSize: ScreenUtil().setSp(32)))),
|
|
|
|
586
|
+ HEmptyView(10),
|
|
|
|
587
|
+ Expanded(
|
|
|
|
588
|
+ child: TextField(
|
|
|
|
589
|
+ controller: controllerDay,
|
|
|
|
590
|
+ textAlign: TextAlign.right,
|
|
|
|
591
|
+ textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
592
|
+ maxLines: 1,
|
|
|
|
593
|
+ // //光标颜色
|
|
|
|
594
|
+ // cursorColor:
|
|
|
|
595
|
+ // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
596
|
+ //输入文本的样式
|
|
|
|
597
|
+ style: TextStyle(
|
|
|
|
598
|
+ color: MyColours.color_515151,
|
|
|
|
599
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
600
|
+ ),
|
|
|
|
601
|
+ inputFormatters: <TextInputFormatter>[
|
|
|
|
602
|
+ FilteringTextInputFormatter.allow(
|
|
|
|
603
|
+ RegExp(r'[0-9]')), //设置只允许输入数字
|
|
|
|
604
|
+ ],
|
|
|
|
605
|
+ decoration: InputDecoration(
|
|
|
|
606
|
+ isCollapsed: true,
|
|
|
|
607
|
+ border:
|
|
|
|
608
|
+ OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
609
|
+ hintText: '输入',
|
|
|
|
610
|
+ hintStyle: TextStyle(
|
|
|
|
611
|
+ color: MyColours.color_999999,
|
|
|
|
612
|
+ fontSize: ScreenUtil().setSp(32),
|
|
|
|
613
|
+ ),
|
|
|
|
614
|
+ enabledBorder: new UnderlineInputBorder(
|
|
|
|
615
|
+ borderSide: BorderSide.none,
|
|
|
|
616
|
+ ),
|
|
|
|
617
|
+ focusedBorder: new UnderlineInputBorder(
|
|
|
|
618
|
+ borderSide: BorderSide.none,
|
|
|
|
619
|
+ ),
|
|
|
|
620
|
+ ),
|
|
|
|
621
|
+ onChanged: (value) {},
|
|
|
|
622
|
+ onEditingComplete: () {
|
|
|
|
623
|
+ FocusScope.of(context)
|
|
|
|
624
|
+ .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
625
|
+ },
|
|
|
|
626
|
+ keyboardType: TextInputType.number),
|
|
|
|
627
|
+ ),
|
|
|
|
628
|
+ Text('天',
|
|
|
|
629
|
+ style: TextStyle(
|
|
|
|
630
|
+ color: MyColours.color_515151,
|
|
|
|
631
|
+ fontSize: ScreenUtil().setSp(32))),
|
|
|
|
632
|
+ HEmptyView(24),
|
|
|
|
633
|
+ ],
|
|
|
|
634
|
+ ),
|
|
|
|
635
|
+ VEmptyView(22),
|
|
|
|
636
|
+ MyDivider(
|
|
|
|
637
|
+ double.infinity,
|
|
|
|
638
|
+ w(1),
|
|
|
|
639
|
+ color: MyColours.color_E7E7E7,
|
|
|
|
640
|
+ ),
|
|
|
|
641
|
+ VEmptyView(24),
|
|
|
|
642
|
+ InkWell(
|
|
|
|
643
|
+ onTap: () {
|
|
|
|
644
|
+ setState(() {
|
|
|
|
645
|
+ customerProvider.cancelOrderdayShopowner =
|
|
|
|
646
|
+ !customerProvider.cancelOrderdayShopowner;
|
|
|
|
647
|
+ });
|
|
|
|
648
|
+ // _sellerGuestSet();
|
|
|
|
649
|
+ },
|
|
|
|
650
|
+ child: Container(
|
|
|
|
651
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
652
|
+ vertical: w(8), horizontal: w(14)),
|
|
|
|
653
|
+ child: Row(
|
|
|
|
654
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
655
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
656
|
+ children: [
|
|
|
|
657
|
+ Text('允许店长临餐取消预订',
|
|
|
|
658
|
+ style: TextStyle(
|
|
|
|
659
|
+ color: MyColours.color_515151,
|
|
|
|
660
|
+ fontSize: ScreenUtil().setSp(28))),
|
|
|
|
661
|
+ Image.asset(
|
|
|
|
662
|
+ customerProvider.cancelOrderdayShopowner
|
|
|
|
663
|
+ ? Utils.getImgPath('swich_on')
|
|
|
|
664
|
+ : Utils.getImgPath('swich_off'),
|
|
|
|
665
|
+ width: ScreenUtil().setWidth(88),
|
|
|
|
666
|
+ // height: ScreenUtil().setWidth(82),
|
|
|
|
667
|
+ ),
|
|
|
|
668
|
+ ],
|
|
|
|
669
|
+ )),
|
|
|
|
670
|
+ ),
|
|
|
|
671
|
+ Padding(
|
|
|
|
672
|
+ padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
673
|
+ child: MyDivider(
|
|
|
|
674
|
+ double.infinity,
|
|
|
|
675
|
+ w(1),
|
|
|
|
676
|
+ color: MyColours.color_E7E7E7,
|
|
|
|
677
|
+ )),
|
|
|
|
678
|
+ VEmptyView(24),
|
|
|
|
679
|
+ InkWell(
|
|
|
|
680
|
+ onTap: () {
|
|
|
|
681
|
+ setState(() {
|
|
|
|
682
|
+ customerProvider.cancelOrderdayManager =
|
|
|
|
683
|
+ !customerProvider.cancelOrderdayManager;
|
|
|
|
684
|
+ });
|
|
|
|
685
|
+ },
|
|
|
|
686
|
+ child: Container(
|
|
|
|
687
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
688
|
+ vertical: w(8), horizontal: w(14)),
|
|
|
|
689
|
+ child: Row(
|
|
|
|
690
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
691
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
692
|
+ children: [
|
|
|
|
693
|
+ Text('允许经理临餐取消预订',
|
|
|
|
694
|
+ style: TextStyle(
|
|
|
|
695
|
+ color: MyColours.color_515151,
|
|
|
|
696
|
+ fontSize: ScreenUtil().setSp(28))),
|
|
|
|
697
|
+ Image.asset(
|
|
|
|
698
|
+ customerProvider.cancelOrderdayManager
|
|
|
|
699
|
+ ? Utils.getImgPath('swich_on')
|
|
|
|
700
|
+ : Utils.getImgPath('swich_off'),
|
|
|
|
701
|
+ width: ScreenUtil().setWidth(88),
|
|
|
|
702
|
+ // height: ScreenUtil().setWidth(82),
|
|
|
|
703
|
+ ),
|
|
|
|
704
|
+ ],
|
|
|
|
705
|
+ ),
|
|
|
|
706
|
+ )),
|
|
|
|
707
|
+ Padding(
|
|
|
|
708
|
+ padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
709
|
+ child: MyDivider(
|
|
|
|
710
|
+ double.infinity,
|
|
|
|
711
|
+ w(1),
|
|
|
|
712
|
+ color: MyColours.color_E7E7E7,
|
|
|
|
713
|
+ )),
|
|
|
|
714
|
+ VEmptyView(24),
|
|
|
|
715
|
+ InkWell(
|
|
|
|
716
|
+ onTap: () {
|
|
|
|
717
|
+ setState(() {
|
|
|
|
718
|
+ customerProvider.cancelOrderdayOther =
|
|
|
|
719
|
+ !customerProvider.cancelOrderdayOther;
|
|
|
|
720
|
+ });
|
|
|
|
721
|
+ },
|
|
|
|
722
|
+ child: Container(
|
|
|
|
723
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
724
|
+ vertical: w(8), horizontal: w(14)),
|
|
|
|
725
|
+ child: Row(
|
|
|
|
726
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
727
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
728
|
+ children: [
|
|
|
|
729
|
+ Text('允许服务员及其他人员临餐取消预订',
|
|
|
|
730
|
+ style: TextStyle(
|
|
|
|
731
|
+ color: MyColours.color_515151,
|
|
|
|
732
|
+ fontSize: ScreenUtil().setSp(28))),
|
|
|
|
733
|
+ Image.asset(
|
|
|
|
734
|
+ customerProvider.cancelOrderdayOther
|
|
|
|
735
|
+ ? Utils.getImgPath('swich_on')
|
|
|
|
736
|
+ : Utils.getImgPath('swich_off'),
|
|
|
|
737
|
+ width: ScreenUtil().setWidth(88),
|
|
|
|
738
|
+ // height: ScreenUtil().setWidth(82),
|
|
|
|
739
|
+ ),
|
|
|
|
740
|
+ ],
|
|
|
|
741
|
+ ),
|
|
|
|
742
|
+ )),
|
|
|
|
743
|
+ Padding(
|
|
|
|
744
|
+ padding: EdgeInsets.only(left: w(14), right: w(10)),
|
|
|
|
745
|
+ child: MyDivider(
|
|
|
|
746
|
+ double.infinity,
|
|
|
|
747
|
+ w(1),
|
|
|
|
748
|
+ color: MyColours.color_E7E7E7,
|
|
|
|
749
|
+ )),
|
|
|
|
750
|
+ VEmptyView(48),
|
|
553
|
Text('店内自定义标签',
|
751
|
Text('店内自定义标签',
|
|
554
|
style: TextStyle(
|
752
|
style: TextStyle(
|
|
555
|
color: MyColours.color_515151,
|
753
|
color: MyColours.color_515151,
|
|
@@ -591,6 +789,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
@@ -591,6 +789,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { |
|
591
|
fontSize: 28,
|
789
|
fontSize: 28,
|
|
592
|
textColor: MyColours.color_ffffff,
|
790
|
textColor: MyColours.color_ffffff,
|
|
593
|
onPressed: () {
|
791
|
onPressed: () {
|
|
|
|
792
|
+ FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
594
|
_saveData();
|
793
|
_saveData();
|
|
595
|
},
|
794
|
},
|
|
596
|
),
|
795
|
),
|