diff --git a/lib/pages/event_activity/event_voting_page.dart b/lib/pages/event_activity/event_voting_page.dart index 50ab0f71..a14f5ba8 100644 --- a/lib/pages/event_activity/event_voting_page.dart +++ b/lib/pages/event_activity/event_voting_page.dart @@ -29,6 +29,19 @@ class _EventVotingPageState extends State { super.dispose(); } + String _getButtonText(int status) { + switch (status) { + case 1: + case 2: + return '去投票'; + case 3: + return '已结束'; + case 4: + return '已投票'; + default: + } + } + Widget _buildCard(EventVotingModel model) { return Container( clipBehavior: Clip.antiAliasWithSaveLayer, @@ -46,7 +59,11 @@ class _EventVotingPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - model.title.text.black.size(28.sp).bold.make(), + model.title.text.black + .size(28.sp) + .bold + .overflow(TextOverflow.ellipsis) + .make(), 16.w.heightBox, model.content.text.color(ktextSubColor).size(24.sp).make(), 8.w.heightBox, @@ -73,13 +90,18 @@ class _EventVotingPageState extends State { avatars: model.headImgURls.map((e) => e.url).toList()), Spacer(), MaterialButton( - color: kPrimaryColor, + color: model.status == 3 ? kDarkSubColor : kPrimaryColor, minWidth: 120.w, padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), elevation: 0, onPressed: () {}, - child: '去投票'.text.black.size(20.sp).bold.make(), + child: (_getButtonText(model.status)) + .text + .black + .size(20.sp) + .bold + .make(), ), ], ) diff --git a/lib/pages/goods_deto_page/widget/goods_info_card.dart b/lib/pages/goods_deto_page/widget/goods_info_card.dart index 3d6dcce8..ea04672a 100644 --- a/lib/pages/goods_deto_page/widget/goods_info_card.dart +++ b/lib/pages/goods_deto_page/widget/goods_info_card.dart @@ -101,7 +101,7 @@ class GoodsInfoCard extends StatelessWidget { fontSize: 32.sp, color: Color(0xff333333)), ), - Text(BeeMap().fixState[model.status], + Text(BeeMap.fixState[model.status], style: TextStyle( fontWeight: FontWeight.w600, fontSize: 28.sp, @@ -120,11 +120,11 @@ class GoodsInfoCard extends StatelessWidget { BorderSide(color: Color(0xffeeeeee), width: 0.5)), ), child: Column(children: [ - _builTile('物品重量', BeeMap().goodsOutweight[model.weight]), + _builTile('物品重量', BeeMap.goodsOutweight[model.weight]), _builTile('出户时间', model.expectedTime), _builTile('物品名称', model.name), _builTile( - '搬运方式', BeeMap().goodsOutApproach[model.approach]), + '搬运方式', BeeMap.goodsOutApproach[model.approach]), ]), ), Container( diff --git a/lib/pages/things_page/fixed_submit_page.dart b/lib/pages/things_page/fixed_submit_page.dart index a3bfd174..ca796899 100644 --- a/lib/pages/things_page/fixed_submit_page.dart +++ b/lib/pages/things_page/fixed_submit_page.dart @@ -105,7 +105,7 @@ class _FixedSubmitPageState extends State { padding: EdgeInsets.fromLTRB(24.w, 24.w, 24.w, 0), child: Row( children: [ - BeeMap() + BeeMap .fixTag[model.type] .text .color(ktextPrimary) @@ -113,7 +113,7 @@ class _FixedSubmitPageState extends State { .size(32.sp) .make(), Spacer(), - BeeMap() + BeeMap .fixState[model.status] .text .color(_getColor(model.status)) diff --git a/lib/pages/things_page/widget/fixed_detail_page.dart b/lib/pages/things_page/widget/fixed_detail_page.dart index afb9f517..dab48b12 100644 --- a/lib/pages/things_page/widget/fixed_detail_page.dart +++ b/lib/pages/things_page/widget/fixed_detail_page.dart @@ -1,4 +1,5 @@ // Flutter imports: +import 'package:akuCommunity/utils/bee_map.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,7 +16,6 @@ import 'package:akuCommunity/const/resource.dart'; import 'package:akuCommunity/model/manager/fixed_detail_model.dart'; import 'package:akuCommunity/pages/manager_func.dart'; import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.dart'; -import 'package:akuCommunity/utils/bee_map.dart'; import 'package:akuCommunity/utils/headers.dart'; import 'package:akuCommunity/utils/network/base_model.dart'; import 'package:akuCommunity/widget/bee_divider.dart'; @@ -102,7 +102,7 @@ class _FixedDetailPageState extends State { borderRadius: BorderRadius.circular(36.w), color: Colors.transparent, ), - child: BeeMap() + child: BeeMap .fixTag[model.appReportRepairVo.type] .text .black @@ -110,7 +110,7 @@ class _FixedDetailPageState extends State { .make(), ), Spacer(), - BeeMap() + BeeMap .fixState[model.appReportRepairVo.status] .text .color(_getColor(_model.appReportRepairVo.status)) @@ -226,7 +226,7 @@ class _FixedDetailPageState extends State { ...model.appProcessRecordVo .map((e) => Row( children: [ - BeeMap() + BeeMap .processClass[e.operationType] .text .color(ktextSubColor) diff --git a/lib/utils/bee_map.dart b/lib/utils/bee_map.dart index c5a54dc2..15d8ec34 100644 --- a/lib/utils/bee_map.dart +++ b/lib/utils/bee_map.dart @@ -1,10 +1,10 @@ class BeeMap { - Map fixTag = { + static Map fixTag = { 1: '公区报修', 2: '家庭报修', }; - Map fixState = { + static Map fixState = { 1: '待分配', 2: '未接单', 3: '处理中', @@ -15,7 +15,7 @@ class BeeMap { 8: '未知' }; - Map processClass = { + static Map processClass = { 1: '报修时间', 2: '管家分派', 3: '师傅接单', @@ -27,15 +27,22 @@ class BeeMap { 9: '取消' }; - Map goodsOutweight = { + static Map goodsOutweight = { 1: '< 50kg', 2: '50kg-100kg', 3: '> 100kg', }; - Map goodsOutApproach = { + static Map goodsOutApproach = { 1: '自己搬运', 2: '搬家公司', }; - static Map borrowStatus = {1: '出借中', 2: '已归还'}; + static Map borrowStatus = {1: '出借中', 2: '已归还'}; + + static Map votingStatus = { + 1: '未开始', + 2: '进行中', + 3: '已结束', + 4: '已投票', + }; }