Commit cbccc635d80b1f3e178ae09d268f841a34633df1

Authored by wdn127929
1 parent fb6fe159

核销券相关UI ok

@@ -6,6 +6,9 @@ class FilterBtnModel { @@ -6,6 +6,9 @@ class FilterBtnModel {
6 String roleName; 6 String roleName;
7 String phone; 7 String phone;
8 String account; 8 String account;
  9 + bool selectMor = false;
  10 + bool selectNoon = false;
  11 + bool selectNig = false;
9 12
10 FilterBtnModel(); 13 FilterBtnModel();
11 14
@@ -15,7 +18,10 @@ class FilterBtnModel { @@ -15,7 +18,10 @@ class FilterBtnModel {
15 ..select = json["select"] 18 ..select = json["select"]
16 ..roleName = json["role_name"] 19 ..roleName = json["role_name"]
17 ..phone = json["phone"] 20 ..phone = json["phone"]
18 - ..account = json["account"]; 21 + ..account = json["account"]
  22 + ..selectMor = json["selectMor"]
  23 + ..selectNoon = json["selectNoon"]
  24 + ..selectNig = json["selectNig"];
19 25
20 Map<String, dynamic> toJson() => <String, dynamic>{ 26 Map<String, dynamic> toJson() => <String, dynamic>{
21 "id": id, 27 "id": id,
@@ -23,6 +29,9 @@ class FilterBtnModel { @@ -23,6 +29,9 @@ class FilterBtnModel {
23 "select": select, 29 "select": select,
24 'roleName': roleName, 30 'roleName': roleName,
25 'phone': phone, 31 'phone': phone,
26 - 'account': account 32 + 'account': account,
  33 + 'selectMor': selectMor,
  34 + 'selectNoon': selectNoon,
  35 + 'selectNig': selectNig
27 }; 36 };
28 } 37 }
@@ -17,6 +17,9 @@ import 'package:one_key/widgets/system_app_bar.dart'; @@ -17,6 +17,9 @@ import 'package:one_key/widgets/system_app_bar.dart';
17 import 'package:one_key/widgets/v_empty_view.dart'; 17 import 'package:one_key/widgets/v_empty_view.dart';
18 import 'package:provider/provider.dart'; 18 import 'package:provider/provider.dart';
19 19
  20 +import '../../models/filter_btn_model.dart';
  21 +import '../../utils/screen_util.dart';
  22 +
20 /** 23 /**
21 * 新建券 24 * 新建券
22 */ 25 */
@@ -45,6 +48,31 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -45,6 +48,31 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
45 CouponProvider couponProvider; 48 CouponProvider couponProvider;
46 bool swichHexiao = true; //默认启用 核销状态 49 bool swichHexiao = true; //默认启用 核销状态
47 String uids = ''; 50 String uids = '';
  51 + TextEditingController _priceControl = TextEditingController();
  52 + FocusNode _priceFocusNode = FocusNode();
  53 +
  54 + bool money = true;
  55 + bool discount = false;
  56 + bool dish = false;
  57 +
  58 + TextEditingController moneyControl = TextEditingController();
  59 + TextEditingController discountControl = TextEditingController();
  60 + TextEditingController dishControl = TextEditingController();
  61 +
  62 + FocusNode moneyFocusNode = FocusNode();
  63 + FocusNode discountFocusNode = FocusNode();
  64 + FocusNode dishFocusNode = FocusNode();
  65 +
  66 + bool limitNone = true;
  67 + bool limitWeek = false;
  68 + bool limitBirthday = false;
  69 + String weekShow = '点击设置可用日期';
  70 + List<FilterBtnModel> weekData = [];
  71 +
  72 + // morning == "00:00-00:00"
  73 + String morning;
  74 + String noon;
  75 + String night;
48 76
49 @override 77 @override
50 void initState() { 78 void initState() {
@@ -73,21 +101,112 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -73,21 +101,112 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
73 // _editingController.text = ''; 101 // _editingController.text = '';
74 } 102 }
75 }); 103 });
  104 +
  105 + _priceFocusNode.addListener(() {
  106 + if (_priceFocusNode.hasFocus) {
  107 + //有焦点
  108 + if (showDateSelWidget) {
  109 + Navigator.pop(context);
  110 + showDateSelWidget = false;
  111 + }
  112 + } else {
  113 + //失去焦点
  114 + // _editingController.text = '';
  115 + }
  116 + });
  117 + moneyFocusNode.addListener(() {
  118 + if (moneyFocusNode.hasFocus) {
  119 + //有焦点
  120 + if (showDateSelWidget) {
  121 + Navigator.pop(context);
  122 + showDateSelWidget = false;
  123 + }
  124 + } else {
  125 + //失去焦点
  126 + // _editingController.text = '';
  127 + }
  128 + });
  129 + discountFocusNode.addListener(() {
  130 + if (discountFocusNode.hasFocus) {
  131 + //有焦点
  132 + if (showDateSelWidget) {
  133 + Navigator.pop(context);
  134 + showDateSelWidget = false;
  135 + }
  136 + } else {
  137 + //失去焦点
  138 + // _editingController.text = '';
  139 + }
  140 + });
  141 + dishFocusNode.addListener(() {
  142 + if (dishFocusNode.hasFocus) {
  143 + //有焦点
  144 + if (showDateSelWidget) {
  145 + Navigator.pop(context);
  146 + showDateSelWidget = false;
  147 + }
  148 + } else {
  149 + //失去焦点
  150 + // _editingController.text = '';
  151 + }
  152 + });
  153 +
  154 + WidgetsBinding.instance.addPostFrameCallback((_) {
  155 + // _couponNetworkData(0);
  156 + _initWeekData();
  157 + });
  158 + }
  159 +
  160 + // //初始化时间
  161 + // initWeekData() async {
  162 + // // UserModel userModel = Provider.of<UserModel>(context, listen: false);
  163 +
  164 + // // morning =
  165 + // // userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
  166 + // // noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
  167 + // // night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
  168 + // // if (morning != "00:00-00:00") {
  169 + // // //开通早餐
  170 + // // }
  171 + // // if (morning != "00:00-00:00") {
  172 + // // //开通午餐
  173 + // // }
  174 + // // if (morning != "00:00-00:00") {
  175 + // // //开通晚餐
  176 + // // }
  177 +
  178 + // }
  179 +
  180 + _initWeekData() {
  181 + FilterBtnModel filterBtnModel = FilterBtnModel();
  182 + filterBtnModel.selectNoon = false;
  183 + filterBtnModel.selectNig = false;
  184 + filterBtnModel.title = '周日';
  185 + weekData.add(filterBtnModel);
  186 + for (int i = 1; i < 7; i++) {
  187 + FilterBtnModel filterBtnModel = FilterBtnModel();
  188 + filterBtnModel.selectNoon = false;
  189 + filterBtnModel.selectNig = false;
  190 + filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
  191 + weekData.add(filterBtnModel);
  192 + }
76 } 193 }
77 194
78 //创建新券 客户经理创建活动 195 //创建新券 客户经理创建活动
79 _createNewCoupon() async { 196 _createNewCoupon() async {
80 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 197 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  198 + String from = fromDate + ' 00:00:00';
  199 + String end = endDate + ' 23:59:59';
81 Map<String, String> params = { 200 Map<String, String> params = {
82 "uid": Provider.of<UserModel>(context, listen: false).user.openid, 201 "uid": Provider.of<UserModel>(context, listen: false).user.openid,
83 "aname": _couponNameEditControl.text.trim(), 202 "aname": _couponNameEditControl.text.trim(),
84 "desc": _couponRequireEditControl.text.trim(), 203 "desc": _couponRequireEditControl.text.trim(),
85 "stime": fromDate == '点击选择' 204 "stime": fromDate == '点击选择'
86 ? "" 205 ? ""
87 - : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}', 206 + : '${(DateUtil.getDateMsByTimeStr(from) / 1000).floor()}',
88 "etime": endDate == '点击选择' 207 "etime": endDate == '点击选择'
89 ? '' 208 ? ''
90 - : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}', 209 + : '${(DateUtil.getDateMsByTimeStr(end) / 1000).floor()}',
91 "explain": _couponExplainEditControl.text, 210 "explain": _couponExplainEditControl.text,
92 "is_open": swichState ? "1" : "0", 211 "is_open": swichState ? "1" : "0",
93 "status": swichState ? "1" : "0", 212 "status": swichState ? "1" : "0",
@@ -111,7 +230,9 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -111,7 +230,9 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
111 } 230 }
112 231
113 ///输入框 232 ///输入框
114 - Widget _textfield(String title, String hintText) { 233 + Widget _textfield(String title, String hintText,
  234 + TextEditingController controller, FocusNode focusNode,
  235 + {TextInputType textInputType = TextInputType.text}) {
115 return Container( 236 return Container(
116 child: Row( 237 child: Row(
117 mainAxisAlignment: MainAxisAlignment.spaceBetween, 238 mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -129,41 +250,38 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -129,41 +250,38 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
129 Container( 250 Container(
130 width: ScreenUtil().setWidth(231 * 2), 251 width: ScreenUtil().setWidth(231 * 2),
131 child: TextField( 252 child: TextField(
132 - controller: title == '券名称'  
133 - ? _couponNameEditControl  
134 - : _couponRequireEditControl,  
135 - textAlign: TextAlign.right,  
136 - textAlignVertical: TextAlignVertical.bottom,  
137 - maxLines: 1,  
138 - // //光标颜色  
139 - // cursorColor:  
140 - // widget.isSelect ? Colors.white : MyColours.color_199095,  
141 - //输入文本的样式  
142 - style: TextStyle(  
143 - color: MyColours.color_515151,  
144 - fontSize: ScreenUtil().setSp(32),  
145 - ),  
146 - focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,  
147 - decoration: InputDecoration(  
148 - border: OutlineInputBorder(borderSide: BorderSide.none),  
149 - hintText: hintText,  
150 - hintStyle: TextStyle(  
151 - color: MyColours.color_999999, 253 + controller: controller,
  254 + textAlign: TextAlign.right,
  255 + textAlignVertical: TextAlignVertical.bottom,
  256 + maxLines: 1,
  257 + // //光标颜色
  258 + // cursorColor:
  259 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  260 + //输入文本的样式
  261 + style: TextStyle(
  262 + color: MyColours.color_515151,
152 fontSize: ScreenUtil().setSp(32), 263 fontSize: ScreenUtil().setSp(32),
153 ), 264 ),
154 - enabledBorder: new UnderlineInputBorder(  
155 - borderSide: BorderSide.none, 265 + focusNode: focusNode,
  266 + decoration: InputDecoration(
  267 + border: OutlineInputBorder(borderSide: BorderSide.none),
  268 + hintText: hintText,
  269 + hintStyle: TextStyle(
  270 + color: MyColours.color_999999,
  271 + fontSize: ScreenUtil().setSp(32),
  272 + ),
  273 + enabledBorder: new UnderlineInputBorder(
  274 + borderSide: BorderSide.none,
  275 + ),
  276 + focusedBorder: new UnderlineInputBorder(
  277 + borderSide: BorderSide.none,
  278 + ),
156 ), 279 ),
157 - focusedBorder: new UnderlineInputBorder(  
158 - borderSide: BorderSide.none,  
159 - ),  
160 - ),  
161 - onChanged: (value) {},  
162 - onEditingComplete: () {  
163 - FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘  
164 - },  
165 - keyboardType: TextInputType.text,  
166 - ), 280 + onChanged: (value) {},
  281 + onEditingComplete: () {
  282 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  283 + },
  284 + keyboardType: textInputType),
167 ), 285 ),
168 HEmptyView(32) 286 HEmptyView(32)
169 ], 287 ],
@@ -171,6 +289,77 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -171,6 +289,77 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
171 ); 289 );
172 } 290 }
173 291
  292 + ///输入框
  293 + Widget _textfieldSelect(
  294 + String title,
  295 + String hintText,
  296 + TextEditingController controller,
  297 + FocusNode focusNode, {
  298 + TextInputType textInputType = TextInputType.text,
  299 + String subtitle = '',
  300 + }) {
  301 + return Container(
  302 + padding: EdgeInsets.only(left: w(20), right: (w(20))),
  303 + child: Row(
  304 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  305 + children: [
  306 + Container(
  307 + child: Text(
  308 + title,
  309 + style: TextStyle(
  310 + color: MyColours.color_515151,
  311 + fontSize: ScreenUtil().setSp(32)),
  312 + ),
  313 + ),
  314 + HEmptyView(40),
  315 + Expanded(
  316 + child: TextField(
  317 + controller: controller,
  318 + textAlign: TextAlign.right,
  319 + textAlignVertical: TextAlignVertical.bottom,
  320 + maxLines: 1,
  321 + // //光标颜色
  322 + // cursorColor:
  323 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  324 + //输入文本的样式
  325 + style: TextStyle(
  326 + color: MyColours.color_515151,
  327 + fontSize: ScreenUtil().setSp(32),
  328 + ),
  329 + focusNode: focusNode,
  330 + decoration: InputDecoration(
  331 + isCollapsed: true,
  332 + border: OutlineInputBorder(borderSide: BorderSide.none),
  333 + hintText: hintText,
  334 + hintStyle: TextStyle(
  335 + color: MyColours.color_999999,
  336 + fontSize: ScreenUtil().setSp(32),
  337 + ),
  338 + enabledBorder: new UnderlineInputBorder(
  339 + borderSide: BorderSide.none,
  340 + ),
  341 + focusedBorder: new UnderlineInputBorder(
  342 + borderSide: BorderSide.none,
  343 + ),
  344 + ),
  345 + onChanged: (value) {},
  346 + onEditingComplete: () {
  347 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  348 + },
  349 + keyboardType: textInputType),
  350 + ),
  351 + if (subtitle != '') HEmptyView(6),
  352 + Text(
  353 + subtitle,
  354 + style: TextStyle(
  355 + color: MyColours.color_515151,
  356 + fontSize: ScreenUtil().setSp(32)),
  357 + ),
  358 + ],
  359 + ),
  360 + );
  361 + }
  362 +
