diff --git a/lib/ui/community/activity/activity_detail_page.dart b/lib/ui/community/activity/activity_detail_page.dart index b077444c..3e5c4dce 100644 --- a/lib/ui/community/activity/activity_detail_page.dart +++ b/lib/ui/community/activity/activity_detail_page.dart @@ -152,7 +152,7 @@ class _ActivityDetailPageState extends State { ), ), bottomNavi: BottomButton( - child: '立即报名'.text.size(32.sp).bold.make(), + child: btnText, onPressed: !canTap ? null : () async { @@ -166,6 +166,16 @@ class _ActivityDetailPageState extends State { ); } + Widget get btnText{ + if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) { + return '报名截止'.text.size(32.sp).bold.make(); + }else if(_model!.isRegistration==1){ + return '已报名'.text.size(32.sp).bold.make(); + }else{ + return '立即报名'.text.size(32.sp).bold.make(); + } + } + bool get canTap { if ((_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) ||_model!.isRegistration==1) { return false; diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index 1d4b96b4..609115e2 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -174,6 +174,13 @@ class _ChatCardState extends State { super.initState(); } + @override + void didUpdateWidget(covariant ChatCard oldWidget) { + _isLiked = widget.model.isLike; + _likeNum = widget.model.likes; + super.didUpdateWidget(oldWidget); + } + @override Widget build(BuildContext context) { return DecoratedBox(