pull/1/head
张萌 3 years ago
parent f8c5cc5592
commit 8971038193

@ -9,7 +9,6 @@ import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bottom_button.dart';
import 'package:aku_new_community/widget/others/stack_avatar.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -150,22 +149,27 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
),
),
bottomNavi: BottomButton(
child: '立即报名'.text.size(32.sp).color(Colors.black).bold.make(),
onPressed: () async {
if (_model!.regisEndTime?.isBefore(DateTime.now()) ?? false) {
BotToast.showText(text: '报名时间已结束');
return;
}
var re = await NetUtil().get(SAASAPI.activity.registration,
params: {'activityId': _model!.id}, showMessage: true);
if (re.success) {
_refreshController.callRefresh();
}
},
child: '立即报名'.text.size(32.sp).bold.make(),
onPressed: !canTap
? null
: () async {
var re = await NetUtil().get(SAASAPI.activity.registration,
params: {'activityId': _model!.id}, showMessage: true);
if (re.success) {
_refreshController.callRefresh();
}
},
),
);
}
bool get canTap {
if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) {
return false;
}
return true;
}
Container _headWidget() {
return Container(
color: Colors.white,

@ -15,6 +15,7 @@ import 'package:aku_new_community/ui/community/community_views/add_new_event_pag
import 'package:aku_new_community/ui/community/community_views/my_community_view.dart';
import 'package:aku_new_community/ui/community/community_views/new_community_view.dart';
import 'package:aku_new_community/ui/community/community_views/topic/topic_community_view.dart';
import 'package:aku_new_community/ui/community/community_views/topic/topic_detail_page.dart';
import 'package:aku_new_community/ui/community/community_views/widgets/chat_card.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_infomation_card.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_infomation_page.dart';
@ -398,7 +399,7 @@ class _CommunityPageState extends State<CommunityPage>
}, '全部'),
),
32.hb,
_searchHistoryWidget()
_newTopicListWidget()
],
),
);
@ -416,7 +417,7 @@ class _CommunityPageState extends State<CommunityPage>
minWidth: double.infinity,
color: Color(0xFFF3F3F3),
onPressed: () {
//Get.to(() => SearchGoodsPage());
// Get.to(() => TopicSearchPage());
},
child: Row(
children: [
@ -433,7 +434,8 @@ class _CommunityPageState extends State<CommunityPage>
);
}
_searchHistoryWidget() {
///
_newTopicListWidget() {
return Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 32.w, right: 32.w),
@ -464,7 +466,9 @@ class _CommunityPageState extends State<CommunityPage>
labelPadding: EdgeInsets.only(right: 12.w, left: 12.w),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onSelected: (bool value) {
// Get.to(() => TopicDetailPage(model: item));
Get.to(() => TopicDetailPage(
topicId: item.id,
));
},
label: Row(
mainAxisSize: MainAxisSize.min,

@ -22,11 +22,13 @@ class TopicSearchPage extends StatefulWidget {
class _TopicSearchPageState extends State<TopicSearchPage> {
List<TopicListModel> _models = [];
bool isHot = true;
TextEditingController _textEditingController = TextEditingController();
Future _getModels() async {
var re = await NetUtil().get(SAASAPI.community.topicList, params: {
'pageNum': 1,
'size': 10,
'title': _textEditingController.text
});
if (re.success) {
_models = (re.data['rows'] as List)
@ -42,6 +44,12 @@ class _TopicSearchPageState extends State<TopicSearchPage> {
super.initState();
}
@override
void dispose() {
_textEditingController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
var appbar = PreferredSize(
@ -80,6 +88,7 @@ class _TopicSearchPageState extends State<TopicSearchPage> {
.get(SAASAPI.community.topicList, params: {
'pageNum': 1,
'size': 20,
'title': _textEditingController.text,
});
if (re.success) {
_models = (re.data['rows'] as List)
@ -88,6 +97,7 @@ class _TopicSearchPageState extends State<TopicSearchPage> {
setState(() {});
}
},
controller: _textEditingController,
decoration: InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.zero,

@ -1,9 +1,7 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_new_community/base/base_style.dart';
class BottomButton extends StatelessWidget {
final VoidCallback? onPressed;
final Widget child;
@ -26,7 +24,7 @@ class BottomButton extends StatelessWidget {
child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
disabledColor: Colors.white.withOpacity(0.5),
disabledTextColor: ktextSubColor.withOpacity(0.8),
disabledTextColor: ktextSubColor.withOpacity(0.4),
textColor: textColor,
child: child,
onPressed: onPressed,

Loading…
Cancel
Save