Commit b68e17971dcc19b4b69820124ab277ad05dd9c1c

Authored by wdn127929
1 parent 18dc71fb

uiui

@@ -388,7 +388,9 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -388,7 +388,9 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
388 height: ScreenUtil().setWidth(50), 388 height: ScreenUtil().setWidth(50),
389 fontSize: 26, 389 fontSize: 26,
390 isBold: false, 390 isBold: false,
391 - onPressed: () {}, 391 + onPressed: () {
  392 + NavigatorUtil.goFestivalEditPage(context);
  393 + },
392 ), 394 ),
393 ], 395 ],
394 ), 396 ),
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/res/colors.dart';
  4 +import 'package:one_key/utils/dialog_util.dart';
  5 +import 'package:one_key/utils/utils.dart';
  6 +import 'package:one_key/widgets/h_empty_view.dart';
  7 +import 'package:one_key/widgets/round_button.dart';
  8 +import 'package:one_key/widgets/system_app_bar.dart';
  9 +import 'package:one_key/widgets/v_empty_view.dart';
  10 +
  11 +class FestivalEditPage extends StatefulWidget {
  12 + FestivalEditPage({Key key}) : super(key: key);
  13 +
  14 + @override
  15 + _FestivalEditPageState createState() => _FestivalEditPageState();
  16 +}
  17 +
  18 +class _FestivalEditPageState extends State<FestivalEditPage> {
  19 + @override
  20 + Widget build(BuildContext context) {
  21 + return Scaffold(
  22 + backgroundColor: MyColours.color_ffffff,
  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(children: [
  34 + Expanded(
  35 + child: ListView.builder(
  36 + shrinkWrap: true,
  37 + itemCount: 10,
  38 + itemBuilder: (BuildContext context, int index) {
  39 + return InkWell(
  40 + onTap: () {
  41 + DialogUtil.festivalAlertDialog(context, 'ggg', 700,
  42 + rCallback: (name) {
  43 + // _addCookbookClass(name, showLoading: true);
  44 + });
  45 + },
  46 + child: Padding(
  47 + padding: EdgeInsets.symmetric(
  48 + horizontal: ScreenUtil().setWidth(20),
  49 + vertical: ScreenUtil().setWidth(20)),
  50 + child: Row(
  51 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  52 + children: [
  53 + Expanded(
  54 + child: Text(
  55 + '本人生日:12月18日(公历)',
  56 + overflow: TextOverflow.ellipsis,
  57 + style: TextStyle(
  58 + fontSize: ScreenUtil().setSp(26),
  59 + color: MyColours.color_333333),
  60 + )),
  61 + HEmptyView(10),
  62 + Image.asset(
  63 + Utils.getImgPath('c_edit'),
  64 + width: ScreenUtil().setWidth(40),
  65 + // height: ScreenUtil().setWidth(10),
  66 + )
  67 + ],
  68 + ),
  69 + ));
  70 + },
  71 + )),
  72 + RoundButton(
  73 + text: '新增',
  74 + radius: ScreenUtil().setWidth(10),
  75 + margin:
  76 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(90)),
  77 + height: ScreenUtil().setWidth(80),
  78 + fontSize: 26,
  79 + isBold: false,
  80 + onPressed: () {},
  81 + ),
  82 + VEmptyView(30)
  83 + ])));
  84 + }
  85 +}
@@ -575,4 +575,13 @@ class NavigatorUtil { @@ -575,4 +575,13 @@ class NavigatorUtil {
575 return _navigateTo(context, "${Routes.customer_edit_detail_page}", 575 return _navigateTo(context, "${Routes.customer_edit_detail_page}",
576 replace: replace); 576 replace: replace);
577 } 577 }
  578 +
  579 + ///纪念日
  580 + static Future<dynamic> goFestivalEditPage(
  581 + BuildContext context, {
  582 + replace = false,
  583 + }) {
  584 + return _navigateTo(context, "${Routes.festival_edit_page}",
  585 + replace: replace);
  586 + }
