Showing
8 changed files
with
450 additions
and
44 deletions
| @@ -261,7 +261,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -261,7 +261,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 261 | )), | 261 | )), |
| 262 | InkWell( | 262 | InkWell( |
| 263 | onTap: () { | 263 | onTap: () { |
| 264 | - // NavigatorUtil.goMarketingRecordsDetailPage(context); | 264 | + NavigatorUtil.goCustomerOrderPage(context); |
| 265 | }, | 265 | }, |
| 266 | child: Text('更多', | 266 | child: Text('更多', |
| 267 | style: TextStyle( | 267 | style: TextStyle( |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/utils.dart'; | ||
| 5 | +import 'package:one_key/widgets/MyDivider.dart'; | ||
| 6 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 7 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 8 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 9 | + | ||
| 10 | +class CustomerOrderPage extends StatefulWidget { | ||
| 11 | + CustomerOrderPage({Key key}) : super(key: key); | ||
| 12 | + | ||
| 13 | + @override | ||
| 14 | + _CustomerOrderPageState createState() => _CustomerOrderPageState(); | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +class _CustomerOrderPageState extends State<CustomerOrderPage> { | ||
| 18 | + int year = DateTime.now().year; | ||
| 19 | + @override | ||
| 20 | + Widget build(BuildContext context) { | ||
| 21 | + return Scaffold( | ||
| 22 | + backgroundColor: Color.fromRGBO(246, 248, 250, 1), | ||
| 23 | + appBar: SystemAppBar( | ||
| 24 | + '客户订单', | ||
| 25 | + onTap: () { | ||
| 26 | + Navigator.pop(context); | ||
| 27 | + }, | ||
| 28 | + ), | ||
| 29 | + body: Padding( | ||
| 30 | + padding: EdgeInsets.symmetric( | ||
| 31 | + horizontal: ScreenUtil().setWidth(40), | ||
| 32 | + vertical: ScreenUtil().setWidth(40)), | ||
| 33 | + child: Column( | ||
| 34 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 35 | + children: [ | ||
| 36 | + Row( | ||
| 37 | + children: [ | ||
| 38 | + InkWell( | ||
| 39 | + onTap: () { | ||
| 40 | + setState(() { | ||
| 41 | + year--; | ||
| 42 | + }); | ||
| 43 | + }, | ||
| 44 | + child: Image.asset( | ||
| 45 | + Utils.getImgPath('c_arrow_left'), | ||
| 46 | + width: ScreenUtil().setWidth(24), | ||
| 47 | + )), | ||
| 48 | + Padding( | ||
| 49 | + padding: EdgeInsets.symmetric( | ||
| 50 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 51 | + child: Text( | ||
| 52 | + '${year}年', | ||
| 53 | + style: TextStyle( | ||
| 54 | + fontSize: ScreenUtil().setSp(34), | ||
| 55 | + color: MyColours.color_333333), | ||
| 56 | + ), | ||
| 57 | + ), | ||
| 58 | + InkWell( | ||
| 59 | + onTap: () { | ||
| 60 | + if (year >= DateTime.now().year) { | ||
| 61 | + return; | ||
| 62 | + } | ||
| 63 | + setState(() { | ||
| 64 | + year++; | ||
| 65 | + }); | ||
| 66 | + }, | ||
| 67 | + child: Image.asset( | ||
| 68 | + Utils.getImgPath(year != DateTime.now().year | ||
| 69 | + ? 'c_arrow_right' | ||
| 70 | + : 'c_arrow_right_gray'), | ||
| 71 | + width: ScreenUtil().setWidth(24), | ||
| 72 | + )) | ||
| 73 | + ], | ||
| 74 | + ), | ||
| 75 | + VEmptyView(20), | ||
| 76 | + Wrap( | ||
| 77 | + children: [ | ||
| 78 | + Text( | ||
| 79 | + '全年累计', | ||
| 80 | + style: TextStyle( | ||
| 81 | + fontSize: ScreenUtil().setSp(24), | ||
| 82 | + color: MyColours.color_353535), | ||
| 83 | + ), | ||
| 84 | + Text( | ||
| 85 | + ' 2000 ', | ||
| 86 | + style: TextStyle( | ||
| 87 | + fontSize: ScreenUtil().setSp(24), | ||
| 88 | + color: MyColours.color_199095), | ||
| 89 | + ), | ||
| 90 | + Text( | ||
| 91 | + '单', | ||
| 92 | + style: TextStyle( | ||
| 93 | + fontSize: ScreenUtil().setSp(24), | ||
| 94 | + color: MyColours.color_353535), | ||
| 95 | + ), | ||
| 96 | + HEmptyView(20), | ||
| 97 | + Text( | ||
| 98 | + '全年取消', | ||
| 99 | + style: TextStyle( | ||
| 100 | + fontSize: ScreenUtil().setSp(24), | ||
| 101 | + color: MyColours.color_353535), | ||
| 102 | + ), | ||
| 103 | + Text( | ||
| 104 | + ' 2000 ', | ||
| 105 | + style: TextStyle( | ||
| 106 | + fontSize: ScreenUtil().setSp(24), | ||
| 107 | + color: MyColours.color_199095), | ||
| 108 | + ), | ||
| 109 | + Text( | ||
| 110 | + '单', | ||
| 111 | + style: TextStyle( | ||
| 112 | + fontSize: ScreenUtil().setSp(24), | ||
| 113 | + color: MyColours.color_353535), | ||
| 114 | + ), | ||
| 115 | + ], | ||
| 116 | + ), | ||
| 117 | + VEmptyView(20), | ||
| 118 | + Wrap( | ||
| 119 | + children: [ | ||
| 120 | + Text( | ||
| 121 | + '记录全额订单:', | ||
| 122 | + style: TextStyle( | ||
| 123 | + fontSize: ScreenUtil().setSp(24), | ||
| 124 | + color: MyColours.color_353535), | ||
| 125 | + ), | ||
| 126 | + Text( | ||
| 127 | + '2000 ', | ||
| 128 | + style: TextStyle( | ||
| 129 | + fontSize: ScreenUtil().setSp(24), | ||
| 130 | + color: MyColours.color_353535), | ||
| 131 | + ), | ||
| 132 | + Text( | ||
| 133 | + '单', | ||
| 134 | + style: TextStyle( | ||
| 135 | + fontSize: ScreenUtil().setSp(24), | ||
| 136 | + color: MyColours.color_353535), | ||
| 137 | + ), | ||
| 138 | + HEmptyView(20), | ||
| 139 | + Text( | ||
| 140 | + '记录人数订单:', | ||
| 141 | + style: TextStyle( | ||
| 142 | + fontSize: ScreenUtil().setSp(24), | ||
| 143 | + color: MyColours.color_353535), | ||
| 144 | + ), | ||
| 145 | + Text( | ||
| 146 | + '2000 ', | ||
| 147 | + style: TextStyle( | ||
| 148 | + fontSize: ScreenUtil().setSp(24), | ||
| 149 | + color: MyColours.color_353535), | ||
| 150 | + ), | ||
| 151 | + Text( | ||
| 152 | + '单', | ||
| 153 | + style: TextStyle( | ||
| 154 | + fontSize: ScreenUtil().setSp(24), | ||
| 155 | + color: MyColours.color_353535), | ||
| 156 | + ), | ||
| 157 | + ], | ||
| 158 | + ), | ||
| 159 | + VEmptyView(20), | ||
| 160 | + Wrap( | ||
| 161 | + children: [ | ||
| 162 | + Text( | ||
| 163 | + '总消费:', | ||
| 164 | + style: TextStyle( | ||
| 165 | + fontSize: ScreenUtil().setSp(24), | ||
| 166 | + color: MyColours.color_353535), | ||
| 167 | + ), | ||
| 168 | + Text( | ||
| 169 | + '2000 ', | ||
| 170 | + style: TextStyle( | ||
| 171 | + fontSize: ScreenUtil().setSp(24), | ||
| 172 | + color: MyColours.color_353535), | ||
| 173 | + ), | ||
| 174 | + Text( | ||
| 175 | + '元', | ||
| 176 | + style: TextStyle( | ||
| 177 | + fontSize: ScreenUtil().setSp(24), | ||
| 178 | + color: MyColours.color_353535), | ||
| 179 | + ), | ||
| 180 | + HEmptyView(20), | ||
| 181 | + Text( | ||
| 182 | + '总人数:', | ||
| 183 | + style: TextStyle( | ||
| 184 | + fontSize: ScreenUtil().setSp(24), | ||
| 185 | + color: MyColours.color_353535), | ||
| 186 | + ), | ||
| 187 | + Text( | ||
| 188 | + '2000 ', | ||
| 189 | + style: TextStyle( | ||
| 190 | + fontSize: ScreenUtil().setSp(24), | ||
| 191 | + color: MyColours.color_353535), | ||
| 192 | + ), | ||
| 193 | + Text( | ||
| 194 | + '人', | ||
| 195 | + style: TextStyle( | ||
| 196 | + fontSize: ScreenUtil().setSp(24), | ||
| 197 | + color: MyColours.color_353535), | ||
| 198 | + ), | ||
| 199 | + HEmptyView(20), | ||
| 200 | + Text( | ||
| 201 | + '人均:', | ||
| 202 | + style: TextStyle( | ||
| 203 | + fontSize: ScreenUtil().setSp(24), | ||
| 204 | + color: MyColours.color_353535), | ||
| 205 | + ), | ||
| 206 | + Text( | ||
| 207 | + '2000 ', | ||
| 208 | + style: TextStyle( | ||
| 209 | + fontSize: ScreenUtil().setSp(24), | ||
| 210 | + color: MyColours.color_353535), | ||
| 211 | + ), | ||
| 212 | + Text( | ||
| 213 | + '元/人', | ||
| 214 | + style: TextStyle( | ||
| 215 | + fontSize: ScreenUtil().setSp(24), | ||
| 216 | + color: MyColours.color_353535), | ||
| 217 | + ), | ||
| 218 | + ], | ||
| 219 | + ), | ||
| 220 | + VEmptyView(20), | ||
| 221 | + MyDivider( | ||
| 222 | + double.infinity, | ||
| 223 | + ScreenUtil().setWidth(1), | ||
| 224 | + color: MyColours.color_E0E0E0, | ||
| 225 | + ), | ||
| 226 | + VEmptyView(20), | ||
| 227 | + Expanded( | ||
| 228 | + child: ListView.builder( | ||
| 229 | + shrinkWrap: true, | ||
| 230 | + itemCount: 10, | ||
| 231 | + // controller: controller, | ||
| 232 | + itemBuilder: (BuildContext context, int index) { | ||
| 233 | + return Row( | ||
| 234 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 235 | + children: [ | ||
| 236 | + CircleAvatar( | ||
| 237 | + radius: ScreenUtil().setWidth(10), | ||
| 238 | + backgroundColor: MyColours.color_199095, | ||
| 239 | + ), | ||
| 240 | + HEmptyView(20), | ||
| 241 | + Column( | ||
| 242 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 243 | + children: [ | ||
| 244 | + Wrap( | ||
| 245 | + children: [ | ||
| 246 | + Text( | ||
| 247 | + '[已完成]', | ||
| 248 | + style: TextStyle( | ||
| 249 | + fontSize: ScreenUtil().setSp(24), | ||
| 250 | + color: MyColours.color_353535), | ||
| 251 | + ), | ||
| 252 | + HEmptyView(10), | ||
| 253 | + Text( | ||
| 254 | + '42天前', | ||
| 255 | + style: TextStyle( | ||
| 256 | + fontSize: ScreenUtil().setSp(24), | ||
| 257 | + color: MyColours.color_353535), | ||
| 258 | + ), | ||
| 259 | + HEmptyView(10), | ||
| 260 | + Text( | ||
| 261 | + '2021-09-29', | ||
| 262 | + style: TextStyle( | ||
| 263 | + fontSize: ScreenUtil().setSp(24), | ||
| 264 | + color: MyColours.color_353535), | ||
| 265 | + ), | ||
| 266 | + HEmptyView(10), | ||
| 267 | + Text( | ||
| 268 | + '午餐', | ||
| 269 | + style: TextStyle( | ||
| 270 | + fontSize: ScreenUtil().setSp(24), | ||
| 271 | + color: MyColours.color_353535), | ||
| 272 | + ), | ||
| 273 | + HEmptyView(10), | ||
| 274 | + Text( | ||
| 275 | + '【201】', | ||
| 276 | + style: TextStyle( | ||
| 277 | + fontSize: ScreenUtil().setSp(24), | ||
| 278 | + color: MyColours.color_353535), | ||
| 279 | + ), | ||
| 280 | + ], | ||
| 281 | + ), | ||
| 282 | + VEmptyView(20), | ||
| 283 | + Row( | ||
| 284 | + children: [ | ||
| 285 | + Text( | ||
| 286 | + '人数:', | ||
| 287 | + style: TextStyle( | ||
| 288 | + fontSize: ScreenUtil().setSp(24), | ||
| 289 | + color: MyColours.color_353535), | ||
| 290 | + ), | ||
| 291 | + Text( | ||
| 292 | + '未记录', | ||
| 293 | + style: TextStyle( | ||
| 294 | + fontSize: ScreenUtil().setSp(24), | ||
| 295 | + color: MyColours.color_353535), | ||
| 296 | + ), | ||
| 297 | + HEmptyView(20), | ||
| 298 | + Text( | ||
| 299 | + '消费:', | ||
| 300 | + style: TextStyle( | ||
| 301 | + fontSize: ScreenUtil().setSp(24), | ||
| 302 | + color: MyColours.color_353535), | ||
| 303 | + ), | ||
| 304 | + Text( | ||
| 305 | + '未记录', | ||
| 306 | + style: TextStyle( | ||
| 307 | + fontSize: ScreenUtil().setSp(24), | ||
| 308 | + color: MyColours.color_353535), | ||
| 309 | + ), | ||
| 310 | + ], | ||
| 311 | + ), | ||
| 312 | + VEmptyView(20), | ||
| 313 | + Text( | ||
| 314 | + '客户经理:xxx 18739837273', | ||
| 315 | + style: TextStyle( | ||
| 316 | + fontSize: ScreenUtil().setSp(24), | ||
| 317 | + color: MyColours.color_353535), | ||
| 318 | + ), | ||
| 319 | + VEmptyView(40), | ||
| 320 | + ], | ||
| 321 | + ) | ||
| 322 | + ], | ||
| 323 | + ); | ||
| 324 | + }, | ||
| 325 | + )) | ||
| 326 | + ], | ||
| 327 | + ))); | ||
| 328 | + } | ||
| 329 | +} |
| @@ -585,4 +585,13 @@ class NavigatorUtil { | @@ -585,4 +585,13 @@ class NavigatorUtil { | ||
| 585 | return _navigateTo(context, "${Routes.festival_edit_page}", | 585 | return _navigateTo(context, "${Routes.festival_edit_page}", |
| 586 | replace: replace); | 586 | replace: replace); |
| 587 | } | 587 | } |
| 588 | + | ||
| 589 | + ///客户订单 | ||
| 590 | + static Future<dynamic> goCustomerOrderPage( | ||
| 591 | + BuildContext context, { | ||
| 592 | + replace = false, | ||
| 593 | + }) { | ||
| 594 | + return _navigateTo(context, "${Routes.customer_order_page}", | ||
| 595 | + replace: replace); | ||
| 596 | + } | ||
| 588 | } | 597 | } |
| @@ -43,6 +43,7 @@ import 'package:one_key/pages/message/message_order_menu.dart'; | @@ -43,6 +43,7 @@ import 'package:one_key/pages/message/message_order_menu.dart'; | ||
| 43 | import 'package:one_key/pages/my/customer_type/customer_detail_edit_page.dart'; | 43 | import 'package:one_key/pages/my/customer_type/customer_detail_edit_page.dart'; |
| 44 | import 'package:one_key/pages/my/customer_type/customer_detail_page.dart'; | 44 | import 'package:one_key/pages/my/customer_type/customer_detail_page.dart'; |
| 45 | import 'package:one_key/pages/my/customer_type/customer_list_page.dart'; | 45 | import 'package:one_key/pages/my/customer_type/customer_list_page.dart'; |
| 46 | +import 'package:one_key/pages/my/customer_type/customer_order_page.dart'; | ||
| 46 | import 'package:one_key/pages/my/customer_type/customer_setting_page.dart'; | 47 | import 'package:one_key/pages/my/customer_type/customer_setting_page.dart'; |
| 47 | import 'package:one_key/pages/my/customer_type/festival_edit_page.dart'; | 48 | import 'package:one_key/pages/my/customer_type/festival_edit_page.dart'; |
| 48 | import 'package:one_key/pages/my/customer_type/make_marking_page.dart'; | 49 | import 'package:one_key/pages/my/customer_type/make_marking_page.dart'; |
| @@ -911,4 +912,13 @@ var festivalEditPageHandle = new Handler( | @@ -911,4 +912,13 @@ var festivalEditPageHandle = new Handler( | ||
| 911 | create: (_) => CustomerProvider(), child: FestivalEditPage()); | 912 | create: (_) => CustomerProvider(), child: FestivalEditPage()); |
| 912 | }); | 913 | }); |
| 913 | 914 | ||
| 914 | - | 915 | +///客户订单 |
| 916 | +var customerOrderPageHandle = new Handler( | ||
| 917 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 918 | + // String idstr = params["idstr"].first; | ||
| 919 | + // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode( | ||
| 920 | + // FluroConvertUtils.fluroCnParamsDecode( | ||
| 921 | + // params["userHistoryEntity"].first))); | ||
| 922 | + return ChangeNotifierProvider<CustomerProvider>( | ||
| 923 | + create: (_) => CustomerProvider(), child: CustomerOrderPage()); | ||
| 924 | +}); |
| @@ -80,6 +80,9 @@ class Routes { | @@ -80,6 +80,9 @@ class Routes { | ||
| 80 | 80 | ||
| 81 | static String festival_edit_page = | 81 | static String festival_edit_page = |
| 82 | "/festival_edit_page"; //编辑纪念日 | 82 | "/festival_edit_page"; //编辑纪念日 |
| 83 | + static String customer_order_page = | ||
| 84 | + "/customer_order_page"; //客户订单 | ||
| 85 | + | ||
| 83 | 86 | ||
| 84 | 87 | ||
| 85 | static void configureRoutes(FluroRouter router) { | 88 | static void configureRoutes(FluroRouter router) { |
| @@ -168,6 +171,10 @@ class Routes { | @@ -168,6 +171,10 @@ class Routes { | ||
| 168 | handler: customerDetailEditPageHandle); | 171 | handler: customerDetailEditPageHandle); |
| 169 | router.define(festival_edit_page, | 172 | router.define(festival_edit_page, |
| 170 | handler: festivalEditPageHandle); | 173 | handler: festivalEditPageHandle); |
| 174 | + router.define(customer_order_page, | ||
| 175 | + handler: customerOrderPageHandle); | ||
| 176 | + | ||
| 177 | + | ||
| 171 | 178 | ||
| 172 | } | 179 | } |
| 173 | } | 180 | } |
| @@ -2348,6 +2348,7 @@ class DialogUtil { | @@ -2348,6 +2348,7 @@ class DialogUtil { | ||
| 2348 | String yearStr = '选填'; | 2348 | String yearStr = '选填'; |
| 2349 | String monthStr = ''; | 2349 | String monthStr = ''; |
| 2350 | String dayStr = ''; | 2350 | String dayStr = ''; |
| 2351 | + bool gongli = true; | ||
| 2351 | final action = await showDialog( | 2352 | final action = await showDialog( |
| 2352 | context: context, | 2353 | context: context, |
| 2353 | barrierDismissible: true, | 2354 | barrierDismissible: true, |
| @@ -2468,36 +2469,86 @@ class DialogUtil { | @@ -2468,36 +2469,86 @@ class DialogUtil { | ||
| 2468 | Row( | 2469 | Row( |
| 2469 | children: [ | 2470 | children: [ |
| 2470 | InkWell( | 2471 | InkWell( |
| 2472 | + onTap: () { | ||
| 2473 | + if (gongli) { | ||
| 2474 | + return; | ||
| 2475 | + } | ||
| 2476 | + stateSetter(() { | ||
| 2477 | + gongli = !gongli; | ||
| 2478 | + }); | ||
| 2479 | + if (dayStr != '') { | ||
| 2480 | + List dayList = updateDay( | ||
| 2481 | + gongli, | ||
| 2482 | + yearStr == '选填' | ||
| 2483 | + ? DateTime.now() | ||
| 2484 | + .year | ||
| 2485 | + .toString() | ||
| 2486 | + : yearStr, | ||
| 2487 | + monthStr == '' | ||
| 2488 | + ? DateTime.now() | ||
| 2489 | + .month | ||
| 2490 | + .toString() | ||
| 2491 | + : monthStr); | ||
| 2492 | + if (!dayList.contains(dayStr)) { | ||
| 2493 | + stateSetter(() { | ||
| 2494 | + dayStr = ''; | ||
| 2495 | + }); | ||
| 2496 | + } | ||
| 2497 | + } | ||
| 2498 | + }, | ||
| 2471 | child: Container( | 2499 | child: Container( |
| 2472 | - padding: EdgeInsets.symmetric( | ||
| 2473 | - horizontal: ScreenUtil().setWidth(5), | ||
| 2474 | - vertical: ScreenUtil().setWidth(6)), | ||
| 2475 | - decoration: BoxDecoration( | ||
| 2476 | - color: true | ||
| 2477 | - ? MyColours.color_199095 | ||
| 2478 | - : MyColours.color_ffffff, | ||
| 2479 | - borderRadius: BorderRadius.only( | ||
| 2480 | - topLeft: Radius.circular( | ||
| 2481 | - ScreenUtil().setWidth(10)), | ||
| 2482 | - bottomLeft: Radius.circular( | ||
| 2483 | - ScreenUtil().setWidth(10))), | ||
| 2484 | - border: Border.all( | ||
| 2485 | - color: MyColours.color_199095, | ||
| 2486 | - width: ScreenUtil().setWidth(2))), | ||
| 2487 | - child: Text('公历', | ||
| 2488 | - style: TextStyle( | ||
| 2489 | - fontSize: ScreenUtil().setSp(28), | ||
| 2490 | - color: true | ||
| 2491 | - ? MyColours.color_ffffff | ||
| 2492 | - : MyColours.color_333333)), | ||
| 2493 | - )), | 2500 | + padding: EdgeInsets.symmetric( |
| 2501 | + horizontal: ScreenUtil().setWidth(5), | ||
| 2502 | + vertical: ScreenUtil().setWidth(6)), | ||
| 2503 | + decoration: BoxDecoration( | ||
| 2504 | + color: gongli | ||
| 2505 | + ? MyColours.color_199095 | ||
| 2506 | + : MyColours.color_ffffff, | ||
| 2507 | + borderRadius: BorderRadius.only( | ||
| 2508 | + topLeft: Radius.circular( | ||
| 2509 | + ScreenUtil().setWidth(10)), | ||
| 2510 | + bottomLeft: Radius.circular( | ||
| 2511 | + ScreenUtil().setWidth(10))), | ||
| 2512 | + border: Border.all( | ||
| 2513 | + color: MyColours.color_199095, | ||
| 2514 | + width: ScreenUtil().setWidth(2))), | ||
| 2515 | + child: Text('公历', | ||
| 2516 | + style: TextStyle( | ||
| 2517 | + fontSize: ScreenUtil().setSp(28), | ||
| 2518 | + color: gongli | ||
| 2519 | + ? MyColours.color_ffffff | ||
| 2520 | + : MyColours.color_333333)), | ||
| 2521 | + )), | ||
| 2494 | InkWell( | 2522 | InkWell( |
| 2523 | + onTap: () { | ||
| 2524 | + if (!gongli) { | ||
| 2525 | + return; | ||
| 2526 | + } | ||
| 2527 | + stateSetter(() { | ||
| 2528 | + gongli = !gongli; | ||
| 2529 | + }); | ||
| 2530 | + if (dayStr != '') { | ||
| 2531 | + List dayList = updateDay( | ||
| 2532 | + gongli, | ||
| 2533 | + yearStr == '选填' | ||
| 2534 | + ? DateTime.now().year.toString() | ||
| 2535 | + : yearStr, | ||
| 2536 | + monthStr == '' | ||
| 2537 | + ? DateTime.now().month.toString() | ||
| 2538 | + : monthStr); | ||
| 2539 | + if (!dayList.contains(dayStr)) { | ||
| 2540 | + stateSetter(() { | ||
| 2541 | + dayStr = ''; | ||
| 2542 | + }); | ||
| 2543 | + } | ||
| 2544 | + } | ||
| 2545 | + }, | ||
| 2495 | child: Container( | 2546 | child: Container( |
| 2496 | padding: EdgeInsets.symmetric( | 2547 | padding: EdgeInsets.symmetric( |
| 2497 | horizontal: ScreenUtil().setWidth(5), | 2548 | horizontal: ScreenUtil().setWidth(5), |
| 2498 | vertical: ScreenUtil().setWidth(6)), | 2549 | vertical: ScreenUtil().setWidth(6)), |
| 2499 | decoration: BoxDecoration( | 2550 | decoration: BoxDecoration( |
| 2500 | - color: false | 2551 | + color: !gongli |
| 2501 | ? MyColours.color_199095 | 2552 | ? MyColours.color_199095 |
| 2502 | : MyColours.color_ffffff, | 2553 | : MyColours.color_ffffff, |
| 2503 | borderRadius: BorderRadius.only( | 2554 | borderRadius: BorderRadius.only( |
| @@ -2511,7 +2562,7 @@ class DialogUtil { | @@ -2511,7 +2562,7 @@ class DialogUtil { | ||
| 2511 | child: Text('农历', | 2562 | child: Text('农历', |
| 2512 | style: TextStyle( | 2563 | style: TextStyle( |
| 2513 | fontSize: ScreenUtil().setSp(28), | 2564 | fontSize: ScreenUtil().setSp(28), |
| 2514 | - color: false | 2565 | + color: !gongli |
| 2515 | ? MyColours.color_ffffff | 2566 | ? MyColours.color_ffffff |
| 2516 | : MyColours.color_333333))), | 2567 | : MyColours.color_333333))), |
| 2517 | ), | 2568 | ), |
| @@ -2520,7 +2571,7 @@ class DialogUtil { | @@ -2520,7 +2571,7 @@ class DialogUtil { | ||
| 2520 | onTap: () { | 2571 | onTap: () { |
| 2521 | incrementCounterYear( | 2572 | incrementCounterYear( |
| 2522 | context, | 2573 | context, |
| 2523 | - true, | 2574 | + gongli, |
| 2524 | yearStr == '选填' | 2575 | yearStr == '选填' |
| 2525 | ? DateTime.now().year.toString() | 2576 | ? DateTime.now().year.toString() |
| 2526 | : yearStr, (year) { | 2577 | : yearStr, (year) { |
| @@ -2572,7 +2623,7 @@ class DialogUtil { | @@ -2572,7 +2623,7 @@ class DialogUtil { | ||
| 2572 | onTap: () { | 2623 | onTap: () { |
| 2573 | incrementCounterMonth( | 2624 | incrementCounterMonth( |
| 2574 | context, | 2625 | context, |
| 2575 | - true, | 2626 | + gongli, |
| 2576 | yearStr == '选填' | 2627 | yearStr == '选填' |
| 2577 | ? DateTime.now().year.toString() | 2628 | ? DateTime.now().year.toString() |
| 2578 | : yearStr, | 2629 | : yearStr, |
| @@ -2585,7 +2636,7 @@ class DialogUtil { | @@ -2585,7 +2636,7 @@ class DialogUtil { | ||
| 2585 | }); | 2636 | }); |
| 2586 | if (dayStr != '') { | 2637 | if (dayStr != '') { |
| 2587 | List dayList = updateDay( | 2638 | List dayList = updateDay( |
| 2588 | - true, | 2639 | + gongli, |
| 2589 | yearStr == '选填' | 2640 | yearStr == '选填' |
| 2590 | ? DateTime.now() | 2641 | ? DateTime.now() |
| 2591 | .year | 2642 | .year |
| @@ -2646,7 +2697,7 @@ class DialogUtil { | @@ -2646,7 +2697,7 @@ class DialogUtil { | ||
| 2646 | onTap: () { | 2697 | onTap: () { |
| 2647 | incrementCounterDay( | 2698 | incrementCounterDay( |
| 2648 | context, | 2699 | context, |
| 2649 | - true, | 2700 | + gongli, |
| 2650 | yearStr == '选填' | 2701 | yearStr == '选填' |
| 2651 | ? DateTime.now().year.toString() | 2702 | ? DateTime.now().year.toString() |
| 2652 | : yearStr, | 2703 | : yearStr, |
| @@ -111,7 +111,7 @@ class _PickBodyDayState extends State<PickBodyDay> { | @@ -111,7 +111,7 @@ class _PickBodyDayState extends State<PickBodyDay> { | ||
| 111 | dayController = | 111 | dayController = |
| 112 | new FixedExtentScrollController(initialItem: int.parse(widget.day) - 1); | 112 | new FixedExtentScrollController(initialItem: int.parse(widget.day) - 1); |
| 113 | sDay = widget.day; | 113 | sDay = widget.day; |
| 114 | - DateTime today = DateTime.now(); | 114 | + // DateTime today = DateTime.now(); |
| 115 | 115 | ||
| 116 | // 请空之前的数据 | 116 | // 请空之前的数据 |
| 117 | 117 | ||
| @@ -377,7 +377,6 @@ class _PickBodyDayState extends State<PickBodyDay> { | @@ -377,7 +377,6 @@ class _PickBodyDayState extends State<PickBodyDay> { | ||
| 377 | ]))); | 377 | ]))); |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | - | ||
| 381 | List<Widget> XZItem(_data, type) { | 380 | List<Widget> XZItem(_data, type) { |
| 382 | List<Widget> list = new List(); | 381 | List<Widget> list = new List(); |
| 383 | 382 |
| @@ -28,28 +28,29 @@ List updateDay(bool gongli, String year, String month) { | @@ -28,28 +28,29 @@ List updateDay(bool gongli, String year, String month) { | ||
| 28 | } | 28 | } |
| 29 | return yday; | 29 | return yday; |
| 30 | } else { | 30 | } else { |
| 31 | - int count1 = getYangliDay(int.parse(year), int.parse(month)); | 31 | + int count = getNongliDay(int.parse(year), int.parse(month)); |
| 32 | 32 | ||
| 33 | - print('count---$count1'); | 33 | + print('农历天数count---$count'); |
| 34 | 34 | ||
| 35 | List yday = []; | 35 | List yday = []; |
| 36 | 36 | ||
| 37 | - for (int m = 1; m < count1 + 1; m++) { | 37 | + for (int m = 1; m < count + 1; m++) { |
| 38 | yday.add('$m'); | 38 | yday.add('$m'); |
| 39 | } | 39 | } |
| 40 | - int count = getNongliDay(int.parse(year), int.parse(month)); | ||
| 41 | 40 | ||
| 42 | - print('农历的天数==${count}'); | 41 | + // int count = getNongliDay(int.parse(year), int.parse(month)); |
| 43 | 42 | ||
| 44 | - List old = yday; | 43 | + // print('农历的天数==${count}'); |
| 45 | 44 | ||
| 46 | - List newDay = old.sublist(0, count); | 45 | + // List old = yday; |
| 47 | 46 | ||
| 48 | - print(old); | 47 | + // List newDay = old.sublist(0, count); |
| 49 | 48 | ||
| 50 | - print(newDay); | 49 | + // print(old); |
| 51 | 50 | ||
| 52 | - yday = newDay; | 51 | + // print(newDay); |
| 52 | + | ||
| 53 | + // yday = newDay; | ||
| 53 | return yday; | 54 | return yday; |
| 54 | } | 55 | } |
| 55 | } | 56 | } |
| @@ -117,8 +118,8 @@ class _PickBodyMonthState extends State<PickBodyMonth> { | @@ -117,8 +118,8 @@ class _PickBodyMonthState extends State<PickBodyMonth> { | ||
| 117 | // 获取当天的日期,年份默认选择的是2000年,月份默认是6月,日期默认是15日,时间默认是不详 | 118 | // 获取当天的日期,年份默认选择的是2000年,月份默认是6月,日期默认是15日,时间默认是不详 |
| 118 | monthController = new FixedExtentScrollController( | 119 | monthController = new FixedExtentScrollController( |
| 119 | initialItem: int.parse(widget.month) - 1); | 120 | initialItem: int.parse(widget.month) - 1); |
| 120 | - DateTime today = DateTime.now(); | ||
| 121 | - | 121 | + // DateTime today = DateTime.now(); |
| 122 | + sMonth = widget.month; | ||
| 122 | // 请空之前的数据 | 123 | // 请空之前的数据 |
| 123 | 124 | ||
| 124 | yMonth = []; | 125 | yMonth = []; |
-
Please register or login to post a comment