社区报名接口对接

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

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

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

@ -1,4 +1,6 @@
// 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/material.dart';
@ -31,7 +33,8 @@ class ActivityDetailPage extends StatefulWidget {
class _ActivityDetailPageState extends State<ActivityDetailPage> {
ActivityDetailModel model;
EasyRefreshController _refreshController = EasyRefreshController();
bool get outdate =>
(model?.registEndDate ?? DateTime(0)).compareTo(DateTime.now()) == -1;
Widget get emptyWidget => Shimmer.fromColors(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -121,6 +124,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: e.url,
fit: BoxFit.cover,
),
),
),
@ -184,6 +188,20 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
],
),
).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,
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(avatars[index]),
fit: BoxFit.cover,
),
),
);

Loading…
Cancel
Save