578 } 587 }
@@ -44,6 +44,7 @@ import 'package:one_key/pages/my/customer_type/customer_detail_edit_page.dart'; @@ -44,6 +44,7 @@ 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_setting_page.dart'; 46 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';
47 import 'package:one_key/pages/my/customer_type/make_marking_page.dart'; 48 import 'package:one_key/pages/my/customer_type/make_marking_page.dart';
48 import 'package:one_key/pages/my/customer_type/marketing_records_detail_page.dart'; 49 import 'package:one_key/pages/my/customer_type/marketing_records_detail_page.dart';
49 import 'package:one_key/pages/my/customer_type/marketing_records_page.dart'; 50 import 'package:one_key/pages/my/customer_type/marketing_records_page.dart';
@@ -897,3 +898,16 @@ var customerDetailEditPageHandle = new Handler( @@ -897,3 +898,16 @@ var customerDetailEditPageHandle = new Handler(
897 return ChangeNotifierProvider<CustomerProvider>( 898 return ChangeNotifierProvider<CustomerProvider>(
898 create: (_) => CustomerProvider(), child: CustomerDetailEditPage()); 899 create: (_) => CustomerProvider(), child: CustomerDetailEditPage());
899 }); 900 });
  901 +
  902 +///纪念日
  903 +var festivalEditPageHandle = new Handler(
  904 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  905 + // String idstr = params["idstr"].first;
  906 + // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
  907 + // FluroConvertUtils.fluroCnParamsDecode(
  908 + // params["userHistoryEntity"].first)));
  909 + return ChangeNotifierProvider<CustomerProvider>(
  910 + create: (_) => CustomerProvider(), child: FestivalEditPage());
  911 +});
  912 +
  913 +
