update voting page

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

@ -29,6 +29,19 @@ class _EventVotingPageState extends State<EventVotingPage> {
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<EventVotingPage> {
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<EventVotingPage> {
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(),
),
],
)

@ -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(

@ -105,7 +105,7 @@ class _FixedSubmitPageState extends State<FixedSubmitPage> {
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<FixedSubmitPage> {
.size(32.sp)
.make(),
Spacer(),
BeeMap()
BeeMap
.fixState[model.status]
.text
.color(_getColor(model.status))

@ -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<FixedDetailPage> {
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<FixedDetailPage> {
.make(),
),
Spacer(),
BeeMap()
BeeMap
.fixState[model.appReportRepairVo.status]
.text
.color(_getColor(_model.appReportRepairVo.status))
@ -226,7 +226,7 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
...model.appProcessRecordVo
.map((e) => Row(
children: [
BeeMap()
BeeMap
.processClass[e.operationType]
.text
.color(ktextSubColor)

@ -1,10 +1,10 @@
class BeeMap {
Map<int, String> fixTag = {
static Map<int, String> fixTag = {
1: '公区报修',
2: '家庭报修',
};
Map<int, String> fixState = {
static Map<int, String> fixState = {
1: '待分配',
2: '未接单',
3: '处理中',
@ -15,7 +15,7 @@ class BeeMap {
8: '未知'
};
Map<int, String> processClass = {
static Map<int, String> processClass = {
1: '报修时间',
2: '管家分派',
3: '师傅接单',
@ -27,15 +27,22 @@ class BeeMap {
9: '取消'
};
Map<int, String> goodsOutweight = {
static Map<int, String> goodsOutweight = {
1: '< 50kg',
2: '50kg-100kg',
3: '> 100kg',
};
Map<int, String> goodsOutApproach = {
static Map<int, String> goodsOutApproach = {
1: '自己搬运',
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