Commit 8ecd2a5b authored by 林生雨's avatar 林生雨

commit

parent b08c33b5
......@@ -23,6 +23,10 @@ class LevelOneItem extends StatelessWidget {
return PlanItem(context);
} else if (cards.cardType == "hospital") {
return HospitalItem(context);
} else if (cards.cardType == "doctor") {
return DoctorItem(context);
} else if (cards.cardType == "diary") {
return DiaryItem(context);
}
}
......@@ -283,4 +287,173 @@ class LevelOneItem extends StatelessWidget {
],
);
}
Widget DiaryItem(BuildContext context) {
if (cards.plan == null && isDebug) {
throw new Exception();
}
return Container(
margin: EdgeInsets.only(left: 20, right: 20),
width: double.maxFinite,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
height: 25,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 25,
height: 25,
child: ClipOval(
child: CachedNetworkImage(
imageUrl: cards.diary.user.portrait,
fit: BoxFit.cover,
),
),
),
Container(
margin: EdgeInsets.only(left: 8),
child: baseText(
cards.diary.user.userName, 13, Color(0xff999999)),
),
cards.diary.userLevel!=null&&cards.diary.userLevel.levelIcon!=null
? Container(
width: 31,
height: 12,
child: CachedNetworkImage(
imageUrl: cards.diary.userLevel.levelIcon,
),
)
: Container(
width: 0,
)
],
),
),
(cards.diary.images == null ||
cards.diary.images.isEmpty ||
cards.diary.images.length < 2)
? Container(
height: 0,
)
: Row(
children: <Widget>[
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
cards.diary.images[0].imageHalf))),
alignment: Alignment.bottomLeft,
child: Container(
width: 65.5,
height: 18,
decoration: BoxDecoration(
color: Color(0x4c000000),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(4),
topRight: Radius.circular(2),
)),
alignment: Alignment.center,
child: baseText(
cards.diary.images[0].desc, 11, Colors.white),
),
),
),
Container(
width: 9,
),
Expanded(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
cards.diary.images[1].imageHalf))),
alignment: Alignment.bottomLeft,
child: Container(
width: 65.5,
height: 18,
decoration: BoxDecoration(
color: Color(0x4c000000),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(4),
topRight: Radius.circular(2),
)),
alignment: Alignment.center,
child: baseText(
cards.diary.images[1].desc, 11, Colors.white),
),
),
)
],
),
Container(
margin: EdgeInsets.only(top: 12.5,bottom: 12),
child:Text(
cards.diary.content,
textScaleFactor: 1.0,
maxLines: 5,
overflow: TextOverflow.ellipsis,
style: TextStyle(
decoration: TextDecoration.none,
fontSize: 15,
color: Color(0xff464646),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400),
) ,
)
,
baseText("项目${cards.diary.title}", 13, Color(0xff999999)),
Container(
margin: EdgeInsets.only(top: 12,bottom: 16),
height: 14,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 14,
height: 14,
child: Image.asset("assets/eye.png"),
),
Container(
margin: EdgeInsets.only(left: 5,right: 20),
child: baseText("${cards.diary.viewNum}", 12, Color(0xff999999)),
),
Container(
width: 14,
height: 14,
child: Image.asset("assets/arguement.png"),
),
Container(
margin: EdgeInsets.only(left: 5,right: 20),
child: baseText("${cards.diary.replyNum}", 12, Color(0xff999999)),
),
Container(
width: 14,
height: 14,
child: Image.asset("assets/heart.png"),
),
Container(
margin: EdgeInsets.only(left: 5,right: 20),
child: baseText("${cards.diary.voteNum}", 12, Color(0xff999999)),
)
],
),
),
Container(
width: double.maxFinite,
height: 0.5,
color: Color(0xffE5E5E5),
)
],
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment