Showing
3 changed files
with
219 additions
and
58 deletions
assets/dialog_close.png
0 → 100644
612 Bytes
| @@ -506,12 +506,12 @@ class DialogUtil { | @@ -506,12 +506,12 @@ class DialogUtil { | ||
| 506 | child: Container( | 506 | child: Container( |
| 507 | decoration: BoxDecoration( | 507 | decoration: BoxDecoration( |
| 508 | border: Border.all( | 508 | border: Border.all( |
| 509 | - color: (data[index].select??false) | 509 | + color: (data[index].select ?? |
| 510 | + false) | ||
| 510 | ? MyColours.color_438E93 | 511 | ? MyColours.color_438E93 |
| 511 | : Colors.transparent, | 512 | : Colors.transparent, |
| 512 | width: w(3))), | 513 | width: w(3))), |
| 513 | - child: Image.network( | ||
| 514 | - data[index].url, | 514 | + child: Image.network(data[index].url, |
| 515 | width: double.infinity, | 515 | width: double.infinity, |
| 516 | height: w(44))))); | 516 | height: w(44))))); |
| 517 | }, | 517 | }, |
| @@ -2816,6 +2816,7 @@ class DialogUtil { | @@ -2816,6 +2816,7 @@ class DialogUtil { | ||
| 2816 | ); | 2816 | ); |
| 2817 | }); | 2817 | }); |
| 2818 | } | 2818 | } |
| 2819 | + | ||
| 2819 | static Future openFTablesChangeDialogOnly( | 2820 | static Future openFTablesChangeDialogOnly( |
| 2820 | BuildContext context, List<TableListReserve> tables, | 2821 | BuildContext context, List<TableListReserve> tables, |
| 2821 | {CustomCallBack onTap}) async { | 2822 | {CustomCallBack onTap}) async { |
| @@ -6657,7 +6658,8 @@ class DialogUtil { | @@ -6657,7 +6658,8 @@ class DialogUtil { | ||
| 6657 | }); | 6658 | }); |
| 6658 | }); | 6659 | }); |
| 6659 | } | 6660 | } |
| 6660 | - static tableListChangeWidgetOnly( | 6661 | + |
| 6662 | + static tableListChangeWidgetOnly( | ||
| 6661 | List<TableListReserve> tables, CustomCallBack callback) { | 6663 | List<TableListReserve> tables, CustomCallBack callback) { |
| 6662 | List<Widget> lists = tables.map((item) { | 6664 | List<Widget> lists = tables.map((item) { |
| 6663 | return remarkButton( | 6665 | return remarkButton( |
| @@ -6673,7 +6675,6 @@ class DialogUtil { | @@ -6673,7 +6675,6 @@ class DialogUtil { | ||
| 6673 | return lists; | 6675 | return lists; |
| 6674 | } | 6676 | } |
| 6675 | 6677 | ||
| 6676 | - | ||
| 6677 | static tableListChangeWidget( | 6678 | static tableListChangeWidget( |
| 6678 | List<TableList> tables, CustomCallBack callback) { | 6679 | List<TableList> tables, CustomCallBack callback) { |
| 6679 | List<Widget> lists = tables.map((item) { | 6680 | List<Widget> lists = tables.map((item) { |
| @@ -6689,7 +6690,8 @@ class DialogUtil { | @@ -6689,7 +6690,8 @@ class DialogUtil { | ||
| 6689 | }).toList(); | 6690 | }).toList(); |
| 6690 | return lists; | 6691 | return lists; |
| 6691 | } | 6692 | } |
| 6692 | - static tableListWidgetNew(List tables, CustomCallBack callback) { | 6693 | + |
| 6694 | + static tableListWidgetNew(List tables, CustomCallBack callback) { | ||
| 6693 | List<Widget> lists = tables.map((item) { | 6695 | List<Widget> lists = tables.map((item) { |
| 6694 | return remarkButton( | 6696 | return remarkButton( |
| 6695 | content: item, | 6697 | content: item, |
| @@ -6916,6 +6918,7 @@ class DialogUtil { | @@ -6916,6 +6918,7 @@ class DialogUtil { | ||
| 6916 | Provider.of<MessageDialogModel>(context, listen: false); | 6918 | Provider.of<MessageDialogModel>(context, listen: false); |
| 6917 | if (messageModel.messages.isEmpty) return null; | 6919 | if (messageModel.messages.isEmpty) return null; |
| 6918 | messageModel.showMessageDialog = true; | 6920 | messageModel.showMessageDialog = true; |
| 6921 | + | ||
| 6919 | await showModalBottomSheet<int>( | 6922 | await showModalBottomSheet<int>( |
| 6920 | context: context, | 6923 | context: context, |
| 6921 | isScrollControlled: true, | 6924 | isScrollControlled: true, |
| @@ -6930,6 +6933,162 @@ class DialogUtil { | @@ -6930,6 +6933,162 @@ class DialogUtil { | ||
| 6930 | Consumer<MessageDialogModel>(builder: (BuildContext context, | 6933 | Consumer<MessageDialogModel>(builder: (BuildContext context, |
| 6931 | MessageDialogModel model, Widget child) { | 6934 | MessageDialogModel model, Widget child) { |
| 6932 | if (messageModel.messages.isEmpty) return Container(); | 6935 | if (messageModel.messages.isEmpty) return Container(); |
| 6936 | + List<Widget> widgetData = []; | ||
| 6937 | + if (model.messages.length > 3) { | ||
| 6938 | + //分类 | ||
| 6939 | + | ||
| 6940 | + int online = 0; //10 在线预订 | ||
| 6941 | + int cancel = 0; //11 取消预订 | ||
| 6942 | + int order = 0; //1 提前点餐 | ||
| 6943 | + int pay = 0; //12 在线买单 | ||
| 6944 | + int payFinish = 0; //13 买单通知 | ||
| 6945 | + int invoice = 0; //14 发票申请 | ||
| 6946 | + int instore = 0; //15 店内消息 | ||
| 6947 | + // int cancelManager = 0; //16 取消预订 | ||
| 6948 | + int recharge = 0; //17 会员充值 | ||
| 6949 | + int wine = 0; //18 存酒超期 | ||
| 6950 | + int commemoration = 0; //19 纪念日提醒 | ||
| 6951 | + // int person = 0; //20 补充预订 店内消息 | ||
| 6952 | + | ||
| 6953 | + model.messages.forEach((element) { | ||
| 6954 | + if (element.message_type == "10") { | ||
| 6955 | + online++; | ||
| 6956 | + } else if (element.message_type == "11" || | ||
| 6957 | + element.message_type == "16") { | ||
| 6958 | + cancel++; | ||
| 6959 | + } else if (element.message_type == "1") { | ||
| 6960 | + order++; | ||
| 6961 | + } else if (element.message_type == "12") { | ||
| 6962 | + pay++; | ||
| 6963 | + } else if (element.message_type == "13") { | ||
| 6964 | + payFinish++; | ||
| 6965 | + } else if (element.message_type == "14") { | ||
| 6966 | + invoice++; | ||
| 6967 | + } else if (element.message_type == "15" || | ||
| 6968 | + element.message_type == "20") { | ||
| 6969 | + instore++; | ||
| 6970 | + } else if (element.message_type == "17") { | ||
| 6971 | + recharge++; | ||
| 6972 | + } else if (element.message_type == "18") { | ||
| 6973 | + wine++; | ||
| 6974 | + } else if (element.message_type == "19") { | ||
| 6975 | + commemoration++; | ||
| 6976 | + } | ||
| 6977 | + }); | ||
| 6978 | + | ||
| 6979 | + if (online > 0) { | ||
| 6980 | + widgetData.add(Padding( | ||
| 6981 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 6982 | + child: Text( | ||
| 6983 | + '在线预订 ${online}个', | ||
| 6984 | + style: TextStyle( | ||
| 6985 | + color: MyColours.color_515151, | ||
| 6986 | + fontSize: font(16)), | ||
| 6987 | + ))); | ||
| 6988 | + } | ||
| 6989 | + if (cancel > 0) { | ||
| 6990 | + widgetData.add(Padding( | ||
| 6991 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 6992 | + child: Text( | ||
| 6993 | + '取消预订 ${cancel}个', | ||
| 6994 | + style: TextStyle( | ||
| 6995 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 6996 | + ))); | ||
| 6997 | + } | ||
| 6998 | + if (order > 0) { | ||
| 6999 | + widgetData.add(Padding( | ||
| 7000 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7001 | + child: Text( | ||
| 7002 | + '提前点餐 ${order}个', | ||
| 7003 | + style: TextStyle( | ||
| 7004 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7005 | + ))); | ||
| 7006 | + } | ||
| 7007 | + if (pay > 0) { | ||
| 7008 | + widgetData.add(Padding( | ||
| 7009 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7010 | + child: Text( | ||
| 7011 | + '在线买单 ${pay}个', | ||
| 7012 | + style: TextStyle( | ||
| 7013 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7014 | + ))); | ||
| 7015 | + } | ||
| 7016 | + if (payFinish > 0) { | ||
| 7017 | + widgetData.add(Padding( | ||
| 7018 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7019 | + child: Text( | ||
| 7020 | + '买单通知 ${payFinish}个', | ||
| 7021 | + style: TextStyle( | ||
| 7022 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7023 | + ))); | ||
| 7024 | + } | ||
| 7025 | + if (invoice > 0) { | ||
| 7026 | + widgetData.add(Padding( | ||
| 7027 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7028 | + child: Text( | ||
| 7029 | + '发票申请 ${invoice}个', | ||
| 7030 | + style: TextStyle( | ||
| 7031 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7032 | + ))); | ||
| 7033 | + } | ||
| 7034 | + if (instore > 0) { | ||
| 7035 | + widgetData.add(Padding( | ||
| 7036 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7037 | + child: Text( | ||
| 7038 | + '店内消息 ${instore}个', | ||
| 7039 | + style: TextStyle( | ||
| 7040 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7041 | + ))); | ||
| 7042 | + } | ||
| 7043 | + if (recharge > 0) { | ||
| 7044 | + widgetData.add(Padding( | ||
| 7045 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7046 | + child: Text( | ||
| 7047 | + '会员充值 ${recharge}个', | ||
| 7048 | + style: TextStyle( | ||
| 7049 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7050 | + ))); | ||
| 7051 | + } | ||
| 7052 | + | ||
| 7053 | + if (wine > 0) { | ||
| 7054 | + widgetData.add(Padding( | ||
| 7055 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7056 | + child: Text( | ||
| 7057 | + '存酒超期 ${wine}个', | ||
| 7058 | + style: TextStyle( | ||
| 7059 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7060 | + ))); | ||
| 7061 | + } | ||
| 7062 | + if (commemoration > 0) { | ||
| 7063 | + widgetData.add(Padding( | ||
| 7064 | + padding: EdgeInsets.only(bottom: w(10)), | ||
| 7065 | + child: Text( | ||
| 7066 | + '纪念日提醒 ${commemoration}个', | ||
| 7067 | + style: TextStyle( | ||
| 7068 | + color: MyColours.color_515151, fontSize: font(16)), | ||
| 7069 | + ))); | ||
| 7070 | + } | ||
| 7071 | + widgetData.add(Row( | ||
| 7072 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 7073 | + children: <Widget>[ | ||
| 7074 | + Spacer(), | ||
| 7075 | + RoundButton( | ||
| 7076 | + text:"立即处理", | ||
| 7077 | + width: w(100), | ||
| 7078 | + height: w(43), | ||
| 7079 | + fontSize: 28, | ||
| 7080 | + gradientStart: MyColours.color_ffffff, | ||
| 7081 | + gradientEnd: MyColours.color_ffffff, | ||
| 7082 | + borderColor: MyColours.color_438E93, | ||
| 7083 | + radius: r(5), | ||
| 7084 | + textColor:MyColours.color_438E93, | ||
| 7085 | + onPressed: () { | ||
| 7086 | + NavigatorUtil.goHomePage(context, initialIndex: 0); | ||
| 7087 | + }, | ||
| 7088 | + ) | ||
| 7089 | + ], | ||
| 7090 | + )); | ||
| 7091 | + } | ||
| 6933 | return Column( | 7092 | return Column( |
| 6934 | mainAxisSize: MainAxisSize.min, | 7093 | mainAxisSize: MainAxisSize.min, |
| 6935 | children: <Widget>[ | 7094 | children: <Widget>[ |
| @@ -6946,9 +7105,9 @@ class DialogUtil { | @@ -6946,9 +7105,9 @@ class DialogUtil { | ||
| 6946 | // top: ScreenUtil().setWidth(21), | 7105 | // top: ScreenUtil().setWidth(21), |
| 6947 | // bottom: ScreenUtil().setWidth(2)), | 7106 | // bottom: ScreenUtil().setWidth(2)), |
| 6948 | child: Text( | 7107 | child: Text( |
| 6949 | - "您有一条新的消息", | 7108 | + "您有${messageModel.messages.length}条新的消息", |
| 6950 | style: TextStyle( | 7109 | style: TextStyle( |
| 6951 | - color: MyColours.color_333333, | 7110 | + color:model.messages.length > 3? MyColours.color_ffffff: MyColours.color_333333, |
| 6952 | fontSize: ScreenUtil().setSp(32)), | 7111 | fontSize: ScreenUtil().setSp(32)), |
| 6953 | )), | 7112 | )), |
| 6954 | Align( | 7113 | Align( |
| @@ -6968,7 +7127,7 @@ class DialogUtil { | @@ -6968,7 +7127,7 @@ class DialogUtil { | ||
| 6968 | bottom: ScreenUtil().setWidth(38), | 7127 | bottom: ScreenUtil().setWidth(38), |
| 6969 | ), | 7128 | ), |
| 6970 | child: Image.asset( | 7129 | child: Image.asset( |
| 6971 | - "assets/close.png", | 7130 | + messageModel.messages.length > 3? "assets/dialog_close.png": "assets/close.png", |
| 6972 | width: ScreenUtil().setWidth(28), | 7131 | width: ScreenUtil().setWidth(28), |
| 6973 | height: ScreenUtil().setWidth(28), | 7132 | height: ScreenUtil().setWidth(28), |
| 6974 | ), | 7133 | ), |
| @@ -6992,55 +7151,57 @@ class DialogUtil { | @@ -6992,55 +7151,57 @@ class DialogUtil { | ||
| 6992 | Radius.circular( | 7151 | Radius.circular( |
| 6993 | ScreenUtil().setWidth(8)))), | 7152 | ScreenUtil().setWidth(8)))), |
| 6994 | child: Column( | 7153 | child: Column( |
| 6995 | - mainAxisSize: MainAxisSize.min, | ||
| 6996 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 6997 | - children: <Widget>[ | ||
| 6998 | - Row( | ||
| 6999 | - crossAxisAlignment: | ||
| 7000 | - CrossAxisAlignment.center, | ||
| 7001 | - children: <Widget>[ | ||
| 7002 | - Text( | ||
| 7003 | - "在线预订", | ||
| 7004 | - style: TextStyle( | ||
| 7005 | - color: MyColours.color_353535, | ||
| 7006 | - fontSize: ScreenUtil().setSp(32)), | ||
| 7007 | - ), | ||
| 7008 | - Spacer(), | ||
| 7009 | - Text( | ||
| 7010 | - "刚刚", | ||
| 7011 | - style: TextStyle( | ||
| 7012 | - color: MyColours.color_999999, | ||
| 7013 | - fontSize: ScreenUtil().setSp(22)), | ||
| 7014 | - ), | ||
| 7015 | - ], | ||
| 7016 | - ), | ||
| 7017 | - VEmptyView(20), | ||
| 7018 | - Text( | ||
| 7019 | - "在线预订:${model.messages.length}个", | ||
| 7020 | - style: TextStyle( | ||
| 7021 | - color: MyColours.color_353535, | ||
| 7022 | - fontSize: ScreenUtil().setSp(32)), | 7154 | + mainAxisSize: MainAxisSize.min, |
| 7155 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 7156 | + children: widgetData | ||
| 7157 | + // <Widget>[ | ||
| 7158 | + // widgetData() | ||
| 7159 | + // Row( | ||
| 7160 | + // crossAxisAlignment: | ||
| 7161 | + // CrossAxisAlignment.center, | ||
| 7162 | + // children: <Widget>[ | ||
| 7163 | + // Text( | ||
| 7164 | + // "在线预订", | ||
| 7165 | + // style: TextStyle( | ||
| 7166 | + // color: MyColours.color_353535, | ||
| 7167 | + // fontSize: ScreenUtil().setSp(32)), | ||
| 7168 | + // ), | ||
| 7169 | + // Spacer(), | ||
| 7170 | + // Text( | ||
| 7171 | + // "刚刚", | ||
| 7172 | + // style: TextStyle( | ||
| 7173 | + // color: MyColours.color_999999, | ||
| 7174 | + // fontSize: ScreenUtil().setSp(22)), | ||
| 7175 | + // ), | ||
| 7176 | + // ], | ||
| 7177 | + // ), | ||
| 7178 | + // VEmptyView(20), | ||
| 7179 | + // Text( | ||
| 7180 | + // "在线预订:${model.messages.length}个", | ||
| 7181 | + // style: TextStyle( | ||
| 7182 | + // color: MyColours.color_353535, | ||
| 7183 | + // fontSize: ScreenUtil().setSp(32)), | ||
| 7184 | + // ), | ||
| 7185 | + // Row( | ||
| 7186 | + // crossAxisAlignment: | ||
| 7187 | + // CrossAxisAlignment.center, | ||
| 7188 | + // children: <Widget>[ | ||
| 7189 | + // Spacer(), | ||
| 7190 | + // CommonButton( | ||
| 7191 | + // width: 160, | ||
| 7192 | + // height: 48, | ||
| 7193 | + // fontSize: 32, | ||
| 7194 | + // content: "立即处理", | ||
| 7195 | + // state: 1, | ||
| 7196 | + // onPress: () { | ||
| 7197 | + // NavigatorUtil.goHomePage(context, | ||
| 7198 | + // initialIndex: 0); | ||
| 7199 | + // }, | ||
| 7200 | + // ) | ||
| 7201 | + // ], | ||
| 7202 | + // ) | ||
| 7203 | + // ], | ||
| 7023 | ), | 7204 | ), |
| 7024 | - Row( | ||
| 7025 | - crossAxisAlignment: | ||
| 7026 | - CrossAxisAlignment.center, | ||
| 7027 | - children: <Widget>[ | ||
| 7028 | - Spacer(), | ||
| 7029 | - CommonButton( | ||
| 7030 | - width: 160, | ||
| 7031 | - height: 48, | ||
| 7032 | - fontSize: 32, | ||
| 7033 | - content: "立即处理", | ||
| 7034 | - state: 1, | ||
| 7035 | - onPress: () { | ||
| 7036 | - NavigatorUtil.goHomePage(context, | ||
| 7037 | - initialIndex: 0); | ||
| 7038 | - }, | ||
| 7039 | - ) | ||
| 7040 | - ], | ||
| 7041 | - ) | ||
| 7042 | - ], | ||
| 7043 | - ), | ||
| 7044 | ) | 7205 | ) |
| 7045 | : ListView.builder( | 7206 | : ListView.builder( |
| 7046 | itemBuilder: (context, index) { | 7207 | itemBuilder: (context, index) { |
| @@ -2246,7 +2246,7 @@ class Utils { | @@ -2246,7 +2246,7 @@ class Utils { | ||
| 2246 | // ..strokeCap = StrokeCap.butt | 2246 | // ..strokeCap = StrokeCap.butt |
| 2247 | // ..strokeWidth = 2; | 2247 | // ..strokeWidth = 2; |
| 2248 | Paint paint = Paint() | 2248 | Paint paint = Paint() |
| 2249 | - ..color = Color.fromRGBO(81, 81, 81, 0.6) | 2249 | + ..color = Color.fromRGBO(81, 81, 81, 0.4) |
| 2250 | ..style = PaintingStyle.fill; | 2250 | ..style = PaintingStyle.fill; |
| 2251 | if (Platform.isIOS) { | 2251 | if (Platform.isIOS) { |
| 2252 | paint = Paint() | 2252 | paint = Paint() |
-
Please register or login to post a comment