Commit 786986ea942184363db78d88b1f7daf7de8474ca

Authored by weixin_45529955
1 parent 6267611f

ff

@@ -112,15 +112,11 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -112,15 +112,11 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
112 112
113 ///从时间选择器中获取分钟数字符串 00 or 30 113 ///从时间选择器中获取分钟数字符串 00 or 30
114 String _getMinuteStrFromPicker(List value) { 114 String _getMinuteStrFromPicker(List value) {
115 - if (value[1] == 0) { 115 + int? minute = SetTimeWidget.dateData[value[0]].values.last[value[1]];
  116 + if (minute == 0) {
116 return '00'; 117 return '00';
117 - } else if (value[1] == 1) {  
118 - return '15';  
119 - }  
120 - if (value[1] == 2) {  
121 - return '30';  
122 } 118 }
123 - return '45'; 119 + return '${minute}';
124 } 120 }
125 121
126 @override 122 @override
@@ -1930,7 +1926,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -1930,7 +1926,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
1930 FocusScope.of(context).requestFocus( 1926 FocusScope.of(context).requestFocus(
1931 FocusNode()); //点击空白处隐藏键盘 1927 FocusNode()); //点击空白处隐藏键盘
1932 }, 1928 },
1933 - keyboardType: TextInputType.numberWithOptions(), 1929 + keyboardType:
  1930 + TextInputType.numberWithOptions(),
1934 ), 1931 ),
1935 )), 1932 )),
1936 HEmptyView(20), 1933 HEmptyView(20),
@@ -2016,7 +2013,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> { @@ -2016,7 +2013,8 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
2016 .requestFocus( 2013 .requestFocus(
2017 FocusNode()); //点击空白处隐藏键盘 2014 FocusNode()); //点击空白处隐藏键盘
2018 }, 2015 },
2019 - keyboardType: TextInputType.numberWithOptions(), 2016 + keyboardType: TextInputType
  2017 + .numberWithOptions(),
