update voting page

hmxc
张萌 4 years ago
parent 5d1e9f373e
commit 5e01b548ad

@ -29,6 +29,19 @@ class _EventVotingPageState extends State<EventVotingPage> {
super.dispose(); super.dispose();
} }
String _getButtonText(int status) {
switch (status) {
case 1:
case 2:
return '去投票';
case 3:
return '已结束';
case 4:
return '已投票';
default:
}
}
Widget _buildCard(EventVotingModel model) { Widget _buildCard(EventVotingModel model) {
return Container( return Container(
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
@ -46,7 +59,11 @@ class _EventVotingPageState extends State<EventVotingPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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, 16.w.heightBox,
model.content.text.color(ktextSubColor).size(24.sp).make(), model.content.text.color(ktextSubColor).size(24.sp).make(),
8.w.heightBox, 8.w.heightBox,
@ -73,13 +90,18 @@ class _EventVotingPageState extends State<EventVotingPage> {
avatars: model.headImgURls.map((e) => e.url).toList()), avatars: model.headImgURls.map((e) => e.url).toList()),
Spacer(), Spacer(),
MaterialButton( MaterialButton(
color: kPrimaryColor, color: model.status == 3 ? kDarkSubColor : kPrimaryColor,
minWidth: 120.w, minWidth: 120.w,
padding: padding:
EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w), EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w),
elevation: 0, elevation: 0,
onPressed: () {}, onPressed: () {},
child: '去投票'.text.black.size(20.sp).bold.make(), child: (_getButtonText(model.status))
.text
.black
.size(20.sp)
.bold
.make(),
), ),
], ],
) )

@ -101,7 +101,7 @@ class GoodsInfoCard extends StatelessWidget {
fontSize: 32.sp, fontSize: 32.sp,
color: Color(0xff333333)), color: Color(0xff333333)),
), ),
Text(BeeMap().fixState[model.status], Text(BeeMap.fixState[model.status],
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 28.sp, fontSize: 28.sp,
@ -120,11 +120,11 @@ class GoodsInfoCard extends StatelessWidget {
BorderSide(color: Color(0xffeeeeee), width: 0.5)), BorderSide(color: Color(0xffeeeeee), width: 0.5)),
), ),
child: Column(children: [ child: Column(children: [
_builTile('物品重量', BeeMap().goodsOutweight[model.weight]), _builTile('物品重量', BeeMap.goodsOutweight[model.weight]),
_builTile('出户时间', model.expectedTime), _builTile('出户时间', model.expectedTime),
_builTile('物品名称', model.name), _builTile('物品名称', model.name),
_builTile( _builTile(
'搬运方式', BeeMap().goodsOutApproach[model.approach]), '搬运方式', BeeMap.goodsOutApproach[model.approach]),
]), ]),
), ),
Container( Container(

@ -105,7 +105,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
padding: EdgeInsets.fromLTRB(24.w, 24.w, 24.w, 0), padding: EdgeInsets.fromLTRB(24.w, 24.w, 24.w, 0),
child: Row( child: Row(
children: [ children: [
BeeMap() BeeMap
.fixTag[model.type] .fixTag[model.type]
.text .text
.color(ktextPrimary) .color(ktextPrimary)
@ -113,7 +113,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
.size(32.sp) .size(32.sp)
.make(), .make(),
Spacer(), Spacer(),
BeeMap() BeeMap
.fixState[model.status] .fixState[model.status]
.text .text
.color(_getColor(model.status)) .color(_getColor(model.status))

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/utils/bee_map.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/model/manager/fixed_detail_model.dart';
import 'package:akuCommunity/pages/manager_func.dart'; import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.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/headers.dart';
import 'package:akuCommunity/utils/network/base_model.dart'; import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/widget/bee_divider.dart'; import 'package:akuCommunity/widget/bee_divider.dart';
@ -102,7 +102,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
borderRadius: BorderRadius.circular(36.w), borderRadius: BorderRadius.circular(36.w),
color: Colors.transparent, color: Colors.transparent,
), ),
child: BeeMap() child: BeeMap
.fixTag[model.appReportRepairVo.type] .fixTag[model.appReportRepairVo.type]
.text .text
.black .black
@ -110,7 +110,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
.make(), .make(),
), ),
Spacer(), Spacer(),
BeeMap() BeeMap
.fixState[model.appReportRepairVo.status] .fixState[model.appReportRepairVo.status]
.text .text
.color(_getColor(_model.appReportRepairVo.status)) .color(_getColor(_model.appReportRepairVo.status))
@ -226,7 +226,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
...model.appProcessRecordVo ...model.appProcessRecordVo
.map((e) => Row( .map((e) => Row(
children: [ children: [
BeeMap() BeeMap
.processClass[e.operationType] .processClass[e.operationType]
.text .text
.color(ktextSubColor) .color(ktextSubColor)

@ -1,10 +1,10 @@
class BeeMap { class BeeMap {
Map<int, String> fixTag = { static Map<int, String> fixTag = {
1: '公区报修', 1: '公区报修',
2: '家庭报修', 2: '家庭报修',
}; };
Map<int, String> fixState = { static Map<int, String> fixState = {
1: '待分配', 1: '待分配',
2: '未接单', 2: '未接单',
3: '处理中', 3: '处理中',
@ -15,7 +15,7 @@ class BeeMap {
8: '未知' 8: '未知'
}; };
Map<int, String> processClass = { static Map<int, String> processClass = {
1: '报修时间', 1: '报修时间',
2: '管家分派', 2: '管家分派',
3: '师傅接单', 3: '师傅接单',
@ -27,15 +27,22 @@ class BeeMap {
9: '取消' 9: '取消'
}; };
Map<int, String> goodsOutweight = { static Map<int, String> goodsOutweight = {
1: '< 50kg', 1: '< 50kg',
2: '50kg-100kg', 2: '50kg-100kg',
3: '> 100kg', 3: '> 100kg',
}; };
Map<int, String> goodsOutApproach = { static Map<int, String> goodsOutApproach = {
1: '自己搬运', 1: '自己搬运',
2: '搬家公司', 2: '搬家公司',
}; };
static Map<int, String> borrowStatus = {1: '出借中', 2: '已归还'}; static Map<int, String> borrowStatus = {1: '出借中', 2: '已归还'};
static Map<int, String> votingStatus = {
1: '未开始',
2: '进行中',
3: '已结束',
4: '已投票',
};
} }

Loading…
Cancel
Save