Commit 24dbcdb7b557edd978b17b27a579e89f8cfc3267

Authored by wdn127929
1 parent 0e723987

交易记录

@@ -71,15 +71,31 @@ class _CouponCreateSelectTypePageState @@ -71,15 +71,31 @@ class _CouponCreateSelectTypePageState
71 ), 71 ),
72 HEmptyView(56), 72 HEmptyView(56),
73 Expanded( 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 - )), 74 + child: Column(
  75 + crossAxisAlignment: CrossAxisAlignment.start,
  76 + mainAxisAlignment: MainAxisAlignment.center,
  77 + children: [
  78 + Text(
  79 + '免费代金券',
  80 + style: TextStyle(
  81 + fontWeight: FontWeight.bold,
  82 + fontSize: ScreenUtil().setSp(36),
  83 + color: selectF
  84 + ? MyColours.color_ffffff
  85 + : MyColours.color_999999),
  86 + ),
  87 + VEmptyView(16),
  88 + Text(
  89 + '客人无需购买就可以获得代金券;',
  90 + style: TextStyle(
  91 + fontSize: ScreenUtil().setSp(20),
  92 + color: selectF
  93 + ? MyColours.color_ffffff
  94 + : MyColours.color_999999),
  95 + )
  96 + ],
  97 + ),
  98 + ),
83 // Column( 99 // Column(
84 // mainAxisAlignment: MainAxisAlignment.center, 100 // mainAxisAlignment: MainAxisAlignment.center,
85 // crossAxisAlignment: CrossAxisAlignment.start, 101 // crossAxisAlignment: CrossAxisAlignment.start,
@@ -143,16 +159,30 @@ class _CouponCreateSelectTypePageState @@ -143,16 +159,30 @@ class _CouponCreateSelectTypePageState
143 ), 159 ),
144 HEmptyView(56), 160 HEmptyView(56),
145 Expanded( 161 Expanded(
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 - ), 162 + child: Column(
  163 + crossAxisAlignment: CrossAxisAlignment.start,
  164 + mainAxisAlignment: MainAxisAlignment.center,
  165 + children: [
  166 + Text(
  167 + '付费优惠券',
  168 + style: TextStyle(
  169 + fontWeight: FontWeight.bold,
  170 + fontSize: ScreenUtil().setSp(36),
  171 + color: !selectF
  172 + ? MyColours.color_ffffff
  173 + : MyColours.color_999999),
  174 + ),
  175 + VEmptyView(16),
  176 + Text(
  177 + '客人需要提前购买才可以获得优惠券;\n支持代金券、菜品券和折扣券',
  178 + style: TextStyle(
  179 + fontSize: ScreenUtil().setSp(20),
  180 + color: !selectF
  181 + ? MyColours.color_ffffff
  182 + : MyColours.color_999999),
  183 + )
  184 + ],
  185 + )),
156 ], 186 ],
157 ), 187 ),
158 )), 188 )),
@@ -36,7 +36,10 @@ import '../online_check/img_picker_widget.dart'; @@ -36,7 +36,10 @@ import '../online_check/img_picker_widget.dart';
36 class CouponEidtPage extends StatefulWidget { 36 class CouponEidtPage extends StatefulWidget {
37 final bool isMine; 37 final bool isMine;
38 final CouponSunModel? couponSunModel; 38 final CouponSunModel? couponSunModel;
39 - CouponEidtPage({Key? key, this.isMine = true, this.couponSunModel}) 39 + final String? from;
  40 + final String? end;
  41 + CouponEidtPage(
  42 + {Key? key, this.isMine = true, this.from, this.end, this.couponSunModel})
40 : super(key: key); 43 : super(key: key);
41 44
42 @override 45 @override
@@ -1604,6 +1607,21 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -1604,6 +1607,21 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
1604 Utils.showToast('请选择活动结束时间'); 1607 Utils.showToast('请选择活动结束时间');
1605 return; 1608 return;
1606 } 1609 }
  1610 + // 券开始早于活动开始 && 券结束大于活动结束
  1611 + if (widget.from != null) {
  1612 + if (DateUtil.getDateTime(fromDate)
  1613 + .compareTo(DateUtil.getDateTime(widget.from!)) >
  1614 + 0) {
  1615 + Utils.showToast('优惠券的开始日期需要选择${widget.from}或以前的时间!');
  1616 + return;
  1617 + }
  1618 + if (DateUtil.getDateTime(widget.end!)
  1619 + .compareTo(DateUtil.getDateTime(endDate)) >
  1620 + 0) {
  1621 + Utils.showToast('优惠券的结束日期需要选择${widget.end}或以后的时间!');
  1622 + return;
  1623 + }
  1624 + }
