活动列表参与人头像

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/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';
part 'home_activity_model.g.dart';
@JsonSerializable()
class HomeActivityModel {
class HomeActivityModel extends Equatable {
final int id;
final String title;
final int status;
@ -17,12 +18,15 @@ class HomeActivityModel {
final String activityEndTime;
final List<ImgModel>? imgList;
final int? registrationNum;
final List<ImgModel>? avatarImgList;
factory HomeActivityModel.fromJson(Map<String, dynamic> json) =>
_$HomeActivityModelFromJson(json);
DateTime? get begin => DateUtil.getDateTime(registrationStartTime);
DateTime? get end => DateUtil.getDateTime(registrationEndTime);
String get statusString {
switch (this.status) {
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({
required this.id,
required this.title,
@ -62,6 +80,7 @@ class HomeActivityModel {
required this.activityStartTime,
required this.activityEndTime,
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>))
.toList(),
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 content;
final String createDate;
final List<ImgModel>? imgList;
final List<ImgModel>? servicePersonnelImgList;
final int newReportNum;
final int? evaluateLevel;
@ -23,22 +24,6 @@ class WorkOrderDetailModel extends Equatable {
factory WorkOrderDetailModel.fromJson(Map<String, dynamic> 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
List<Object?> get props => [
id,
@ -54,5 +39,23 @@ class WorkOrderDetailModel extends Equatable {
evaluateLevel,
evaluateContent,
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,
content: json['content'] as String,
createDate: json['createDate'] as String,
imgList: (json['imgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
servicePersonnelImgList:
(json['servicePersonnelImgList'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))

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

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

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

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

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

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

Loading…
Cancel
Save