Commit b4a0c01a4680733cf52f0e5128c5c43ea696740f
1 parent
584151c0
可预订时段更改(0、15、30、45)后,导致到店时间半小时间隔函数死循环 修复
Showing
14 changed files
with
336 additions
and
77 deletions
| @@ -213,6 +213,22 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -213,6 +213,22 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 213 | int beginHour = int.parse(tempHour[0]); | 213 | int beginHour = int.parse(tempHour[0]); |
| 214 | /*获取开始分钟*/ | 214 | /*获取开始分钟*/ |
| 215 | int beginMinute = int.parse(tempHour[1]); | 215 | int beginMinute = int.parse(tempHour[1]); |
| 216 | + if (beginMinute == 15) { | ||
| 217 | + beginMinute = 30; | ||
| 218 | + } else if (beginMinute == 45) { | ||
| 219 | + beginHour++; | ||
| 220 | + beginMinute = 0; | ||
| 221 | + } | ||
| 222 | + List endTemp = endDate.split(':'); | ||
| 223 | + /*获取结束小时*/ | ||
| 224 | + int endHour = int.parse(endTemp[0]); | ||
| 225 | + /*获取结束分钟*/ | ||
| 226 | + int endMinute = int.parse(endTemp[1]); | ||
| 227 | + if (endMinute == 15) { | ||
| 228 | + endDate = '${endHour}:00'; | ||
| 229 | + } else if (endMinute == 45) { | ||
| 230 | + endDate = '${endHour}:30'; | ||
| 231 | + } | ||
| 216 | List res = []; | 232 | List res = []; |
| 217 | bool tempLimit = true; | 233 | bool tempLimit = true; |
| 218 | while (tempLimit) { | 234 | while (tempLimit) { |
| @@ -2613,48 +2629,46 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2613,48 +2629,46 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2613 | // .length == | 2629 | // .length == |
| 2614 | // 0 | 2630 | // 0 |
| 2615 | // ? | 2631 | // ? |
| 2616 | - Expanded( | ||
| 2617 | - flex: 1, | ||
| 2618 | - child: InkWell( | ||
| 2619 | - onTap: () { | ||
| 2620 | - NavigatorUtil | ||
| 2621 | - .goOrderAdvanceHomePage( | ||
| 2622 | - context, | ||
| 2623 | - detailEntity, | ||
| 2624 | - widget.rid); | ||
| 2625 | - }, | ||
| 2626 | - child: Container( | ||
| 2627 | - margin: EdgeInsets.only( | ||
| 2628 | - right: ScreenUtil() | ||
| 2629 | - .setWidth(20)), | ||
| 2630 | - decoration: BoxDecoration( | 2632 | + Expanded( |
| 2633 | + flex: 1, | ||
| 2634 | + child: InkWell( | ||
| 2635 | + onTap: () { | ||
| 2636 | + NavigatorUtil | ||
| 2637 | + .goOrderAdvanceHomePage( | ||
| 2638 | + context, | ||
| 2639 | + detailEntity, | ||
| 2640 | + widget.rid); | ||
| 2641 | + }, | ||
| 2642 | + child: Container( | ||
| 2643 | + margin: EdgeInsets.only( | ||
| 2644 | + right: ScreenUtil() | ||
| 2645 | + .setWidth(20)), | ||
| 2646 | + decoration: BoxDecoration( | ||
| 2647 | + color: | ||
| 2648 | + MyColours.color_ffffff, | ||
| 2649 | + border: Border.all( | ||
| 2650 | + width: w(1), | ||
| 2631 | color: MyColours | 2651 | color: MyColours |
| 2632 | - .color_ffffff, | ||
| 2633 | - border: Border.all( | ||
| 2634 | - width: w(1), | 2652 | + .color_438E93), |
| 2653 | + borderRadius: | ||
| 2654 | + BorderRadius.circular( | ||
| 2655 | + ScreenUtil() | ||
| 2656 | + .setWidth(10)), | ||
| 2657 | + ), | ||
| 2658 | + child: Align( | ||
| 2659 | + alignment: Alignment.center, | ||
| 2660 | + child: Text('预点菜', | ||
| 2661 | + style: TextStyle( | ||
| 2635 | color: MyColours | 2662 | color: MyColours |
| 2636 | - .color_438E93), | ||
| 2637 | - borderRadius: | ||
| 2638 | - BorderRadius.circular( | 2663 | + .color_438E93, |
| 2664 | + fontSize: | ||
| 2639 | ScreenUtil() | 2665 | ScreenUtil() |
| 2640 | - .setWidth( | ||
| 2641 | - 10)), | ||
| 2642 | - ), | ||
| 2643 | - child: Align( | ||
| 2644 | - alignment: | ||
| 2645 | - Alignment.center, | ||
| 2646 | - child: Text('预点菜', | ||
| 2647 | - style: TextStyle( | ||
| 2648 | - color: MyColours | ||
| 2649 | - .color_438E93, | ||
| 2650 | - fontSize: | ||
| 2651 | - ScreenUtil() | ||
| 2652 | - .setSp( | ||
| 2653 | - 34))), | ||
| 2654 | - ), | ||
| 2655 | - ), | ||
| 2656 | - )), | ||
| 2657 | - // : SizedBox(), | 2666 | + .setSp( |
| 2667 | + 34))), | ||
| 2668 | + ), | ||
| 2669 | + ), | ||
| 2670 | + )), | ||
| 2671 | + // : SizedBox(), | ||
| 2658 | Expanded( | 2672 | Expanded( |
| 2659 | flex: 2, | 2673 | flex: 2, |
| 2660 | child: InkWell( | 2674 | child: InkWell( |
| @@ -122,6 +122,23 @@ class SelectTableFPageState extends State<SelectTableFPage> { | @@ -122,6 +122,23 @@ class SelectTableFPageState extends State<SelectTableFPage> { | ||
| 122 | int beginHour = int.parse(tempHour[0]); | 122 | int beginHour = int.parse(tempHour[0]); |
| 123 | /*获取开始分钟*/ | 123 | /*获取开始分钟*/ |
| 124 | int beginMinute = int.parse(tempHour[1]); | 124 | int beginMinute = int.parse(tempHour[1]); |
| 125 | + if (beginMinute == 15) { | ||
| 126 | + beginMinute = 30; | ||
| 127 | + } else if (beginMinute == 45) { | ||
| 128 | + beginHour++; | ||
| 129 | + beginMinute = 0; | ||
| 130 | + } | ||
| 131 | + List endTemp = endDate.split(':'); | ||
| 132 | + /*获取结束小时*/ | ||
| 133 | + int endHour = int.parse(endTemp[0]); | ||
| 134 | + /*获取结束分钟*/ | ||
| 135 | + int endMinute = int.parse(endTemp[1]); | ||
| 136 | + if (endMinute == 15) { | ||
| 137 | + | ||
| 138 | + endDate = '${endHour}:00'; | ||
| 139 | + } else if (endMinute == 45) { | ||
| 140 | + endDate = '${endHour}:30'; | ||
| 141 | + } | ||
| 125 | List res = []; | 142 | List res = []; |
| 126 | bool tempLimit = true; | 143 | bool tempLimit = true; |
| 127 | while (tempLimit) { | 144 | while (tempLimit) { |
| @@ -565,6 +565,23 @@ class InvicationPageState extends State<InvicationPage> | @@ -565,6 +565,23 @@ class InvicationPageState extends State<InvicationPage> | ||
| 565 | int beginHour = int.parse(tempHour[0]); | 565 | int beginHour = int.parse(tempHour[0]); |
| 566 | /*获取开始分钟*/ | 566 | /*获取开始分钟*/ |
| 567 | int beginMinute = int.parse(tempHour[1]); | 567 | int beginMinute = int.parse(tempHour[1]); |
| 568 | + if (beginMinute == 15) { | ||
| 569 | + beginMinute = 30; | ||
| 570 | + } else if (beginMinute == 45) { | ||
| 571 | + beginHour++; | ||
| 572 | + beginMinute = 0; | ||
| 573 | + } | ||
| 574 | + List endTemp = endDate.split(':'); | ||
| 575 | + /*获取结束小时*/ | ||
| 576 | + int endHour = int.parse(endTemp[0]); | ||
| 577 | + /*获取结束分钟*/ | ||
| 578 | + int endMinute = int.parse(endTemp[1]); | ||
| 579 | + if (endMinute == 15) { | ||
| 580 | + | ||
| 581 | + endDate = '${endHour}:00'; | ||
| 582 | + } else if (endMinute == 45) { | ||
| 583 | + endDate = '${endHour}:30'; | ||
| 584 | + } | ||
| 568 | List<String> res = []; | 585 | List<String> res = []; |
| 569 | bool tempLimit = true; | 586 | bool tempLimit = true; |
| 570 | while (tempLimit) { | 587 | while (tempLimit) { |
| @@ -613,6 +630,23 @@ class InvicationPageState extends State<InvicationPage> | @@ -613,6 +630,23 @@ class InvicationPageState extends State<InvicationPage> | ||
| 613 | // int beginHour = int.parse(tempHour[0]); | 630 | // int beginHour = int.parse(tempHour[0]); |
| 614 | // /*获取开始分钟*/ | 631 | // /*获取开始分钟*/ |
| 615 | // int beginMinute = int.parse(tempHour[1]); | 632 | // int beginMinute = int.parse(tempHour[1]); |
| 633 | + // if (beginMinute == 15) { | ||
| 634 | + // beginMinute = 30; | ||
| 635 | + // } else if (beginMinute == 45) { | ||
| 636 | + // beginHour++; | ||
| 637 | + // beginMinute = 0; | ||
| 638 | + // } | ||
| 639 | + // List endTemp = endDate.split(':'); | ||
| 640 | + // /*获取结束小时*/ | ||
| 641 | + // int endHour = int.parse(endTemp[0]); | ||
| 642 | + // /*获取结束分钟*/ | ||
| 643 | + // int endMinute = int.parse(endTemp[1]); | ||
| 644 | + // if (endMinute == 15) { | ||
| 645 | + | ||
| 646 | + // endDate = '${endHour}:00'; | ||
| 647 | + // } else if (endMinute == 45) { | ||
| 648 | + // endDate = '${endHour}:30'; | ||
| 649 | + // } | ||
| 616 | // List res = []; | 650 | // List res = []; |
| 617 | // bool tempLimit = true; | 651 | // bool tempLimit = true; |
| 618 | // while (tempLimit) { | 652 | // while (tempLimit) { |
| @@ -107,41 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | @@ -107,41 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> { | ||
| 107 | child: SingleChildScrollView( | 107 | child: SingleChildScrollView( |
| 108 | child: Column( | 108 | child: Column( |
| 109 | children: [ | 109 | children: [ |
| 110 | - // InkWell( | ||
| 111 | - // onTap: () { | ||
| 112 | - // NavigatorUtil.goRechargeHomePage(context); | ||
| 113 | - // }, | ||
| 114 | - // child: Padding( | ||
| 115 | - // padding: EdgeInsets.only( | ||
| 116 | - // left: w(16), | ||
| 117 | - // top: w(12), | ||
| 118 | - // bottom: w(12), | ||
| 119 | - // right: w(12)), | ||
| 120 | - // child: Row( | ||
| 121 | - // children: [ | ||
| 122 | - // Text( | ||
| 123 | - // '会员充值优惠活动', | ||
| 124 | - // style: TextStyle( | ||
| 125 | - // color: MyColours.color_515151, | ||
| 126 | - // fontSize: ScreenUtil().setWidth(32)), | ||
| 127 | - // ), | ||
| 128 | - // Spacer(), | ||
| 129 | - // Container( | ||
| 130 | - // padding: EdgeInsets.symmetric( | ||
| 131 | - // horizontal: w(7), vertical: w(4)), | ||
| 132 | - // child: Image.asset( | ||
| 133 | - // "assets/arrow_right_new.png", | ||
| 134 | - // width: ScreenUtil().setWidth(18), | ||
| 135 | - // height: ScreenUtil().setWidth(32), | ||
| 136 | - // ), | ||
| 137 | - // ) | ||
| 138 | - // ], | ||
| 139 | - // ))), | ||
| 140 | - // Padding( | ||
| 141 | - // padding: EdgeInsets.only(left: w(16)), | ||
| 142 | - // child: MyDivider(double.infinity, w(0.5), | ||
| 143 | - // color: MyColours.color_E7E7E7)), | ||
| 144 | - // VEmptyView(24), | 110 | + InkWell( |
| 111 | + onTap: () { | ||
| 112 | + NavigatorUtil.goRechargeHomePage(context); | ||
| 113 | + }, | ||
| 114 | + child: Padding( | ||
| 115 | + padding: EdgeInsets.only( | ||
| 116 | + left: w(16), | ||
| 117 | + top: w(12), | ||
| 118 | + bottom: w(12), | ||
| 119 | + right: w(12)), | ||
| 120 | + child: Row( | ||
| 121 | + children: [ | ||
| 122 | + Text( | ||
| 123 | + '会员充值优惠活动', | ||
| 124 | + style: TextStyle( | ||
| 125 | + color: MyColours.color_515151, | ||
| 126 | + fontSize: ScreenUtil().setWidth(32)), | ||
| 127 | + ), | ||
| 128 | + Spacer(), | ||
| 129 | + Container( | ||
| 130 | + padding: EdgeInsets.symmetric( | ||
| 131 | + horizontal: w(7), vertical: w(4)), | ||
| 132 | + child: Image.asset( | ||
| 133 | + "assets/arrow_right_new.png", | ||
| 134 | + width: ScreenUtil().setWidth(18), | ||
| 135 | + height: ScreenUtil().setWidth(32), | ||
| 136 | + ), | ||
| 137 | + ) | ||
| 138 | + ], | ||
| 139 | + ))), | ||
| 140 | + Padding( | ||
| 141 | + padding: EdgeInsets.only(left: w(16)), | ||
| 142 | + child: MyDivider(double.infinity, w(0.5), | ||
| 143 | + color: MyColours.color_E7E7E7)), | ||
| 144 | + VEmptyView(24), | ||
| 145 | InkWell( | 145 | InkWell( |
| 146 | onTap: () { | 146 | onTap: () { |
| 147 | setState(() { | 147 | setState(() { |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:common_utils/common_utils.dart'; | 3 | import 'package:common_utils/common_utils.dart'; |
| 2 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 3 | import 'package:flutter_picker/Picker.dart'; | 5 | import 'package:flutter_picker/Picker.dart'; |
| @@ -61,6 +63,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -61,6 +63,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 61 | bool giveScoreSwich = false; | 63 | bool giveScoreSwich = false; |
| 62 | bool giveCouponsSwich = false; | 64 | bool giveCouponsSwich = false; |
| 63 | 65 | ||
| 66 | + List<CouponSunModel> couponsData = []; | ||
| 67 | + | ||
| 64 | @override | 68 | @override |
| 65 | void initState() { | 69 | void initState() { |
| 66 | super.initState(); | 70 | super.initState(); |
| @@ -636,12 +640,15 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -636,12 +640,15 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 636 | object['couponsid'] != null) { | 640 | object['couponsid'] != null) { |
| 637 | List<CouponSunModel> data = | 641 | List<CouponSunModel> data = |
| 638 | object['couponsdata']; | 642 | object['couponsdata']; |
| 643 | + | ||
| 644 | + couponsData = []; | ||
| 639 | // | 645 | // |
| 640 | selectIDs = object['couponsid']; | 646 | selectIDs = object['couponsid']; |
| 641 | coupons = []; | 647 | coupons = []; |
| 642 | data.forEach((element) { | 648 | data.forEach((element) { |
| 643 | if (element.isCheck) { | 649 | if (element.isCheck) { |
| 644 | coupons.add(element.aname); | 650 | coupons.add(element.aname); |
| 651 | + couponsData.add(element); | ||
| 645 | } | 652 | } |
| 646 | }); | 653 | }); |
| 647 | setState(() {}); | 654 | setState(() {}); |
| @@ -871,6 +878,74 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -871,6 +878,74 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 871 | isBold: false, | 878 | isBold: false, |
| 872 | fontSize: 28, | 879 | fontSize: 28, |
| 873 | onPressed: () async { | 880 | onPressed: () async { |
| 881 | + //优惠活动 | ||
| 882 | + if (givePriceSwich && givePriceC.text.trim().length == 0) { | ||
| 883 | + Utils.showToast('请输入赠送金额!'); | ||
| 884 | + return; | ||
| 885 | + } | ||
| 886 | + if (giveScoreSwich && giveScoreC.text.trim().length == 0) { | ||
| 887 | + Utils.showToast('请输入赠送积分!'); | ||
| 888 | + return; | ||
| 889 | + } | ||
| 890 | + if (giveCouponsSwich && couponsData.length == 0) { | ||
| 891 | + Utils.showToast('请选择赠送的优惠券!'); | ||
| 892 | + return; | ||
| 893 | + } | ||
| 894 | + | ||
| 895 | + //有效期 | ||
| 896 | + | ||
| 897 | + if (fixdate) { | ||
| 898 | + //固定时间段 | ||
| 899 | + | ||
| 900 | + if (fromDate == '点击设置开始日期') { | ||
| 901 | + Utils.showToast('请设置开始日期!'); | ||
| 902 | + return; | ||
| 903 | + } | ||
| 904 | + | ||
| 905 | + if (endDate == '点击设置结束日期') { | ||
| 906 | + Utils.showToast('请设置结束日期!'); | ||
| 907 | + return; | ||
| 908 | + } | ||
| 909 | + if (DateUtil.getDateTime(endDate) | ||
| 910 | + .compareTo(DateUtil.getDateTime(fromDate)) < | ||
| 911 | + 0) { | ||
| 912 | + Utils.showToast('有效期结束日期不能早于开始日期!'); | ||
| 913 | + return; | ||
| 914 | + } | ||
| 915 | + } | ||
| 916 | + | ||
| 917 | + if (weekly && weekShow == '点击设置可用日期') { | ||
| 918 | + Utils.showToast('请设置可用日期!'); | ||
| 919 | + return; | ||
| 920 | + } | ||
| 921 | + | ||
| 922 | + Map discounts = { | ||
| 923 | + 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额 | ||
| 924 | + 'is_score': giveScoreSwich ? '1' : '0', //赠送积分 | ||
| 925 | + 'is_coupons': giveCouponsSwich ? '1' : '0', //赠送优惠券 | ||
| 926 | + 'price': givePriceC.text, | ||
| 927 | + 'score': giveScoreC.text, | ||
| 928 | + 'coupons': couponsData, | ||
| 929 | + 'coupons_ids': selectIDs, | ||
| 930 | + 'coupons_names': coupons | ||
| 931 | + }; | ||
| 932 | + | ||
| 933 | + String discountsStr = json.encode(discounts); | ||
| 934 | + print(discountsStr); | ||
| 935 | + | ||
| 936 | + Map date = { | ||
| 937 | + 'is_fix': fixdate ? '1' : '0', | ||
| 938 | + 'is_week': weekly ? '1' : '0', | ||
| 939 | + 'is_birthday': birthday ? '1' : '0', | ||
| 940 | + 'fix_sdate': fixdate ? fromDate : '', // 开始时间 | ||
| 941 | + 'fix_edate': fixdate ? endDate : '', //结束时间 | ||
| 942 | + 'week_date_show': weekly ? weekShow : '', | ||
| 943 | + 'week_date_data': weekly ? weekData : '' | ||
| 944 | + }; | ||
| 945 | + | ||
| 946 | + String dateStr = json.encode(date); | ||
| 947 | + print(dateStr); | ||
| 948 | + | ||
| 874 | // "stime": fromDate == '点击选择' | 949 | // "stime": fromDate == '点击选择' |
| 875 | // ? "" | 950 | // ? "" |
| 876 | // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}', | 951 | // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}', |
| @@ -133,6 +133,23 @@ class PhotoManagerPageState extends State<PhotoManagerPage> { | @@ -133,6 +133,23 @@ class PhotoManagerPageState extends State<PhotoManagerPage> { | ||
| 133 | int beginHour = int.parse(tempHour[0]); | 133 | int beginHour = int.parse(tempHour[0]); |
| 134 | /*获取开始分钟*/ | 134 | /*获取开始分钟*/ |
| 135 | int beginMinute = int.parse(tempHour[1]); | 135 | int beginMinute = int.parse(tempHour[1]); |
| 136 | + if (beginMinute == 15) { | ||
| 137 | + beginMinute = 30; | ||
| 138 | + } else if (beginMinute == 45) { | ||
| 139 | + beginHour++; | ||
| 140 | + beginMinute = 0; | ||
| 141 | + } | ||
| 142 | + List endTemp = endDate.split(':'); | ||
| 143 | + /*获取结束小时*/ | ||
| 144 | + int endHour = int.parse(endTemp[0]); | ||
| 145 | + /*获取结束分钟*/ | ||
| 146 | + int endMinute = int.parse(endTemp[1]); | ||
| 147 | + if (endMinute == 15) { | ||
| 148 | + | ||
| 149 | + endDate = '${endHour}:00'; | ||
| 150 | + } else if (endMinute == 45) { | ||
| 151 | + endDate = '${endHour}:30'; | ||
| 152 | + } | ||
| 136 | List res = []; | 153 | List res = []; |
| 137 | bool tempLimit = true; | 154 | bool tempLimit = true; |
| 138 | while (tempLimit) { | 155 | while (tempLimit) { |
| @@ -144,6 +144,23 @@ class MergeTableSelectPageState extends State<MergeTableSelectPage> { | @@ -144,6 +144,23 @@ class MergeTableSelectPageState extends State<MergeTableSelectPage> { | ||
| 144 | // int beginHour = int.parse(tempHour[0]); | 144 | // int beginHour = int.parse(tempHour[0]); |
| 145 | // /*获取开始分钟*/ | 145 | // /*获取开始分钟*/ |
| 146 | // int beginMinute = int.parse(tempHour[1]); | 146 | // int beginMinute = int.parse(tempHour[1]); |
| 147 | + // if (beginMinute == 15) { | ||
| 148 | + // beginMinute = 30; | ||
| 149 | + // } else if (beginMinute == 45) { | ||
| 150 | + // beginHour++; | ||
| 151 | + // beginMinute = 0; | ||
| 152 | + // } | ||
| 153 | + // List endTemp = endDate.split(':'); | ||
| 154 | + // /*获取结束小时*/ | ||
| 155 | + // int endHour = int.parse(endTemp[0]); | ||
| 156 | + // /*获取结束分钟*/ | ||
| 157 | + // int endMinute = int.parse(endTemp[1]); | ||
| 158 | + // if (endMinute == 15) { | ||
| 159 | + | ||
| 160 | + // endDate = '${endHour}:00'; | ||
| 161 | + // } else if (endMinute == 45) { | ||
| 162 | + // endDate = '${endHour}:30'; | ||
| 163 | + // } | ||
| 147 | // List res = []; | 164 | // List res = []; |
| 148 | // bool tempLimit = true; | 165 | // bool tempLimit = true; |
| 149 | // while (tempLimit) { | 166 | // while (tempLimit) { |
| @@ -242,6 +242,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -242,6 +242,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 242 | } | 242 | } |
| 243 | } | 243 | } |
| 244 | }); | 244 | }); |
| 245 | + if (baseResp == null) return []; | ||
| 245 | if (baseResp.code == Constant.status_success) { | 246 | if (baseResp.code == Constant.status_success) { |
| 246 | couponListSelect = CouponModel.fromJson(baseResp.responseData).data; | 247 | couponListSelect = CouponModel.fromJson(baseResp.responseData).data; |
| 247 | notifyListeners(); | 248 | notifyListeners(); |
| @@ -322,6 +322,22 @@ class EnterModel with ChangeNotifier { | @@ -322,6 +322,22 @@ class EnterModel with ChangeNotifier { | ||
| 322 | int beginHour = int.parse(tempHour[0]); | 322 | int beginHour = int.parse(tempHour[0]); |
| 323 | /*获取开始分钟*/ | 323 | /*获取开始分钟*/ |
| 324 | int beginMinute = int.parse(tempHour[1]); | 324 | int beginMinute = int.parse(tempHour[1]); |
| 325 | + if (beginMinute == 15) { | ||
| 326 | + beginMinute = 30; | ||
| 327 | + } else if (beginMinute == 45) { | ||
| 328 | + beginHour++; | ||
| 329 | + beginMinute = 0; | ||
| 330 | + } | ||
| 331 | + List endTemp = endDate.split(':'); | ||
| 332 | + /*获取结束小时*/ | ||
| 333 | + int endHour = int.parse(endTemp[0]); | ||
| 334 | + /*获取结束分钟*/ | ||
| 335 | + int endMinute = int.parse(endTemp[1]); | ||
| 336 | + if (endMinute == 15) { | ||
| 337 | + endDate = '${endHour}:00'; | ||
| 338 | + } else if (endMinute == 45) { | ||
| 339 | + endDate = '${endHour}:30'; | ||
| 340 | + } | ||
| 325 | List res = []; | 341 | List res = []; |
| 326 | bool tempLimit = true; | 342 | bool tempLimit = true; |
| 327 | while (tempLimit) { | 343 | while (tempLimit) { |
| @@ -205,6 +205,23 @@ class HomeEnterModel with ChangeNotifier { | @@ -205,6 +205,23 @@ class HomeEnterModel with ChangeNotifier { | ||
| 205 | int beginHour = int.parse(tempHour[0]); | 205 | int beginHour = int.parse(tempHour[0]); |
| 206 | /*获取开始分钟*/ | 206 | /*获取开始分钟*/ |
| 207 | int beginMinute = int.parse(tempHour[1]); | 207 | int beginMinute = int.parse(tempHour[1]); |
| 208 | + if (beginMinute == 15) { | ||
| 209 | + beginMinute = 30; | ||
| 210 | + } else if (beginMinute == 45) { | ||
| 211 | + beginHour++; | ||
| 212 | + beginMinute = 0; | ||
| 213 | + } | ||
| 214 | + List endTemp = endDate.split(':'); | ||
| 215 | + /*获取结束小时*/ | ||
| 216 | + int endHour = int.parse(endTemp[0]); | ||
| 217 | + /*获取结束分钟*/ | ||
| 218 | + int endMinute = int.parse(endTemp[1]); | ||
| 219 | + if (endMinute == 15) { | ||
| 220 | + | ||
| 221 | + endDate = '${endHour}:00'; | ||
| 222 | + } else if (endMinute == 45) { | ||
| 223 | + endDate = '${endHour}:30'; | ||
| 224 | + } | ||
| 208 | List res = []; | 225 | List res = []; |
| 209 | bool tempLimit = true; | 226 | bool tempLimit = true; |
| 210 | while (tempLimit) { | 227 | while (tempLimit) { |
| @@ -224,6 +224,22 @@ class NotebookDetailChangeModel with ChangeNotifier { | @@ -224,6 +224,22 @@ class NotebookDetailChangeModel with ChangeNotifier { | ||
| 224 | int beginHour = int.parse(tempHour[0]); | 224 | int beginHour = int.parse(tempHour[0]); |
| 225 | /*获取开始分钟*/ | 225 | /*获取开始分钟*/ |
| 226 | int beginMinute = int.parse(tempHour[1]); | 226 | int beginMinute = int.parse(tempHour[1]); |
| 227 | + if (beginMinute == 15) { | ||
| 228 | + beginMinute = 30; | ||
| 229 | + } else if (beginMinute == 45) { | ||
| 230 | + beginHour++; | ||
| 231 | + beginMinute = 0; | ||
| 232 | + } | ||
| 233 | + List endTemp = endDate.split(':'); | ||
| 234 | + /*获取结束小时*/ | ||
| 235 | + int endHour = int.parse(endTemp[0]); | ||
| 236 | + /*获取结束分钟*/ | ||
| 237 | + int endMinute = int.parse(endTemp[1]); | ||
| 238 | + if (endMinute == 15) { | ||
| 239 | + endDate = '${endHour}:00'; | ||
| 240 | + } else if (endMinute == 45) { | ||
| 241 | + endDate = '${endHour}:30'; | ||
| 242 | + } | ||
| 227 | List res = []; | 243 | List res = []; |
| 228 | bool tempLimit = true; | 244 | bool tempLimit = true; |
| 229 | while (tempLimit) { | 245 | while (tempLimit) { |
| @@ -266,7 +266,7 @@ class TableManagerModel with ChangeNotifier { | @@ -266,7 +266,7 @@ class TableManagerModel with ChangeNotifier { | ||
| 266 | return ddateStr.substring(0, 10); | 266 | return ddateStr.substring(0, 10); |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | - //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组 | 269 | + //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组 16:00-23:15 |
| 270 | _getHourAndMinute(String hourAndMinuteStr, int mnd) { | 270 | _getHourAndMinute(String hourAndMinuteStr, int mnd) { |
| 271 | List tempDate = hourAndMinuteStr.split("-"); | 271 | List tempDate = hourAndMinuteStr.split("-"); |
| 272 | String beginDate = tempDate[0]; | 272 | String beginDate = tempDate[0]; |
| @@ -276,11 +276,30 @@ class TableManagerModel with ChangeNotifier { | @@ -276,11 +276,30 @@ class TableManagerModel with ChangeNotifier { | ||
| 276 | int beginHour = int.parse(tempHour[0]); | 276 | int beginHour = int.parse(tempHour[0]); |
| 277 | /*获取开始分钟*/ | 277 | /*获取开始分钟*/ |
| 278 | int beginMinute = int.parse(tempHour[1]); | 278 | int beginMinute = int.parse(tempHour[1]); |
| 279 | + | ||
| 280 | + if (beginMinute == 15) { | ||
| 281 | + beginMinute = 30; | ||
| 282 | + } else if (beginMinute == 45) { | ||
| 283 | + beginHour++; | ||
| 284 | + beginMinute = 0; | ||
| 285 | + } | ||
| 286 | + List endTemp = endDate.split(':'); | ||
| 287 | + /*获取结束小时*/ | ||
| 288 | + int endHour = int.parse(endTemp[0]); | ||
| 289 | + /*获取结束分钟*/ | ||
| 290 | + int endMinute = int.parse(endTemp[1]); | ||
| 291 | + if (endMinute == 15) { | ||
| 292 | + | ||
| 293 | + endDate = '${endHour}:00'; | ||
| 294 | + } else if (endMinute == 45) { | ||
| 295 | + endDate = '${endHour}:30'; | ||
| 296 | + } | ||
| 279 | List<String> res = []; | 297 | List<String> res = []; |
| 280 | bool tempLimit = true; | 298 | bool tempLimit = true; |
| 281 | while (tempLimit) { | 299 | while (tempLimit) { |
| 282 | String temp = _dealTime(beginHour, beginMinute); | 300 | String temp = _dealTime(beginHour, beginMinute); |
| 283 | res.add(temp); | 301 | res.add(temp); |
| 302 | + print(res); | ||
| 284 | if (temp == endDate) { | 303 | if (temp == endDate) { |
| 285 | tempLimit = false; | 304 | tempLimit = false; |
| 286 | break; | 305 | break; |
| @@ -790,7 +809,7 @@ class TableManagerModel with ChangeNotifier { | @@ -790,7 +809,7 @@ class TableManagerModel with ChangeNotifier { | ||
| 790 | table.sign = notebook.status; | 809 | table.sign = notebook.status; |
| 791 | table.notebookId = notebook.id; | 810 | table.notebookId = notebook.id; |
| 792 | table.reserver = notebook.rnameStr; | 811 | table.reserver = notebook.rnameStr; |
| 793 | - table.phone = notebook.phone; | 812 | + table.phone = notebook.phone; |
| 794 | table.pnum = notebook.actual_pnum; | 813 | table.pnum = notebook.actual_pnum; |
| 795 | table.nickName = notebook.nick_name; | 814 | table.nickName = notebook.nick_name; |
| 796 | table.label = notebook.className; | 815 | table.label = notebook.className; |
| @@ -1566,7 +1566,7 @@ class Utils { | @@ -1566,7 +1566,7 @@ class Utils { | ||
| 1566 | title: _title, | 1566 | title: _title, |
| 1567 | path: _path, | 1567 | path: _path, |
| 1568 | description: _description, | 1568 | description: _description, |
| 1569 | - // miniProgramType: WXMiniProgramType.PREVIEW, //体验版 | 1569 | + miniProgramType: WXMiniProgramType.PREVIEW, //体验版 |
| 1570 | // miniProgramType: WXMiniProgramType.RELEASE //正式版 | 1570 | // miniProgramType: WXMiniProgramType.RELEASE //正式版 |
| 1571 | // miniProgramType: WXMiniProgramType.TEST //开发版 | 1571 | // miniProgramType: WXMiniProgramType.TEST //开发版 |
| 1572 | // thumbnail: WeChatImage.binary(source) | 1572 | // thumbnail: WeChatImage.binary(source) |
| @@ -106,6 +106,22 @@ class SetTimeWidget { | @@ -106,6 +106,22 @@ class SetTimeWidget { | ||
| 106 | int beginHour = int.parse(tempHour[0]); | 106 | int beginHour = int.parse(tempHour[0]); |
| 107 | /*获取开始分钟*/ | 107 | /*获取开始分钟*/ |
| 108 | int beginMinute = int.parse(tempHour[1]); | 108 | int beginMinute = int.parse(tempHour[1]); |
| 109 | + if (beginMinute == 15) { | ||
| 110 | + beginMinute = 30; | ||
| 111 | + } else if (beginMinute == 45) { | ||
| 112 | + beginHour++; | ||
| 113 | + beginMinute = 0; | ||
| 114 | + } | ||
| 115 | + List endTemp = endDate.split(':'); | ||
| 116 | + /*获取结束小时*/ | ||
| 117 | + int endHour = int.parse(endTemp[0]); | ||
| 118 | + /*获取结束分钟*/ | ||
| 119 | + int endMinute = int.parse(endTemp[1]); | ||
| 120 | + if (endMinute == 15) { | ||
| 121 | + endDate = '${endHour}:00'; | ||
| 122 | + } else if (endMinute == 45) { | ||
| 123 | + endDate = '${endHour}:30'; | ||
| 124 | + } | ||
| 109 | List res = []; | 125 | List res = []; |
| 110 | bool tempLimit = true; | 126 | bool tempLimit = true; |
| 111 | while (tempLimit) { | 127 | while (tempLimit) { |
-
Please register or login to post a comment