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

hmxc
小赖 4 years ago
parent 8c2118c100
commit b4abbdbf71

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

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

@ -293,7 +293,30 @@ class _ChatCardState extends State<ChatCard> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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, 6.hb,
widget.model.content.text.black.make(), widget.model.content.text.black.make(),
20.hb, 20.hb,

Loading…
Cancel
Save