Showing
9 changed files
with
1033 additions
and
339 deletions
| @@ -38,6 +38,7 @@ class CustomerLabelSunModel extends Object { | @@ -38,6 +38,7 @@ class CustomerLabelSunModel extends Object { | ||
| 38 | 38 | ||
| 39 | @JsonKey(name: 'cdate') | 39 | @JsonKey(name: 'cdate') |
| 40 | String cdate; | 40 | String cdate; |
| 41 | + bool select = false; | ||
| 41 | 42 | ||
| 42 | CustomerLabelSunModel( | 43 | CustomerLabelSunModel( |
| 43 | this.id, | 44 | this.id, |
| @@ -453,10 +453,11 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -453,10 +453,11 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 453 | 453 | ||
| 454 | Widget flatBtn(String tilte, Color color) { | 454 | Widget flatBtn(String tilte, Color color) { |
| 455 | return Container( | 455 | return Container( |
| 456 | - height: w(18), | ||
| 457 | - alignment: Alignment.center, | ||
| 458 | - padding: EdgeInsets.symmetric(horizontal: w(4)), | ||
| 459 | - margin: EdgeInsets.only(left: w(10)), | 456 | + // constraints: BoxConstraints(maxWidth: w(50)), |
| 457 | + // height: w(18), | ||
| 458 | + // alignment: Alignment.center, | ||
| 459 | + padding: EdgeInsets.symmetric(horizontal: w(4), vertical: w(0.5)), | ||
| 460 | + // margin: EdgeInsets.only(left: w(10)), | ||
| 460 | decoration: BoxDecoration( | 461 | decoration: BoxDecoration( |
| 461 | border: Border.all(color: color, width: w(1)), | 462 | border: Border.all(color: color, width: w(1)), |
| 462 | borderRadius: BorderRadius.circular(r(5))), | 463 | borderRadius: BorderRadius.circular(r(5))), |
| @@ -467,6 +468,55 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -467,6 +468,55 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 467 | ); | 468 | ); |
| 468 | } | 469 | } |
| 469 | 470 | ||
| 471 | + List<Widget> labelsWidget(model) { | ||
| 472 | + List<Widget> data = []; | ||
| 473 | + | ||
| 474 | + data.add(Container( | ||
| 475 | + width: w(30), | ||
| 476 | + height: w(16), | ||
| 477 | + alignment: Alignment.center, | ||
| 478 | + // padding: EdgeInsets.symmetric( | ||
| 479 | + // horizontal: ScreenUtil().setWidth(10), | ||
| 480 | + // vertical: ScreenUtil().setWidth(2), | ||
| 481 | + // ), | ||
| 482 | + decoration: BoxDecoration( | ||
| 483 | + color: model.attr != null && model.attr != '' | ||
| 484 | + ? model.attr == '沉睡' | ||
| 485 | + ? MyColours.color_999999 | ||
| 486 | + : model.attr == '活跃' | ||
| 487 | + ? MyColours.color_00715F | ||
| 488 | + : model.attr == '流失' | ||
| 489 | + ? MyColours.color_E34D59 | ||
| 490 | + : Color.fromRGBO(239, 143, 49, 1) | ||
| 491 | + : Colors.transparent, | ||
| 492 | + borderRadius: BorderRadius.circular( | ||
| 493 | + ScreenUtil().setWidth(10), | ||
| 494 | + ), | ||
| 495 | + ), | ||
| 496 | + child: Text(model.attr == null || model.attr == '' ? '' : model.attr, | ||
| 497 | + style: TextStyle( | ||
| 498 | + color: MyColours.color_ffffff, | ||
| 499 | + fontSize: ScreenUtil().setSp(20))))); | ||
| 500 | + | ||
| 501 | + if (model.label != null) { | ||
| 502 | + List<String> labels = model.label.split(','); | ||
| 503 | + labels.forEach((element) { | ||
| 504 | + data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 505 | + }); | ||
| 506 | + } | ||
| 507 | + | ||
| 508 | + if (model.isMember == '1' || model.isMember == '0') { | ||
| 509 | + data.add(flatBtn( | ||
| 510 | + model.isMember == '1' ? '会员' : '非会员', MyColours.color_438E93)); | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + if ('${model.storeDay}' != '0' && model.storeDay != null) { | ||
| 514 | + data.add(flatBtn('存酒${model.storeDay}天', MyColours.color_438E93)); | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + return data; | ||
| 518 | + } | ||
| 519 | + | ||
| 470 | ///改版item样式 | 520 | ///改版item样式 |
| 471 | Widget _buildListNewItem(CustomerListSunModel model, int index) { | 521 | Widget _buildListNewItem(CustomerListSunModel model, int index) { |
| 472 | String susTag = model.getSuspensionTag(); | 522 | String susTag = model.getSuspensionTag(); |
| @@ -515,6 +565,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -515,6 +565,7 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 515 | blurRadius: ScreenUtil().setWidth(8)) | 565 | blurRadius: ScreenUtil().setWidth(8)) |
| 516 | ]), | 566 | ]), |
| 517 | child: Column( | 567 | child: Column( |
| 568 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 518 | children: [ | 569 | children: [ |
| 519 | Container( | 570 | Container( |
| 520 | height: w(35), | 571 | height: w(35), |
| @@ -590,51 +641,58 @@ class _MyContactListPageState extends State<MyContactListPage> { | @@ -590,51 +641,58 @@ class _MyContactListPageState extends State<MyContactListPage> { | ||
| 590 | ), | 641 | ), |
| 591 | ), | 642 | ), |
| 592 | Padding( | 643 | Padding( |
| 593 | - padding: EdgeInsets.all(w(15)), | ||
| 594 | - child: Row( | ||
| 595 | - children: [ | ||
| 596 | - Container( | ||
| 597 | - width: w(30), | ||
| 598 | - height: w(16), | ||
| 599 | - alignment: Alignment.center, | ||
| 600 | - // padding: EdgeInsets.symmetric( | ||
| 601 | - // horizontal: ScreenUtil().setWidth(10), | ||
| 602 | - // vertical: ScreenUtil().setWidth(2), | ||
| 603 | - // ), | ||
| 604 | - decoration: BoxDecoration( | ||
| 605 | - color: model.attr != null && model.attr != '' | ||
| 606 | - ? model.attr == '沉睡' | ||
| 607 | - ? MyColours.color_999999 | ||
| 608 | - : model.attr == '活跃' | ||
| 609 | - ? MyColours.color_00715F | ||
| 610 | - : model.attr == '流失' | ||
| 611 | - ? MyColours.color_E34D59 | ||
| 612 | - : Color.fromRGBO( | ||
| 613 | - 239, 143, 49, 1) | ||
| 614 | - : Colors.transparent, | ||
| 615 | - borderRadius: BorderRadius.circular( | ||
| 616 | - ScreenUtil().setWidth(10), | ||
| 617 | - ), | ||
| 618 | - ), | ||
| 619 | - child: Text( | ||
| 620 | - model.attr == null || model.attr == '' | ||
| 621 | - ? '' | ||
| 622 | - : model.attr, | ||
| 623 | - style: TextStyle( | ||
| 624 | - color: MyColours.color_ffffff, | ||
| 625 | - fontSize: ScreenUtil().setSp(20)))), | ||
| 626 | - model.label != null | ||
| 627 | - ? flatBtn(model.label, MyColours.color_B39437) | ||
| 628 | - : SizedBox(), | ||
| 629 | - if (model.isMember == '1' || model.isMember == '0') | ||
| 630 | - flatBtn(model.isMember == '1' ? '会员' : '非会员', | ||
| 631 | - MyColours.color_438E93), | ||
| 632 | - '${model.storeDay}' != '0' && model.storeDay != null | ||
| 633 | - ? flatBtn('存酒${model.storeDay}天', | ||
| 634 | - MyColours.color_438E93) | ||
| 635 | - : SizedBox() | ||
| 636 | - ], | ||
| 637 | - )), | 644 | + padding: EdgeInsets.all(w(15)), |
| 645 | + child: Wrap( | ||
| 646 | + runSpacing: w(10), | ||
| 647 | + spacing: w(10), | ||
| 648 | + children: labelsWidget(model), | ||
| 649 | + ), | ||
| 650 | + // Row( | ||
| 651 | + // children: [ | ||
| 652 | + // Container( | ||
| 653 | + // width: w(30), | ||
| 654 | + // height: w(16), | ||
| 655 | + // alignment: Alignment.center, | ||
| 656 | + // // padding: EdgeInsets.symmetric( | ||
| 657 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 658 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 659 | + // // ), | ||
| 660 | + // decoration: BoxDecoration( | ||
| 661 | + // color: model.attr != null && model.attr != '' | ||
| 662 | + // ? model.attr == '沉睡' | ||
| 663 | + // ? MyColours.color_999999 | ||
| 664 | + // : model.attr == '活跃' | ||
| 665 | + // ? MyColours.color_00715F | ||
| 666 | + // : model.attr == '流失' | ||
| 667 | + // ? MyColours.color_E34D59 | ||
| 668 | + // : Color.fromRGBO( | ||
| 669 | + // 239, 143, 49, 1) | ||
| 670 | + // : Colors.transparent, | ||
| 671 | + // borderRadius: BorderRadius.circular( | ||
| 672 | + // ScreenUtil().setWidth(10), | ||
| 673 | + // ), | ||
| 674 | + // ), | ||
| 675 | + // child: Text( | ||
| 676 | + // model.attr == null || model.attr == '' | ||
| 677 | + // ? '' | ||
| 678 | + // : model.attr, | ||
| 679 | + // style: TextStyle( | ||
| 680 | + // color: MyColours.color_ffffff, | ||
| 681 | + // fontSize: ScreenUtil().setSp(20)))), | ||
| 682 | + // Wrap(children: labelsWidget(model)), | ||
| 683 | + // model.label != null | ||
| 684 | + // ? flatBtn(model.label, MyColours.color_B39437) | ||
| 685 | + // : SizedBox(), | ||
| 686 | + // if (model.isMember == '1' || model.isMember == '0') | ||
| 687 | + // flatBtn(model.isMember == '1' ? '会员' : '非会员', | ||
| 688 | + // MyColours.color_438E93), | ||
| 689 | + // '${model.storeDay}' != '0' && model.storeDay != null | ||
| 690 | + // ? flatBtn('存酒${model.storeDay}天', | ||
| 691 | + // MyColours.color_438E93) | ||
| 692 | + // : SizedBox() | ||
| 693 | + // ], | ||
| 694 | + // ) | ||
| 695 | + ), | ||
| 638 | Padding( | 696 | Padding( |
| 639 | padding: EdgeInsets.only( | 697 | padding: EdgeInsets.only( |
| 640 | left: w(15), right: w(15), bottom: w(10)), | 698 | left: w(15), right: w(15), bottom: w(10)), |
| @@ -400,10 +400,10 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -400,10 +400,10 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 400 | if (label != null && label.length > 0) { | 400 | if (label != null && label.length > 0) { |
| 401 | List<String> labels = label.split(','); | 401 | List<String> labels = label.split(','); |
| 402 | labels.forEach((element) { | 402 | labels.forEach((element) { |
| 403 | - Text( | 403 | + data.add(Text( |
| 404 | element, | 404 | element, |
| 405 | - style: TextStyle(fontSize: font(16), color: MyColours.color_999999), | ||
| 406 | - ); | 405 | + style: TextStyle(fontSize: font(14), color: MyColours.color_999999), |
| 406 | + )); | ||
| 407 | }); | 407 | }); |
| 408 | } | 408 | } |
| 409 | 409 | ||
| @@ -602,36 +602,69 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -602,36 +602,69 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 602 | '职位', '填写职位', positionController, positionFocus), | 602 | '职位', '填写职位', positionController, positionFocus), |
| 603 | InkWell( | 603 | InkWell( |
| 604 | onTap: () { | 604 | onTap: () { |
| 605 | + // FocusScope.of(context) | ||
| 606 | + // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 607 | + // DialogUtil.showSelectCusmanDialog( | ||
| 608 | + // context, | ||
| 609 | + // customerProvider.labelList.map((item) { | ||
| 610 | + // return item.label; | ||
| 611 | + // }).toList(), (value) { | ||
| 612 | + // if (value != null) { | ||
| 613 | + // setState(() { | ||
| 614 | + // customerProvider.labelSelIndex = | ||
| 615 | + // value.first; | ||
| 616 | + // labelShow = customerProvider | ||
| 617 | + // .labelList[ | ||
| 618 | + // customerProvider.labelSelIndex] | ||
| 619 | + // .label; | ||
| 620 | + // }); | ||
| 621 | + // } | ||
| 622 | + // }, | ||
| 623 | + // selecteds: | ||
| 624 | + // customerProvider.labelSelIndex == null | ||
| 625 | + // ? [] | ||
| 626 | + // : [ | ||
| 627 | + // customerProvider.labelSelIndex | ||
| 628 | + // ]) | ||
| 629 | + // .then((value) {}); | ||
| 605 | FocusScope.of(context) | 630 | FocusScope.of(context) |
| 606 | .requestFocus(FocusNode()); //隐藏键盘 | 631 | .requestFocus(FocusNode()); //隐藏键盘 |
| 607 | - DialogUtil.showSelectCusmanDialog( | ||
| 608 | - context, | ||
| 609 | - customerProvider.labelList.map((item) { | ||
| 610 | - return item.label; | ||
| 611 | - }).toList(), (value) { | 632 | + // 存储 |
| 633 | + | ||
| 634 | + DialogUtil.openLabelSelectModalBottomSheet( | ||
| 635 | + context, | ||
| 636 | + customerProvider.labelList, | ||
| 637 | + labelShow, rCallback: (value) async { | ||
| 612 | if (value != null) { | 638 | if (value != null) { |
| 613 | - setState(() { | ||
| 614 | - customerProvider.labelSelIndex = | ||
| 615 | - value.first; | ||
| 616 | - labelShow = customerProvider | ||
| 617 | - .labelList[ | ||
| 618 | - customerProvider.labelSelIndex] | ||
| 619 | - .label; | ||
| 620 | - }); | 639 | + labelShow = value; |
| 640 | + // customerProvider.labelSelIndex = | ||
| 641 | + // value.first; | ||
| 642 | + // labelShow = customerProvider | ||
| 643 | + // .labelList[ | ||
| 644 | + // customerProvider.labelSelIndex] | ||
| 645 | + // .label; | ||
| 621 | } | 646 | } |
| 622 | - }, | ||
| 623 | - selecteds: | ||
| 624 | - customerProvider.labelSelIndex == null | ||
| 625 | - ? [] | ||
| 626 | - : [ | ||
| 627 | - customerProvider.labelSelIndex | ||
| 628 | - ]) | ||
| 629 | - .then((value) {}); | 647 | + setState(() {}); |
| 648 | + // bool sucess = await detailModel.upReserveInfo( | ||
| 649 | + // context, widget.rid, | ||
| 650 | + // reserveType: reserveType, | ||
| 651 | + // needToast: false); | ||
| 652 | + // if (sucess) { | ||
| 653 | + // EventBus() | ||
| 654 | + // .emit("refresh_tablemanager"); //刷新桌位 | ||
| 655 | + // bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 656 | + // bus.emit("refresh_detail"); | ||
| 657 | + // // await _getReserveDetail( | ||
| 658 | + // // showCicle: false); | ||
| 659 | + // } | ||
| 660 | + // } | ||
| 661 | + }); | ||
| 630 | }, | 662 | }, |
| 631 | child: Container( | 663 | child: Container( |
| 632 | // height: ScreenUtil().setWidth(60), | 664 | // height: ScreenUtil().setWidth(60), |
| 633 | - padding: EdgeInsets.symmetric( | ||
| 634 | - vertical: ScreenUtil().setWidth(50)), | 665 | + padding: EdgeInsets.only( |
| 666 | + top: ScreenUtil().setWidth(50), | ||
| 667 | + bottom: w(12)), | ||
| 635 | decoration: BoxDecoration( | 668 | decoration: BoxDecoration( |
| 636 | border: Border( | 669 | border: Border( |
| 637 | bottom: BorderSide( | 670 | bottom: BorderSide( |
| @@ -639,6 +672,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -639,6 +672,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 639 | color: Color.fromRGBO( | 672 | color: Color.fromRGBO( |
| 640 | 220, 220, 220, 1)))), | 673 | 220, 220, 220, 1)))), |
| 641 | child: Column( | 674 | child: Column( |
| 675 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 642 | children: [ | 676 | children: [ |
| 643 | Row( | 677 | Row( |
| 644 | mainAxisAlignment: | 678 | mainAxisAlignment: |
| @@ -658,17 +692,18 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -658,17 +692,18 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 658 | color: MyColours.color_333333), | 692 | color: MyColours.color_333333), |
| 659 | ), | 693 | ), |
| 660 | ), | 694 | ), |
| 661 | - Expanded( | ||
| 662 | - child: Text( | ||
| 663 | - labelShow, | ||
| 664 | - overflow: TextOverflow.ellipsis, | ||
| 665 | - style: TextStyle( | ||
| 666 | - color: | ||
| 667 | - Color.fromRGBO(193, 194, 63, 1), | ||
| 668 | - fontSize: ScreenUtil().setSp(28), | ||
| 669 | - ), | ||
| 670 | - )), | ||
| 671 | - HEmptyView(10), | 695 | + // Expanded( |
| 696 | + // child: Text( | ||
| 697 | + // labelShow, | ||
| 698 | + // overflow: TextOverflow.ellipsis, | ||
| 699 | + // style: TextStyle( | ||
| 700 | + // color: | ||
| 701 | + // Color.fromRGBO(193, 194, 63, 1), | ||
| 702 | + // fontSize: ScreenUtil().setSp(28), | ||
| 703 | + // ), | ||
| 704 | + // )), | ||
| 705 | + // HEmptyView(10), | ||
| 706 | + Spacer(), | ||
| 672 | Image.asset( | 707 | Image.asset( |
| 673 | "assets/arrow_right_new.png", | 708 | "assets/arrow_right_new.png", |
| 674 | width: ScreenUtil().setWidth(14), | 709 | width: ScreenUtil().setWidth(14), |
| @@ -676,9 +711,14 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -676,9 +711,14 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 676 | ) | 711 | ) |
| 677 | ], | 712 | ], |
| 678 | ), | 713 | ), |
| 679 | - VEmptyView(10), | ||
| 680 | - Wrap( | ||
| 681 | - children: [], | 714 | + VEmptyView(15), |
| 715 | + Padding( | ||
| 716 | + padding: EdgeInsets.only(left: w(25)), | ||
| 717 | + child: Wrap( | ||
| 718 | + runSpacing: w(10), | ||
| 719 | + spacing: w(10), | ||
| 720 | + children: labelsWidget(labelShow), | ||
| 721 | + ), | ||
| 682 | ) | 722 | ) |
| 683 | ], | 723 | ], |
| 684 | ))), | 724 | ))), |
| @@ -255,6 +255,108 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -255,6 +255,108 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 255 | ); | 255 | ); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | + List<Widget> labelsWidget() { | ||
| 259 | + List<Widget> data = []; | ||
| 260 | + | ||
| 261 | + if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 262 | + customerProvider.guestInfoSunModel.guest.attr != '') { | ||
| 263 | + data.add(Container( | ||
| 264 | + width: w(30), | ||
| 265 | + height: w(16), | ||
| 266 | + alignment: Alignment.center, | ||
| 267 | + // padding: EdgeInsets.symmetric( | ||
| 268 | + // horizontal: ScreenUtil().setWidth(10), | ||
| 269 | + // vertical: ScreenUtil().setWidth(2), | ||
| 270 | + // ), | ||
| 271 | + decoration: BoxDecoration( | ||
| 272 | + color: customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 273 | + customerProvider.guestInfoSunModel.guest.attr != '' | ||
| 274 | + ? customerProvider.guestInfoSunModel.guest.attr == '沉睡' | ||
| 275 | + ? MyColours.color_999999 | ||
| 276 | + : customerProvider.guestInfoSunModel.guest.attr == '活跃' | ||
| 277 | + ? MyColours.color_00715F | ||
| 278 | + : customerProvider.guestInfoSunModel.guest.attr == '流失' | ||
| 279 | + ? MyColours.color_E34D59 | ||
| 280 | + : Color.fromRGBO(239, 143, 49, 1) | ||
| 281 | + : Colors.transparent, | ||
| 282 | + borderRadius: BorderRadius.circular( | ||
| 283 | + ScreenUtil().setWidth(10), | ||
| 284 | + ), | ||
| 285 | + ), | ||
| 286 | + child: Text(customerProvider.guestInfoSunModel.guest.attr, | ||
| 287 | + style: TextStyle( | ||
| 288 | + color: MyColours.color_ffffff, | ||
| 289 | + fontSize: ScreenUtil().setSp(20))))); | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + if (customerProvider.guestInfoSunModel.guest.label != null) { | ||
| 293 | + List<String> labels = | ||
| 294 | + customerProvider.guestInfoSunModel.guest.label.split(','); | ||
| 295 | + labels.forEach((element) { | ||
| 296 | + data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 297 | + }); | ||
| 298 | + } | ||
| 299 | + | ||
| 300 | + if (customerProvider.guestInfoSunModel.guest.isMember == '1' || | ||
| 301 | + customerProvider.guestInfoSunModel.guest.isMember == '0') { | ||
| 302 | + data.add(flatBtn( | ||
| 303 | + customerProvider.guestInfoSunModel.guest.isMember == '1' | ||
| 304 | + ? '会员' | ||
| 305 | + : '非会员', | ||
| 306 | + MyColours.color_438E93)); | ||
| 307 | + } | ||
| 308 | + if ('${customerProvider.guestInfoSunModel.store.storeDay}' != '0') { | ||
| 309 | + data.add(flatBtn( | ||
| 310 | + '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 311 | + MyColours.color_438E93)); | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + // data.add(Container( | ||
| 315 | + // width: w(30), | ||
| 316 | + // height: w(16), | ||
| 317 | + // alignment: Alignment.center, | ||
| 318 | + // // padding: EdgeInsets.symmetric( | ||
| 319 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 320 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 321 | + // // ), | ||
| 322 | + // decoration: BoxDecoration( | ||
| 323 | + // color: model.attr != null && model.attr != '' | ||
| 324 | + // ? model.attr == '沉睡' | ||
| 325 | + // ? MyColours.color_999999 | ||
| 326 | + // : model.attr == '活跃' | ||
| 327 | + // ? MyColours.color_00715F | ||
| 328 | + // : model.attr == '流失' | ||
| 329 | + // ? MyColours.color_E34D59 | ||
| 330 | + // : Color.fromRGBO(239, 143, 49, 1) | ||
| 331 | + // : Colors.transparent, | ||
| 332 | + // borderRadius: BorderRadius.circular( | ||
| 333 | + // ScreenUtil().setWidth(10), | ||
| 334 | + // ), | ||
| 335 | + // ), | ||
| 336 | + // child: Text(model.attr == null || model.attr == '' ? '' : model.attr, | ||
| 337 | + // style: TextStyle( | ||
| 338 | + // color: MyColours.color_ffffff, | ||
| 339 | + // fontSize: ScreenUtil().setSp(20)))));} | ||
| 340 | + | ||
| 341 | + // if (model.label != null) { | ||
| 342 | + // List<String> labels = model.label.split(','); | ||
| 343 | + // labels.forEach((element) { | ||
| 344 | + // data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 345 | + // }); | ||
| 346 | + // } | ||
| 347 | + | ||
| 348 | + // if (model.isMember == '1' || model.isMember == '0') { | ||
| 349 | + // data.add(flatBtn( | ||
| 350 | + // model.isMember == '1' ? '会员' : '非会员', MyColours.color_438E93)); | ||
| 351 | + // } | ||
| 352 | + | ||
| 353 | + // if ('${model.storeDay}' != '0' && model.storeDay != null) { | ||
| 354 | + // data.add(flatBtn('存酒${model.storeDay}天', MyColours.color_438E93)); | ||
| 355 | + // } | ||
| 356 | + | ||
| 357 | + return data; | ||
| 358 | + } | ||
| 359 | + | ||
| 258 | Widget _lineItemWidget(String title, String content) { | 360 | Widget _lineItemWidget(String title, String content) { |
| 259 | return Container( | 361 | return Container( |
| 260 | padding: EdgeInsets.symmetric( | 362 | padding: EdgeInsets.symmetric( |
| @@ -335,69 +437,74 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -335,69 +437,74 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 335 | ], | 437 | ], |
| 336 | ), | 438 | ), |
| 337 | VEmptyView(20), | 439 | VEmptyView(20), |
| 338 | - Row( | ||
| 339 | - mainAxisAlignment: MainAxisAlignment.start, | ||
| 340 | - children: [ | ||
| 341 | - if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 342 | - customerProvider.guestInfoSunModel.guest.attr != '') | ||
| 343 | - Container( | ||
| 344 | - width: w(30), | ||
| 345 | - height: w(16), | ||
| 346 | - alignment: Alignment.center, | ||
| 347 | - // padding: EdgeInsets.symmetric( | ||
| 348 | - // horizontal: ScreenUtil().setWidth(10), | ||
| 349 | - // vertical: ScreenUtil().setWidth(2), | ||
| 350 | - // ), | ||
| 351 | - decoration: BoxDecoration( | ||
| 352 | - color: customerProvider | ||
| 353 | - .guestInfoSunModel.guest.attr != | ||
| 354 | - null && | ||
| 355 | - customerProvider | ||
| 356 | - .guestInfoSunModel.guest.attr != | ||
| 357 | - '' | ||
| 358 | - ? customerProvider | ||
| 359 | - .guestInfoSunModel.guest.attr == | ||
| 360 | - '沉睡' | ||
| 361 | - ? MyColours.color_999999 | ||
| 362 | - : customerProvider | ||
| 363 | - .guestInfoSunModel.guest.attr == | ||
| 364 | - '活跃' | ||
| 365 | - ? MyColours.color_00715F | ||
| 366 | - : customerProvider.guestInfoSunModel | ||
| 367 | - .guest.attr == | ||
| 368 | - '流失' | ||
| 369 | - ? MyColours.color_E34D59 | ||
| 370 | - : Color.fromRGBO(239, 143, 49, 1) | ||
| 371 | - : Colors.transparent, | ||
| 372 | - borderRadius: BorderRadius.circular( | ||
| 373 | - ScreenUtil().setWidth(10), | ||
| 374 | - ), | ||
| 375 | - ), | ||
| 376 | - child: Text( | ||
| 377 | - customerProvider.guestInfoSunModel.guest.attr, | ||
| 378 | - style: TextStyle( | ||
| 379 | - color: MyColours.color_ffffff, | ||
| 380 | - fontSize: ScreenUtil().setSp(20)))), | ||
| 381 | - if (customerProvider.guestInfoSunModel.guest.label != null) | ||
| 382 | - flatBtn(customerProvider.guestInfoSunModel.guest.label, | ||
| 383 | - MyColours.color_B39437), | ||
| 384 | - if (customerProvider.guestInfoSunModel.guest.isMember == | ||
| 385 | - '1' || | ||
| 386 | - customerProvider.guestInfoSunModel.guest.isMember == | ||
| 387 | - '0') | ||
| 388 | - flatBtn( | ||
| 389 | - customerProvider.guestInfoSunModel.guest.isMember == | ||
| 390 | - '1' | ||
| 391 | - ? '会员' | ||
| 392 | - : '非会员', | ||
| 393 | - MyColours.color_438E93), | ||
| 394 | - if ('${customerProvider.guestInfoSunModel.store.storeDay}' != | ||
| 395 | - '0') | ||
| 396 | - flatBtn( | ||
| 397 | - '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 398 | - MyColours.color_438E93) | ||
| 399 | - ], | 440 | + Wrap( |
| 441 | + runSpacing: w(10), | ||
| 442 | + spacing: w(10), | ||
| 443 | + children: labelsWidget(), | ||
| 400 | ), | 444 | ), |
| 445 | + // Row( | ||
| 446 | + // mainAxisAlignment: MainAxisAlignment.start, | ||
| 447 | + // children: [ | ||
| 448 | + // if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 449 | + // customerProvider.guestInfoSunModel.guest.attr != '') | ||
| 450 | + // Container( | ||
| 451 | + // width: w(30), | ||
| 452 | + // height: w(16), | ||
| 453 | + // alignment: Alignment.center, | ||
| 454 | + // // padding: EdgeInsets.symmetric( | ||
| 455 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 456 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 457 | + // // ), | ||
| 458 | + // decoration: BoxDecoration( | ||
| 459 | + // color: customerProvider | ||
| 460 | + // .guestInfoSunModel.guest.attr != | ||
| 461 | + // null && | ||
| 462 | + // customerProvider | ||
| 463 | + // .guestInfoSunModel.guest.attr != | ||
| 464 | + // '' | ||
| 465 | + // ? customerProvider | ||
| 466 | + // .guestInfoSunModel.guest.attr == | ||
| 467 | + // '沉睡' | ||
| 468 | + // ? MyColours.color_999999 | ||
| 469 | + // : customerProvider | ||
| 470 | + // .guestInfoSunModel.guest.attr == | ||
| 471 | + // '活跃' | ||
| 472 | + // ? MyColours.color_00715F | ||
| 473 | + // : customerProvider.guestInfoSunModel | ||
| 474 | + // .guest.attr == | ||
| 475 | + // '流失' | ||
| 476 | + // ? MyColours.color_E34D59 | ||
| 477 | + // : Color.fromRGBO(239, 143, 49, 1) | ||
| 478 | + // : Colors.transparent, | ||
| 479 | + // borderRadius: BorderRadius.circular( | ||
| 480 | + // ScreenUtil().setWidth(10), | ||
| 481 | + // ), | ||
| 482 | + // ), | ||
| 483 | + // child: Text( | ||
| 484 | + // customerProvider.guestInfoSunModel.guest.attr, | ||
| 485 | + // style: TextStyle( | ||
| 486 | + // color: MyColours.color_ffffff, | ||
| 487 | + // fontSize: ScreenUtil().setSp(20)))), | ||
| 488 | + // if (customerProvider.guestInfoSunModel.guest.label != null) | ||
| 489 | + // flatBtn(customerProvider.guestInfoSunModel.guest.label, | ||
| 490 | + // MyColours.color_B39437), | ||
| 491 | + // if (customerProvider.guestInfoSunModel.guest.isMember == | ||
| 492 | + // '1' || | ||
| 493 | + // customerProvider.guestInfoSunModel.guest.isMember == | ||
| 494 | + // '0') | ||
| 495 | + // flatBtn( | ||
| 496 | + // customerProvider.guestInfoSunModel.guest.isMember == | ||
| 497 | + // '1' | ||
| 498 | + // ? '会员' | ||
| 499 | + // : '非会员', | ||
| 500 | + // MyColours.color_438E93), | ||
| 501 | + // if ('${customerProvider.guestInfoSunModel.store.storeDay}' != | ||
| 502 | + // '0') | ||
| 503 | + // flatBtn( | ||
| 504 | + // '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 505 | + // MyColours.color_438E93) | ||
| 506 | + // ], | ||
| 507 | + // ), | ||
| 401 | VEmptyView(20), | 508 | VEmptyView(20), |
| 402 | // Text( | 509 | // Text( |
| 403 | // customerProvider.guestInfoSunModel.guest.nickName == null | 510 | // customerProvider.guestInfoSunModel.guest.nickName == null |
| @@ -635,10 +742,10 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -635,10 +742,10 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 635 | 742 | ||
| 636 | Widget flatBtn(String tilte, Color color) { | 743 | Widget flatBtn(String tilte, Color color) { |
| 637 | return Container( | 744 | return Container( |
| 638 | - height: w(18), | ||
| 639 | - alignment: Alignment.center, | ||
| 640 | - padding: EdgeInsets.symmetric(horizontal: w(4)), | ||
| 641 | - margin: EdgeInsets.only(left: w(10)), | 745 | + // height: w(18), |
| 746 | + // alignment: Alignment.center, | ||
| 747 | + padding: EdgeInsets.symmetric(horizontal: w(4), vertical: w(0.5)), | ||
| 748 | + // margin: EdgeInsets.only(left: w(10)), | ||
| 642 | decoration: BoxDecoration( | 749 | decoration: BoxDecoration( |
| 643 | border: Border.all(color: color, width: w(1)), | 750 | border: Border.all(color: color, width: w(1)), |
| 644 | borderRadius: BorderRadius.circular(r(5))), | 751 | borderRadius: BorderRadius.circular(r(5))), |
| @@ -438,10 +438,11 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -438,10 +438,11 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 438 | 438 | ||
| 439 | Widget flatBtn(String tilte, Color color) { | 439 | Widget flatBtn(String tilte, Color color) { |
| 440 | return Container( | 440 | return Container( |
| 441 | - height: w(18), | ||
| 442 | - alignment: Alignment.center, | ||
| 443 | - padding: EdgeInsets.symmetric(horizontal: w(4)), | ||
| 444 | - margin: EdgeInsets.only(left: w(10)), | 441 | + // constraints: BoxConstraints(maxWidth: w(50)), |
| 442 | + // height: w(18), | ||
| 443 | + // alignment: Alignment.center, | ||
| 444 | + padding: EdgeInsets.symmetric(horizontal: w(4), vertical: w(0.5)), | ||
| 445 | + // margin: EdgeInsets.only(left: w(10)), | ||
| 445 | decoration: BoxDecoration( | 446 | decoration: BoxDecoration( |
| 446 | border: Border.all(color: color, width: w(1)), | 447 | border: Border.all(color: color, width: w(1)), |
| 447 | borderRadius: BorderRadius.circular(r(5))), | 448 | borderRadius: BorderRadius.circular(r(5))), |
| @@ -452,6 +453,55 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -452,6 +453,55 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 452 | ); | 453 | ); |
| 453 | } | 454 | } |
| 454 | 455 | ||
| 456 | + List<Widget> labelsWidget(model) { | ||
| 457 | + List<Widget> data = []; | ||
| 458 | + | ||
| 459 | + data.add(Container( | ||
| 460 | + width: w(30), | ||
| 461 | + height: w(16), | ||
| 462 | + alignment: Alignment.center, | ||
| 463 | + // padding: EdgeInsets.symmetric( | ||
| 464 | + // horizontal: ScreenUtil().setWidth(10), | ||
| 465 | + // vertical: ScreenUtil().setWidth(2), | ||
| 466 | + // ), | ||
| 467 | + decoration: BoxDecoration( | ||
| 468 | + color: model.attr != null && model.attr != '' | ||
| 469 | + ? model.attr == '沉睡' | ||
| 470 | + ? MyColours.color_999999 | ||
| 471 | + : model.attr == '活跃' | ||
| 472 | + ? MyColours.color_00715F | ||
| 473 | + : model.attr == '流失' | ||
| 474 | + ? MyColours.color_E34D59 | ||
| 475 | + : Color.fromRGBO(239, 143, 49, 1) | ||
| 476 | + : Colors.transparent, | ||
| 477 | + borderRadius: BorderRadius.circular( | ||
| 478 | + ScreenUtil().setWidth(10), | ||
| 479 | + ), | ||
| 480 | + ), | ||
| 481 | + child: Text(model.attr == null || model.attr == '' ? '' : model.attr, | ||
| 482 | + style: TextStyle( | ||
| 483 | + color: MyColours.color_ffffff, | ||
| 484 | + fontSize: ScreenUtil().setSp(20))))); | ||
| 485 | + | ||
| 486 | + if (model.label != null) { | ||
| 487 | + List<String> labels = model.label.split(','); | ||
| 488 | + labels.forEach((element) { | ||
| 489 | + data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 490 | + }); | ||
| 491 | + } | ||
| 492 | + | ||
| 493 | + if (model.isMember == '1' || model.isMember == '0') { | ||
| 494 | + data.add(flatBtn( | ||
| 495 | + model.isMember == '1' ? '会员' : '非会员', MyColours.color_438E93)); | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + if ('${model.storeDay}' != '0' && model.storeDay != null) { | ||
| 499 | + data.add(flatBtn('存酒${model.storeDay}天', MyColours.color_438E93)); | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + return data; | ||
| 503 | + } | ||
| 504 | + | ||
| 455 | ///改版item样式 | 505 | ///改版item样式 |
| 456 | Widget _buildListNewItem(CustomerBySellerSunModel model, int index) { | 506 | Widget _buildListNewItem(CustomerBySellerSunModel model, int index) { |
| 457 | String susTag = model.getSuspensionTag(); | 507 | String susTag = model.getSuspensionTag(); |
| @@ -501,6 +551,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -501,6 +551,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 501 | blurRadius: ScreenUtil().setWidth(8)) | 551 | blurRadius: ScreenUtil().setWidth(8)) |
| 502 | ]), | 552 | ]), |
| 503 | child: Column( | 553 | child: Column( |
| 554 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 504 | children: [ | 555 | children: [ |
| 505 | Container( | 556 | Container( |
| 506 | height: w(35), | 557 | height: w(35), |
| @@ -577,52 +628,59 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -577,52 +628,59 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 577 | ), | 628 | ), |
| 578 | Padding( | 629 | Padding( |
| 579 | padding: EdgeInsets.all(w(15)), | 630 | padding: EdgeInsets.all(w(15)), |
| 580 | - child: Row( | ||
| 581 | - children: [ | ||
| 582 | - Container( | ||
| 583 | - width: w(30), | ||
| 584 | - height: w(16), | ||
| 585 | - alignment: Alignment.center, | ||
| 586 | - // padding: EdgeInsets.symmetric( | ||
| 587 | - // horizontal: ScreenUtil().setWidth(10), | ||
| 588 | - // vertical: ScreenUtil().setWidth(2), | ||
| 589 | - // ), | ||
| 590 | - decoration: BoxDecoration( | ||
| 591 | - color: model.attr != null && model.attr != '' | ||
| 592 | - ? model.attr == '沉睡' | ||
| 593 | - ? MyColours.color_999999 | ||
| 594 | - : model.attr == '活跃' | ||
| 595 | - ? MyColours.color_00715F | ||
| 596 | - : model.attr == '流失' | ||
| 597 | - ? MyColours.color_E34D59 | ||
| 598 | - : Color.fromRGBO( | ||
| 599 | - 239, 143, 49, 1) | ||
| 600 | - : Colors.transparent, | ||
| 601 | - borderRadius: BorderRadius.circular( | ||
| 602 | - ScreenUtil().setWidth(10), | ||
| 603 | - ), | ||
| 604 | - ), | ||
| 605 | - child: Text( | ||
| 606 | - model.attr == null || model.attr == '' | ||
| 607 | - ? '' | ||
| 608 | - : model.attr, | ||
| 609 | - style: TextStyle( | ||
| 610 | - color: MyColours.color_ffffff, | ||
| 611 | - fontSize: ScreenUtil().setSp(20)))), | ||
| 612 | - model.label != null | ||
| 613 | - ? flatBtn(model.label, MyColours.color_B39437) | ||
| 614 | - : SizedBox(), | ||
| 615 | - model.isMember == '1' | ||
| 616 | - ? flatBtn('会员', MyColours.color_438E93) | ||
| 617 | - : model.isMember == '0' | ||
| 618 | - ? flatBtn('非会员', MyColours.color_438E93) | ||
| 619 | - : SizedBox(), | ||
| 620 | - '${model.storeDay}' != '0' | ||
| 621 | - ? flatBtn('存酒${model.storeDay}天', | ||
| 622 | - MyColours.color_438E93) | ||
| 623 | - : SizedBox() | ||
| 624 | - ], | 631 | + child: Wrap( |
| 632 | + runSpacing: w(10), | ||
| 633 | + spacing: w(10), | ||
| 634 | + children: labelsWidget(model), | ||
| 625 | )), | 635 | )), |
| 636 | + // Padding( | ||
| 637 | + // padding: EdgeInsets.all(w(15)), | ||
| 638 | + // child: Row( | ||
| 639 | + // children: [ | ||
| 640 | + // Container( | ||
| 641 | + // width: w(30), | ||
| 642 | + // height: w(16), | ||
| 643 | + // alignment: Alignment.center, | ||
| 644 | + // // padding: EdgeInsets.symmetric( | ||
| 645 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 646 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 647 | + // // ), | ||
| 648 | + // decoration: BoxDecoration( | ||
| 649 | + // color: model.attr != null && model.attr != '' | ||
| 650 | + // ? model.attr == '沉睡' | ||
| 651 | + // ? MyColours.color_999999 | ||
| 652 | + // : model.attr == '活跃' | ||
| 653 | + // ? MyColours.color_00715F | ||
| 654 | + // : model.attr == '流失' | ||
| 655 | + // ? MyColours.color_E34D59 | ||
| 656 | + // : Color.fromRGBO( | ||
| 657 | + // 239, 143, 49, 1) | ||
| 658 | + // : Colors.transparent, | ||
| 659 | + // borderRadius: BorderRadius.circular( | ||
| 660 | + // ScreenUtil().setWidth(10), | ||
| 661 | + // ), | ||
| 662 | + // ), | ||
| 663 | + // child: Text( | ||
| 664 | + // model.attr == null || model.attr == '' | ||
| 665 | + // ? '' | ||
| 666 | + // : model.attr, | ||
| 667 | + // style: TextStyle( | ||
| 668 | + // color: MyColours.color_ffffff, | ||
| 669 | + // fontSize: ScreenUtil().setSp(20)))), | ||
| 670 | + // model.label != null | ||
| 671 | + // ? flatBtn(model.label, MyColours.color_B39437) | ||
| 672 | + // : SizedBox(), | ||
| 673 | + // model.isMember == '1' | ||
| 674 | + // ? flatBtn('会员', MyColours.color_438E93) | ||
| 675 | + // : model.isMember == '0' | ||
| 676 | + // ? flatBtn('非会员', MyColours.color_438E93) | ||
| 677 | + // : SizedBox(), | ||
| 678 | + // '${model.storeDay}' != '0' | ||
| 679 | + // ? flatBtn('存酒${model.storeDay}天', | ||
| 680 | + // MyColours.color_438E93) | ||
| 681 | + // : SizedBox() | ||
| 682 | + // ], | ||
| 683 | + // )), | ||
| 626 | Padding( | 684 | Padding( |
| 627 | padding: EdgeInsets.only( | 685 | padding: EdgeInsets.only( |
| 628 | left: w(15), right: w(15), bottom: w(10)), | 686 | left: w(15), right: w(15), bottom: w(10)), |
| @@ -17,6 +17,8 @@ import 'package:one_key/widgets/system_app_bar.dart'; | @@ -17,6 +17,8 @@ import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 17 | import 'package:one_key/widgets/v_empty_view.dart'; | 17 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 18 | import 'package:provider/provider.dart'; | 18 | import 'package:provider/provider.dart'; |
| 19 | 19 | ||
| 20 | +import '../../../../utils/screen_util.dart'; | ||
| 21 | + | ||
| 20 | class CustomerDetailEditPage extends StatefulWidget { | 22 | class CustomerDetailEditPage extends StatefulWidget { |
| 21 | final Guest guest; | 23 | final Guest guest; |
| 22 | final FromPage fromPage; | 24 | final FromPage fromPage; |
| @@ -343,6 +345,22 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -343,6 +345,22 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 343 | ); | 345 | ); |
| 344 | } | 346 | } |
| 345 | 347 | ||
| 348 | + List<Widget> labelsWidget(String label) { | ||
| 349 | + List<Widget> data = []; | ||
| 350 | + | ||
| 351 | + if (label != null && label.length > 0) { | ||
| 352 | + List<String> labels = label.split(','); | ||
| 353 | + labels.forEach((element) { | ||
| 354 | + data.add(Text( | ||
| 355 | + element, | ||
| 356 | + style: TextStyle(fontSize: font(14), color: MyColours.color_999999), | ||
| 357 | + )); | ||
| 358 | + }); | ||
| 359 | + } | ||
| 360 | + | ||
| 361 | + return data; | ||
| 362 | + } | ||
| 363 | + | ||
| 346 | ///忌口和喜好 | 364 | ///忌口和喜好 |
| 347 | Widget _textMulLine( | 365 | Widget _textMulLine( |
| 348 | String title, String hintText, TextEditingController controller) { | 366 | String title, String hintText, TextEditingController controller) { |
| @@ -600,78 +618,200 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -600,78 +618,200 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 600 | '职位', '填写职位', positionController, positionFocus), | 618 | '职位', '填写职位', positionController, positionFocus), |
| 601 | InkWell( | 619 | InkWell( |
| 602 | onTap: () { | 620 | onTap: () { |
| 621 | + // FocusScope.of(context) | ||
| 622 | + // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 623 | + // DialogUtil.showSelectCusmanDialog( | ||
| 624 | + // context, | ||
| 625 | + // customerProvider.labelList.map((item) { | ||
| 626 | + // return item.label; | ||
| 627 | + // }).toList(), (value) { | ||
| 628 | + // if (value != null) { | ||
| 629 | + // setState(() { | ||
| 630 | + // customerProvider.labelSelIndex = | ||
| 631 | + // value.first; | ||
| 632 | + // labelShow = customerProvider | ||
| 633 | + // .labelList[ | ||
| 634 | + // customerProvider.labelSelIndex] | ||
| 635 | + // .label; | ||
| 636 | + // }); | ||
| 637 | + // } | ||
| 638 | + // }, | ||
| 639 | + // selecteds: | ||
| 640 | + // customerProvider.labelSelIndex == null | ||
| 641 | + // ? [] | ||
| 642 | + // : [ | ||
| 643 | + // customerProvider.labelSelIndex | ||
| 644 | + // ]) | ||
| 645 | + // .then((value) {}); | ||
| 603 | FocusScope.of(context) | 646 | FocusScope.of(context) |
| 604 | .requestFocus(FocusNode()); //隐藏键盘 | 647 | .requestFocus(FocusNode()); //隐藏键盘 |
| 605 | - DialogUtil.showSelectCusmanDialog( | ||
| 606 | - context, | ||
| 607 | - customerProvider.labelList.map((item) { | ||
| 608 | - return item.label; | ||
| 609 | - }).toList(), (value) { | 648 | + // 存储 |
| 649 | + | ||
| 650 | + DialogUtil.openLabelSelectModalBottomSheet( | ||
| 651 | + context, | ||
| 652 | + customerProvider.labelList, | ||
| 653 | + labelShow, rCallback: (value) async { | ||
| 610 | if (value != null) { | 654 | if (value != null) { |
| 611 | - setState(() { | ||
| 612 | - customerProvider.labelSelIndex = | ||
| 613 | - value.first; | ||
| 614 | - labelShow = customerProvider | ||
| 615 | - .labelList[ | ||
| 616 | - customerProvider.labelSelIndex] | ||
| 617 | - .label; | ||
| 618 | - }); | 655 | + labelShow = value; |
| 656 | + // customerProvider.labelSelIndex = | ||
| 657 | + // value.first; | ||
| 658 | + // labelShow = customerProvider | ||
| 659 | + // .labelList[ | ||
| 660 | + // customerProvider.labelSelIndex] | ||
| 661 | + // .label; | ||
| 619 | } | 662 | } |
| 620 | - }, | ||
| 621 | - selecteds: | ||
| 622 | - customerProvider.labelSelIndex == null | ||
| 623 | - ? [] | ||
| 624 | - : [ | ||
| 625 | - customerProvider.labelSelIndex | ||
| 626 | - ]) | ||
| 627 | - .then((value) {}); | 663 | + setState(() {}); |
| 664 | + // bool sucess = await detailModel.upReserveInfo( | ||
| 665 | + // context, widget.rid, | ||
| 666 | + // reserveType: reserveType, | ||
| 667 | + // needToast: false); | ||
| 668 | + // if (sucess) { | ||
| 669 | + // EventBus() | ||
| 670 | + // .emit("refresh_tablemanager"); //刷新桌位 | ||
| 671 | + // bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 672 | + // bus.emit("refresh_detail"); | ||
| 673 | + // // await _getReserveDetail( | ||
| 674 | + // // showCicle: false); | ||
| 675 | + // } | ||
| 676 | + // } | ||
| 677 | + }); | ||
| 628 | }, | 678 | }, |
| 629 | child: Container( | 679 | child: Container( |
| 630 | - // height: ScreenUtil().setWidth(60), | ||
| 631 | - padding: EdgeInsets.symmetric( | ||
| 632 | - vertical: ScreenUtil().setWidth(50)), | ||
| 633 | - decoration: BoxDecoration( | ||
| 634 | - border: Border( | ||
| 635 | - bottom: BorderSide( | ||
| 636 | - width: ScreenUtil().setWidth(2), | ||
| 637 | - color: Color.fromRGBO( | ||
| 638 | - 220, 220, 220, 1)))), | ||
| 639 | - child: Row( | ||
| 640 | - mainAxisAlignment: | ||
| 641 | - MainAxisAlignment.spaceBetween, | ||
| 642 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 643 | - children: [ | ||
| 644 | - Container( | ||
| 645 | - // color: Colors.red, | ||
| 646 | - width: ScreenUtil().setWidth(150), | ||
| 647 | - height: ScreenUtil().setWidth(35), | ||
| 648 | - child: Text( | ||
| 649 | - '自定义标签', | ||
| 650 | - style: TextStyle( | ||
| 651 | - fontSize: ScreenUtil().setSp(28), | ||
| 652 | - color: MyColours.color_333333), | ||
| 653 | - ), | ||
| 654 | - ), | ||
| 655 | - Expanded( | ||
| 656 | - child: Text( | ||
| 657 | - labelShow, | ||
| 658 | - overflow: TextOverflow.ellipsis, | ||
| 659 | - style: TextStyle( | ||
| 660 | - color: Color.fromRGBO(193, 194, 63, 1), | ||
| 661 | - fontSize: ScreenUtil().setSp(28), | 680 | + // height: ScreenUtil().setWidth(60), |
| 681 | + padding: EdgeInsets.only( | ||
| 682 | + top: ScreenUtil().setWidth(50), | ||
| 683 | + bottom: w(12)), | ||
| 684 | + decoration: BoxDecoration( | ||
| 685 | + border: Border( | ||
| 686 | + bottom: BorderSide( | ||
| 687 | + width: ScreenUtil().setWidth(2), | ||
| 688 | + color: Color.fromRGBO( | ||
| 689 | + 220, 220, 220, 1)))), | ||
| 690 | + child: Column( | ||
| 691 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 692 | + children: [ | ||
| 693 | + Row( | ||
| 694 | + mainAxisAlignment: | ||
| 695 | + MainAxisAlignment.spaceBetween, | ||
| 696 | + crossAxisAlignment: | ||
| 697 | + CrossAxisAlignment.center, | ||
| 698 | + children: [ | ||
| 699 | + Container( | ||
| 700 | + // color: Colors.red, | ||
| 701 | + width: ScreenUtil().setWidth(150), | ||
| 702 | + height: ScreenUtil().setWidth(35), | ||
| 703 | + child: Text( | ||
| 704 | + '自定义标签', | ||
| 705 | + style: TextStyle( | ||
| 706 | + fontSize: | ||
| 707 | + ScreenUtil().setSp(28), | ||
| 708 | + color: MyColours.color_333333), | ||
| 709 | + ), | ||
| 710 | + ), | ||
| 711 | + // Expanded( | ||
| 712 | + // child: Text( | ||
| 713 | + // labelShow, | ||
| 714 | + // overflow: TextOverflow.ellipsis, | ||
| 715 | + // style: TextStyle( | ||
| 716 | + // color: | ||
| 717 | + // Color.fromRGBO(193, 194, 63, 1), | ||
| 718 | + // fontSize: ScreenUtil().setSp(28), | ||
| 719 | + // ), | ||
| 720 | + // )), | ||
| 721 | + // HEmptyView(10), | ||
| 722 | + Spacer(), | ||
| 723 | + Image.asset( | ||
| 724 | + "assets/arrow_right_new.png", | ||
| 725 | + width: ScreenUtil().setWidth(14), | ||
| 726 | + height: ScreenUtil().setWidth(22), | ||
| 727 | + ) | ||
| 728 | + ], | ||
| 662 | ), | 729 | ), |
| 663 | - )), | ||
| 664 | - HEmptyView(10), | ||
| 665 | - Image.asset( | ||
| 666 | - Utils.getImgPath(showLabel | ||
| 667 | - ? 'c_arrow_up' | ||
| 668 | - : 'c_arrow_down'), | ||
| 669 | - width: ScreenUtil().setWidth(24), | ||
| 670 | - // height: ScreenUtil().setWidth(10), | ||
| 671 | - ) | ||
| 672 | - ], | ||
| 673 | - ), | ||
| 674 | - )), | 730 | + VEmptyView(15), |
| 731 | + Padding( | ||
| 732 | + padding: EdgeInsets.only(left: w(25)), | ||
| 733 | + child: Wrap( | ||
| 734 | + runSpacing: w(10), | ||
| 735 | + spacing: w(10), | ||
| 736 | + children: labelsWidget(labelShow), | ||
| 737 | + ), | ||
| 738 | + ) | ||
| 739 | + ], | ||
| 740 | + ))), | ||
| 741 | + // InkWell( | ||
| 742 | + // onTap: () { | ||
| 743 | + // FocusScope.of(context) | ||
| 744 | + // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 745 | + // DialogUtil.showSelectCusmanDialog( | ||
| 746 | + // context, | ||
| 747 | + // customerProvider.labelList.map((item) { | ||
| 748 | + // return item.label; | ||
| 749 | + // }).toList(), (value) { | ||
| 750 | + // if (value != null) { | ||
| 751 | + // setState(() { | ||
| 752 | + // customerProvider.labelSelIndex = | ||
| 753 | + // value.first; | ||
| 754 | + // labelShow = customerProvider | ||
| 755 | + // .labelList[ | ||
| 756 | + // customerProvider.labelSelIndex] | ||
| 757 | + // .label; | ||
| 758 | + // }); | ||
| 759 | + // } | ||
| 760 | + // }, | ||
| 761 | + // selecteds: | ||
| 762 | + // customerProvider.labelSelIndex == null | ||
| 763 | + // ? [] | ||
| 764 | + // : [ | ||
| 765 | + // customerProvider.labelSelIndex | ||
| 766 | + // ]) | ||
| 767 | + // .then((value) {}); | ||
| 768 | + // }, | ||
| 769 | + // child: Container( | ||
| 770 | + // // height: ScreenUtil().setWidth(60), | ||
| 771 | + // padding: EdgeInsets.symmetric( | ||
| 772 | + // vertical: ScreenUtil().setWidth(50)), | ||
| 773 | + // decoration: BoxDecoration( | ||
| 774 | + // border: Border( | ||
| 775 | + // bottom: BorderSide( | ||
| 776 | + // width: ScreenUtil().setWidth(2), | ||
| 777 | + // color: Color.fromRGBO( | ||
| 778 | + // 220, 220, 220, 1)))), | ||
| 779 | + // child: Row( | ||
| 780 | + // mainAxisAlignment: | ||
| 781 | + // MainAxisAlignment.spaceBetween, | ||
| 782 | + // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 783 | + // children: [ | ||
| 784 | + // Container( | ||
| 785 | + // // color: Colors.red, | ||
| 786 | + // width: ScreenUtil().setWidth(150), | ||
| 787 | + // height: ScreenUtil().setWidth(35), | ||
| 788 | + // child: Text( | ||
| 789 | + // '自定义标签', | ||
| 790 | + // style: TextStyle( | ||
| 791 | + // fontSize: ScreenUtil().setSp(28), | ||
| 792 | + // color: MyColours.color_333333), | ||
| 793 | + // ), | ||
| 794 | + // ), | ||
| 795 | + // Expanded( | ||
| 796 | + // child: Text( | ||
| 797 | + // labelShow, | ||
| 798 | + // overflow: TextOverflow.ellipsis, | ||
| 799 | + // style: TextStyle( | ||
| 800 | + // color: Color.fromRGBO(193, 194, 63, 1), | ||
| 801 | + // fontSize: ScreenUtil().setSp(28), | ||
| 802 | + // ), | ||
| 803 | + // )), | ||
| 804 | + // HEmptyView(10), | ||
| 805 | + // Image.asset( | ||
| 806 | + // Utils.getImgPath(showLabel | ||
| 807 | + // ? 'c_arrow_up' | ||
| 808 | + // : 'c_arrow_down'), | ||
| 809 | + // width: ScreenUtil().setWidth(24), | ||
| 810 | + // // height: ScreenUtil().setWidth(10), | ||
| 811 | + // ) | ||
| 812 | + // ], | ||
| 813 | + // ), | ||
| 814 | + // )), | ||
| 675 | InkWell( | 815 | InkWell( |
| 676 | onTap: () { | 816 | onTap: () { |
| 677 | FocusScope.of(context) | 817 | FocusScope.of(context) |
| @@ -346,69 +346,74 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -346,69 +346,74 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 346 | ], | 346 | ], |
| 347 | ), | 347 | ), |
| 348 | VEmptyView(20), | 348 | VEmptyView(20), |
| 349 | - Row( | ||
| 350 | - mainAxisAlignment: MainAxisAlignment.start, | ||
| 351 | - children: [ | ||
| 352 | - if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 353 | - customerProvider.guestInfoSunModel.guest.attr != '') | ||
| 354 | - Container( | ||
| 355 | - width: w(30), | ||
| 356 | - height: w(16), | ||
| 357 | - alignment: Alignment.center, | ||
| 358 | - // padding: EdgeInsets.symmetric( | ||
| 359 | - // horizontal: ScreenUtil().setWidth(10), | ||
| 360 | - // vertical: ScreenUtil().setWidth(2), | ||
| 361 | - // ), | ||
| 362 | - decoration: BoxDecoration( | ||
| 363 | - color: customerProvider | ||
| 364 | - .guestInfoSunModel.guest.attr != | ||
| 365 | - null && | ||
| 366 | - customerProvider | ||
| 367 | - .guestInfoSunModel.guest.attr != | ||
| 368 | - '' | ||
| 369 | - ? customerProvider | ||
| 370 | - .guestInfoSunModel.guest.attr == | ||
| 371 | - '沉睡' | ||
| 372 | - ? MyColours.color_999999 | ||
| 373 | - : customerProvider | ||
| 374 | - .guestInfoSunModel.guest.attr == | ||
| 375 | - '活跃' | ||
| 376 | - ? MyColours.color_00715F | ||
| 377 | - : customerProvider.guestInfoSunModel | ||
| 378 | - .guest.attr == | ||
| 379 | - '流失' | ||
| 380 | - ? MyColours.color_E34D59 | ||
| 381 | - : Color.fromRGBO(239, 143, 49, 1) | ||
| 382 | - : Colors.transparent, | ||
| 383 | - borderRadius: BorderRadius.circular( | ||
| 384 | - ScreenUtil().setWidth(10), | ||
| 385 | - ), | ||
| 386 | - ), | ||
| 387 | - child: Text( | ||
| 388 | - customerProvider.guestInfoSunModel.guest.attr, | ||
| 389 | - style: TextStyle( | ||
| 390 | - color: MyColours.color_ffffff, | ||
| 391 | - fontSize: ScreenUtil().setSp(20)))), | ||
| 392 | - if (customerProvider.guestInfoSunModel.guest.label != null) | ||
| 393 | - flatBtn(customerProvider.guestInfoSunModel.guest.label, | ||
| 394 | - MyColours.color_B39437), | ||
| 395 | - if (customerProvider.guestInfoSunModel.guest.isMember == | ||
| 396 | - '1' || | ||
| 397 | - customerProvider.guestInfoSunModel.guest.isMember == | ||
| 398 | - '0') | ||
| 399 | - flatBtn( | ||
| 400 | - customerProvider.guestInfoSunModel.guest.isMember == | ||
| 401 | - '1' | ||
| 402 | - ? '会员' | ||
| 403 | - : '非会员', | ||
| 404 | - MyColours.color_438E93), | ||
| 405 | - if ('${customerProvider.guestInfoSunModel.store.storeDay}' != | ||
| 406 | - '0') | ||
| 407 | - flatBtn( | ||
| 408 | - '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 409 | - MyColours.color_438E93) | ||
| 410 | - ], | 349 | + Wrap( |
| 350 | + runSpacing: w(10), | ||
| 351 | + spacing: w(10), | ||
| 352 | + children: labelsWidget(), | ||
| 411 | ), | 353 | ), |
| 354 | + // Row( | ||
| 355 | + // mainAxisAlignment: MainAxisAlignment.start, | ||
| 356 | + // children: [ | ||
| 357 | + // if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 358 | + // customerProvider.guestInfoSunModel.guest.attr != '') | ||
| 359 | + // Container( | ||
| 360 | + // width: w(30), | ||
| 361 | + // height: w(16), | ||
| 362 | + // alignment: Alignment.center, | ||
| 363 | + // // padding: EdgeInsets.symmetric( | ||
| 364 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 365 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 366 | + // // ), | ||
| 367 | + // decoration: BoxDecoration( | ||
| 368 | + // color: customerProvider | ||
| 369 | + // .guestInfoSunModel.guest.attr != | ||
| 370 | + // null && | ||
| 371 | + // customerProvider | ||
| 372 | + // .guestInfoSunModel.guest.attr != | ||
| 373 | + // '' | ||
| 374 | + // ? customerProvider | ||
| 375 | + // .guestInfoSunModel.guest.attr == | ||
| 376 | + // '沉睡' | ||
| 377 | + // ? MyColours.color_999999 | ||
| 378 | + // : customerProvider | ||
| 379 | + // .guestInfoSunModel.guest.attr == | ||
| 380 | + // '活跃' | ||
| 381 | + // ? MyColours.color_00715F | ||
| 382 | + // : customerProvider.guestInfoSunModel | ||
| 383 | + // .guest.attr == | ||
| 384 | + // '流失' | ||
| 385 | + // ? MyColours.color_E34D59 | ||
| 386 | + // : Color.fromRGBO(239, 143, 49, 1) | ||
| 387 | + // : Colors.transparent, | ||
| 388 | + // borderRadius: BorderRadius.circular( | ||
| 389 | + // ScreenUtil().setWidth(10), | ||
| 390 | + // ), | ||
| 391 | + // ), | ||
| 392 | + // child: Text( | ||
| 393 | + // customerProvider.guestInfoSunModel.guest.attr, | ||
| 394 | + // style: TextStyle( | ||
| 395 | + // color: MyColours.color_ffffff, | ||
| 396 | + // fontSize: ScreenUtil().setSp(20)))), | ||
| 397 | + // if (customerProvider.guestInfoSunModel.guest.label != null) | ||
| 398 | + // flatBtn(customerProvider.guestInfoSunModel.guest.label, | ||
| 399 | + // MyColours.color_B39437), | ||
| 400 | + // if (customerProvider.guestInfoSunModel.guest.isMember == | ||
| 401 | + // '1' || | ||
| 402 | + // customerProvider.guestInfoSunModel.guest.isMember == | ||
| 403 | + // '0') | ||
| 404 | + // flatBtn( | ||
| 405 | + // customerProvider.guestInfoSunModel.guest.isMember == | ||
| 406 | + // '1' | ||
| 407 | + // ? '会员' | ||
| 408 | + // : '非会员', | ||
| 409 | + // MyColours.color_438E93), | ||
| 410 | + // if ('${customerProvider.guestInfoSunModel.store.storeDay}' != | ||
| 411 | + // '0') | ||
| 412 | + // flatBtn( | ||
| 413 | + // '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 414 | + // MyColours.color_438E93) | ||
| 415 | + // ], | ||
| 416 | + // ), | ||
| 412 | VEmptyView(20), | 417 | VEmptyView(20), |
| 413 | Text( | 418 | Text( |
| 414 | customerProvider.guestInfoSunModel.guest.nickName == null | 419 | customerProvider.guestInfoSunModel.guest.nickName == null |
| @@ -646,10 +651,10 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -646,10 +651,10 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 646 | 651 | ||
| 647 | Widget flatBtn(String tilte, Color color) { | 652 | Widget flatBtn(String tilte, Color color) { |
| 648 | return Container( | 653 | return Container( |
| 649 | - height: w(18), | ||
| 650 | - alignment: Alignment.center, | ||
| 651 | - padding: EdgeInsets.symmetric(horizontal: w(4)), | ||
| 652 | - margin: EdgeInsets.only(left: w(10)), | 654 | + // height: w(18), |
| 655 | + // alignment: Alignment.center, | ||
| 656 | + padding: EdgeInsets.symmetric(horizontal: w(4), vertical: w(0.5)), | ||
| 657 | + // margin: EdgeInsets.only(left: w(10)), | ||
| 653 | decoration: BoxDecoration( | 658 | decoration: BoxDecoration( |
| 654 | border: Border.all(color: color, width: w(1)), | 659 | border: Border.all(color: color, width: w(1)), |
| 655 | borderRadius: BorderRadius.circular(r(5))), | 660 | borderRadius: BorderRadius.circular(r(5))), |
| @@ -660,6 +665,108 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -660,6 +665,108 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 660 | ); | 665 | ); |
| 661 | } | 666 | } |
| 662 | 667 | ||
| 668 | + List<Widget> labelsWidget() { | ||
| 669 | + List<Widget> data = []; | ||
| 670 | + | ||
| 671 | + if (customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 672 | + customerProvider.guestInfoSunModel.guest.attr != '') { | ||
| 673 | + data.add(Container( | ||
| 674 | + width: w(30), | ||
| 675 | + height: w(16), | ||
| 676 | + alignment: Alignment.center, | ||
| 677 | + // padding: EdgeInsets.symmetric( | ||
| 678 | + // horizontal: ScreenUtil().setWidth(10), | ||
| 679 | + // vertical: ScreenUtil().setWidth(2), | ||
| 680 | + // ), | ||
| 681 | + decoration: BoxDecoration( | ||
| 682 | + color: customerProvider.guestInfoSunModel.guest.attr != null && | ||
| 683 | + customerProvider.guestInfoSunModel.guest.attr != '' | ||
| 684 | + ? customerProvider.guestInfoSunModel.guest.attr == '沉睡' | ||
| 685 | + ? MyColours.color_999999 | ||
| 686 | + : customerProvider.guestInfoSunModel.guest.attr == '活跃' | ||
| 687 | + ? MyColours.color_00715F | ||
| 688 | + : customerProvider.guestInfoSunModel.guest.attr == '流失' | ||
| 689 | + ? MyColours.color_E34D59 | ||
| 690 | + : Color.fromRGBO(239, 143, 49, 1) | ||
| 691 | + : Colors.transparent, | ||
| 692 | + borderRadius: BorderRadius.circular( | ||
| 693 | + ScreenUtil().setWidth(10), | ||
| 694 | + ), | ||
| 695 | + ), | ||
| 696 | + child: Text(customerProvider.guestInfoSunModel.guest.attr, | ||
| 697 | + style: TextStyle( | ||
| 698 | + color: MyColours.color_ffffff, | ||
| 699 | + fontSize: ScreenUtil().setSp(20))))); | ||
| 700 | + } | ||
| 701 | + | ||
| 702 | + if (customerProvider.guestInfoSunModel.guest.label != null) { | ||
| 703 | + List<String> labels = | ||
| 704 | + customerProvider.guestInfoSunModel.guest.label.split(','); | ||
| 705 | + labels.forEach((element) { | ||
| 706 | + data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 707 | + }); | ||
| 708 | + } | ||
| 709 | + | ||
| 710 | + if (customerProvider.guestInfoSunModel.guest.isMember == '1' || | ||
| 711 | + customerProvider.guestInfoSunModel.guest.isMember == '0') { | ||
| 712 | + data.add(flatBtn( | ||
| 713 | + customerProvider.guestInfoSunModel.guest.isMember == '1' | ||
| 714 | + ? '会员' | ||
| 715 | + : '非会员', | ||
| 716 | + MyColours.color_438E93)); | ||
| 717 | + } | ||
| 718 | + if ('${customerProvider.guestInfoSunModel.store.storeDay}' != '0') { | ||
| 719 | + data.add(flatBtn( | ||
| 720 | + '存酒${customerProvider.guestInfoSunModel.store.storeDay}天', | ||
| 721 | + MyColours.color_438E93)); | ||
| 722 | + } | ||
| 723 | + | ||
| 724 | + // data.add(Container( | ||
| 725 | + // width: w(30), | ||
| 726 | + // height: w(16), | ||
| 727 | + // alignment: Alignment.center, | ||
| 728 | + // // padding: EdgeInsets.symmetric( | ||
| 729 | + // // horizontal: ScreenUtil().setWidth(10), | ||
| 730 | + // // vertical: ScreenUtil().setWidth(2), | ||
| 731 | + // // ), | ||
| 732 | + // decoration: BoxDecoration( | ||
| 733 | + // color: model.attr != null && model.attr != '' | ||
| 734 | + // ? model.attr == '沉睡' | ||
| 735 | + // ? MyColours.color_999999 | ||
| 736 | + // : model.attr == '活跃' | ||
| 737 | + // ? MyColours.color_00715F | ||
| 738 | + // : model.attr == '流失' | ||
| 739 | + // ? MyColours.color_E34D59 | ||
| 740 | + // : Color.fromRGBO(239, 143, 49, 1) | ||
| 741 | + // : Colors.transparent, | ||
| 742 | + // borderRadius: BorderRadius.circular( | ||
| 743 | + // ScreenUtil().setWidth(10), | ||
| 744 | + // ), | ||
| 745 | + // ), | ||
| 746 | + // child: Text(model.attr == null || model.attr == '' ? '' : model.attr, | ||
| 747 | + // style: TextStyle( | ||
| 748 | + // color: MyColours.color_ffffff, | ||
| 749 | + // fontSize: ScreenUtil().setSp(20)))));} | ||
| 750 | + | ||
| 751 | + // if (model.label != null) { | ||
| 752 | + // List<String> labels = model.label.split(','); | ||
| 753 | + // labels.forEach((element) { | ||
| 754 | + // data.add(flatBtn(element, MyColours.color_B39437)); | ||
| 755 | + // }); | ||
| 756 | + // } | ||
| 757 | + | ||
| 758 | + // if (model.isMember == '1' || model.isMember == '0') { | ||
| 759 | + // data.add(flatBtn( | ||
| 760 | + // model.isMember == '1' ? '会员' : '非会员', MyColours.color_438E93)); | ||
| 761 | + // } | ||
| 762 | + | ||
| 763 | + // if ('${model.storeDay}' != '0' && model.storeDay != null) { | ||
| 764 | + // data.add(flatBtn('存酒${model.storeDay}天', MyColours.color_438E93)); | ||
| 765 | + // } | ||
| 766 | + | ||
| 767 | + return data; | ||
| 768 | + } | ||
| 769 | + | ||
| 663 | @override | 770 | @override |
| 664 | Widget build(BuildContext context) { | 771 | Widget build(BuildContext context) { |
| 665 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); | 772 | customerProvider = Provider.of<CustomerProvider>(context, listen: true); |
| @@ -38,6 +38,7 @@ import 'package:one_key/models/table.dart' as t; | @@ -38,6 +38,7 @@ import 'package:one_key/models/table.dart' as t; | ||
| 38 | import 'package:url_launcher/url_launcher.dart'; | 38 | import 'package:url_launcher/url_launcher.dart'; |
| 39 | 39 | ||
| 40 | import '../models/cookbook_model.dart'; | 40 | import '../models/cookbook_model.dart'; |
| 41 | +import '../models/customer_label_model.dart'; | ||
| 41 | import '../models/get_reserve_type_field_model.dart'; | 42 | import '../models/get_reserve_type_field_model.dart'; |
| 42 | import '../models/radio_model.dart'; | 43 | import '../models/radio_model.dart'; |
| 43 | import '../models/seller_template_color_list_model.dart'; | 44 | import '../models/seller_template_color_list_model.dart'; |
| @@ -51,6 +52,7 @@ typedef CustomCallBackMap = void Function(Map<String, String> object); | @@ -51,6 +52,7 @@ typedef CustomCallBackMap = void Function(Map<String, String> object); | ||
| 51 | 52 | ||
| 52 | typedef ClickCallback = void Function(String value); | 53 | typedef ClickCallback = void Function(String value); |
| 53 | 54 | ||
| 55 | +typedef ClickkListCallbac = void Function(List<String> value); | ||
| 54 | // Example holidays | 56 | // Example holidays |
| 55 | // final Map<DateTime, List> _holidays = { | 57 | // final Map<DateTime, List> _holidays = { |
| 56 | // DateTime(2021, 1, 1): ['元旦节'], | 58 | // DateTime(2021, 1, 1): ['元旦节'], |
| @@ -61,6 +63,84 @@ typedef ClickCallback = void Function(String value); | @@ -61,6 +63,84 @@ typedef ClickCallback = void Function(String value); | ||
| 61 | // }; | 63 | // }; |
| 62 | 64 | ||
| 63 | class DialogUtil { | 65 | class DialogUtil { |
| 66 | + static List<Widget> labelSelectBtn(List<CustomerLabelSunModel> labelList, | ||
| 67 | + state, List<String> datas, ClickkListCallbac callback) { | ||
| 68 | + List<Widget> temp = []; | ||
| 69 | + for (int i = 0; i < labelList.length; i++) { | ||
| 70 | + CustomerLabelSunModel practiceModel = labelList[i]; | ||
| 71 | + temp.add(InkWell( | ||
| 72 | + onTap: () { | ||
| 73 | + // for (int j = 0; j < labelList.length; j++) { | ||
| 74 | + // labelList[j].select = false; | ||
| 75 | + // } | ||
| 76 | + // labelList[i].select = true; | ||
| 77 | + labelList[i].select = !labelList[i].select; | ||
| 78 | + if (labelList[i].select) { | ||
| 79 | + datas.add(labelList[i].label); | ||
| 80 | + } else { | ||
| 81 | + datas.remove(labelList[i].label); | ||
| 82 | + } | ||
| 83 | + callback(datas); | ||
| 84 | + state(() {}); | ||
| 85 | + }, | ||
| 86 | + child: Container( | ||
| 87 | + // height: w(34), | ||
| 88 | + padding: | ||
| 89 | + EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)), | ||
| 90 | + decoration: BoxDecoration( | ||
| 91 | + border: Border.all( | ||
| 92 | + color: practiceModel.select | ||
| 93 | + ? MyColours.color_438E93 | ||
| 94 | + : MyColours.color_515151, | ||
| 95 | + width: w(1)), | ||
| 96 | + borderRadius: BorderRadius.circular(r(5)), | ||
| 97 | + color: practiceModel.select | ||
| 98 | + ? MyColours.color_438E93 | ||
| 99 | + : MyColours.color_ffffff, | ||
| 100 | + ), | ||
| 101 | + child: Text(practiceModel.label, | ||
| 102 | + style: TextStyle( | ||
| 103 | + fontSize: font(14), | ||
| 104 | + color: practiceModel.select | ||
| 105 | + ? MyColours.color_ffffff | ||
| 106 | + : MyColours.color_515151, | ||
| 107 | + )), | ||
| 108 | + )) | ||
| 109 | + | ||
| 110 | + // RoundButton( | ||
| 111 | + // text: practiceModel.name, | ||
| 112 | + // // bgColor: MyColours.color_ffffff, | ||
| 113 | + // gradientStart: practiceModel.select | ||
| 114 | + // ? MyColours.color_438E93 | ||
| 115 | + // : MyColours.color_ffffff, | ||
| 116 | + // gradientEnd: practiceModel.select | ||
| 117 | + // ? MyColours.color_438E93 | ||
| 118 | + // : MyColours.color_ffffff, | ||
| 119 | + // // width: w(80), | ||
| 120 | + // padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)), | ||
| 121 | + // height: w(34), | ||
| 122 | + // isBold: false, | ||
| 123 | + // radius: r(5), | ||
| 124 | + // textColor: practiceModel.select | ||
| 125 | + // ? MyColours.color_ffffff | ||
| 126 | + // : MyColours.color_515151, | ||
| 127 | + // borderColor: practiceModel.select | ||
| 128 | + // ? MyColours.color_438E93 | ||
| 129 | + // : MyColours.color_515151, | ||
| 130 | + // onPressed: () { | ||
| 131 | + // for (int j = 0; j < menuSunModel.length; j++) { | ||
| 132 | + // menuSunModel[j].select = false; | ||
| 133 | + // } | ||
| 134 | + // menuSunModel[i].select = true; | ||
| 135 | + // callback(menuSunModel[i].name); | ||
| 136 | + // state(() {}); | ||
| 137 | + // }, | ||
| 138 | + // ) | ||
| 139 | + ); | ||
| 140 | + } | ||
| 141 | + return temp; | ||
| 142 | + } | ||
| 143 | + | ||
| 64 | static List<Widget> dishSelectBtn( | 144 | static List<Widget> dishSelectBtn( |
| 65 | List<GetReserveTypeFieldsSunModel> menuSunModel, | 145 | List<GetReserveTypeFieldsSunModel> menuSunModel, |
| 66 | state, | 146 | state, |
| @@ -135,6 +215,110 @@ class DialogUtil { | @@ -135,6 +215,110 @@ class DialogUtil { | ||
| 135 | return temp; | 215 | return temp; |
| 136 | } | 216 | } |
| 137 | 217 | ||
| 218 | + ///自定义标签选择 | ||
| 219 | + static openLabelSelectModalBottomSheet( | ||
| 220 | + context, List<CustomerLabelSunModel> labelList, String labelShow, | ||
| 221 | + {VoidCallback lCallback, ClickCallback rCallback}) async { | ||
| 222 | + String selectType = labelShow; | ||
| 223 | + List<String> datas = []; | ||
| 224 | + if (selectType != '') { | ||
| 225 | + datas = selectType.split(','); | ||
| 226 | + labelList.forEach((element) { | ||
| 227 | + element.select = false; | ||
| 228 | + if (datas.contains(element.label)) { | ||
| 229 | + element.select = true; | ||
| 230 | + } | ||
| 231 | + }); | ||
| 232 | + } | ||
| 233 | + final option = await showModalBottomSheet( | ||
| 234 | + context: context, | ||
| 235 | + backgroundColor: Colors.transparent, | ||
| 236 | + isDismissible: false, | ||
| 237 | + isScrollControlled: true, | ||
| 238 | + builder: (BuildContext context) { | ||
| 239 | + return StatefulBuilder(builder: (context, state) { | ||
| 240 | + return Container( | ||
| 241 | + decoration: BoxDecoration( | ||
| 242 | + color: MyColours.color_ffffff, | ||
| 243 | + borderRadius: BorderRadius.only( | ||
| 244 | + topLeft: Radius.circular(ScreenUtil().setWidth(10)), | ||
| 245 | + topRight: Radius.circular(ScreenUtil().setWidth(10)))), | ||
| 246 | + child: Column( | ||
| 247 | + mainAxisSize: MainAxisSize.min, | ||
| 248 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 249 | + children: <Widget>[ | ||
| 250 | + Row( | ||
| 251 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 252 | + children: [ | ||
| 253 | + GestureDetector( | ||
| 254 | + behavior: HitTestBehavior.opaque, | ||
| 255 | + onTap: () { | ||
| 256 | + Navigator.of(context).pop(); | ||
| 257 | + }, | ||
| 258 | + child: Container( | ||
| 259 | + // width: double.infinity, | ||
| 260 | + alignment: Alignment.center, | ||
| 261 | + padding: EdgeInsets.symmetric( | ||
| 262 | + horizontal: w(15), | ||
| 263 | + vertical: ScreenUtil().setWidth(40)), | ||
| 264 | + child: Text( | ||
| 265 | + "取消", | ||
| 266 | + style: TextStyle( | ||
| 267 | + fontSize: ScreenUtil().setSp(32), | ||
| 268 | + color: MyColours.color_438E93), | ||
| 269 | + ), | ||
| 270 | + )), | ||
| 271 | + Container( | ||
| 272 | + // width: double.infinity, | ||
| 273 | + alignment: Alignment.center, | ||
| 274 | + padding: EdgeInsets.symmetric( | ||
| 275 | + vertical: ScreenUtil().setWidth(40)), | ||
| 276 | + child: Text( | ||
| 277 | + "选择自定义标签", | ||
| 278 | + style: TextStyle( | ||
| 279 | + fontWeight: FontWeight.bold, | ||
| 280 | + fontSize: ScreenUtil().setSp(32), | ||
| 281 | + color: MyColours.color_E6000000), | ||
| 282 | + ), | ||
| 283 | + ), | ||
| 284 | + GestureDetector( | ||
| 285 | + behavior: HitTestBehavior.opaque, | ||
| 286 | + onTap: () { | ||
| 287 | + Navigator.of(context).pop(); | ||
| 288 | + rCallback(selectType); | ||
| 289 | + }, | ||
| 290 | + child: Container( | ||
| 291 | + // width: double.infinity, | ||
| 292 | + alignment: Alignment.center, | ||
| 293 | + padding: EdgeInsets.symmetric( | ||
| 294 | + horizontal: w(15), | ||
| 295 | + vertical: ScreenUtil().setWidth(40)), | ||
| 296 | + child: Text("确定", | ||
| 297 | + style: TextStyle( | ||
| 298 | + fontSize: ScreenUtil().setSp(32), | ||
| 299 | + color: MyColours.color_438E93)), | ||
| 300 | + )), | ||
| 301 | + ]), | ||
| 302 | + VEmptyView(50), | ||
| 303 | + Padding( | ||
| 304 | + padding: EdgeInsets.symmetric(horizontal: w(15)), | ||
| 305 | + child: Wrap( | ||
| 306 | + spacing: w(12), | ||
| 307 | + runSpacing: w(12), | ||
| 308 | + children: labelSelectBtn(labelList, state, datas, | ||
| 309 | + (value) { | ||
| 310 | + selectType = value.join(','); | ||
| 311 | + })), | ||
| 312 | + ), | ||
| 313 | + VEmptyView(50), | ||
| 314 | + ])); | ||
| 315 | + }); | ||
| 316 | + }); | ||
| 317 | + labelList.forEach((element) { | ||
| 318 | + element.select = false; | ||
| 319 | + }); | ||
| 320 | + } | ||
| 321 | + | ||
| 138 | ///用餐类型 | 322 | ///用餐类型 |
| 139 | static openDishTypeSelectModalBottomSheet(context, | 323 | static openDishTypeSelectModalBottomSheet(context, |
| 140 | List<GetReserveTypeFieldsSunModel> reserveTypes, String reserveType, | 324 | List<GetReserveTypeFieldsSunModel> reserveTypes, String reserveType, |
| @@ -8317,10 +8501,9 @@ class DialogUtil { | @@ -8317,10 +8501,9 @@ class DialogUtil { | ||
| 8317 | color: rColor)), | 8501 | color: rColor)), |
| 8318 | onPressed: () { | 8502 | onPressed: () { |
| 8319 | Navigator.of(context).pop(); | 8503 | Navigator.of(context).pop(); |
| 8320 | - if(rCallback !=null){ | ||
| 8321 | - rCallback(); | 8504 | + if (rCallback != null) { |
| 8505 | + rCallback(); | ||
| 8322 | } | 8506 | } |
| 8323 | - | ||
| 8324 | }, | 8507 | }, |
| 8325 | ), | 8508 | ), |
| 8326 | ], | 8509 | ], |
-
Please register or login to post a comment