dock interface:eventVoting/list

add event voting detail page
hmxc
张萌 4 years ago
parent 5e01b548ad
commit a1597faeb1

@ -148,6 +148,9 @@ class _Manager {
///app
String get enventVotingList => '/user/eventVoting/list';
///
String get voteDetail => '/user/eventVoting/voteDetail';
}
class _Community {

@ -1,3 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart';
class EventVotingModel {
int id;
String title;
@ -5,8 +7,8 @@ class EventVotingModel {
String beginDate;
String endDate;
int status;
List<String> imgUrls;
List<HeadImgURls> headImgURls;
List<ImgModel> imgUrls;
List<ImgModel> headImgURls;
EventVotingModel(
{this.id,
@ -25,13 +27,19 @@ class EventVotingModel {
beginDate = json['beginDate'];
endDate = json['endDate'];
status = json['status'];
imgUrls = json['imgUrls'].cast<String>();
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else
imgUrls = [];
if (json['headImgURls'] != null) {
headImgURls = new List<HeadImgURls>();
headImgURls = new List<ImgModel>();
json['headImgURls'].forEach((v) {
headImgURls.add(new HeadImgURls.fromJson(v));
headImgURls.add(new ImgModel.fromJson(v));
});
}
}else headImgURls=[];
}
Map<String, dynamic> toJson() {
@ -42,7 +50,9 @@ class EventVotingModel {
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
data['status'] = this.status;
data['imgUrls'] = this.imgUrls;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
if (this.headImgURls != null) {
data['headImgURls'] = this.headImgURls.map((v) => v.toJson()).toList();
}
@ -50,16 +60,16 @@ class EventVotingModel {
}
}
class HeadImgURls {
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
HeadImgURls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
HeadImgURls.fromJson(Map<String, dynamic> json) {
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];

@ -0,0 +1,119 @@
import 'package:akuCommunity/model/common/img_model.dart';
class VotingDetailModel {
int id;
String title;
String content;
int status;
int totals;
List<ImgModel> imgUrls;
List<AppVoteCandidateVos> appVoteCandidateVos;
VotingDetailModel(
{this.id,
this.title,
this.content,
this.status,
this.totals,
this.imgUrls,
this.appVoteCandidateVos});
VotingDetailModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
content = json['content'];
status = json['status'];
totals = json['totals'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else
imgUrls = [];
if (json['appVoteCandidateVos'] != null) {
appVoteCandidateVos = new List<AppVoteCandidateVos>();
json['appVoteCandidateVos'].forEach((v) {
appVoteCandidateVos.add(new AppVoteCandidateVos.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['content'] = this.content;
data['status'] = this.status;
data['totals'] = this.totals;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
if (this.appVoteCandidateVos != null) {
data['appVoteCandidateVos'] =
this.appVoteCandidateVos.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}
class AppVoteCandidateVos {
int id;
String name;
int total;
List<ImgModel> imgUrls;
AppVoteCandidateVos({this.id, this.name, this.total, this.imgUrls});
AppVoteCandidateVos.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
total = json['total'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else
imgUrls = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['total'] = this.total;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -1,6 +1,7 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/manager/event_voting_model.dart';
import 'package:akuCommunity/pages/event_activity/voting_detail_page.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/others/stack_avatar.dart';
@ -44,15 +45,20 @@ class _EventVotingPageState extends State<EventVotingPage> {
Widget _buildCard(EventVotingModel model) {
return Container(
clipBehavior: Clip.antiAliasWithSaveLayer,
// clipBehavior: Clip.,
decoration: BoxDecoration(
color: kForeGroundColor, borderRadius: BorderRadius.circular(8.w)),
child: Column(
children: [
ClipRect(
SizedBox(
height: 210.w,
width: double.infinity,
child: ClipRect(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(model.imgUrls[0])),
image: API.image(
model.imgUrls.isNotEmpty ? model.imgUrls.first.url : '')),
),
),
Padding(
padding: EdgeInsets.fromLTRB(24.w, 16.w, 24.w, 24.w),
@ -90,12 +96,17 @@ class _EventVotingPageState extends State<EventVotingPage> {
avatars: model.headImgURls.map((e) => e.url).toList()),
Spacer(),
MaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22.w)),
color: model.status == 3 ? kDarkSubColor : kPrimaryColor,
minWidth: 120.w,
height: 44.w,
padding:
EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.w),
elevation: 0,
onPressed: () {},
onPressed: () {
VotingDetailPage(id: model.id,).to();
},
child: (_getButtonText(model.status))
.text
.black

@ -0,0 +1,39 @@
import 'package:akuCommunity/model/manager/voting_detail_page.dart';
import 'package:akuCommunity/pages/manager_func.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:akuCommunity/utils/headers.dart';
class VotingDetailPage extends StatefulWidget {
final int id;
VotingDetailPage({Key key, this.id}) : super(key: key);
@override
_VotingDetailPageState createState() => _VotingDetailPageState();
}
class _VotingDetailPageState extends State<VotingDetailPage> {
VotingDetailModel _model;
@override
void initState() {
super.initState();
ManagerFunc.voteDetail(widget.id).then((value) {
_model = value.data;
return true;
});
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '活动详情',
body: ListView(
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 26.w,
),
children: [],
),
);
}
}

@ -148,22 +148,29 @@ class ManagerFunc {
return baseModel;
}
static Future<BaseModel> fromLoss(int id)async{
static Future<BaseModel> fromLoss(int id) async {
BaseModel baseModel = await NetUtil().post(
API.manager.fromLoss,
params: {
'articleBorrowId':id
},
params: {'articleBorrowId': id},
showMessage: true,
);
return baseModel;
}
static Future<BaseModel> findEstatelsPayment()async{
static Future<BaseModel> findEstatelsPayment() async {
BaseModel baseModel = await NetUtil().get(
API.manager.findEstatelsPament,
showMessage: false,
);
return baseModel.data;
}
static Future<BaseModel> voteDetail(int id) async {
BaseModel baseModel = await NetUtil().get(API.manager.voteDetail,
params: {
'voteId': 1,
},
showMessage: false);
return baseModel.data;
}
}

Loading…
Cancel
Save