diff --git a/lib/pages/message_notice_page/message_notice_page.dart b/lib/pages/message_notice_page/message_notice_page.dart index ef20ad4..62c7ad5 100644 --- a/lib/pages/message_notice_page/message_notice_page.dart +++ b/lib/pages/message_notice_page/message_notice_page.dart @@ -57,8 +57,8 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine } /// TODO 需要实现 子widget点击事件,公共跳转 - void _onItemClick(){ - + void _onItemClick(SkipModel model){ + RouterUtil.route(model, model.toJson(), context); } @override @@ -276,7 +276,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine /// 官方通知样式 Widget _buildOfficialNoticeStyleWidget(OfficialNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) { return GestureDetector( - onTap: ()=> _onItemClick(), + onTap: ()=> _onItemClick(styleModel), behavior: HitTestBehavior.opaque, child: Container( padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), @@ -333,7 +333,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine /// 官方活动样式 Widget _buildOfficialActivitiesStyleWidget(OfficialActivityStyle styleModel, MessageNoticeDataItemModel dataModel) { return GestureDetector( - onTap: ()=> _onItemClick(), + onTap: ()=> _onItemClick(styleModel), behavior: HitTestBehavior.opaque, child: Container( padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), @@ -380,7 +380,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine /// 交易通知样式 Widget _buildTradeNoticeStyleWidget(TransactionNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) { return GestureDetector( - onTap: ()=> _onItemClick(), + onTap: ()=> _onItemClick(styleModel), behavior: HitTestBehavior.opaque, child: Container( padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), @@ -426,7 +426,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine /// 推广通知样式 Widget _buildPromoteNoticeStyleWidget(PromotionNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) { return GestureDetector( - onTap: ()=> _onItemClick(), + onTap: ()=> _onItemClick(styleModel), behavior: HitTestBehavior.opaque, child: Container( padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10), @@ -480,7 +480,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine /// 反馈通知样式 Widget _buildFeedbackNoticeStyleWidget(FeedbackNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) { return GestureDetector( - onTap: ()=> _onItemClick(), + onTap: ()=> _onItemClick(styleModel), behavior: HitTestBehavior.opaque, child: Container( padding: const EdgeInsets.only(left: 15, right: 15, top: 14, bottom: 10), diff --git a/lib/pages/message_notice_page/model/message_notice_style_model.dart b/lib/pages/message_notice_page/model/message_notice_style_model.dart index 5e19417..60b2d43 100644 --- a/lib/pages/message_notice_page/model/message_notice_style_model.dart +++ b/lib/pages/message_notice_page/model/message_notice_style_model.dart @@ -1,3 +1,6 @@ +import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart'; +import 'package:zhiying_comm/models/base/skip_model.dart'; + class MessageNoticeStyleModel { bool isFist; String styleType; @@ -78,7 +81,7 @@ class MessageNoticeStyleModel { } } -class FeedbackNotificationStyle { +class FeedbackNotificationStyle extends SkipModel { String bg_color; String icon; String message_value_color; @@ -95,19 +98,29 @@ class FeedbackNotificationStyle { this.title_value_color, }); - factory FeedbackNotificationStyle.fromJson(Map json) { - return FeedbackNotificationStyle( - bg_color: json['bg_color'], - icon: json['icon'], - message_value_color: json['message_value_color'], - skip_identifier: json['skip_identifier'], - time_color: json['time_color'], - title_value_color: json['title_value_color'], - ); + // factory FeedbackNotificationStyle.fromJson(Map json) { + // return FeedbackNotificationStyle( + // bg_color: json['bg_color'], + // icon: json['icon'], + // message_value_color: json['message_value_color'], + // skip_identifier: json['skip_identifier'], + // time_color: json['time_color'], + // title_value_color: json['title_value_color'], + // ); + // } + + FeedbackNotificationStyle.fromJson(Map json) { + super.fromJson(json); + bg_color = json['bg_color']; + icon = json['icon']; + message_value_color = json['message_value_color']; + skip_identifier = json['skip_identifier']; + time_color = json['time_color']; + title_value_color = json['title_value_color']; } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['bg_color'] = this.bg_color; data['icon'] = this.icon; data['message_value_color'] = this.message_value_color; @@ -144,7 +157,7 @@ class MainNotificationStyle { } } -class MainNotificationStyleItem { +class MainNotificationStyleItem extends SkipModel { String bg_color; String icon; String name; @@ -188,7 +201,7 @@ class MainNotificationStyleItem { } } -class OfficialActivityStyle { +class OfficialActivityStyle extends SkipModel { String bg_color; String message_value_color; String skip_identifier; @@ -203,18 +216,17 @@ class OfficialActivityStyle { this.title_value_color, }); - factory OfficialActivityStyle.fromJson(Map json) { - return OfficialActivityStyle( - bg_color: json['bg_color'], - message_value_color: json['message_value_color'], - skip_identifier: json['skip_identifier'], - time_color: json['time_color'], - title_value_color: json['title_value_color'], - ); + OfficialActivityStyle.fromJson(Map json) { + super.fromJson(json); + bg_color = json['bg_color']; + message_value_color = json['message_value_color']; + skip_identifier = json['skip_identifier']; + time_color = json['time_color']; + title_value_color = json['title_value_color']; } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['bg_color'] = this.bg_color; data['message_value_color'] = this.message_value_color; data['skip_identifier'] = this.skip_identifier; @@ -224,7 +236,7 @@ class OfficialActivityStyle { } } -class OfficialNotificationStyle { +class OfficialNotificationStyle extends SkipModel { String bg_color; String icon; String message_value_color; @@ -241,19 +253,18 @@ class OfficialNotificationStyle { this.title_value_color, }); - factory OfficialNotificationStyle.fromJson(Map json) { - return OfficialNotificationStyle( - bg_color: json['bg_color'], - icon: json['icon'], - message_value_color: json['message_value_color'], - skip_identifier: json['skip_identifier'], - time_color: json['time_color'], - title_value_color: json['title_value_color'], - ); + OfficialNotificationStyle.fromJson(Map json) { + super.fromJson(json); + bg_color = json['bg_color']; + icon = json['icon']; + message_value_color = json['message_value_color']; + skip_identifier = json['skip_identifier']; + time_color = json['time_color']; + title_value_color = json['title_value_color']; } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['bg_color'] = this.bg_color; data['icon'] = this.icon; data['message_value_color'] = this.message_value_color; @@ -264,7 +275,7 @@ class OfficialNotificationStyle { } } -class PromotionNotificationStyle { +class PromotionNotificationStyle extends SkipModel { String bg_color; String icon; String message_value_color; @@ -281,19 +292,28 @@ class PromotionNotificationStyle { this.title_value_color, }); - factory PromotionNotificationStyle.fromJson(Map json) { - return PromotionNotificationStyle( - bg_color: json['bg_color'], - icon: json['icon'], - message_value_color: json['message_value_color'], - skip_identifier: json['skip_identifier'], - time_color: json['time_color'], - title_value_color: json['title_value_color'], - ); + // factory PromotionNotificationStyle.fromJson(Map json) { + // return PromotionNotificationStyle( + // bg_color: json['bg_color'], + // icon: json['icon'], + // message_value_color: json['message_value_color'], + // skip_identifier: json['skip_identifier'], + // time_color: json['time_color'], + // title_value_color: json['title_value_color'], + // ); + // } + PromotionNotificationStyle.fromJson(Map json) { + super.fromJson(json); + bg_color = json['bg_color']; + icon = json['icon']; + message_value_color = json['message_value_color']; + skip_identifier = json['skip_identifier']; + time_color = json['time_color']; + title_value_color = json['title_value_color']; } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['bg_color'] = this.bg_color; data['icon'] = this.icon; data['message_value_color'] = this.message_value_color; @@ -304,7 +324,7 @@ class PromotionNotificationStyle { } } -class TransactionNotificationStyle { +class TransactionNotificationStyle extends SkipModel { String bg_color; String earnings; String icon; @@ -323,20 +343,31 @@ class TransactionNotificationStyle { this.title_value_color, }); - factory TransactionNotificationStyle.fromJson(Map json) { - return TransactionNotificationStyle( - bg_color: json['bg_color'], - earnings: json['earnings'], - icon: json['icon'], - message_value_color: json['message_value_color'], - skip_identifier: json['skip_identifier'], - time_color: json['time_color'], - title_value_color: json['title_value_color'], - ); + // factory TransactionNotificationStyle.fromJson(Map json) { + // return TransactionNotificationStyle( + // bg_color: json['bg_color'], + // earnings: json['earnings'], + // icon: json['icon'], + // message_value_color: json['message_value_color'], + // skip_identifier: json['skip_identifier'], + // time_color: json['time_color'], + // title_value_color: json['title_value_color'], + // ); + // } + + TransactionNotificationStyle.fromJson(Map json) { + super.fromJson(json); + bg_color = json['bg_color']; + earnings = json['earnings']; + icon = json['icon']; + message_value_color = json['message_value_color']; + skip_identifier = json['skip_identifier']; + time_color = json['time_color']; + title_value_color = json['title_value_color']; } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['bg_color'] = this.bg_color; data['earnings'] = this.earnings; data['icon'] = this.icon; diff --git a/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart b/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart index aae9488..237b272 100644 --- a/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart +++ b/lib/widgets/hot_ranking/hot_ranking_goods/hot_ranking_goods.dart @@ -40,6 +40,7 @@ class HotRankingGoods extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ + /// 商品图片 Container( width: 254.w, height: 254.w, @@ -52,59 +53,55 @@ class HotRankingGoods extends StatelessWidget { decoration: BoxDecoration(borderRadius: BorderRadius.circular(6)), ), + /// 商品图片右边视图 Expanded( child: Container( margin: EdgeInsets.only(left: 20.w), child: Column( - mainAxisSize: MainAxisSize.max, + // mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - height: 70.h, - child: Row( - children: [ - Expanded( - child: RichText( - textAlign: TextAlign.start, - overflow: TextOverflow.ellipsis, - maxLines: 2, - text: TextSpan(children: [ - WidgetSpan( - alignment: - ui.PlaceholderAlignment.middle, - child: Container( - padding: EdgeInsets.only( - left: 4.w, - right: 4.w, - top: 1, - bottom: 1), - decoration: BoxDecoration( - color: HexColor.fromHex( - providers.providerBgColor), - borderRadius: - BorderRadius.circular(2.5)), - child: Text( - good.providerName ?? "", - style: TextStyle( - color: HexColor.fromHex( - providers.providerNameColor, - ), - fontSize: 18.sp), - ), - )), - WidgetSpan( - child: SizedBox( - width: 4.h, - )), - TextSpan( - text: good.goodTitle, - style: TextStyle( - color: HexColor.fromHex( - styleModel.titleColor ?? ""), - fontSize: 30.sp)) - ]))) - ], - ), - ), + /// 商品标题 + RichText( + textAlign: TextAlign.start, + overflow: TextOverflow.ellipsis, + maxLines: 2, + text: TextSpan(children: [ + WidgetSpan( + alignment: ui.PlaceholderAlignment.middle, + child: Container( + padding: EdgeInsets.only( + left: 4.w, + right: 4.w, + top: 1, + bottom: 1), + decoration: BoxDecoration( + color: HexColor.fromHex( + providers.providerBgColor), + borderRadius: + BorderRadius.circular(2.5)), + child: Text( + good.providerName ?? "", + style: TextStyle( + color: HexColor.fromHex( + providers.providerNameColor, + ), + fontSize: 18.sp), + ), + )), + WidgetSpan( + child: SizedBox( + width: 4.h, + )), + TextSpan( + text: good.goodTitle, + style: TextStyle( + color: HexColor.fromHex( + styleModel.titleColor ?? ""), + fontSize: 30.sp)) + ])), + + /// 优惠券 Row( children: [ good.coupon == "" @@ -170,6 +167,8 @@ class HotRankingGoods extends StatelessWidget { ), ], ), + + /// 价格 Padding( padding: const EdgeInsets.only(top: 4, bottom: 4), child: Row( @@ -209,6 +208,8 @@ class HotRankingGoods extends StatelessWidget { ], ), ), + + /// 热抢 Row( children: [ Expanded( diff --git a/lib/widgets/team/input/team_input_widget.dart b/lib/widgets/team/input/team_input_widget.dart index 3f539b2..0fa75fa 100644 --- a/lib/widgets/team/input/team_input_widget.dart +++ b/lib/widgets/team/input/team_input_widget.dart @@ -160,8 +160,10 @@ class _TeamInputWidgetState extends State { behavior: HitTestBehavior.opaque, onTap: () => _onSearchClick(), child: Container( + height: double.infinity, + alignment: Alignment.center, decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: HexColor.fromHex(widget?.styleModel?.searchBarBtnBgColor ?? '#FF4242')), - padding: const EdgeInsets.only(left: 15, right: 15, bottom: 6.5, top: 6.5), + padding: const EdgeInsets.only(left: 15, right: 15, ), child: Text( widget?.styleModel?.searchBarBtnText ?? '搜索', style: TextStyle(color: HexColor.fromHex(widget?.styleModel?.searchBarBtnTextColor ?? '#FFFFFF'), fontSize: 11),