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/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart';
import 'package:aku_new_community/widget/others/stack_avatar.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:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -150,12 +149,10 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
), ),
), ),
bottomNavi: BottomButton( bottomNavi: BottomButton(
child: '立即报名'.text.size(32.sp).color(Colors.black).bold.make(), child: '立即报名'.text.size(32.sp).bold.make(),
onPressed: () async { onPressed: !canTap
if (_model!.regisEndTime?.isBefore(DateTime.now()) ?? false) { ? null
BotToast.showText(text: '报名时间已结束'); : () async {
return;
}
var re = await NetUtil().get(SAASAPI.activity.registration, var re = await NetUtil().get(SAASAPI.activity.registration,
params: {'activityId': _model!.id}, showMessage: true); params: {'activityId': _model!.id}, showMessage: true);
if (re.success) { if (re.success) {
@ -166,6 +163,13 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
); );
} }
bool get canTap {
if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) {
return false;
}
return true;
}
Container _headWidget() { Container _headWidget() {
return Container( return Container(
color: Colors.white, 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/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/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_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/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_card.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_infomation_page.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, 32.hb,
_searchHistoryWidget() _newTopicListWidget()
], ],
), ),
); );
@ -416,7 +417,7 @@ class _CommunityPageState extends State<CommunityPage>
minWidth: double.infinity, minWidth: double.infinity,
color: Color(0xFFF3F3F3), color: Color(0xFFF3F3F3),
onPressed: () { onPressed: () {
//Get.to(() => SearchGoodsPage()); // Get.to(() => TopicSearchPage());
}, },
child: Row( child: Row(
children: [ children: [
@ -433,7 +434,8 @@ class _CommunityPageState extends State<CommunityPage>
); );
} }
_searchHistoryWidget() { ///
_newTopicListWidget() {
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 32.w, right: 32.w), 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), labelPadding: EdgeInsets.only(right: 12.w, left: 12.w),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onSelected: (bool value) { onSelected: (bool value) {
// Get.to(() => TopicDetailPage(model: item)); Get.to(() => TopicDetailPage(
topicId: item.id,
));
}, },
label: Row( label: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

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

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

Loading…
Cancel
Save