社区报名接口对接

hmxc
小赖 4 years ago
parent 6c030f22fd
commit 2bdbd99efb

@ -203,6 +203,8 @@ class _Community {
/// ///
String get sendAComment => '/user/gambit/comment'; String get sendAComment => '/user/gambit/comment';
///
String get signUpActivity => '/user/activity/signUp';
} }
class _Upload { class _Upload {

@ -22,7 +22,7 @@ class ActivityCard extends StatelessWidget {
String get firstPath => String get firstPath =>
(model.imgUrls?.isEmpty ?? true) ? null : model.imgUrls.first.url; (model.imgUrls?.isEmpty ?? true) ? null : model.imgUrls.first.url;
bool get outdate => model.end.compareTo(DateTime.now()) == -1;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialButton( return MaterialButton(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
@ -51,6 +51,7 @@ class ActivityCard extends StatelessWidget {
image: API.image(firstPath), image: API.image(firstPath),
height: 210.w, height: 210.w,
width: double.infinity, width: double.infinity,
fit: BoxFit.cover,
), ),
), ),
), ),
@ -87,8 +88,11 @@ class ActivityCard extends StatelessWidget {
shape: StadiumBorder(), shape: StadiumBorder(),
height: 44.w, height: 44.w,
minWidth: 120.w, minWidth: 120.w,
onPressed: () {}, disabledColor: Color(0xFFABABAB),
child: '去看看'.text.size(20.sp).bold.make(), onPressed: outdate ? null : ActivityDetailPage(id: model.id).to,
child: outdate
? '已结束'.text.size(20.sp).bold.make()
: '去看看'.text.size(20.sp).bold.make(),
), ),
].row().p(24.w), ].row().p(24.w),
], ],

@ -1,4 +1,6 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,7 +33,8 @@ class ActivityDetailPage extends StatefulWidget {
class _ActivityDetailPageState extends State<ActivityDetailPage> { class _ActivityDetailPageState extends State<ActivityDetailPage> {
ActivityDetailModel model; ActivityDetailModel model;
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
bool get outdate =>
(model?.registEndDate ?? DateTime(0)).compareTo(DateTime.now()) == -1;
Widget get emptyWidget => Shimmer.fromColors( Widget get emptyWidget => Shimmer.fromColors(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -121,6 +124,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: e.url, image: e.url,
fit: BoxFit.cover,
), ),
), ),
), ),
@ -184,6 +188,20 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
], ],
), ),
).material(color: Colors.white), ).material(color: Colors.white),
bottomNavi: outdate
? SizedBox()
: BottomButton(
onPressed: () async {
VoidCallback cancel = BotToast.showLoading();
NetUtil().get(
API.community.signUpActivity,
params: {'activityId': widget.id},
showMessage: true,
);
cancel();
},
child: '我要报名'.text.make(),
),
); );
} }
} }

@ -34,6 +34,7 @@ class StackAvatar extends StatelessWidget {
width: 44.w, width: 44.w,
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(avatars[index]), image: API.image(avatars[index]),
fit: BoxFit.cover,
), ),
), ),
); );

Loading…
Cancel
Save