1607 1625
1608 if (DateUtil.getDateTime(endDate) 1626 if (DateUtil.getDateTime(endDate)
1609 .compareTo(DateUtil.getDateTime(fromDate)) < 1627 .compareTo(DateUtil.getDateTime(fromDate)) <
@@ -14,22 +14,26 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -14,22 +14,26 @@ import 'package:one_key/widgets/v_empty_view.dart';
14 class CouponItemF extends StatefulWidget { 14 class CouponItemF extends StatefulWidget {
15 final String? from; 15 final String? from;
16 final VoidCallback? onPressed; 16 final VoidCallback? onPressed;
  17 + final VoidCallback? onPressedSelect;
17 final VoidCallback? onPressedSwich; 18 final VoidCallback? onPressedSwich;
18 final CouponSunModel? couponSonModel; 19 final CouponSunModel? couponSonModel;
19 final bool showBtn; 20 final bool showBtn;
20 final bool showCheck; 21 final bool showCheck;
21 final bool radio; 22 final bool radio;
  23 + final bool needNum;
22 24
23 - CouponItemF({  
24 - Key? key,  
25 - this.from,  
26 - this.onPressed,  
27 - this.onPressedSwich,  
28 - this.couponSonModel,  
29 - this.showBtn = false,  
30 - this.showCheck = false,  
31 - this.radio = false,  
32 - }) : super(key: key); 25 + CouponItemF(
  26 + {Key? key,
  27 + this.from,
  28 + this.onPressed,
  29 + this.onPressedSelect,
  30 + this.onPressedSwich,
  31 + this.couponSonModel,
  32 + this.showBtn = false,
  33 + this.showCheck = false,
  34 + this.radio = false,
  35 + this.needNum = true})
  36 + : super(key: key);
33 37
34 @override 38 @override
35 _CouponItemFState createState() => _CouponItemFState(); 39 _CouponItemFState createState() => _CouponItemFState();
@@ -71,16 +75,22 @@ class _CouponItemFState extends State<CouponItemF> { @@ -71,16 +75,22 @@ class _CouponItemFState extends State<CouponItemF> {
71 children: [ 75 children: [
72 HEmptyView(20), 76 HEmptyView(20),
73 widget.from == 'select' 77 widget.from == 'select'
74 - ? Image.asset(  
75 - Utils.getImgPath(sunModel.isCheck  
76 - ? widget.radio  
77 - ? 'c_mul_select'  
78 - : 'select_f'  
79 - : widget.radio  
80 - ? 'c_not_edit'  
81 - : 'show_select_f'),  
82 - width: w(20),  
83 - ) 78 + ? InkWell(
  79 + onTap: widget.onPressedSelect,
  80 + child: Container(
  81 + // color: Colors.red,
  82 + padding: EdgeInsets.symmetric(vertical: w(50),horizontal: w(5)),
  83 + child: Image.asset(
  84 + Utils.getImgPath(sunModel.isCheck
  85 + ? widget.radio
  86 + ? 'c_mul_select'
  87 + : 'select_f'
  88 + : widget.radio
  89 + ? 'c_not_edit'
  90 + : 'show_select_f'),
  91 + width: w(20),
  92 + ),
  93 + ))
84 : Container(), 94 : Container(),
85 Expanded( 95 Expanded(
86 child: Container( 96 child: Container(
@@ -246,7 +256,8 @@ class _CouponItemFState extends State<CouponItemF> { @@ -246,7 +256,8 @@ class _CouponItemFState extends State<CouponItemF> {
246 )), 256 )),
247 if (widget.from == 'select' && 257 if (widget.from == 'select' &&
248 sunModel.isType == '3' && 258 sunModel.isType == '3' &&
249 - widget.radio) 259 + widget.radio &&
  260 + widget.needNum)
250 Row( 261 Row(
251 children: [ 262 children: [
252 InkWell( 263 InkWell(
  1 +
  2 +// import 'package:flutter/material.dart';
  3 +// import 'package:one_key/widgets/system_app_bar.dart';
  4 +
  5 +// /**
  6 +// * 企业资料上传
  7 +// */
  8 +
  9 +// class EnterpriseInformationUploadPage extends StatefulWidget {
  10 +// const EnterpriseInformationUploadPage({super.key});
  11 +
  12 +// @override
  13 +// State<EnterpriseInformationUploadPage> createState() => _EnterpriseInformationUploadPageState();
  14 +// }
  15 +
  16 +// class _EnterpriseInformationUploadPageState extends State<EnterpriseInformationUploadPage> {
  17 +// @override
  18 +// Widget build(BuildContext context) {
  19 +// return Scaffold(
  20 +// appBar: SystemAppBar('资料上传'),
  21 +// body: ,
  22 +// );
  23 +// }
  24 +// }
@@ -69,7 +69,9 @@ class _FinanceManageHomePageState extends State<FinanceManageHomePage> { @@ -69,7 +69,9 @@ class _FinanceManageHomePageState extends State<FinanceManageHomePage> {
69 children: [ 69 children: [
70 _item('收银资料上传', () {}), 70 _item('收银资料上传', () {}),
71 _item('微信商户账户开通结果查询', () {}), 71 _item('微信商户账户开通结果查询', () {}),
72 - _item('支付返券', () {}), 72 + _item('支付返券', () {
  73 + // NavigatorUtil.goPaymentGiftPage(context);
  74 + }),
73 _item('门店收款码', () { 75 _item('门店收款码', () {
74 NavigatorUtil.goPaymentCodePage(context); 76 NavigatorUtil.goPaymentCodePage(context);
75 }), 77 }),
  1 +import 'package:common_utils/common_utils.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter/services.dart';
  4 +import 'package:flutter_picker_plus/picker.dart';
  5 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  6 +import 'package:one_key/res/colors.dart';
  7 +import 'package:one_key/widgets/h_empty_view.dart';
  8 +import 'package:one_key/widgets/system_app_bar.dart';
  9 +import 'package:provider/provider.dart';
  10 +
  11 +import '../../../models/coupon_model.dart';
  12 +import '../../../provider/finance_provider.dart';
  13 +import '../../../route/navigator_util.dart';
  14 +import '../../../utils/dialog_util.dart';
  15 +import '../../../utils/screen_util.dart';
  16 +import '../../../utils/utils.dart';
  17 +import '../../../widgets/round_button.dart';
  18 +import '../../../widgets/v_empty_view.dart';
  19 +
  20 +/**
  21 + * 支付返券
  22 + */
  23 +class PaymentGiftPage extends StatefulWidget {
  24 + const PaymentGiftPage({super.key});
  25 +
  26 + @override
  27 + State<PaymentGiftPage> createState() => _PaymentGiftPageState();
  28 +}
  29 +
  30 +class _PaymentGiftPageState extends State<PaymentGiftPage> {
  31 + bool fullReduction = true;
  32 + bool ladderReduction = false;
  33 +
  34 + String fromDateFull = '选择日期';
  35 + String endDateFull = '选择日期';
  36 +
  37 + String fromDateLadder = '选择日期';
  38 + String endDateLadder = '选择日期';
  39 +
  40 + final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
  41 +
  42 + FinanceProvider? financeProvider;
  43 + TextEditingController fullC = TextEditingController();
  44 + FocusNode fullNode = FocusNode();
  45 +
  46 + List coupons = ['1', '2', '3'];
  47 + List ladders = ['1', '2', '3'];
  48 + List<CouponSunModel>? couponSelectFree = [];
  49 +
  50 + ///是否立即启用
  51 + Widget _canUse(
  52 + String title,
  53 + bool swich,
  54 + GestureTapCallback onTap,
  55 + ) {
  56 + return InkWell(
  57 + onTap: onTap,
  58 + child: Container(
  59 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
  60 + margin: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
  61 + decoration: BoxDecoration(
  62 + border: Border(
  63 + bottom:
  64 + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  65 + child: Row(
  66 + crossAxisAlignment: CrossAxisAlignment.center,
  67 + mainAxisAlignment: MainAxisAlignment.center,
  68 + children: [
  69 + Container(
  70 + // height: ScreenUtil().setWidth(40),
  71 + // color: Colors.red,
  72 + child: Text(
  73 + title,
  74 + style: TextStyle(
  75 + color: MyColours.color_515151, fontSize: font(16)),
  76 + ),
  77 + ),
  78 + Spacer(),
  79 + Image.asset(
  80 + swich
  81 + ? Utils.getImgPath('swich_on')
  82 + : Utils.getImgPath('swich_off'),
  83 + width: ScreenUtil().setWidth(44 * 2),
  84 + ),
  85 + HEmptyView(32)
  86 + ],
  87 + ),
  88 + ),
  89 + );
  90 + }
  91 +
  92 + Widget _priceWidget(TextEditingController controller, FocusNode focusNode,
  93 + {num width = 40}) {
  94 + return Container(
  95 + margin: EdgeInsets.only(left: w(width)),
  96 + padding: EdgeInsets.only(top: w(8), bottom: w(8), right: w(16)),
  97 + // decoration: BoxDecoration(
  98 + // border: Border(
  99 + // bottom:
  100 + // BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  101 + child: Row(
  102 + children: [
  103 + Text(
  104 + '用户消费满',
  105 + style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
  106 + ),
  107 + HEmptyView(10),
  108 + Container(
  109 + width: w(70),
  110 + height: w(26),
  111 + alignment: Alignment.center,
  112 + decoration: BoxDecoration(
  113 + border: Border.all(color: MyColours.color_999999, width: w(1))),
  114 + child: TextField(
  115 + controller: controller,
  116 + textAlign: TextAlign.center,
  117 + textAlignVertical: TextAlignVertical.center,
  118 + maxLines: 1,
  119 + // //光标颜色
  120 + // cursorColor:
  121 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  122 + //输入文本的样式
  123 + inputFormatters: [
  124 + FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
  125 + ], // 限制输入为数字,
  126 + style: TextStyle(
  127 + color: MyColours.color_515151,
  128 + fontSize: ScreenUtil().setSp(24),
  129 + ),
  130 + focusNode: focusNode,
  131 + decoration: InputDecoration(
  132 + isCollapsed: true,
  133 + border: OutlineInputBorder(borderSide: BorderSide.none),
  134 + hintText: '输入门槛',
  135 + hintStyle: TextStyle(
  136 + color: MyColours.color_999999,
  137 + fontSize: ScreenUtil().setSp(24),
  138 + ),
  139 + enabledBorder: new UnderlineInputBorder(
  140 + borderSide: BorderSide.none,
  141 + ),
  142 + focusedBorder: new UnderlineInputBorder(
  143 + borderSide: BorderSide.none,
  144 + ),
  145 + ),
  146 + onChanged: (value) {},
  147 + onEditingComplete: () {
  148 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  149 + },
  150 + keyboardType: TextInputType.numberWithOptions()),
  151 + ),
  152 + HEmptyView(10),
  153 + Text(
  154 + '元 发放优惠券',
  155 + style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
  156 + ),
  157 + ],
  158 + ),
  159 + );
  160 + }
  161 +
  162 + ///时间选择
  163 + Widget _select(String title, String hintText, GestureTapCallback onTap) {
  164 + return InkWell(
  165 + onTap: onTap,
  166 + child: Container(
  167 + margin: EdgeInsets.only(left: w(40)),
  168 + padding: EdgeInsets.only(
  169 + top: w(8),
  170 + bottom: w(8),
  171 + ),
  172 + decoration: BoxDecoration(
  173 + border: Border(
  174 + bottom:
  175 + BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
  176 + child: Row(
  177 + crossAxisAlignment: CrossAxisAlignment.center,
  178 + mainAxisAlignment: MainAxisAlignment.center,
  179 + children: [
  180 + Container(
  181 + // height: ScreenUtil().setWidth(40),
  182 + // color: Colors.red,
  183 + child: Text(
  184 + title,
  185 + style: TextStyle(
  186 + color: MyColours.color_515151,
  187 + fontSize: ScreenUtil().setSp(28)),
  188 + ),
  189 + ),
  190 + HEmptyView(20),
  191 + Spacer(),
  192 + Text(hintText,
  193 + style: TextStyle(
  194 + color: hintText == '选择日期'
  195 + ? MyColours.color_999999
  196 + : MyColours.color_515151,
  197 + fontSize: ScreenUtil().setSp(24),
  198 + )),
  199 + HEmptyView(20),
  200 + Image.asset(
  201 + Utils.getImgPath('arrow_right_new'),
  202 + width: ScreenUtil().setWidth(16),
  203 + ),
  204 + HEmptyView(32),
  205 + ],
  206 + ),
  207 + ),
  208 + );
  209 + }
  210 +
  211 + Widget _couponShow(String name, {GestureTapCallback? onTap}) {
  212 + return Row(
  213 + // mainAxisAlignment: MainAxisAlignment.center,
  214 + mainAxisSize: MainAxisSize.min,
  215 + children: [
  216 + Container(
  217 + padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(4)),
  218 + decoration: BoxDecoration(
  219 + border: Border.all(color: MyColours.color_999999, width: w(1)),
  220 + borderRadius: BorderRadius.only(
  221 + topLeft: Radius.circular(r(5)),
  222 + bottomLeft: Radius.circular(r(5)),
  223 + )),
  224 + child: Text(
  225 + name,
  226 + style: TextStyle(color: MyColours.color_515151, fontSize: font(12)),
  227 + ),
  228 + ),
  229 + InkWell(
  230 + onTap: onTap,
  231 + child: Container(
  232 + padding: EdgeInsets.symmetric(horizontal: w(5), vertical: w(4)),
  233 + decoration: BoxDecoration(
  234 + color: MyColours.color_999999,
  235 + border:
  236 + Border.all(color: MyColours.color_999999, width: w(1)),
  237 + borderRadius: BorderRadius.only(
  238 + topRight: Radius.circular(r(5)),
  239 + bottomRight: Radius.circular(r(5)),
  240 + )),
  241 + child: Text(
  242 + '×',
  243 + style: TextStyle(
  244 + color: MyColours.color_515151, fontSize: font(12)),
  245 + ),
  246 + ))
  247 + ],
  248 + );
  249 + }
  250 +
  251 + Widget _selectCouponBtn(VoidCallback? onPressed) {
  252 + return RoundButton(
  253 + text: '+选择优惠券',
  254 + width: w(88),
  255 + height: w(26),
  256 + gradientStart: MyColours.color_ffffff,
  257 + gradientEnd: MyColours.color_ffffff,
  258 + textColor: MyColours.color_438E93,
  259 + borderColor: MyColours.color_438E93,
  260 + radius: r(5),
  261 + fontSize: 24,
  262 + onPressed: onPressed);
  263 + }
  264 +
  265 + Widget _selectCouponWidget(List<CouponSunModel> coupons,
  266 + {bool needBottom = true, num width = 40, VoidCallback? onPressed}) {
  267 + List<Widget> data = coupons.map((e) {
  268 + return _couponShow(e.aname ?? '', onTap: () {
  269 + //删除选择的券
  270 + coupons.remove(e);
  271 + setState(() {});
  272 + });
  273 + }).toList();
  274 + data.add(_selectCouponBtn(onPressed));
  275 + return Container(
  276 + width: double.infinity,
  277 + padding: EdgeInsets.only(top: w(8), bottom: w(8), right: w(16)),
  278 + margin: EdgeInsets.only(left: w(width)),
  279 + decoration: BoxDecoration(
  280 + border: Border(
  281 + bottom: BorderSide(
  282 + width: w(0.5),
  283 + color: needBottom
  284 + ? MyColours.color_E7E7E7
  285 + : MyColours.color_ffffff))),
  286 + child: Wrap(runSpacing: w(8), spacing: w(6), children: data),
  287 + );
  288 + }
  289 +
  290 + ///发放阶梯
  291 + Widget _ladderWidget(int index, e, {GestureTapCallback? onTap}) {
  292 + return Container(
  293 + padding:
  294 + EdgeInsets.only(left: w(40), top: w(8), bottom: w(8), right: w(16)),
  295 + child: Column(
  296 + children: [
  297 + Container(
  298 + child: Row(
  299 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  300 + children: [
  301 + Text(
  302 + '发放阶梯(${index})',
  303 + style: TextStyle(
  304 + color: MyColours.color_515151, fontSize: font(14)),
  305 + ),
  306 + InkWell(
  307 + onTap: onTap,
  308 + child: Padding(
  309 + padding: EdgeInsets.only(top: w(8), bottom: w(8)),
  310 + child: Text(
  311 + '删除',
  312 + style: TextStyle(
  313 + color: MyColours.color_438E93, fontSize: font(12)),
  314 + ),
  315 + ))
  316 + ],
  317 + ),
  318 + ),
  319 + _priceWidget(TextEditingController(), FocusNode(), width: 20),
  320 + _selectCouponWidget(couponSelectFree!, width: 20, needBottom: false,
  321 + onPressed: () async {
  322 + //跳转到优惠券选择页面,条件:券的有效期包含活动有效期
  323 + //阶梯发券
  324 + // dynamic temp = await NavigatorUtil.goPaymentGiftSelectPage(
  325 + // context, '3', {'object': couponSelectFree});
  326 + // if (temp != null && temp['coupon'] != null) {
  327 + // couponSelectFree = temp['coupon'];
  328 +
  329 + // setState(() {});
  330 + // }
  331 + }),
  332 + // }),
  333 + ],
  334 + ),
  335 + );
  336 + }
  337 +
  338 + @override
  339 + Widget build(BuildContext context) {
  340 + financeProvider = Provider.of<FinanceProvider>(context, listen: true);
  341 + int i = 0;
  342 + return Scaffold(
  343 + backgroundColor: MyColours.color_ffffff,
  344 + appBar: SystemAppBar('支付返券'),
  345 + key: scaffoldKey,
  346 + body: Column(
  347 + children: [
  348 + Expanded(
  349 + child: SingleChildScrollView(
  350 + child: Column(
  351 + children: [
  352 + _canUse('开通实际支付满减返券【拉复购】', fullReduction, () {
  353 + setState(() {
  354 + fullReduction = !fullReduction;
  355 + });
  356 + }),
  357 + _select('活动开始于', fromDateFull, () {
  358 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  359 + //弹出时间选择器
  360 + // showPickerDateTime(context);
  361 + // showDateSelWidget = true;
  362 + DialogUtil.showPickerDateTime24(
  363 + context,
  364 + scaffoldKey,
  365 + (value) {
  366 + // {'text': picker.adapter.text, 'select': selecteds}
  367 + if (value != null) {
  368 + setState(() {
  369 + print(value);
  370 + fromDateFull = DateUtil.formatDateStr(value,
  371 + format: DateFormats.y_mo_d);
  372 + });
  373 + }
  374 + // showDateSelWidget = false;
  375 + },
  376 + minValue: DateTime(1987, 1, 1),
  377 + dateTime: fromDateFull == '选择日期'
  378 + ? null
  379 + : DateUtil.getDateTime(fromDateFull),
  380 + pickerDateTimeType: PickerDateTimeType.kYMD,
  381 + onCancel: () {
  382 + // showDateSelWidget = false;
  383 + });
  384 + }),
  385 + _select('活动结束于', endDateFull, () {
  386 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  387 + //弹出时间选择器
  388 + // showPickerDateTime(context);
  389 + // showDateSelWidget = true;
  390 + DialogUtil.showPickerDateTime24(
  391 + context,
  392 + scaffoldKey,
  393 + (value) {
  394 + // {'text': picker.adapter.text, 'select': selecteds}
  395 + if (value != null) {
  396 + setState(() {
  397 + print(value);
  398 + endDateFull = DateUtil.formatDateStr(value,
  399 + format: DateFormats.y_mo_d);
  400 + });
  401 + }
  402 + // showDateSelWidget = false;
  403 + },
  404 + minValue: DateTime(1987, 1, 1),
  405 + dateTime: endDateFull == '选择日期'
  406 + ? null
  407 + : DateUtil.getDateTime(endDateFull),
  408 + pickerDateTimeType: PickerDateTimeType.kYMD,
  409 + onCancel: () {
  410 + // showDateSelWidget = false;
  411 + });
  412 + }),
  413 + _priceWidget(fullC, fullNode),
  414 + _selectCouponWidget(couponSelectFree!, onPressed: () async {
  415 + if (fromDateFull == '选择日期') {
  416 + Utils.showToast('请选择满减返券的开始日期');
  417 + return;
  418 + }
  419 + if (endDateFull == '选择日期') {
  420 + Utils.showToast('请选择满减返券的结束日期');
  421 + return;
  422 + }
  423 + if (DateUtil.getDateTime(endDateFull)
  424 + .compareTo(DateUtil.getDateTime(fromDateFull)) <
  425 + 0) {
  426 + Utils.showToast('满减返券的活动结束日期不能早于开始日期');
  427 + return;
  428 + }
  429 + //选择券,满减送的
  430 + dynamic temp = await NavigatorUtil.goPaymentGiftSelectPage(
  431 + context,
  432 + '3',
  433 + {'object': couponSelectFree},
  434 + fromDateFull,
  435 + endDateFull);
  436 + if (temp != null && temp['coupon'] != null) {
  437 + couponSelectFree = temp['coupon'];
  438 +
  439 + setState(() {});
  440 + }
  441 + }),
  442 + Container(
  443 + padding:
  444 + EdgeInsets.only(top: w(8), bottom: w(8), right: w(16)),
  445 + margin: EdgeInsets.only(left: w(40)),
  446 + decoration: BoxDecoration(
  447 + border: Border(
  448 + bottom: BorderSide(
  449 + width: w(0.5), color: MyColours.color_E7E7E7))),
  450 + child: Row(
  451 + children: [
  452 + Text(
  453 + '发放规则',
  454 + style: TextStyle(
  455 + color: MyColours.color_515151, fontSize: font(14)),
  456 + ),
  457 + Spacer(),
  458 + Container(
  459 + // width: w(100),
  460 + // height: w(30),
  461 + padding: EdgeInsets.symmetric(
  462 + horizontal: w(10), vertical: w(5)),
  463 + decoration: BoxDecoration(
  464 + color: MyColours.color_438E93,
  465 + borderRadius: BorderRadius.only(
  466 + topLeft: Radius.circular(r(5)),
  467 + bottomLeft: Radius.circular(r(5)))),
  468 + child: Text(
  469 + '每满门槛均发放',
  470 + style: TextStyle(
  471 + color: MyColours.color_ffffff,
  472 + fontSize: font(14)),
  473 + ),
  474 + ),
  475 + Container(
  476 + padding: EdgeInsets.symmetric(
  477 + horizontal: w(10), vertical: w(5)),
  478 + decoration: BoxDecoration(
  479 + color: MyColours.color_DBDBDB,
  480 + borderRadius: BorderRadius.only(
  481 + topRight: Radius.circular(r(5)),
  482 + bottomRight: Radius.circular(r(5)))),
  483 + child: Text(
  484 + '仅发放一次',
  485 + style: TextStyle(
  486 + color: MyColours.color_438E93,
  487 + fontSize: font(14)),
  488 + ),
  489 + )
  490 + ],
  491 + ),
  492 + ),
  493 + VEmptyView(22),
  494 + _canUse('开通实际支付阶梯返券【提客单】', ladderReduction, () {
  495 + //
  496 + setState(() {
  497 + ladderReduction = !ladderReduction;
  498 + });
  499 + }),
  500 + _select('活动开始于', fromDateLadder, () {
  501 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  502 + //弹出时间选择器
  503 + // showPickerDateTime(context);
  504 + // showDateSelWidget = true;
  505 + DialogUtil.showPickerDateTime24(
  506 + context,
  507 + scaffoldKey,
  508 + (value) {
  509 + // {'text': picker.adapter.text, 'select': selecteds}
  510 + if (value != null) {
  511 + setState(() {
  512 + print(value);
  513 + fromDateLadder = DateUtil.formatDateStr(value,
  514 + format: DateFormats.y_mo_d);
  515 + });
  516 + }
  517 + // showDateSelWidget = false;
  518 + },
  519 + minValue: DateTime(1987, 1, 1),
  520 + dateTime: fromDateLadder == '选择日期'
  521 + ? null
  522 + : DateUtil.getDateTime(fromDateLadder),
  523 + pickerDateTimeType: PickerDateTimeType.kYMD,
  524 + onCancel: () {
  525 + // showDateSelWidget = false;
  526 + });
  527 + }),
  528 + _select('活动结束于', endDateLadder, () {
  529 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  530 + //弹出时间选择器
  531 + // showPickerDateTime(context);
  532 + // showDateSelWidget = true;
  533 + DialogUtil.showPickerDateTime24(
  534 + context,
  535 + scaffoldKey,
  536 + (value) {
  537 + // {'text': picker.adapter.text, 'select': selecteds}
  538 + if (value != null) {
  539 + setState(() {
  540 + print(value);
  541 + endDateLadder = DateUtil.formatDateStr(value,
  542 + format: DateFormats.y_mo_d);
  543 + });
  544 + }
  545 + // showDateSelWidget = false;
  546 + },
  547 + minValue: DateTime(1987, 1, 1),
  548 + dateTime: endDateLadder == '选择日期'
  549 + ? null
  550 + : DateUtil.getDateTime(endDateLadder),
  551 + pickerDateTimeType: PickerDateTimeType.kYMD,
  552 + onCancel: () {
  553 + // showDateSelWidget = false;
  554 + });
  555 + }),
  556 + Column(
  557 + children: ladders.map((e) {
  558 + i++;
  559 + return _ladderWidget(i, e, onTap: () {
  560 + ladders.remove(e);
  561 + setState(() {});
  562 + });
  563 + }).toList(),
  564 + ),
  565 + InkWell(
  566 + onTap: () {
  567 + ladders.add('${ladders.length + 1}');
  568 + setState(() {});
  569 + },
  570 + child: Container(
  571 + // height: w(30),
  572 +
  573 + margin: EdgeInsets.only(left: w(60), top: w(8)),
  574 + padding: EdgeInsets.symmetric(vertical: w(8)),
  575 + alignment: Alignment.center,
  576 + decoration: BoxDecoration(
  577 + // color: Colors.red,
  578 + border: Border(
  579 + bottom: BorderSide(
  580 + width: w(0.5),
  581 + color: MyColours.color_E7E7E7))),
  582 + child: Text(
  583 + '增加阶梯',
  584 + style: TextStyle(
  585 + color: MyColours.color_438E93, fontSize: font(12)),
  586 + ),
  587 + ))
  588 + ],
  589 + ),
  590 + )),
  591 + Container(
  592 + padding: EdgeInsets.only(
  593 + top: w(13), left: w(45), right: w(45), bottom: w(26)),
  594 + child: RoundButton(
  595 + text: '立即提交',
  596 + height: w(43),
  597 + radius: r(5),
  598 + gradientStart: MyColours.color_438E93,
  599 + gradientEnd: MyColours.color_438E93,
  600 + borderColor: MyColours.color_438E93,
  601 + textColor: MyColours.color_ffffff,
  602 + isBold: true,
  603 + fontSize: 32,
  604 + onPressed: () {},
  605 + ),
  606 + )
  607 + ],
  608 + ),
  609 + );
  610 + }
  611 +}
  1 +import 'dart:io';
  2 +
  3 +import 'package:common_utils/common_utils.dart';
  4 +import 'package:flutter/material.dart';
  5 +import 'package:flutter_easyrefresh/easy_refresh.dart';
  6 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  7 +import 'package:one_key/constant/state.dart';
  8 +import 'package:one_key/pages/coupon/coupon_item.dart';
  9 +import 'package:one_key/pages/coupon/coupon_item_f.dart';
  10 +import 'package:one_key/provider/SmsModel.dart';
  11 +import 'package:one_key/provider/coupon_provider.dart';
  12 +import 'package:one_key/provider/user_model.dart';
  13 +import 'package:one_key/res/colors.dart';
  14 +import 'package:one_key/utils/dialog_util.dart';
  15 +import 'package:one_key/utils/event_bus.dart';
  16 +import 'package:one_key/route/navigator_util.dart';
  17 +import 'package:one_key/utils/utils.dart';
  18 +import 'package:one_key/widgets/h_empty_view.dart';
  19 +import 'package:one_key/widgets/page_exception.dart';
  20 +import 'package:one_key/widgets/round_button.dart';
  21 +import 'package:one_key/widgets/system_app_bar.dart';
  22 +import 'package:one_key/widgets/v_empty_view.dart';
  23 +import 'package:provider/provider.dart';
  24 +import 'package:sendsms/sendsms.dart';
  25 +// import 'package:sendsms/sendsms.dart';
  26 +import 'package:flutter_sms/flutter_sms.dart';
  27 +
  28 +import '../../../../models/coupon_model.dart';
  29 +import '../../../../utils/screen_util.dart';
  30 +
  31 +/**
  32 + * 支付返券选择页面
  33 + */
  34 +class PaymentGiftSelectPage extends StatefulWidget {
  35 + final String? type;
  36 + final List<CouponSunModel>?couponList;
  37 + final String? from;
  38 + final String? end;
  39 +
  40 + final bool mulSelect;
  41 + PaymentGiftSelectPage(
  42 + {Key? key,
  43 + this.type,
  44 + this.couponList,
  45 + this.from,
  46 + this.end,
  47 + this.mulSelect = true})
  48 + : super(key: key);
  49 +
  50 + @override
  51 + _PaymentGiftSelectPageState createState() => _PaymentGiftSelectPageState();
  52 +}
  53 +
  54 +class _PaymentGiftSelectPageState extends State<PaymentGiftSelectPage> {
  55 + EasyRefreshController _controller = EasyRefreshController();
  56 + late CouponProvider couponProvider;
  57 +
  58 + List<CouponSunModel> selectDataList = [];
  59 + bool all = false;
  60 +
  61 + @override
  62 + void initState() {
  63 + // TODO: implement initState
  64 + super.initState();
  65 + WidgetsBinding.instance.addPostFrameCallback((_) {
  66 + // if (!couponProvider.hasModify) {
  67 + _couponNetworkData();
  68 + // } else {
  69 + // couponProvider.pageStateSelect = PageState.Success;
  70 + // // couponProvider.notifyListeners();
  71 + // }
  72 + });
  73 + }
  74 +
  75 + @override
  76 + void dispose() {
  77 + super.dispose();
  78 + }
  79 +
  80 + ///获取优惠券列表数据(status == 1)
  81 +
  82 + _couponNetworkData({bool isShowLoading = true}) async {
  83 + Map<String, String> params = {
  84 + "uid": Provider.of<UserModel>(context, listen: false).user!.openid!,
  85 + "is_type": widget.type!
  86 + };
  87 + params['status'] = '1';
  88 +
  89 + await couponProvider.getCustomerSelectActivityMarking(context, params,
  90 + isShowLoading: isShowLoading);
  91 +
  92 + // if (DateUtil.getDateTime(endDate)
  93 + // List<String> start = fromDate.split('-');
  94 +
  95 + // String from = '${start[0]}' +
  96 + // '-' +
  97 + // Utils.addZeroNumber(int.parse(start[1])) +
  98 + // '-' +
  99 + // Utils.addZeroNumber(int.parse(start[2])) +
  100 + // ' 00:00:00';
  101 + // List<String> endList = endDate.split('-');
  102 + // String end = '${endList[0]}' +
  103 + // '-' +
  104 + // Utils.addZeroNumber(int.parse(endList[1])) +
  105 + // '-' +
  106 + // Utils.addZeroNumber(int.parse(endList[2])) +
  107 + // ' 23:59:59';
  108 +
  109 + // Map<String, String?> params = {
  110 + // 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
  111 + // 'stime': '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}',
  112 + // 'etime': '${(DateUtil.getDateMsByTimeStr(end)! / 1000).floor()}',
  113 + // };
  114 + // .compareTo(DateUtil.getDateTime(fromDate)) <
  115 + // 0) {
  116 + // Utils.showToast('结束日期不能早于开始日期');
  117 + // return;
  118 + // }
  119 +
  120 + // outerloop:
  121 + List<CouponSunModel> temp = [];
  122 + for (int i = 0; i < couponProvider.couponListSelect!.length; i++) {
  123 + CouponSunModel data = couponProvider.couponListSelect![i];
  124 + // data.stime
  125 + // data.etime
  126 + //重组数据
  127 +// 券开始早于活动开始 && 券结束大于活动结束
  128 + DateTime dateTimes = DateTime.fromMillisecondsSinceEpoch(
  129 + int.parse(data.stime.toString()) * 1000);
  130 + String fromC = DateUtil.formatDate(dateTimes, format: DateFormats.y_mo_d);
  131 +
  132 + DateTime dateTimeseEnd = DateTime.fromMillisecondsSinceEpoch(
  133 + int.parse(data.etime.toString()) * 1000);
  134 + String endC =
  135 + DateUtil.formatDate(dateTimeseEnd, format: DateFormats.y_mo_d);
  136 + if (DateUtil.getDateTime(fromC)
  137 + .compareTo(DateUtil.getDateTime(widget.from!)) <=
  138 + 0 &&
  139 + DateUtil.getDateTime(widget.end!)
  140 + .compareTo(DateUtil.getDateTime(endC)) <=
  141 + 0) {
  142 + temp.add(couponProvider.couponListSelect![i]);
  143 + }
  144 + }
  145 + couponProvider.couponListSelect = temp;
  146 + if (couponProvider.couponListSelect!.length == 0) {
  147 + couponProvider.pageStateSelect = PageState.Empty;
  148 + setState(() {});
  149 + } else {
  150 + for (var item in couponProvider.couponListSelect!) {
  151 + for (var itemselect in widget.couponList!) {
  152 + if (itemselect.id == item.id) {
  153 + item.isCheck = true;
  154 + // item.number = itemselect.number;
  155 + // item.numberC.text = item.number.toString();
  156 + selectDataList.add(item);
  157 + // break outerloop;
  158 + }
  159 + }
  160 + }
  161 + if (selectDataList.length == couponProvider.couponListSelect!.length) {
  162 + all = true;
  163 + }
  164 +
  165 + setState(() {});
  166 + }
  167 + }
  168 +
  169 + @override
  170 + Widget build(BuildContext context) {
  171 + couponProvider = Provider.of<CouponProvider>(context, listen: true);
  172 + return Scaffold(
  173 + backgroundColor: MyColours.color_ffffff,
  174 + appBar: SystemAppBar(
  175 + '选择优惠券',
  176 + onTap: () {
  177 + if (Navigator.canPop(context)) {
  178 + Navigator.pop(context);
  179 + }
  180 + },
  181 + ),
  182 + body: Column(
  183 + children: [
  184 + Expanded(child: Consumer<CouponProvider>(
  185 + builder: (context, model, _) {
  186 + if (model.pageStateSelect != PageState.Success) {
  187 + return ExceptionPage(
  188 + pageState: model.pageStateSelect,
  189 + callback: () async {
  190 + if (model.pageStateSelect == PageState.Empty) {
  191 + //去创建免费优惠券
  192 + bool? needRefresh;
  193 +
  194 + needRefresh = await NavigatorUtil.goCouponEditPage(
  195 + context,
  196 + from: widget.from,
  197 + end: widget.end,
  198 + isMine: true);
  199 +
  200 + print(needRefresh);
  201 + if (needRefresh != null && needRefresh) {
  202 + //刷新页面数据
  203 + // _controller.callRefresh();
  204 + _couponNetworkData();
  205 + }
  206 + } else {
  207 + _couponNetworkData();
  208 + }
  209 +
  210 + // offset = 0;
  211 + // getMessage(showLoading: true);
  212 + },
  213 + emptyMsg: "暂时没有可用的优惠券哦,",
  214 + emptyImg: "empty_search",
  215 + showMsg: "加载中,请稍候...",
  216 + showText: '去创建',
  217 + );
  218 + } else {
  219 + return EasyRefresh.custom(
  220 + controller: _controller,
  221 + shrinkWrap: true,
  222 + slivers: [
  223 + SliverList(
  224 + delegate: SliverChildBuilderDelegate(
  225 + (BuildContext context, int index) {
  226 + return VEmptyView(40);
  227 + }, childCount: 1),
  228 + ),
  229 + SliverList(
  230 + delegate: SliverChildBuilderDelegate(
  231 + (BuildContext context, int index) {
  232 + CouponSunModel sunModel =
  233 + couponProvider.couponListSelect![index];
  234 + return InkWell(
  235 + onTap: () {
  236 + if (sunModel.isType != '3') {
  237 + //改这里 ******8
  238 + if (widget.mulSelect) {
  239 + sunModel.isCheck = !sunModel.isCheck;
  240 + if (sunModel.isCheck) {
  241 + selectDataList.add(sunModel);
  242 + } else {
  243 + selectDataList.remove(sunModel);
  244 + }
  245 + if (couponProvider.couponListSelect!
  246 + .every((element) => element.isCheck)) {
  247 + all = true;
  248 + } else {
  249 + all = false;
  250 + }
  251 + } else {
  252 + couponProvider.couponListSelect!
  253 + .forEach((element) {
  254 + element.isCheck = false;
  255 + });
  256 + selectDataList = [];
  257 + selectDataList.add(sunModel);
  258 + sunModel.isCheck = true;
  259 + }
  260 +
  261 + setState(() {});
  262 + }
  263 + },
  264 + // child: Row(
  265 + // children: [
  266 + // HEmptyView(30),
  267 + // !widget.hasModify
  268 + // ? Checkbox(
  269 + // value: couponProvider
  270 + // .couponListSelect[index].isCheck,
  271 + // checkColor: MyColours.color_ffffff,
  272 + // activeColor: MyColours.app_main,
  273 + // onChanged: (bool value) {},
  274 + // )
  275 + // : Container(),
  276 + // Image.asset(
  277 + // couponProvider.listData[index]['checked']
  278 + // ? 'assets/select.png'
  279 + // : 'assets/unselect.png',
  280 + // width: ScreenUtil().setWidth(44)),
  281 + child: CouponItemF(
  282 + from: 'select',
  283 + showCheck: true,
  284 + radio: widget.mulSelect,
  285 + needNum: false,
  286 + couponSonModel:
  287 + couponProvider.couponListSelect![index],
  288 + onPressed: () {
  289 + NavigatorUtil.goCouponDetailPage(context, couponProvider.couponListSelect![index],
  290 + idStr: couponProvider.couponListSelect![index].id);
  291 + },
  292 + onPressedSelect: () {
  293 + // bool old = couponProvider
  294 + // .couponListSelect[index].isCheck;
  295 + //改这里 ******8
  296 + if (widget.mulSelect) {
  297 + couponProvider.couponListSelect![index]
  298 + .isCheck =
  299 + !couponProvider
  300 + .couponListSelect![index].isCheck;
  301 + if (couponProvider
  302 + .couponListSelect![index].isCheck) {
  303 + selectDataList.add(couponProvider
  304 + .couponListSelect![index]);
  305 + } else {
  306 + selectDataList.remove(couponProvider
  307 + .couponListSelect![index]);
  308 + }
  309 + if (couponProvider.couponListSelect!
  310 + .every(
  311 + (element) => element.isCheck)) {
  312 + all = true;
  313 + } else {
  314 + all = false;
  315 + }
  316 + } else {
  317 + couponProvider.couponListSelect!
  318 + .forEach((element) {
  319 + element.isCheck = false;
  320 + });
  321 + selectDataList = [];
  322 + selectDataList.add(couponProvider
  323 + .couponListSelect![index]);
  324 + couponProvider.couponListSelect![index]
  325 + .isCheck = true;
  326 + }
  327 + setState(() {});
  328 + }));
  329 + }, childCount: couponProvider.couponListSelect!.length),
  330 + )
  331 + ],
  332 + // onRefresh: () async {
  333 + // // offset = 0;
  334 + // // getMessage(showLoading: false);
  335 + // },
  336 + // onLoad: () async {
  337 + // // offset++;
  338 + // // getMessage(showLoading: false);
  339 + // },
  340 + );
  341 + }
  342 + },
  343 + )),
  344 + VEmptyView(20),
  345 + if (couponProvider.pageStateSelect == PageState.Success)
  346 + widget.mulSelect
  347 + ? Container(
  348 + padding: EdgeInsets.only(
  349 + left: w(20), top: w(12), right: w(20), bottom: w(25)),
  350 + child: Row(
  351 + crossAxisAlignment: CrossAxisAlignment.center,
  352 + children: [
  353 + InkWell(
  354 + onTap: () {
  355 + all = !all;
  356 + if (all) {
  357 + selectDataList = [];
  358 + for (var item
  359 + in couponProvider.couponListSelect!) {
  360 + item.isCheck = true;
  361 + selectDataList.add(item);
  362 + }
  363 + } else {
  364 + selectDataList = [];
  365 + for (var item
  366 + in couponProvider.couponListSelect!) {
  367 + item.isCheck = false;
  368 + }
  369 + }
  370 + setState(() {});
  371 + },
  372 + child: Row(
  373 + children: [
  374 + Image.asset(
  375 + Utils.getImgPath(
  376 + all ? 'c_mul_select' : 'c_not_edit'),
  377 + width: ScreenUtil().setWidth(40),
  378 + ),
  379 + HEmptyView(10),
  380 + Text(
  381 + '全选',
  382 + style: TextStyle(
  383 + fontSize: ScreenUtil().setWidth(32),
  384 + fontWeight: FontWeight.bold,
  385 + color: MyColours.color_000000),
  386 + ),
  387 + HEmptyView(20),
  388 + ],
  389 + )),
  390 + Expanded(
  391 + child: RoundButton(
  392 + onPressed: () async {
  393 + //如果是免费的优惠券,有个数的,数量为0的时候提示
  394 + bool can = true;
  395 + for (int i = 0; i < selectDataList.length; i++) {
  396 + CouponSunModel element = selectDataList[i];
  397 + if (element.isType == '3' &&
  398 + element.isCheck &&
  399 + element.number == 0) {
  400 + Utils.showToast('请输入【${element.aname}】的数量');
  401 + can = false;
  402 + break;
  403 + }
  404 + }
  405 + if (can) {
  406 + Map temp = {
  407 + 'coupon': selectDataList,
  408 + };
  409 + if (Navigator.canPop(context)) {
  410 + Navigator.pop(context, temp);
  411 + }
  412 + }
  413 + },
  414 + text: '确定选择${selectDataList.length}个优惠券',
  415 + fontSize: 34,
  416 + isBold: false,
  417 + height: ScreenUtil().setWidth(80),
  418 + // width: double.infinity,
  419 + radius: ScreenUtil().setWidth(10),
  420 + )),
  421 + ],
  422 + ))
  423 + : Container(
  424 + padding: EdgeInsets.only(
  425 + left: w(20), top: w(12), right: w(20), bottom: w(25)),
  426 + child: RoundButton(
  427 + onPressed: () async {
  428 + Map temp = {
  429 + 'coupon': selectDataList,
  430 + };
  431 + if (Navigator.canPop(context)) {
  432 + Navigator.pop(context, temp);
  433 + }
  434 + },
  435 + text: '确定',
  436 + fontSize: 34,
  437 + isBold: false,
  438 + height: ScreenUtil().setWidth(80),
  439 + width: double.infinity,
  440 + radius: ScreenUtil().setWidth(10),
  441 + ))
  442 + ],
  443 + ));
  444 + }
  445 +}
@@ -93,7 +93,7 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> { @@ -93,7 +93,7 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> {
93 return Container( 93 return Container(
94 width: double.infinity, 94 width: double.infinity,
95 height: w(40), 95 height: w(40),
96 - color: MyColours.color_4DDBDBDB, 96 + // color: MyColours.color_4DDBDBDB,
97 alignment: Alignment.center, 97 alignment: Alignment.center,
98 child: Text( 98 child: Text(
99 '仅展示近5天的交易信息,如果需要展示更多信息,请使用右上角日期筛选', 99 '仅展示近5天的交易信息,如果需要展示更多信息,请使用右上角日期筛选',
@@ -107,30 +107,18 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> { @@ -107,30 +107,18 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> {
107 financeProvider = Provider.of<FinanceProvider>(context, listen: true); 107 financeProvider = Provider.of<FinanceProvider>(context, listen: true);
108 return Scaffold( 108 return Scaffold(
109 backgroundColor: MyColours.color_ffffff, 109 backgroundColor: MyColours.color_ffffff,
110 - appBar: SystemAppBar('交易记录'), 110 + appBar: SystemAppBar(
  111 + '交易记录',
  112 + rightImgName: 'calender.png',
  113 + onTapRight: () {
  114 + //跳转筛选页面
  115 + NavigatorUtil.goTransactionRecordSearchPage(context);
  116 + },
  117 + ),
111 body: Consumer<FinanceProvider>(builder: (context, model, _) { 118 body: Consumer<FinanceProvider>(builder: (context, model, _) {
112 if (model.pageStateRecordHome != PageState.Success) { 119 if (model.pageStateRecordHome != PageState.Success) {
113 return Column( 120 return Column(
114 children: [ 121 children: [
115 - Align(  
116 - alignment: Alignment.centerRight,  
117 - child: InkWell(  
118 - onTap: () {  
119 - //跳转筛选页面  
120 - NavigatorUtil.goTransactionRecordSearchPage(context);  
121 - },  
122 - child: Container(  
123 - padding: EdgeInsets.only(  
124 - right: w(20),  
125 - left: w(20),  
126 - top: w(10),  
127 - bottom: w(10)),  
128 - child: Image.asset(  
129 - Utils.getImgPath('calender'),  
130 - width: w(20),  
131 - ),  
132 - )),  
133 - ),  
134 Expanded( 122 Expanded(
135 child: ExceptionPage( 123 child: ExceptionPage(
136 pageState: model.pageStateRecordHome, 124 pageState: model.pageStateRecordHome,
@@ -159,65 +147,36 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> { @@ -159,65 +147,36 @@ class _TransactionRecordHomePageState extends State<TransactionRecordHomePage> {
159 child: Column( 147 child: Column(
160 crossAxisAlignment: CrossAxisAlignment.center, 148 crossAxisAlignment: CrossAxisAlignment.center,
161 children: [ 149 children: [
162 - Stack(children: [  
163 - Container(  
164 - width: double.infinity,  
165 - alignment: Alignment.center, 150 + Container(
  151 + width: double.infinity,
  152 + alignment: Alignment.center,
166 153
167 - // height: w(40),  
168 - color: MyColours.color_4DDBDBDB,  
169 - padding: EdgeInsets.only(  
170 - top: index == 0 ? w(10) : w(22),  
171 - bottom: w(10)),  
172 - child: Wrap(  
173 - runSpacing: w(5),  
174 - crossAxisAlignment:  
175 - WrapCrossAlignment.center,  
176 - children: [  
177 - Text(  
178 - listData!.date ?? '',  
179 - style: TextStyle(  
180 - color: MyColours.color_515151,  
181 - fontSize: font(14)),  
182 - ),  
183 - HEmptyView(16),  
184 - Padding(  
185 - padding: EdgeInsets.only(  
186 - right: index == 0 ? w(33) : 0),  
187 - child: Text(  
188 - '收入${listData.total},支出${listData.refundTotal}',  
189 - maxLines: 3,  
190 - overflow: TextOverflow.ellipsis,  
191 - style: TextStyle(  
192 - color: MyColours.color_999999,  
193 - fontSize: font(12)),  
194 - ),  
195 - ),  
196 - ],  
197 - )),  
198 - if (index == 0)  
199 - Positioned(  
200 - top: 0,  
201 - right: 0,  
202 - child: InkWell(  
203 - onTap: () {  
204 - //跳转筛选页面  
205 - NavigatorUtil  
206 - .goTransactionRecordSearchPage(  
207 - context);  
208 - },  
209 - child: Container(  
210 - padding: EdgeInsets.only(  
211 - right: w(20),  
212 - left: w(20),  
213 - top: w(10),  
214 - bottom: w(10)),  
215 - child: Image.asset(  
216 - Utils.getImgPath('calender'),  
217 - width: w(20),  
218 - ),  
219 - )))  
220 - ]), 154 + // height: w(40),
  155 + color: MyColours.color_4DDBDBDB,
  156 + padding: EdgeInsets.only(
  157 + top: w(10), bottom: w(10)),
  158 + child: Wrap(
  159 + runSpacing: w(5),
  160 + crossAxisAlignment:
  161 + WrapCrossAlignment.center,
  162 + children: [
  163 + Text(
  164 + listData!.date ?? '',
  165 + style: TextStyle(
  166 + color: MyColours.color_515151,
  167 + fontSize: font(14)),
  168 + ),
  169 + HEmptyView(16),
  170 + Text(
  171 + '收入${listData.total},支出${listData.refundTotal}',
  172 + maxLines: 3,
  173 + overflow: TextOverflow.ellipsis,
  174 + style: TextStyle(
  175 + color: MyColours.color_999999,
  176 + fontSize: font(12)),
  177 + ),
  178 + ],
  179 + )),
221 ListView.builder( 180 ListView.builder(
222 itemCount: listData.list?.length, 181 itemCount: listData.list?.length,
223 shrinkWrap: true, 182 shrinkWrap: true,
@@ -121,6 +121,7 @@ class _TransactionRecordSearchPageState @@ -121,6 +121,7 @@ class _TransactionRecordSearchPageState
121 Widget build(BuildContext context) { 121 Widget build(BuildContext context) {
122 financeProvider = Provider.of<FinanceProvider>(context, listen: true); 122 financeProvider = Provider.of<FinanceProvider>(context, listen: true);
123 return Scaffold( 123 return Scaffold(
  124 + backgroundColor: MyColours.color_ffffff,
124 appBar: SystemAppBar('自定义查询'), 125 appBar: SystemAppBar('自定义查询'),
125 key: scaffoldKey, 126 key: scaffoldKey,
126 body: Column( 127 body: Column(
@@ -165,6 +166,7 @@ class _TransactionRecordSearchPageState @@ -165,6 +166,7 @@ class _TransactionRecordSearchPageState
165 }); 166 });
166 }), 167 }),
167 Container( 168 Container(
  169 + margin: EdgeInsets.only(left: w(16)),
168 height: ScreenUtil().setWidth(1), 170 height: ScreenUtil().setWidth(1),
169 color: MyColours.color_E7E7E7, 171 color: MyColours.color_E7E7E7,
170 ), 172 ),
@@ -197,6 +199,7 @@ class _TransactionRecordSearchPageState @@ -197,6 +199,7 @@ class _TransactionRecordSearchPageState
197 }); 199 });
198 }), 200 }),
199 Container( 201 Container(
  202 + margin: EdgeInsets.only(left: w(16)),
200 height: ScreenUtil().setWidth(1), 203 height: ScreenUtil().setWidth(1),
201 color: MyColours.color_E7E7E7, 204 color: MyColours.color_E7E7E7,
202 ), 205 ),
@@ -207,7 +207,11 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> { @@ -207,7 +207,11 @@ class _MarkingCouponSelectPageState extends State<MarkingCouponSelectPage> {
207 radio: widget.mulSelect, 207 radio: widget.mulSelect,
208 couponSonModel: 208 couponSonModel:
209 couponProvider.couponListSelect![index], 209 couponProvider.couponListSelect![index],
210 - onPressed: () { 210 + onPressed: () {
  211 + NavigatorUtil.goCouponDetailPage(context, couponProvider.couponListSelect![index],
  212 + idStr: couponProvider.couponListSelect![index].id);
  213 + },
  214 + onPressedSelect: () {
211 // bool old = couponProvider 215 // bool old = couponProvider
212 // .couponListSelect[index].isCheck; 216 // .couponListSelect[index].isCheck;
213 //改这里 ******8 217 //改这里 ******8
@@ -178,7 +178,12 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> { @@ -178,7 +178,12 @@ class _MarkingRechargeSelectPageState extends State<MarkingRechargeSelectPage> {
178 showCheck: true, 178 showCheck: true,
179 rechargeListSunModel: 179 rechargeListSunModel:
180 rechargeListCanUse[index], 180 rechargeListCanUse[index],
181 - onPressed: () { 181 + onPressed: (){
  182 + //查看页
  183 + NavigatorUtil.goRechargeDetailPage(
  184 + context, rechargeListCanUse[index].id);
  185 + },
  186 + onPressedSelect: () {
182 // bool old = couponProvider 187 // bool old = couponProvider
183 // .couponListSelect[index].isCheck; 188 // .couponListSelect[index].isCheck;
184 //改这里 ******8 189 //改这里 ******8
1 -  
2 import 'package:cached_network_image/cached_network_image.dart'; 1 import 'package:cached_network_image/cached_network_image.dart';
3 import 'package:common_utils/common_utils.dart'; 2 import 'package:common_utils/common_utils.dart';
4 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
@@ -19,6 +18,7 @@ import '../../../../utils/screen_util.dart'; @@ -19,6 +18,7 @@ import '../../../../utils/screen_util.dart';
19 class RechargeItem extends StatefulWidget { 18 class RechargeItem extends StatefulWidget {
20 final String? from; 19 final String? from;
21 final VoidCallback? onPressed; 20 final VoidCallback? onPressed;
  21 + final VoidCallback? onPressedSelect;
22 final VoidCallback? onPressedDel; 22 final VoidCallback? onPressedDel;
23 final VoidCallback? onPressedUse; 23 final VoidCallback? onPressedUse;
24 final RechargeListSunModel? rechargeListSunModel; 24 final RechargeListSunModel? rechargeListSunModel;
@@ -28,6 +28,7 @@ class RechargeItem extends StatefulWidget { @@ -28,6 +28,7 @@ class RechargeItem extends StatefulWidget {
28 Key? key, 28 Key? key,
29 this.from, 29 this.from,
30 this.onPressed, 30 this.onPressed,
  31 + this.onPressedSelect,
31 this.onPressedDel, 32 this.onPressedDel,
32 this.onPressedUse, 33 this.onPressedUse,
33 this.rechargeListSunModel, 34 this.rechargeListSunModel,
@@ -50,7 +51,6 @@ class _RechargeItemState extends State<RechargeItem> { @@ -50,7 +51,6 @@ class _RechargeItemState extends State<RechargeItem> {
50 notSelect = false; 51 notSelect = false;
51 } else { 52 } else {
52 // notSelect = sunModel.isOpenBool; 53 // notSelect = sunModel.isOpenBool;
53 -  
54 } 54 }
55 if (widget.from == 'menu' || widget.from == 'menu-show') { 55 if (widget.from == 'menu' || widget.from == 'menu-show') {
56 decoration = BoxDecoration( 56 decoration = BoxDecoration(
@@ -138,7 +138,8 @@ class _RechargeItemState extends State<RechargeItem> { @@ -138,7 +138,8 @@ class _RechargeItemState extends State<RechargeItem> {
138 mainAxisAlignment: 138 mainAxisAlignment:
139 MainAxisAlignment.spaceBetween, 139 MainAxisAlignment.spaceBetween,
140 children: [ 140 children: [
141 - Expanded(child: Text( 141 + Expanded(
  142 + child: Text(
142 widget.rechargeListSunModel!.rname!, 143 widget.rechargeListSunModel!.rname!,
143 maxLines: 1, 144 maxLines: 1,
144 overflow: TextOverflow.ellipsis, 145 overflow: TextOverflow.ellipsis,
@@ -386,13 +387,17 @@ class _RechargeItemState extends State<RechargeItem> { @@ -386,13 +387,17 @@ class _RechargeItemState extends State<RechargeItem> {
386 ? Positioned( 387 ? Positioned(
387 left: w(10), 388 left: w(10),
388 // top: ScreenUtil().setWidth(115), 389 // top: ScreenUtil().setWidth(115),
389 - child: Image.asset(  
390 - Utils.getImgPath(widget.rechargeListSunModel!.isCheck  
391 - ? 'select_f'  
392 - : 'show_select_f'),  
393 - width: ScreenUtil().setWidth(50),  
394 - height: ScreenUtil().setWidth(50),  
395 - )) 390 + child: InkWell(
  391 + onTap: widget.onPressedSelect,
  392 + child: Container(
  393 + child: Image.asset(
  394 + Utils.getImgPath(
  395 + widget.rechargeListSunModel!.isCheck
  396 + ? 'select_f'
  397 + : 'show_select_f'),
  398 + width: ScreenUtil().setWidth(50),
  399 + height: ScreenUtil().setWidth(50),
  400 + ))))
396 : SizedBox(), 401 : SizedBox(),
397 if (widget.from == 'history') 402 if (widget.from == 'history')
398 Positioned( 403 Positioned(
1 -  
2 import 'dart:io'; 1 import 'dart:io';
3 2
4 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
@@ -212,6 +211,12 @@ class _RechargeSelectStoreCouponPageState @@ -212,6 +211,12 @@ class _RechargeSelectStoreCouponPageState
212 couponSonModel: 211 couponSonModel:
213 couponProvider.couponListSelect![index], 212 couponProvider.couponListSelect![index],
214 onPressed: () { 213 onPressed: () {
  214 + NavigatorUtil.goCouponDetailPage(context,
  215 + couponProvider.couponListSelect![index],
  216 + idStr: couponProvider
  217 + .couponListSelect![index].id);
  218 + },
  219 + onPressedSelect: () {
215 //改这里 ******8 220 //改这里 ******8
216 if (true) { 221 if (true) {
217 couponProvider 222 couponProvider
@@ -359,13 +359,13 @@ class NavigatorUtil { @@ -359,13 +359,13 @@ class NavigatorUtil {
359 359
360 /// 创建优惠券 360 /// 创建优惠券
361 static Future<dynamic> goCouponEditPage(BuildContext context, 361 static Future<dynamic> goCouponEditPage(BuildContext context,
362 - {replace = false, bool isMine = true, CouponSunModel? couponSunModel}) { 362 + {replace = false, String? from,String? end,bool isMine = true, CouponSunModel? couponSunModel}) {
363 if (couponSunModel != null) { 363 if (couponSunModel != null) {
364 return _navigateTo(context, 364 return _navigateTo(context,
365 - "${Routes.coupon_edit}?isMine=${isMine}&couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}", 365 + "${Routes.coupon_edit}?isMine=${isMine}&from=${from}&end=$end&couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}",
366 replace: replace); 366 replace: replace);
367 } 367 }
368 - return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}", 368 + return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}&from=${from}&end=$end",
369 replace: replace); 369 replace: replace);
370 } 370 }
371 371
@@ -2374,8 +2374,7 @@ class NavigatorUtil { @@ -2374,8 +2374,7 @@ class NavigatorUtil {
2374 replace: replace); 2374 replace: replace);
2375 } 2375 }
2376 2376
2377 -  
2378 - ///交易记录自定义查询 2377 + ///交易记录自定义查询
2379 static Future<dynamic> goTransactionRecordSearchPage( 2378 static Future<dynamic> goTransactionRecordSearchPage(
2380 BuildContext context, { 2379 BuildContext context, {
2381 replace = false, 2380 replace = false,
@@ -2384,14 +2383,33 @@ class NavigatorUtil { @@ -2384,14 +2383,33 @@ class NavigatorUtil {
2384 replace: replace); 2383 replace: replace);
2385 } 2384 }
2386 2385
2387 -  
2388 -  
2389 - ///交易详情 2386 + ///交易详情
2390 static Future<dynamic> goTransactionRecordDetailPage( 2387 static Future<dynamic> goTransactionRecordDetailPage(
2391 - BuildContext context,String? status,String? id, { 2388 + BuildContext context,
  2389 + String? status,
  2390 + String? id, {
  2391 + replace = false,
  2392 + }) {
  2393 + return _navigateTo(context,
  2394 + "${Routes.transaction_record_detail_page}?status=$status&id=$id",
  2395 + replace: replace);
  2396 + }
  2397 +
  2398 + ///支付返券
  2399 + static Future<dynamic> goPaymentGiftPage(
  2400 + BuildContext context, {
2392 replace = false, 2401 replace = false,
2393 }) { 2402 }) {
2394 - return _navigateTo(context, "${Routes.transaction_record_detail_page}?status=$status&id=$id", 2403 + return _navigateTo(context, "${Routes.payment_gift_page}",
  2404 + replace: replace);
  2405 + }
  2406 +
  2407 + ///支付返券------优惠券选择
  2408 + static Future<dynamic> goPaymentGiftSelectPage(
  2409 + BuildContext context, String type, Map object, String from, String end,
  2410 + {replace = false, bool mulSelect = true}) {
  2411 + return _navigateTo(context,
  2412 + "${Routes.payment_gift_select_page}?object=${FluroConvertUtils.object2string(object)}&from=$from&end=$end&type=$type&mulSelect=${mulSelect}",
2395 replace: replace); 2413 replace: replace);
2396 } 2414 }
2397 } 2415 }
@@ -223,6 +223,8 @@ import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart'; @@ -223,6 +223,8 @@ import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart';
223 import '../pages/my/feast_manage/feast_wine_manage_page.dart'; 223 import '../pages/my/feast_manage/feast_wine_manage_page.dart';
224 import '../pages/my/finance_manage/finance_manage_home_page.dart'; 224 import '../pages/my/finance_manage/finance_manage_home_page.dart';
225 import '../pages/my/finance_manage/payment_code_page.dart'; 225 import '../pages/my/finance_manage/payment_code_page.dart';
  226 +import '../pages/my/finance_manage/payment_gift_page.dart';
  227 +import '../pages/my/finance_manage/payment_gift_select_page.dart';
226 import '../pages/my/finance_manage/transaction_record_detail_page.dart'; 228 import '../pages/my/finance_manage/transaction_record_detail_page.dart';
227 import '../pages/my/finance_manage/transaction_record_home_page.dart'; 229 import '../pages/my/finance_manage/transaction_record_home_page.dart';
228 import '../pages/my/finance_manage/transaction_record_search_page.dart'; 230 import '../pages/my/finance_manage/transaction_record_search_page.dart';
@@ -887,6 +889,9 @@ var handleCouponEditPageHandler = new Handler( @@ -887,6 +889,9 @@ var handleCouponEditPageHandler = new Handler(
887 // String rid = params["rid"].first; 889 // String rid = params["rid"].first;
888 bool isMine = 890 bool isMine =
889 FluroConvertUtils.string2bool(params["isMine"]!.first as String); 891 FluroConvertUtils.string2bool(params["isMine"]!.first as String);
  892 +
  893 + String from= params["from"]?.first as String;
  894 + String end = params["end"]?.first as String;
890 CouponSunModel? couponSunModel; 895 CouponSunModel? couponSunModel;
891 if (params.keys.contains("couponSunModel")) { 896 if (params.keys.contains("couponSunModel")) {
892 couponSunModel = CouponSunModel.fromJson(json.decode( 897 couponSunModel = CouponSunModel.fromJson(json.decode(
@@ -896,7 +901,7 @@ var handleCouponEditPageHandler = new Handler( @@ -896,7 +901,7 @@ var handleCouponEditPageHandler = new Handler(
896 901
897 return ChangeNotifierProvider<UploadImageProvider>( 902 return ChangeNotifierProvider<UploadImageProvider>(
898 create: (_) => UploadImageProvider(), 903 create: (_) => UploadImageProvider(),
899 - child: CouponEidtPage(isMine: isMine, couponSunModel: couponSunModel)); 904 + child: CouponEidtPage(isMine: isMine,from:from,end:end, couponSunModel: couponSunModel));
900 }); 905 });
901 906
902 ///选择优惠券 907 ///选择优惠券
@@ -4180,7 +4185,7 @@ var transactionRecordSearchPageHandle = new Handler( @@ -4180,7 +4185,7 @@ var transactionRecordSearchPageHandle = new Handler(
4180 var transactionRecordDetailPageHandle = new Handler( 4185 var transactionRecordDetailPageHandle = new Handler(
4181 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) { 4186 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
4182 String id = params["id"]!.first as String; 4187 String id = params["id"]!.first as String;
4183 - String status= params["status"]!.first as String; 4188 + String status = params["status"]!.first as String;
4184 // bool isMine = 4189 // bool isMine =
4185 // FluroConvertUtils.string2bool(params["isMine"]!.first as String); 4190 // FluroConvertUtils.string2bool(params["isMine"]!.first as String);
4186 // CouponSunModel? couponSunModel; 4191 // CouponSunModel? couponSunModel;
@@ -4191,5 +4196,61 @@ var transactionRecordDetailPageHandle = new Handler( @@ -4191,5 +4196,61 @@ var transactionRecordDetailPageHandle = new Handler(
4191 // } 4196 // }
4192 4197
4193 return ChangeNotifierProvider<FinanceProvider>( 4198 return ChangeNotifierProvider<FinanceProvider>(
4194 - create: (_) => FinanceProvider(), child: TransactionRecordDetailPage(status:status,id:id)); 4199 + create: (_) => FinanceProvider(),
  4200 + child: TransactionRecordDetailPage(status: status, id: id));
  4201 +});
  4202 +
  4203 +///支付返券
  4204 +var paymentGiftPageHandle = new Handler(
  4205 + handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
  4206 + // String id = params["id"]!.first as String;
  4207 + // String status = params["status"]!.first as String;
  4208 + // bool isMine =
  4209 + // FluroConvertUtils.string2bool(params["isMine"]!.first as String);
  4210 + // CouponSunModel? couponSunModel;
  4211 + // if (params.keys.contains("couponSunModel")) {
  4212 + // couponSunModel = CouponSunModel.fromJson(json.decode(
  4213 + // FluroConvertUtils.fluroCnParamsDecode(
  4214 + // params["couponSunModel"]!.first as String)));
  4215 + // }
  4216 +
  4217 + return ChangeNotifierProvider<FinanceProvider>(
  4218 + create: (_) => FinanceProvider(), child: PaymentGiftPage());
  4219 +});
  4220 +
  4221 +// /选择优惠券
  4222 +// var paymentGiftSelectPageHandle = new Handler(
  4223 +// handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
  4224 +// String from = params["from"]!.first as String;
  4225 +// bool hasModify =
  4226 +// FluroConvertUtils.string2bool(params["hasModify"]!.first as String);
  4227 +// return PaymentGiftSelectPage(from: from, hasModify: hasModify);
  4228 +// });
  4229 +
  4230 +///收银管理---支付返券选择优惠券
  4231 +var paymentGiftSelectPageHandle = new Handler(
  4232 + handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
  4233 + // String idstr = params["idstr"].first;dfdf
  4234 +
  4235 + String type = params["type"]!.first as String;
  4236 + String from= params["from"]!.first as String;
  4237 + String end = params["end"]!.first as String;
  4238 + List<CouponSunModel> res = [];
  4239 + if (params.keys.contains('object')) {
  4240 + Map object =
  4241 + FluroConvertUtils.string2map(params["object"]!.first as String)!;
  4242 + List temp = object['object'];
  4243 +
  4244 + for (var item in temp) {
  4245 + res.add(CouponSunModel.fromJson(item));
  4246 + }
  4247 + }
  4248 + bool mulSelect =
  4249 + FluroConvertUtils.string2bool(params["mulSelect"]!.first as String);
  4250 + // NotebookDetail detailEntity = NotebookDetail.fromJson(json
  4251 + // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  4252 + return ChangeNotifierProvider<MarketingCenterProvider>(
  4253 + create: (_) => MarketingCenterProvider(),
  4254 + child: PaymentGiftSelectPage(
  4255 + type: type, couponList: res, mulSelect: mulSelect,from :from,end:end));
4195 }); 4256 });
@@ -414,7 +414,14 @@ class Routes { @@ -414,7 +414,14 @@ class Routes {
414 "/transaction_record_search_page"; //自定义查询 414 "/transaction_record_search_page"; //自定义查询
415 static String transaction_record_detail_page = 415 static String transaction_record_detail_page =
416 "/transaction_record_detail_page"; //订单消费详情 416 "/transaction_record_detail_page"; //订单消费详情
417 - 417 +
  418 +
  419 +
  420 + static String payment_gift_page =
  421 + "/payment_gift_page"; //支付返券
  422 + static String payment_gift_select_page =
  423 + "/payment_gift_select_page"; //支付返券选择券页面(免费代金券)
  424 +
418 425
419 static void configureRoutes(FluroRouter router) { 426 static void configureRoutes(FluroRouter router) {
420 router.notFoundHandler = new Handler( 427 router.notFoundHandler = new Handler(
@@ -785,6 +792,13 @@ class Routes { @@ -785,6 +792,13 @@ class Routes {
785 handler: transactionRecordSearchPageHandle); 792 handler: transactionRecordSearchPageHandle);
786 router.define(transaction_record_detail_page, 793 router.define(transaction_record_detail_page,
787 handler: transactionRecordDetailPageHandle); 794 handler: transactionRecordDetailPageHandle);
  795 + router.define(payment_gift_page,
  796 + handler: paymentGiftPageHandle);
  797 + router.define(payment_gift_select_page,
  798 + handler:paymentGiftSelectPageHandle);
  799 +
  800 +
  801 +
788 802
789 803
790 } 804 }