社区活动报名按钮状态显示;社区话题点赞

pull/1/head
戴余标 3 years ago
parent 25f3a85ef6
commit 289b78849c

@ -152,7 +152,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
),
),
bottomNavi: BottomButton(
child: '立即报名'.text.size(32.sp).bold.make(),
child: btnText,
onPressed: !canTap
? null
: () async {
@ -166,6 +166,16 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
);
}
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;

@ -174,6 +174,13 @@ class _ChatCardState extends State<ChatCard> {
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(

Loading…
Cancel
Save