活动列表参与人头像

pull/1/head
张萌 3 years ago
parent ad32f713fc
commit 3a38b1e291

@ -1,13 +1,14 @@
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'home_activity_model.g.dart'; part 'home_activity_model.g.dart';
@JsonSerializable() @JsonSerializable()
class HomeActivityModel { class HomeActivityModel extends Equatable {
final int id; final int id;
final String title; final String title;
final int status; final int status;
@ -17,12 +18,15 @@ class HomeActivityModel {
final String activityEndTime; final String activityEndTime;
final List<ImgModel>? imgList; final List<ImgModel>? imgList;
final int? registrationNum; final int? registrationNum;
final List<ImgModel>? avatarImgList;
factory HomeActivityModel.fromJson(Map<String, dynamic> json) => factory HomeActivityModel.fromJson(Map<String, dynamic> json) =>
_$HomeActivityModelFromJson(json); _$HomeActivityModelFromJson(json);
DateTime? get begin => DateUtil.getDateTime(registrationStartTime); DateTime? get begin => DateUtil.getDateTime(registrationStartTime);
DateTime? get end => DateUtil.getDateTime(registrationEndTime); DateTime? get end => DateUtil.getDateTime(registrationEndTime);
String get statusString { String get statusString {
switch (this.status) { switch (this.status) {
case 1: case 1:
@ -53,6 +57,20 @@ class HomeActivityModel {
} }
} }
@override
List<Object?> get props => [
id,
title,
status,
registrationStartTime,
registrationEndTime,
activityStartTime,
activityEndTime,
imgList,
registrationNum,
avatarImgList,
];
const HomeActivityModel({ const HomeActivityModel({
required this.id, required this.id,
required this.title, required this.title,
@ -62,6 +80,7 @@ class HomeActivityModel {
required this.activityStartTime, required this.activityStartTime,
required this.activityEndTime, required this.activityEndTime,
this.imgList, this.imgList,
this.registrationNum, required this.registrationNum,
this.avatarImgList,
}); });
} }

@ -19,4 +19,7 @@ HomeActivityModel _$HomeActivityModelFromJson(Map<String, dynamic> json) =>
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) ?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
registrationNum: json['registrationNum'] as int?, registrationNum: json['registrationNum'] as int?,
avatarImgList: (json['avatarImgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
); );

@ -14,6 +14,7 @@ class WorkOrderDetailModel extends Equatable {
final String reserveDate; final String reserveDate;
final String content; final String content;
final String createDate; final String createDate;
final List<ImgModel>? imgList;
final List<ImgModel>? servicePersonnelImgList; final List<ImgModel>? servicePersonnelImgList;
final int newReportNum; final int newReportNum;
final int? evaluateLevel; final int? evaluateLevel;
@ -23,22 +24,6 @@ class WorkOrderDetailModel extends Equatable {
factory WorkOrderDetailModel.fromJson(Map<String, dynamic> json) => factory WorkOrderDetailModel.fromJson(Map<String, dynamic> json) =>
_$WorkOrderDetailModelFromJson(json); _$WorkOrderDetailModelFromJson(json);
const WorkOrderDetailModel({
required this.id,
required this.code,
required this.status,
required this.workOrderTypeName,
required this.reserveAddress,
required this.reserveDate,
required this.content,
required this.createDate,
this.servicePersonnelImgList,
required this.newReportNum,
this.evaluateLevel,
this.evaluateContent,
this.evaluateDate,
});
@override @override
List<Object?> get props => [ List<Object?> get props => [
id, id,
@ -54,5 +39,23 @@ class WorkOrderDetailModel extends Equatable {
evaluateLevel, evaluateLevel,
evaluateContent, evaluateContent,
evaluateDate, evaluateDate,
imgList
]; ];
const WorkOrderDetailModel({
required this.id,
required this.code,
required this.status,
required this.workOrderTypeName,
required this.reserveAddress,
required this.reserveDate,
required this.content,
required this.createDate,
this.imgList,
this.servicePersonnelImgList,
required this.newReportNum,
this.evaluateLevel,
this.evaluateContent,
this.evaluateDate,
});
} }

@ -17,6 +17,9 @@ WorkOrderDetailModel _$WorkOrderDetailModelFromJson(
reserveDate: json['reserveDate'] as String, reserveDate: json['reserveDate'] as String,
content: json['content'] as String, content: json['content'] as String,
createDate: json['createDate'] as String, createDate: json['createDate'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
servicePersonnelImgList: servicePersonnelImgList:
(json['servicePersonnelImgList'] as List<dynamic>?) (json['servicePersonnelImgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) ?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))

@ -18,7 +18,7 @@ class ActivityCard extends StatelessWidget {
this.home = false, this.home = false,
}) : super(key: key); }) : super(key: key);
bool get outdate => model!.end!.compareTo(DateTime.now()) == -1; bool get outdate => ActivityFunc.dateCheck(model!.end) == '';
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ConstrainedBox( return ConstrainedBox(
@ -109,7 +109,8 @@ class ActivityCard extends StatelessWidget {
[ [
Flexible( Flexible(
child: AvatarsParticipate( child: AvatarsParticipate(
avatars: (model?.imgList?.map((e) => e.url).toList() ?? []), avatars:
(model?.avatarImgList?.map((e) => e.url).toList() ?? []),
pNum: model?.registrationNum ?? 0, pNum: model?.registrationNum ?? 0,
hasIcon: false, hasIcon: false,
), ),

@ -5,7 +5,7 @@ class ActivityFunc {
} }
var nowDate = DateTime.now(); var nowDate = DateTime.now();
if (date.isBefore(nowDate)) { if (date.isBefore(nowDate)) {
return '已结束'; return '';
} else { } else {
var days = date.difference(nowDate).inDays; var days = date.difference(nowDate).inDays;
if (days > 0) { if (days > 0) {

@ -429,7 +429,7 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
.make(), .make(),
24.hb, 24.hb,
BeeGridImageView( BeeGridImageView(
urls: [], urls: (_model!.imgList ?? []).map((e) => e.url).toList(),
), ),
24.hb, 24.hb,
], ],

@ -257,7 +257,7 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
height: 100.w, height: 100.w,
width: double.infinity, width: double.infinity,
child: Text( child: Text(
(_goodDetail!.skuName ?? ''), (_goodDetail!.skuName),
style: TextStyle( style: TextStyle(
fontSize: 36.sp, fontSize: 36.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -266,7 +266,7 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
_getIcon(_goodDetail!.kind ?? 0), _getIcon(_goodDetail!.kind),
24.hb, 24.hb,
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -325,13 +325,13 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
height: 80.w, height: 80.w,
width: double.infinity, width: double.infinity,
child: Text( child: Text(
(_goodDetail!.skuName ?? ''), (_goodDetail!.skuName),
style: TextStyle(fontSize: 28.sp, color: ktextPrimary), style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
_getIcon(_goodDetail!.kind ?? 0), _getIcon(_goodDetail!.kind),
Spacer(), Spacer(),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

@ -439,7 +439,7 @@ class _SubmitOrderNormalPageState extends State<SubmitOrderNormalPage> {
var top = RichText( var top = RichText(
text: TextSpan(children: [ text: TextSpan(children: [
WidgetSpan( WidgetSpan(
child: _getKindWd(model.kind ?? 0), child: _getKindWd(model.kind),
), ),
TextSpan( TextSpan(
text: model.skuName, text: model.skuName,

@ -26,7 +26,7 @@ class StackAvatar extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(22.w + 2.w), borderRadius: BorderRadius.circular(22.w + 2.w),
border: Border.all(color: Color(0xFF999999)), // border: Border.all(color: Color(0xFF999999)),
), ),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: BeeImageNetwork( child: BeeImageNetwork(

Loading…
Cancel
Save