From d6a53a88b9c6b81537560377b5eb49bb99b8fec7 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Fri, 5 Feb 2021 14:30:55 +0800 Subject: [PATCH] fixed some issues --- .../event_activity/voting_detail_page.dart | 19 +++++++++++++++++-- lib/widget/buttons/bee_single_check.dart | 5 +++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/pages/event_activity/voting_detail_page.dart b/lib/pages/event_activity/voting_detail_page.dart index 8bfd29c1..915309f2 100644 --- a/lib/pages/event_activity/voting_detail_page.dart +++ b/lib/pages/event_activity/voting_detail_page.dart @@ -1,6 +1,8 @@ // Flutter imports: import 'package:akuCommunity/base/base_style.dart'; +import 'package:akuCommunity/utils/network/base_model.dart'; 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'; @@ -143,6 +145,9 @@ class _VotingDetailPageState extends State { await ManagerFunc.voteDetail(widget.id) .then((value) => _model = value); _isOnload = false; + setState(() { + + }); }, header: MaterialHeader(), child: _isOnload @@ -194,8 +199,18 @@ class _VotingDetailPageState extends State { ), ), bottomNavi: BottomButton( - onPressed: () { - Get.dialog(_shouwVoteDialog()); + onPressed: () async { + if (_selectId == null) { + BotToast.showText(text: '请先选择候选人!'); + } else { + BaseModel baseModel = + await ManagerFunc.vote(_selectId, widget.id); + if (baseModel.status) { + Get.dialog(_shouwVoteDialog()); + } else { + BotToast.showText(text: '${baseModel.message}'); + } + } }, child: '投票'.text.black.size(28.sp).bold.make()), ); diff --git a/lib/widget/buttons/bee_single_check.dart b/lib/widget/buttons/bee_single_check.dart index ba99ba9e..0d51662c 100644 --- a/lib/widget/buttons/bee_single_check.dart +++ b/lib/widget/buttons/bee_single_check.dart @@ -20,6 +20,7 @@ class _BeeSingleCheckState extends State { height: 40.w, width: 40.w, decoration: BoxDecoration( + color: kPrimaryColor.withOpacity(_selected ? 1 : 0), border: Border.all( color: _selected ? kPrimaryColor : Color(0xFF979797), width: 3.w, @@ -34,9 +35,9 @@ class _BeeSingleCheckState extends State { curve: Curves.easeInOutCubic, opacity: _selected ? 1 : 0, child: Icon( - CupertinoIcons.chevron_up, + CupertinoIcons.checkmark, color: Colors.white, - size: 24.w, + size: 28.w, ), ), );