Commit e4c8ee48cc40d55a5a11c91e796eeece416e67b0

Authored by wdn127929
1 parent 2dc32118

照片管理返回时 我的 页面电池条变色

@@ -26,6 +26,7 @@ import 'package:one_key/widgets/common_button.dart'; @@ -26,6 +26,7 @@ import 'package:one_key/widgets/common_button.dart';
26 import 'package:one_key/widgets/f_table_item.dart'; 26 import 'package:one_key/widgets/f_table_item.dart';
27 import 'package:one_key/widgets/h_empty_view.dart'; 27 import 'package:one_key/widgets/h_empty_view.dart';
28 import 'package:one_key/widgets/page_exception.dart'; 28 import 'package:one_key/widgets/page_exception.dart';
  29 +import 'package:one_key/widgets/system_app_bar.dart';
29 import 'package:one_key/widgets/table_item.dart'; 30 import 'package:one_key/widgets/table_item.dart';
30 import 'package:one_key/models/table.dart' as t; 31 import 'package:one_key/models/table.dart' as t;
31 import 'package:one_key/widgets/v_empty_view.dart'; 32 import 'package:one_key/widgets/v_empty_view.dart';
@@ -543,271 +544,284 @@ class PhotoManagerPageState extends State<PhotoManagerPage> { @@ -543,271 +544,284 @@ class PhotoManagerPageState extends State<PhotoManagerPage> {
543 body: SafeArea( 544 body: SafeArea(
544 child: Column( 545 child: Column(
545 children: <Widget>[ 546 children: <Widget>[
546 - MyAppBar( 547 + SystemAppBar(
547 "照片管理", 548 "照片管理",
548 - showBack: true, 549 + onTap: () {
  550 + EventBus().emit('changeStatusColor');
  551 + Navigator.of(context).pop();
  552 + },
549 ), 553 ),
550 - Expanded(  
551 - child: Consumer<ChooseTableModel>(builder: (context, model, _) {  
552 - if (model.pageState != PageState.Success) {  
553 - return ExceptionPage(  
554 - pageState: model.pageState,  
555 - callback: () {  
556 - getTableList();  
557 - },  
558 - emptyMsg: "暂时没有桌位哦",  
559 - emptyImg: "empty_search",  
560 - showMsg: "加载中,请稍后...",  
561 - );  
562 - } else {  
563 - return Column(  
564 - // crossAxisAlignment: CrossAxisAlignment.center,  
565 - children: [  
566 - Container(  
567 - color: MyColours.color_ffffff,  
568 - height: ScreenUtil().setWidth(92),  
569 - margin:  
570 - EdgeInsets.only(bottom: ScreenUtil().setWidth(30)),  
571 - child: Row(  
572 - children: [  
573 - HEmptyView(20),  
574 - Expanded(  
575 - child: ListView.builder(  
576 - itemCount: areas.length == 0  
577 - ? 0  
578 - : areas.length + 1,  
579 - shrinkWrap: true,  
580 - scrollDirection: Axis.horizontal,  
581 - itemBuilder:  
582 - (BuildContext contxt, int index) {  
583 - // if (index == areas.length + 1 ||  
584 - // areas.length == 0) {  
585 - // return InkWell(  
586 - // onTap: () async {  
587 - // //添加区域弹框  
588 - // await DialogUtil.openCreateAreaDialog(  
589 - // context, onTap: (value) async {  
590 - // print(value);  
591 - // //添加区域  
592 - // bool success = await _chooseTableModel  
593 - // .addTableAreas(context, value);  
594 - // print(success);  
595 - // if (success) {  
596 - // Utils.showToast('添加成功!');  
597 - // UserModel userModel =  
598 - // Provider.of<UserModel>(context,  
599 - // listen: false);  
600 - // Map<String, String> params = {  
601 - // "sellerid": userModel.user.sellerid  
602 - // };  
603 - // await _chooseTableModel.getTableList(  
604 - // context, params,  
605 - // needLoading: false);  
606 - // initData();  
607 -  
608 - // // setState(() {  
609 - // // updateMenu();  
610 - // // });  
611 - // // _scrollToIndex(widget  
612 - // // .tableManagerModel  
613 - // // .areas  
614 - // // .length);  
615 -  
616 - // }  
617 - // });  
618 - // },  
619 - // child: Column(  
620 - // children: [  
621 - // VEmptyView(20),  
622 - // DottedBorder(  
623 - // dashPattern: [5, 5, 5, 5],  
624 - // borderType: BorderType.RRect,  
625 - // radius: Radius.circular(  
626 - // ScreenUtil().setWidth(10)),  
627 - // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),  
628 - // color: MyColours.color_199095,  
629 - // strokeWidth: ScreenUtil().setWidth(2),  
630 - // child: ClipRRect(  
631 - // borderRadius: BorderRadius.all(  
632 - // Radius.circular(  
633 - // ScreenUtil().setWidth(10))),  
634 - // child: Container(  
635 - // height:  
636 - // ScreenUtil().setWidth(25 * 2),  
637 - // width: ScreenUtil()  
638 - // .setWidth(104 * 2),  
639 - // child: Column(  
640 - // mainAxisAlignment:  
641 - // MainAxisAlignment.center,  
642 - // children: [  
643 - // Image.asset(  
644 - // Utils.getImgPath(  
645 - // 'add_area'),  
646 - // width: ScreenUtil()  
647 - // .setWidth(24)),  
648 - // ],  
649 - // ),  
650 - // ),  
651 - // ),  
652 - // )  
653 - // ],  
654 - // ),  
655 - // );  
656 - // } else {  
657 - if (index == 0) {  
658 - return InkWell(  
659 - onTap: () {  
660 - setState(() {  
661 - isSelected = true;  
662 - currentArea = '全部';  
663 - _chooseTableModel.currentTables =  
664 - _chooseTableModel  
665 - .areaTableMapShow[  
666 - currentArea];  
667 - });  
668 - },  
669 - child: Container(  
670 - // width: ScreenUtil().setWidth(104 * 2),  
671 - height: ScreenUtil().setWidth(80),  
672 - margin: EdgeInsets.only(  
673 - right: ScreenUtil().setWidth(20),  
674 - top: ScreenUtil().setWidth(20),  
675 - ),  
676 - padding: EdgeInsets.symmetric(  
677 - horizontal: 554 + WillPopScope(
  555 + onWillPop: () {
  556 + EventBus().emit('changeStatusColor');
  557 + Navigator.of(context).pop();
  558 + },
  559 + child: Expanded(
  560 + child: Consumer<ChooseTableModel>(builder: (context, model, _) {
  561 + if (model.pageState != PageState.Success) {
  562 + return ExceptionPage(
  563 + pageState: model.pageState,
  564 + callback: () {
  565 + getTableList();
  566 + },
  567 + emptyMsg: "暂时没有桌位哦",
  568 + emptyImg: "empty_search",
  569 + showMsg: "加载中,请稍后...",
  570 + );
  571 + } else {
  572 + return Column(
  573 + // crossAxisAlignment: CrossAxisAlignment.center,
  574 + children: [
  575 + Container(
  576 + color: MyColours.color_ffffff,
  577 + height: ScreenUtil().setWidth(92),
  578 + margin: EdgeInsets.only(
  579 + bottom: ScreenUtil().setWidth(30)),
  580 + child: Row(
  581 + children: [
  582 + HEmptyView(20),
  583 + Expanded(
  584 + child: ListView.builder(
  585 + itemCount: areas.length == 0
  586 + ? 0
  587 + : areas.length + 1,
  588 + shrinkWrap: true,
  589 + scrollDirection: Axis.horizontal,
  590 + itemBuilder:
  591 + (BuildContext contxt, int index) {
  592 + // if (index == areas.length + 1 ||
  593 + // areas.length == 0) {
  594 + // return InkWell(
  595 + // onTap: () async {
  596 + // //添加区域弹框
  597 + // await DialogUtil.openCreateAreaDialog(
  598 + // context, onTap: (value) async {
  599 + // print(value);
  600 + // //添加区域
  601 + // bool success = await _chooseTableModel
  602 + // .addTableAreas(context, value);
  603 + // print(success);
  604 + // if (success) {
  605 + // Utils.showToast('添加成功!');
  606 + // UserModel userModel =
  607 + // Provider.of<UserModel>(context,
  608 + // listen: false);
  609 + // Map<String, String> params = {
  610 + // "sellerid": userModel.user.sellerid
  611 + // };
  612 + // await _chooseTableModel.getTableList(
  613 + // context, params,
  614 + // needLoading: false);
  615 + // initData();
  616 +
  617 + // // setState(() {
  618 + // // updateMenu();
  619 + // // });
  620 + // // _scrollToIndex(widget
  621 + // // .tableManagerModel
  622 + // // .areas
  623 + // // .length);
  624 +
  625 + // }
  626 + // });
  627 + // },
  628 + // child: Column(
  629 + // children: [
  630 + // VEmptyView(20),
  631 + // DottedBorder(
  632 + // dashPattern: [5, 5, 5, 5],
  633 + // borderType: BorderType.RRect,
  634 + // radius: Radius.circular(
  635 + // ScreenUtil().setWidth(10)),
  636 + // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
  637 + // color: MyColours.color_199095,
  638 + // strokeWidth: ScreenUtil().setWidth(2),
  639 + // child: ClipRRect(
  640 + // borderRadius: BorderRadius.all(
  641 + // Radius.circular(
  642 + // ScreenUtil().setWidth(10))),
  643 + // child: Container(
  644 + // height:
  645 + // ScreenUtil().setWidth(25 * 2),
  646 + // width: ScreenUtil()
  647 + // .setWidth(104 * 2),
  648 + // child: Column(
  649 + // mainAxisAlignment:
  650 + // MainAxisAlignment.center,
  651 + // children: [
  652 + // Image.asset(
  653 + // Utils.getImgPath(
  654 + // 'add_area'),
  655 + // width: ScreenUtil()
  656 + // .setWidth(24)),
  657 + // ],
  658 + // ),
  659 + // ),
  660 + // ),
  661 + // )
  662 + // ],
  663 + // ),
  664 + // );
  665 + // } else {
  666 + if (index == 0) {
  667 + return InkWell(
  668 + onTap: () {
  669 + setState(() {
  670 + isSelected = true;
  671 + currentArea = '全部';
  672 + _chooseTableModel
  673 + .currentTables =
  674 + _chooseTableModel
  675 + .areaTableMapShow[
  676 + currentArea];
  677 + });
  678 + },
  679 + child: Container(
  680 + // width: ScreenUtil().setWidth(104 * 2),
  681 + height: ScreenUtil().setWidth(80),
  682 + margin: EdgeInsets.only(
  683 + right:
678 ScreenUtil().setWidth(20), 684 ScreenUtil().setWidth(20),
679 - vertical:  
680 - ScreenUtil().setWidth(10)),  
681 - alignment: Alignment.center,  
682 - decoration: BoxDecoration(  
683 - // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),  
684 - color: isSelected  
685 - ? MyColours.color_199095  
686 - : MyColours.color_ffffff,  
687 - border: Border.all(  
688 - color:  
689 - MyColours.color_E0E0E0,  
690 - width: ScreenUtil()  
691 - .setWidth(2))),  
692 - child: Text(  
693 - '全部',  
694 - overflow: TextOverflow.ellipsis,  
695 - style: TextStyle( 685 + top: ScreenUtil().setWidth(20),
  686 + ),
  687 + padding: EdgeInsets.symmetric(
  688 + horizontal:
  689 + ScreenUtil().setWidth(20),
  690 + vertical: ScreenUtil()
  691 + .setWidth(10)),
  692 + alignment: Alignment.center,
  693 + decoration: BoxDecoration(
  694 + // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
696 color: isSelected 695 color: isSelected
697 - ? MyColours.color_ffffff  
698 - : MyColours.color_333333,  
699 - fontSize:  
700 - ScreenUtil().setSp(28),  
701 - decoration:  
702 - TextDecoration.none,  
703 - fontWeight:  
704 - FontWeight.normal), 696 + ? MyColours.color_199095
  697 + : MyColours.color_ffffff,
  698 + border: Border.all(
  699 + color: MyColours
  700 + .color_E0E0E0,
  701 + width: ScreenUtil()
  702 + .setWidth(2))),
  703 + child: Text(
  704 + '全部',
  705 + overflow: TextOverflow.ellipsis,
  706 + style: TextStyle(
  707 + color: isSelected
  708 + ? MyColours.color_ffffff
  709 + : MyColours
  710 + .color_333333,
  711 + fontSize:
  712 + ScreenUtil().setSp(28),
  713 + decoration:
  714 + TextDecoration.none,
  715 + fontWeight:
  716 + FontWeight.normal),
  717 + ),
705 ), 718 ),
706 - ),  
707 - );  
708 - } else {  
709 - return AreaItemTable(  
710 - areas[index - 1],  
711 - currentArea,  
712 - (area) {  
713 - setState(() {  
714 - isSelected = false;  
715 - _selectNumber = index - 1;  
716 - currentArea =  
717 - areas[index - 1].name;  
718 - _chooseTableModel.currentTables =  
719 - _chooseTableModel  
720 - .areaTableMapShow[  
721 - currentArea];  
722 - // _anmationMenu();  
723 - });  
724 - },  
725 - showBadge: false,  
726 - ); 719 + );
  720 + } else {
  721 + return AreaItemTable(
  722 + areas[index - 1],
  723 + currentArea,
  724 + (area) {
  725 + setState(() {
  726 + isSelected = false;
  727 + _selectNumber = index - 1;
  728 + currentArea =
  729 + areas[index - 1].name;
  730 + _chooseTableModel
  731 + .currentTables =
  732 + _chooseTableModel
  733 + .areaTableMapShow[
  734 + currentArea];
  735 + // _anmationMenu();
  736 + });
  737 + },
  738 + showBadge: false,
  739 + );
  740 + }
727 } 741 }
728 - }  
729 - // },  
730 - )),  
731 - ], 742 + // },
  743 + )),
  744 + ],
  745 + ),
732 ), 746 ),
733 - ),  
734 - Expanded(  
735 - flex: 2,  
736 - child: Container(  
737 - constraints: BoxConstraints(  
738 - minHeight: ScreenUtil().setWidth(100)),  
739 - color: Color.fromRGBO(249, 249, 249, 1),  
740 - child: item(_selectNumber))),  
741 - // Container(  
742 - // width: double.infinity,  
743 - // height: ScreenUtil().setHeight(84),  
744 - // margin: EdgeInsets.only(  
745 - // bottom: ScreenUtil().setWidth(50)),  
746 - // padding: EdgeInsets.symmetric(  
747 - // horizontal: ScreenUtil().setWidth(31)),  
748 - // alignment: Alignment.center,  
749 - // color: MyColours.color_ffffff,  
750 - // child: CommonButton(  
751 - // // content: widget.fromPage == 'tablePhoto'  
752 - // // ? '确定'  
753 - // // : "已选${selectNum}个 确定",  
754 - // content: '确定',  
755 - // width: 300,  
756 - // height: 84,  
757 - // fontSize: 34,  
758 - // state: 1,  
759 - // onPress: () {  
760 - // if (widget.fromPage == "tablePhoto") {  
761 - // Map temp = {  
762 - // 'tid': selectTables.length > 0  
763 - // ? selectTables[0].id  
764 - // : '',  
765 - // 'tname': selectTables.length > 0  
766 - // ? selectTables[0].name  
767 - // : ''  
768 - // };  
769 - // Navigator.of(context).pop(temp);  
770 - // } else {  
771 - // if (widget.canChoose) {  
772 - // // if (widget.tableList.length > 0) {  
773 - // String tid = "";  
774 - // for (TableList table in widget.tableList) {  
775 - // tid += table.id + ",";  
776 - // }  
777 - // if (widget.tableList.length > 0) {  
778 - // tid = tid.substring(0, tid.length - 1);  
779 - // }  
780 -  
781 - // Map temp = {  
782 - // 'object': widget.tableList,  
783 - // 'tid': tid  
784 - // };  
785 - // Navigator.of(context).pop(temp);  
786 - // // }  
787 - // } else {  
788 - // if (selectTables.length > 0) {  
789 - // String tid = "";  
790 - // for (t.Table table in selectTables) {  
791 - // tid += table.id + ",";  
792 - // }  
793 - // if (selectTables.length > 0) {  
794 - // tid = tid.substring(0, tid.length - 1);  
795 - // }  
796 -  
797 - // Map temp = {  
798 - // 'object': widget.tableList,  
799 - // 'tid': tid  
800 - // };  
801 - // Navigator.of(context).pop(temp);  
802 - // }  
803 - // }  
804 - // }  
805 - // },  
806 - // )),  
807 - ]);  
808 - }  
809 - }),  
810 - ), 747 + Expanded(
  748 + flex: 2,
  749 + child: Container(
  750 + constraints: BoxConstraints(
  751 + minHeight: ScreenUtil().setWidth(100)),
  752 + color: Color.fromRGBO(249, 249, 249, 1),
  753 + child: item(_selectNumber))),
  754 + // Container(
  755 + // width: double.infinity,
  756 + // height: ScreenUtil().setHeight(84),
  757 + // margin: EdgeInsets.only(
  758 + // bottom: ScreenUtil().setWidth(50)),
  759 + // padding: EdgeInsets.symmetric(
  760 + // horizontal: ScreenUtil().setWidth(31)),
  761 + // alignment: Alignment.center,
  762 + // color: MyColours.color_ffffff,
  763 + // child: CommonButton(
  764 + // // content: widget.fromPage == 'tablePhoto'
  765 + // // ? '确定'
  766 + // // : "已选${selectNum}个 确定",
  767 + // content: '确定',
  768 + // width: 300,
  769 + // height: 84,
  770 + // fontSize: 34,
  771 + // state: 1,
  772 + // onPress: () {
  773 + // if (widget.fromPage == "tablePhoto") {
  774 + // Map temp = {
  775 + // 'tid': selectTables.length > 0
  776 + // ? selectTables[0].id
  777 + // : '',
  778 + // 'tname': selectTables.length > 0
  779 + // ? selectTables[0].name
  780 + // : ''
  781 + // };
  782 + // Navigator.of(context).pop(temp);
  783 + // } else {
  784 + // if (widget.canChoose) {
  785 + // // if (widget.tableList.length > 0) {
  786 + // String tid = "";
  787 + // for (TableList table in widget.tableList) {
  788 + // tid += table.id + ",";
  789 + // }
  790 + // if (widget.tableList.length > 0) {
  791 + // tid = tid.substring(0, tid.length - 1);
  792 + // }
  793 +
  794 + // Map temp = {
  795 + // 'object': widget.tableList,
  796 + // 'tid': tid
  797 + // };
  798 + // Navigator.of(context).pop(temp);
  799 + // // }
  800 + // } else {
  801 + // if (selectTables.length > 0) {
  802 + // String tid = "";
  803 + // for (t.Table table in selectTables) {
  804 + // tid += table.id + ",";
  805 + // }
  806 + // if (selectTables.length > 0) {
  807 + // tid = tid.substring(0, tid.length - 1);
  808 + // }
  809 +
  810 + // Map temp = {
  811 + // 'object': widget.tableList,
  812 + // 'tid': tid
  813 + // };
  814 + // Navigator.of(context).pop(temp);
  815 + // }
  816 + // }
  817 + // }
  818 + // },
  819 + // )),
  820 + ]);
  821 + }
  822 + }),
  823 + ),
  824 + )
811 ], 825 ],
812 ), 826 ),
813 )); 827 ));