2020 ), 2018 ),
2021 )), 2019 )),
2022 HEmptyView(20), 2020 HEmptyView(20),
@@ -101,15 +101,11 @@ class _StoreBaseInfoPageSimState extends State<StoreBaseInfoPageSim> { @@ -101,15 +101,11 @@ class _StoreBaseInfoPageSimState extends State<StoreBaseInfoPageSim> {
101 101
102 ///从时间选择器中获取分钟数字符串 00 or 30 102 ///从时间选择器中获取分钟数字符串 00 or 30
103 String _getMinuteStrFromPicker(List value) { 103 String _getMinuteStrFromPicker(List value) {
104 - if (value[1] == 0) { 104 + int? minute = SetTimeWidget.dateData[value[0]].values.last[value[1]];
  105 + if (minute == 0) {
105 return '00'; 106 return '00';
106 - } else if (value[1] == 1) {  
107 - return '15';  
108 - }  
109 - if (value[1] == 2) {  
110 - return '30';  
111 } 107 }
112 - return '45'; 108 + return '${minute}';
113 } 109 }
114 110
115 @override 111 @override
1 -  
2 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
3 import 'package:one_key/utils/dialog_util.dart'; 2 import 'package:one_key/utils/dialog_util.dart';
4 import 'package:one_key/utils/utils.dart'; 3 import 'package:one_key/utils/utils.dart';
@@ -9,76 +8,76 @@ class SetTimeWidget { @@ -9,76 +8,76 @@ class SetTimeWidget {
9 static SetTimeWidget init = SetTimeWidget(); 8 static SetTimeWidget init = SetTimeWidget();
10 static List dateData = [ 9 static List dateData = [
11 { 10 {
12 - '深夜00时': [00, 15, 30, 45] 11 + '深夜00时': [0, 10, 15, 20, 30, 40, 45, 50]
13 }, 12 },
14 { 13 {
15 - '深夜01时': [00, 15, 30, 45] 14 + '深夜01时': [0, 10, 15, 20, 30, 40, 45, 50]
16 }, 15 },
17 { 16 {
18 - '深夜02时': [00, 15, 30, 45] 17 + '深夜02时': [0, 10, 15, 20, 30, 40, 45, 50]
19 }, 18 },
20 { 19 {
21 - '深夜03时': [00, 15, 30, 45] 20 + '深夜03时': [0, 10, 15, 20, 30, 40, 45, 50]
22 }, 21 },
23 { 22 {
24 - '深夜04时': [00, 15, 30, 45] 23 + '深夜04时': [0, 10, 15, 20, 30, 40, 45, 50]
25 }, 24 },
26 { 25 {
27 - '深夜05时': [00, 15, 30, 45] 26 + '深夜05时': [0, 10, 15, 20, 30, 40, 45, 50]
28 }, 27 },
29 { 28 {
30 - '早上06时': [00, 15, 30, 45] 29 + '早上06时': [0, 10, 15, 20, 30, 40, 45, 50]
31 }, 30 },
32 { 31 {
33 - '早上07时': [00, 15, 30, 45] 32 + '早上07时': [0, 10, 15, 20, 30, 40, 45, 50]
34 }, 33 },
35 { 34 {
36 - '早上08时': [00, 15, 30, 45] 35 + '早上08时': [0, 10, 15, 20, 30, 40, 45, 50]
37 }, 36 },
38 { 37 {
39 - '早上09时': [00, 15, 30, 45] 38 + '早上09时': [0, 10, 15, 20, 30, 40, 45, 50]
40 }, 39 },
41 { 40 {
42 - '中午10时': [00, 15, 30, 45] 41 + '中午10时': [0, 10, 15, 20, 30, 40, 45, 50]
43 }, 42 },
44 { 43 {
45 - '中午11时': [00, 15, 30, 45] 44 + '中午11时': [0, 10, 15, 20, 30, 40, 45, 50]
46 }, 45 },
47 { 46 {
48 - '中午12时': [00, 15, 30, 45] 47 + '中午12时': [0, 10, 15, 20, 30, 40, 45, 50]
49 }, 48 },
50 { 49 {
51 - '中午13时': [00, 15, 30, 45] 50 + '中午13时': [0, 10, 15, 20, 30, 40, 45, 50]
52 }, 51 },
53 { 52 {
54 - '中午14时': [00, 15, 30, 45] 53 + '中午14时': [0, 10, 15, 20, 30, 40, 45, 50]
55 }, 54 },
56 { 55 {
57 - '下午15时': [00, 15, 30, 45] 56 + '下午15时': [0, 10, 15, 20, 30, 40, 45, 50]
58 }, 57 },
59 { 58 {
60 - '下午16时': [00, 15, 30, 45] 59 + '下午16时': [0, 10, 15, 20, 30, 40, 45, 50]
61 }, 60 },
62 { 61 {
63 - '下午17时': [00, 15, 30, 45] 62 + '下午17时': [0, 10, 15, 20, 30, 40, 45, 50]
64 }, 63 },
65 { 64 {
66 - '下午18时': [00, 15, 30, 45] 65 + '下午18时': [0, 10, 15, 20, 30, 40, 45, 50]
67 }, 66 },
68 { 67 {
69 - '晚上19时': [00, 15, 30, 45] 68 + '晚上19时': [0, 10, 15, 20, 30, 40, 45, 50]
70 }, 69 },
71 { 70 {
72 - '晚上20时': [00, 15, 30, 45] 71 + '晚上20时': [0, 10, 15, 20, 30, 40, 45, 50]
73 }, 72 },
74 { 73 {
75 - '晚上21时': [00, 15, 30, 45] 74 + '晚上21时': [0, 10, 15, 20, 30, 40, 45, 50]
76 }, 75 },
77 { 76 {
78 - '晚上22时': [00, 15, 30, 45] 77 + '晚上22时': [0, 10, 15, 20, 30, 40, 45, 50]
79 }, 78 },
80 { 79 {
81 - '晚上23时': [00, 15, 30, 45] 80 + '晚上23时': [0, 10, 15, 20, 30, 40, 45, 50]
82 } 81 }
83 ]; 82 ];
84 83
@@ -202,10 +201,14 @@ class SetTimeWidget { @@ -202,10 +201,14 @@ class SetTimeWidget {
202 context, data, hourAndMinute, SetTimeCallback setTimeCallback) { 201 context, data, hourAndMinute, SetTimeCallback setTimeCallback) {
203 DialogUtil.showSelectCusmanTimerDialog(context, data, (value) { 202 DialogUtil.showSelectCusmanTimerDialog(context, data, (value) {
204 setTimeCallback(value); 203 setTimeCallback(value);
205 - }, selecteds:hourAndMinute == null?[]: [  
206 - _getFirSelected(hourAndMinute, data),  
207 - _getSecSelected(hourAndMinute, data)  
208 - ]).then((value) { 204 + },
  205 + selecteds: hourAndMinute == null
  206 + ? []
  207 + : [
  208 + _getFirSelected(hourAndMinute, data),
  209 + _getSecSelected(hourAndMinute, data)
  210 + ])
  211 + .then((value) {
209 print(value); 212 print(value);
210 }); 213 });
211 } 214 }