174 ///时间选择 363 ///时间选择
175 Widget _select(String title, String hintText, GestureTapCallback onTap) { 364 Widget _select(String title, String hintText, GestureTapCallback onTap) {
176 return InkWell( 365 return InkWell(
@@ -363,6 +552,69 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -363,6 +552,69 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
363 ); 552 );
364 } 553 }
365 554
  555 + _itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
  556 + return InkWell(
  557 + onTap: onTap,
  558 + child: Row(children: [
  559 + Image.asset(
  560 + Utils.getImgPath(
  561 + select ? 'plan_dish_select' : 'plan_dish_unselect'),
  562 + width: w(20),
  563 + ),
  564 + HEmptyView(6),
  565 + Text(
  566 + title,
  567 + style: TextStyle(
  568 + color: MyColours.color_515151,
  569 + fontSize: ScreenUtil().setSp(32)),
  570 + ),
  571 + ]));
  572 + }
  573 +
  574 + ///时间选择
  575 + Widget _select1(String title, String hintText, GestureTapCallback onTap) {
  576 + return InkWell(
  577 + onTap: onTap,
  578 + child: Container(
  579 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
  580 + child: Row(
  581 + crossAxisAlignment: CrossAxisAlignment.center,
  582 + mainAxisAlignment: MainAxisAlignment.center,
  583 + children: [
  584 + Container(
  585 + // height: ScreenUtil().setWidth(40),
  586 + // color: Colors.red,
  587 + child: Text(
  588 + title,
  589 + style: TextStyle(
  590 + height: 1.5,
  591 + color: title == '点击设置可用日期'
  592 + ? MyColours.color_999999
  593 + : MyColours.color_515151,
  594 + fontSize: ScreenUtil().setSp(32)),
  595 + ),
  596 + ),
  597 + HEmptyView(20),
  598 + Spacer(),
  599 + Text(hintText,
  600 + style: TextStyle(
  601 + color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
  602 + ? MyColours.color_999999
  603 + : MyColours.color_515151,
  604 + fontSize: ScreenUtil().setSp(32),
  605 + )),
  606 + HEmptyView(20),
  607 + Image.asset(
  608 + Utils.getImgPath('arrow_right_new'),
  609 + width: ScreenUtil().setWidth(18),
  610 + ),
  611 + HEmptyView(32),
  612 + ],
  613 + ),
  614 + ),
  615 + );
  616 + }
  617 +
