Commit df3b7056ea6a66578256996f325289c9ec014fbd

Authored by wdn127929
1 parent 9c509379

付费优惠券保存

@@ -157,7 +157,7 @@ class Constant { @@ -157,7 +157,7 @@ class Constant {
157 '到店': ['管理员', '店长', '前台', '迎宾'], 157 '到店': ['管理员', '店长', '前台', '迎宾'],
158 '离店': ['管理员', '店长', '前台', '迎宾'], 158 '离店': ['管理员', '店长', '前台', '迎宾'],
159 '全店任务': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'], 159 '全店任务': ['管理员', '店长', '客户经理', '收银员', '服务员', '前台'],
160 - '创建新的优惠券': [ 160 + '创建新券': [
161 '管理员', 161 '管理员',
162 '店长', 162 '店长',
163 ], 163 ],
@@ -88,6 +88,10 @@ class CouponSunModel extends Object { @@ -88,6 +88,10 @@ class CouponSunModel extends Object {
88 @JsonKey(name: 'use') 88 @JsonKey(name: 'use')
89 CouponUse use; 89 CouponUse use;
90 90
  91 +
  92 + @JsonKey(name: 'arule')
  93 + Arule arule;
  94 +
91 @JsonKey(name: 'exp_date') 95 @JsonKey(name: 'exp_date')
92 ExpDate expDate; 96 ExpDate expDate;
93 97
@@ -103,6 +107,11 @@ class CouponSunModel extends Object { @@ -103,6 +107,11 @@ class CouponSunModel extends Object {
103 @JsonKey(name: 'lite_qrcode') 107 @JsonKey(name: 'lite_qrcode')
104 String liteQrcode; 108 String liteQrcode;
105 109
  110 + @JsonKey(name: 'aexpiration')
  111 + String aexpiration;
  112 +
  113 + // arule 券使用和分享规则 领取后有效天数
  114 +
106 bool isCheck = false; 115 bool isCheck = false;
107 bool showText = false; 116 bool showText = false;
108 bool isMarking = false; 117 bool isMarking = false;
@@ -127,11 +136,13 @@ class CouponSunModel extends Object { @@ -127,11 +136,13 @@ class CouponSunModel extends Object {
127 this.isOpenBool, 136 this.isOpenBool,
128 this.price, 137 this.price,
129 this.use, 138 this.use,
  139 + this.arule,
130 this.expDate, 140 this.expDate,
131 this.nickNameShow, 141 this.nickNameShow,
132 this.grantNum, 142 this.grantNum,
133 this.urllink, 143 this.urllink,
134 - this.liteQrcode); 144 + this.liteQrcode,
  145 + this.aexpiration);
135 146
136 factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) => 147 factory CouponSunModel.fromJson(Map<String, dynamic> srcJson) =>
137 _$CouponSunModelFromJson(srcJson); 148 _$CouponSunModelFromJson(srcJson);
@@ -172,6 +183,56 @@ class CouponUse extends Object { @@ -172,6 +183,56 @@ class CouponUse extends Object {
172 } 183 }
173 184
174 @JsonSerializable() 185 @JsonSerializable()
  186 +class Arule extends Object {
  187 + @JsonKey(name: 'is_same_day')
  188 + bool isSameDay;
  189 +
  190 + @JsonKey(name: 'is_accumulation')
  191 + bool isAccumulation;
  192 +
  193 + @JsonKey(name: 'is_compartment')
  194 + bool isCompartment;
  195 +
  196 + @JsonKey(name: 'is_eatin')
  197 + bool isEatin;
  198 +
  199 + @JsonKey(name: 'is_takeout')
  200 + bool isTakeout;
  201 +
  202 + @JsonKey(name: 'is_appointment')
  203 + bool isAppointment;
  204 +
  205 + @JsonKey(name: 'is_share_lose')
  206 + bool isShareLose;
  207 +
  208 + @JsonKey(name: 'is_share_have')
  209 + bool isShareHave;
  210 +
  211 + @JsonKey(name: 'is_commission')
  212 + bool isCommission;
  213 +
  214 + @JsonKey(name: 'commission')
  215 + String commission;
  216 +
  217 + Arule(
  218 + this.isSameDay,
  219 + this.isAccumulation,
  220 + this.isCompartment,
  221 + this.isEatin,
  222 + this.isTakeout,
  223 + this.isAppointment,
  224 + this.isShareLose,
  225 + this.isShareHave,
  226 + this.isCommission,
  227 + this.commission);
  228 +
  229 + factory Arule.fromJson(Map<String, dynamic> srcJson) =>
  230 + _$AruleFromJson(srcJson);
  231 +
  232 + Map<String, dynamic> toJson() => _$AruleToJson(this);
  233 +}
  234 +
  235 +@JsonSerializable()
175 class ExpDate extends Object { 236 class ExpDate extends Object {
176 @JsonKey(name: 'is_none') 237 @JsonKey(name: 'is_none')
177 bool isNone; 238 bool isNone;
@@ -51,6 +51,13 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) { @@ -51,6 +51,13 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) {
51 : (json['use'] is Map) 51 : (json['use'] is Map)
52 ? CouponUse.fromJson(json['use']) 52 ? CouponUse.fromJson(json['use'])
53 : null, 53 : null,
  54 + json['arule'] == null
  55 + ? null
  56 + : (json['arule'] is String)
  57 + ? Arule.fromJson(jsonDecode(json['arule']))
  58 + : (json['arule'] is Map)
  59 + ? Arule.fromJson(json['arule'])
  60 + : null,
54 json['exp_date'] == null 61 json['exp_date'] == null
55 ? null 62 ? null
56 : (json['exp_date'] is String) 63 : (json['exp_date'] is String)
@@ -62,6 +69,7 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) { @@ -62,6 +69,7 @@ CouponSunModel _$CouponSunModelFromJson(Map<String, dynamic> json) {
62 json['grant_num'] as String, 69 json['grant_num'] as String,
63 json['urllink'] as String, 70 json['urllink'] as String,
64 json['lite_qrcode'] as String, 71 json['lite_qrcode'] as String,
  72 + json['aexpiration'] as String,
65 ); 73 );
66 } 74 }
67 75
@@ -86,11 +94,13 @@ Map<String, dynamic> _$CouponSunModelToJson(CouponSunModel instance) => @@ -86,11 +94,13 @@ Map<String, dynamic> _$CouponSunModelToJson(CouponSunModel instance) =>
86 'isOpenBool': instance.isOpenBool, 94 'isOpenBool': instance.isOpenBool,
87 'price': instance.price, 95 'price': instance.price,
88 'use': instance.use, 96 'use': instance.use,
  97 + 'arule': instance.arule,
89 'exp_date': instance.expDate, 98 'exp_date': instance.expDate,
90 'nick_name': instance.nickNameShow, 99 'nick_name': instance.nickNameShow,
91 'grant_num': instance.grantNum, 100 'grant_num': instance.grantNum,
92 - 'urllink':instance.urllink,  
93 - 'lite_qrcode':instance.liteQrcode 101 + 'urllink': instance.urllink,
  102 + 'lite_qrcode': instance.liteQrcode,
  103 + 'aexpiration': instance.aexpiration
94 }; 104 };
95 105
96 CouponUse _$CouponUseFromJson(Map<String, dynamic> json) { 106 CouponUse _$CouponUseFromJson(Map<String, dynamic> json) {
@@ -147,6 +157,96 @@ Map<String, dynamic> _$CouponUseToJson(CouponUse instance) => <String, dynamic>{ @@ -147,6 +157,96 @@ Map<String, dynamic> _$CouponUseToJson(CouponUse instance) => <String, dynamic>{
147 'images': instance.images 157 'images': instance.images
148 }; 158 };
149 159
  160 +Arule _$AruleFromJson(Map<String, dynamic> json) {
  161 + bool isSameDay = false;
  162 + if (json['is_same_day'] is String) {
  163 + isSameDay = json['is_same_day'] == '1' ? true : false;
  164 + } else if (json['is_same_day'] is bool) {
  165 + isSameDay = json['is_same_day'] ? true : false;
  166 + }
  167 +
  168 + bool isAccumulation = false;
  169 + if (json['is_accumulation'] is String) {
  170 + isAccumulation = json['is_accumulation'] == '1' ? true : false;
  171 + } else if (json['is_accumulation'] is bool) {
  172 + isAccumulation = json['is_accumulation'] ? true : false;
  173 + }
  174 +
  175 + bool isCompartment = false;
  176 + if (json['is_compartment'] is String) {
  177 + isCompartment = json['is_compartment'] == '1' ? true : false;
  178 + } else if (json['is_compartment'] is bool) {
  179 + isCompartment = json['is_compartment'] ? true : false;
  180 + }
  181 +
  182 + bool isEatin = false;
  183 + if (json['is_eatin'] is String) {
  184 + isEatin = json['is_eatin'] == '1' ? true : false;
  185 + } else if (json['is_eatin'] is bool) {
  186 + isEatin = json['is_eatin'] ? true : false;
  187 + }
  188 +
  189 + bool isTakeout = false;
  190 + if (json['is_takeout'] is String) {
  191 + isTakeout = json['is_takeout'] == '1' ? true : false;
  192 + } else if (json['is_takeout'] is bool) {
  193 + isTakeout = json['is_takeout'] ? true : false;
  194 + }
  195 +
  196 + bool isAppointment = false;
  197 + if (json['is_appointment'] is String) {
  198 + isAppointment = json['is_appointment'] == '1' ? true : false;
  199 + } else if (json['is_appointment'] is bool) {
  200 + isAppointment = json['is_appointment'] ? true : false;
  201 + }
  202 +
  203 + bool isShareLose = false;
  204 + if (json['is_share_lose'] is String) {
  205 + isShareLose = json['is_share_lose'] == '1' ? true : false;
  206 + } else if (json['is_share_lose'] is bool) {
  207 + isShareLose = json['is_share_lose'] ? true : false;
  208 + }
  209 +
  210 + bool isShareHave = false;
  211 + if (json['is_share_have'] is String) {
  212 + isShareHave = json['is_share_have'] == '1' ? true : false;
  213 + } else if (json['is_share_have'] is bool) {
  214 + isShareHave = json['is_share_have'] ? true : false;
  215 + }
  216 +
  217 + bool isCommission = false;
  218 + if (json['is_commission'] is String) {
  219 + isCommission = json['is_commission'] == '1' ? true : false;
  220 + } else if (json['is_commission'] is bool) {
  221 + isCommission = json['is_commission'] ? true : false;
  222 + }
  223 +
  224 + return Arule(
  225 + isSameDay,
  226 + isAccumulation,
  227 + isCompartment,
  228 + isEatin,
  229 + isTakeout,
  230 + isAppointment,
  231 + isShareLose,
  232 + isShareHave,
  233 + isCommission,
  234 + json['commission']);
  235 +}
  236 +
  237 +Map<String, dynamic> _$AruleToJson(Arule instance) => <String, dynamic>{
  238 + 'is_same_day': instance.isSameDay,
  239 + 'is_accumulation': instance.isAccumulation,
  240 + 'is_compartment': instance.isCompartment,
  241 + 'is_eatin': instance.isEatin,
  242 + 'is_takeout': instance.isTakeout,
  243 + 'is_appointment': instance.isAppointment,
  244 + 'is_share_lose': instance.isShareLose,
  245 + 'is_share_have': instance.isShareHave,
  246 + 'is_commission': instance.isCommission,
  247 + 'commission': instance.commission,
  248 + };
  249 +
150 ExpDate _$ExpDateFromJson(Map<String, dynamic> json) { 250 ExpDate _$ExpDateFromJson(Map<String, dynamic> json) {
151 List<FilterBtnModel> weekdata = []; 251 List<FilterBtnModel> weekdata = [];
152 if (json['week_data'] != null) { 252 if (json['week_data'] != null) {
@@ -338,7 +338,6 @@ class MarkStoreModel { @@ -338,7 +338,6 @@ class MarkStoreModel {
338 if (json['content'] != null) { 338 if (json['content'] != null) {
339 content = []; 339 content = [];
340 340
341 -  
342 if (json['content'] is List) { 341 if (json['content'] is List) {
343 List temp = json['content']; 342 List temp = json['content'];
344 temp.forEach((element) { 343 temp.forEach((element) {
@@ -417,7 +416,7 @@ class MarkChefModel { @@ -417,7 +416,7 @@ class MarkChefModel {
417 isImages = json['is_images']; 416 isImages = json['is_images'];
418 if (json['content'] != null) { 417 if (json['content'] != null) {
419 content = []; 418 content = [];
420 - if (json['content'] is List) { 419 + if (json['content'] is List) {
421 List temp = json['content']; 420 List temp = json['content'];
422 temp.forEach((element) { 421 temp.forEach((element) {
423 content.add(ContentModel.fromJson(element)); 422 content.add(ContentModel.fromJson(element));
@@ -521,12 +520,13 @@ class MarkMarketingModel { @@ -521,12 +520,13 @@ class MarkMarketingModel {
521 String isLink; // 520 String isLink; //
522 String wecomle; // 521 String wecomle; //
523 String logo; // 522 String logo; //
524 - String isCoupon; 523 + String isCouponFree;
  524 + String isCouponPay;
525 String isRecharge; 525 String isRecharge;
526 RechargeListSunModel rechargeData; 526 RechargeListSunModel rechargeData;
527 527
528 - List<CouponSunModel> couponDataList;  
529 - 528 + List<CouponSunModel> couponDataListPay;
  529 + List<CouponSunModel> couponDataListFree;
530 String isComments; 530 String isComments;
531 String isCommentsCoupon; 531 String isCommentsCoupon;
532 List<CouponSunModel> couponDataListComments; 532 List<CouponSunModel> couponDataListComments;
@@ -541,10 +541,12 @@ class MarkMarketingModel { @@ -541,10 +541,12 @@ class MarkMarketingModel {
541 this.isTranspond, 541 this.isTranspond,
542 this.logo, 542 this.logo,
543 this.wecomle, 543 this.wecomle,
544 - this.isCoupon, 544 + this.isCouponFree,
  545 + this.isCouponPay,
545 this.isRecharge, 546 this.isRecharge,
546 this.rechargeData, 547 this.rechargeData,
547 - this.couponDataList, 548 + this.couponDataListPay,
  549 + this.couponDataListFree,
548 this.isComments, 550 this.isComments,
549 this.isCommentsCoupon, 551 this.isCommentsCoupon,
550 this.couponDataListComments, 552 this.couponDataListComments,
@@ -558,35 +560,65 @@ class MarkMarketingModel { @@ -558,35 +560,65 @@ class MarkMarketingModel {
558 isLink = json['is_link']; 560 isLink = json['is_link'];
559 wecomle = json['wecomle']; 561 wecomle = json['wecomle'];
560 logo = json['logo']; 562 logo = json['logo'];
561 - isCoupon = json['is_coupon']; 563 + isCouponFree = json['is_coupon_free'];
  564 + isCouponPay = json['is_coupon_pay'];
562 isRecharge = json['is_recharge']; 565 isRecharge = json['is_recharge'];
563 rechargeData = json['recharge_data'] != null 566 rechargeData = json['recharge_data'] != null
564 ? new RechargeListSunModel.fromJson(json['recharge_data']) 567 ? new RechargeListSunModel.fromJson(json['recharge_data'])
565 : null; 568 : null;
566 - if (json['coupon_data'] != null) {  
567 - couponDataList = <CouponSunModel>[];  
568 - if (json['coupon_data'] is Map) { 569 + if (json['coupon_data_pay'] != null) {
  570 + couponDataListPay = <CouponSunModel>[];
  571 + if (json['coupon_data_pay'] is Map) {
  572 + //旧数据map
  573 + couponDataListPay.add(CouponSunModel.fromJson(json['coupon_data_pay']));
  574 + } else {
  575 + var couponData;
  576 + if (json['coupon_data_pay'] is String) {
  577 + couponData = convert.jsonDecode(json['coupon_data_pay']);
  578 + } else {
  579 + couponData = json['coupon_data_pay'];
  580 + }
  581 +
  582 + if (couponData is List) {
  583 + couponData.forEach((v) {
  584 + couponDataListPay.add(CouponSunModel.fromJson(v));
  585 + });
  586 + } else if (couponData is Map) {
  587 + // json['coupon_data'].forEach((v) {
  588 + couponDataListPay.add(CouponSunModel.fromJson(couponData));
  589 + // });
  590 + } else {
  591 + couponData.forEach((v) {
  592 + couponDataListPay.add(v);
  593 + });
  594 + }
  595 + }
  596 + }
  597 + if (json['coupon_data_free'] != null) {
  598 + couponDataListFree = <CouponSunModel>[];
  599 + if (json['coupon_data_free'] is Map) {
569 //旧数据map 600 //旧数据map
570 - couponDataList.add(CouponSunModel.fromJson(json['coupon_data'])); 601 + couponDataListFree
  602 + .add(CouponSunModel.fromJson(json['coupon_data_free']));
571 } else { 603 } else {
572 var couponData; 604 var couponData;
573 - if (json['coupon_data'] is String) {  
574 - couponData = convert.jsonDecode(json['coupon_data']); 605 + if (json['coupon_data_free'] is String) {
  606 + couponData = convert.jsonDecode(json['coupon_data_free']);
575 } else { 607 } else {
576 - couponData = json['coupon_data']; 608 + couponData = json['coupon_data_free'];
577 } 609 }
578 610
579 if (couponData is List) { 611 if (couponData is List) {
580 couponData.forEach((v) { 612 couponData.forEach((v) {
581 - couponDataList.add(CouponSunModel.fromJson(v)); 613 + couponDataListFree.add(CouponSunModel.fromJson(v));
582 }); 614 });
583 } else if (couponData is Map) { 615 } else if (couponData is Map) {
584 // json['coupon_data'].forEach((v) { 616 // json['coupon_data'].forEach((v) {
585 - couponDataList.add(CouponSunModel.fromJson(couponData)); 617 + couponDataListFree.add(CouponSunModel.fromJson(couponData));
586 // }); 618 // });
587 } else { 619 } else {
588 couponData.forEach((v) { 620 couponData.forEach((v) {
589 - couponDataList.add(v); 621 + couponDataListFree.add(v);
590 }); 622 });
591 } 623 }
592 } 624 }
@@ -635,10 +667,12 @@ class MarkMarketingModel { @@ -635,10 +667,12 @@ class MarkMarketingModel {
635 data['is_link'] = this.isLink; 667 data['is_link'] = this.isLink;
636 data['wecomle'] = this.wecomle; 668 data['wecomle'] = this.wecomle;
637 data['logo'] = this.logo; 669 data['logo'] = this.logo;
638 - data['is_coupon'] = this.isCoupon; 670 + data['is_coupon_free'] = this.isCouponFree;
  671 + data['is_coupon_pay'] = this.isCouponPay;
639 data['is_recharge'] = this.isRecharge; 672 data['is_recharge'] = this.isRecharge;
640 data['recharge_data'] = this.rechargeData; 673 data['recharge_data'] = this.rechargeData;
641 - data['coupon_data'] = this.couponDataList; 674 + data['coupon_data_pay'] = this.couponDataListPay;
  675 + data['coupon_data_free'] = this.couponDataListFree;
642 data['is_comments'] = this.isComments; 676 data['is_comments'] = this.isComments;
643 data['is_comments_coupon'] = this.isCommentsCoupon; 677 data['is_comments_coupon'] = this.isCommentsCoupon;
644 data['coupon_data_comments'] = this.couponDataListComments; 678 data['coupon_data_comments'] = this.couponDataListComments;
@@ -66,36 +66,44 @@ class _CouponCreateSelectTypePageState @@ -66,36 +66,44 @@ class _CouponCreateSelectTypePageState
66 child: Row( 66 child: Row(
67 children: [ 67 children: [
68 Image.asset( 68 Image.asset(
69 - Utils.getImgPath(selectF  
70 - ? 'coupon_select_type_user'  
71 - : 'coupon_select_type_user_un'),  
72 - width: ScreenUtil().setWidth(70 * 2),  
73 - ),  
74 - HEmptyView(70),  
75 - Column(  
76 - mainAxisAlignment: MainAxisAlignment.center,  
77 - crossAxisAlignment: CrossAxisAlignment.start,  
78 - children: [  
79 - Text(  
80 - '仅为我创建',  
81 - style: TextStyle(  
82 - fontWeight: FontWeight.bold,  
83 - fontSize: ScreenUtil().setSp(36),  
84 - color: selectF  
85 - ? MyColours.color_ffffff  
86 - : MyColours.color_999999),  
87 - ),  
88 - VEmptyView(16),  
89 - Text(  
90 - '创建后仅我可发放该优惠券',  
91 - style: TextStyle(  
92 - fontSize: ScreenUtil().setSp(24),  
93 - color: selectF  
94 - ? MyColours.color_ffffff  
95 - : MyColours.color_BFC4D4),  
96 - ),  
97 - ], 69 + Utils.getImgPath(selectF ? 'free' : 'free_un'),
  70 + width: ScreenUtil().setWidth(50 * 2),
98 ), 71 ),
  72 + HEmptyView(56),
  73 + Expanded(
  74 + child: Text(
  75 + '免费代金券',
  76 + style: TextStyle(
  77 + fontWeight: FontWeight.bold,
  78 + fontSize: ScreenUtil().setSp(36),
  79 + color: selectF
  80 + ? MyColours.color_ffffff
  81 + : MyColours.color_999999),
  82 + )),
  83 + // Column(
  84 + // mainAxisAlignment: MainAxisAlignment.center,
  85 + // crossAxisAlignment: CrossAxisAlignment.start,
  86 + // children: [
  87 + // Text(
  88 + // '仅为我创建',
  89 + // style: TextStyle(
  90 + // fontWeight: FontWeight.bold,
  91 + // fontSize: ScreenUtil().setSp(36),
  92 + // color: selectF
  93 + // ? MyColours.color_ffffff
  94 + // : MyColours.color_999999),
  95 + // ),
  96 + // VEmptyView(16),
  97 + // Text(
  98 + // '创建后仅我可发放该优惠券',
  99 + // style: TextStyle(
  100 + // fontSize: ScreenUtil().setSp(24),
  101 + // color: selectF
  102 + // ? MyColours.color_ffffff
  103 + // : MyColours.color_BFC4D4),
  104 + // ),
  105 + // ],
  106 + // ),
99 ], 107 ],
100 ), 108 ),
101 )), 109 )),
@@ -130,37 +138,21 @@ class _CouponCreateSelectTypePageState @@ -130,37 +138,21 @@ class _CouponCreateSelectTypePageState
130 child: Row( 138 child: Row(
131 children: [ 139 children: [
132 Image.asset( 140 Image.asset(
133 - Utils.getImgPath(!selectF  
134 - ? 'coupon_select_type_store'  
135 - : 'coupon_select_type_store_un'),  
136 - width: ScreenUtil().setWidth(75 * 2), 141 + Utils.getImgPath(!selectF ? 'pay' : 'pay_un'),
  142 + width: ScreenUtil().setWidth(50 * 2),
137 ), 143 ),
138 - HEmptyView(60), 144 + HEmptyView(56),
139 Expanded( 145 Expanded(
140 - child: Column(  
141 - mainAxisAlignment: MainAxisAlignment.center,  
142 - crossAxisAlignment: CrossAxisAlignment.start,  
143 - children: [  
144 - Text(  
145 - '为全店创建',  
146 - style: TextStyle(  
147 - fontWeight: FontWeight.bold,  
148 - fontSize: ScreenUtil().setSp(36),  
149 - color: !selectF  
150 - ? MyColours.color_ffffff  
151 - : MyColours.color_999999),  
152 - ),  
153 - VEmptyView(16),  
154 - Text(  
155 - '创建后所有员工均可发放该优惠券',  
156 - style: TextStyle(  
157 - fontSize: ScreenUtil().setSp(24),  
158 - color: !selectF  
159 - ? MyColours.color_ffffff  
160 - : MyColours.color_BFC4D4),  
161 - ),  
162 - ],  
163 - )), 146 + child: Text(
  147 + '付费优惠券',
  148 + style: TextStyle(
  149 + fontWeight: FontWeight.bold,
  150 + fontSize: ScreenUtil().setSp(36),
  151 + color: !selectF
  152 + ? MyColours.color_ffffff
  153 + : MyColours.color_999999),
  154 + ),
  155 + ),
164 ], 156 ],
165 ), 157 ),
166 )), 158 )),
@@ -197,7 +197,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -197,7 +197,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
197 ///是否立即启用 197 ///是否立即启用
198 Widget _canUse(String title, bool swich) { 198 Widget _canUse(String title, bool swich) {
199 return Container( 199 return Container(
200 - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)), 200 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(14)),
201 child: Row( 201 child: Row(
202 crossAxisAlignment: CrossAxisAlignment.center, 202 crossAxisAlignment: CrossAxisAlignment.center,
203 mainAxisAlignment: MainAxisAlignment.center, 203 mainAxisAlignment: MainAxisAlignment.center,
@@ -215,8 +215,12 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -215,8 +215,12 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
215 Spacer(), 215 Spacer(),
216 Image.asset( 216 Image.asset(
217 swich 217 swich
218 - ? Utils.getImgPath('swich_on')  
219 - : Utils.getImgPath('swich_off'), 218 + ? Utils.getImgPath(title == '立即启用' || title == '是否核销'
  219 + ? 'swich_on'
  220 + : 'swich_on_lit')
  221 + : Utils.getImgPath(title == '立即启用' || title == '是否核销'
  222 + ? 'swich_off'
  223 + : 'swich_off_lit'),
220 width: ScreenUtil().setWidth(44 * 2), 224 width: ScreenUtil().setWidth(44 * 2),
221 ) 225 )
222 ], 226 ],
@@ -328,9 +332,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -328,9 +332,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
328 appBar: SystemAppBar( 332 appBar: SystemAppBar(
329 '优惠券详情', 333 '优惠券详情',
330 onTap: () { 334 onTap: () {
331 - if (Navigator.canPop(context)) {  
332 - Navigator.pop(context);  
333 - } 335 + if (Navigator.canPop(context)) {
  336 + Navigator.pop(context);
  337 + }
334 }, 338 },
335 // rightImgName: couponProvider != null && 339 // rightImgName: couponProvider != null &&
336 // couponProvider.couponSunModel != null && 340 // couponProvider.couponSunModel != null &&
@@ -386,13 +390,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -386,13 +390,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
386 '券类型', 390 '券类型',
387 couponProvider.couponSunModel.isType == '1' 391 couponProvider.couponSunModel.isType == '1'
388 ? '店铺优惠券' 392 ? '店铺优惠券'
389 - : '我的优惠券'), 393 + : couponProvider.couponSunModel.isType ==
  394 + '2'
  395 + ? '我的优惠券'
  396 + : couponProvider
  397 + .couponSunModel.isType ==
  398 + '3'
  399 + ? '免费代金券'
  400 + : '付费优惠券'),
390 Container( 401 Container(
391 height: ScreenUtil().setWidth(2), 402 height: ScreenUtil().setWidth(2),
392 color: MyColours.color_E7E7E7, 403 color: MyColours.color_E7E7E7,
393 ), 404 ),
394 VEmptyView(24), 405 VEmptyView(24),
395 - if (couponProvider.couponSunModel.isType == '1') 406 + if (couponProvider.couponSunModel.isType == '1' ||
  407 + couponProvider.couponSunModel.isType == '3' ||
  408 + couponProvider.couponSunModel.isType == '4')
396 Column( 409 Column(
397 children: [ 410 children: [
398 _canUse( 411 _canUse(
@@ -414,7 +427,21 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -414,7 +427,21 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
414 color: MyColours.color_E7E7E7, 427 color: MyColours.color_E7E7E7,
415 ), 428 ),
416 VEmptyView(24), 429 VEmptyView(24),
417 - if (couponProvider.couponSunModel.isType == '1' && 430 +
  431 + _item(
  432 + couponProvider.couponSunModel.isType == '3'
  433 + ? '券金额'
  434 + : '销售价',
  435 + '${couponProvider.couponSunModel.price}元' ??
  436 + ''),
  437 + Container(
  438 + height: ScreenUtil().setWidth(2),
  439 + color: MyColours.color_E7E7E7,
  440 + ),
  441 + VEmptyView(24),
  442 + if ((couponProvider.couponSunModel.isType == '1' ||
  443 + couponProvider.couponSunModel.isType ==
  444 + '4') &&
418 couponProvider.couponSunModel.use != null) 445 couponProvider.couponSunModel.use != null)
419 Column( 446 Column(
420 crossAxisAlignment: CrossAxisAlignment.start, 447 crossAxisAlignment: CrossAxisAlignment.start,
@@ -470,25 +497,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -470,25 +497,22 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
470 color: MyColours.color_E7E7E7, 497 color: MyColours.color_E7E7E7,
471 ), 498 ),
472 VEmptyView(24), 499 VEmptyView(24),
473 - _item(  
474 - '销售价',  
475 - '${couponProvider.couponSunModel.price}元' ??  
476 - ''),  
477 - Container(  
478 - height: ScreenUtil().setWidth(2),  
479 - color: MyColours.color_E7E7E7,  
480 - ),  
481 - VEmptyView(24),  
482 ], 500 ],
483 ), 501 ),
484 - _item('券要求', couponProvider.couponSunModel.desc), 502 + _item(
  503 + '消费要求',
  504 + couponProvider.couponSunModel.isType == '1' ||
  505 + couponProvider.couponSunModel.isType ==
  506 + '2'
  507 + ? couponProvider.couponSunModel.desc
  508 + : '消费满${couponProvider.couponSunModel.desc}元可用'),
485 Container( 509 Container(
486 height: ScreenUtil().setWidth(2), 510 height: ScreenUtil().setWidth(2),
487 color: MyColours.color_E7E7E7, 511 color: MyColours.color_E7E7E7,
488 ), 512 ),
489 VEmptyView(24), 513 VEmptyView(24),
490 _item( 514 _item(
491 - '有效期从', 515 + '活动开始于',
492 Utils.getDateStrFromJiekou( 516 Utils.getDateStrFromJiekou(
493 couponProvider.couponSunModel.stime)), 517 couponProvider.couponSunModel.stime)),
494 Container( 518 Container(
@@ -497,9 +521,40 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -497,9 +521,40 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
497 ), 521 ),
498 VEmptyView(24), 522 VEmptyView(24),
499 _item( 523 _item(
500 - '有效期至', 524 + '活动结束于',
501 Utils.getDateStrFromJiekou( 525 Utils.getDateStrFromJiekou(
502 couponProvider.couponSunModel.etime)), 526 couponProvider.couponSunModel.etime)),
  527 + Container(
  528 + height: ScreenUtil().setWidth(2),
  529 + color: MyColours.color_E7E7E7,
  530 + ),
  531 +
  532 + VEmptyView(24),
  533 + if (couponProvider.couponSunModel.isType == '3' ||
  534 + couponProvider.couponSunModel.isType == '4')
  535 + _item('领取后有效天数',
  536 + couponProvider.couponSunModel.aexpiration),
  537 +
  538 + if ((couponProvider.couponSunModel.isType == '3' ||
  539 + couponProvider.couponSunModel.isType ==
  540 + '4') &&
  541 + couponProvider.couponSunModel.expDate != null)
  542 + Column(children: [
  543 + Container(
  544 + height: ScreenUtil().setWidth(2),
  545 + color: MyColours.color_E7E7E7,
  546 + ),
  547 + VEmptyView(24),
  548 + _item(
  549 + '不可用日期',
  550 + couponProvider
  551 + .couponSunModel.expDate.weekShow),
  552 + Container(
  553 + height: ScreenUtil().setWidth(2),
  554 + color: MyColours.color_E7E7E7,
  555 + ),
  556 + VEmptyView(24),
  557 + ]),
503 if (couponProvider.couponSunModel.isType == '1' && 558 if (couponProvider.couponSunModel.isType == '1' &&
504 couponProvider.couponSunModel.expDate != null) 559 couponProvider.couponSunModel.expDate != null)
505 Column(children: [ 560 Column(children: [
@@ -555,7 +610,102 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -555,7 +610,102 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
555 // ], 610 // ],
556 // ) 611 // )
557 // : SizedBox(), 612 // : SizedBox(),
558 - couponProvider.couponSunModel.isType == '1' 613 + if (couponProvider.couponSunModel.isType == '3' ||
  614 + couponProvider.couponSunModel.isType == '4')
  615 + Column(
  616 + children: [
  617 + VEmptyView(24),
  618 + Container(
  619 + alignment: Alignment.centerLeft,
  620 + child: Text(
  621 + '使用规则:',
  622 + style: TextStyle(
  623 + color: MyColours.color_515151,
  624 + // fontWeight: FontWeight.bold,
  625 + fontSize: ScreenUtil().setSp(32)),
  626 + ),
  627 + ),
  628 + VEmptyView(24),
  629 + Padding(
  630 + padding: EdgeInsets.only(
  631 + left: w(32),
  632 + ),
  633 + child: Column(
  634 + children: [
  635 + _canUse(
  636 + '领取当日可用',
  637 + couponProvider.couponSunModel.arule
  638 + .isSameDay),
  639 + _canUse(
  640 + '可以叠加使用其他优惠券',
  641 + couponProvider.couponSunModel.arule
  642 + .isAccumulation,
  643 + ),
  644 + _canUse(
  645 + '可使用包间',
  646 + couponProvider.couponSunModel.arule
  647 + .isCompartment),
  648 + _canUse(
  649 + '堂食可用',
  650 + couponProvider
  651 + .couponSunModel.arule.isEatin,
  652 + ),
  653 + _canUse(
  654 + '外带可用',
  655 + couponProvider.couponSunModel.arule
  656 + .isTakeout),
  657 + _canUse(
  658 + '是否需要提前预约',
  659 + couponProvider.couponSunModel.arule
  660 + .isAppointment),
  661 + ],
  662 + ),
  663 + ),
  664 + VEmptyView(24),
  665 + Container(
  666 + alignment: Alignment.centerLeft,
  667 + child: Text(
  668 + '分享设置:',
  669 + style: TextStyle(
  670 + color: MyColours.color_515151,
  671 + // fontWeight: FontWeight.bold,
  672 + fontSize: ScreenUtil().setSp(32)),
  673 + ),
  674 + ),
  675 + VEmptyView(24),
  676 + Padding(
  677 + padding: EdgeInsets.only(
  678 + left: w(32),
  679 + ),
  680 + child: Column(
  681 + children: [
  682 + _canUse(
  683 + '用户可以分享给好友',
  684 + couponProvider.couponSunModel.arule
  685 + .isShareLose),
  686 + _canUse(
  687 + '用户分享给好友后继续拥有此券',
  688 + couponProvider
  689 + .couponSunModel.arule.isShareHave,
  690 + ),
  691 + _canUse(
  692 + '分享核销后,分享用户获得佣金',
  693 + couponProvider.couponSunModel.arule
  694 + .isCommission),
  695 + _item('分享佣金',
  696 + '${couponProvider.couponSunModel.arule.commission}%'),
  697 + ],
  698 + ),
  699 + ),
  700 + VEmptyView(24),
  701 + Container(
  702 + height: ScreenUtil().setWidth(2),
  703 + color: MyColours.color_E7E7E7,
  704 + ),
  705 + ],
  706 + ),
  707 + couponProvider.couponSunModel.isType == '1' ||
  708 + couponProvider.couponSunModel.isType == '4'
559 ? Column( 709 ? Column(
560 crossAxisAlignment: 710 crossAxisAlignment:
561 CrossAxisAlignment.start, 711 CrossAxisAlignment.start,
@@ -573,12 +723,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -573,12 +723,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
573 height: ScreenUtil().setWidth(2), 723 height: ScreenUtil().setWidth(2),
574 color: MyColours.color_E7E7E7, 724 color: MyColours.color_E7E7E7,
575 ), 725 ),
576 - VEmptyView(24),  
577 - _item(  
578 - '发放总量限制',  
579 - couponProvider  
580 - .couponSunModel.grantNum ??  
581 - ''), 726 +
582 // _select( 727 // _select(
583 // '谁可以发放', 728 // '谁可以发放',
584 // '查看', 729 // '查看',
@@ -594,6 +739,10 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -594,6 +739,10 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
594 ], 739 ],
595 ) 740 )
596 : SizedBox(), 741 : SizedBox(),
  742 +
  743 + VEmptyView(24),
  744 + _item('发放总量限制',
  745 + couponProvider.couponSunModel.grantNum ?? ''),
597 couponProvider.couponSunModel.explain != null && 746 couponProvider.couponSunModel.explain != null &&
598 couponProvider.couponSunModel.explain != '' 747 couponProvider.couponSunModel.explain != ''
599 ? Container( 748 ? Container(
@@ -607,39 +756,40 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -607,39 +756,40 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
607 : SizedBox(), 756 : SizedBox(),
608 couponProvider.couponSunModel.explain != null && 757 couponProvider.couponSunModel.explain != null &&
609 couponProvider.couponSunModel.explain != '' 758 couponProvider.couponSunModel.explain != ''
610 - ? _item('券说明', '') 759 + ? _item('券说明',
  760 + couponProvider.couponSunModel.explain)
611 : SizedBox(), 761 : SizedBox(),
612 Container( 762 Container(
613 height: ScreenUtil().setWidth(2), 763 height: ScreenUtil().setWidth(2),
614 color: MyColours.color_E7E7E7, 764 color: MyColours.color_E7E7E7,
615 ), 765 ),
  766 + // VEmptyView(24),
  767 + // if (couponProvider.couponSunModel.explain != null &&
  768 + // couponProvider.couponSunModel.explain != '')
  769 + // Align(
  770 + // alignment: Alignment.centerRight,
  771 + // child: Text(
  772 + // couponProvider.couponSunModel.explain,
  773 + // textAlign: TextAlign.left,
  774 + // style: TextStyle(
  775 + // // height: 1.5,
  776 + // fontSize: font(16),
  777 + // color: MyColours.color_999999),
  778 + // ),
  779 + // ),
  780 +
616 VEmptyView(24), 781 VEmptyView(24),
617 - if (couponProvider.couponSunModel.explain != null &&  
618 - couponProvider.couponSunModel.explain != '')  
619 - Align(  
620 - alignment: Alignment.centerLeft,  
621 - child: Text(  
622 - couponProvider.couponSunModel.explain,  
623 - textAlign: TextAlign.left,  
624 - style: TextStyle(  
625 - // height: 1.5,  
626 - fontSize: font(16),  
627 - color: MyColours.color_999999),  
628 - ),  
629 - ),  
630 - if (couponProvider.couponSunModel.explain != null &&  
631 - couponProvider.couponSunModel.explain != '')  
632 - VEmptyView(24),  
633 // Container( 782 // Container(
634 // height: ScreenUtil().setWidth(2), 783 // height: ScreenUtil().setWidth(2),
635 // color: MyColours.color_E7E7E7, 784 // color: MyColours.color_E7E7E7,
636 // ), 785 // ),
637 - VEmptyView(24), 786 + // VEmptyView(24),
638 _canUse( 787 _canUse(
639 '立即启用', 788 '立即启用',
640 couponProvider.couponSunModel.status == '1' 789 couponProvider.couponSunModel.status == '1'
641 ? true 790 ? true
642 - : false) 791 + : false),
  792 + VEmptyView(24),
643 ], 793 ],
644 ))), 794 ))),
645 ), 795 ),
@@ -668,7 +818,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -668,7 +818,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
668 mainAxisAlignment: MainAxisAlignment.spaceBetween, 818 mainAxisAlignment: MainAxisAlignment.spaceBetween,
669 children: [ 819 children: [
670 if (couponProvider.couponSunModel.liteQrcode != null && 820 if (couponProvider.couponSunModel.liteQrcode != null &&
671 - couponProvider.couponSunModel.isType == '1') 821 + (couponProvider.couponSunModel.isType == '4'))
672 RoundButton( 822 RoundButton(
673 text: '生成海报', 823 text: '生成海报',
674 width: w(100), 824 width: w(100),
@@ -706,82 +856,90 @@ class _CouponDetailPageState extends State<CouponDetailPage> { @@ -706,82 +856,90 @@ class _CouponDetailPageState extends State<CouponDetailPage> {
706 ), 856 ),
707 if (couponProvider.couponSunModel.liteQrcode != null) 857 if (couponProvider.couponSunModel.liteQrcode != null)
708 HEmptyView(30), 858 HEmptyView(30),
709 - RoundButton(  
710 - text: '复用',  
711 - width: w(100),  
712 - gradientStart: MyColours.color_ffffff,  
713 - gradientEnd: MyColours.color_ffffff,  
714 - borderColor: MyColours.color_438E93,  
715 - textColor: MyColours.color_438E93,  
716 - height: ScreenUtil().setWidth(80),  
717 - radius: ScreenUtil().setWidth(14),  
718 - isBold: true,  
719 - fontSize: 28,  
720 - onPressed: () async {  
721 - //复用,跳转至编辑页面  
722 - bool needRefresh =  
723 - await NavigatorUtil.goCouponEditPage(context,  
724 - isMine:  
725 - couponProvider.couponSunModel.isType ==  
726 - '1'  
727 - ? false  
728 - : true,  
729 - couponSunModel: couponProvider.couponSunModel);  
730 - if(needRefresh != null &&needRefresh){  
731 -  
732 - if (Navigator.canPop(context)) {  
733 - Navigator.pop(context);  
734 - }  
735 - }  
736 - },  
737 - ),  
738 - HEmptyView(30),  
739 - Expanded(  
740 - child: RoundButton(  
741 - text: '分享给客户', 859 + if (couponProvider.couponSunModel.isType == '3' ||
  860 + couponProvider.couponSunModel.isType == '4')
  861 + RoundButton(
  862 + text: '复用',
  863 + width: w(100),
  864 + gradientStart: MyColours.color_ffffff,
  865 + gradientEnd: MyColours.color_ffffff,
  866 + borderColor: MyColours.color_438E93,
  867 + textColor: MyColours.color_438E93,
742 height: ScreenUtil().setWidth(80), 868 height: ScreenUtil().setWidth(80),
743 radius: ScreenUtil().setWidth(14), 869 radius: ScreenUtil().setWidth(14),
744 - isBold: false, 870 + isBold: true,
745 fontSize: 28, 871 fontSize: 28,
746 - onPressed: () {  
747 - if (couponProvider.couponSunModel.status != '1') {  
748 - Utils.showToast('请先启用优惠券后再进行操作!');  
749 - return;  
750 - }  
751 - if (couponProvider.couponSunModel.isType == '1' &&  
752 - couponProvider.couponSunModel.status == '1') {  
753 - //店铺券  
754 -  
755 - // 谁可以发放  
756 - // 可以发放的才能分享  
757 - if (couponProvider.couponSunModel.uidList  
758 - .split(',')  
759 - .contains(Provider.of<UserModel>(context,  
760 - listen: false)  
761 - .user  
762 - .openid)) {  
763 - //包含当前登录人  
764 - Utils.goShareBuyCouponToWeChat(  
765 - context,  
766 - widget.idstr,  
767 - couponProvider.couponSunModel.use,  
768 - couponProvider.couponSunModel);  
769 - } else {  
770 - Utils.showToast('您没有此权限'); 872 + onPressed: () async {
  873 + //复用,跳转至编辑页面
  874 + bool needRefresh =
  875 + await NavigatorUtil.goCouponEditPage(context,
  876 + isMine:
  877 + couponProvider.couponSunModel.isType ==
  878 + '4'
  879 + ? false
  880 + : true,
  881 + couponSunModel:
  882 + couponProvider.couponSunModel);
  883 + if (needRefresh != null && needRefresh) {
  884 + if (Navigator.canPop(context)) {
  885 + Navigator.pop(context);
771 } 886 }
772 - } else if (couponProvider.couponSunModel.isType ==  
773 - '2' &&  
774 - couponProvider.couponSunModel.status == '1') {  
775 - // 我的优惠券  
776 - Utils.goShareBuyCouponToWeChatMy(  
777 - context,  
778 - widget.idstr,  
779 - managerName,  
780 - couponProvider.couponSunModel);  
781 } 887 }
782 }, 888 },
783 ), 889 ),
784 - ) 890 + HEmptyView(30),
  891 + if (couponProvider.couponSunModel.isType == '3' ||
  892 + couponProvider.couponSunModel.isType == '4')
  893 + Expanded(
  894 + child: RoundButton(
  895 + text: '分享给客户',
  896 + height: ScreenUtil().setWidth(80),
  897 + radius: ScreenUtil().setWidth(14),
  898 + isBold: false,
  899 + fontSize: 28,
  900 + onPressed: () {
  901 + if (couponProvider.couponSunModel.status != '1') {
  902 + Utils.showToast('请先启用优惠券后再进行操作!');
  903 + return;
  904 + }
  905 + if ((couponProvider.couponSunModel.isType ==
  906 + '3' ||
  907 + couponProvider.couponSunModel.isType ==
  908 + '4') &&
  909 + couponProvider.couponSunModel.status == '1') {
  910 + //店铺券
  911 +
  912 + // 谁可以发放
  913 + // 可以发放的才能分享
  914 + if (couponProvider.couponSunModel.uidList
  915 + .split(',')
  916 + .contains(Provider.of<UserModel>(context,
  917 + listen: false)
  918 + .user
  919 + .openid)) {
  920 + //包含当前登录人
  921 + Utils.goShareBuyCouponToWeChat(
  922 + context,
  923 + widget.idstr,
  924 + couponProvider.couponSunModel.use,
  925 + couponProvider.couponSunModel);
  926 + } else {
  927 + Utils.showToast('您没有此权限');
  928 + }
  929 + }
  930 + // else if (couponProvider.couponSunModel.isType ==
  931 + // '2' &&
  932 + // couponProvider.couponSunModel.status == '1') {
  933 + // // 我的优惠券
  934 + // Utils.goShareBuyCouponToWeChatMy(
  935 + // context,
  936 + // widget.idstr,
  937 + // managerName,
  938 + // couponProvider.couponSunModel);
  939 + // }
  940 + },
  941 + ),
  942 + )
785 ], 943 ],
786 )) 944 ))
787 ]); 945 ]);
@@ -49,7 +49,12 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -49,7 +49,12 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
49 TextEditingController _couponRequireEditControl = TextEditingController(); 49 TextEditingController _couponRequireEditControl = TextEditingController();
50 TextEditingController _couponExplainEditControl = TextEditingController(); 50 TextEditingController _couponExplainEditControl = TextEditingController();
51 TextEditingController _limitNumControl = TextEditingController(); 51 TextEditingController _limitNumControl = TextEditingController();
  52 + TextEditingController _commissionControl = TextEditingController();
  53 + TextEditingController _limitDay = TextEditingController();
52 FocusNode _limitNumFocusNode = FocusNode(); 54 FocusNode _limitNumFocusNode = FocusNode();
  55 + FocusNode _limitDayFocusNode = FocusNode();
  56 + FocusNode _commissionFocusNode = FocusNode();
  57 +
53 final heightCell = ScreenUtil().setWidth(48 * 2); 58 final heightCell = ScreenUtil().setWidth(48 * 2);
54 bool swichState = true; //默认启用 开关状态 59 bool swichState = true; //默认启用 开关状态
55 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); 60 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
@@ -59,7 +64,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -59,7 +64,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
59 FocusNode _requireFocusNode = FocusNode(); 64 FocusNode _requireFocusNode = FocusNode();
60 bool showDateSelWidget = false; 65 bool showDateSelWidget = false;
61 CouponProvider couponProvider; 66 CouponProvider couponProvider;
62 - bool swichHexiao = true; //默认启用 核销状态 67 + // bool swichHexiao = true; //默认启用 核销状态
63 String uids = ''; 68 String uids = '';
64 TextEditingController _priceControl = TextEditingController(); 69 TextEditingController _priceControl = TextEditingController();
65 FocusNode _priceFocusNode = FocusNode(); 70 FocusNode _priceFocusNode = FocusNode();
@@ -79,7 +84,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -79,7 +84,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
79 bool limitNone = true; 84 bool limitNone = true;
80 bool limitWeek = false; 85 bool limitWeek = false;
81 bool limitBirthday = false; 86 bool limitBirthday = false;
82 - String weekShow = '点击设置可用日期'; 87 + String weekShow = '无';
83 List<FilterBtnModel> weekData = []; 88 List<FilterBtnModel> weekData = [];
84 89
85 // morning == "00:00-00:00" 90 // morning == "00:00-00:00"
@@ -92,6 +97,20 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -92,6 +97,20 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
92 97
93 List<String> imgAll = []; 98 List<String> imgAll = [];
94 99
  100 + bool isSameDay = true; //领取当日可用
  101 +
  102 + bool isAccumulation = true; //叠加使用
  103 +
  104 + bool isCompartment = true; //包间可用
  105 +
  106 + bool isEatin = true; //堂食
  107 + bool isTakeout = true; //外带
  108 + bool isAppointment = true; //预约
  109 +
  110 + bool isShareLose = true; //分享好友
  111 + bool isShareHave = true; //分享好友后继续拥有此券
  112 + bool isCommission = true; //返佣金
  113 +
95 @override 114 @override
96 void initState() { 115 void initState() {
97 super.initState(); 116 super.initState();
@@ -193,15 +212,26 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -193,15 +212,26 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
193 endDate = DateUtil.formatDate(dateTimee, format: DateFormats.y_mo_d); 212 endDate = DateUtil.formatDate(dateTimee, format: DateFormats.y_mo_d);
194 213
195 swichState = widget.couponSunModel.status == '1' ? true : false; 214 swichState = widget.couponSunModel.status == '1' ? true : false;
  215 + _priceControl.text = widget.couponSunModel.price;
  216 + _limitDay.text = widget.couponSunModel.aexpiration;
  217 +
  218 + isSameDay = widget.couponSunModel.arule.isSameDay;
  219 + isAccumulation = widget.couponSunModel.arule.isAccumulation;
  220 + isCompartment = widget.couponSunModel.arule.isCompartment;
  221 + isEatin = widget.couponSunModel.arule.isEatin; //堂食
  222 + isTakeout = widget.couponSunModel.arule.isTakeout; //外带
  223 + isAppointment = widget.couponSunModel.arule.isAppointment;
  224 + isShareLose = widget.couponSunModel.arule.isShareLose; //分享好友
  225 + isShareHave = widget.couponSunModel.arule.isShareHave; //分享好友后继续拥有此券
  226 + isCommission = widget.couponSunModel.arule.isCommission; //返佣金
  227 + _commissionControl.text = widget.couponSunModel.arule.commission;
  228 + weekShow = widget.couponSunModel.expDate.weekShow ?? '无';
  229 + weekData = widget.couponSunModel.expDate.weekData ?? [];
  230 + _limitNumControl.text = widget.couponSunModel.grantNum;
196 231
197 - if (widget.isMine) {  
198 - //我的优惠券  
199 -  
200 - } else {  
201 - //店铺  
202 - swichHexiao = widget.couponSunModel.isExamine == '1' ? true : false;  
203 - _priceControl.text = widget.couponSunModel.price;  
204 - 232 + if (!widget.isMine) {
  233 + //付费优惠券
  234 + // swichHexiao = widget.couponSunModel.isExamine == '1' ? true : false;
205 money = widget.couponSunModel.use.isCash; 235 money = widget.couponSunModel.use.isCash;
206 dish = widget.couponSunModel.use.isDish; 236 dish = widget.couponSunModel.use.isDish;
207 discount = widget.couponSunModel.use.isDiscount; 237 discount = widget.couponSunModel.use.isDiscount;
@@ -223,10 +253,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -223,10 +253,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
223 limitBirthday = widget.couponSunModel.expDate.isBirthday ? true : false; 253 limitBirthday = widget.couponSunModel.expDate.isBirthday ? true : false;
224 limitWeek = widget.couponSunModel.expDate.isWeek ? true : false; 254 limitWeek = widget.couponSunModel.expDate.isWeek ? true : false;
225 255
226 - weekShow = widget.couponSunModel.expDate.weekShow ?? '点击设置可用日期';  
227 - weekData = widget.couponSunModel.expDate.weekData ?? [];  
228 uids = widget.couponSunModel.uidList; 256 uids = widget.couponSunModel.uidList;
229 - _limitNumControl.text = widget.couponSunModel.grantNum;  
230 } 257 }
231 } 258 }
232 259
@@ -286,6 +313,11 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -286,6 +313,11 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
286 filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}'; 313 filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
287 weekData.add(filterBtnModel); 314 weekData.add(filterBtnModel);
288 } 315 }
  316 + FilterBtnModel filterBtnModel1 = FilterBtnModel();
  317 + filterBtnModel1.selectNoon = false;
  318 + filterBtnModel1.selectNig = false;
  319 + filterBtnModel1.title = '法定假日';
  320 + weekData.add(filterBtnModel1);
289 } 321 }
290 322
291 //创建新券 客户经理创建活动 323 //创建新券 客户经理创建活动
@@ -307,14 +339,46 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -307,14 +339,46 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
307 "explain": _couponExplainEditControl.text, 339 "explain": _couponExplainEditControl.text,
308 "is_open": swichState ? "1" : "0", 340 "is_open": swichState ? "1" : "0",
309 "status": swichState ? "1" : "0", 341 "status": swichState ? "1" : "0",
310 - 'is_type': widget.isMine ? "2" : "1" 342 + 'is_type': widget.isMine ? "3" : "4"
  343 + };
  344 +
  345 + params['aexpiration'] = _limitDay.text;
  346 +
  347 + // params['arule'] = ;
  348 + params['price'] =
  349 + _priceControl.text.trim().length == 0 ? '0' : _priceControl.text;
  350 + Map expDate = {
  351 + // 'is_none': limitNone ? '1' : '0',
  352 + // 'is_week': limitWeek ? '1' : '0',
  353 + // 'is_birthday': limitBirthday ? '1' : '0',
  354 + 'week_show': weekShow,
  355 + 'week_data': weekData
  356 + };
  357 + params['exp_date'] = jsonEncode(expDate);
  358 +
  359 + if (_limitNumControl.text.trim().length == 0) {
  360 + params['grant_num'] = '1000';
  361 + } else {
  362 + params['grant_num'] = _limitNumControl.text;
  363 + }
  364 +
  365 + Map setting = {
  366 + 'is_same_day': isSameDay ? '1' : '0',
  367 + 'is_accumulation': isAccumulation ? '1' : '0',
  368 + 'is_compartment': isCompartment ? '1' : '0',
  369 + 'is_eatin': isEatin ? '1' : '0',
  370 + 'is_takeout': isTakeout ? '1' : '0',
  371 + 'is_appointment': isAppointment ? '1' : '0',
  372 + 'is_share_lose': isShareLose ? '1' : '0',
  373 + 'is_share_have': isShareHave ? '1' : '0',
  374 + 'is_commission': isCommission ? '1' : '0',
  375 + 'commission': _commissionControl.text
311 }; 376 };
  377 + params['arule'] = jsonEncode(setting);
  378 + params['is_examine'] = "1";
312 List<String> images = []; 379 List<String> images = [];
313 if (!widget.isMine) { 380 if (!widget.isMine) {
314 - params['is_examine'] = swichHexiao ? "1" : "0";  
315 params['uid_list'] = uids; 381 params['uid_list'] = uids;
316 - params['price'] =  
317 - _priceControl.text.trim().length == 0 ? '0' : _priceControl.text;  
318 382
319 if (img.length > 0) { 383 if (img.length > 0) {
320 img.forEach((value) { 384 img.forEach((value) {
@@ -332,21 +396,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -332,21 +396,6 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
332 'images': json.encode(images) 396 'images': json.encode(images)
333 }; 397 };
334 params['use'] = jsonEncode(use); 398 params['use'] = jsonEncode(use);
335 -  
336 - Map expDate = {  
337 - 'is_none': limitNone ? '1' : '0',  
338 - 'is_week': limitWeek ? '1' : '0',  
339 - 'is_birthday': limitBirthday ? '1' : '0',  
340 - 'week_show': weekShow,  
341 - 'week_data': weekData  
342 - };  
343 - params['exp_date'] = jsonEncode(expDate);  
344 -  
345 - if (_limitNumControl.text.trim().length == 0) {  
346 - params['grant_num'] = '1000';  
347 - } else {  
348 - params['grant_num'] = _limitNumControl.text;  
349 - }  
350 } 399 }
351 bool isSuccess = 400 bool isSuccess =
352 await couponProvider.createCustomerActivity(context, params); 401 await couponProvider.createCustomerActivity(context, params);
@@ -380,6 +429,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -380,6 +429,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
380 TextEditingController controller, FocusNode focusNode, 429 TextEditingController controller, FocusNode focusNode,
381 {TextInputType textInputType = TextInputType.text}) { 430 {TextInputType textInputType = TextInputType.text}) {
382 return Container( 431 return Container(
  432 + margin: EdgeInsets.only(bottom: w(12)),
  433 + height: w(24),
383 child: Row( 434 child: Row(
384 mainAxisAlignment: MainAxisAlignment.spaceBetween, 435 mainAxisAlignment: MainAxisAlignment.spaceBetween,
385 children: [ 436 children: [
@@ -388,11 +439,12 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -388,11 +439,12 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
388 title, 439 title,
389 style: TextStyle( 440 style: TextStyle(
390 color: Color.fromRGBO(0, 0, 0, 0.9), 441 color: Color.fromRGBO(0, 0, 0, 0.9),
391 - fontWeight: FontWeight.bold,  
392 - fontSize: ScreenUtil().setSp(32)), 442 + fontWeight:
  443 + title == '分享佣金' ? FontWeight.normal : FontWeight.bold,
  444 + fontSize: title == '分享佣金' ? font(14) : font(16)),
393 ), 445 ),
394 ), 446 ),
395 - HEmptyView(80), 447 + // HEmptyView(10),
396 Expanded( 448 Expanded(
397 // width: ScreenUtil().setWidth(231 * 2), 449 // width: ScreenUtil().setWidth(231 * 2),
398 child: TextField( 450 child: TextField(
@@ -406,18 +458,25 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -406,18 +458,25 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
406 //输入文本的样式 458 //输入文本的样式
407 inputFormatters: title == '券名称' 459 inputFormatters: title == '券名称'
408 ? [LengthLimitingTextInputFormatter(15)] 460 ? [LengthLimitingTextInputFormatter(15)]
409 - : [], 461 + : title == '券金额' ||
  462 + title == '领取后有效天数' ||
  463 + title == '消费要求(0为无门槛)' ||
  464 + title == '分享佣金' ||
  465 + title == '发放总量限制'
  466 + ? [FilteringTextInputFormatter.digitsOnly]
  467 + : [], // 限制输入为数字,
410 style: TextStyle( 468 style: TextStyle(
411 color: MyColours.color_515151, 469 color: MyColours.color_515151,
412 - fontSize: ScreenUtil().setSp(32), 470 + fontSize: ScreenUtil().setSp(28),
413 ), 471 ),
414 focusNode: focusNode, 472 focusNode: focusNode,
415 decoration: InputDecoration( 473 decoration: InputDecoration(
  474 + isCollapsed: true,
416 border: OutlineInputBorder(borderSide: BorderSide.none), 475 border: OutlineInputBorder(borderSide: BorderSide.none),
417 hintText: hintText, 476 hintText: hintText,
418 hintStyle: TextStyle( 477 hintStyle: TextStyle(
419 color: MyColours.color_999999, 478 color: MyColours.color_999999,
420 - fontSize: ScreenUtil().setSp(32), 479 + fontSize: ScreenUtil().setSp(28),
421 ), 480 ),
422 enabledBorder: new UnderlineInputBorder( 481 enabledBorder: new UnderlineInputBorder(
423 borderSide: BorderSide.none, 482 borderSide: BorderSide.none,
@@ -432,7 +491,26 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -432,7 +491,26 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
432 }, 491 },
433 keyboardType: textInputType), 492 keyboardType: textInputType),
434 ), 493 ),
435 - HEmptyView(32) 494 + HEmptyView(5),
  495 + if (title == '领取后有效天数')
  496 + Text(
  497 + '天',
  498 + style: TextStyle(
  499 + fontWeight: FontWeight.bold,
  500 + color: MyColours.color_515151,
  501 + fontSize: font(14),
  502 + ),
  503 + ),
  504 + if (title == '分享佣金')
  505 + Text(
  506 + '%',
  507 + style: TextStyle(
  508 + fontWeight: FontWeight.bold,
  509 + color: MyColours.color_515151,
  510 + fontSize: font(14),
  511 + ),
  512 + ),
  513 + HEmptyView(22)
436 ], 514 ],
437 ), 515 ),
438 ); 516 );
@@ -569,16 +647,16 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -569,16 +647,16 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
569 fontWeight: FontWeight.bold, 647 fontWeight: FontWeight.bold,
570 fontSize: ScreenUtil().setSp(32)), 648 fontSize: ScreenUtil().setSp(32)),
571 )), 649 )),
572 - VEmptyView(26),  
573 - Container(  
574 - height: ScreenUtil().setWidth(2),  
575 - color: MyColours.color_E7E7E7,  
576 - ), 650 + // VEmptyView(26),
  651 + // Container(
  652 + // height: ScreenUtil().setWidth(2),
  653 + // color: MyColours.color_E7E7E7,
  654 + // ),
577 TextField( 655 TextField(
578 controller: _couponExplainEditControl, 656 controller: _couponExplainEditControl,
579 // keyboardType: TextInputType.number, //键盘类型,数字键盘 657 // keyboardType: TextInputType.number, //键盘类型,数字键盘
580 - maxLines: 3,  
581 - maxLength: 50, 658 + maxLines: 5,
  659 + maxLength: 500,
582 660
583 // maxLengthEnforced: true, 661 // maxLengthEnforced: true,
584 style: TextStyle( 662 style: TextStyle(
@@ -632,11 +710,14 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -632,11 +710,14 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
632 } 710 }
633 711
634 ///是否立即启用 712 ///是否立即启用
635 - Widget _canUse(String title, bool swich, GestureTapCallback onTap) { 713 + Widget _canUse(String title, bool swich, GestureTapCallback onTap,
  714 + {bool isBig = true}) {
636 return InkWell( 715 return InkWell(
637 onTap: onTap, 716 onTap: onTap,
638 child: Container( 717 child: Container(
639 - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)), 718 + padding: isBig
  719 + ? EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24))
  720 + : EdgeInsets.only(bottom: w(17)),
640 margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)), 721 margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
641 child: Row( 722 child: Row(
642 crossAxisAlignment: CrossAxisAlignment.center, 723 crossAxisAlignment: CrossAxisAlignment.center,
@@ -649,15 +730,16 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -649,15 +730,16 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
649 title, 730 title,
650 style: TextStyle( 731 style: TextStyle(
651 color: Color.fromRGBO(0, 0, 0, 0.9), 732 color: Color.fromRGBO(0, 0, 0, 0.9),
652 - fontWeight: FontWeight.bold,  
653 - fontSize: ScreenUtil().setSp(32)), 733 + fontWeight:
  734 + title == '立即启用' ? FontWeight.bold : FontWeight.normal,
  735 + fontSize: title == '立即启用' ? font(16) : font(14)),
654 ), 736 ),
655 ), 737 ),
656 Spacer(), 738 Spacer(),
657 Image.asset( 739 Image.asset(
658 swich 740 swich
659 - ? Utils.getImgPath('swich_on')  
660 - : Utils.getImgPath('swich_off'), 741 + ? Utils.getImgPath(isBig ? 'swich_on' : 'swich_on_lit')
  742 + : Utils.getImgPath(isBig ? 'swich_off' : 'swich_off_lit'),
661 width: ScreenUtil().setWidth(44 * 2), 743 width: ScreenUtil().setWidth(44 * 2),
662 ) 744 )
663 ], 745 ],
@@ -797,51 +879,52 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -797,51 +879,52 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
797 child: Column( 879 child: Column(
798 children: [ 880 children: [
799 VEmptyView(56), 881 VEmptyView(56),
800 - _item('券类型', widget.isMine ? '我的优惠券' : '店铺优惠券'), 882 + // _item('券类型', widget.isMine ? '我的优惠券' : '店铺优惠券'),
  883 + // Container(
  884 + // height: ScreenUtil().setWidth(2),
  885 + // color: MyColours.color_E7E7E7,
  886 + // ),
  887 + // VEmptyView(24),
  888 + // widget.isMine
  889 + // ? SizedBox()
  890 + // : _canUse('是否核销', swichHexiao, () {
  891 + // setState(() {
  892 + // swichHexiao = !swichHexiao;
  893 + // });
  894 + // }),
  895 + // widget.isMine
  896 + // ? SizedBox()
  897 + // : Container(
  898 + // height: ScreenUtil().setWidth(2),
  899 + // color: MyColours.color_E7E7E7,
  900 + // ),
  901 + // widget.isMine ? SizedBox() : VEmptyView(24),
  902 + _textfield('券名称', '点击输入券名称',
  903 + _couponNameEditControl, _nameFocusNode),
801 Container( 904 Container(
802 height: ScreenUtil().setWidth(2), 905 height: ScreenUtil().setWidth(2),
803 color: MyColours.color_E7E7E7, 906 color: MyColours.color_E7E7E7,
804 ), 907 ),
805 - VEmptyView(24),  
806 - widget.isMine  
807 - ? SizedBox()  
808 - : _canUse('是否核销', swichHexiao, () {  
809 - setState(() {  
810 - swichHexiao = !swichHexiao;  
811 - });  
812 - }),  
813 - widget.isMine  
814 - ? SizedBox()  
815 - : Container(  
816 - height: ScreenUtil().setWidth(2),  
817 - color: MyColours.color_E7E7E7,  
818 - ),  
819 - widget.isMine ? SizedBox() : VEmptyView(24),  
820 - _textfield('券名称', '例:9折券/200元代金券/菜品券',  
821 - _couponNameEditControl, _nameFocusNode), 908 + VEmptyView(48),
  909 + //销售价
  910 +
  911 + _textfield(widget.isMine ? '券金额' : '销售价',
  912 + '点击输入代金券金额', _priceControl, _priceFocusNode,
  913 + textInputType:
  914 + TextInputType.numberWithOptions(
  915 + decimal: true)),
  916 +
822 Container( 917 Container(
823 height: ScreenUtil().setWidth(2), 918 height: ScreenUtil().setWidth(2),
824 color: MyColours.color_E7E7E7, 919 color: MyColours.color_E7E7E7,
825 ), 920 ),
826 - VEmptyView(24), 921 + VEmptyView(48),
827 if (!widget.isMine) 922 if (!widget.isMine)
828 Column( 923 Column(
829 children: [ 924 children: [
830 - //销售价  
831 -  
832 - _textfield('销售价', '默认0元,可以免费发放',  
833 - _priceControl, _priceFocusNode,  
834 - textInputType:  
835 - TextInputType.numberWithOptions(  
836 - decimal: true)),  
837 -  
838 - Container(  
839 - height: ScreenUtil().setWidth(2),  
840 - color: MyColours.color_E7E7E7,  
841 - ),  
842 // VEmptyView(24), 925 // VEmptyView(24),
843 //券用途 926 //券用途
844 - VEmptyView(56), 927 +
845 Container( 928 Container(
846 alignment: Alignment.centerLeft, 929 alignment: Alignment.centerLeft,
847 child: Text( 930 child: Text(
@@ -1059,16 +1142,18 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1059,16 +1142,18 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1059 height: ScreenUtil().setWidth(2), 1142 height: ScreenUtil().setWidth(2),
1060 color: MyColours.color_E7E7E7, 1143 color: MyColours.color_E7E7E7,
1061 ), 1144 ),
  1145 + VEmptyView(48),
1062 ], 1146 ],
1063 ), 1147 ),
1064 - _textfield('券要求', '例:无门槛/满2000元', 1148 +
  1149 + _textfield('消费要求(0为无门槛)', '点击输入最低消费金额需求',
1065 _couponRequireEditControl, _requireFocusNode), 1150 _couponRequireEditControl, _requireFocusNode),
1066 Container( 1151 Container(
1067 height: ScreenUtil().setWidth(2), 1152 height: ScreenUtil().setWidth(2),
1068 color: MyColours.color_E7E7E7, 1153 color: MyColours.color_E7E7E7,
1069 ), 1154 ),
1070 VEmptyView(24), 1155 VEmptyView(24),
1071 - _select('有效期从', fromDate, () { 1156 + _select('活动开始于', fromDate, () {
1072 FocusScope.of(context) 1157 FocusScope.of(context)
1073 .requestFocus(FocusNode()); //点击空白处隐藏键盘 1158 .requestFocus(FocusNode()); //点击空白处隐藏键盘
1074 //弹出时间选择器 1159 //弹出时间选择器
@@ -1100,7 +1185,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1100,7 +1185,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1100 color: MyColours.color_E7E7E7, 1185 color: MyColours.color_E7E7E7,
1101 ), 1186 ),
1102 VEmptyView(24), 1187 VEmptyView(24),
1103 - _select('有效期至', endDate, () { 1188 + _select('活动结束于', endDate, () {
1104 FocusScope.of(context) 1189 FocusScope.of(context)
1105 .requestFocus(FocusNode()); //点击空白处隐藏键盘 1190 .requestFocus(FocusNode()); //点击空白处隐藏键盘
1106 //弹出时间选择器 1191 //弹出时间选择器
@@ -1131,128 +1216,294 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1131,128 +1216,294 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1131 height: ScreenUtil().setWidth(2), 1216 height: ScreenUtil().setWidth(2),
1132 color: MyColours.color_E7E7E7, 1217 color: MyColours.color_E7E7E7,
1133 ), 1218 ),
1134 - VEmptyView(24),  
1135 - if (!widget.isMine)  
1136 - Column(  
1137 - children: [  
1138 - //使用限制  
1139 - VEmptyView(24),  
1140 - Container(  
1141 - alignment: Alignment.centerLeft,  
1142 - child: Text(  
1143 - '使用限制',  
1144 - style: TextStyle(  
1145 - color: Color.fromRGBO(0, 0, 0, 0.9),  
1146 - fontWeight: FontWeight.bold,  
1147 - fontSize: ScreenUtil().setSp(32)),  
1148 - ),  
1149 - ),  
1150 - VEmptyView(40),  
1151 - Row(  
1152 - children: [  
1153 - HEmptyView(30),  
1154 - _itemRadioWidget(limitNone, '无',  
1155 - onTap: () {  
1156 - if (!limitNone) {  
1157 - setState(() {  
1158 - limitNone = true; 1219 + VEmptyView(48),
1159 1220
1160 - limitWeek = false;  
1161 - limitBirthday = false;  
1162 - });  
1163 - }  
1164 - }),  
1165 - Spacer(),  
1166 - _itemRadioWidget(limitWeek, '每周',  
1167 - onTap: () {  
1168 - if (!limitWeek) {  
1169 - setState(() {  
1170 - limitWeek = true;  
1171 -  
1172 - limitNone = false;  
1173 - limitBirthday = false;  
1174 - });  
1175 - }  
1176 - }),  
1177 - Spacer(),  
1178 - _itemRadioWidget(  
1179 - limitBirthday, '会员生日当天', onTap: () {  
1180 - if (!limitBirthday) {  
1181 - setState(() {  
1182 - limitBirthday = true;  
1183 - limitNone = false;  
1184 - limitWeek = false;  
1185 - });  
1186 - }  
1187 - }),  
1188 - HEmptyView(30),  
1189 - ],  
1190 - ),  
1191 - if (limitWeek) VEmptyView(30),  
1192 -  
1193 - if (limitWeek)  
1194 - _select1(weekShow, '', () async {  
1195 - FocusScope.of(context).requestFocus(  
1196 - FocusNode()); //点击空白处隐藏键盘  
1197 - //弹出时间选择器  
1198 - // showPickerDateTime(context);  
1199 - showDateSelWidget = false;  
1200 -  
1201 - List<FilterBtnModel> data = await DialogUtil  
1202 - .openCoponsWeekSelectModalBottomSheet(  
1203 - context, weekData);  
1204 - if (data != null) {  
1205 - //改变了  
1206 - weekData = [];  
1207 - weekData.addAll(data);  
1208 - weekShow = '';  
1209 -  
1210 - String noonStr = '午餐:';  
1211 - String nightStr = '晚餐:';  
1212 -  
1213 - weekData.forEach((element) {  
1214 - if (element.selectNoon) {  
1215 - noonStr += '${element.title} ';  
1216 - }  
1217 - if (element.selectNig) {  
1218 - nightStr += '${element.title} ';  
1219 - }  
1220 - });  
1221 - if (noonStr.endsWith(' ')) {  
1222 - noonStr = noonStr.substring(  
1223 - 0, noonStr.length - 1);  
1224 - }  
1225 - if (nightStr.endsWith(' ')) {  
1226 - nightStr = nightStr.substring(  
1227 - 0, nightStr.length - 1);  
1228 - } 1221 + _textfield('领取后有效天数', '点击输入,0表示到活动结束', _limitDay,
  1222 + _limitDayFocusNode,
  1223 + textInputType: TextInputType.number),
  1224 + Container(
  1225 + height: ScreenUtil().setWidth(2),
  1226 + color: MyColours.color_E7E7E7,
  1227 + ),
  1228 + VEmptyView(24),
1229 1229
1230 - if (noonStr == '午餐:' &&  
1231 - nightStr == '晚餐:') {  
1232 - weekShow = '点击设置可用日期';  
1233 - } else {  
1234 - if (noonStr != '午餐:' &&  
1235 - nightStr != '晚餐:') {  
1236 - weekShow =  
1237 - noonStr + '\n' + nightStr;  
1238 - } else if (noonStr != '午餐:') {  
1239 - weekShow = noonStr;  
1240 - } else {  
1241 - weekShow = nightStr;  
1242 - }  
1243 - } 1230 + _select('不可用日期', weekShow, () async {
  1231 + FocusScope.of(context)
  1232 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  1233 + //弹出时间选择器
  1234 + // showPickerDateTime(context);
  1235 + showDateSelWidget = false;
  1236 +
  1237 + List<FilterBtnModel> data = await DialogUtil
  1238 + .openCoponsWeekSelectModalBottomSheet(
  1239 + context, weekData);
  1240 + if (data != null) {
  1241 + //改变了
  1242 + weekData = [];
  1243 + weekData.addAll(data);
  1244 + weekShow = '';
  1245 +
  1246 + String noonStr = '午餐:';
  1247 + String nightStr = '晚餐:';
  1248 +
  1249 + weekData.forEach((element) {
  1250 + if (element.selectNoon) {
  1251 + noonStr += '${element.title} ';
  1252 + }
  1253 + if (element.selectNig) {
  1254 + nightStr += '${element.title} ';
  1255 + }
  1256 + });
  1257 + if (noonStr.endsWith(' ')) {
  1258 + noonStr = noonStr.substring(
  1259 + 0, noonStr.length - 1);
  1260 + }
  1261 + if (nightStr.endsWith(' ')) {
  1262 + nightStr = nightStr.substring(
  1263 + 0, nightStr.length - 1);
  1264 + }
  1265 +
  1266 + if (noonStr == '午餐:' && nightStr == '晚餐:') {
  1267 + weekShow = '无';
  1268 + } else {
  1269 + if (noonStr != '午餐:' && nightStr != '晚餐:') {
  1270 + weekShow = noonStr + '\n' + nightStr;
  1271 + } else if (noonStr != '午餐:') {
  1272 + weekShow = noonStr;
  1273 + } else {
  1274 + weekShow = nightStr;
  1275 + }
  1276 + }
  1277 +
  1278 + setState(() {});
  1279 + }
  1280 + }),
  1281 + Container(
  1282 + height: ScreenUtil().setWidth(2),
  1283 + color: MyColours.color_E7E7E7,
  1284 + ),
  1285 + VEmptyView(48),
1244 1286
1245 - setState(() {});  
1246 - }  
1247 - }),  
1248 - limitWeek ? VEmptyView(22) : VEmptyView(48),  
1249 - Container(  
1250 - height: ScreenUtil().setWidth(2),  
1251 - color: MyColours.color_E7E7E7,  
1252 - ),  
1253 - VEmptyView(48), 1287 + Container(
  1288 + alignment: Alignment.centerLeft,
  1289 + child: Text(
  1290 + '使用规则:',
  1291 + style: TextStyle(
  1292 + color: Color.fromRGBO(0, 0, 0, 0.9),
  1293 + fontWeight: FontWeight.bold,
  1294 + fontSize: ScreenUtil().setSp(32)),
  1295 + ),
  1296 + ),
  1297 + VEmptyView(24),
  1298 + Padding(
  1299 + padding: EdgeInsets.only(
  1300 + left: w(32),
  1301 + ),
  1302 + child: Column(
  1303 + children: [
  1304 + _canUse('领取当日可用', isSameDay, () {
  1305 + setState(() {
  1306 + isSameDay = !isSameDay;
  1307 + });
  1308 + }, isBig: false),
  1309 + _canUse('可以叠加使用其他优惠券', isAccumulation, () {
  1310 + setState(() {
  1311 + isAccumulation = !isAccumulation;
  1312 + });
  1313 + }, isBig: false),
  1314 + _canUse('可使用包间', isCompartment, () {
  1315 + setState(() {
  1316 + isCompartment = !isCompartment;
  1317 + });
  1318 + }, isBig: false),
  1319 + _canUse('堂食可用', isEatin, () {
  1320 + setState(() {
  1321 + isEatin = !isEatin;
  1322 + });
  1323 + }, isBig: false),
  1324 + _canUse('外带可用', isTakeout, () {
  1325 + setState(() {
  1326 + isTakeout = !isTakeout;
  1327 + });
  1328 + }, isBig: false),
  1329 + _canUse('是否需要提前预约', isAppointment, () {
  1330 + setState(() {
  1331 + isAppointment = !isAppointment;
  1332 + });
  1333 + }, isBig: false),
  1334 + ],
  1335 + ),
  1336 + ),
  1337 + VEmptyView(24),
  1338 + Container(
  1339 + alignment: Alignment.centerLeft,
  1340 + child: Text(
  1341 + '分享设置:',
  1342 + style: TextStyle(
  1343 + color: Color.fromRGBO(0, 0, 0, 0.9),
  1344 + fontWeight: FontWeight.bold,
  1345 + fontSize: ScreenUtil().setSp(32)),
  1346 + ),
  1347 + ),
  1348 + VEmptyView(24),
  1349 + Padding(
  1350 + padding: EdgeInsets.only(
  1351 + left: w(32),
  1352 + ),
  1353 + child: Column(
  1354 + children: [
  1355 + _canUse('用户可以分享给好友', isShareLose, () {
  1356 + setState(() {
  1357 + isShareLose = !isShareLose;
  1358 + });
  1359 + }, isBig: false),
  1360 + _canUse('用户分享给好友后继续拥有此券', isShareHave, () {
  1361 + setState(() {
  1362 + isShareHave = !isShareHave;
  1363 + });
  1364 + }, isBig: false),
  1365 + _canUse('分享核销后,分享用户获得佣金', isCommission, () {
  1366 + setState(() {
  1367 + isCommission = !isCommission;
  1368 + });
  1369 + }, isBig: false),
  1370 + _textfield(
  1371 + '分享佣金',
  1372 + '点击输入,0表示到活动结束',
  1373 + _commissionControl,
  1374 + _commissionFocusNode,
  1375 + textInputType: TextInputType.number),
1254 ], 1376 ],
1255 ), 1377 ),
  1378 + ),
  1379 + VEmptyView(24),
  1380 + Container(
  1381 + height: ScreenUtil().setWidth(2),
  1382 + color: MyColours.color_E7E7E7,
  1383 + ),
  1384 +
  1385 + // if (!widget.isMine)
  1386 + // Column(
  1387 + // children: [
  1388 + // //使用限制
  1389 + // VEmptyView(24),
  1390 + // Container(
  1391 + // alignment: Alignment.centerLeft,
  1392 + // child: Text(
  1393 + // '使用限制',
  1394 + // style: TextStyle(
  1395 + // color: Color.fromRGBO(0, 0, 0, 0.9),
  1396 + // fontWeight: FontWeight.bold,
  1397 + // fontSize: ScreenUtil().setSp(32)),
  1398 + // ),
  1399 + // ),
  1400 + // VEmptyView(40),
  1401 + // Row(
  1402 + // children: [
  1403 + // HEmptyView(30),
  1404 + // _itemRadioWidget(limitNone, '无',
  1405 + // onTap: () {
  1406 + // if (!limitNone) {
  1407 + // setState(() {
  1408 + // limitNone = true;
  1409 +
  1410 + // limitWeek = false;
  1411 + // limitBirthday = false;
  1412 + // });
  1413 + // }
  1414 + // }),
  1415 + // Spacer(),
  1416 + // _itemRadioWidget(limitWeek, '每周',
  1417 + // onTap: () {
  1418 + // if (!limitWeek) {
  1419 + // setState(() {
  1420 + // limitWeek = true;
  1421 +
  1422 + // limitNone = false;
  1423 + // limitBirthday = false;
  1424 + // });
  1425 + // }
  1426 + // }),
  1427 + // Spacer(),
  1428 + // _itemRadioWidget(
  1429 + // limitBirthday, '会员生日当天', onTap: () {
  1430 + // if (!limitBirthday) {
  1431 + // setState(() {
  1432 + // limitBirthday = true;
  1433 + // limitNone = false;
  1434 + // limitWeek = false;
  1435 + // });
  1436 + // }
  1437 + // }),
  1438 + // HEmptyView(30),
  1439 + // ],
  1440 + // ),
  1441 + // if (limitWeek) VEmptyView(30),
  1442 +
  1443 + // if (limitWeek)
  1444 + // _select1(weekShow, '', () async {
  1445 + // FocusScope.of(context).requestFocus(
  1446 + // FocusNode()); //点击空白处隐藏键盘
  1447 + // //弹出时间选择器
  1448 + // // showPickerDateTime(context);
  1449 + // showDateSelWidget = false;
  1450 +
  1451 + // List<FilterBtnModel> data = await DialogUtil
  1452 + // .openCoponsWeekSelectModalBottomSheet(
  1453 + // context, weekData);
  1454 + // if (data != null) {
  1455 + // //改变了
  1456 + // weekData = [];
  1457 + // weekData.addAll(data);
  1458 + // weekShow = '';
  1459 +
  1460 + // String noonStr = '午餐:';
  1461 + // String nightStr = '晚餐:';
  1462 +
  1463 + // weekData.forEach((element) {
  1464 + // if (element.selectNoon) {
  1465 + // noonStr += '${element.title} ';
  1466 + // }
  1467 + // if (element.selectNig) {
  1468 + // nightStr += '${element.title} ';
  1469 + // }
  1470 + // });
  1471 + // if (noonStr.endsWith(' ')) {
  1472 + // noonStr = noonStr.substring(
  1473 + // 0, noonStr.length - 1);
  1474 + // }
  1475 + // if (nightStr.endsWith(' ')) {
  1476 + // nightStr = nightStr.substring(
  1477 + // 0, nightStr.length - 1);
  1478 + // }
  1479 +
  1480 + // if (noonStr == '午餐:' &&
  1481 + // nightStr == '晚餐:') {
  1482 + // weekShow = '点击设置可用日期';
  1483 + // } else {
  1484 + // if (noonStr != '午餐:' &&
  1485 + // nightStr != '晚餐:') {
  1486 + // weekShow =
  1487 + // noonStr + '\n' + nightStr;
  1488 + // } else if (noonStr != '午餐:') {
  1489 + // weekShow = noonStr;
  1490 + // } else {
  1491 + // weekShow = nightStr;
  1492 + // }
  1493 + // }
  1494 +
  1495 + // setState(() {});
  1496 + // }
  1497 + // }),
  1498 + // limitWeek ? VEmptyView(22) : VEmptyView(48),
  1499 + // Container(
  1500 + // height: ScreenUtil().setWidth(2),
  1501 + // color: MyColours.color_E7E7E7,
  1502 + // ),
  1503 + // VEmptyView(48),
  1504 + // ],
  1505 + // ),
  1506 + widget.isMine ? VEmptyView(48) : VEmptyView(24),
1256 widget.isMine 1507 widget.isMine
1257 ? SizedBox() 1508 ? SizedBox()
1258 : _select('谁可以发放', '编辑', () async { 1509 : _select('谁可以发放', '编辑', () async {
@@ -1270,19 +1521,15 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1270,19 +1521,15 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1270 height: ScreenUtil().setWidth(2), 1521 height: ScreenUtil().setWidth(2),
1271 color: MyColours.color_E7E7E7, 1522 color: MyColours.color_E7E7E7,
1272 ), 1523 ),
1273 - widget.isMine ? SizedBox() : VEmptyView(24),  
1274 - widget.isMine  
1275 - ? SizedBox()  
1276 - : _textfield('发放总量限制', '点击输入总数量限制',  
1277 - _limitNumControl, _limitNumFocusNode,  
1278 - textInputType: TextInputType.number),  
1279 - widget.isMine  
1280 - ? SizedBox()  
1281 - : Container(  
1282 - height: ScreenUtil().setWidth(2),  
1283 - color: MyColours.color_E7E7E7,  
1284 - ),  
1285 - widget.isMine ? SizedBox() : VEmptyView(24), 1524 + widget.isMine ? SizedBox() : VEmptyView(48),
  1525 + _textfield('发放总量限制', '点击输入总数量限制',
  1526 + _limitNumControl, _limitNumFocusNode,
  1527 + textInputType: TextInputType.number),
  1528 + Container(
  1529 + height: ScreenUtil().setWidth(2),
  1530 + color: MyColours.color_E7E7E7,
  1531 + ),
  1532 + VEmptyView(24),
1286 _explain('券说明', '例:可用包间,停车免费,不与店内其他活动共享等'), 1533 _explain('券说明', '例:可用包间,停车免费,不与店内其他活动共享等'),
1287 VEmptyView(20), 1534 VEmptyView(20),
1288 _canUse('立即启用', swichState, () { 1535 _canUse('立即启用', swichState, () {
@@ -1313,6 +1560,11 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1313,6 +1560,11 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1313 Utils.showToast('请填写券名称'); 1560 Utils.showToast('请填写券名称');
1314 return; 1561 return;
1315 } 1562 }
  1563 + if (_priceControl.text.trim().length == 0) {
  1564 + Utils.showToast(widget.isMine ? '请填写券金额' : '请填写销售价');
  1565 + return;
  1566 + }
  1567 +
1316 if (!widget.isMine) { 1568 if (!widget.isMine) {
1317 if (money && moneyControl.text.trim().length == 0) { 1569 if (money && moneyControl.text.trim().length == 0) {
1318 Utils.showToast('请输入代金券金额!'); 1570 Utils.showToast('请输入代金券金额!');
@@ -1327,42 +1579,54 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1327,42 +1579,54 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1327 Utils.showToast('请输入菜品!'); 1579 Utils.showToast('请输入菜品!');
1328 return; 1580 return;
1329 } 1581 }
1330 -  
1331 - if (limitWeek && weekShow == '点击设置可用日期') {  
1332 - Utils.showToast('请设置可用日期!');  
1333 - return;  
1334 - }  
1335 - if (uids == null || uids == '') {  
1336 - Utils.showToast('请设置发放人!');  
1337 - return;  
1338 - }  
1339 -  
1340 - bool isNumber = Utils.isInteger(  
1341 - _limitNumControl.text.trim()); //判断输入的内容是否是数字  
1342 - if (!isNumber) {  
1343 - Utils.showToast('发放总量限制请输入数字');  
1344 - _limitNumControl.text = '';  
1345 - return;  
1346 - }  
1347 } 1582 }
  1583 +
1348 if (_couponRequireEditControl.text.trim().length == 0) { 1584 if (_couponRequireEditControl.text.trim().length == 0) {
1349 - Utils.showToast('请填写券要求'); 1585 + Utils.showToast('请填写消费要求');
1350 return; 1586 return;
1351 } 1587 }
1352 if (fromDate == '点击选择') { 1588 if (fromDate == '点击选择') {
1353 - Utils.showToast('请选择有效期起始时间'); 1589 + Utils.showToast('请选择活动开始时间');
1354 return; 1590 return;
1355 } 1591 }
1356 if (endDate == '点击选择') { 1592 if (endDate == '点击选择') {
1357 - Utils.showToast('请选择有效期结束时间'); 1593 + Utils.showToast('请选择活动结束时间');
1358 return; 1594 return;
1359 } 1595 }
  1596 +
1360 if (DateUtil.getDateTime(endDate) 1597 if (DateUtil.getDateTime(endDate)
1361 .compareTo(DateUtil.getDateTime(fromDate)) < 1598 .compareTo(DateUtil.getDateTime(fromDate)) <
1362 0) { 1599 0) {
1363 - Utils.showToast('有效期结束时间不能早于起始时间'); 1600 + Utils.showToast('活动结束时间不能早于活动开始时间');
  1601 + return;
  1602 + }
  1603 + if (_limitDay.text.trim().length == 0) {
  1604 + Utils.showToast('请填写领取后有效天数');
  1605 + return;
  1606 + }
  1607 +
  1608 + if (isCommission &&
  1609 + _commissionControl.text.trim().length == 0) {
  1610 + Utils.showToast('请填写分享佣金的比例');
  1611 + return;
  1612 + }
  1613 + if (!widget.isMine) {
  1614 + if (uids == null || uids == '') {
  1615 + Utils.showToast('请设置发放人!');
  1616 + return;
  1617 + }
  1618 + }
  1619 + if (_limitNumControl.text.trim().length == 0) {
  1620 + Utils.showToast('请填写发放总量限制');
1364 return; 1621 return;
1365 } 1622 }
  1623 + // bool isNumber = Utils.isInteger(
  1624 + // _limitNumControl.text.trim()); //判断输入的内容是否是数字
  1625 + // if (!isNumber) {
  1626 + // Utils.showToast('发放总量限制请输入数字');
  1627 + // _limitNumControl.text = '';
  1628 + // return;
  1629 + // }
1366 1630
1367 // ***参数*** 1631 // ***参数***
1368 // _couponNameEditControl.text 1632 // _couponNameEditControl.text
@@ -1375,8 +1639,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1375,8 +1639,8 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1375 } 1639 }
1376 }, 1640 },
1377 text: '立即创建', 1641 text: '立即创建',
1378 - fontSize: 24,  
1379 - isBold: false, 1642 + fontSize: 32,
  1643 + isBold: true,
1380 height: ScreenUtil().setWidth(37 * 2), 1644 height: ScreenUtil().setWidth(37 * 2),
1381 width: ScreenUtil().setWidth(130 * 2), 1645 width: ScreenUtil().setWidth(130 * 2),
1382 radius: ScreenUtil().setWidth(22), 1646 radius: ScreenUtil().setWidth(22),
@@ -64,268 +64,10 @@ class _CouponItemFState extends State<CouponItemF> { @@ -64,268 +64,10 @@ class _CouponItemFState extends State<CouponItemF> {
64 ? Alignment.centerLeft 64 ? Alignment.centerLeft
65 : AlignmentDirectional.topStart, 65 : AlignmentDirectional.topStart,
66 children: [ 66 children: [
67 - InkWell(  
68 - onTap: widget.onPressed,  
69 - child: Container(  
70 - // width: ScreenUtil().setWidth(610),  
71 - margin: EdgeInsets.fromLTRB(  
72 - ScreenUtil().setWidth(40),  
73 - ScreenUtil().setWidth(0),  
74 - ScreenUtil().setWidth(40),  
75 - ScreenUtil().setWidth(0)),  
76 - decoration: BoxDecoration(  
77 - color: MyColours.color_ffffff,  
78 - boxShadow: [  
79 - BoxShadow(  
80 - spreadRadius: ScreenUtil().setWidth(2),  
81 - color: Color.fromRGBO(0, 0, 0, 0.25),  
82 - offset: Offset(0, ScreenUtil().setWidth(8)),  
83 - blurRadius: ScreenUtil().setWidth(8))  
84 - ],  
85 - borderRadius: BorderRadius.all(  
86 - Radius.circular(ScreenUtil().setWidth(16)),  
87 - ),  
88 - ),  
89 - child: Column(  
90 - mainAxisSize: MainAxisSize.min,  
91 - crossAxisAlignment: CrossAxisAlignment.start,  
92 - children: [  
93 - Container(  
94 - height: ScreenUtil().setWidth(40),  
95 - padding: EdgeInsets.symmetric(  
96 - horizontal: ScreenUtil().setWidth(24)),  
97 - decoration: BoxDecoration(  
98 - color: widget.from == 'history'  
99 - ? MyColours.color_BFC4D4  
100 - : notSelect  
101 - ? sunModel.isType == '1'  
102 - ? sunModel.isMarking  
103 - ? MyColours.color_00A870  
104 - : MyColours.color_438E93  
105 - : MyColours.color_ED7B2F  
106 - : MyColours.color_999999,  
107 - borderRadius: BorderRadius.only(  
108 - topLeft:  
109 - Radius.circular(ScreenUtil().setWidth(16)),  
110 - topRight: Radius.circular(  
111 - ScreenUtil().setWidth(16)))),  
112 - child: Row(  
113 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
114 - children: [  
115 - Text(  
116 - sunModel.isType == '1'  
117 - ? sunModel.isExamine == '1'  
118 - ? '店铺优惠券(核销)'  
119 - : '店铺优惠券'  
120 - : '我的优惠券',  
121 - style: TextStyle(  
122 - color: MyColours.color_ffffff,  
123 - fontSize: ScreenUtil().setSp(24)),  
124 - ),  
125 - InkWell(  
126 - onTap: widget.onPressedSwich,  
127 - child: Text(  
128 - sunModel.isType == '1'  
129 - ? sunModel.isExamine == '1'  
130 - ? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'  
131 - : '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'  
132 - : '被领取:${sunModel.receiveNum}张',  
133 - maxLines: 1,  
134 - overflow: TextOverflow.ellipsis,  
135 - style: TextStyle(  
136 - color: MyColours.color_ffffff,  
137 - fontSize: ScreenUtil().setSp(20))),  
138 - ),  
139 - ],  
140 - ),  
141 - ),  
142 - Container(  
143 - padding: EdgeInsets.fromLTRB(  
144 - ScreenUtil().setWidth(24 * 2),  
145 - ScreenUtil().setWidth(9 * 2),  
146 - ScreenUtil().setWidth(10),  
147 - ScreenUtil().setWidth(20)),  
148 - child: Column(  
149 - crossAxisAlignment: CrossAxisAlignment.start,  
150 - children: [  
151 - Container(  
152 - width: ScreenUtil().setWidth(232 * 2),  
153 - child: Container(  
154 - height: ScreenUtil().setWidth(25 * 2),  
155 - constraints: BoxConstraints(  
156 - maxWidth: ScreenUtil().setWidth(190)),  
157 - child: Text(  
158 - sunModel.aname,  
159 - maxLines: 2,  
160 - overflow: TextOverflow.ellipsis,  
161 - style: TextStyle(  
162 - color: widget.from == 'history'  
163 - ? MyColours.color_BFC4D4  
164 - : notSelect  
165 - ? MyColours.color_515151  
166 - : MyColours.color_999999,  
167 - fontSize: ScreenUtil().setSp(36),  
168 - fontWeight: FontWeight.bold),  
169 - ),  
170 - )),  
171 - Container(  
172 - height: ScreenUtil().setWidth(14 * 2),  
173 - width: ScreenUtil().setWidth(232 * 2),  
174 - child: Text('${sunModel.desc}',  
175 - maxLines: 1,  
176 - overflow: TextOverflow.ellipsis,  
177 - style: TextStyle(  
178 - color: widget.from == 'history'  
179 - ? MyColours.color_BFC4D4  
180 - : notSelect  
181 - ? MyColours.color_515151  
182 - : MyColours.color_999999,  
183 - fontSize: ScreenUtil().setSp(20),  
184 - )),  
185 - ),  
186 - VEmptyView(16),  
187 - (ObjectUtil.isNotEmpty(sunModel.stime) &&  
188 - sunModel.stime != '0') ||  
189 - (ObjectUtil.isNotEmpty(sunModel.etime) &&  
190 - sunModel.etime != '0')  
191 - ? Container(  
192 - child: Text(  
193 - '使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',  
194 - style: TextStyle(  
195 - color: widget.from == 'history'  
196 - ? MyColours.color_BFC4D4  
197 - : MyColours.color_999999,  
198 - fontSize: ScreenUtil().setSp(20))),  
199 - )  
200 - : Container(),  
201 - ],  
202 - ),  
203 - // widget.from == 'select'  
204 - // ? widget.showCheck  
205 - // ? Positioned(  
206 - // right: 0,  
207 - // top: ScreenUtil().setWidth(20),  
208 - // child: Image.asset(  
209 - // Utils.getImgPath(widget.couponSonModel.isCheck  
210 - // ? 'check_r'  
211 - // : 'check_un'),  
212 - // width: ScreenUtil().setWidth(40),  
213 - // height: ScreenUtil().setWidth(40),  
214 - // ))  
215 - // : Container()  
216 - // :  
217 - ),  
218 - ObjectUtil.isNotEmpty(sunModel.explain)  
219 - ? const MySeparator(  
220 - width: 3, color: MyColours.color_f3f3f3)  
221 - : SizedBox(),  
222 - ObjectUtil.isNotEmpty(sunModel.explain)  
223 - ? InkWell(  
224 - onTap: () {  
225 - if (explainH > 19) {  
226 - setState(() {  
227 - widget.couponSonModel.showText =  
228 - !widget.couponSonModel.showText;  
229 - });  
230 - }  
231 - },  
232 - child: Container(  
233 - width: double.infinity,  
234 - decoration: BoxDecoration(  
235 - color: widget.from == 'history'  
236 - ? MyColours.color_ffffff  
237 - : notSelect  
238 - ? MyColours.color_ffffff  
239 - : MyColours.color_FAFAFA,  
240 - borderRadius: BorderRadius.only(  
241 - bottomLeft: Radius.circular(  
242 - ScreenUtil().setWidth(20)),  
243 - bottomRight: Radius.circular(  
244 - ScreenUtil().setWidth(20)))),  
245 - child: Row(  
246 - crossAxisAlignment:  
247 - CrossAxisAlignment.start,  
248 - children: [  
249 - widget.couponSonModel.showText  
250 - ? Container(  
251 - padding: EdgeInsets.fromLTRB(  
252 - ScreenUtil().setWidth(24 * 2),  
253 - ScreenUtil().setWidth(14),  
254 - ScreenUtil().setWidth(0),  
255 - ScreenUtil().setWidth(14)),  
256 - width: ScreenUtil().screenWidth -  
257 - ScreenUtil().setWidth(92 * 2),  
258 - child: Text(  
259 - '说明:${sunModel.explain}',  
260 - maxLines: 5,  
261 - style: TextStyle(  
262 - color: widget.from ==  
263 - 'history'  
264 - ? MyColours  
265 - .color_BFC4D4  
266 - : MyColours  
267 - .color_999999,  
268 - fontSize: ScreenUtil()  
269 - .setSp(20))),  
270 - )  
271 - : Container(  
272 - padding: EdgeInsets.fromLTRB(  
273 - ScreenUtil().setWidth(24 * 2),  
274 - ScreenUtil().setWidth(14),  
275 - ScreenUtil().setWidth(0),  
276 - ScreenUtil().setWidth(14)),  
277 - width: ScreenUtil().screenWidth -  
278 - ScreenUtil()  
279 - .setWidth(92 * 2) +  
280 - ScreenUtil().setWidth(20),  
281 - child: Text(  
282 - '说明:${sunModel.explain}',  
283 - maxLines: 1,  
284 - overflow: TextOverflow.fade,  
285 - softWrap: false,  
286 - style: TextStyle(  
287 - color: widget.from ==  
288 - 'history'  
289 - ? MyColours  
290 - .color_BFC4D4  
291 - : MyColours  
292 - .color_999999,  
293 - fontSize: ScreenUtil()  
294 - .setSp(20))),  
295 - ),  
296 - Spacer(),  
297 - explainH > 19  
298 - ? Container(  
299 - margin: EdgeInsets.only(  
300 - top:  
301 - ScreenUtil().setWidth(10),  
302 - right: ScreenUtil()  
303 - .setWidth(16)),  
304 - child: Image.asset(  
305 - !widget.couponSonModel  
306 - .showText  
307 - ? Utils.getImgPath(  
308 - 'quan_down_f')  
309 - : Utils.getImgPath(  
310 - 'quan_up_f'),  
311 - width:  
312 - ScreenUtil().setWidth(28),  
313 - height: ScreenUtil()  
314 - .setWidth(28)),  
315 - )  
316 - : Container(),  
317 - HEmptyView(14)  
318 - ],  
319 - )),  
320 - )  
321 - : Container(),  
322 - VEmptyView(32),  
323 - ],  
324 - ),  
325 - )),  
326 - Positioned(  
327 - left: ScreenUtil().setWidth(21),  
328 - child: widget.from == 'select' 67 + Row(
  68 + children: [
  69 + HEmptyView(20),
  70 + widget.from == 'select'
329 ? Image.asset( 71 ? Image.asset(
330 Utils.getImgPath(sunModel.isCheck 72 Utils.getImgPath(sunModel.isCheck
331 ? widget.radio 73 ? widget.radio
@@ -334,9 +76,324 @@ class _CouponItemFState extends State<CouponItemF> { @@ -334,9 +76,324 @@ class _CouponItemFState extends State<CouponItemF> {
334 : widget.radio 76 : widget.radio
335 ? 'show_select_f' 77 ? 'show_select_f'
336 : 'c_not_edit'), 78 : 'c_not_edit'),
337 - width: w(25), 79 + width: w(20),
338 ) 80 )
339 - : Container()), 81 + : Container(),
  82 + Expanded(
  83 + child: InkWell(
  84 + onTap: widget.onPressed,
  85 + child: Container(
  86 + // width: ScreenUtil().setWidth(610),
  87 + margin: EdgeInsets.fromLTRB(
  88 + ScreenUtil().setWidth(20),
  89 + ScreenUtil().setWidth(0),
  90 + ScreenUtil().setWidth(40),
  91 + ScreenUtil().setWidth(0)),
  92 + decoration: BoxDecoration(
  93 + color: MyColours.color_ffffff,
  94 + boxShadow: [
  95 + BoxShadow(
  96 + spreadRadius: ScreenUtil().setWidth(2),
  97 + color: Color.fromRGBO(0, 0, 0, 0.25),
  98 + offset: Offset(0, ScreenUtil().setWidth(8)),
  99 + blurRadius: ScreenUtil().setWidth(8))
  100 + ],
  101 + borderRadius: BorderRadius.all(
  102 + Radius.circular(ScreenUtil().setWidth(16)),
  103 + ),
  104 + ),
  105 + child: Column(
  106 + mainAxisSize: MainAxisSize.min,
  107 + crossAxisAlignment: CrossAxisAlignment.start,
  108 + children: [
  109 + Container(
  110 + height: ScreenUtil().setWidth(40),
  111 + padding: EdgeInsets.symmetric(
  112 + horizontal: ScreenUtil().setWidth(24)),
  113 + decoration: BoxDecoration(
  114 + color: widget.from == 'history'
  115 + ? MyColours.color_BFC4D4
  116 + : widget.from == 'setting'
  117 + ? MyColours.color_00A870
  118 + : notSelect
  119 + ? sunModel.isType == '1' ||
  120 + sunModel.isType ==
  121 + '3' ||
  122 + sunModel.isType == '4'
  123 + ? sunModel.isMarking
  124 + ? MyColours.color_00A870
  125 + : MyColours.color_438E93
  126 + : MyColours.color_ED7B2F
  127 + : MyColours.color_999999,
  128 + borderRadius: BorderRadius.only(
  129 + topLeft: Radius.circular(
  130 + ScreenUtil().setWidth(16)),
  131 + topRight: Radius.circular(
  132 + ScreenUtil().setWidth(16)))),
  133 + child: Row(
  134 + mainAxisAlignment:
  135 + MainAxisAlignment.spaceBetween,
  136 + children: [
  137 + Text(
  138 + sunModel.isType == '1'
  139 + ? sunModel.isExamine == '1'
  140 + ? '店铺优惠券(核销)'
  141 + : '店铺优惠券'
  142 + : sunModel.isType == '2'
  143 + ? '我的优惠券'
  144 + : sunModel.isType == '3'
  145 + ? '免费代金券'
  146 + : '付费优惠券',
  147 + style: TextStyle(
  148 + color: MyColours.color_ffffff,
  149 + fontSize: ScreenUtil().setSp(24)),
  150 + ),
  151 + InkWell(
  152 + onTap: widget.onPressedSwich,
  153 + child: Text(
  154 + sunModel.isType == '1'
  155 + ? sunModel.isExamine == '1'
  156 + ? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
  157 + : '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
  158 + : sunModel.isType == '2'
  159 + ? '被领取:${sunModel.receiveNum}张'
  160 + : '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张',
  161 + maxLines: 1,
  162 + overflow: TextOverflow.ellipsis,
  163 + style: TextStyle(
  164 + color: MyColours.color_ffffff,
  165 + fontSize:
  166 + ScreenUtil().setSp(20))),
  167 + ),
  168 + ],
  169 + ),
  170 + ),
  171 + Container(
  172 + padding: EdgeInsets.fromLTRB(
  173 + ScreenUtil().setWidth(24 * 2),
  174 + ScreenUtil().setWidth(9 * 2),
  175 + ScreenUtil().setWidth(10),
  176 + ScreenUtil().setWidth(20)),
  177 + child: Column(
  178 + crossAxisAlignment: CrossAxisAlignment.start,
  179 + children: [
  180 + Container(
  181 + width: ScreenUtil().setWidth(232 * 2),
  182 + child: Container(
  183 + height: ScreenUtil().setWidth(25 * 2),
  184 + constraints: BoxConstraints(
  185 + maxWidth:
  186 + ScreenUtil().setWidth(190)),
  187 + child: Text(
  188 + sunModel.aname,
  189 + maxLines: 2,
  190 + overflow: TextOverflow.ellipsis,
  191 + style: TextStyle(
  192 + color: widget.from == 'history'
  193 + ? MyColours.color_BFC4D4
  194 + : notSelect
  195 + ? MyColours.color_515151
  196 + : MyColours
  197 + .color_999999,
  198 + fontSize:
  199 + ScreenUtil().setSp(36),
  200 + fontWeight: FontWeight.bold),
  201 + ),
  202 + )),
  203 + Container(
  204 + height: ScreenUtil().setWidth(14 * 2),
  205 + width: ScreenUtil().setWidth(232 * 2),
  206 + child: Text(
  207 + sunModel.isType == '1' ||
  208 + sunModel.isType == '2'
  209 + ? '${sunModel.desc}'
  210 + : sunModel.desc == '0'
  211 + ? ''
  212 + : '消费满${sunModel.desc}元可用',
  213 + maxLines: 1,
  214 + overflow: TextOverflow.ellipsis,
  215 + style: TextStyle(
  216 + color: widget.from == 'history'
  217 + ? MyColours.color_BFC4D4
  218 + : notSelect
  219 + ? MyColours.color_515151
  220 + : MyColours.color_999999,
  221 + fontSize: ScreenUtil().setSp(20),
  222 + )),
  223 + ),
  224 + VEmptyView(16),
  225 + (ObjectUtil.isNotEmpty(sunModel.stime) &&
  226 + sunModel.stime != '0') ||
  227 + (ObjectUtil.isNotEmpty(
  228 + sunModel.etime) &&
  229 + sunModel.etime != '0')
  230 + ? Container(
  231 + child: Text(
  232 + '使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
  233 + style: TextStyle(
  234 + color: widget.from ==
  235 + 'history'
  236 + ? MyColours.color_BFC4D4
  237 + : MyColours
  238 + .color_999999,
  239 + fontSize: ScreenUtil()
  240 + .setSp(20))),
  241 + )
  242 + : Container(),
  243 + ],
  244 + ),
  245 + // widget.from == 'select'
  246 + // ? widget.showCheck
  247 + // ? Positioned(
  248 + // right: 0,
  249 + // top: ScreenUtil().setWidth(20),
  250 + // child: Image.asset(
  251 + // Utils.getImgPath(widget.couponSonModel.isCheck
  252 + // ? 'check_r'
  253 + // : 'check_un'),
  254 + // width: ScreenUtil().setWidth(40),
  255 + // height: ScreenUtil().setWidth(40),
  256 + // ))
  257 + // : Container()
  258 + // :
  259 + ),
  260 + ObjectUtil.isNotEmpty(sunModel.explain)
  261 + ? const MySeparator(
  262 + width: 3, color: MyColours.color_f3f3f3)
  263 + : SizedBox(),
  264 + ObjectUtil.isNotEmpty(sunModel.explain)
  265 + ? InkWell(
  266 + onTap: () {
  267 + if (explainH > 19) {
  268 + setState(() {
  269 + widget.couponSonModel.showText =
  270 + !widget.couponSonModel.showText;
  271 + });
  272 + }
  273 + },
  274 + child: Container(
  275 + width: double.infinity,
  276 + decoration: BoxDecoration(
  277 + color: widget.from == 'history'
  278 + ? MyColours.color_ffffff
  279 + : notSelect
  280 + ? MyColours.color_ffffff
  281 + : MyColours.color_FAFAFA,
  282 + borderRadius: BorderRadius.only(
  283 + bottomLeft: Radius.circular(
  284 + ScreenUtil()
  285 + .setWidth(20)),
  286 + bottomRight: Radius.circular(
  287 + ScreenUtil()
  288 + .setWidth(20)))),
  289 + child: Row(
  290 + crossAxisAlignment:
  291 + CrossAxisAlignment.start,
  292 + children: [
  293 + widget.couponSonModel.showText
  294 + ? Container(
  295 + padding:
  296 + EdgeInsets.fromLTRB(
  297 + ScreenUtil()
  298 + .setWidth(
  299 + 24 * 2),
  300 + ScreenUtil()
  301 + .setWidth(14),
  302 + ScreenUtil()
  303 + .setWidth(0),
  304 + ScreenUtil()
  305 + .setWidth(
  306 + 14)),
  307 + width: ScreenUtil()
  308 + .screenWidth -
  309 + ScreenUtil()
  310 + .setWidth(92 * 2),
  311 + child: Text(
  312 + '说明:${sunModel.explain}',
  313 + maxLines: 5,
  314 + style: TextStyle(
  315 + color: widget
  316 + .from ==
  317 + 'history'
  318 + ? MyColours
  319 + .color_BFC4D4
  320 + : MyColours
  321 + .color_999999,
  322 + fontSize:
  323 + ScreenUtil()
  324 + .setSp(
  325 + 20))),
  326 + )
  327 + : Container(
  328 + padding:
  329 + EdgeInsets.fromLTRB(
  330 + ScreenUtil()
  331 + .setWidth(
  332 + 24 * 2),
  333 + ScreenUtil()
  334 + .setWidth(14),
  335 + ScreenUtil()
  336 + .setWidth(0),
  337 + ScreenUtil()
  338 + .setWidth(
  339 + 14)),
  340 + width: ScreenUtil()
  341 + .screenWidth -
  342 + ScreenUtil().setWidth(
  343 + 92 * 2) +
  344 + ScreenUtil()
  345 + .setWidth(20),
  346 + child: Text(
  347 + '说明:${sunModel.explain}',
  348 + maxLines: 1,
  349 + overflow:
  350 + TextOverflow.fade,
  351 + softWrap: false,
  352 + style: TextStyle(
  353 + color: widget
  354 + .from ==
  355 + 'history'
  356 + ? MyColours
  357 + .color_BFC4D4
  358 + : MyColours
  359 + .color_999999,
  360 + fontSize:
  361 + ScreenUtil()
  362 + .setSp(
  363 + 20))),
  364 + ),
  365 + Spacer(),
  366 + explainH > 19
  367 + ? Container(
  368 + margin: EdgeInsets.only(
  369 + top: ScreenUtil()
  370 + .setWidth(10),
  371 + right: ScreenUtil()
  372 + .setWidth(16)),
  373 + child: Image.asset(
  374 + !widget.couponSonModel
  375 + .showText
  376 + ? Utils.getImgPath(
  377 + 'quan_down_f')
  378 + : Utils.getImgPath(
  379 + 'quan_up_f'),
  380 + width: ScreenUtil()
  381 + .setWidth(28),
  382 + height: ScreenUtil()
  383 + .setWidth(28)),
  384 + )
  385 + : Container(),
  386 + HEmptyView(14)
  387 + ],
  388 + )),
  389 + )
  390 + : Container(),
  391 + VEmptyView(32),
  392 + ],
  393 + ),
  394 + ))),
  395 + ],
  396 + ),
340 Positioned( 397 Positioned(
341 right: ScreenUtil().setWidth(100), 398 right: ScreenUtil().setWidth(100),
342 top: ScreenUtil().setWidth(37 * 2), 399 top: ScreenUtil().setWidth(37 * 2),
@@ -194,14 +194,14 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -194,14 +194,14 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
194 backgroundColor: MyColours.color_f3f3f3, 194 backgroundColor: MyColours.color_f3f3f3,
195 appBar: Utils.getAuthority(context, '线上券-设置') 195 appBar: Utils.getAuthority(context, '线上券-设置')
196 ? SystemAppBar( 196 ? SystemAppBar(
197 - '线上券', 197 + '优惠券',
198 rightImgName: 'set_g.png', 198 rightImgName: 'set_g.png',
199 onTapRight: () { 199 onTapRight: () {
200 NavigatorUtil.goCouponSettingPage(context); 200 NavigatorUtil.goCouponSettingPage(context);
201 }, 201 },
202 ) 202 )
203 : SystemAppBar( 203 : SystemAppBar(
204 - '线上券', 204 + '优惠券',
205 ), 205 ),
206 body: Column( 206 body: Column(
207 children: <Widget>[ 207 children: <Widget>[
@@ -211,16 +211,22 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -211,16 +211,22 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
211 color: MyColours.color_ffffff, 211 color: MyColours.color_ffffff,
212 padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(6)), 212 padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(6)),
213 child: TabBar( 213 child: TabBar(
  214 + isScrollable: true, // 允许滚动
  215 + padding: EdgeInsets.only(left: w(15)),
  216 + // labelPadding:
  217 + // EdgeInsets.only(left: 16.0, right: 16.0), // 调整标签周围的空白区域
214 controller: tabController, 218 controller: tabController,
  219 +
215 tabs: [ 220 tabs: [
216 Tab( 221 Tab(
217 text: "全部", 222 text: "全部",
218 ), 223 ),
  224 +
219 Tab( 225 Tab(
220 - text: "店铺优惠券", 226 + text: "免费代金券",
221 ), 227 ),
222 Tab( 228 Tab(
223 - text: "我的优惠券", 229 + text: "付费优惠券",
224 ), 230 ),
225 Tab( 231 Tab(
226 text: "核销记录", 232 text: "核销记录",
@@ -233,7 +239,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -233,7 +239,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
233 unselectedLabelColor: MyColours.color_999999, 239 unselectedLabelColor: MyColours.color_999999,
234 labelStyle: TextStyle( 240 labelStyle: TextStyle(
235 color: MyColours.color_438E93, 241 color: MyColours.color_438E93,
236 - fontSize: ScreenUtil().setSp(25), 242 + fontSize: ScreenUtil().setSp(28),
237 fontWeight: FontWeight.bold), 243 fontWeight: FontWeight.bold),
238 unselectedLabelStyle: TextStyle( 244 unselectedLabelStyle: TextStyle(
239 color: MyColours.color_999999, 245 color: MyColours.color_999999,
@@ -254,12 +260,12 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -254,12 +260,12 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
254 create: (_) => PersonnelProvider(), 260 create: (_) => PersonnelProvider(),
255 child: ChangeNotifierProvider<MarketingCenterProvider>( 261 child: ChangeNotifierProvider<MarketingCenterProvider>(
256 create: (_) => MarketingCenterProvider(), 262 create: (_) => MarketingCenterProvider(),
257 - child: CouponSunPage(index: 1))), 263 + child: CouponSunPage(index: 3))),
258 ChangeNotifierProvider<PersonnelProvider>( 264 ChangeNotifierProvider<PersonnelProvider>(
259 create: (_) => PersonnelProvider(), 265 create: (_) => PersonnelProvider(),
260 child: ChangeNotifierProvider<MarketingCenterProvider>( 266 child: ChangeNotifierProvider<MarketingCenterProvider>(
261 create: (_) => MarketingCenterProvider(), 267 create: (_) => MarketingCenterProvider(),
262 - child: CouponSunPage(index: 2))), 268 + child: CouponSunPage(index: 4))),
263 ChangeNotifierProvider<PersonnelProvider>( 269 ChangeNotifierProvider<PersonnelProvider>(
264 create: (_) => PersonnelProvider(), 270 create: (_) => PersonnelProvider(),
265 child: CouponHasVerificationPage()), 271 child: CouponHasVerificationPage()),
@@ -271,8 +277,8 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -271,8 +277,8 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
271 padding: EdgeInsets.only( 277 padding: EdgeInsets.only(
272 top: ScreenUtil().setWidth(16 * 2), 278 top: ScreenUtil().setWidth(16 * 2),
273 bottom: ScreenUtil().setWidth(35 * 2), 279 bottom: ScreenUtil().setWidth(35 * 2),
274 - left: ScreenUtil().setWidth(45 * 2),  
275 - right: ScreenUtil().setWidth(45 * 2), 280 + left: ScreenUtil().setWidth(23 * 2),
  281 + right: ScreenUtil().setWidth(23 * 2),
276 ), 282 ),
277 decoration: BoxDecoration( 283 decoration: BoxDecoration(
278 color: MyColours.color_ffffff, 284 color: MyColours.color_ffffff,
@@ -293,10 +299,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -293,10 +299,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
293 tabController.index == 3 299 tabController.index == 3
294 ? Expanded( 300 ? Expanded(
295 child: RoundButton( 301 child: RoundButton(
296 - text: '扫码核销', 302 + text: '扫码核销付费券',
297 width: tabController.index == 3 303 width: tabController.index == 3
298 ? double.infinity 304 ? double.infinity
299 - : w(100), 305 + : w(218),
300 gradientStart: MyColours.color_ffffff, 306 gradientStart: MyColours.color_ffffff,
301 gradientEnd: MyColours.color_ffffff, 307 gradientEnd: MyColours.color_ffffff,
302 borderColor: MyColours.color_438E93, 308 borderColor: MyColours.color_438E93,
@@ -304,15 +310,15 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -304,15 +310,15 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
304 height: ScreenUtil().setWidth(80), 310 height: ScreenUtil().setWidth(80),
305 radius: ScreenUtil().setWidth(14), 311 radius: ScreenUtil().setWidth(14),
306 isBold: true, 312 isBold: true,
307 - fontSize: 28, 313 + fontSize:32,
308 onPressed: () async { 314 onPressed: () async {
309 _scan(); 315 _scan();
310 }, 316 },
311 ), 317 ),
312 ) 318 )
313 : RoundButton( 319 : RoundButton(
314 - text: '扫码核销',  
315 - width: w(100), 320 + text: '扫码核销付费券',
  321 + width: w(218),
316 gradientStart: MyColours.color_ffffff, 322 gradientStart: MyColours.color_ffffff,
317 gradientEnd: MyColours.color_ffffff, 323 gradientEnd: MyColours.color_ffffff,
318 borderColor: MyColours.color_438E93, 324 borderColor: MyColours.color_438E93,
@@ -320,7 +326,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -320,7 +326,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
320 height: ScreenUtil().setWidth(80), 326 height: ScreenUtil().setWidth(80),
321 radius: ScreenUtil().setWidth(14), 327 radius: ScreenUtil().setWidth(14),
322 isBold: true, 328 isBold: true,
323 - fontSize: 28, 329 + fontSize: 32,
324 onPressed: () async { 330 onPressed: () async {
325 _scan(); 331 _scan();
326 }, 332 },
@@ -329,15 +335,15 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -329,15 +335,15 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
329 if (tabController.index != 3) 335 if (tabController.index != 3)
330 Expanded( 336 Expanded(
331 child: RoundButton( 337 child: RoundButton(
332 - text: '创建新的优惠券', 338 + text: '创建新券',
333 height: ScreenUtil().setWidth(80), 339 height: ScreenUtil().setWidth(80),
334 radius: ScreenUtil().setWidth(14), 340 radius: ScreenUtil().setWidth(14),
335 - isBold: false,  
336 - fontSize: 28, 341 + isBold: true,
  342 + fontSize: 32,
337 onPressed: () async { 343 onPressed: () async {
338 // UserModel userModel = 344 // UserModel userModel =
339 // Provider.of<UserModel>(context, listen: false); 345 // Provider.of<UserModel>(context, listen: false);
340 - if (Utils.getAuthority(context, '创建新的优惠券')) { 346 + if (Utils.getAuthority(context, '创建新券')) {
341 NavigatorUtil.goCouponCreateSelectTypePage(context); 347 NavigatorUtil.goCouponCreateSelectTypePage(context);
342 } 348 }
343 // if (userModel.user.role_name == '管理员' || 349 // if (userModel.user.role_name == '管理员' ||
@@ -2,6 +2,7 @@ import 'dart:convert'; @@ -2,6 +2,7 @@ import 'dart:convert';
2 2
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/pages/coupon/coupon_item_f.dart';
5 import 'package:one_key/widgets/system_app_bar.dart'; 6 import 'package:one_key/widgets/system_app_bar.dart';
6 import 'package:provider/provider.dart'; 7 import 'package:provider/provider.dart';
7 8
@@ -39,7 +40,9 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -39,7 +40,9 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
39 bool isOnlineBook = false; //在线预订 40 bool isOnlineBook = false; //在线预订
40 bool isOrder = false; //提前点餐 41 bool isOrder = false; //提前点餐
41 bool isLink = false; //充值优惠活动链接 42 bool isLink = false; //充值优惠活动链接
42 - bool isCoupon = false; // 代金券 43 + bool isCouponFree = false; // 代金券免费
  44 + bool isCouponPay = false; // 代金券付费
  45 +
43 bool isRecharge = false; //充值券 46 bool isRecharge = false; //充值券
44 String welcome = ''; 47 String welcome = '';
45 String qiniuUrl = ''; 48 String qiniuUrl = '';
@@ -48,6 +51,11 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -48,6 +51,11 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
48 String rechargeContent = ''; 51 String rechargeContent = '';
49 52
50 List<CouponSunModel> couponDataList = []; 53 List<CouponSunModel> couponDataList = [];
  54 +
  55 + List<CouponSunModel> couponDataListFree = [];
  56 + List<CouponSunModel> couponDataListPay = [];
  57 + List<CouponSunModel> couponSelectFree = [];
  58 + List<CouponSunModel> couponSelectPay = [];
51 bool isComments = false; //启用评价设置 59 bool isComments = false; //启用评价设置
52 bool isCommentsCoupon = false; //启用评价送券 60 bool isCommentsCoupon = false; //启用评价送券
53 List<CouponSunModel> couponDataListComments = []; 61 List<CouponSunModel> couponDataListComments = [];
@@ -82,9 +90,14 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -82,9 +90,14 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
82 ? true 90 ? true
83 : false; 91 : false;
84 92
85 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
86 - ? true  
87 - : false; 93 + isCouponPay =
  94 + marketingCenterProvider.markDataModel.marketing.isCouponPay == '1'
  95 + ? true
  96 + : false;
  97 + isCouponFree =
  98 + marketingCenterProvider.markDataModel.marketing.isCouponFree == '1'
  99 + ? true
  100 + : false;
88 101
89 isRecharge = 102 isRecharge =
90 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 103 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
@@ -93,8 +106,12 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -93,8 +106,12 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
93 106
94 rechargeData = 107 rechargeData =
95 marketingCenterProvider.markDataModel.marketing.rechargeData; 108 marketingCenterProvider.markDataModel.marketing.rechargeData;
96 - couponDataList =  
97 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 109 + couponSelectPay =
  110 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  111 + [];
  112 + couponSelectFree =
  113 + marketingCenterProvider.markDataModel.marketing.couponDataListFree ??
  114 + [];
98 couponDataListComments = marketingCenterProvider 115 couponDataListComments = marketingCenterProvider
99 .markDataModel.marketing.couponDataListComments ?? 116 .markDataModel.marketing.couponDataListComments ??
100 []; 117 [];
@@ -126,13 +143,15 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -126,13 +143,15 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
126 'is_arrival': isArrival ? '1' : '0', //确认到店 143 'is_arrival': isArrival ? '1' : '0', //确认到店
127 'is_online_book': isOnlineBook ? '1' : '0', //在线预订 144 'is_online_book': isOnlineBook ? '1' : '0', //在线预订
128 'is_order': isOrder ? '1' : '0', //去点餐 145 'is_order': isOrder ? '1' : '0', //去点餐
129 - 'is_coupon': isCoupon ? '1' : '0', //代金券暂时 146 + 'is_coupon_free': isCouponFree ? '1' : '0', //代金券暂时免费
  147 + 'is_coupon_pay': isCouponPay ? '1' : '0', //代金券暂时付费
130 'is_recharge': isRecharge ? '1' : '0', //充值券暂时 148 'is_recharge': isRecharge ? '1' : '0', //充值券暂时
131 'is_link': isLink ? '1' : '0', 149 'is_link': isLink ? '1' : '0',
132 'wecomle': welcome ?? '', 150 'wecomle': welcome ?? '',
133 'logo': qiniuUrl, 151 'logo': qiniuUrl,
134 'recharge_data': rechargeData, 152 'recharge_data': rechargeData,
135 - 'coupon_data': json.encode(couponDataList), 153 + // 'coupon_data_free': json.encode(couponDataList),
  154 + 'coupon_data_pay': json.encode(couponSelectPay),
136 'is_comments': isComments ? '1' : '0', 155 'is_comments': isComments ? '1' : '0',
137 'is_comments_coupon': isCommentsCoupon ? '1' : '0', 156 'is_comments_coupon': isCommentsCoupon ? '1' : '0',
138 'coupon_data_comments': json.encode(couponDataListComments), 157 'coupon_data_comments': json.encode(couponDataListComments),
@@ -161,14 +180,28 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -161,14 +180,28 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
161 }; 180 };
162 params['status'] = '1'; 181 params['status'] = '1';
163 182
164 - await couponProvider.getCustomerSelectActivityMarking(context, params,  
165 - isShowLoading: isShowLoading);  
166 - if (couponDataList == null || couponDataList.length == 0) {  
167 - if (couponProvider.couponListSelect != null &&  
168 - couponProvider.couponListSelect.length > 0) {  
169 - couponDataList.add(couponProvider.couponListSelect[0]); 183 + List<CouponSunModel> couponData =
  184 + await couponProvider.getCustomerSelectActivityMarking(context, params,
  185 + isShowLoading: isShowLoading);
  186 + //组装免费、付费数据
  187 + couponData.forEach((element) {
  188 + if (element.isType == '3') {
  189 + couponDataListFree.add(element);
  190 + } else if (element.isType == '4') {
  191 + couponDataListPay.add(element);
170 } 192 }
171 - } 193 + });
  194 +
  195 + // if (couponSelectFree == null || couponSelectFree.length == 0) {
  196 + // if (couponDataListFree != null && couponDataListFree.length > 0) {
  197 + // couponSelectFree.add(couponDataListFree[0]);
  198 + // }
  199 + // }
  200 + // if (couponSelectPay == null || couponSelectPay.length == 0) {
  201 + // if (couponDataListPay != null && couponDataListPay.length > 0) {
  202 + // couponSelectPay.add(couponDataListPay[0]);
  203 + // }
  204 + // }
172 setState(() {}); 205 setState(() {});
173 } 206 }
174 207
@@ -197,63 +230,77 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -197,63 +230,77 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
197 bool select = false, 230 bool select = false,
198 VoidCallback onPressedSelect, 231 VoidCallback onPressedSelect,
199 }) { 232 }) {
200 - return Container(  
201 - margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),  
202 - child: Column(  
203 - children: [  
204 - InkWell(  
205 - onTap: onPressedSelect,  
206 - child: Row(  
207 - children: [  
208 - Image.asset(  
209 - Utils.getImgPath(select ? 'f_select' : 'f_select_not'),  
210 - width: w(20),  
211 - ),  
212 - HEmptyView(20),  
213 - Text(  
214 - '推荐店内优惠券活动',  
215 - style: TextStyle(  
216 - fontSize: font(14), color: MyColours.color_515151),  
217 - ),  
218 - Spacer(),  
219 - RoundButton(  
220 - text: '选择活动',  
221 - width: w(72),  
222 - height: w(22),  
223 - gradientStart: MyColours.color_ffffff,  
224 - gradientEnd: MyColours.color_ffffff,  
225 - borderColor: MyColours.color_438E93,  
226 - textColor: MyColours.color_438E93,  
227 - radius: r(11),  
228 - fontSize: 24,  
229 - isBold: true,  
230 - onPressed: onPressed,  
231 - )  
232 - ],  
233 - )),  
234 - VEmptyView(20),  
235 - ListView.builder(  
236 - shrinkWrap: true,  
237 - controller: controller,  
238 - itemCount: couponDataList.length,  
239 - itemBuilder: (BuildContext context, int index) {  
240 - CouponSunModel couponData = couponDataList[index];  
241 - return _markingCuponItem(  
242 - couponData.aname,  
243 - _getCouponsDesc(couponData),  
244 - couponData.price ?? '',  
245 - couponData.use != null && couponData.use.isCash  
246 - ? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折'  
247 - : '',  
248 - '切换活动',  
249 - select: isCoupon, onPressedSelect: () {  
250 - setState(() {  
251 - isCoupon = !isCoupon;  
252 - });  
253 - });  
254 - })  
255 - ],  
256 - ), 233 + return Column(
  234 + children: [
  235 + Container(
  236 + margin: EdgeInsets.only(left: w(21), top: w(12), right: w(21)),
  237 + child: InkWell(
  238 + onTap: onPressedSelect,
  239 + child: Row(
  240 + children: [
  241 + Image.asset(
  242 + Utils.getImgPath(select ? 'f_select' : 'f_select_not'),
  243 + width: w(20),
  244 + ),
  245 + HEmptyView(20),
  246 + Text(
  247 + '预订安排中推荐付费优惠券活动',
  248 + style: TextStyle(
  249 + fontSize: font(14), color: MyColours.color_515151),
  250 + ),
  251 + Spacer(),
  252 + RoundButton(
  253 + text: '选择活动',
  254 + width: w(72),
  255 + height: w(22),
  256 + gradientStart: MyColours.color_ffffff,
  257 + gradientEnd: MyColours.color_ffffff,
  258 + borderColor: MyColours.color_438E93,
  259 + textColor: MyColours.color_438E93,
  260 + radius: r(11),
  261 + fontSize: 24,
  262 + isBold: true,
  263 + onPressed: onPressed,
  264 + )
  265 + ],
  266 + ))),
  267 + VEmptyView(20),
  268 + ListView.builder(
  269 + shrinkWrap: true,
  270 + controller: controller,
  271 + itemCount: couponSelectPay.length,
  272 + itemBuilder: (BuildContext context, int index) {
  273 + CouponSunModel couponData = couponSelectPay[index];
  274 + return CouponItemF(
  275 + from: 'setting',
  276 + couponSonModel: couponData,
  277 + showBtn: false,
  278 + onPressedSwich: () {
  279 + // couponProvider.couponList[index].isOpenBool =
  280 + // !couponProvider.couponList[index].isOpenBool;
  281 + // _setCustomerActivity(index);
  282 + },
  283 + onPressed: () {
  284 + NavigatorUtil.goCouponDetailPage(
  285 + context, couponProvider.couponList[index],
  286 + idStr: couponProvider.couponList[index].id);
  287 + },
  288 + );
  289 + // return _markingCuponItem(
  290 + // couponData.aname,
  291 + // _getCouponsDesc(couponData),
  292 + // couponData.price ?? '',
  293 + // couponData.use != null && couponData.use.isCash
  294 + // ? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折'
  295 + // : '',
  296 + // '切换活动',
  297 + // select: isCoupon, onPressedSelect: () {
  298 + // setState(() {
  299 + // isCoupon = !isCoupon;
  300 + // });
  301 + // });
  302 + })
  303 + ],
257 ); 304 );
258 } 305 }
259 306
@@ -426,30 +473,31 @@ class _CouponSettingPageState extends State<CouponSettingPage> { @@ -426,30 +473,31 @@ class _CouponSettingPageState extends State<CouponSettingPage> {
426 children: [ 473 children: [
427 _headItem('预订安排中附带的营销推广'), 474 _headItem('预订安排中附带的营销推广'),
428 VEmptyView(24), 475 VEmptyView(24),
429 - couponProvider.couponListSelect != null &&  
430 - couponProvider.couponListSelect.length > 0 476 + couponDataListPay != null && couponDataListPay.length > 0
431 ? _markingCupon( 477 ? _markingCupon(
432 - select: isCoupon, 478 + select: isCouponPay,
433 onPressedSelect: () { 479 onPressedSelect: () {
434 setState(() { 480 setState(() {
435 - isCoupon = !isCoupon; 481 + isCouponPay = !isCouponPay;
436 }); 482 });
437 }, 483 },
438 onPressed: () async { 484 onPressed: () async {
439 //切换活动 485 //切换活动
440 Map temp = 486 Map temp =
441 await NavigatorUtil.goMarkingCouponSelectPage( 487 await NavigatorUtil.goMarkingCouponSelectPage(
442 - context, {'object': couponDataList}); 488 + context,
  489 + '4',
  490 + {'object': couponSelectPay});
443 if (temp != null && temp['coupon'] != null) { 491 if (temp != null && temp['coupon'] != null) {
444 - couponDataList = temp['coupon']; 492 + couponSelectPay = temp['coupon'];
445 493
446 setState(() {}); 494 setState(() {});
447 } 495 }
448 }) 496 })
449 - : (couponProvider.couponListSelect == null ||  
450 - couponProvider.couponListSelect.length == 0) 497 + : (couponDataListPay == null ||
  498 + couponDataListPay.length == 0)
451 ? _markingItem( 499 ? _markingItem(
452 - '推荐店内优惠券活动', 500 + '预订安排中推荐付费优惠券活动',
453 '当前没有可用优惠券,请创建优惠券后再来尝试。', 501 '当前没有可用优惠券,请创建优惠券后再来尝试。',
454 select: false, 502 select: false,
455 ) 503 )
@@ -41,9 +41,9 @@ class _CouponSunPageState extends State<CouponSunPage> { @@ -41,9 +41,9 @@ class _CouponSunPageState extends State<CouponSunPage> {
41 WidgetsBinding.instance.addPostFrameCallback((_) { 41 WidgetsBinding.instance.addPostFrameCallback((_) {
42 if (widget.index == 0) { 42 if (widget.index == 0) {
43 couponProvider.pageState = PageState.Loading; 43 couponProvider.pageState = PageState.Loading;
44 - } else if (widget.index == 1) { 44 + } else if (widget.index == 3) {
45 couponProvider.pageStateStore = PageState.Loading; 45 couponProvider.pageStateStore = PageState.Loading;
46 - } else if (widget.index == 2) { 46 + } else if (widget.index == 4) {
47 couponProvider.pageStateMine = PageState.Loading; 47 couponProvider.pageStateMine = PageState.Loading;
48 } 48 }
49 couponProvider.notifyListeners(); 49 couponProvider.notifyListeners();
@@ -119,7 +119,17 @@ class _CouponSunPageState extends State<CouponSunPage> { @@ -119,7 +119,17 @@ class _CouponSunPageState extends State<CouponSunPage> {
119 bool success = await marketingCenterProvider.getSellerTemplateConf(context); 119 bool success = await marketingCenterProvider.getSellerTemplateConf(context);
120 if (success && marketingCenterProvider.markDataModel.marketing != null) { 120 if (success && marketingCenterProvider.markDataModel.marketing != null) {
121 couponDataList = 121 couponDataList =
122 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 122 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  123 + [];
  124 + if (marketingCenterProvider.markDataModel.marketing.couponDataListFree !=
  125 + null &&
  126 + marketingCenterProvider
  127 + .markDataModel.marketing.couponDataListFree.length >
  128 + 0) {
  129 + couponDataList.addAll(
  130 + marketingCenterProvider.markDataModel.marketing.couponDataListFree);
  131 + }
  132 +
123 return true; 133 return true;
124 } else { 134 } else {
125 return false; 135 return false;
@@ -156,9 +166,9 @@ class _CouponSunPageState extends State<CouponSunPage> { @@ -156,9 +166,9 @@ class _CouponSunPageState extends State<CouponSunPage> {
156 PageState pageState; 166 PageState pageState;
157 if (widget.index == 0) { 167 if (widget.index == 0) {
158 pageState = couponProvider.pageState; 168 pageState = couponProvider.pageState;
159 - } else if (widget.index == 1) { 169 + } else if (widget.index == 3) {
160 pageState = couponProvider.pageStateStore; 170 pageState = couponProvider.pageStateStore;
161 - } else if (widget.index == 2) { 171 + } else if (widget.index == 4) {
162 pageState = couponProvider.pageStateMine; 172 pageState = couponProvider.pageStateMine;
163 } 173 }
164 return Container( 174 return Container(
@@ -25,15 +25,18 @@ import 'package:sendsms/sendsms.dart'; @@ -25,15 +25,18 @@ import 'package:sendsms/sendsms.dart';
25 import 'package:flutter_sms/flutter_sms.dart'; 25 import 'package:flutter_sms/flutter_sms.dart';
26 26
27 import '../../../../models/coupon_model.dart'; 27 import '../../../../models/coupon_model.dart';
  28 +import '../../../../utils/screen_util.dart';
28 29
29 /** 30 /**
30 * 优惠券单选页面 31 * 优惠券单选页面
31 */ 32 */
32 class MarkingCouponSelectPage extends StatefulWidget { 33 class MarkingCouponSelectPage extends StatefulWidget {
  34 + final String type;
33 final List<CouponSunModel> couponList; 35 final List<CouponSunModel> couponList;
34 36
35 final bool mulSelect; 37 final bool mulSelect;
36 - MarkingCouponSelectPage({Key key, this.couponList, this.mulSelect = true}) 38 + MarkingCouponSelectPage(
  39 + {Key key, this.type, this.couponList, this.mulSelect = true})
37 : super(key: key); 40 : super(key: key);
38 41
39 @override 42 @override
@@ -52,6 +55,7 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> { @@ -52,6 +55,7 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
52 _couponNetworkData({bool isShowLoading = true}) async { 55 _couponNetworkData({bool isShowLoading = true}) async {
53 Map<String, String> params = { 56 Map<String, String> params = {
54 "uid": Provider.of<UserModel>(context, listen: false).user.openid, 57 "uid": Provider.of<UserModel>(context, listen: false).user.openid,
  58 + "is_type": widget.type
55 }; 59 };
56 params['status'] = '1'; 60 params['status'] = '1';
57 61
@@ -104,10 +108,10 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> { @@ -104,10 +108,10 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
104 return Scaffold( 108 return Scaffold(
105 backgroundColor: MyColours.color_ffffff, 109 backgroundColor: MyColours.color_ffffff,
106 appBar: SystemAppBar( 110 appBar: SystemAppBar(
107 - '优惠券', 111 + '选择优惠券',
108 onTap: () { 112 onTap: () {
109 - if (Navigator.canPop(context)) {  
110 - Navigator.pop(context); 113 + if (Navigator.canPop(context)) {
  114 + Navigator.pop(context);
111 } 115 }
112 }, 116 },
113 ), 117 ),
@@ -190,7 +194,7 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> { @@ -190,7 +194,7 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
190 child: CouponItemF( 194 child: CouponItemF(
191 from: 'select', 195 from: 'select',
192 showCheck: true, 196 showCheck: true,
193 - radio: true, 197 + radio: false,
194 couponSonModel: 198 couponSonModel:
195 couponProvider.couponListSelect[index], 199 couponProvider.couponListSelect[index],
196 onPressed: () { 200 onPressed: () {
@@ -240,24 +244,43 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> { @@ -240,24 +244,43 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
240 )), 244 )),
241 VEmptyView(20), 245 VEmptyView(20),
242 couponProvider.pageStateSelect == PageState.Success 246 couponProvider.pageStateSelect == PageState.Success
243 - ? Padding(  
244 - padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,  
245 - ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),  
246 - child: RoundButton(  
247 - onPressed: () async {  
248 - Map temp = {  
249 - 'coupon': selectDataList,  
250 - };  
251 - if (Navigator.canPop(context)) {  
252 - Navigator.pop(context, temp);  
253 - }  
254 - },  
255 - text: '确定',  
256 - fontSize: 34,  
257 - isBold: false,  
258 - height: ScreenUtil().setWidth(80),  
259 - width: double.infinity,  
260 - radius: ScreenUtil().setWidth(10), 247 + ? Container(
  248 + padding: EdgeInsets.only(
  249 + left: w(20), top: w(12), right: w(20), bottom: w(25)),
  250 + child: Row(
  251 + crossAxisAlignment: CrossAxisAlignment.center,
  252 + children: [
  253 + Image.asset(
  254 + Utils.getImgPath(true ? 'c_mul_select' : 'c_not_edit'),
  255 + width: ScreenUtil().setWidth(40),
  256 + ),
  257 + HEmptyView(10),
  258 + Text(
  259 + '全选',
  260 + style: TextStyle(
  261 + fontSize: ScreenUtil().setWidth(32),
  262 + fontWeight: FontWeight.bold,
  263 + color: MyColours.color_000000),
  264 + ),
  265 + HEmptyView(20),
  266 + Expanded(
  267 + child: RoundButton(
  268 + onPressed: () async {
  269 + Map temp = {
  270 + 'coupon': selectDataList,
  271 + };
  272 + if (Navigator.canPop(context)) {
  273 + Navigator.pop(context, temp);
  274 + }
  275 + },
  276 + text: '确定选择${selectDataList.length}个优惠券',
  277 + fontSize: 34,
  278 + isBold: false,
  279 + height: ScreenUtil().setWidth(80),
  280 + // width: double.infinity,
  281 + radius: ScreenUtil().setWidth(10),
  282 + )),
  283 + ],
261 )) 284 ))
262 : Container() 285 : Container()
263 ], 286 ],
@@ -51,14 +51,17 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { @@ -51,14 +51,17 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
51 bool isOnlineBook = false; //在线预订 51 bool isOnlineBook = false; //在线预订
52 bool isOrder = false; //提前点餐 52 bool isOrder = false; //提前点餐
53 bool isLink = false; //充值优惠活动链接 53 bool isLink = false; //充值优惠活动链接
54 - bool isCoupon = false; // 代金券 54 + bool isCouponFree = false; // 代金券
  55 + bool isCouponPay = false; // 代金券
55 bool isRecharge = false; //充值券 56 bool isRecharge = false; //充值券
56 bool isCustomerCancel = true; //向客人开放取消预订功能 57 bool isCustomerCancel = true; //向客人开放取消预订功能
57 58
58 RechargeListSunModel rechargeData; 59 RechargeListSunModel rechargeData;
59 String rechargeContent = ''; 60 String rechargeContent = '';
60 61
61 - List<CouponSunModel> couponDataList = []; 62 + List<CouponSunModel> couponDataListFree = [];
  63 +
  64 + List<CouponSunModel> couponDataListPay = [];
62 bool isComments = false; //启用评价设置 65 bool isComments = false; //启用评价设置
63 bool isCommentsCoupon = false; //启用评价送券 66 bool isCommentsCoupon = false; //启用评价送券
64 List<CouponSunModel> couponDataListComments = []; 67 List<CouponSunModel> couponDataListComments = [];
@@ -165,9 +168,14 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { @@ -165,9 +168,14 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
165 ? true 168 ? true
166 : false; 169 : false;
167 170
168 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
169 - ? true  
170 - : false; 171 + isCouponFree =
  172 + marketingCenterProvider.markDataModel.marketing.isCouponFree == '1'
  173 + ? true
  174 + : false;
  175 + isCouponPay =
  176 + marketingCenterProvider.markDataModel.marketing.isCouponPay == '1'
  177 + ? true
  178 + : false;
171 179
172 isRecharge = 180 isRecharge =
173 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 181 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
@@ -176,8 +184,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { @@ -176,8 +184,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
176 184
177 rechargeData = 185 rechargeData =
178 marketingCenterProvider.markDataModel.marketing.rechargeData; 186 marketingCenterProvider.markDataModel.marketing.rechargeData;
179 - couponDataList =  
180 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 187 + couponDataListFree =
  188 + marketingCenterProvider.markDataModel.marketing.couponDataListFree ??
  189 + [];
  190 + couponDataListPay =
  191 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  192 + [];
181 couponDataListComments = marketingCenterProvider 193 couponDataListComments = marketingCenterProvider
182 .markDataModel.marketing.couponDataListComments ?? 194 .markDataModel.marketing.couponDataListComments ??
183 []; 195 [];
@@ -38,7 +38,8 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -38,7 +38,8 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
38 bool isOnlineBook = false; //在线预订 38 bool isOnlineBook = false; //在线预订
39 bool isOrder = false; //提前点餐 39 bool isOrder = false; //提前点餐
40 bool isLink = false; //充值优惠活动链接 40 bool isLink = false; //充值优惠活动链接
41 - bool isCoupon = false; // 代金券 41 + bool isCouponFree = false; // 代金券
  42 + bool isCouponPay = false; // 代金券
42 bool isRecharge = false; //充值券 43 bool isRecharge = false; //充值券
43 44
44 String welcome = ''; 45 String welcome = '';
@@ -47,7 +48,8 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -47,7 +48,8 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
47 RechargeListSunModel rechargeData; 48 RechargeListSunModel rechargeData;
48 String rechargeContent = ''; 49 String rechargeContent = '';
49 50
50 - List<CouponSunModel> couponDataList = []; 51 + List<CouponSunModel> couponDataListFree = [];
  52 + List<CouponSunModel> couponDataListPay = [];
51 bool isComments = false; //启用评价设置 53 bool isComments = false; //启用评价设置
52 bool isCommentsCoupon = false; //启用评价送券 54 bool isCommentsCoupon = false; //启用评价送券
53 List<CouponSunModel> couponDataListComments = []; 55 List<CouponSunModel> couponDataListComments = [];
@@ -83,21 +85,27 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -83,21 +85,27 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
83 ? true 85 ? true
84 : false; 86 : false;
85 87
86 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
87 - ? true  
88 - : false;  
89 - 88 + isCouponFree =
  89 + marketingCenterProvider.markDataModel.marketing.isCouponFree == '1'
  90 + ? true
  91 + : false;
  92 + isCouponPay =
  93 + marketingCenterProvider.markDataModel.marketing.isCouponPay == '1'
  94 + ? true
  95 + : false;
90 isRecharge = 96 isRecharge =
91 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 97 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
92 ? true 98 ? true
93 : false; 99 : false;
94 -  
95 100
96 rechargeData = 101 rechargeData =
97 marketingCenterProvider.markDataModel.marketing.rechargeData; 102 marketingCenterProvider.markDataModel.marketing.rechargeData;
98 - couponDataList =  
99 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];  
100 - 103 + couponDataListFree =
  104 + marketingCenterProvider.markDataModel.marketing.couponDataListFree ??
  105 + [];
  106 + couponDataListPay =
  107 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  108 + [];
101 couponDataListComments = marketingCenterProvider 109 couponDataListComments = marketingCenterProvider
102 .markDataModel.marketing.couponDataListComments ?? 110 .markDataModel.marketing.couponDataListComments ??
103 []; 111 [];
@@ -130,13 +138,15 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -130,13 +138,15 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
130 'is_arrival': isArrival ? '1' : '0', //确认到店 138 'is_arrival': isArrival ? '1' : '0', //确认到店
131 'is_online_book': isOnlineBook ? '1' : '0', //在线预订 139 'is_online_book': isOnlineBook ? '1' : '0', //在线预订
132 'is_order': isOrder ? '1' : '0', //去点餐 140 'is_order': isOrder ? '1' : '0', //去点餐
133 - 'is_coupon': isCoupon ? '1' : '0', //代金券暂时 141 + 'is_coupon_free': isCouponFree ? '1' : '0', //代金券暂时
  142 + 'is_coupon_pay': isCouponPay ? '1' : '0', //代金券暂时
134 'is_recharge': isRecharge ? '1' : '0', //充值券暂时 143 'is_recharge': isRecharge ? '1' : '0', //充值券暂时
135 'is_link': isLink ? '1' : '0', 144 'is_link': isLink ? '1' : '0',
136 'wecomle': welcome ?? '', 145 'wecomle': welcome ?? '',
137 'logo': qiniuUrl, 146 'logo': qiniuUrl,
138 'recharge_data': rechargeData, 147 'recharge_data': rechargeData,
139 - 'coupon_data': json.encode(couponDataList), 148 + 'coupon_data_pay': json.encode(couponDataListPay),
  149 + 'coupon_data_free': json.encode(couponDataListFree),
140 'is_comments': isComments ? '1' : '0', 150 'is_comments': isComments ? '1' : '0',
141 'is_comments_coupon': isCommentsCoupon ? '1' : '0', 151 'is_comments_coupon': isCommentsCoupon ? '1' : '0',
142 'coupon_data_comments': json.encode(couponDataListComments), 152 'coupon_data_comments': json.encode(couponDataListComments),
@@ -152,7 +162,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -152,7 +162,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
152 // bus.emit('refresh_coupon_list_f'); 162 // bus.emit('refresh_coupon_list_f');
153 Utils.showToast('保存成功'); 163 Utils.showToast('保存成功');
154 if (Navigator.canPop(context)) { 164 if (Navigator.canPop(context)) {
155 - Navigator.pop(context); 165 + Navigator.pop(context);
156 } 166 }
157 } 167 }
158 } 168 }
@@ -494,6 +504,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> { @@ -494,6 +504,7 @@ class _CommentsSettingPageState extends State<CommentsSettingPage> {
494 Map temp = 504 Map temp =
495 await NavigatorUtil.goMarkingCouponSelectPage( 505 await NavigatorUtil.goMarkingCouponSelectPage(
496 context, 506 context,
  507 + '3',
497 {'object': couponDataListComments}, 508 {'object': couponDataListComments},
498 mulSelect: false); 509 mulSelect: false);
499 // Map temp = await NavigatorUtil.goCouponSelectPage( 510 // Map temp = await NavigatorUtil.goCouponSelectPage(
@@ -35,7 +35,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -35,7 +35,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
35 bool isOnlineBook = false; //在线预订 35 bool isOnlineBook = false; //在线预订
36 bool isOrder = true; //提前点餐 36 bool isOrder = true; //提前点餐
37 bool isLink = false; //充值优惠活动链接 37 bool isLink = false; //充值优惠活动链接
38 - bool isCoupon = false; // 代金券 38 + bool isCouponFree = false; // 代金券
  39 + bool isCouponPay = false; // 代金券
39 bool isRecharge = false; //充值券 40 bool isRecharge = false; //充值券
40 41
41 RechargeListSunModel rechargeData; 42 RechargeListSunModel rechargeData;
@@ -44,7 +45,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -44,7 +45,8 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
44 45
45 String welcome = ''; 46 String welcome = '';
46 47
47 - List<CouponSunModel> couponDataList = []; 48 + List<CouponSunModel> couponDataListFree = [];
  49 + List<CouponSunModel> couponDataListPay = [];
48 bool isComments = false; //启用评价设置 50 bool isComments = false; //启用评价设置
49 bool isCommentsCoupon = false; //启用评价送券 51 bool isCommentsCoupon = false; //启用评价送券
50 List<CouponSunModel> couponDataListComments = []; 52 List<CouponSunModel> couponDataListComments = [];
@@ -88,9 +90,14 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -88,9 +90,14 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
88 ? true 90 ? true
89 : false; 91 : false;
90 92
91 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
92 - ? true  
93 - : false; 93 + isCouponFree =
  94 + marketingCenterProvider.markDataModel.marketing.isCouponFree == '1'
  95 + ? true
  96 + : false;
  97 + isCouponPay =
  98 + marketingCenterProvider.markDataModel.marketing.isCouponPay == '1'
  99 + ? true
  100 + : false;
94 101
95 isRecharge = 102 isRecharge =
96 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 103 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
@@ -99,8 +106,12 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -99,8 +106,12 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
99 106
100 rechargeData = 107 rechargeData =
101 marketingCenterProvider.markDataModel.marketing.rechargeData; 108 marketingCenterProvider.markDataModel.marketing.rechargeData;
102 - couponDataList =  
103 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 109 + couponDataListFree =
  110 + marketingCenterProvider.markDataModel.marketing.couponDataListFree ??
  111 + [];
  112 + couponDataListPay =
  113 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  114 + [];
104 couponDataListComments = marketingCenterProvider 115 couponDataListComments = marketingCenterProvider
105 .markDataModel.marketing.couponDataListComments ?? 116 .markDataModel.marketing.couponDataListComments ??
106 []; 117 [];
@@ -132,9 +143,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -132,9 +143,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
132 if (indexSelect < 0 || indexSelect > 4) { 143 if (indexSelect < 0 || indexSelect > 4) {
133 indexSelect = 0; 144 indexSelect = 0;
134 } 145 }
135 - setState(() {  
136 -  
137 - }); 146 + setState(() {});
138 } 147 }
139 } 148 }
140 149
@@ -148,13 +157,15 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -148,13 +157,15 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
148 'is_arrival': isArrival ? '1' : '0', //确认到店 157 'is_arrival': isArrival ? '1' : '0', //确认到店
149 'is_online_book': isOnlineBook ? '1' : '0', //在线预订 158 'is_online_book': isOnlineBook ? '1' : '0', //在线预订
150 'is_order': isOrder ? '1' : '0', //去点餐 159 'is_order': isOrder ? '1' : '0', //去点餐
151 - 'is_coupon': isCoupon ? '1' : '0', //代金券暂时 160 + 'is_coupon_free': isCouponFree ? '1' : '0', //代金券暂时
  161 + 'is_coupon_pay': isCouponPay ? '1' : '0', //代金券暂时
152 'is_recharge': isRecharge ? '1' : '0', //充值券暂时 162 'is_recharge': isRecharge ? '1' : '0', //充值券暂时
153 'is_link': isLink ? '1' : '0', 163 'is_link': isLink ? '1' : '0',
154 'wecomle': welcome ?? '', 164 'wecomle': welcome ?? '',
155 'logo': qiniuUrl, 165 'logo': qiniuUrl,
156 'recharge_data': rechargeData, 166 'recharge_data': rechargeData,
157 - 'coupon_data': json.encode(couponDataList), 167 + 'coupon_data_free': json.encode(couponDataListFree),
  168 + 'coupon_data_pay': json.encode(couponDataListPay),
158 'is_comments': isComments ? '1' : '0', 169 'is_comments': isComments ? '1' : '0',
159 'is_comments_coupon': isCommentsCoupon ? '1' : '0', 170 'is_comments_coupon': isCommentsCoupon ? '1' : '0',
160 'coupon_data_comments': json.encode(couponDataListComments), 171 'coupon_data_comments': json.encode(couponDataListComments),
@@ -169,7 +180,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -169,7 +180,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
169 if (success) { 180 if (success) {
170 Utils.showToast('保存成功'); 181 Utils.showToast('保存成功');
171 if (Navigator.canPop(context)) { 182 if (Navigator.canPop(context)) {
172 - Navigator.pop(context); 183 + Navigator.pop(context);
173 } 184 }
174 } 185 }
175 } 186 }
@@ -219,7 +230,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> { @@ -219,7 +230,7 @@ class _OrderSettingPageState extends State<OrderSettingPage> {
219 await marketingCenterProvider.setConfing( 230 await marketingCenterProvider.setConfing(
220 context, 231 context,
221 { 232 {
222 - 'sid': Provider.of<UserModel>(context,listen: false).user.sellerid, 233 + 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
223 'key': 'is_allow_update', 234 'key': 'is_allow_update',
224 'value': '${indexSelect + 1}' 235 'value': '${indexSelect + 1}'
225 }, 236 },
@@ -38,7 +38,8 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -38,7 +38,8 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
38 bool isOnlineBook = false; //在线预订 38 bool isOnlineBook = false; //在线预订
39 bool isOrder = false; //提前点餐 39 bool isOrder = false; //提前点餐
40 bool isLink = false; //充值优惠活动链接 40 bool isLink = false; //充值优惠活动链接
41 - bool isCoupon = false; // 代金券 41 + bool isCouponFree = false; // 代金券
  42 + bool isCouponPay = false; // 代金券
42 bool isRecharge = false; //充值券 43 bool isRecharge = false; //充值券
43 44
44 String welcome = ''; 45 String welcome = '';
@@ -47,7 +48,8 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -47,7 +48,8 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
47 RechargeListSunModel rechargeData; 48 RechargeListSunModel rechargeData;
48 String rechargeContent = ''; 49 String rechargeContent = '';
49 50
50 - List<CouponSunModel> couponDataList = []; 51 + List<CouponSunModel> couponDataListFree = [];
  52 + List<CouponSunModel> couponDataListPay = [];
51 List<RechargeListSunModel> rechargeListCanUse = []; 53 List<RechargeListSunModel> rechargeListCanUse = [];
52 bool isComments = false; //启用评价设置 54 bool isComments = false; //启用评价设置
53 bool isCommentsCoupon = false; //启用评价送券 55 bool isCommentsCoupon = false; //启用评价送券
@@ -83,20 +85,28 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -83,20 +85,28 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
83 ? true 85 ? true
84 : false; 86 : false;
85 87
86 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
87 - ? true  
88 - : false; 88 + isCouponFree =
  89 + marketingCenterProvider.markDataModel.marketing.isCouponFree == '1'
  90 + ? true
  91 + : false;
  92 + isCouponPay =
  93 + marketingCenterProvider.markDataModel.marketing.isCouponPay == '1'
  94 + ? true
  95 + : false;
89 96
90 isRecharge = 97 isRecharge =
91 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 98 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
92 ? true 99 ? true
93 : false; 100 : false;
94 -  
95 101
96 rechargeData = 102 rechargeData =
97 marketingCenterProvider.markDataModel.marketing.rechargeData; 103 marketingCenterProvider.markDataModel.marketing.rechargeData;
98 - couponDataList =  
99 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 104 + couponDataListFree =
  105 + marketingCenterProvider.markDataModel.marketing.couponDataListFree ??
  106 + [];
  107 + couponDataListPay =
  108 + marketingCenterProvider.markDataModel.marketing.couponDataListPay ??
  109 + [];
100 couponDataListComments = marketingCenterProvider 110 couponDataListComments = marketingCenterProvider
101 .markDataModel.marketing.couponDataListComments ?? 111 .markDataModel.marketing.couponDataListComments ??
102 []; 112 [];
@@ -129,13 +139,15 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -129,13 +139,15 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
129 'is_arrival': isArrival ? '1' : '0', //确认到店 139 'is_arrival': isArrival ? '1' : '0', //确认到店
130 'is_online_book': isOnlineBook ? '1' : '0', //在线预订 140 'is_online_book': isOnlineBook ? '1' : '0', //在线预订
131 'is_order': isOrder ? '1' : '0', //去点餐 141 'is_order': isOrder ? '1' : '0', //去点餐
132 - 'is_coupon': isCoupon ? '1' : '0', //代金券暂时 142 + 'is_coupon_free': isCouponFree ? '1' : '0', //代金券暂时
  143 + 'is_coupon_pay': isCouponPay ? '1' : '0', //代金券暂时
133 'is_recharge': isRecharge ? '1' : '0', //充值券暂时 144 'is_recharge': isRecharge ? '1' : '0', //充值券暂时
134 'is_link': isLink ? '1' : '0', 145 'is_link': isLink ? '1' : '0',
135 'wecomle': welcome ?? '', 146 'wecomle': welcome ?? '',
136 'logo': qiniuUrl, 147 'logo': qiniuUrl,
137 'recharge_data': rechargeData, 148 'recharge_data': rechargeData,
138 - 'coupon_data': json.encode(couponDataList), 149 + 'coupon_data_pay': json.encode(couponDataListPay),
  150 + 'coupon_data_free': json.encode(couponDataListFree),
139 'is_comments': isComments ? '1' : '0', 151 'is_comments': isComments ? '1' : '0',
140 'is_comments_coupon': isCommentsCoupon ? '1' : '0', 152 'is_comments_coupon': isCommentsCoupon ? '1' : '0',
141 'coupon_data_comments': json.encode(couponDataListComments), 153 'coupon_data_comments': json.encode(couponDataListComments),
@@ -150,9 +162,9 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> { @@ -150,9 +162,9 @@ class _RechargeSettingPageState extends State<RechargeSettingPage> {
150 if (success) { 162 if (success) {
151 bus.emit('refresh_recharge_home'); 163 bus.emit('refresh_recharge_home');
152 Utils.showToast('保存成功'); 164 Utils.showToast('保存成功');
153 - if (Navigator.canPop(context)) {  
154 - Navigator.pop(context);  
155 - } 165 + if (Navigator.canPop(context)) {
  166 + Navigator.pop(context);
  167 + }
156 } 168 }
157 } 169 }
158 170
@@ -52,7 +52,7 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> { @@ -52,7 +52,7 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> {
52 bool isOnlineBook = false; //在线预订 52 bool isOnlineBook = false; //在线预订
53 bool isOrder = false; //提前点餐 53 bool isOrder = false; //提前点餐
54 bool isLink = false; //充值优惠活动链接 54 bool isLink = false; //充值优惠活动链接
55 - bool isCoupon = false; // 代金券 55 + // bool isCoupon = false; // 代金券
56 bool isRecharge = false; //充值券 56 bool isRecharge = false; //充值券
57 57
58 RechargeListSunModel rechargeData; 58 RechargeListSunModel rechargeData;
@@ -153,9 +153,9 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> { @@ -153,9 +153,9 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> {
153 ? true 153 ? true
154 : false; 154 : false;
155 155
156 - isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'  
157 - ? true  
158 - : false; 156 + // isCoupon = marketingCenterProvider.markDataModel.marketing.isCoupon == '1'
  157 + // ? true
  158 + // : false;
159 159
160 isRecharge = 160 isRecharge =
161 marketingCenterProvider.markDataModel.marketing.isRecharge == '1' 161 marketingCenterProvider.markDataModel.marketing.isRecharge == '1'
@@ -164,8 +164,8 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> { @@ -164,8 +164,8 @@ class _MarkingInteractionPageSimState extends State<MarkingInteractionPageSim> {
164 164
165 rechargeData = 165 rechargeData =
166 marketingCenterProvider.markDataModel.marketing.rechargeData; 166 marketingCenterProvider.markDataModel.marketing.rechargeData;
167 - couponDataList =  
168 - marketingCenterProvider.markDataModel.marketing.couponDataList ?? []; 167 + // couponDataList =
  168 + // marketingCenterProvider.markDataModel.marketing.couponDataList ?? [];
169 couponDataListComments = marketingCenterProvider 169 couponDataListComments = marketingCenterProvider
170 .markDataModel.marketing.couponDataListComments ?? 170 .markDataModel.marketing.couponDataListComments ??
171 []; 171 [];
@@ -179,9 +179,9 @@ class CouponProvider with ChangeNotifier { @@ -179,9 +179,9 @@ class CouponProvider with ChangeNotifier {
179 PageState state; 179 PageState state;
180 if (index == 0) { 180 if (index == 0) {
181 state = pageState; 181 state = pageState;
182 - } else if (index == 1) { 182 + } else if (index == 3) {
183 state = pageStateStore; 183 state = pageStateStore;
184 - } else if (index == 2) { 184 + } else if (index == 4) {
185 state = pageStateMine; 185 state = pageStateMine;
186 } 186 }
187 if (isShowLoading) { 187 if (isShowLoading) {
@@ -233,9 +233,9 @@ class CouponProvider with ChangeNotifier { @@ -233,9 +233,9 @@ class CouponProvider with ChangeNotifier {
233 } 233 }
234 if (index == 0) { 234 if (index == 0) {
235 pageState = state; 235 pageState = state;
236 - } else if (index == 1) { 236 + } else if (index == 3) {
237 pageStateStore = state; 237 pageStateStore = state;
238 - } else if (index == 2) { 238 + } else if (index == 4) {
239 pageStateMine = state; 239 pageStateMine = state;
240 } 240 }
241 notifyListeners(); 241 notifyListeners();
@@ -435,15 +435,15 @@ class CouponProvider with ChangeNotifier { @@ -435,15 +435,15 @@ class CouponProvider with ChangeNotifier {
435 } 435 }
436 couponListSelect = CouponModel.fromJson(baseResp.responseData).data; 436 couponListSelect = CouponModel.fromJson(baseResp.responseData).data;
437 437
438 - List<CouponSunModel> temp = [];  
439 - for (int i = 0; i < couponListSelect.length; i++) {  
440 - if (couponListSelect[i].isType == '1' &&  
441 - couponListSelect[i].isExamine == '1') {  
442 - //店铺优惠券 && 可核销 && dang  
443 - temp.add(couponListSelect[i]);  
444 - }  
445 - }  
446 - couponListSelect = temp; 438 + // List<CouponSunModel> temp = [];
  439 + // for (int i = 0; i < couponListSelect.length; i++) {
  440 + // if (couponListSelect[i].isType == '1' &&
  441 + // couponListSelect[i].isExamine == '1') {
  442 + // //店铺优惠券 && 可核销 && dang
  443 + // temp.add(couponListSelect[i]);
  444 + // }
  445 + // }
  446 + // couponListSelect = temp;
447 447
448 notifyListeners(); 448 notifyListeners();
449 } else { 449 } else {
@@ -1723,21 +1723,21 @@ class NavigatorUtil { @@ -1723,21 +1723,21 @@ class NavigatorUtil {
1723 1723
1724 ///预订安排通知定制------优惠券选择 1724 ///预订安排通知定制------优惠券选择
1725 static Future<dynamic> goMarkingCouponSelectPage( 1725 static Future<dynamic> goMarkingCouponSelectPage(
1726 - BuildContext context, Map object, 1726 + BuildContext context,String type, Map object,
1727 {replace = false, bool mulSelect = true}) { 1727 {replace = false, bool mulSelect = true}) {
1728 return _navigateTo(context, 1728 return _navigateTo(context,
1729 - "${Routes.marking_coupon_select_page}?object=${FluroConvertUtils.object2string(object)}&mulSelect=${mulSelect}", 1729 + "${Routes.marking_coupon_select_page}?object=${FluroConvertUtils.object2string(object)}&type=$type&mulSelect=${mulSelect}",
1730 replace: replace); 1730 replace: replace);
1731 } 1731 }
1732 1732
1733 - ///预订安排通知定制------预订安排预览页  
1734 - static Future<dynamic> goMarkingPreviewPage(  
1735 - BuildContext context, {  
1736 - replace = false,  
1737 - }) {  
1738 - return _navigateTo(context, "${Routes.marking_preview_page}",  
1739 - replace: replace);  
1740 - } 1733 + // ///预订安排通知定制------预订安排预览页
  1734 + // static Future<dynamic> goMarkingPreviewPage(
  1735 + // BuildContext context, {
  1736 + // replace = false,
  1737 + // }) {
  1738 + // return _navigateTo(context, "${Routes.marking_preview_page}",
  1739 + // replace: replace);
  1740 + // }
1741 1741
1742 ///我的------存酒管理首页 1742 ///我的------存酒管理首页
1743 static Future<dynamic> goStoreWineManageHomePage( 1743 static Future<dynamic> goStoreWineManageHomePage(
@@ -3092,7 +3092,7 @@ var markingInteractionPageSimHandle = new Handler( @@ -3092,7 +3092,7 @@ var markingInteractionPageSimHandle = new Handler(
3092 //我的----营销中心-优惠券选择 3092 //我的----营销中心-优惠券选择
3093 var markingCouponSelectPageHandle = new Handler( 3093 var markingCouponSelectPageHandle = new Handler(
3094 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 3094 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
3095 - // String idstr = params["idstr"].first;dfdf 3095 + String type = params["type"].first;
3096 List<CouponSunModel> res = []; 3096 List<CouponSunModel> res = [];
3097 if (params.keys.contains('object')) { 3097 if (params.keys.contains('object')) {
3098 Map object = FluroConvertUtils.string2map(params["object"].first); 3098 Map object = FluroConvertUtils.string2map(params["object"].first);
@@ -3108,18 +3108,18 @@ var markingCouponSelectPageHandle = new Handler( @@ -3108,18 +3108,18 @@ var markingCouponSelectPageHandle = new Handler(
3108 // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); 3108 // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
3109 return ChangeNotifierProvider<MarketingCenterProvider>( 3109 return ChangeNotifierProvider<MarketingCenterProvider>(
3110 create: (_) => MarketingCenterProvider(), 3110 create: (_) => MarketingCenterProvider(),
3111 - child: MarkingCouponSelectPage(couponList: res, mulSelect: mulSelect)); 3111 + child: MarkingCouponSelectPage(type:type,couponList: res, mulSelect: mulSelect));
3112 }); 3112 });
3113 3113
3114 //我的----营销中心-预订安排预览页 3114 //我的----营销中心-预订安排预览页
3115 -var markingPreviewPageHandle = new Handler(  
3116 - handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {  
3117 - // String idstr = params["idstr"].first;  
3118 - // NotebookDetail detailEntity = NotebookDetail.fromJson(json  
3119 - // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));  
3120 - return ChangeNotifierProvider<MarketingCenterProvider>(  
3121 - create: (_) => MarketingCenterProvider(), child: MarkingPreviewPage());  
3122 -}); 3115 +// var markingPreviewPageHandle = new Handler(
  3116 +// handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  3117 +// // String idstr = params["idstr"].first;
  3118 +// // NotebookDetail detailEntity = NotebookDetail.fromJson(json
  3119 +// // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  3120 +// return ChangeNotifierProvider<MarketingCenterProvider>(
  3121 +// create: (_) => MarketingCenterProvider(), child: MarkingPreviewPage());
  3122 +// });
3123 3123
3124 ///我的----存酒管理 3124 ///我的----存酒管理
3125 var storeWineManageHomePageHandle = new Handler( 3125 var storeWineManageHomePageHandle = new Handler(
@@ -19,7 +19,6 @@ class Routes { @@ -19,7 +19,6 @@ class Routes {
19 static String select_table = "/select_table"; //选择桌位 19 static String select_table = "/select_table"; //选择桌位
20 static String select_table_f = "/select_table_f"; //选择桌位_方硕新修改的页面 20 static String select_table_f = "/select_table_f"; //选择桌位_方硕新修改的页面
21 21
22 -  
23 static String invication = "/invication"; //邀请函 22 static String invication = "/invication"; //邀请函
24 23
25 static String invication_sim = "/invication_sim"; //邀请函 24 static String invication_sim = "/invication_sim"; //邀请函
@@ -63,7 +62,7 @@ class Routes { @@ -63,7 +62,7 @@ class Routes {
63 static String store_type_fill_manage_page = 62 static String store_type_fill_manage_page =
64 "/store_type_fill_manage_page"; //包间置满管理 63 "/store_type_fill_manage_page"; //包间置满管理
65 64
66 - static String store_type_fill_manage_page_sim = 65 + static String store_type_fill_manage_page_sim =
67 "/store_type_fill_manage_page_sim"; //包间置满管理 66 "/store_type_fill_manage_page_sim"; //包间置满管理
68 static String sms_manager_page = "/sms_manager_page"; //短信充值 67 static String sms_manager_page = "/sms_manager_page"; //短信充值
69 static String sms_recharge_page = "/sms_recharge_page"; //短信充值 68 static String sms_recharge_page = "/sms_recharge_page"; //短信充值
@@ -90,9 +89,7 @@ class Routes { @@ -90,9 +89,7 @@ class Routes {
90 "/personnel_password_edit_page"; //密码修改页 89 "/personnel_password_edit_page"; //密码修改页
91 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面 90 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面
92 91
93 -  
94 -  
95 - static String change_detail_f_only = "/change_detail_f_only"; //变更预订_方硕新修改页面 92 + static String change_detail_f_only = "/change_detail_f_only"; //变更预订_方硕新修改页面
96 static String photo_manager_page = "/photo_manager_page"; //照片管理 93 static String photo_manager_page = "/photo_manager_page"; //照片管理
97 static String edit_reserver_page = "/edit_reserver_page"; //填写预订联系人 94 static String edit_reserver_page = "/edit_reserver_page"; //填写预订联系人
98 static String store_customer_page = "/store_customer_page"; //全店客情 95 static String store_customer_page = "/store_customer_page"; //全店客情
@@ -220,7 +217,7 @@ class Routes { @@ -220,7 +217,7 @@ class Routes {
220 */ 217 */
221 static String order_advance_home_page = "/order_advance_home_page"; //经理预点菜首页 218 static String order_advance_home_page = "/order_advance_home_page"; //经理预点菜首页
222 // static String order_advance_home_page_sim = "/order_advance_home_page_sim"; //经理预点菜首页 219 // static String order_advance_home_page_sim = "/order_advance_home_page_sim"; //经理预点菜首页
223 - 220 +
224 static String order_advance_edit_page = "/order_advance_edit_page"; //经理预点菜编辑 221 static String order_advance_edit_page = "/order_advance_edit_page"; //经理预点菜编辑
225 static String order_preview_page = "/order_preview_page"; //预览页 222 static String order_preview_page = "/order_preview_page"; //预览页
226 static String order_edit_list_show_page = 223 static String order_edit_list_show_page =
@@ -259,8 +256,8 @@ class Routes { @@ -259,8 +256,8 @@ class Routes {
259 static String marking_coupon_select_page = 256 static String marking_coupon_select_page =
260 "/marking_coupon_select_page"; //预订安排通知定制------优惠券选择 257 "/marking_coupon_select_page"; //预订安排通知定制------优惠券选择
261 258
262 - static String marking_preview_page =  
263 - "/marking_preview_page"; //预订安排通知定制------预览页 259 + // static String marking_preview_page =
  260 + // "/marking_preview_page"; //预订安排通知定制------预览页
264 261
265 /** 存酒管理 262 /** 存酒管理
266 */ 263 */
@@ -391,35 +388,20 @@ class Routes { @@ -391,35 +388,20 @@ class Routes {
391 static String mini_program_setting_page = 388 static String mini_program_setting_page =
392 "/mini_program_setting_page"; //小程序封面样式设置 389 "/mini_program_setting_page"; //小程序封面样式设置
393 390
394 - static String wine_setting_msg_page =  
395 - "/wine_setting_msg_page"; //存酒短信模版设置  
396 - 391 + static String wine_setting_msg_page = "/wine_setting_msg_page"; //存酒短信模版设置
397 392
398 - static String book_time_setting_list_page = 393 + static String book_time_setting_list_page =
399 "/book_time_setting_list_page"; //多时段预订列表 394 "/book_time_setting_list_page"; //多时段预订列表
400 395
401 -  
402 - static String book_time_setting_edit_page = 396 + static String book_time_setting_edit_page =
403 "/book_time_setting_edit_page"; //多时段预订列表编辑页面 397 "/book_time_setting_edit_page"; //多时段预订列表编辑页面
404 - static String park_info_page =  
405 - "/park_info_page"; //停车指引介绍 398 + static String park_info_page = "/park_info_page"; //停车指引介绍
406 399
407 - static String birthday_setting_page =  
408 - "/birthday_setting_page"; //客户生日提醒及营销 400 + static String birthday_setting_page = "/birthday_setting_page"; //客户生日提醒及营销
409 401
410 - static String birthday_sms_module_setting_page = 402 + static String birthday_sms_module_setting_page =
411 "/birthday_sms_module_setting_page"; //客户生日提前通知短信设置 403 "/birthday_sms_module_setting_page"; //客户生日提前通知短信设置
412 404
413 -  
414 -  
415 -  
416 -  
417 -  
418 -  
419 -  
420 -  
421 -  
422 -  
423 static void configureRoutes(FluroRouter router) { 405 static void configureRoutes(FluroRouter router) {
424 router.notFoundHandler = new Handler( 406 router.notFoundHandler = new Handler(
425 handlerFunc: (BuildContext context, Map<String, List<String>> params) { 407 handlerFunc: (BuildContext context, Map<String, List<String>> params) {
@@ -436,7 +418,8 @@ class Routes { @@ -436,7 +418,8 @@ class Routes {
436 router.define(reserve_detail_sim, handler: reserveDetailSimHandler); 418 router.define(reserve_detail_sim, handler: reserveDetailSimHandler);
437 router.define(select_table, handler: handleSelectTableHandler); 419 router.define(select_table, handler: handleSelectTableHandler);
438 router.define(select_table_f, handler: handleSelectTableFHandler); 420 router.define(select_table_f, handler: handleSelectTableFHandler);
439 -router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHandler); 421 + router.define(select_table_f_or_reserve,
  422 + handler: handleSelectTableFOrReserveHandler);
440 423
441 router.define(invication, handler: handleInvicationHandler); 424 router.define(invication, handler: handleInvicationHandler);
442 router.define(invication_sim, handler: handleInvicationSimHandler); 425 router.define(invication_sim, handler: handleInvicationSimHandler);
@@ -489,8 +472,6 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -489,8 +472,6 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
489 router.define(store_type_fill_manage_page_sim, 472 router.define(store_type_fill_manage_page_sim,
490 handler: storeTypeFillManagePageSimHandler); 473 handler: storeTypeFillManagePageSimHandler);
491 474
492 -  
493 -  
494 router.define(sms_manager_page, handler: smsManagerPageHandler); 475 router.define(sms_manager_page, handler: smsManagerPageHandler);
495 router.define(sms_recharge_page, handler: smsRechargePageHandler); 476 router.define(sms_recharge_page, handler: smsRechargePageHandler);
496 router.define(store_base_info_page, handler: storeBaseInfoPageHandler); 477 router.define(store_base_info_page, handler: storeBaseInfoPageHandler);
@@ -517,8 +498,8 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -517,8 +498,8 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
517 router.define(personnel_password_edit_page, 498 router.define(personnel_password_edit_page,
518 handler: personnelPasswordEditPageHandle); 499 handler: personnelPasswordEditPageHandle);
519 router.define(change_detail_f, handler: noteBookChangeFPageHandle); 500 router.define(change_detail_f, handler: noteBookChangeFPageHandle);
520 - router.define(change_detail_f_only, handler: noteBookChangeFPageOnlyHandle);  
521 - 501 + router.define(change_detail_f_only, handler: noteBookChangeFPageOnlyHandle);
  502 +
522 router.define(photo_manager_page, handler: photoManagerPageHandle); 503 router.define(photo_manager_page, handler: photoManagerPageHandle);
523 router.define(edit_reserver_page, handler: editReserverPageHandle); 504 router.define(edit_reserver_page, handler: editReserverPageHandle);
524 router.define(store_customer_page, handler: storeCustomerPageHandle); 505 router.define(store_customer_page, handler: storeCustomerPageHandle);
@@ -632,7 +613,6 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -632,7 +613,6 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
632 router.define(final_plan_dish_page, handler: finalPlanDishPageHandle); 613 router.define(final_plan_dish_page, handler: finalPlanDishPageHandle);
633 router.define(order_advance_home_page, handler: orderAdvanceHomePageHandle); 614 router.define(order_advance_home_page, handler: orderAdvanceHomePageHandle);
634 // router.define(order_advance_home_page_sim, handler: orderAdvanceHomePageSimHandle); 615 // router.define(order_advance_home_page_sim, handler: orderAdvanceHomePageSimHandle);
635 -  
636 616
637 router.define(order_advance_edit_page, handler: orderAdvanceEidtPageHandle); 617 router.define(order_advance_edit_page, handler: orderAdvanceEidtPageHandle);
638 router.define(order_preview_page, handler: orderPreviewPageHandle); 618 router.define(order_preview_page, handler: orderPreviewPageHandle);
@@ -668,7 +648,7 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -668,7 +648,7 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
668 handler: markingInteractionPageSimHandle); 648 handler: markingInteractionPageSimHandle);
669 router.define(marking_coupon_select_page, 649 router.define(marking_coupon_select_page,
670 handler: markingCouponSelectPageHandle); 650 handler: markingCouponSelectPageHandle);
671 - router.define(marking_preview_page, handler: markingPreviewPageHandle); 651 + // router.define(marking_preview_page, handler: markingPreviewPageHandle);
672 router.define(store_wine_manag_home_page, 652 router.define(store_wine_manag_home_page,
673 handler: storeWineManageHomePageHandle); 653 handler: storeWineManageHomePageHandle);
674 654
@@ -762,30 +742,21 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan @@ -762,30 +742,21 @@ router.define(select_table_f_or_reserve, handler: handleSelectTableFOrReserveHan
762 handler: invicationAdditionPageHandle); 742 handler: invicationAdditionPageHandle);
763 router.define(payment_setting_page, handler: paymentSettingPageHandle); 743 router.define(payment_setting_page, handler: paymentSettingPageHandle);
764 744
765 - router.define(mini_program_setting_page, handler: miniprogramSettingPageHandle);  
766 - router.define(wine_setting_msg_page, handler:wineSettingMsgPageHandle);  
767 -  
768 - router.define(book_time_setting_list_page, handler:bookTimeSettingListPageHandle);  
769 -  
770 -  
771 - router.define(book_time_setting_edit_page, handler:bookTimeSettingEditPageHandle);  
772 -  
773 - router.define(park_info_page, handler:parkInfoPageHandle);  
774 -  
775 -  
776 - router.define(birthday_setting_page, handler:birthdaySettingPageHandle);  
777 -  
778 - router.define(birthday_sms_module_setting_page, handler:birthdaySmsModuleSettingPageHandle);  
779 -  
780 - 745 + router.define(mini_program_setting_page,
  746 + handler: miniprogramSettingPageHandle);
  747 + router.define(wine_setting_msg_page, handler: wineSettingMsgPageHandle);
781 748
782 -  
783 - 749 + router.define(book_time_setting_list_page,
  750 + handler: bookTimeSettingListPageHandle);
784 751
  752 + router.define(book_time_setting_edit_page,
  753 + handler: bookTimeSettingEditPageHandle);
785 754
  755 + router.define(park_info_page, handler: parkInfoPageHandle);
786 756
787 - 757 + router.define(birthday_setting_page, handler: birthdaySettingPageHandle);
788 758
789 - 759 + router.define(birthday_sms_module_setting_page,
  760 + handler: birthdaySmsModuleSettingPageHandle);
790 } 761 }
791 } 762 }