Commit 9b9762e7e73db7e38d93ff7e5930ff521b2e5acf

Authored by weixin_45529955
1 parent ba728755

hhh

1 -  
2 import 'dart:convert'; 1 import 'dart:convert';
3 2
4 import 'package:common_utils/common_utils.dart'; 3 import 'package:common_utils/common_utils.dart';
@@ -160,12 +159,13 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -160,12 +159,13 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
160 } 159 }
161 160
162 _getNewRechargeDetail() async { 161 _getNewRechargeDetail() async {
163 - bool success = await marketingCenterProvider!.getNewRechargeDetail(  
164 - context, widget.idstr); 162 + bool success = await marketingCenterProvider!
  163 + .getNewRechargeDetail(context, widget.idstr);
165 if (success) { 164 if (success) {
166 //请求成功 165 //请求成功
167 - nameC.text = marketingCenterProvider!.rechargeDetail!.rname??"";  
168 - priceminC.text = marketingCenterProvider!.rechargeDetail!.rechargeMoney??""; 166 + nameC.text = marketingCenterProvider!.rechargeDetail!.rname ?? "";
  167 + priceminC.text =
  168 + marketingCenterProvider!.rechargeDetail!.rechargeMoney ?? "";
169 givePriceSwich = 169 givePriceSwich =
170 marketingCenterProvider!.rechargeDetail!.rechargeList!.isPrice == '1' 170 marketingCenterProvider!.rechargeDetail!.rechargeList!.isPrice == '1'
171 ? true 171 ? true
@@ -179,13 +179,15 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -179,13 +179,15 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
179 giveScoreC.text = 179 giveScoreC.text =
180 marketingCenterProvider!.rechargeDetail!.rechargeList!.score!; 180 marketingCenterProvider!.rechargeDetail!.rechargeList!.score!;
181 giveCouponsSwich = 181 giveCouponsSwich =
182 - marketingCenterProvider!.rechargeDetail!.rechargeList!.isCoupons == '1' 182 + marketingCenterProvider!.rechargeDetail!.rechargeList!.isCoupons ==
  183 + '1'
183 ? true 184 ? true
184 : false; 185 : false;
185 selectIDs = 186 selectIDs =
186 marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsIds; 187 marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsIds;
187 188
188 - couponsData = marketingCenterProvider!.rechargeDetail!.rechargeList!.coupons; 189 + couponsData =
  190 + marketingCenterProvider!.rechargeDetail!.rechargeList!.coupons;
189 coupons = 191 coupons =
190 marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsNames; 192 marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsNames;
191 fixdate = marketingCenterProvider!.rechargeDetail!.expDate!.isFix == '1' 193 fixdate = marketingCenterProvider!.rechargeDetail!.expDate!.isFix == '1'
@@ -201,13 +203,17 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -201,13 +203,17 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
201 weekly = marketingCenterProvider!.rechargeDetail!.expDate!.isWeek == '1' 203 weekly = marketingCenterProvider!.rechargeDetail!.expDate!.isWeek == '1'
202 ? true 204 ? true
203 : false; 205 : false;
204 - if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow != '') {  
205 - weekShow = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow!; 206 + if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow !=
  207 + '') {
  208 + weekShow =
  209 + marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow!;
206 } 210 }
207 211
208 - if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData!.length > 212 + if (marketingCenterProvider!
  213 + .rechargeDetail!.expDate!.weekDateData!.length >
209 0) { 214 0) {
210 - weekData = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData; 215 + weekData =
  216 + marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData;
211 } 217 }
212 218
213 birthday = 219 birthday =
@@ -215,7 +221,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -215,7 +221,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
215 ? true 221 ? true
216 : false; 222 : false;
217 223
218 - remarkC.text = marketingCenterProvider!.rechargeDetail!.explain??""; 224 + remarkC.text = marketingCenterProvider!.rechargeDetail!.explain ?? "";
219 canUse = 225 canUse =
220 marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? true : false; 226 marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? true : false;
221 setState(() {}); 227 setState(() {});
@@ -259,6 +265,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -259,6 +265,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
259 textAlign: TextAlign.right, 265 textAlign: TextAlign.right,
260 textAlignVertical: TextAlignVertical.bottom, 266 textAlignVertical: TextAlignVertical.bottom,
261 maxLines: 1, 267 maxLines: 1,
  268 +
262 // //光标颜色 269 // //光标颜色
263 // cursorColor: 270 // cursorColor:
264 // widget.isSelect ? Colors.white : MyColours.color_199095, 271 // widget.isSelect ? Colors.white : MyColours.color_199095,
@@ -540,8 +547,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -540,8 +547,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
540 if (widget.idstr != null && 547 if (widget.idstr != null &&
541 widget.idstr != 'null' && 548 widget.idstr != 'null' &&
542 marketingCenterProvider!.rechargeDetail!.isOpen == '1') { 549 marketingCenterProvider!.rechargeDetail!.isOpen == '1') {
543 - Utils.goShareBuyRechargeToWeChat(  
544 - context, widget.idstr, marketingCenterProvider!.rechargeDetail!); 550 + Utils.goShareBuyRechargeToWeChat(context, widget.idstr,
  551 + marketingCenterProvider!.rechargeDetail!);
545 } 552 }
546 }, 553 },
547 ), 554 ),
@@ -553,14 +560,37 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -553,14 +560,37 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
553 padding: EdgeInsets.only(left: w(32)), 560 padding: EdgeInsets.only(left: w(32)),
554 child: Column( 561 child: Column(
555 children: [ 562 children: [
556 - _textfield('活动名称', '点击输入活动名称', nameC, nameF), 563 + Container(
  564 + padding: EdgeInsets.only(right: w(10)),
  565 + child: Row(
  566 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  567 + children: [
  568 + Container(
  569 + child: Text(
  570 + '活动名称',
  571 + style: TextStyle(
  572 + color: MyColours.color_515151,
  573 + fontSize: ScreenUtil().setSp(32)),
  574 + ),
  575 + ),
  576 + HEmptyView(80),
  577 + Container(
  578 + child: Text(
  579 + '当餐免费',
  580 + style: TextStyle(
  581 + color: MyColours.color_999999,
  582 + fontSize: ScreenUtil().setSp(32)),
  583 + ),
  584 + ),
  585 + ])),
  586 + // _textfield('活动名称', '点击输入活动名称', nameC, nameF),
557 MyDivider( 587 MyDivider(
558 double.infinity, 588 double.infinity,
559 w(1), 589 w(1),
560 color: MyColours.color_E7E7E7, 590 color: MyColours.color_E7E7E7,
561 ), 591 ),
562 VEmptyView(24), 592 VEmptyView(24),
563 - _textfield('充值满', '点击输入充值金额门槛', priceminC, priceminF, 593 + _textfield('充值实际消费金额的倍数', '点击输入', priceminC, priceminF,
564 textInputStyle: 594 textInputStyle:
565 TextInputType.numberWithOptions(decimal: true)), 595 TextInputType.numberWithOptions(decimal: true)),
566 MyDivider( 596 MyDivider(
@@ -795,7 +825,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -795,7 +825,7 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
795 .requestFocus(FocusNode()); 825 .requestFocus(FocusNode());
796 Map? object = await NavigatorUtil 826 Map? object = await NavigatorUtil
797 .goRechargeSelectStoreCouponPage( 827 .goRechargeSelectStoreCouponPage(
798 - context, selectIDs!.join(',')) ; 828 + context, selectIDs!.join(','));
799 print(object); 829 print(object);
800 if (object != null && 830 if (object != null &&
801 object['couponsid'] != null) { 831 object['couponsid'] != null) {
@@ -852,230 +882,234 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -852,230 +882,234 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
852 color: MyColours.color_E7E7E7, 882 color: MyColours.color_E7E7E7,
853 ), 883 ),
854 VEmptyView(48), 884 VEmptyView(48),
855 - Container(  
856 - alignment: Alignment.centerLeft,  
857 - child: Text(  
858 - '使用限制:',  
859 - style: TextStyle(  
860 - color: MyColours.color_515151,  
861 - fontSize: ScreenUtil().setSp(32)),  
862 - ),  
863 - ),  
864 - VEmptyView(24),  
865 - Row(  
866 - children: [  
867 - HEmptyView(30),  
868 - _itemRadioWidget(fixdate, '无', onTap: () {  
869 - if (!fixdate) {  
870 - setState(() {  
871 - fixdate = true;  
872 - weekly = false;  
873 - birthday = false;  
874 - });  
875 - }  
876 - }),  
877 - Spacer(),  
878 - _itemRadioWidget(weekly, '每周', onTap: () {  
879 - if (!weekly) {  
880 - setState(() {  
881 - weekly = true;  
882 - fixdate = false;  
883 - birthday = false;  
884 - });  
885 - }  
886 - }),  
887 - Spacer(),  
888 - _itemRadioWidget(birthday, '会员生日当天', onTap: () {  
889 - if (!birthday) {  
890 - setState(() {  
891 - birthday = true;  
892 - weekly = false;  
893 - fixdate = false;  
894 - });  
895 - }  
896 - }),  
897 - HEmptyView(30),  
898 - ],  
899 - ),  
900 - birthday ? SizedBox() : VEmptyView(24),  
901 - // fixdate  
902 - // ? Column(  
903 - // children: [  
904 - // _select('有效期从', fromDate, () {  
905 - // FocusScope.of(context)  
906 - // .requestFocus(FocusNode()); //点击空白处隐藏键盘  
907 - // //弹出时间选择器  
908 - // // showPickerDateTime(context);  
909 - // showDateSelWidget = true;  
910 - // DialogUtil.showPickerDateTime24(  
911 - // context,  
912 - // scaffoldKey,  
913 - // (value) {  
914 - // // {'text': picker.adapter.text, 'select': selecteds}  
915 - // if (value != null) {  
916 - // setState(() {  
917 - // print(value);  
918 - // fromDate = DateUtil.formatDateStr(  
919 - // value,  
920 - // format: DateFormats.y_mo_d);  
921 - // });  
922 - // }  
923 - // showDateSelWidget = false;  
924 - // },  
925 - // dateTime: DateUtil.getDateTime(fromDate),  
926 - // pickerDateTimeType: PickerDateTimeType.kYMD,  
927 - // onCancel: () {  
928 - // showDateSelWidget = false;  
929 - // });  
930 - // }),  
931 - // VEmptyView(24),  
932 - // _select('有效期至', endDate, () {  
933 - // FocusScope.of(context)  
934 - // .requestFocus(FocusNode()); //点击空白处隐藏键盘  
935 - // //弹出时间选择器  
936 - // // showPickerDateTime(context);  
937 - // showDateSelWidget = true;  
938 - // DialogUtil.showPickerDateTime24(  
939 - // context,  
940 - // scaffoldKey,  
941 - // (value) {  
942 - // // {'text': picker.adapter.text, 'select': selecteds}  
943 - // if (value != null) {  
944 - // setState(() {  
945 - // print(value);  
946 - // endDate = DateUtil.formatDateStr(  
947 - // value,  
948 - // format: DateFormats.y_mo_d);  
949 - // });  
950 - // }  
951 - // showDateSelWidget = false;  
952 - // },  
953 - // dateTime: DateUtil.getDateTime(endDate),  
954 - // pickerDateTimeType: PickerDateTimeType.kYMD,  
955 - // onCancel: () {  
956 - // showDateSelWidget = false;  
957 - // });  
958 - // })  
959 - // ],  
960 - // )  
961 - // : SizedBox(),  
962 - weekly  
963 - ? _select(weekShow, '', () async {  
964 - FocusScope.of(context)  
965 - .requestFocus(FocusNode()); //点击空白处隐藏键盘  
966 - //弹出时间选择器  
967 - // showPickerDateTime(context);  
968 - showDateSelWidget = false; 885 + // Container(
  886 + // alignment: Alignment.centerLeft,
  887 + // child: Text(
  888 + // '使用限制:',
  889 + // style: TextStyle(
  890 + // color: MyColours.color_515151,
  891 + // fontSize: ScreenUtil().setSp(32)),
  892 + // ),
  893 + // ),
  894 + // VEmptyView(24),
  895 + // Row(
  896 + // children: [
  897 + // HEmptyView(30),
  898 + // _itemRadioWidget(fixdate, '无', onTap: () {
  899 + // if (!fixdate) {
  900 + // setState(() {
  901 + // fixdate = true;
  902 + // weekly = false;
  903 + // birthday = false;
  904 + // });
  905 + // }
  906 + // }),
  907 + // Spacer(),
  908 + // _itemRadioWidget(weekly, '每周', onTap: () {
  909 + // if (!weekly) {
  910 + // setState(() {
  911 + // weekly = true;
  912 + // fixdate = false;
  913 + // birthday = false;
  914 + // });
  915 + // }
  916 + // }),
  917 + // Spacer(),
  918 + // _itemRadioWidget(birthday, '会员生日当天', onTap: () {
  919 + // if (!birthday) {
  920 + // setState(() {
  921 + // birthday = true;
  922 + // weekly = false;
  923 + // fixdate = false;
  924 + // });
  925 + // }
  926 + // }),
  927 + // HEmptyView(30),
  928 + // ],
  929 + // ),
  930 + // birthday ? SizedBox() : VEmptyView(24),
  931 + // // fixdate
  932 + // // ? Column(
  933 + // // children: [
  934 + // // _select('有效期从', fromDate, () {
  935 + // // FocusScope.of(context)
  936 + // // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  937 + // // //弹出时间选择器
  938 + // // // showPickerDateTime(context);
  939 + // // showDateSelWidget = true;
  940 + // // DialogUtil.showPickerDateTime24(
  941 + // // context,
  942 + // // scaffoldKey,
  943 + // // (value) {
  944 + // // // {'text': picker.adapter.text, 'select': selecteds}
  945 + // // if (value != null) {
  946 + // // setState(() {
  947 + // // print(value);
  948 + // // fromDate = DateUtil.formatDateStr(
  949 + // // value,
  950 + // // format: DateFormats.y_mo_d);
  951 + // // });
  952 + // // }
  953 + // // showDateSelWidget = false;
  954 + // // },
  955 + // // dateTime: DateUtil.getDateTime(fromDate),
  956 + // // pickerDateTimeType: PickerDateTimeType.kYMD,
  957 + // // onCancel: () {
  958 + // // showDateSelWidget = false;
  959 + // // });
  960 + // // }),
  961 + // // VEmptyView(24),
  962 + // // _select('有效期至', endDate, () {
  963 + // // FocusScope.of(context)
  964 + // // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  965 + // // //弹出时间选择器
  966 + // // // showPickerDateTime(context);
  967 + // // showDateSelWidget = true;
  968 + // // DialogUtil.showPickerDateTime24(
  969 + // // context,
  970 + // // scaffoldKey,
  971 + // // (value) {
  972 + // // // {'text': picker.adapter.text, 'select': selecteds}
  973 + // // if (value != null) {
  974 + // // setState(() {
  975 + // // print(value);
  976 + // // endDate = DateUtil.formatDateStr(
  977 + // // value,
  978 + // // format: DateFormats.y_mo_d);
  979 + // // });
  980 + // // }
  981 + // // showDateSelWidget = false;
  982 + // // },
  983 + // // dateTime: DateUtil.getDateTime(endDate),
  984 + // // pickerDateTimeType: PickerDateTimeType.kYMD,
  985 + // // onCancel: () {
  986 + // // showDateSelWidget = false;
  987 + // // });
  988 + // // })
  989 + // // ],
  990 + // // )
  991 + // // : SizedBox(),
  992 + // weekly
  993 + // ? _select(weekShow, '', () async {
  994 + // FocusScope.of(context)
  995 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  996 + // //弹出时间选择器
  997 + // // showPickerDateTime(context);
  998 + // showDateSelWidget = false;
969 999
970 - List<FilterBtnModel> data =  
971 - await DialogUtil.openWeekSelectModalBottomSheet(  
972 - context, weekData!);  
973 - if (data != null) {  
974 - //改变了  
975 - weekData = [];  
976 - weekData!.addAll(data);  
977 - weekShow = ''; 1000 + // List<FilterBtnModel> data =
  1001 + // await DialogUtil.openWeekSelectModalBottomSheet(
  1002 + // context, weekData!);
  1003 + // if (data != null) {
  1004 + // //改变了
  1005 + // weekData = [];
  1006 + // weekData!.addAll(data);
  1007 + // weekShow = '';
978 1008
979 - weekData!.forEach((element) {  
980 - if (element.select!) {  
981 - weekShow += '${element.title} ';  
982 - }  
983 - });  
984 - if (weekShow.endsWith(' ')) {  
985 - weekShow =  
986 - weekShow.substring(0, weekShow.length - 1);  
987 - }  
988 - if (weekShow == '') {  
989 - weekShow = '点击设置可用日期';  
990 - } 1009 + // weekData!.forEach((element) {
  1010 + // if (element.select!) {
  1011 + // weekShow += '${element.title} ';
  1012 + // }
  1013 + // });
  1014 + // if (weekShow.endsWith(' ')) {
  1015 + // weekShow =
  1016 + // weekShow.substring(0, weekShow.length - 1);
  1017 + // }
  1018 + // if (weekShow == '') {
  1019 + // weekShow = '点击设置可用日期';
  1020 + // }
991 1021
992 - setState(() {});  
993 - }  
994 - })  
995 - : SizedBox(),  
996 - VEmptyView(24),  
997 - MyDivider(  
998 - double.infinity,  
999 - w(1),  
1000 - color: MyColours.color_E7E7E7,  
1001 - ),  
1002 - VEmptyView(48),  
1003 - Container(  
1004 - alignment: Alignment.centerLeft,  
1005 - child: Text(  
1006 - '有效期:',  
1007 - style: TextStyle(  
1008 - color: MyColours.color_515151,  
1009 - fontSize: ScreenUtil().setSp(32)),  
1010 - ),  
1011 - ),  
1012 - VEmptyView(24),  
1013 - _selectTime('有效期从', fromDate, () {  
1014 - FocusScope.of(context)  
1015 - .requestFocus(FocusNode()); //点击空白处隐藏键盘  
1016 - //弹出时间选择器  
1017 - // showPickerDateTime(context);  
1018 - showDateSelWidget = true;  
1019 - DialogUtil.showPickerDateTime24(  
1020 - context,  
1021 - scaffoldKey,  
1022 - (value) {  
1023 - // {'text': picker.adapter.text, 'select': selecteds}  
1024 - if (value != null) {  
1025 - setState(() {  
1026 - print(value);  
1027 - fromDate = DateUtil.formatDateStr(value,  
1028 - format: DateFormats.y_mo_d);  
1029 - });  
1030 - }  
1031 - showDateSelWidget = false;  
1032 - },  
1033 - dateTime:fromDate == '点击设置开始日期' ? null: DateUtil.getDateTime(fromDate),  
1034 - pickerDateTimeType: PickerDateTimeType.kYMD,  
1035 - onCancel: () {  
1036 - showDateSelWidget = false;  
1037 - });  
1038 - }), 1022 + // setState(() {});
  1023 + // }
  1024 + // })
  1025 + // : SizedBox(),
  1026 + // VEmptyView(24),
  1027 + // MyDivider(
  1028 + // double.infinity,
  1029 + // w(1),
  1030 + // color: MyColours.color_E7E7E7,
  1031 + // ),
  1032 + // VEmptyView(48),
1039 // Container( 1033 // Container(
1040 - // height: ScreenUtil().setWidth(2), 1034 + // alignment: Alignment.centerLeft,
  1035 + // child: Text(
  1036 + // '有效期:',
  1037 + // style: TextStyle(
  1038 + // color: MyColours.color_515151,
  1039 + // fontSize: ScreenUtil().setSp(32)),
  1040 + // ),
  1041 + // ),
  1042 + // VEmptyView(24),
  1043 + // _selectTime('有效期从', fromDate, () {
  1044 + // FocusScope.of(context)
  1045 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  1046 + // //弹出时间选择器
  1047 + // // showPickerDateTime(context);
  1048 + // showDateSelWidget = true;
  1049 + // DialogUtil.showPickerDateTime24(
  1050 + // context,
  1051 + // scaffoldKey,
  1052 + // (value) {
  1053 + // // {'text': picker.adapter.text, 'select': selecteds}
  1054 + // if (value != null) {
  1055 + // setState(() {
  1056 + // print(value);
  1057 + // fromDate = DateUtil.formatDateStr(value,
  1058 + // format: DateFormats.y_mo_d);
  1059 + // });
  1060 + // }
  1061 + // showDateSelWidget = false;
  1062 + // },
  1063 + // dateTime: fromDate == '点击设置开始日期'
  1064 + // ? null
  1065 + // : DateUtil.getDateTime(fromDate),
  1066 + // pickerDateTimeType: PickerDateTimeType.kYMD,
  1067 + // onCancel: () {
  1068 + // showDateSelWidget = false;
  1069 + // });
  1070 + // }),
  1071 + // // Container(
  1072 + // // height: ScreenUtil().setWidth(2),
  1073 + // // color: MyColours.color_E7E7E7,
  1074 + // // ),
  1075 + // VEmptyView(24),
  1076 + // _selectTime('有效期至', endDate, () {
  1077 + // FocusScope.of(context)
  1078 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  1079 + // //弹出时间选择器
  1080 + // // showPickerDateTime(context);
  1081 + // showDateSelWidget = true;
  1082 + // DialogUtil.showPickerDateTime24(
  1083 + // context,
  1084 + // scaffoldKey,
  1085 + // (value) {
  1086 + // // {'text': picker.adapter.text, 'select': selecteds}
  1087 + // if (value != null) {
  1088 + // setState(() {
  1089 + // print(value);
  1090 + // endDate = DateUtil.formatDateStr(value,
  1091 + // format: DateFormats.y_mo_d);
  1092 + // });
  1093 + // }
  1094 + // showDateSelWidget = false;
  1095 + // },
  1096 + // dateTime: endDate == '点击设置结束日期'
  1097 + // ? null
  1098 + // : DateUtil.getDateTime(endDate),
  1099 + // pickerDateTimeType: PickerDateTimeType.kYMD,
  1100 + // onCancel: () {
  1101 + // showDateSelWidget = false;
  1102 + // });
  1103 + // }),
  1104 + // VEmptyView(24),
  1105 + // MyDivider(
  1106 + // double.infinity,
  1107 + // w(1),
1041 // color: MyColours.color_E7E7E7, 1108 // color: MyColours.color_E7E7E7,
1042 // ), 1109 // ),
1043 - VEmptyView(24),  
1044 - _selectTime('有效期至', endDate, () {  
1045 - FocusScope.of(context)  
1046 - .requestFocus(FocusNode()); //点击空白处隐藏键盘  
1047 - //弹出时间选择器  
1048 - // showPickerDateTime(context);  
1049 - showDateSelWidget = true;  
1050 - DialogUtil.showPickerDateTime24(  
1051 - context,  
1052 - scaffoldKey,  
1053 - (value) {  
1054 - // {'text': picker.adapter.text, 'select': selecteds}  
1055 - if (value != null) {  
1056 - setState(() {  
1057 - print(value);  
1058 - endDate = DateUtil.formatDateStr(value,  
1059 - format: DateFormats.y_mo_d);  
1060 - });  
1061 - }  
1062 - showDateSelWidget = false;  
1063 - },  
1064 - dateTime:endDate =='点击设置结束日期'?null: DateUtil.getDateTime(endDate),  
1065 - pickerDateTimeType: PickerDateTimeType.kYMD,  
1066 - onCancel: () {  
1067 - showDateSelWidget = false;  
1068 - });  
1069 - }),  
1070 - VEmptyView(24),  
1071 - MyDivider(  
1072 - double.infinity,  
1073 - w(1),  
1074 - color: MyColours.color_E7E7E7,  
1075 - ),  
1076 - VEmptyView(48), 1110 + // VEmptyView(48),
1077 _explain('备注', '请输入备注信息', remarkC, remarkF), 1111 _explain('备注', '请输入备注信息', remarkC, remarkF),
1078 - VEmptyView(72), 1112 + VEmptyView(72),
1079 _canUse('立即启用', canUse, () { 1113 _canUse('立即启用', canUse, () {
1080 setState(() { 1114 setState(() {
1081 canUse = !canUse; 1115 canUse = !canUse;
@@ -1233,8 +1267,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { @@ -1233,8 +1267,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> {
1233 pramas['id'] = widget.idstr; 1267 pramas['id'] = widget.idstr;
1234 } 1268 }
1235 1269
1236 - bool success = await marketingCenterProvider!.createNewRecharge(  
1237 - context, pramas); 1270 + bool success = await marketingCenterProvider!
  1271 + .createNewRecharge(context, pramas);
1238 1272
1239 if (success) { 1273 if (success) {
1240 //成功后返回前面列表 1274 //成功后返回前面列表
  1 +
  2 +// import 'dart:convert';
  3 +
  4 +// import 'package:common_utils/common_utils.dart';
  5 +// import 'package:flutter/material.dart';
  6 +// import 'package:flutter/services.dart';
  7 +// import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
  8 +// import 'package:flutter_picker_plus/flutter_picker_plus.dart';
  9 +// import 'package:flutter_screenutil/flutter_screenutil.dart';
  10 +// import 'package:one_key/models/coupon_model.dart';
  11 +// import 'package:one_key/models/filter_btn_model.dart';
  12 +// import 'package:one_key/provider/user_model.dart';
  13 +// import 'package:one_key/route/navigator_util.dart';
  14 +// import 'package:one_key/widgets/MyDivider.dart';
  15 +// import 'package:one_key/widgets/system_app_bar.dart';
  16 +// import 'package:provider/provider.dart';
  17 +
  18 +// import '../../../../provider/marketing_center_provider.dart';
  19 +// import '../../../../res/colors.dart';
  20 +// import '../../../../utils/dialog_util.dart';
  21 +// import '../../../../utils/event_bus.dart';
  22 +// import '../../../../utils/screen_util.dart';
  23 +// import '../../../../utils/utils.dart';
  24 +// import '../../../../widgets/h_empty_view.dart';
  25 +// import '../../../../widgets/round_button.dart';
  26 +// import '../../../../widgets/v_empty_view.dart';
  27 +
  28 +// /**
  29 +// *
  30 +// * 新建优惠券
  31 +// */
  32 +
  33 +// class RechargeEditPage extends StatefulWidget {
  34 +// final String? idstr;
  35 +// RechargeEditPage({Key? key, this.idstr}) : super(key: key);
  36 +
  37 +// @override
  38 +// _RechargeEditPageState createState() => _RechargeEditPageState();
  39 +// }
  40 +
  41 +// class _RechargeEditPageState extends State<RechargeEditPage> {
  42 +// TextEditingController nameC = TextEditingController();
  43 +// TextEditingController priceminC = TextEditingController();
  44 +// TextEditingController givePriceC = TextEditingController(); //赠送金额
  45 +// TextEditingController giveScoreC = TextEditingController(); //积分
  46 +// TextEditingController remarkC = TextEditingController(); //备注
  47 +
  48 +// FocusNode nameF = FocusNode();
  49 +// FocusNode priceminF = FocusNode();
  50 +// FocusNode givePricF = FocusNode();
  51 +// FocusNode giveScoreF = FocusNode();
  52 +// FocusNode remarkF = FocusNode();
  53 +// bool fixdate = true;
  54 +// bool weekly = false;
  55 +// bool birthday = false;
  56 +// final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
  57 +
  58 +// bool showDateSelWidget = false;
  59 +// String fromDate = '点击设置开始日期'; //有效期开始时间
  60 +// String endDate = '点击设置结束日期'; //有效期结束时间
  61 +
  62 +// List<FilterBtnModel>? weekData = [];
  63 +
  64 +// String weekShow = '点击设置可用日期';
  65 +// bool canUse = true;
  66 +// List<dynamic>? coupons = [];
  67 +
  68 +// List<dynamic>? selectIDs = [];
  69 +
  70 +// bool givePriceSwich = false;
  71 +// bool giveScoreSwich = false;
  72 +// bool giveCouponsSwich = false;
  73 +
  74 +// List<CouponSunModel>? couponsData = [];
  75 +
  76 +// MarketingCenterProvider? marketingCenterProvider;
  77 +
  78 +// @override
  79 +// void initState() {
  80 +// super.initState();
  81 +
  82 +// _initWeekData();
  83 +
  84 +// nameF.addListener(() {
  85 +// if (nameF.hasFocus) {
  86 +// //有焦点
  87 +// if (showDateSelWidget) {
  88 +// if (Navigator.canPop(context)) {
  89 +// Navigator.pop(context);
  90 +// }
  91 +// showDateSelWidget = false;
  92 +// }
  93 +// } else {
  94 +// //失去焦点
  95 +// // _editingController.text = '';
  96 +// }
  97 +// });
  98 +// priceminF.addListener(() {
  99 +// if (priceminF.hasFocus) {
  100 +// //有焦点
  101 +// if (showDateSelWidget) {
  102 +// if (Navigator.canPop(context)) {
  103 +// Navigator.pop(context);
  104 +// }
  105 +// showDateSelWidget = false;
  106 +// }
  107 +// } else {
  108 +// //失去焦点
  109 +// // _editingController.text = '';
  110 +// }
  111 +// });
  112 +// givePricF.addListener(() {
  113 +// if (givePricF.hasFocus) {
  114 +// //有焦点
  115 +// if (showDateSelWidget) {
  116 +// if (Navigator.canPop(context)) {
  117 +// Navigator.pop(context);
  118 +// }
  119 +// showDateSelWidget = false;
  120 +// }
  121 +// } else {
  122 +// //失去焦点
  123 +// // _editingController.text = '';
  124 +// }
  125 +// });
  126 +// giveScoreF.addListener(() {
  127 +// if (giveScoreF.hasFocus) {
  128 +// //有焦点
  129 +// if (showDateSelWidget) {
  130 +// if (Navigator.canPop(context)) {
  131 +// Navigator.pop(context);
  132 +// }
  133 +// showDateSelWidget = false;
  134 +// }
  135 +// } else {
  136 +// //失去焦点
  137 +// // _editingController.text = '';
  138 +// }
  139 +// });
  140 +// remarkF.addListener(() {
  141 +// if (remarkF.hasFocus) {
  142 +// //有焦点
  143 +// if (showDateSelWidget) {
  144 +// if (Navigator.canPop(context)) {
  145 +// Navigator.pop(context);
  146 +// }
  147 +// showDateSelWidget = false;
  148 +// }
  149 +// } else {
  150 +// //失去焦点
  151 +// // _editingController.text = '';
  152 +// }
  153 +// });
  154 +
  155 +// WidgetsBinding.instance.addPostFrameCallback((_) {
  156 +// if (widget.idstr != null && widget.idstr != 'null') {
  157 +// _getNewRechargeDetail();
  158 +// }
  159 +// });
  160 +// }
  161 +
  162 +// _getNewRechargeDetail() async {
  163 +// bool success = await marketingCenterProvider!.getNewRechargeDetail(
  164 +// context, widget.idstr);
  165 +// if (success) {
  166 +// //请求成功
  167 +// nameC.text = marketingCenterProvider!.rechargeDetail!.rname??"";
  168 +// priceminC.text = marketingCenterProvider!.rechargeDetail!.rechargeMoney??"";
  169 +// givePriceSwich =
  170 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.isPrice == '1'
  171 +// ? true
  172 +// : false;
  173 +// givePriceC.text =
  174 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.price!;
  175 +// giveScoreSwich =
  176 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.isScore == '1'
  177 +// ? true
  178 +// : false;
  179 +// giveScoreC.text =
  180 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.score!;
  181 +// giveCouponsSwich =
  182 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.isCoupons == '1'
  183 +// ? true
  184 +// : false;
  185 +// selectIDs =
  186 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsIds;
  187 +
  188 +// couponsData = marketingCenterProvider!.rechargeDetail!.rechargeList!.coupons;
  189 +// coupons =
  190 +// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsNames;
  191 +// fixdate = marketingCenterProvider!.rechargeDetail!.expDate!.isFix == '1'
  192 +// ? true
  193 +// : false;
  194 +// // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') {
  195 +// fromDate = marketingCenterProvider!.rechargeDetail!.stimeStr;
  196 +// // }
  197 +// // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') {
  198 +// endDate = marketingCenterProvider!.rechargeDetail!.etimeStr;
  199 +// // }
  200 +
  201 +// weekly = marketingCenterProvider!.rechargeDetail!.expDate!.isWeek == '1'
  202 +// ? true
  203 +// : false;
  204 +// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow != '') {
  205 +// weekShow = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow!;
  206 +// }
  207 +
  208 +// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData!.length >
  209 +// 0) {
  210 +// weekData = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData;
  211 +// }
  212 +
  213 +// birthday =
  214 +// marketingCenterProvider!.rechargeDetail!.expDate!.isBirthday == '1'
  215 +// ? true
  216 +// : false;
  217 +
  218 +// remarkC.text = marketingCenterProvider!.rechargeDetail!.explain??"";
  219 +// canUse =
  220 +// marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? true : false;
  221 +// setState(() {});
  222 +// }
  223 +// }
  224 +
  225 +// _initWeekData() {
  226 +// FilterBtnModel filterBtnModel = FilterBtnModel();
  227 +// filterBtnModel.select = false;
  228 +// filterBtnModel.title = '周日';
  229 +// weekData!.add(filterBtnModel);
  230 +// for (int i = 1; i < 7; i++) {
  231 +// FilterBtnModel filterBtnModel = FilterBtnModel();
  232 +// filterBtnModel.select = false;
  233 +// filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
  234 +// weekData!.add(filterBtnModel);
  235 +// }
  236 +// }
  237 +
  238 +// ///输入框
  239 +// Widget _textfield(String title, String hintText,
  240 +// TextEditingController controller, FocusNode node,
  241 +// {TextInputType textInputStyle = TextInputType.text}) {
  242 +// return Container(
  243 +// child: Row(
  244 +// mainAxisAlignment: MainAxisAlignment.spaceBetween,
  245 +// children: [
  246 +// Container(
  247 +// child: Text(
  248 +// title,
  249 +// style: TextStyle(
  250 +// color: MyColours.color_515151,
  251 +// fontSize: ScreenUtil().setSp(32)),
  252 +// ),
  253 +// ),
  254 +// HEmptyView(80),
  255 +// Expanded(
  256 +// child: TextField(
  257 +// controller: controller,
  258 +// focusNode: node,
  259 +// textAlign: TextAlign.right,
  260 +// textAlignVertical: TextAlignVertical.bottom,
  261 +// maxLines: 1,
  262 +// // //光标颜色
  263 +// // cursorColor:
  264 +// // widget.isSelect ? Colors.white : MyColours.color_199095,
  265 +// //输入文本的样式
  266 +
  267 +// inputFormatters:
  268 +// title == '活动名称' ? [LengthLimitingTextInputFormatter(15)] : [],
  269 +// style: TextStyle(
  270 +// color: MyColours.color_515151,
  271 +// fontSize: ScreenUtil().setSp(32),
  272 +// ),
  273 +// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
  274 +// decoration: InputDecoration(
  275 +// border: OutlineInputBorder(borderSide: BorderSide.none),
  276 +// hintText: hintText,
  277 +// hintStyle: TextStyle(
  278 +// color: MyColours.color_999999,
  279 +// fontSize: ScreenUtil().setSp(32),
  280 +// ),
  281 +// enabledBorder: new UnderlineInputBorder(
  282 +// borderSide: BorderSide.none,
  283 +// ),
  284 +// focusedBorder: new UnderlineInputBorder(
  285 +// borderSide: BorderSide.none,
  286 +// ),
  287 +// ),
  288 +// onChanged: (value) {},
  289 +// onEditingComplete: () {
  290 +// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  291 +// },
  292 +// keyboardType: textInputStyle,
  293 +// ),
  294 +// ),
  295 +// HEmptyView(32)
  296 +// ],
  297 +// ),
  298 +// );
  299 +// }
  300 +
  301 +// ///时间选择
  302 +// Widget _selectTime(String title, String hintText, GestureTapCallback onTap) {
  303 +// return InkWell(
  304 +// onTap: onTap,
  305 +// child: Container(
  306 +// // padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
  307 +// child: Row(
  308 +// crossAxisAlignment: CrossAxisAlignment.center,
  309 +// mainAxisAlignment: MainAxisAlignment.center,
  310 +// children: [
  311 +// Container(
  312 +// // height: ScreenUtil().setWidth(40),
  313 +// // color: Colors.red,
  314 +// child: Text(
  315 +// title,
  316 +// style: TextStyle(
  317 +// color: title == '点击设置可用日期'
  318 +// ? MyColours.color_438E93
  319 +// : MyColours.color_515151,
  320 +// fontSize: ScreenUtil().setSp(32)),
  321 +// ),
  322 +// ),
  323 +// HEmptyView(20),
  324 +// Spacer(),
  325 +// Text(hintText,
  326 +// style: TextStyle(
  327 +// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
  328 +// ? MyColours.color_438E93
  329 +// : MyColours.color_515151,
  330 +// fontSize: ScreenUtil().setSp(32),
  331 +// )),
  332 +// HEmptyView(20),
  333 +// Image.asset(
  334 +// Utils.getImgPath('arrow_right_new'),
  335 +// width: ScreenUtil().setWidth(20),
  336 +// ),
  337 +// HEmptyView(32),
  338 +// ],
  339 +// ),
  340 +// ),
  341 +// );
  342 +// }
  343 +
  344 +// ///时间选择
  345 +// Widget _select(String title, String hintText, GestureTapCallback onTap) {
  346 +// return InkWell(
  347 +// onTap: onTap,
  348 +// child: Container(
  349 +// padding: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
  350 +// child: Row(
  351 +// crossAxisAlignment: CrossAxisAlignment.center,
  352 +// mainAxisAlignment: MainAxisAlignment.center,
  353 +// children: [
  354 +// Container(
  355 +// // height: ScreenUtil().setWidth(40),
  356 +// // color: Colors.red,
  357 +// child: Text(
  358 +// title,
  359 +// style: TextStyle(
  360 +// color: title == '点击设置可用日期'
  361 +// ? MyColours.color_999999
  362 +// : MyColours.color_515151,
  363 +// fontSize: ScreenUtil().setSp(32)),
  364 +// ),
  365 +// ),
  366 +// HEmptyView(20),
  367 +// Spacer(),
  368 +// Text(hintText,
  369 +// style: TextStyle(
  370 +// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
  371 +// ? MyColours.color_999999
  372 +// : MyColours.color_515151,
  373 +// fontSize: ScreenUtil().setSp(32),
  374 +// )),
  375 +// HEmptyView(20),
  376 +// Image.asset(
  377 +// Utils.getImgPath('arrow_right_new'),
  378 +// width: ScreenUtil().setWidth(18),
  379 +// ),
  380 +// HEmptyView(32),
  381 +// ],
  382 +// ),
  383 +// ),
  384 +// );
  385 +// }
  386 +
  387 +// ///券说明
  388 +// Widget _explain(String title, String hintText,
  389 +// TextEditingController controller, FocusNode node) {
  390 +// return Container(
  391 +// // height: ScreenUtil().setWidth(380),
  392 +// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
  393 +// child: Column(
  394 +// crossAxisAlignment: CrossAxisAlignment.start,
  395 +// children: [
  396 +// Align(
  397 +// alignment: Alignment.centerLeft,
  398 +// child: Text(
  399 +// title,
  400 +// textAlign: TextAlign.left,
  401 +// style: TextStyle(
  402 +// color: MyColours.color_515151,
  403 +// fontSize: ScreenUtil().setSp(32)),
  404 +// )),
  405 +// VEmptyView(26),
  406 +// Container(
  407 +// height: ScreenUtil().setWidth(2),
  408 +// color: MyColours.color_E7E7E7,
  409 +// ),
  410 +// TextField(
  411 +// controller: controller,
  412 +// focusNode: node,
  413 +// // keyboardType: TextInputType.numberWithOptions(decimal: true), //键盘类型,数字键盘
  414 +// maxLines: 3,
  415 +// maxLength: 150,
  416 +
  417 +// // maxLengthEnforced: true,
  418 +// style: TextStyle(
  419 +// fontSize: ScreenUtil().setSp(32),
  420 +// color: MyColours.color_333333), //输入文本的样式
  421 +// decoration: InputDecoration(
  422 +// contentPadding:
  423 +// EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(30)),
  424 +// hintText: hintText,
  425 +// hintStyle: TextStyle(
  426 +// color: MyColours.color_999999,
  427 +// fontSize: ScreenUtil().setSp(32),
  428 +// ),
  429 +
  430 +// border: OutlineInputBorder(borderSide: BorderSide.none),
  431 +
  432 +// enabledBorder: new UnderlineInputBorder(
  433 +// borderSide: BorderSide.none,
  434 +// ),
  435 +// focusedBorder: new UnderlineInputBorder(
  436 +// borderSide: BorderSide.none,
  437 +// ),
  438 +
  439 +// // fillColor: MyColours.color_F9F9F9,
  440 +// // // fillColor: Colors.red,
  441 +// // filled: true,
  442 +// // enabledBorder: OutlineInputBorder(
  443 +// // //未选中时候的颜色
  444 +// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
  445 +// // borderSide: BorderSide(
  446 +// // color: MyColours.color_cccccc,
  447 +// // width: ScreenUtil().setWidth(2)),
  448 +// // ),
  449 +// // focusedBorder: OutlineInputBorder(
  450 +// // //选中时外边框颜色
  451 +// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
  452 +// // borderSide: BorderSide(
  453 +// // color: MyColours.app_main,
  454 +// // ),
  455 +// // ),
  456 +// // border: OutlineInputBorder(
  457 +// // borderRadius:
  458 +// // BorderRadius.circular(ScreenUtil().setWidth(20)),
  459 +// // borderSide: BorderSide(
  460 +// // color: Colors.red, width: ScreenUtil().setWidth(2))),
  461 +// ),
  462 +// onChanged: (value) {},
  463 +// ),
  464 +// ],
  465 +// ),
  466 +// );
  467 +// }
  468 +
  469 +// _itemRadioWidget(bool select, String title, {GestureTapCallback? onTap}) {
  470 +// return InkWell(
  471 +// onTap: onTap,
  472 +// child: Row(children: [
  473 +// Image.asset(
  474 +// Utils.getImgPath(
  475 +// select ? 'plan_dish_select' : 'plan_dish_unselect'),
  476 +// width: w(20),
  477 +// ),
  478 +// HEmptyView(6),
  479 +// Text(
  480 +// title,
  481 +// style: TextStyle(
  482 +// color: MyColours.color_515151,
  483 +// fontSize: ScreenUtil().setSp(32)),
  484 +// ),
  485 +// ]));
  486 +// }
  487 +
  488 +// ///是否立即启用
  489 +// Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
  490 +// return InkWell(
  491 +// onTap: onTap,
  492 +// child: Container(
  493 +// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
  494 +// margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
  495 +// child: Row(
  496 +// crossAxisAlignment: CrossAxisAlignment.center,
  497 +// mainAxisAlignment: MainAxisAlignment.center,
  498 +// children: [
  499 +// Container(
  500 +// // height: ScreenUtil().setWidth(40),
  501 +// // color: Colors.red,
  502 +// child: Text(
  503 +// title,
  504 +// style: TextStyle(
  505 +// color: MyColours.color_515151,
  506 +// fontSize: ScreenUtil().setSp(32)),
  507 +// ),
  508 +// ),
  509 +// Spacer(),
  510 +// Image.asset(
  511 +// swich
  512 +// ? Utils.getImgPath('swich_on')
  513 +// : Utils.getImgPath('swich_off'),
  514 +// width: ScreenUtil().setWidth(44 * 2),
  515 +// )
  516 +// ],
  517 +// ),
  518 +// ),
  519 +// );
  520 +// }
  521 +
  522 +// @override
  523 +// Widget build(BuildContext context) {
  524 +// marketingCenterProvider =
  525 +// Provider.of<MarketingCenterProvider>(context, listen: true);
  526 +// return KeyboardDismissOnTap(
  527 +// child: Scaffold(
  528 +// key: scaffoldKey,
  529 +// backgroundColor: MyColours.color_ffffff,
  530 +// appBar: SystemAppBar(
  531 +// '充值优惠详情',
  532 +// rightImgName: marketingCenterProvider != null &&
  533 +// marketingCenterProvider!.rechargeDetail != null &&
  534 +// widget.idstr != null &&
  535 +// widget.idstr != 'null' &&
  536 +// marketingCenterProvider!.rechargeDetail!.isOpen == '1'
  537 +// ? 'share.png'
  538 +// : '',
  539 +// onTapRight: () {
  540 +// if (widget.idstr != null &&
  541 +// widget.idstr != 'null' &&
  542 +// marketingCenterProvider!.rechargeDetail!.isOpen == '1') {
  543 +// Utils.goShareBuyRechargeToWeChat(
  544 +// context, widget.idstr, marketingCenterProvider!.rechargeDetail!);
  545 +// }
  546 +// },
  547 +// ),
  548 +// body: Column(
  549 +// children: [
  550 +// Expanded(
  551 +// child: SingleChildScrollView(
  552 +// child: Padding(
  553 +// padding: EdgeInsets.only(left: w(32)),
  554 +// child: Column(
  555 +// children: [
  556 +// _textfield('活动名称', '点击输入活动名称', nameC, nameF),
  557 +// MyDivider(
  558 +// double.infinity,
  559 +// w(1),
  560 +// color: MyColours.color_E7E7E7,
  561 +// ),
  562 +// VEmptyView(24),
  563 +// _textfield('充值满', '点击输入充值金额门槛', priceminC, priceminF,
  564 +// textInputStyle:
  565 +// TextInputType.numberWithOptions(decimal: true)),
  566 +// MyDivider(
  567 +// double.infinity,
  568 +// w(1),
  569 +// color: MyColours.color_E7E7E7,
  570 +// ),
  571 +// VEmptyView(48),
  572 +// Container(
  573 +// alignment: Alignment.centerLeft,
  574 +// child: Text(
  575 +// '优惠活动',
  576 +// style: TextStyle(
  577 +// color: MyColours.color_515151,
  578 +// fontSize: ScreenUtil().setSp(32)),
  579 +// ),
  580 +// ),
  581 +// VEmptyView(26),
  582 +// Column(
  583 +// crossAxisAlignment: CrossAxisAlignment.start,
  584 +// children: [
  585 +// Row(
  586 +// children: [
  587 +// InkWell(
  588 +// onTap: () {
  589 +// setState(() {
  590 +// givePriceSwich = !givePriceSwich;
  591 +// });
  592 +// },
  593 +// child: Padding(
  594 +// padding: EdgeInsets.only(
  595 +// left: w(16),
  596 +// right: w(8),
  597 +// ),
  598 +// child: Image.asset(
  599 +// Utils.getImgPath(givePriceSwich
  600 +// ? 'f_select'
  601 +// : 'f_select_not'),
  602 +// width: w(20),
  603 +// ),
  604 +// ),
  605 +// ),
  606 +// Text(
  607 +// '赠送',
  608 +// style: TextStyle(
  609 +// color: MyColours.color_515151,
  610 +// fontSize: ScreenUtil().setSp(32)),
  611 +// ),
  612 +// HEmptyView(16),
  613 +// Container(
  614 +// width: w(140),
  615 +// height: w(28),
  616 +// alignment: Alignment.center,
  617 +// decoration: BoxDecoration(
  618 +// border: Border.all(
  619 +// width: w(1),
  620 +// color: MyColours.color_DBDBDB)),
  621 +// child: TextField(
  622 +// controller: givePriceC,
  623 +// focusNode: givePricF,
  624 +// textAlign: TextAlign.center,
  625 +// // textAlignVertical: TextAlignVertical.bottom,
  626 +// maxLines: 1,
  627 +
  628 +// // //光标颜色
  629 +// // cursorColor:
  630 +// // widget.isSelect ? Colors.white : MyColours.color_199095,
  631 +// //输入文本的样式
  632 +// style: TextStyle(
  633 +// color: MyColours.color_515151,
  634 +// fontSize: ScreenUtil().setSp(32),
  635 +// ),
  636 +// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
  637 +// decoration: InputDecoration(
  638 +// isCollapsed:
  639 +// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  640 +// border: OutlineInputBorder(
  641 +// borderSide: BorderSide.none),
  642 +// hintText: '',
  643 +// hintStyle: TextStyle(
  644 +// color: MyColours.color_999999,
  645 +// fontSize: ScreenUtil().setSp(32),
  646 +// ),
  647 +// enabledBorder: new UnderlineInputBorder(
  648 +// borderSide: BorderSide.none,
  649 +// ),
  650 +// contentPadding: EdgeInsets.zero,
  651 +// focusedBorder: new UnderlineInputBorder(
  652 +// borderSide: BorderSide.none,
  653 +// ),
  654 +// ),
  655 +// onChanged: (value) {},
  656 +// onEditingComplete: () {
  657 +// FocusScope.of(context)
  658 +// .requestFocus(FocusNode()); //点击空白处隐藏键盘
  659 +// },
  660 +// keyboardType: TextInputType.numberWithOptions(
  661 +// decimal: true),
  662 +// ),
  663 +// ),
  664 +// HEmptyView(16),
  665 +// Text(
  666 +// '元余额',
  667 +// style: TextStyle(
  668 +// color: MyColours.color_515151,
  669 +// fontSize: ScreenUtil().setSp(32)),
  670 +// ),
  671 +// ],
  672 +// ),
  673 +// VEmptyView(20),
  674 +// Row(
  675 +// children: [
  676 +// InkWell(
  677 +// onTap: () {
  678 +// setState(() {
  679 +// giveScoreSwich = !giveScoreSwich;
  680 +// });
  681 +// },
  682 +// child: Padding(
  683 +// padding: EdgeInsets.only(
  684 +// left: w(16),
  685 +// right: w(8),
  686 +// ),
  687 +// child: Image.asset(
  688 +// Utils.getImgPath(giveScoreSwich
  689 +// ? 'f_select'
  690 +// : 'f_select_not'),
  691 +// width: w(20),
  692 +// ),
  693 +// ),
  694 +// ),
  695 +// Text(
  696 +// '赠送',
  697 +// style: TextStyle(
  698 +// color: MyColours.color_515151,
  699 +// fontSize: ScreenUtil().setSp(32)),
  700 +// ),
  701 +// HEmptyView(16),
  702 +// Container(
  703 +// width: w(140),
  704 +// height: w(28),
  705 +// alignment: Alignment.center,
  706 +// decoration: BoxDecoration(
  707 +// border: Border.all(
  708 +// width: w(1),
  709 +// color: MyColours.color_DBDBDB)),
  710 +// child: TextField(
  711 +// controller: giveScoreC,
  712 +// focusNode: giveScoreF,
  713 +// textAlign: TextAlign.center,
  714 +// // textAlignVertical: TextAlignVertical.bottom,
  715 +// maxLines: 1,
  716 +
  717 +// // //光标颜色
  718 +// // cursorColor:
  719 +// // widget.isSelect ? Colors.white : MyColours.color_199095,
  720 +// //输入文本的样式
  721 +// style: TextStyle(
  722 +// color: MyColours.color_515151,
  723 +// fontSize: ScreenUtil().setSp(32),
  724 +// ),
  725 +// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
  726 +// decoration: InputDecoration(
  727 +// isCollapsed:
  728 +// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  729 +// border: OutlineInputBorder(
  730 +// borderSide: BorderSide.none),
  731 +// hintText: '',
  732 +// hintStyle: TextStyle(
  733 +// color: MyColours.color_999999,
  734 +// fontSize: ScreenUtil().setSp(32),
  735 +// ),
  736 +// enabledBorder: new UnderlineInputBorder(
  737 +// borderSide: BorderSide.none,
  738 +// ),
  739 +// contentPadding: EdgeInsets.zero,
  740 +// focusedBorder: new UnderlineInputBorder(
  741 +// borderSide: BorderSide.none,
  742 +// ),
  743 +// ),
  744 +// onChanged: (value) {},
  745 +// onEditingComplete: () {
  746 +// FocusScope.of(context)
  747 +// .requestFocus(FocusNode()); //点击空白处隐藏键盘
  748 +// },
  749 +// keyboardType: TextInputType.numberWithOptions(
  750 +// decimal: true),
  751 +// ),
  752 +// ),
  753 +// HEmptyView(16),
  754 +// Text(
  755 +// '积分',
  756 +// style: TextStyle(
  757 +// color: MyColours.color_515151,
  758 +// fontSize: ScreenUtil().setSp(32)),
  759 +// ),
  760 +// ],
  761 +// ),
  762 +// VEmptyView(20),
  763 +// Row(
  764 +// children: [
  765 +// InkWell(
  766 +// onTap: () {
  767 +// setState(() {
  768 +// giveCouponsSwich = !giveCouponsSwich;
  769 +// });
  770 +// },
  771 +// child: Padding(
  772 +// padding: EdgeInsets.only(
  773 +// left: w(16),
  774 +// right: w(8),
  775 +// ),
  776 +// child: Image.asset(
  777 +// Utils.getImgPath(giveCouponsSwich
  778 +// ? 'f_select'
  779 +// : 'f_select_not'),
  780 +// width: w(20),
  781 +// ),
  782 +// ),
  783 +// ),
  784 +// Text(
  785 +// '赠送优惠券',
  786 +// style: TextStyle(
  787 +// color: MyColours.color_515151,
  788 +// fontSize: ScreenUtil().setSp(32)),
  789 +// ),
  790 +// HEmptyView(60),
  791 +// if (giveCouponsSwich)
  792 +// InkWell(
  793 +// onTap: () async {
  794 +// FocusScope.of(context)
  795 +// .requestFocus(FocusNode());
  796 +// Map? object = await NavigatorUtil
  797 +// .goRechargeSelectStoreCouponPage(
  798 +// context, selectIDs!.join(',')) ;
  799 +// print(object);
  800 +// if (object != null &&
  801 +// object['couponsid'] != null) {
  802 +// List<CouponSunModel> data =
  803 +// object['couponsdata'];
  804 +
  805 +// couponsData = [];
  806 +// //
  807 +// selectIDs = object['couponsid'];
  808 +// coupons = [];
  809 +// data.forEach((element) {
  810 +// if (element.isCheck) {
  811 +// coupons!.add(element.aname);
  812 +// couponsData!.add(element);
  813 +// }
  814 +// });
  815 +// setState(() {});
  816 +// }
  817 +// },
  818 +// child: Text(
  819 +// '选择优惠券',
  820 +// style: TextStyle(
  821 +// color: MyColours.color_438E93,
  822 +// fontSize: ScreenUtil().setSp(32)),
  823 +// )),
  824 +// ],
  825 +// ),
  826 +// if (giveCouponsSwich) VEmptyView(20),
  827 +// if (giveCouponsSwich)
  828 +// Padding(
  829 +// padding: EdgeInsets.only(
  830 +// left: w(45),
  831 +// right: w(8),
  832 +// ),
  833 +// child: Wrap(
  834 +// spacing: w(9),
  835 +// runSpacing: w(9),
  836 +// alignment: WrapAlignment.start,
  837 +// runAlignment: WrapAlignment.start,
  838 +// children: coupons!.map((e) {
  839 +// return Text(
  840 +// e,
  841 +// style: TextStyle(
  842 +// color: MyColours.color_515151,
  843 +// fontSize: ScreenUtil().setSp(32)),
  844 +// );
  845 +// }).toList())),
  846 +// VEmptyView(20),
  847 +// ],
  848 +// ),
  849 +// MyDivider(
  850 +// double.infinity,
  851 +// w(1),
  852 +// color: MyColours.color_E7E7E7,
  853 +// ),
  854 +// VEmptyView(48),
  855 +// Container(
  856 +// alignment: Alignment.centerLeft,
  857 +// child: Text(
  858 +// '使用限制:',
  859 +// style: TextStyle(
  860 +// color: MyColours.color_515151,
  861 +// fontSize: ScreenUtil().setSp(32)),
  862 +// ),
  863 +// ),
  864 +// VEmptyView(24),
  865 +// Row(
  866 +// children: [
  867 +// HEmptyView(30),
  868 +// _itemRadioWidget(fixdate, '无', onTap: () {
  869 +// if (!fixdate) {
  870 +// setState(() {
  871 +// fixdate = true;
  872 +// weekly = false;
  873 +// birthday = false;
  874 +// });
  875 +// }
  876 +// }),
  877 +// Spacer(),
  878 +// _itemRadioWidget(weekly, '每周', onTap: () {
  879 +// if (!weekly) {
  880 +// setState(() {
  881 +// weekly = true;
  882 +// fixdate = false;
  883 +// birthday = false;
  884 +// });
  885 +// }
  886 +// }),
  887 +// Spacer(),
  888 +// _itemRadioWidget(birthday, '会员生日当天', onTap: () {
  889 +// if (!birthday) {
  890 +// setState(() {
  891 +// birthday = true;
  892 +// weekly = false;
  893 +// fixdate = false;
  894 +// });
  895 +// }
  896 +// }),
  897 +// HEmptyView(30),
  898 +// ],
  899 +// ),
  900 +// birthday ? SizedBox() : VEmptyView(24),
  901 +// // fixdate
  902 +// // ? Column(
  903 +// // children: [
  904 +// // _select('有效期从', fromDate, () {
  905 +// // FocusScope.of(context)
  906 +// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  907 +// // //弹出时间选择器
  908 +// // // showPickerDateTime(context);
  909 +// // showDateSelWidget = true;
  910 +// // DialogUtil.showPickerDateTime24(
  911 +// // context,
  912 +// // scaffoldKey,
  913 +// // (value) {
  914 +// // // {'text': picker.adapter.text, 'select': selecteds}
  915 +// // if (value != null) {
  916 +// // setState(() {
  917 +// // print(value);
  918 +// // fromDate = DateUtil.formatDateStr(
  919 +// // value,
  920 +// // format: DateFormats.y_mo_d);
  921 +// // });
  922 +// // }
  923 +// // showDateSelWidget = false;
  924 +// // },
  925 +// // dateTime: DateUtil.getDateTime(fromDate),
  926 +// // pickerDateTimeType: PickerDateTimeType.kYMD,
  927 +// // onCancel: () {
  928 +// // showDateSelWidget = false;
  929 +// // });
  930 +// // }),
  931 +// // VEmptyView(24),
  932 +// // _select('有效期至', endDate, () {
  933 +// // FocusScope.of(context)
  934 +// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  935 +// // //弹出时间选择器
  936 +// // // showPickerDateTime(context);
  937 +// // showDateSelWidget = true;
  938 +// // DialogUtil.showPickerDateTime24(
  939 +// // context,
  940 +// // scaffoldKey,
  941 +// // (value) {
  942 +// // // {'text': picker.adapter.text, 'select': selecteds}
  943 +// // if (value != null) {
  944 +// // setState(() {
  945 +// // print(value);
  946 +// // endDate = DateUtil.formatDateStr(
  947 +// // value,
  948 +// // format: DateFormats.y_mo_d);
  949 +// // });
  950 +// // }
  951 +// // showDateSelWidget = false;
  952 +// // },
  953 +// // dateTime: DateUtil.getDateTime(endDate),
  954 +// // pickerDateTimeType: PickerDateTimeType.kYMD,
  955 +// // onCancel: () {
  956 +// // showDateSelWidget = false;
  957 +// // });
  958 +// // })
  959 +// // ],
  960 +// // )
  961 +// // : SizedBox(),
  962 +// weekly
  963 +// ? _select(weekShow, '', () async {
  964 +// FocusScope.of(context)
  965 +// .requestFocus(FocusNode()); //点击空白处隐藏键盘
  966 +// //弹出时间选择器
  967 +// // showPickerDateTime(context);
  968 +// showDateSelWidget = false;
  969 +
  970 +// List<FilterBtnModel> data =
  971 +// await DialogUtil.openWeekSelectModalBottomSheet(
  972 +// context, weekData!);
  973 +// if (data != null) {
  974 +// //改变了
  975 +// weekData = [];
  976 +// weekData!.addAll(data);
  977 +// weekShow = '';
  978 +
  979 +// weekData!.forEach((element) {
  980 +// if (element.select!) {
  981 +// weekShow += '${element.title} ';
  982 +// }
  983 +// });
  984 +// if (weekShow.endsWith(' ')) {
  985 +// weekShow =
  986 +// weekShow.substring(0, weekShow.length - 1);
  987 +// }
  988 +// if (weekShow == '') {
  989 +// weekShow = '点击设置可用日期';
  990 +// }
  991 +
  992 +// setState(() {});
  993 +// }
  994 +// })
  995 +// : SizedBox(),
  996 +// VEmptyView(24),
  997 +// MyDivider(
  998 +// double.infinity,
  999 +// w(1),
  1000 +// color: MyColours.color_E7E7E7,
  1001 +// ),
  1002 +// VEmptyView(48),
  1003 +// Container(
  1004 +// alignment: Alignment.centerLeft,
  1005 +// child: Text(
  1006 +// '有效期:',
  1007 +// style: TextStyle(
  1008 +// color: MyColours.color_515151,
  1009 +// fontSize: ScreenUtil().setSp(32)),
  1010 +// ),
  1011 +// ),
  1012 +// VEmptyView(24),
  1013 +// _selectTime('有效期从', fromDate, () {
  1014 +// FocusScope.of(context)
  1015 +// .requestFocus(FocusNode()); //点击空白处隐藏键盘
  1016 +// //弹出时间选择器
  1017 +// // showPickerDateTime(context);
  1018 +// showDateSelWidget = true;
  1019 +// DialogUtil.showPickerDateTime24(
  1020 +// context,
  1021 +// scaffoldKey,
  1022 +// (value) {
  1023 +// // {'text': picker.adapter.text, 'select': selecteds}
  1024 +// if (value != null) {
  1025 +// setState(() {
  1026 +// print(value);
  1027 +// fromDate = DateUtil.formatDateStr(value,
  1028 +// format: DateFormats.y_mo_d);
  1029 +// });
  1030 +// }
  1031 +// showDateSelWidget = false;
  1032 +// },
  1033 +// dateTime:fromDate == '点击设置开始日期' ? null: DateUtil.getDateTime(fromDate),
  1034 +// pickerDateTimeType: PickerDateTimeType.kYMD,
  1035 +// onCancel: () {
  1036 +// showDateSelWidget = false;
  1037 +// });
  1038 +// }),
  1039 +// // Container(
  1040 +// // height: ScreenUtil().setWidth(2),
  1041 +// // color: MyColours.color_E7E7E7,
  1042 +// // ),
  1043 +// VEmptyView(24),
  1044 +// _selectTime('有效期至', endDate, () {
  1045 +// FocusScope.of(context)
  1046 +// .requestFocus(FocusNode()); //点击空白处隐藏键盘
  1047 +// //弹出时间选择器
  1048 +// // showPickerDateTime(context);
  1049 +// showDateSelWidget = true;
  1050 +// DialogUtil.showPickerDateTime24(
  1051 +// context,
  1052 +// scaffoldKey,
  1053 +// (value) {
  1054 +// // {'text': picker.adapter.text, 'select': selecteds}
  1055 +// if (value != null) {
  1056 +// setState(() {
  1057 +// print(value);
  1058 +// endDate = DateUtil.formatDateStr(value,
  1059 +// format: DateFormats.y_mo_d);
  1060 +// });
  1061 +// }
  1062 +// showDateSelWidget = false;
  1063 +// },
  1064 +// dateTime:endDate =='点击设置结束日期'?null: DateUtil.getDateTime(endDate),
  1065 +// pickerDateTimeType: PickerDateTimeType.kYMD,
  1066 +// onCancel: () {
  1067 +// showDateSelWidget = false;
  1068 +// });
  1069 +// }),
  1070 +// VEmptyView(24),
  1071 +// MyDivider(
  1072 +// double.infinity,
  1073 +// w(1),
  1074 +// color: MyColours.color_E7E7E7,
  1075 +// ),
  1076 +// VEmptyView(48),
  1077 +// _explain('备注', '请输入备注信息', remarkC, remarkF),
  1078 +// VEmptyView(72),
  1079 +// _canUse('立即启用', canUse, () {
  1080 +// setState(() {
  1081 +// canUse = !canUse;
  1082 +// });
  1083 +// })
  1084 +// ],
  1085 +// )),
  1086 +// )),
  1087 +// Container(
  1088 +// height: ScreenUtil().setWidth(91 * 2),
  1089 +// width: double.infinity,
  1090 +// padding: EdgeInsets.only(
  1091 +// top: ScreenUtil().setWidth(16 * 2),
  1092 +// bottom: ScreenUtil().setWidth(35 * 2),
  1093 +// left: ScreenUtil().setWidth(45 * 2),
  1094 +// right: ScreenUtil().setWidth(45 * 2),
  1095 +// ),
  1096 +// decoration: BoxDecoration(
  1097 +// color: MyColours.color_ffffff,
  1098 +// boxShadow: [
  1099 +// BoxShadow(
  1100 +// spreadRadius: ScreenUtil().setWidth(2),
  1101 +// color: Color.fromRGBO(0, 0, 0, 0.1),
  1102 +// offset: Offset(0, ScreenUtil().setWidth(-2)),
  1103 +// blurRadius: ScreenUtil().setWidth(8))
  1104 +// ],
  1105 +// borderRadius: BorderRadius.all(
  1106 +// Radius.circular(ScreenUtil().setWidth(16)),
  1107 +// ),
  1108 +// ),
  1109 +// child: RoundButton(
  1110 +// text: '保存',
  1111 +// height: ScreenUtil().setWidth(80),
  1112 +// radius: ScreenUtil().setWidth(14),
  1113 +// isBold: false,
  1114 +// fontSize: 28,
  1115 +// onPressed: () async {
  1116 +// if (nameC.text.trim().length == 0) {
  1117 +// Utils.showToast('请输入活动名称!');
  1118 +// return;
  1119 +// }
  1120 +// if (priceminC.text.trim().length == 0) {
  1121 +// Utils.showToast('请输入充值门槛金额!');
  1122 +// return;
  1123 +// }
  1124 +// if (!Utils.isNumeric(priceminC.text.trim())) {
  1125 +// Utils.showToast('充值门槛金额请输入数字!');
  1126 +// return;
  1127 +// }
  1128 +// if (double.parse(priceminC.text.trim()) <= 0) {
  1129 +// Utils.showToast('充值门槛金额需大于0!');
  1130 +// return;
  1131 +// }
  1132 +// //优惠活动
  1133 +// if (!giveScoreSwich && !givePriceSwich && !giveCouponsSwich) {
  1134 +// Utils.showToast('请选择优惠活动!');
  1135 +// return;
  1136 +// }
  1137 +// if (givePriceSwich && givePriceC.text.trim().length == 0) {
  1138 +// Utils.showToast('请输入赠送金额!');
  1139 +// return;
  1140 +// }
  1141 +// if (giveScoreSwich && giveScoreC.text.trim().length == 0) {
  1142 +// Utils.showToast('请输入赠送积分!');
  1143 +// return;
  1144 +// }
  1145 +// if (giveCouponsSwich && couponsData!.length == 0) {
  1146 +// Utils.showToast('请选择赠送的优惠券!');
  1147 +// return;
  1148 +// }
  1149 +
  1150 +// //有效期
  1151 +// if (!fixdate && !weekly && !birthday) {
  1152 +// Utils.showToast('请选择有效期!');
  1153 +// return;
  1154 +// }
  1155 +
  1156 +// // if (fixdate) {
  1157 +// //固定时间段
  1158 +
  1159 +// if (fromDate == '点击设置开始日期') {
  1160 +// Utils.showToast('请设置有效期的开始日期!');
  1161 +// return;
  1162 +// }
  1163 +
  1164 +// if (endDate == '点击设置结束日期') {
  1165 +// Utils.showToast('请设置有效期的结束日期!');
  1166 +// return;
  1167 +// }
  1168 +// if (DateUtil.getDateTime(endDate)
  1169 +// .compareTo(DateUtil.getDateTime(fromDate)) <
  1170 +// 0) {
  1171 +// Utils.showToast('有效期结束日期不能早于开始日期!');
  1172 +// return;
  1173 +// }
  1174 +// // }
  1175 +
  1176 +// if (weekly && weekShow == '点击设置可用日期') {
  1177 +// Utils.showToast('请设置可用日期!');
  1178 +// return;
  1179 +// }
  1180 +
  1181 +// String from = fromDate + ' 00:00:00';
  1182 +// String end = endDate + ' 23:59:59';
  1183 +// String stime = fromDate == '点击设置开始日期'
  1184 +// ? ""
  1185 +// : '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}';
  1186 +// String etime = endDate == '点击设置结束日期'
  1187 +// ? ''
  1188 +// : '${(DateUtil.getDateMsByTimeStr(end)! / 1000).floor()}';
  1189 +
  1190 +// Map discounts = {
  1191 +// 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额
  1192 +// 'is_score': giveScoreSwich ? '1' : '0', //赠送积分
  1193 +// 'is_coupons': giveCouponsSwich ? '1' : '0', //赠送优惠券
  1194 +// 'price': givePriceC.text,
  1195 +// 'score': giveScoreC.text,
  1196 +// 'coupons': couponsData,
  1197 +// 'coupons_ids': selectIDs,
  1198 +// 'coupons_names': coupons
  1199 +// };
  1200 +
  1201 +// String discountsStr = json.encode(discounts);
  1202 +// print(discountsStr);
  1203 +
  1204 +// Map date = {
  1205 +// 'is_fix': fixdate ? '1' : '0',
  1206 +// 'is_week': weekly ? '1' : '0',
  1207 +// 'is_birthday': birthday ? '1' : '0',
  1208 +// // 'fix_sdate': fixdate ? fromDate : '', // 开始时间
  1209 +// // 'fix_edate': fixdate ? endDate : '', //结束时间
  1210 +// 'week_date_show': weekly ? weekShow : '',
  1211 +// 'week_date_data': weekly ? weekData : ''
  1212 +// };
  1213 +
  1214 +// String dateStr = json.encode(date);
  1215 +// print(dateStr);
  1216 +// Map<String, String?> pramas = {
  1217 +// 'sellerid': Provider.of<UserModel>(context, listen: false)
  1218 +// .user!
  1219 +// .sellerid,
  1220 +// 'uid': Provider.of<UserModel>(context, listen: false)
  1221 +// .user!
  1222 +// .openid,
  1223 +// 'rname': nameC.text,
  1224 +// 'recharge_money': priceminC.text,
  1225 +// 'recharge_list': discountsStr,
  1226 +// 'exp_date': dateStr,
  1227 +// 'explain': remarkC.text,
  1228 +// 'is_open': canUse ? '1' : '0',
  1229 +// 'stime': stime,
  1230 +// 'etime': etime
  1231 +// };
  1232 +// if (widget.idstr != null && widget.idstr != 'null') {
  1233 +// pramas['id'] = widget.idstr;
  1234 +// }
  1235 +
  1236 +// bool success = await marketingCenterProvider!.createNewRecharge(
  1237 +// context, pramas);
  1238 +
  1239 +// if (success) {
  1240 +// //成功后返回前面列表
  1241 +// if (Navigator.canPop(context)) {
  1242 +// Navigator.pop(context);
  1243 +// }
  1244 +// //刷新列表
  1245 +// bus.emit('refresh_marketting_page_recharge');
  1246 +// bus.emit('refresh_recharge_home');
  1247 +// }
  1248 +
  1249 +// // "stime": fromDate == '点击选择'
  1250 +// // ? ""
  1251 +// // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
  1252 +// // "etime": endDate == '点击选择'
  1253 +// // ? ''
  1254 +// // : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
  1255 +// // UserModel userModel =
  1256 +// // Provider.of<UserModel>(context, listen: false);
  1257 +// // if (userModel.user.role_name == '管理员' ||
  1258 +// // userModel.user.role_name == '店长') {
  1259 +// // NavigatorUtil.goRechargeEditPage(context);
  1260 +// // } else {
  1261 +// // bool needRefresh =
  1262 +// // await NavigatorUtil.goCouponEditPage(context);
  1263 +// // print(needRefresh);
  1264 +// // if (needRefresh != null && needRefresh) {
  1265 +// // bus.emit('refresh_coupon_list_f');
  1266 +// // //刷新页面数据
  1267 +// // // _controller.callRefresh();
  1268 +// // // _couponNetworkData(tabController.index);
  1269 +// // }
  1270 +// // }
  1271 +// },
  1272 +// ),
  1273 +// )
  1274 +// ],
  1275 +// ),
  1276 +// ));
  1277 +// }
  1278 +// }
@@ -355,23 +355,8 @@ class _RechargeHomePageState extends State<RechargeHomePage> { @@ -355,23 +355,8 @@ class _RechargeHomePageState extends State<RechargeHomePage> {
355 isBold: false, 355 isBold: false,
356 fontSize: 28, 356 fontSize: 28,
357 onPressed: () async { 357 onPressed: () async {
358 - // UserModel userModel =  
359 - // Provider.of<UserModel>(context, listen: false);  
360 - // if (userModel.user.role_name == '管理员' ||  
361 - // userModel.user.role_name == '店长') {  
362 - NavigatorUtil.goRechargeEditPage(context);  
363 - // } else {  
364 - // Utils.showToast('您还没有相关权限');  
365 - // // bool needRefresh =  
366 - // // await NavigatorUtil.goCouponEditPage(context);  
367 - // // print(needRefresh);  
368 - // // if (needRefresh != null && needRefresh) {  
369 - // // bus.emit('refresh_coupon_list_f');  
370 - // // //刷新页面数据  
371 - // // // _controller.callRefresh();  
372 - // // // _couponNetworkData(tabController.index);  
373 - // // }  
374 - // } 358 + // NavigatorUtil.goRechargeEditPage(context);
  359 + NavigatorUtil.goRechargeTypeSelectPage(context);
375 }, 360 },
376 ), 361 ),
377 ) 362 )
  1 +import 'package:flutter/material.dart';
  2 +// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/res/colors.dart';
  5 +import 'package:one_key/route/navigator_util.dart';
  6 +import 'package:one_key/utils/event_bus.dart';
  7 +import 'package:one_key/utils/utils.dart';
  8 +import 'package:one_key/widgets/h_empty_view.dart';
  9 +import 'package:one_key/widgets/round_button.dart';
  10 +import 'package:one_key/widgets/system_app_bar.dart';
  11 +import 'package:one_key/widgets/v_empty_view.dart';
  12 +
  13 +/**
  14 + * 新建充值优惠---类型选择
  15 + */
  16 +class RechargeTypeSelectPage extends StatefulWidget {
  17 + RechargeTypeSelectPage({Key? key}) : super(key: key);
  18 +
  19 + @override
  20 + _RechargeTypeSelectPageState createState() => _RechargeTypeSelectPageState();
  21 +}
  22 +
  23 +class _RechargeTypeSelectPageState extends State<RechargeTypeSelectPage> {
  24 + bool selectF = true;
  25 + @override
  26 + Widget build(BuildContext context) {
  27 + return Scaffold(
  28 + backgroundColor: MyColours.color_ffffff,
  29 + appBar: SystemAppBar(
  30 + '选择充值优惠类型',
  31 + onTap: () {
  32 + if (Navigator.canPop(context)) {
  33 + Navigator.pop(context);
  34 + }
  35 + },
  36 + ),
  37 + body: SingleChildScrollView(
  38 + child: Column(
  39 + children: [
  40 + VEmptyView(98),
  41 + InkWell(
  42 + onTap: () {
  43 + if (!selectF) {
  44 + setState(() {
  45 + selectF = !selectF;
  46 + });
  47 + }
  48 + },
  49 + child: Container(
  50 + padding: EdgeInsets.symmetric(
  51 + horizontal: ScreenUtil().setWidth(60)),
  52 + margin: EdgeInsets.symmetric(
  53 + horizontal: ScreenUtil().setWidth(60)),
  54 + height: ScreenUtil().setWidth(106 * 2),
  55 + decoration: BoxDecoration(
  56 + boxShadow: [
  57 + BoxShadow(
  58 + offset: Offset(0, ScreenUtil().setWidth(4)),
  59 + blurRadius: ScreenUtil().setWidth(20),
  60 + spreadRadius: ScreenUtil().setWidth(2),
  61 + color: Color.fromRGBO(32, 109, 114, 0.2))
  62 + ],
  63 + color: selectF
  64 + ? MyColours.color_438E93
  65 + : MyColours.color_ffffff,
  66 + borderRadius:
  67 + BorderRadius.circular(ScreenUtil().setWidth(24))),
  68 + child: Row(
  69 + children: [
  70 + // Image.asset(
  71 + // Utils.getImgPath(selectF
  72 + // ? 'coupon_select_type_user'
  73 + // : 'coupon_select_type_user_un'),
  74 + // width: ScreenUtil().setWidth(70 * 2),
  75 + // ),
  76 + // HEmptyView(70),
  77 + Expanded(
  78 + child: Column(
  79 + mainAxisAlignment: MainAxisAlignment.center,
  80 + crossAxisAlignment: CrossAxisAlignment.start,
  81 + children: [
  82 + Text(
  83 + '当餐免费',
  84 + style: TextStyle(
  85 + fontWeight: FontWeight.bold,
  86 + fontSize: ScreenUtil().setSp(36),
  87 + color: selectF
  88 + ? MyColours.color_ffffff
  89 + : MyColours.color_999999),
  90 + ),
  91 + VEmptyView(16),
  92 + Text(
  93 + '顾客充值当餐实际消费金额的X倍,则当餐免费',
  94 + maxLines: 2,
  95 + overflow: TextOverflow.ellipsis,
  96 + style: TextStyle(
  97 + fontSize: ScreenUtil().setSp(24),
  98 + color: selectF
  99 + ? MyColours.color_ffffff
  100 + : MyColours.color_BFC4D4),
  101 + ),
  102 + ],
  103 + )),
  104 + ],
  105 + ),
  106 + )),
  107 + VEmptyView(94),
  108 + InkWell(
  109 + onTap: () {
  110 + if (selectF) {
  111 + setState(() {
  112 + selectF = !selectF;
  113 + });
  114 + }
  115 + },
  116 + child: Container(
  117 + padding: EdgeInsets.symmetric(
  118 + horizontal: ScreenUtil().setWidth(60)),
  119 + margin: EdgeInsets.symmetric(
  120 + horizontal: ScreenUtil().setWidth(60)),
  121 + height: ScreenUtil().setWidth(106 * 2),
  122 + decoration: BoxDecoration(
  123 + boxShadow: [
  124 + BoxShadow(
  125 + offset: Offset(0, ScreenUtil().setWidth(4)),
  126 + blurRadius: ScreenUtil().setWidth(20),
  127 + spreadRadius: ScreenUtil().setWidth(2),
  128 + color: Color.fromRGBO(0, 0, 0, 0.1))
  129 + ],
  130 + color: !selectF
  131 + ? MyColours.color_438E93
  132 + : MyColours.color_ffffff,
  133 + borderRadius:
  134 + BorderRadius.circular(ScreenUtil().setWidth(24))),
  135 + child: Row(
  136 + children: [
  137 + // Image.asset(
  138 + // Utils.getImgPath(!selectF
  139 + // ? 'coupon_select_type_store'
  140 + // : 'coupon_select_type_store_un'),
  141 + // width: ScreenUtil().setWidth(75 * 2),
  142 + // ),
  143 + // HEmptyView(60),
  144 + Expanded(
  145 + child: Column(
  146 + mainAxisAlignment: MainAxisAlignment.center,
  147 + crossAxisAlignment: CrossAxisAlignment.start,
  148 + children: [
  149 + Text(
  150 + '充满即赠',
  151 + style: TextStyle(
  152 + fontWeight: FontWeight.bold,
  153 + fontSize: ScreenUtil().setSp(36),
  154 + color: !selectF
  155 + ? MyColours.color_ffffff
  156 + : MyColours.color_999999),
  157 + ),
  158 + VEmptyView(16),
  159 + Text(
  160 + '顾客充值满X元,赠送余额Y元',
  161 + style: TextStyle(
  162 + fontSize: ScreenUtil().setSp(24),
  163 + color: !selectF
  164 + ? MyColours.color_ffffff
  165 + : MyColours.color_BFC4D4),
  166 + ),
  167 + ],
  168 + )),
  169 + ],
  170 + ),
  171 + )),
  172 + VEmptyView(112),
  173 + RoundButton(
  174 + text: '立即创建',
  175 + gradientStart: MyColours.color_ffffff,
  176 + gradientEnd: MyColours.color_ffffff,
  177 + borderColor: MyColours.color_438E93,
  178 + width: ScreenUtil().setWidth(130 * 2),
  179 + height: ScreenUtil().setWidth(37 * 2),
  180 + textColor: MyColours.color_438E93,
  181 + fontSize: 24,
  182 + isBold: true,
  183 + radius: ScreenUtil().setWidth(22),
  184 + onPressed: () async {
  185 + bool? needRefresh = await NavigatorUtil.goRechargeEditPage(
  186 + context,
  187 + );
  188 + print(needRefresh);
  189 + if (needRefresh != null && needRefresh) {
  190 + if (Navigator.canPop(context)) {
  191 + Navigator.pop(context);
  192 + }
  193 + }
  194 + },
  195 + )
  196 + ],
  197 + ),
  198 + ),
  199 + );
  200 + }
  201 +}
@@ -2480,9 +2480,6 @@ class NavigatorUtil { @@ -2480,9 +2480,6 @@ class NavigatorUtil {
2480 replace: replace); 2480 replace: replace);
2481 } 2481 }
2482 2482
2483 -  
2484 -  
2485 -  
2486 ///买单前送消费金 2483 ///买单前送消费金
2487 static Future<dynamic> goGiveMoneyBeforePayPage( 2484 static Future<dynamic> goGiveMoneyBeforePayPage(
2488 BuildContext context, { 2485 BuildContext context, {
@@ -2492,6 +2489,15 @@ class NavigatorUtil { @@ -2492,6 +2489,15 @@ class NavigatorUtil {
2492 replace: replace); 2489 replace: replace);
2493 } 2490 }
2494 2491
  2492 + ///选择充值优惠类型
  2493 + static Future<dynamic> goRechargeTypeSelectPage(
  2494 + BuildContext context, {
  2495 + replace = false,
  2496 + }) {
  2497 + return _navigateTo(context, "${Routes.recharge_type_select_page}",
  2498 + replace: replace);
  2499 + }
  2500 +
2495 static Future<dynamic> goSetBirthdayPage( 2501 static Future<dynamic> goSetBirthdayPage(
2496 BuildContext context, String? gid, String? lunar, String? solar, 2502 BuildContext context, String? gid, String? lunar, String? solar,
2497 {replace = false, String from = 'store'}) { 2503 {replace = false, String from = 'store'}) {
@@ -94,6 +94,7 @@ import 'package:one_key/pages/my/finance_manage/vip_record_detail_page.dart'; @@ -94,6 +94,7 @@ import 'package:one_key/pages/my/finance_manage/vip_record_detail_page.dart';
94 import 'package:one_key/pages/my/marketing_center/book_notification/marking_interaction_page.dart'; 94 import 'package:one_key/pages/my/marketing_center/book_notification/marking_interaction_page.dart';
95 import 'package:one_key/pages/my/marketing_center/grant_page.dart'; 95 import 'package:one_key/pages/my/marketing_center/grant_page.dart';
96 import 'package:one_key/pages/my/marketing_center/grant_wechat_image_page.dart'; 96 import 'package:one_key/pages/my/marketing_center/grant_wechat_image_page.dart';
  97 +import 'package:one_key/pages/my/marketing_center/recharge/recharge_type_select_page.dart';
97 import 'package:one_key/pages/my/menu_type/menu_set_price_page.dart'; 98 import 'package:one_key/pages/my/menu_type/menu_set_price_page.dart';
98 import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart'; 99 import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart';
99 import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; 100 import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart';
@@ -948,7 +949,8 @@ var handleCouponDetailPageHandler = new Handler( @@ -948,7 +949,8 @@ var handleCouponDetailPageHandler = new Handler(
948 949
949 return ChangeNotifierProvider<BaseIndoProvider>( 950 return ChangeNotifierProvider<BaseIndoProvider>(
950 create: (_) => BaseIndoProvider(), 951 create: (_) => BaseIndoProvider(),
951 - child: CouponDetailPage(couponSunModel: couponSunModel, idstr: idStr,isHistory:isHistory)); 952 + child: CouponDetailPage(
  953 + couponSunModel: couponSunModel, idstr: idStr, isHistory: isHistory));
952 }); 954 });
953 955
954 ///个人资料页面 956 ///个人资料页面
@@ -4329,10 +4331,6 @@ var grantPageHandle = new Handler( @@ -4329,10 +4331,6 @@ var grantPageHandle = new Handler(
4329 create: (_) => FinanceProvider(), child: GrantPage()); 4331 create: (_) => FinanceProvider(), child: GrantPage());
4330 }); 4332 });
4331 4333
4332 -  
4333 -  
4334 -  
4335 -  
4336 ///买单前送消费金 4334 ///买单前送消费金
4337 var giveMoneyBeforePayPageHandle = new Handler( 4335 var giveMoneyBeforePayPageHandle = new Handler(
4338 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) { 4336 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
@@ -4342,7 +4340,14 @@ var giveMoneyBeforePayPageHandle = new Handler( @@ -4342,7 +4340,14 @@ var giveMoneyBeforePayPageHandle = new Handler(
4342 create: (_) => FinanceProvider(), child: GiveMoneyBeforePayPage()); 4340 create: (_) => FinanceProvider(), child: GiveMoneyBeforePayPage());
4343 }); 4341 });
4344 4342
4345 - 4343 +///选择充值优惠类型
  4344 +var rechargeTypeSelectPageHandle = new Handler(
  4345 + handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
  4346 + // ConsumeQrcodeSunModel data = ConsumeQrcodeSunModel.fromJson(json.decode(
  4347 + // FluroConvertUtils.fluroCnParamsDecode(params["data"]!.first as String)));
  4348 + return ChangeNotifierProvider<FinanceProvider>(
  4349 + create: (_) => FinanceProvider(), child: RechargeTypeSelectPage());
  4350 +});
4346 4351
4347 ///扫码领消费金 4352 ///扫码领消费金
4348 var grantWechatPageHandle = new Handler( 4353 var grantWechatPageHandle = new Handler(
@@ -437,14 +437,11 @@ class Routes { @@ -437,14 +437,11 @@ class Routes {
437 437
438 static String grant_wechat_page = "/grant_wechat_page"; // 扫码领消费金 438 static String grant_wechat_page = "/grant_wechat_page"; // 扫码领消费金
439 439
  440 + static String give_money_before_pay_page =
  441 + "/give_money_before_pay_page"; // 买单前送消费金
440 442
441 -  
442 -  
443 -  
444 - static String give_money_before_pay_page = "/give_money_before_pay_page"; // 买单前送消费金  
445 -  
446 -  
447 - 443 + static String recharge_type_select_page =
  444 + "/recharge_type_select_page"; // 新建充值优惠类型选择
448 445
449 static void configureRoutes(FluroRouter router) { 446 static void configureRoutes(FluroRouter router) {
450 router.notFoundHandler = new Handler( 447 router.notFoundHandler = new Handler(
@@ -833,15 +830,14 @@ class Routes { @@ -833,15 +830,14 @@ class Routes {
833 830
834 router.define(return_money_page, handler: returnMoneyPageHandle); 831 router.define(return_money_page, handler: returnMoneyPageHandle);
835 832
836 - router.define( grant_page, handler: grantPageHandle);  
837 -  
838 -  
839 - router.define( grant_wechat_page , handler: grantWechatPageHandle); 833 + router.define(grant_page, handler: grantPageHandle);
840 834
  835 + router.define(grant_wechat_page, handler: grantWechatPageHandle);
841 836
842 - router.define( give_money_before_pay_page , handler: giveMoneyBeforePayPageHandle); 837 + router.define(give_money_before_pay_page,
  838 + handler: giveMoneyBeforePayPageHandle);
843 839
844 -  
845 - 840 + router.define(recharge_type_select_page,
  841 + handler: rechargeTypeSelectPageHandle);
846 } 842 }
847 } 843 }