366 @override 618 @override
367 Widget build(BuildContext context) { 619 Widget build(BuildContext context) {
368 couponProvider = Provider.of<CouponProvider>(context, listen: true); 620 couponProvider = Provider.of<CouponProvider>(context, listen: true);
@@ -412,13 +664,110 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -412,13 +664,110 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
412 color: MyColours.color_E7E7E7, 664 color: MyColours.color_E7E7E7,
413 ), 665 ),
414 widget.isMine ? SizedBox() : VEmptyView(24), 666 widget.isMine ? SizedBox() : VEmptyView(24),
415 - _textfield('券名称', '例:9折券/200元代金券/菜品券'), 667 + _textfield('券名称', '例:9折券/200元代金券/菜品券',
  668 + _couponNameEditControl, _nameFocusNode),
416 Container( 669 Container(
417 height: ScreenUtil().setWidth(2), 670 height: ScreenUtil().setWidth(2),
418 color: MyColours.color_E7E7E7, 671 color: MyColours.color_E7E7E7,
419 ), 672 ),
420 VEmptyView(24), 673 VEmptyView(24),
421 - _textfield('券要求', '例:无门槛/满2000元'), 674 + if (!widget.isMine)
  675 + Column(
  676 + children: [
  677 + //销售价
  678 +
  679 + _textfield('销售价', '默认0元,可以免费发放',
  680 + _priceControl, _priceFocusNode,
  681 + textInputType:
  682 + TextInputType.numberWithOptions()),
  683 +
  684 + Container(
  685 + height: ScreenUtil().setWidth(2),
  686 + color: MyColours.color_E7E7E7,
  687 + ),
  688 + // VEmptyView(24),
  689 + //券用途
  690 + VEmptyView(56),
  691 + Container(
  692 + alignment: Alignment.centerLeft,
  693 + child: Text(
  694 + '券用途',
  695 + style: TextStyle(
  696 + color: Color.fromRGBO(0, 0, 0, 0.9),
  697 + fontWeight: FontWeight.bold,
  698 + fontSize: ScreenUtil().setSp(32)),
  699 + ),
  700 + ),
  701 + VEmptyView(40),
  702 + Row(
  703 + children: [
  704 + HEmptyView(30),
  705 + _itemRadioWidget(money, '代金券',
  706 + onTap: () {
  707 + if (!money) {
  708 + setState(() {
  709 + money = true;
  710 +
  711 + dish = false;
  712 + discount = false;
  713 + });
  714 + }
  715 + }),
  716 + Spacer(),
  717 + _itemRadioWidget(discount, '折扣券',
  718 + onTap: () {
  719 + if (!discount) {
  720 + setState(() {
  721 + discount = true;
  722 +
  723 + dish = false;
  724 + money = false;
  725 + });
  726 + }
  727 + }),
  728 + Spacer(),
  729 + _itemRadioWidget(dish, '菜品券',
  730 + onTap: () {
  731 + if (!dish) {
  732 + setState(() {
  733 + dish = true;
  734 + discount = false;
  735 + money = false;
  736 + });
  737 + }
  738 + }),
  739 + HEmptyView(30),
  740 + ],
  741 + ),
  742 + VEmptyView(30),
  743 +
  744 + if (money)
  745 + _textfieldSelect('金额:', '点击输入代金券金额',
  746 + moneyControl, moneyFocusNode,
  747 + subtitle: '元',
  748 + textInputType: TextInputType
  749 + .numberWithOptions()),
  750 + if (discount)
  751 + _textfieldSelect('折扣率:', '点击输入折扣,如9折',
  752 + moneyControl, moneyFocusNode,
  753 + subtitle: '折',
  754 + textInputType: TextInputType
  755 + .numberWithOptions()),
  756 +
  757 + if (dish)
  758 + _textfieldSelect('菜品:', '点击输入赠送菜品名称',
  759 + moneyControl, moneyFocusNode,
  760 + textInputType: TextInputType
  761 + .numberWithOptions()),
  762 + VEmptyView(48),
  763 + Container(
  764 + height: ScreenUtil().setWidth(2),
  765 + color: MyColours.color_E7E7E7,
  766 + ),
  767 + ],
  768 + ),
  769 + _textfield('券要求', '例:无门槛/满2000元',
  770 + _couponRequireEditControl, _requireFocusNode),