@@ -78,6 +78,10 @@ class Routes { @@ -78,6 +78,10 @@ class Routes {
78 static String customer_edit_detail_page = 78 static String customer_edit_detail_page =
79 "/customer_edit_detail_page"; //编辑客户详情 79 "/customer_edit_detail_page"; //编辑客户详情
80 80
  81 + static String festival_edit_page =
  82 + "/festival_edit_page"; //编辑纪念日
  83 +
  84 +
81 static void configureRoutes(FluroRouter router) { 85 static void configureRoutes(FluroRouter router) {
82 router.notFoundHandler = new Handler( 86 router.notFoundHandler = new Handler(
83 handlerFunc: (BuildContext context, Map<String, List<String>> params) { 87 handlerFunc: (BuildContext context, Map<String, List<String>> params) {
@@ -160,7 +164,10 @@ class Routes { @@ -160,7 +164,10 @@ class Routes {
160 handler: marketingRecordsDetailPageHandle); 164 handler: marketingRecordsDetailPageHandle);
161 router.define(make_marketing_page, handler: makeMarkingPageHandle); 165 router.define(make_marketing_page, handler: makeMarkingPageHandle);
162 router.define(customer_detail_page, handler: customerDetailPageHandle); 166 router.define(customer_detail_page, handler: customerDetailPageHandle);
163 - router.define(customer_edit_detail_page, handler: customerDetailEditPageHandle);  
164 - 167 + router.define(customer_edit_detail_page,
  168 + handler: customerDetailEditPageHandle);
  169 + router.define(festival_edit_page,
  170 + handler: festivalEditPageHandle);
  171 +
165 } 172 }
166 } 173 }
@@ -1304,7 +1304,7 @@ class DialogUtil { @@ -1304,7 +1304,7 @@ class DialogUtil {
1304 color: MyColours.color_ffffff, 1304 color: MyColours.color_ffffff,
1305 child: Column( 1305 child: Column(
1306 children: <Widget>[ 1306 children: <Widget>[
1307 - TableCalendar( 1307 + TableCalendar(
1308 // rowHeight: ScreenUtil().setWidth(100), 1308 // rowHeight: ScreenUtil().setWidth(100),
1309 calendarController: _calendarController, 1309 calendarController: _calendarController,
1310 initialSelectedDay: selectDateTime, 1310 initialSelectedDay: selectDateTime,
@@ -1536,10 +1536,10 @@ class DialogUtil { @@ -1536,10 +1536,10 @@ class DialogUtil {
1536 // bottom: 0, 1536 // bottom: 0,
1537 // top: ScreenUtil().setWidth(30), 1537 // top: ScreenUtil().setWidth(30),
1538 // child: buildMarker(date)), 1538 // child: buildMarker(date)),
1539 - // Align(  
1540 - // alignment: Alignment.bottomCenter,  
1541 - // child: buildMarker(date),  
1542 - // ) 1539 + // Align(
  1540 + // alignment: Alignment.bottomCenter,
  1541 + // child: buildMarker(date),
  1542 + // )
1543 // ); 1543 // );
1544 // } 1544 // }
1545 1545
@@ -2339,6 +2339,330 @@ class DialogUtil { @@ -2339,6 +2339,330 @@ class DialogUtil {
2339 ); 2339 );
2340 } 2340 }
2341 2341
  2342 + static Future festivalAlertDialog(
  2343 + BuildContext context, String name, double height,
  2344 + {CustomCallBack rCallback, double fontSize = 28}) async {
  2345 + final action = await showDialog(
  2346 + context: context,
  2347 + barrierDismissible: true,
  2348 + builder: (BuildContext context) {
  2349 + TextEditingController controller = TextEditingController();
  2350 + controller.text = name;
  2351 + return Scaffold(
  2352 + backgroundColor: Colors.transparent,
  2353 + body: Center(
  2354 + child: Container(
  2355 + padding:
  2356 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)),
  2357 + height: ScreenUtil().setWidth(height),
  2358 + decoration: BoxDecoration(
  2359 + borderRadius:
  2360 + BorderRadius.circular(ScreenUtil().setWidth(30))),
  2361 + child: Card(
  2362 + shape: RoundedRectangleBorder(
  2363 + borderRadius: BorderRadius.all(
  2364 + Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角
  2365 + child: Padding(
  2366 + padding: EdgeInsets.symmetric(
  2367 + horizontal: ScreenUtil().setWidth(40)),
  2368 + child: Column(
  2369 + children: [
  2370 + // VEmptyView(60),
  2371 + Stack(children: [
  2372 + Container(
  2373 + padding: EdgeInsets.only(
  2374 + top: ScreenUtil().setWidth(60),
  2375 + bottom: ScreenUtil().setWidth(50)),
  2376 + // color: Colors.red,
  2377 + alignment: Alignment.center,
  2378 + child: Text('纪念日名称',
  2379 + style: TextStyle(
  2380 + fontSize: ScreenUtil().setSp(fontSize),
  2381 + color: MyColours.color_353535)),
  2382 + ),
  2383 + Positioned(
  2384 + right: 0,
  2385 + top: ScreenUtil().setWidth(36),
  2386 + child: Text('删除',
  2387 + style: TextStyle(
  2388 + decoration: TextDecoration.underline,
  2389 + fontSize: ScreenUtil().setSp(26),
  2390 + color: MyColours.color_199095)))
  2391 + ]),
  2392 +
  2393 + Container(
  2394 + height: ScreenUtil().setWidth(40),
  2395 + // color: Colors.red,
  2396 + padding: EdgeInsets.symmetric(
  2397 + horizontal: ScreenUtil().setWidth(68)),
  2398 + alignment: Alignment.center,
  2399 + child: Material(
  2400 + color: Colors.transparent,
  2401 + child: TextField(
  2402 + controller: controller,
  2403 + maxLines: 1,
  2404 +
  2405 + // //光标颜色
  2406 + // cursorColor:
  2407 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  2408 + // //输入文本的样式
  2409 + // inputFormatters: lenghtLimit
  2410 + // ? [
  2411 + // LengthLimitingTextInputFormatter(10),
  2412 + // ]
  2413 + // : [],
  2414 + textAlignVertical:
  2415 + TextAlignVertical.bottom,
  2416 + textAlign: TextAlign.center,
  2417 + style: TextStyle(
  2418 + fontSize: ScreenUtil().setSp(26),
  2419 + ),
  2420 + decoration: InputDecoration(
  2421 + border: OutlineInputBorder(
  2422 + borderSide: BorderSide.none),
  2423 + hintText: '例:本人生日',
  2424 + hintStyle: TextStyle(
  2425 + color: MyColours.color_999999,
  2426 + fontSize: ScreenUtil().setSp(26),
  2427 + ),
  2428 + enabledBorder: new UnderlineInputBorder(
  2429 + borderSide: BorderSide.none,
  2430 + ),
  2431 + focusedBorder: new UnderlineInputBorder(
  2432 + borderSide: BorderSide.none,
  2433 + ),
  2434 + ),
  2435 + onChanged: (value) {
  2436 + name = value;
  2437 + },
  2438 + onEditingComplete: () {
  2439 + FocusScope.of(context).requestFocus(
  2440 + FocusNode()); //点击空白处隐藏键盘
  2441 + },
  2442 + keyboardType: TextInputType.text))),
  2443 + // VEmptyView(28),
  2444 + MyDivider(ScreenUtil().setWidth(280 * 2),
  2445 + ScreenUtil().setWidth(2),
  2446 + color: MyColours.color_efefef),
  2447 + Container(
  2448 + padding: EdgeInsets.only(
  2449 + top: ScreenUtil().setWidth(40),
  2450 + bottom: ScreenUtil().setWidth(50)),
  2451 + // color: Colors.red,
  2452 + alignment: Alignment.center,
  2453 + child: Text('纪念日日期',
  2454 + style: TextStyle(
  2455 + fontSize: ScreenUtil().setSp(fontSize),
  2456 + color: MyColours.color_353535)),
  2457 + ),
  2458 + Row(
  2459 + children: [
  2460 + InkWell(
  2461 + child: Container(
  2462 + padding: EdgeInsets.symmetric(
  2463 + horizontal: ScreenUtil().setWidth(10),
  2464 + vertical: ScreenUtil().setWidth(10)),
  2465 + decoration: BoxDecoration(
  2466 + color: true
  2467 + ? MyColours.color_199095
  2468 + : MyColours.color_ffffff,
  2469 + borderRadius: BorderRadius.only(
  2470 + topLeft: Radius.circular(
  2471 + ScreenUtil().setWidth(10)),
  2472 + bottomLeft: Radius.circular(
  2473 + ScreenUtil().setWidth(10))),
  2474 + border: Border.all(
  2475 + color: MyColours.color_199095,
  2476 + width: ScreenUtil().setWidth(2))),
  2477 + child: Text('公历',
  2478 + style: TextStyle(
  2479 + fontSize: ScreenUtil().setSp(28),
  2480 + color: true
  2481 + ? MyColours.color_ffffff
  2482 + : MyColours.color_333333)),
  2483 + )),
  2484 + InkWell(
  2485 + child: Container(
  2486 + padding: EdgeInsets.symmetric(
  2487 + horizontal: ScreenUtil().setWidth(10),
  2488 + vertical: ScreenUtil().setWidth(10)),
  2489 + decoration: BoxDecoration(
  2490 + color: false
  2491 + ? MyColours.color_199095
  2492 + : MyColours.color_ffffff,
  2493 + borderRadius: BorderRadius.only(
  2494 + topRight: Radius.circular(
  2495 + ScreenUtil().setWidth(10)),
  2496 + bottomRight: Radius.circular(
  2497 + ScreenUtil().setWidth(10))),
  2498 + border: Border.all(
  2499 + color: MyColours.color_199095,
  2500 + width: ScreenUtil().setWidth(2))),
  2501 + child: Text('农历',
  2502 + style: TextStyle(
  2503 + fontSize: ScreenUtil().setSp(28),
  2504 + color: false
  2505 + ? MyColours.color_ffffff
  2506 + : MyColours.color_333333))),
  2507 + ),
  2508 + ],
  2509 + ),
  2510 + Row(
  2511 + children: [
  2512 + InkWell(
  2513 + child: Container(
  2514 + height: ScreenUtil().setWidth(47 * 2),
  2515 + alignment: Alignment.center,
  2516 + child: Text(
  2517 + '取消',
  2518 + style: TextStyle(
  2519 + color: MyColours.color_199095,
  2520 + fontSize: ScreenUtil().setWidth(34)),
  2521 + ),
  2522 + ),
  2523 + onTap: () {
  2524 + Navigator.of(context).pop();
  2525 + },
  2526 + ),
  2527 + InkWell(
  2528 + child: Container(
  2529 + height: ScreenUtil().setWidth(47 * 2),
  2530 + alignment: Alignment.center,
  2531 + child: Text(
  2532 + '保存',
  2533 + style: TextStyle(
  2534 + color: MyColours.color_199095,
  2535 + fontSize: ScreenUtil().setWidth(34)),
  2536 + ),
  2537 + ),
  2538 + onTap: () {
  2539 + if (name == '' || name.trim().length == 0) {
  2540 + Utils.showToast('请输入纪念日名称');
  2541 + return;
  2542 + }
  2543 + Navigator.of(context).pop();
  2544 + rCallback(name);
  2545 + },
  2546 + )
  2547 + ],
  2548 + )
  2549 + ],
  2550 + )),
  2551 + ),
  2552 + ),
  2553 + ));
  2554 + },
  2555 + );
  2556 + }
  2557 +
  2558 + // static Future festivalAlertDialog(BuildContext context,
  2559 + // {String title = "标题",
  2560 + // String text = "内容",
  2561 + // String hintText = "内容",
  2562 + // String lTitle = "取消",
  2563 + // String rTitle = "确定",
  2564 + // String toast = '请输入',
  2565 + // VoidCallback lCallback,
  2566 + // bool lenghtLimit = false,
  2567 + // TextInputType keyboardType = TextInputType.text,
  2568 + // CustomCallBack rCallback}) {
  2569 + // String name = text;
  2570 + // TextEditingController controller = TextEditingController();
  2571 + // controller.text = text;
  2572 + // showCupertinoDialog(
  2573 + // context: context,
  2574 + // builder: (context) {
  2575 + // return Stack(children: [
  2576 + // CupertinoAlertDialog(
  2577 + // title: title != ''
  2578 + // ? Text(title,
  2579 + // style: TextStyle(
  2580 + // fontWeight: FontWeight.bold,
  2581 + // fontSize: ScreenUtil().setSp(30),
  2582 + // ))
  2583 + // : SizedBox(),
  2584 + // content: Material(
  2585 + // color: Colors.transparent,
  2586 + // child: TextField(
  2587 + // controller: controller,
  2588 + // maxLines: 1,
  2589 + // autofocus: true,
  2590 + // // //光标颜色
  2591 + // // cursorColor:
  2592 + // // widget.isSelect ? Colors.white : MyColours.color_199095,
  2593 + // //输入文本的样式
  2594 + // inputFormatters: lenghtLimit
  2595 + // ? [
  2596 + // LengthLimitingTextInputFormatter(10),
  2597 + // ]
  2598 + // : [],
  2599 + // textAlignVertical: TextAlignVertical.bottom,
  2600 + // textAlign: TextAlign.center,
  2601 + // style: TextStyle(
  2602 + // fontSize: ScreenUtil().setSp(28),
  2603 + // ),
  2604 + // decoration: InputDecoration(
  2605 + // border: OutlineInputBorder(borderSide: BorderSide.none),
  2606 + // hintText: hintText,
  2607 + // hintStyle: TextStyle(
  2608 + // color: MyColours.color_999999,
  2609 + // fontSize: ScreenUtil().setSp(28),
  2610 + // ),
  2611 + // enabledBorder: new UnderlineInputBorder(
  2612 + // borderSide: BorderSide.none,
  2613 + // ),
  2614 + // focusedBorder: new UnderlineInputBorder(
  2615 + // borderSide: BorderSide.none,
  2616 + // ),
  2617 + // ),
  2618 + // onChanged: (value) {
  2619 + // name = value;
  2620 + // },
  2621 + // onEditingComplete: () {
  2622 + // FocusScope.of(context)
  2623 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  2624 + // },
  2625 + // keyboardType: keyboardType)),
  2626 + // actions: [
  2627 + // CupertinoDialogAction(
  2628 + // child: Text(lTitle,
  2629 + // style: TextStyle(
  2630 + // fontSize: ScreenUtil().setSp(34),
  2631 + // color: MyColours.color_666666)),
  2632 + // onPressed: () {
  2633 + // Navigator.of(context).pop();
  2634 + // lCallback();
  2635 + // },
  2636 + // ),
  2637 + // CupertinoDialogAction(
  2638 + // child: Text(rTitle,
  2639 + // style: TextStyle(
  2640 + // fontSize: ScreenUtil().setSp(34),
  2641 + // color: MyColours.color_199095)),
  2642 + // onPressed: () {
  2643 + // if (name == '' || name.trim().length == 0) {
  2644 + // Utils.showToast(toast);
  2645 + // return;
  2646 + // }
  2647 + // Navigator.of(context).pop();
  2648 + // rCallback(name);
  2649 + // },
  2650 + // ),
  2651 + // ],
  2652 + // ),
  2653 + // Positioned(
  2654 + // right: 0,
  2655 + // top: 0,
  2656 + // child: Text('删除',
  2657 + // style: TextStyle(
  2658 + // fontWeight: FontWeight.bold,
  2659 + // fontSize: ScreenUtil().setSp(30),
  2660 + // color: MyColours.color_199095)))
  2661 + // ]);
  2662 + // },
  2663 + // );
  2664 + // }
  2665 +
2342 //输入弹框 2666 //输入弹框
2343 static Future textfeildAlertDialog(BuildContext context, 2667 static Future textfeildAlertDialog(BuildContext context,
2344 {String title = "标题", 2668 {String title = "标题",