Commit 101de53c authored by 何碧荣's avatar 何碧荣

消息页bug

parent 2fa3f27c
......@@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/FocusPageEntity.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
......@@ -49,10 +50,14 @@ class FocusListItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width:double.infinity,
height: 42.0,
decoration: BoxDecoration(color: ALColors.ColorFFFFFF),
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(10.0)),
child: myText('${item.username??""} 关注了你', ALColors.Color666666, 13.0),
),
],
),
);
......@@ -71,3 +76,4 @@ class FocusListItem extends StatelessWidget {
);
}
}
......@@ -60,10 +60,10 @@ class LikeListItem extends StatelessWidget {
Widget listItemRight() {
var commentImg;
if(item.type!=2){
if( item.likeContent.content == null && item.likeContent.contentType != 1){
if( item.likeContent.content != null && item.likeContent.contentType != 1){
commentImg = item.likeContent.content ;
}
if(item.likeContent.content!=null && item.likeContent.contentType != 1){
if(item.likeContent.content ==null && item.likeContent.contentType != 1){
commentImg = 'http://alpha.iyanzhi.com/topic/2019/08/16/63ef62d019-w';
}
}
......@@ -95,6 +95,7 @@ class LikeListItem extends StatelessWidget {
Widget listItemInfo() {
var commentInfo;
var commenTime;
var replyContent;
var textTop ;
if(item.type != 2){
if(item.likeContent.type == 0){
......@@ -104,6 +105,9 @@ class LikeListItem extends StatelessWidget {
commentInfo = '赞了你的评论';
}
commenTime = MessageDate(item.time).diffTime();
if(item.type == 1){
replyContent = item.likeContent.replyContent;
}
}
if(item.content != null){
textTop = 11.0 ;
......@@ -131,6 +135,10 @@ class LikeListItem extends StatelessWidget {
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)),
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', ALColors.Color666666, 13.0),
),
item.type ==1? Padding(
padding: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${replyContent??""}', ALColors.Color999999, 10.0)
): Container(),
Padding(
padding: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime??""}', ALColors.Color999999, 10.0)
......
......@@ -2,17 +2,14 @@ class LikePageEntity {
int error;
String message;
Null extra;
bool noData;
List<Data> data;
LikePageEntity(
{this.error, this.message, this.extra, this.noData, this.data});
LikePageEntity({this.error, this.message, this.extra, this.data});
LikePageEntity.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
noData = json['noData'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
......@@ -26,7 +23,6 @@ class LikePageEntity {
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
data['noData'] = this.noData;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
......@@ -35,54 +31,54 @@ class LikePageEntity {
}
class Data {
int type;
int id;
String content;
int userId;
String icon;
bool unread;
String name;
String icon;
double time;
int type;
LikeContent likeContent;
int id;
String content;
bool unread;
Data(
{this.type,
this.id,
this.content,
this.userId,
this.icon,
this.unread,
{this.userId,
this.name,
this.icon,
this.time,
this.likeContent});
this.type,
this.likeContent,
this.id,
this.content,
this.unread});
Data.fromJson(Map<String, dynamic> json) {
type = json['type'];
id = json['id'];
content = json['content'];
userId = json['user_id'];
icon = json['icon'];
unread = json['unread'];
name = json['name'];
icon = json['icon'];
time = json['time'];
type = json['type'];
likeContent = json['like_content'] != null
? new LikeContent.fromJson(json['like_content'])
: null;
id = json['id'];
content = json['content'];
unread = json['unread'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['type'] = this.type;
data['id'] = this.id;
data['content'] = this.content;
data['user_id'] = this.userId;
data['icon'] = this.icon;
data['unread'] = this.unread;
data['name'] = this.name;
data['icon'] = this.icon;
data['time'] = this.time;
data['type'] = this.type;
if (this.likeContent != null) {
data['like_content'] = this.likeContent.toJson();
}
data['id'] = this.id;
data['content'] = this.content;
data['unread'] = this.unread;
return data;
}
}
......@@ -92,14 +88,17 @@ class LikeContent {
int id;
int contentType;
String content;
String replyContent;
LikeContent({this.type, this.id, this.contentType, this.content});
LikeContent(
{this.type, this.id, this.contentType, this.content, this.replyContent});
LikeContent.fromJson(Map<String, dynamic> json) {
type = json['type'];
id = json['id'];
contentType = json['content_type'];
content = json['content'];
replyContent = json['reply_content'];
}
Map<String, dynamic> toJson() {
......@@ -108,6 +107,7 @@ class LikeContent {
data['id'] = this.id;
data['content_type'] = this.contentType;
data['content'] = this.content;
data['reply_content'] = this.replyContent;
return data;
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ class TestPage extends StatelessWidget {
TestPage() {
Api.getInstance().setDioCookie({
'Cookie':
'sessionid=oji01pi0mou9l5ktg425mibrimyq5vc3;_gtid=120408d4f3c911e99a80525400e82fab6178;_gm_token=06e9361571644418'
'sessionid=iwoi8tubbd0h4um1pn3d7npwxe2zcrgd;_gtid=0e05ce8efaf911e9a89b525400e82fab6162;_gm_token=326dd81572428969'
});
}
......
......@@ -30,6 +30,7 @@ class _LayoutTestState extends State<LayoutTest> {
Widget _renderBoxTest(){
return Container(
color: Colors.greenAccent,
width:double.infinity,
constraints: BoxConstraints(
maxWidth: double.infinity,
minWidth: 200.0,
......
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