422 Container( 771 Container(
423 height: ScreenUtil().setWidth(2), 772 height: ScreenUtil().setWidth(2),
424 color: MyColours.color_E7E7E7, 773 color: MyColours.color_E7E7E7,
@@ -440,12 +789,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -440,12 +789,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
440 print(value); 789 print(value);
441 fromDate = DateUtil.formatDateStr( 790 fromDate = DateUtil.formatDateStr(
442 value, 791 value,
443 - format: DateFormats.full); 792 + format: DateFormats.y_mo_d);
444 }); 793 });
445 } 794 }
446 showDateSelWidget = false; 795 showDateSelWidget = false;
447 }, 796 },
448 dateTime: DateUtil.getDateTime(fromDate), 797 dateTime: DateUtil.getDateTime(fromDate),
  798 + pickerDateTimeType: PickerDateTimeType.kYMD,
449 onCancel: () { 799 onCancel: () {
450 showDateSelWidget = false; 800 showDateSelWidget = false;
451 }); 801 });
@@ -471,12 +821,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -471,12 +821,13 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
471 print(value); 821 print(value);
472 endDate = DateUtil.formatDateStr( 822 endDate = DateUtil.formatDateStr(
473 value, 823 value,
474 - format: DateFormats.full); 824 + format: DateFormats.y_mo_d);
475 }); 825 });
476 } 826 }
477 showDateSelWidget = false; 827 showDateSelWidget = false;
478 }, 828 },
479 dateTime: DateUtil.getDateTime(endDate), 829 dateTime: DateUtil.getDateTime(endDate),
  830 + pickerDateTimeType: PickerDateTimeType.kYMD,
480 onCancel: () { 831 onCancel: () {
481 showDateSelWidget = false; 832 showDateSelWidget = false;
482 }); 833 });
@@ -486,6 +837,127 @@ class _CouponEidtPageState extends State<CouponEidtPage> { @@ -486,6 +837,127 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
486 color: MyColours.color_E7E7E7, 837 color: MyColours.color_E7E7E7,
487 ), 838 ),
488 VEmptyView(24), 839 VEmptyView(24),
  840 + if (!widget.isMine)
  841 + Column(
  842 + children: [
  843 + //使用限制
  844 + VEmptyView(24),
  845 + Container(
  846 + alignment: Alignment.centerLeft,
  847 + child: Text(
  848 + '使用限制',
  849 + style: TextStyle(
  850 + color: Color.fromRGBO(0, 0, 0, 0.9),
  851 + fontWeight: FontWeight.bold,
  852 + fontSize: ScreenUtil().setSp(32)),
  853 + ),
  854 + ),
  855 + VEmptyView(40),
  856 + Row(
  857 + children: [
  858 + HEmptyView(30),
  859 + _itemRadioWidget(limitNone, '无',
  860 + onTap: () {
  861 + if (!limitNone) {
  862 + setState(() {
  863 + limitNone = true;
  864 +
  865 + limitWeek = false;
  866 + limitBirthday = false;
  867 + });
  868 + }
  869 + }),
  870 + Spacer(),
  871 + _itemRadioWidget(limitWeek, '每周',
  872 + onTap: () {
  873 + if (!limitWeek) {
  874 + setState(() {
  875 + limitWeek = true;
  876 +
  877 + limitNone = false;
  878 + limitBirthday = false;
  879 + });
  880 + }
  881 + }),
  882 + Spacer(),
  883 + _itemRadioWidget(
  884 + limitBirthday, '会员生日当天', onTap: () {
  885 + if (!limitBirthday) {
  886 + setState(() {
  887 + limitBirthday = true;
  888 + limitNone = false;
  889 + limitWeek = false;
  890 + });
  891 + }
  892 + }),
  893 + HEmptyView(30),
  894 + ],
  895 + ),
  896 + if (limitWeek) VEmptyView(30),
  897 +
  898 + if (limitWeek)
  899 + _select1(weekShow, '', () async {
  900 + FocusScope.of(context).requestFocus(
  901 + FocusNode()); //点击空白处隐藏键盘
  902 + //弹出时间选择器
  903 + // showPickerDateTime(context);
  904 + showDateSelWidget = false;
  905 +
  906 + List<FilterBtnModel> data = await DialogUtil
  907 + .openCoponsWeekSelectModalBottomSheet(
  908 + context, weekData);
  909 + if (data != null) {
  910 + //改变了
  911 + weekData = [];
  912 + weekData.addAll(data);
  913 + weekShow = '';
  914 +
  915 + String noonStr = '午餐:';
  916 + String nightStr = '晚餐:';
  917 +
  918 + weekData.forEach((element) {
  919 + if (element.selectNoon) {
  920 + noonStr += '${element.title} ';
  921 + }
  922 + if (element.selectNig) {
  923 + nightStr += '${element.title} ';
  924 + }
  925 + });
  926 + if (noonStr.endsWith(' ')) {
  927 + noonStr = noonStr.substring(
  928 + 0, noonStr.length - 1);
  929 + }
  930 + if (nightStr.endsWith(' ')) {
  931 + nightStr = nightStr.substring(
  932 + 0, nightStr.length - 1);
  933 + }
  934 +
  935 + if (noonStr == '午餐:' &&
  936 + nightStr == '晚餐:') {
  937 + weekShow = '点击设置可用日期';
  938 + } else {
  939 + if (noonStr != '午餐:' &&
  940 + nightStr != '晚餐:') {
  941 + weekShow =
  942 + noonStr + '\n' + nightStr;
  943 + } else if (noonStr != '午餐:') {
  944 + weekShow = noonStr;
  945 + } else {
  946 + weekShow = nightStr;
  947 + }
  948 + }
  949 +
  950 + setState(() {});
  951 + }
  952 + }),
  953 + limitWeek ? VEmptyView(22) : VEmptyView(48),
  954 + Container(
  955 + height: ScreenUtil().setWidth(2),
  956 + color: MyColours.color_E7E7E7,
  957 + ),
  958 + VEmptyView(48),
  959 + ],
  960 + ),
