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

消息页bug

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