Showing
1 changed file
with
144 additions
and
147 deletions
| @@ -6,6 +6,7 @@ import 'package:one_key/utils/dialog_util.dart'; | @@ -6,6 +6,7 @@ import 'package:one_key/utils/dialog_util.dart'; | ||
| 6 | import 'package:one_key/utils/utils.dart'; | 6 | import 'package:one_key/utils/utils.dart'; |
| 7 | import 'package:one_key/widgets/h_empty_view.dart'; | 7 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 8 | import 'package:one_key/widgets/system_app_bar.dart'; | 8 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 9 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 9 | 10 | ||
| 10 | typedef ClickCallback = void Function(String value); | 11 | typedef ClickCallback = void Function(String value); |
| 11 | enum TimeType { TimeTypeStart, TimeTypeEnd, TimeTypeDefalt } | 12 | enum TimeType { TimeTypeStart, TimeTypeEnd, TimeTypeDefalt } |
| @@ -29,6 +30,7 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -29,6 +30,7 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 29 | int currentIndex = 0; | 30 | int currentIndex = 0; |
| 30 | TextEditingController controller = TextEditingController(); | 31 | TextEditingController controller = TextEditingController(); |
| 31 | StaticsModel tableHeaderModel; | 32 | StaticsModel tableHeaderModel; |
| 33 | + String sortstr = '排序'; | ||
| 32 | 34 | ||
| 33 | @override | 35 | @override |
| 34 | void initState() { | 36 | void initState() { |
| @@ -50,33 +52,6 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -50,33 +52,6 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 50 | controller.text = '50'; | 52 | controller.text = '50'; |
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | - ///筛选条件 | ||
| 54 | - Widget _menuWidget(DateTime date) { | ||
| 55 | - return Container( | ||
| 56 | - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(26)), | ||
| 57 | - height: ScreenUtil().setWidth(100), | ||
| 58 | - child: Row( | ||
| 59 | - children: [ | ||
| 60 | - GestureDetector( | ||
| 61 | - onTap: () { | ||
| 62 | - DialogUtil.showCalendarDialog(context, date).then((day) { | ||
| 63 | - if (day != null) {} | ||
| 64 | - }); | ||
| 65 | - }, | ||
| 66 | - child: Container( | ||
| 67 | - child: Text( | ||
| 68 | - dateS, | ||
| 69 | - style: TextStyle( | ||
| 70 | - color: MyColours.color_199095, | ||
| 71 | - fontSize: ScreenUtil().setSp(26)), | ||
| 72 | - ), | ||
| 73 | - ), | ||
| 74 | - ), | ||
| 75 | - ], | ||
| 76 | - ), | ||
| 77 | - ); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | _buttonChoose(String title, ClickCallback callback, | 55 | _buttonChoose(String title, ClickCallback callback, |
| 81 | {TimeType timeType = TimeType.TimeTypeDefalt}) { | 56 | {TimeType timeType = TimeType.TimeTypeDefalt}) { |
| 82 | return InkWell( | 57 | return InkWell( |
| @@ -101,7 +76,11 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -101,7 +76,11 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 101 | color: title == '开始日期' || title == '结束日期' || title == '排序' | 76 | color: title == '开始日期' || title == '结束日期' || title == '排序' |
| 102 | ? MyColours.color_999999 | 77 | ? MyColours.color_999999 |
| 103 | : MyColours.color_199095, | 78 | : MyColours.color_199095, |
| 104 | - fontSize: ScreenUtil().setWidth(26)), | 79 | + fontSize: ScreenUtil().setWidth(26), |
| 80 | + fontWeight: | ||
| 81 | + title == '开始日期' || title == '结束日期' || title == '排序' | ||
| 82 | + ? FontWeight.normal | ||
| 83 | + : FontWeight.bold), | ||
| 105 | ), | 84 | ), |
| 106 | timeType != TimeType.TimeTypeDefalt | 85 | timeType != TimeType.TimeTypeDefalt |
| 107 | ? SizedBox() | 86 | ? SizedBox() |
| @@ -172,15 +151,113 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -172,15 +151,113 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 172 | Navigator.pop(context); | 151 | Navigator.pop(context); |
| 173 | }, | 152 | }, |
| 174 | ), | 153 | ), |
| 175 | - body: Column( | ||
| 176 | - crossAxisAlignment: CrossAxisAlignment.start, | 154 | + body: Stack( |
| 177 | children: [ | 155 | children: [ |
| 156 | + Column( | ||
| 157 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 158 | + children: [ | ||
| 159 | + VEmptyView(100), | ||
| 160 | + Container( | ||
| 161 | + alignment: Alignment.centerLeft, | ||
| 162 | + padding: EdgeInsets.symmetric( | ||
| 163 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 164 | + color: MyColours.color_f5f5f5, | ||
| 165 | + // width: double.infinity, | ||
| 166 | + height: ScreenUtil().setWidth(80), | ||
| 167 | + child: Row( | ||
| 168 | + children: [ | ||
| 169 | + Text( | ||
| 170 | + '显示前 ', | ||
| 171 | + style: TextStyle( | ||
| 172 | + fontSize: ScreenUtil().setSp(26), | ||
| 173 | + color: MyColours.color_333333), | ||
| 174 | + ), | ||
| 175 | + Container( | ||
| 176 | + alignment: Alignment.center, | ||
| 177 | + margin: EdgeInsets.symmetric( | ||
| 178 | + vertical: ScreenUtil().setWidth(20)), | ||
| 179 | + // alignment: Alignment.centerLeft, | ||
| 180 | + // height: ScreenUtil().setWidth(80), | ||
| 181 | + constraints: BoxConstraints( | ||
| 182 | + maxWidth: ScreenUtil().setWidth(50 * 2)), | ||
| 183 | + decoration: BoxDecoration( | ||
| 184 | + border: Border( | ||
| 185 | + bottom: BorderSide( | ||
| 186 | + width: ScreenUtil().setWidth(2), | ||
| 187 | + color: MyColours.color_199095))), | ||
| 188 | + child: IntrinsicWidth( | ||
| 189 | + child: TextField( | ||
| 190 | + controller: controller, | ||
| 191 | + maxLines: 1, | ||
| 192 | + // inputFormatters: [ | ||
| 193 | + // LengthLimitingTextInputFormatter(9), | ||
| 194 | + // WhitelistingTextInputFormatter.digitsOnly | ||
| 195 | + // ], | ||
| 196 | + | ||
| 197 | + // inputFormatters: [ | ||
| 198 | + // NumLengthInputFormatter( | ||
| 199 | + // decimalLength: 2, integerLength: 6), | ||
| 200 | + // ], | ||
| 201 | + // focusNode: numberFocusNode, | ||
| 202 | + | ||
| 203 | + //光标颜色 | ||
| 204 | + cursorColor: MyColours.color_199095, | ||
| 205 | + //输入文本的样式 | ||
| 206 | + style: TextStyle( | ||
| 207 | + fontSize: ScreenUtil().setSp(26), | ||
| 208 | + color: MyColours.color_199095), | ||
| 209 | + textAlign: TextAlign.center, | ||
| 210 | + textInputAction: TextInputAction.done, | ||
| 211 | + decoration: InputDecoration( | ||
| 212 | + isDense: true, | ||
| 213 | + hintText: "输入", | ||
| 214 | + hintStyle: TextStyle( | ||
| 215 | + color: MyColours.color_999999, | ||
| 216 | + fontSize: ScreenUtil().setSp(26), | ||
| 217 | + ), | ||
| 218 | + | ||
| 219 | + contentPadding: EdgeInsets.zero, //ios 17 | ||
| 220 | + border: InputBorder.none, | ||
| 221 | + ), | ||
| 222 | + onChanged: (value) {}, | ||
| 223 | + onEditingComplete: () { | ||
| 224 | + FocusScope.of(context) | ||
| 225 | + .requestFocus(FocusNode()); //隐藏键盘 | ||
| 226 | + // _updateMoney(); | ||
| 227 | + }, | ||
| 228 | + keyboardType: | ||
| 229 | + TextInputType.numberWithOptions(decimal: true), | ||
| 230 | + ))) | ||
| 231 | + ], | ||
| 232 | + )), | ||
| 233 | + //表头 | ||
| 234 | + _tableItem( | ||
| 235 | + tableHeaderModel, 3, TableItemType.TableItemTypeHeader), | ||
| 236 | + Expanded( | ||
| 237 | + child: ListView.builder( | ||
| 238 | + itemCount: 100, | ||
| 239 | + itemBuilder: (BuildContext context, int index) { | ||
| 240 | + StaticsModel tableHeaderModel1 = StaticsModel(); | ||
| 241 | + tableHeaderModel1.select = true; | ||
| 242 | + tableHeaderModel1.numstr = '$index'; | ||
| 243 | + tableHeaderModel1.name = '某某'; | ||
| 244 | + tableHeaderModel1.phone = '1879097890'; | ||
| 245 | + tableHeaderModel1.count = '${index}次'; | ||
| 246 | + return _tableItem(tableHeaderModel1, index, | ||
| 247 | + TableItemType.TableItemTypeBody); | ||
| 248 | + })) | ||
| 249 | + ], | ||
| 250 | + ), | ||
| 178 | Padding( | 251 | Padding( |
| 179 | padding: | 252 | padding: |
| 180 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)), | 253 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)), |
| 181 | child: Container( | 254 | child: Container( |
| 182 | - height: ScreenUtil().setWidth(100), | 255 | + // height: ScreenUtil().setWidth(100), |
| 256 | + // color: Colors.red, | ||
| 257 | + // margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(120)), | ||
| 258 | + padding: EdgeInsets.only(top: ScreenUtil().setWidth(26)), | ||
| 183 | child: Row( | 259 | child: Row( |
| 260 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 184 | children: [ | 261 | children: [ |
| 185 | _buttonChoose(dateS, (value) { | 262 | _buttonChoose(dateS, (value) { |
| 186 | DialogUtil.showCalendarDialog(context, datetimeS) | 263 | DialogUtil.showCalendarDialog(context, datetimeS) |
| @@ -195,12 +272,15 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -195,12 +272,15 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 195 | }); | 272 | }); |
| 196 | }, timeType: TimeType.TimeTypeStart), | 273 | }, timeType: TimeType.TimeTypeStart), |
| 197 | HEmptyView(10), | 274 | HEmptyView(10), |
| 198 | - Text( | ||
| 199 | - '至', | ||
| 200 | - style: TextStyle( | ||
| 201 | - fontSize: ScreenUtil().setSp(28), | ||
| 202 | - color: MyColours.color_199095, | ||
| 203 | - fontWeight: FontWeight.bold), | 275 | + Padding( |
| 276 | + padding: EdgeInsets.only(top: ScreenUtil().setWidth(6)), | ||
| 277 | + child: Text( | ||
| 278 | + '至', | ||
| 279 | + style: TextStyle( | ||
| 280 | + fontSize: ScreenUtil().setSp(28), | ||
| 281 | + color: MyColours.color_199095, | ||
| 282 | + fontWeight: FontWeight.bold), | ||
| 283 | + ), | ||
| 204 | ), | 284 | ), |
| 205 | HEmptyView(10), | 285 | HEmptyView(10), |
| 206 | _buttonChoose(dateE, (value) { | 286 | _buttonChoose(dateE, (value) { |
| @@ -216,119 +296,36 @@ class _StatisticsPageState extends State<StatisticsPage> { | @@ -216,119 +296,36 @@ class _StatisticsPageState extends State<StatisticsPage> { | ||
| 216 | }); | 296 | }); |
| 217 | }, timeType: TimeType.TimeTypeEnd), | 297 | }, timeType: TimeType.TimeTypeEnd), |
| 218 | HEmptyView(10), | 298 | HEmptyView(10), |
| 219 | - Stack(clipBehavior: Clip.none, children: [ | ||
| 220 | - _buttonChoose('排序', (value) { | ||
| 221 | - setState(() { | ||
| 222 | - showWidget = !showWidget; | ||
| 223 | - print('1'); | ||
| 224 | - }); | ||
| 225 | - }), | ||
| 226 | - Positioned( | ||
| 227 | - left: 0, | ||
| 228 | - top: ScreenUtil().setWidth(58), | ||
| 229 | - child: Material( | ||
| 230 | - color: Colors.transparent, | ||
| 231 | - child: Offstage( | ||
| 232 | - offstage: showWidget, | ||
| 233 | - child: _selectWidget(selectList, (index) { | ||
| 234 | - setState(() { | ||
| 235 | - showWidget = !showWidget; | ||
| 236 | - currentIndex = index; | ||
| 237 | - }); | ||
| 238 | - }), | ||
| 239 | - ))), | ||
| 240 | - ]) | 299 | + Column( |
| 300 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 301 | + children: [ | ||
| 302 | + _buttonChoose(sortstr, (value) { | ||
| 303 | + setState(() { | ||
| 304 | + showWidget = !showWidget; | ||
| 305 | + print('1'); | ||
| 306 | + }); | ||
| 307 | + }), | ||
| 308 | + VEmptyView(10), | ||
| 309 | + Container( | ||
| 310 | + // margin: EdgeInsets.only( | ||
| 311 | + // bottom: ScreenUtil().setWidth(58 + 10)), | ||
| 312 | + child: Material( | ||
| 313 | + color: Colors.transparent, | ||
| 314 | + child: Offstage( | ||
| 315 | + offstage: showWidget, | ||
| 316 | + child: _selectWidget(selectList, (index) { | ||
| 317 | + print(selectList[index]); | ||
| 318 | + setState(() { | ||
| 319 | + showWidget = !showWidget; | ||
| 320 | + currentIndex = index; | ||
| 321 | + sortstr = selectList[index]; | ||
| 322 | + }); | ||
| 323 | + }), | ||
| 324 | + ))), | ||
| 325 | + ]) | ||
| 241 | ], | 326 | ], |
| 242 | ), | 327 | ), |
| 243 | )), | 328 | )), |
| 244 | - Container( | ||
| 245 | - alignment: Alignment.centerLeft, | ||
| 246 | - padding: | ||
| 247 | - EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)), | ||
| 248 | - color: MyColours.color_f5f5f5, | ||
| 249 | - // width: double.infinity, | ||
| 250 | - height: ScreenUtil().setWidth(80), | ||
| 251 | - child: Row( | ||
| 252 | - children: [ | ||
| 253 | - Text( | ||
| 254 | - '显示前 ', | ||
| 255 | - style: TextStyle( | ||
| 256 | - fontSize: ScreenUtil().setSp(26), | ||
| 257 | - color: MyColours.color_333333), | ||
| 258 | - ), | ||
| 259 | - Container( | ||
| 260 | - alignment: Alignment.center, | ||
| 261 | - margin: EdgeInsets.symmetric( | ||
| 262 | - vertical: ScreenUtil().setWidth(20)), | ||
| 263 | - // alignment: Alignment.centerLeft, | ||
| 264 | - // height: ScreenUtil().setWidth(80), | ||
| 265 | - constraints: BoxConstraints( | ||
| 266 | - maxWidth: ScreenUtil().setWidth(50 * 2)), | ||
| 267 | - decoration: BoxDecoration( | ||
| 268 | - border: Border( | ||
| 269 | - bottom: BorderSide( | ||
| 270 | - width: ScreenUtil().setWidth(2), | ||
| 271 | - color: MyColours.color_199095))), | ||
| 272 | - child: IntrinsicWidth( | ||
| 273 | - child: TextField( | ||
| 274 | - controller: controller, | ||
| 275 | - maxLines: 1, | ||
| 276 | - // inputFormatters: [ | ||
| 277 | - // LengthLimitingTextInputFormatter(9), | ||
| 278 | - // WhitelistingTextInputFormatter.digitsOnly | ||
| 279 | - // ], | ||
| 280 | - | ||
| 281 | - // inputFormatters: [ | ||
| 282 | - // NumLengthInputFormatter( | ||
| 283 | - // decimalLength: 2, integerLength: 6), | ||
| 284 | - // ], | ||
| 285 | - // focusNode: numberFocusNode, | ||
| 286 | - | ||
| 287 | - //光标颜色 | ||
| 288 | - cursorColor: MyColours.color_199095, | ||
| 289 | - //输入文本的样式 | ||
| 290 | - style: TextStyle( | ||
| 291 | - fontSize: ScreenUtil().setSp(26), | ||
| 292 | - color: MyColours.color_199095), | ||
| 293 | - textAlign: TextAlign.center, | ||
| 294 | - textInputAction: TextInputAction.done, | ||
| 295 | - decoration: InputDecoration( | ||
| 296 | - isDense: true, | ||
| 297 | - hintText: "输入", | ||
| 298 | - hintStyle: TextStyle( | ||
| 299 | - color: MyColours.color_999999, | ||
| 300 | - fontSize: ScreenUtil().setSp(26), | ||
| 301 | - ), | ||
| 302 | - | ||
| 303 | - contentPadding: EdgeInsets.zero, //ios 17 | ||
| 304 | - border: InputBorder.none, | ||
| 305 | - ), | ||
| 306 | - onChanged: (value) {}, | ||
| 307 | - onEditingComplete: () { | ||
| 308 | - FocusScope.of(context) | ||
| 309 | - .requestFocus(FocusNode()); //隐藏键盘 | ||
| 310 | - // _updateMoney(); | ||
| 311 | - }, | ||
| 312 | - keyboardType: | ||
| 313 | - TextInputType.numberWithOptions(decimal: true), | ||
| 314 | - ))) | ||
| 315 | - ], | ||
| 316 | - )), | ||
| 317 | - //表头 | ||
| 318 | - _tableItem(tableHeaderModel, 3, TableItemType.TableItemTypeHeader), | ||
| 319 | - Expanded( | ||
| 320 | - child: ListView.builder( | ||
| 321 | - itemCount: 100, | ||
| 322 | - itemBuilder: (BuildContext context, int index) { | ||
| 323 | - StaticsModel tableHeaderModel1 = StaticsModel(); | ||
| 324 | - tableHeaderModel1.select = true; | ||
| 325 | - tableHeaderModel1.numstr = '$index'; | ||
| 326 | - tableHeaderModel1.name = '某某'; | ||
| 327 | - tableHeaderModel1.phone = '1879097890'; | ||
| 328 | - tableHeaderModel1.count = '${index}次'; | ||
| 329 | - return _tableItem(tableHeaderModel1, index, | ||
| 330 | - TableItemType.TableItemTypeBody); | ||
| 331 | - })) | ||
| 332 | ], | 329 | ], |
| 333 | ), | 330 | ), |
| 334 | ); | 331 | ); |
-
Please register or login to post a comment