业委会页面添加头像移除任期时间,话题卡片添加举报按钮

hmxc
小赖 4 years ago
parent 8c2118c100
commit b4abbdbf71

@ -1,3 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart';
class CommitteeItemModel {
int id;
int positionId;
@ -10,6 +12,12 @@ class CommitteeItemModel {
String roomNumber;
int unitNo;
int estateNo;
List<ImgModel> imgUrls;
String get firstImg {
if (imgUrls.isEmpty) return '';
return imgUrls.first.url;
}
String get sexValue {
if (sexId == 0 || sexId == null) return '未设置';
@ -18,18 +26,33 @@ class CommitteeItemModel {
return '未设置';
}
CommitteeItemModel(
{this.id,
this.positionId,
this.name,
this.sexId,
this.age,
this.educationId,
this.roomName,
this.profession,
this.roomNumber,
this.unitNo,
this.estateNo});
String get positionValue {
switch (positionId) {
case 1:
return '业委会主任';
case 2:
return '业委会副主任';
case 3:
return '业委会委员';
default:
return '';
}
}
CommitteeItemModel({
this.id,
this.positionId,
this.name,
this.sexId,
this.age,
this.educationId,
this.roomName,
this.profession,
this.roomNumber,
this.unitNo,
this.estateNo,
this.imgUrls,
});
CommitteeItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -43,6 +66,11 @@ class CommitteeItemModel {
roomNumber = json['roomNumber'];
unitNo = json['unitNo'];
estateNo = json['estateNo'];
if (json['imgUrls'] != null) {
imgUrls =
(json['imgUrls'] as List).map((e) => ImgModel.fromJson(e)).toList();
} else
imgUrls = [];
}
Map<String, dynamic> toJson() {

@ -60,19 +60,19 @@ class _IndustryCommitteePageState extends State<IndustryCommitteePage> {
))
.make()
.expand(),
MaterialButton(
onPressed: CommitteeMailboxPage().to,
height: 98.w,
color: kPrimaryColor,
child: '业委会信箱'.text.size(32.sp).color(ktextPrimary).make(),
)
.box
.color(kPrimaryColor)
.padding(EdgeInsets.only(
bottom: MediaQuery.of(context).viewPadding.bottom,
))
.make()
.expand(),
// MaterialButton(
// onPressed: CommitteeMailboxPage().to,
// height: 98.w,
// color: kPrimaryColor,
// child: '业委会信箱'.text.size(32.sp).color(ktextPrimary).make(),
// )
// .box
// .color(kPrimaryColor)
// .padding(EdgeInsets.only(
// bottom: MediaQuery.of(context).viewPadding.bottom,
// ))
// .make()
// .expand(),
].row();
}
@ -83,10 +83,12 @@ class _IndustryCommitteePageState extends State<IndustryCommitteePage> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: SizedBox(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(model.firstImg),
height: 150.w,
width: 150.w,
child: Placeholder(),
fit: BoxFit.cover,
),
),
24.wb,
@ -100,7 +102,10 @@ class _IndustryCommitteePageState extends State<IndustryCommitteePage> {
height: 44.w,
padding:
EdgeInsets.symmetric(horizontal: 22.w, vertical: 6.w),
child: 'XXX'.text.size(24.sp).color(ktextPrimary).make(),
child: model.positionValue.text
.size(24.sp)
.color(ktextPrimary)
.make(),
decoration: BoxDecoration(
color: Color(0xFFFFF3CD),
borderRadius: BorderRadius.circular(22.w),
@ -115,7 +120,7 @@ class _IndustryCommitteePageState extends State<IndustryCommitteePage> {
.size(24.sp)
.color(ktextSubColor)
.make(),
'任职期限XXXXX'.text.size(24.sp).color(ktextSubColor).make(),
// '任职期限XXXXX'.text.size(24.sp).color(ktextSubColor).make(),
'从事岗位:${model.profession}'
.text
.size(24.sp)

@ -293,7 +293,30 @@ class _ChatCardState extends State<ChatCard> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.model.createName.text.black.size(36.sp).make(),
[
widget.model.createName.text.black
.size(36.sp)
.make()
.expand(),
PopupMenuButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w)),
itemBuilder: (context) {
return [
PopupMenuItem(
child: '举报'.text.isIntrinsic.make(),
value: 0,
),
];
},
onSelected: (_) async {
VoidCallback cancel = BotToast.showLoading();
await Future.delayed(Duration(milliseconds: 1000));
cancel();
BotToast.showText(text: '举报成功');
},
),
].row(),
6.hb,
widget.model.content.text.black.make(),
20.hb,

Loading…
Cancel
Save