489 widget.isMine 961 widget.isMine
490 ? SizedBox() 962 ? SizedBox()
491 : _select('谁可以发放', '编辑', () async { 963 : _select('谁可以发放', '编辑', () async {
@@ -19,7 +19,6 @@ import 'package:barcode_scan2/barcode_scan2.dart'; @@ -19,7 +19,6 @@ import 'package:barcode_scan2/barcode_scan2.dart';
19 import '../../utils/dialog_util.dart'; 19 import '../../utils/dialog_util.dart';
20 import '../../utils/misc.dart'; 20 import '../../utils/misc.dart';
21 21
22 -  
23 /** 22 /**
24 * 优惠券列表 23 * 优惠券列表
25 */ 24 */
@@ -128,6 +127,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -128,6 +127,7 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
128 // result.rawContent 127 // result.rawContent
129 setState(() => scanResult = result); 128 setState(() => scanResult = result);
130 print(result); 129 print(result);
  130 + NavigatorUtil.goVerificationCouponPage(context);
131 } on PlatformException catch (e) { 131 } on PlatformException catch (e) {
132 setState(() { 132 setState(() {
133 scanResult = ScanResult( 133 scanResult = ScanResult(
  1 +import 'package:flutter/material.dart';
  2 +
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/net/dio_util.dart';
  5 +
  6 +import 'package:one_key/provider/coupon_provider.dart';
  7 +
  8 +import 'package:one_key/res/colors.dart';
  9 +import 'package:one_key/utils/dialog_util.dart';
  10 +
  11 +import 'package:one_key/utils/utils.dart';
  12 +import 'package:one_key/widgets/h_empty_view.dart';
  13 +import 'package:one_key/widgets/round_button.dart';
  14 +import 'package:one_key/widgets/system_app_bar.dart';
  15 +import 'package:one_key/widgets/v_empty_view.dart';
  16 +import 'package:provider/provider.dart';
  17 +
  18 +import '../../utils/screen_util.dart';
  19 +
  20 +/**
  21 + * 核销券详情页
  22 + */
  23 +
  24 +class VerificationCouponPage extends StatefulWidget {
  25 + VerificationCouponPage({
  26 + Key key,
  27 + }) : super(key: key);
  28 +
  29 + @override
  30 + _VerificationCouponPageState createState() => _VerificationCouponPageState();
  31 +}
  32 +
  33 +class _VerificationCouponPageState extends State<VerificationCouponPage> {
  34 + ScrollController controller = ScrollController();
  35 + final heightCell = ScreenUtil().setWidth(80);
  36 + CouponProvider couponProvider;
  37 +
  38 + @override
  39 + void initState() {
  40 + super.initState();
  41 + }
  42 +
  43 + ///时间选择
  44 + Widget _select(String title, String hintText, GestureTapCallback onTap) {
  45 + return InkWell(
  46 + onTap: onTap,
  47 + child: Container(
  48 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
  49 + child: Row(
  50 + crossAxisAlignment: CrossAxisAlignment.center,
  51 + mainAxisAlignment: MainAxisAlignment.center,
  52 + children: [
  53 + Container(
  54 + // height: ScreenUtil().setWidth(40),
  55 + // color: Colors.red,
  56 + child: Text(
  57 + title,
  58 + style: TextStyle(
  59 + color: Color.fromRGBO(0, 0, 0, 0.9),
  60 + fontWeight: FontWeight.bold,
  61 + fontSize: ScreenUtil().setSp(32)),
  62 + ),
  63 + ),
  64 + HEmptyView(20),
  65 + Spacer(),
  66 + Text(hintText,
  67 + style: TextStyle(
  68 + color: hintText == '点击选择'
  69 + ? MyColours.color_999999
  70 + : MyColours.color_515151,
  71 + fontSize: ScreenUtil().setSp(32),
  72 + )),
  73 + HEmptyView(20),
  74 + Image.asset(
  75 + Utils.getImgPath('arrow_right_new'),
  76 + width: ScreenUtil().setWidth(20),
  77 + ),
  78 + HEmptyView(32),
  79 + ],
  80 + ),
  81 + ),
  82 + );
  83 + }
  84 +
  85 + ///输入框
  86 + Widget _item(String title, String subTitle,
  87 + {Color textColor = MyColours.color_40000000, int fontSize = 16}) {
  88 + return Container(
  89 + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
  90 + child: Row(
  91 + crossAxisAlignment: CrossAxisAlignment.center,
  92 + mainAxisAlignment: MainAxisAlignment.center,
  93 + children: [
  94 + Container(
  95 + child: Text(
  96 + title,
  97 + style: TextStyle(color: MyColours.color_515151, fontSize: w(16)),
  98 + ),
  99 + ),
  100 + HEmptyView(60),
  101 + Expanded(
  102 + child: Text(
  103 + subTitle,
  104 + maxLines: 20,
  105 + textAlign: TextAlign.right,
  106 + overflow: TextOverflow.ellipsis,
  107 + style: TextStyle(
  108 + color: textColor,
  109 + fontSize: w(fontSize),
  110 + ),
  111 + ))
  112 + ],
  113 + ),
  114 + );
  115 + }
  116 +
  117 + @override
  118 + Widget build(BuildContext context) {
  119 + couponProvider = Provider.of<CouponProvider>(context, listen: true);
  120 + return Scaffold(
  121 + backgroundColor: MyColours.color_ffffff,
  122 + appBar: SystemAppBar(
  123 + '优惠券详情',
  124 + onTap: () {
  125 + Navigator.pop(context);
  126 + },
  127 + ),
  128 + body: Column(children: [
  129 + Expanded(
  130 + child: SingleChildScrollView(
  131 + controller: controller,
  132 + physics: BouncingScrollPhysics(),
  133 + child: Padding(
  134 + padding: EdgeInsets.symmetric(
  135 + horizontal: ScreenUtil().setWidth(32)),
  136 + child: Column(
  137 + children: [
  138 + VEmptyView(56),
  139 + _item('券用途', '代金券/折扣券/菜品券',
  140 + textColor: MyColours.color_438E93, fontSize: 20),
  141 + Container(
  142 + height: ScreenUtil().setWidth(2),
  143 + color: MyColours.color_E7E7E7,
  144 + ),
  145 + VEmptyView(24),
  146 + _item('券金额/折扣率/所含菜品', '200元/9折/精品烤鸭',
  147 + textColor: MyColours.color_438E93, fontSize: 20),
  148 + Container(
  149 + height: ScreenUtil().setWidth(2),
  150 + color: MyColours.color_E7E7E7,
  151 + ),
  152 + VEmptyView(24),
  153 + _item('券要求', '满200可用'),
  154 + Container(
  155 + height: ScreenUtil().setWidth(2),
  156 + color: MyColours.color_E7E7E7,
  157 + ),
  158 + VEmptyView(24),
  159 + _item('有效期从', '2022-4-4'), //Utils.getDateStrFromJiekou(
  160 + // widget.couponSunModel.stime)
  161 + Container(
  162 + height: ScreenUtil().setWidth(2),
  163 + color: MyColours.color_E7E7E7,
  164 + ),
  165 + VEmptyView(24),
  166 + _item('有效期至', '2022-4-4'),
  167 + // widget.couponSunModel.isType == '1'
  168 + // ? Column(
  169 + // crossAxisAlignment: CrossAxisAlignment.start,
  170 + // children: [
  171 + // Container(
  172 + // height: ScreenUtil().setWidth(2),
  173 + // color: MyColours.color_E7E7E7,
  174 + // ),
  175 + // VEmptyView(24),
  176 + // _item('创建人', widget.couponSunModel.uid),
  177 + // ],
  178 + // )
  179 + // : SizedBox(),
  180 + // widget.couponSunModel.isType == '1'
  181 + // ? Column(
  182 + // crossAxisAlignment: CrossAxisAlignment.start,
  183 + // children: [
  184 + // Container(
  185 + // height: ScreenUtil().setWidth(2),
  186 + // color: MyColours.color_E7E7E7,
  187 + // ),
  188 + // VEmptyView(24),
  189 + // _select(
  190 + // '谁可以发放',
  191 + // '查看',
  192 + // () async {
  193 + // await NavigatorUtil.goCouponToPersonnalPage(
  194 + // context, widget.couponSunModel.uidList,
  195 + // onlyShow: true);
  196 + // },
  197 + // )
  198 + // ],
  199 + // )
  200 + // : SizedBox(),
  201 + // widget.couponSunModel.explain != null &&
  202 + // widget.couponSunModel.explain != ''
  203 + // ? Container(
  204 + // height: ScreenUtil().setWidth(2),
  205 + // color: MyColours.color_E7E7E7,
  206 + // )
  207 + // : SizedBox(),
  208 + // widget.couponSunModel.explain != null &&
  209 + // widget.couponSunModel.explain != ''
  210 + // ? VEmptyView(24)
  211 + // : SizedBox(),
  212 + _item('券说明',
  213 + '最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多最多'),
  214 +
  215 + Container(
  216 + height: ScreenUtil().setWidth(2),
  217 + color: MyColours.color_E7E7E7,
  218 + ),
  219 + // VEmptyView(24),
  220 + // _item('券状态',
  221 + // widget.couponSunModel.status == '1' ? '发放中' : '停用')
  222 + ],
  223 + ))),
  224 + ),
  225 + true
  226 + ? Padding(
  227 + padding: EdgeInsets.only(bottom: w(58)),
  228 + child: Image.asset(
  229 + Utils.getImgPath('has_use'),
  230 + width: w(50),
  231 + ),
  232 + )
  233 + : Container(
  234 + height: ScreenUtil().setWidth(91 * 2),
  235 + width: double.infinity,
  236 + padding: EdgeInsets.only(
  237 + top: ScreenUtil().setWidth(16 * 2),
  238 + bottom: ScreenUtil().setWidth(35 * 2),
  239 + left: ScreenUtil().setWidth(45 * 2),
  240 + right: ScreenUtil().setWidth(45 * 2),
  241 + ),
  242 + decoration: BoxDecoration(
  243 + color: MyColours.color_ffffff,
  244 + boxShadow: [
  245 + BoxShadow(
  246 + spreadRadius: ScreenUtil().setWidth(2),
  247 + color: Color.fromRGBO(0, 0, 0, 0.1),
  248 + offset: Offset(0, ScreenUtil().setWidth(-2)),
  249 + blurRadius: ScreenUtil().setWidth(8))
  250 + ],
  251 + borderRadius: BorderRadius.all(
  252 + Radius.circular(ScreenUtil().setWidth(16)),
  253 + ),
  254 + ),
  255 + child: RoundButton(
  256 + text: '核销使用',
  257 + height: ScreenUtil().setWidth(80),
  258 + radius: ScreenUtil().setWidth(14),
  259 + isBold: false,
  260 + fontSize: 28,
  261 + onPressed: () async {
  262 + DialogUtil.cupertinoAlertDialog(context,
  263 + content: '确定要核销当前优惠券吗?核销使用后,该券不能再次使用。');
  264 + // "stime": fromDate == '点击选择'
  265 + // ? ""
  266 + // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
  267 + // "etime": endDate == '点击选择'
  268 + // ? ''
  269 + // : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
  270 + // UserModel userModel =
  271 + // Provider.of<UserModel>(context, listen: false);
  272 + // if (userModel.user.role_name == '管理员' ||
  273 + // userModel.user.role_name == '店长') {
  274 + // NavigatorUtil.goRechargeEditPage(context);
  275 + // } else {
  276 + // bool needRefresh =
  277 + // await NavigatorUtil.goCouponEditPage(context);
  278 + // print(needRefresh);
  279 + // if (needRefresh != null && needRefresh) {
  280 + // bus.emit('refresh_coupon_list_f');
  281 + // //刷新页面数据
  282 + // // _controller.callRefresh();
  283 + // // _couponNetworkData(tabController.index);
  284 + // }
  285 + // }
  286 + },
  287 + ),
  288 + )
  289 + ]),
  290 + );
  291 + }
  292 +}
@@ -1580,4 +1580,15 @@ class NavigatorUtil { @@ -1580,4 +1580,15 @@ class NavigatorUtil {
1580 return _navigateTo(context, "${Routes.recharge_detail_page}", 1580 return _navigateTo(context, "${Routes.recharge_detail_page}",
1581 replace: replace); 1581 replace: replace);
1582 } 1582 }
  1583 +
  1584 + ///核销使用
  1585 + static Future<dynamic> goVerificationCouponPage(
  1586 + BuildContext context, {
  1587 + replace = false,
  1588 + }) {
  1589 + return _navigateTo(context, "${Routes.verification_coupon_page}",
  1590 + replace: replace);
  1591 + }
  1592 +
  1593 +
1583 } 1594 }
@@ -158,6 +158,7 @@ import '../models/plan_cook_list_model.dart'; @@ -158,6 +158,7 @@ import '../models/plan_cook_list_model.dart';
158 import '../models/set_xuan_tai_model.dart'; 158 import '../models/set_xuan_tai_model.dart';
159 import '../models/setmeal_by_id_model.dart'; 159 import '../models/setmeal_by_id_model.dart';
160 import '../models/wine_manage_model.dart'; 160 import '../models/wine_manage_model.dart';
  161 +import '../pages/coupon/verification_coupon_page.dart';
161 import '../pages/feast/feast_board.dart'; 162 import '../pages/feast/feast_board.dart';
162 import '../pages/feast/feast_create_page.dart'; 163 import '../pages/feast/feast_create_page.dart';
163 import '../pages/feast/feast_deposit_data_page.dart'; 164 import '../pages/feast/feast_deposit_data_page.dart';
@@ -2543,3 +2544,19 @@ var rechargeDetailPageHandle = new Handler( @@ -2543,3 +2544,19 @@ var rechargeDetailPageHandle = new Handler(
2543 return ChangeNotifierProvider<MarketingCenterProvider>( 2544 return ChangeNotifierProvider<MarketingCenterProvider>(
2544 create: (_) => MarketingCenterProvider(), child: RechargeDetailPage()); 2545 create: (_) => MarketingCenterProvider(), child: RechargeDetailPage());
2545 }); 2546 });
  2547 +
  2548 +///核销使用
  2549 +var verificationCouponPageHandle = new Handler(
  2550 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2551 + // OutWineRecordSunModel outWineRecordSunModel = OutWineRecordSunModel.fromJson(
  2552 + // json.decode(
  2553 + // FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  2554 +
  2555 + // String selectIDs = params["selectIDs"].first;
  2556 + // List<String> selectList = [];
  2557 + // if (selectIDs.length > 0) {
  2558 + // selectList = selectIDs.split(',');
  2559 + // }
  2560 + return ChangeNotifierProvider<CouponProvider>(
  2561 + create: (_) => CouponProvider(), child: VerificationCouponPage());
  2562 +});
@@ -232,6 +232,11 @@ class Routes { @@ -232,6 +232,11 @@ class Routes {
232 static String recharge_detail_page = 232 static String recharge_detail_page =
233 "/recharge_detail_page"; //充值优惠详情页 233 "/recharge_detail_page"; //充值优惠详情页
234 234
  235 + static String verification_coupon_page =
  236 + "/verification_coupon_page"; //核销使用
  237 +
  238 +
  239 +
235 240
236 241
237 static void configureRoutes(FluroRouter router) { 242 static void configureRoutes(FluroRouter router) {
@@ -449,6 +454,9 @@ static String recharge_detail_page = @@ -449,6 +454,9 @@ static String recharge_detail_page =
449 handler: rechargeSelectStoreCouponPageHandle); 454 handler: rechargeSelectStoreCouponPageHandle);
450 router.define(recharge_detail_page, 455 router.define(recharge_detail_page,
451 handler: rechargeDetailPageHandle); 456 handler: rechargeDetailPageHandle);
  457 +router.define(verification_coupon_page,
  458 + handler: verificationCouponPageHandle);
  459 +
452 460
453 461
454 } 462 }
@@ -280,6 +280,181 @@ class DialogUtil { @@ -280,6 +280,181 @@ class DialogUtil {
280 }); 280 });
281 } 281 }
282 282
  283 + ///优惠券每周早餐午餐晚餐选择
  284 + static openCoponsWeekSelectModalBottomSheet(
  285 + context, List<FilterBtnModel> weekData,
  286 + {VoidCallback lCallback, VoidCallback rCallback}) async {
  287 + List<FilterBtnModel> data = weekData.map((e) {
  288 + return FilterBtnModel.fromJson(e.toJson());
  289 + }).toList();
  290 +
  291 + final option = await showModalBottomSheet(
  292 + context: context,
  293 + backgroundColor: Colors.transparent,
  294 + isDismissible: false,
  295 + isScrollControlled: true,
  296 + builder: (BuildContext context) {
  297 + return StatefulBuilder(builder: (context, state) {
  298 + return Container(
  299 + decoration: BoxDecoration(
  300 + color: MyColours.color_ffffff,
  301 + borderRadius: BorderRadius.only(
  302 + topLeft: Radius.circular(ScreenUtil().setWidth(10)),
  303 + topRight: Radius.circular(ScreenUtil().setWidth(10)))),
  304 + child: Column(
  305 + mainAxisSize: MainAxisSize.min,
  306 + children: <Widget>[
  307 + Padding(
  308 + padding: EdgeInsets.only(
  309 + left: w(25), right: w(25), top: w(26), bottom: w(12)),
  310 + child: Row(
  311 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  312 + children: [
  313 + InkWell(
  314 + onTap: () {
  315 + Navigator.pop(context);
  316 + },
  317 + child: Container(
  318 + child: Text(
  319 + '取消',
  320 + style: TextStyle(
  321 + fontSize: ScreenUtil().setSp(32),
  322 + color: MyColours.color_515151,
  323 + ),
  324 + ),
  325 + ),
  326 + ),
  327 + InkWell(
  328 + onTap: () {
  329 + Navigator.pop(context, data);
  330 + },
  331 + child: Container(
  332 + child: Text(
  333 + '确定',
  334 + style: TextStyle(
  335 + fontSize: ScreenUtil().setSp(32),
  336 + color: MyColours.color_438E93,
  337 + ),
  338 + ),
  339 + ),
  340 + ),
  341 + ],
  342 + )),
  343 + MyDivider(
  344 + double.infinity,
  345 + ScreenUtil().setWidth(2),
  346 + color: MyColours.color_DBDBDB,
  347 + ),
  348 + VEmptyView(116),
  349 + ListView.builder(
  350 + shrinkWrap: true,
  351 + itemCount: data.length + 1,
  352 + itemBuilder: (context, index) {
  353 + if (index == 0) {
  354 + return Container(
  355 + margin: EdgeInsets.only(bottom: w(7)),
  356 + padding: EdgeInsets.only(
  357 + left: w(33),
  358 + right: w(33),
  359 + top: w(16),
  360 + bottom: w(7)),
  361 + decoration: index - 1 == data.length - 1
  362 + ? null
  363 + : BoxDecoration(
  364 + border: Border(
  365 + bottom: BorderSide(
  366 + width: w(1),
  367 + color: MyColours.color_DBDBDB))),
  368 + child: Row(
  369 + mainAxisAlignment:
  370 + MainAxisAlignment.spaceBetween,
  371 + children: [
  372 + Spacer(),
  373 + Container(
  374 + width: w(34),
  375 + alignment: Alignment.center,
  376 + child: Text('午餐',
  377 + style: TextStyle(
  378 + color: MyColours.color_515151,
  379 + fontSize: font(16)))),
  380 + HEmptyView(90),
  381 + Container(
  382 + width: w(34),
  383 + alignment: Alignment.center,
  384 + child: Text('晚餐',
  385 + style: TextStyle(
  386 + color: MyColours.color_515151,
  387 + fontSize: font(16)))),
  388 + ],
  389 + ));
  390 + }
  391 + return Container(
  392 + margin: EdgeInsets.only(bottom: w(7)),
  393 + padding: EdgeInsets.only(
  394 + left: w(33),
  395 + right: w(33),
  396 + top: w(16),
  397 + bottom: w(7)),
  398 + decoration: index - 1 == data.length - 1
  399 + ? null
  400 + : BoxDecoration(
  401 + border: Border(
  402 + bottom: BorderSide(
  403 + width: w(1),
  404 + color: MyColours.color_DBDBDB))),
  405 + child: Row(
  406 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  407 + children: [
  408 + Text(data[index - 1].title,
  409 + style: TextStyle(
  410 + color: MyColours.color_515151,
  411 + fontSize: font(16))),
  412 + Spacer(),
  413 + InkWell(
  414 + onTap: () {
  415 + state(() {
  416 + data[index - 1].selectNoon =
  417 + !data[index - 1].selectNoon;
  418 + });
  419 + },
  420 + child: Container(
  421 + width: w(34),
  422 + alignment: Alignment.center,
  423 + child: Image.asset(
  424 + Utils.getImgPath(
  425 + data[index - 1].selectNoon
  426 + ? 'c_mul_select'
  427 + : 'c_mul_select_un'),
  428 + width: w(20)))),
  429 + HEmptyView(90),
  430 + InkWell(
  431 + onTap: () {
  432 + state(() {
  433 + data[index - 1].selectNig =
  434 + !data[index - 1].selectNig;
  435 + });
  436 + },
  437 + child: Container(
  438 + width: w(34),
  439 + alignment: Alignment.center,
  440 + child: Image.asset(
  441 + Utils.getImgPath(
  442 + data[index - 1].selectNig
  443 + ? 'c_mul_select'
  444 + : 'c_mul_select_un'),
  445 + width: w(20)))),
  446 + ],
  447 + ));
  448 + }),
  449 + ],
  450 + ),
  451 + );
  452 + });
  453 + });
  454 + print(option);
  455 + return option;
  456 + }
  457 +
283 ///优惠每周选择 458 ///优惠每周选择
284 static openWeekSelectModalBottomSheet(context, List<FilterBtnModel> weekData, 459 static openWeekSelectModalBottomSheet(context, List<FilterBtnModel> weekData,
285 {VoidCallback lCallback, VoidCallback rCallback}) async { 460 {VoidCallback lCallback, VoidCallback rCallback}) async {
@@ -5748,6 +5923,7 @@ class DialogUtil { @@ -5748,6 +5923,7 @@ class DialogUtil {
5748 } 5923 }
5749 } 5924 }
5750 5925
  5926 +
5751 static Future cupertinoAlertDialogFeast(BuildContext context, 5927 static Future cupertinoAlertDialogFeast(BuildContext context,
5752 {String title = "", 5928 {String title = "",
5753 String content = "内容", 5929 String content = "内容",