parent
5e01b548ad
commit
a1597faeb1
@ -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;
|
||||
}
|
||||
}
|
@ -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: [],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue