Commit d3a54528 authored by 何碧荣's avatar 何碧荣

解决冲突

parents 0968a395 2fa3f27c
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
messageTitle(String text) {
return Text(
text,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(20)
)
);
}
var width = ScreenUtil().setWidth(16);
Widget messageTop(imgUrl, title, content, count) {
var height = ScreenUtil().setHeight(12);
return Container(
padding: EdgeInsets.only(left: width, right: width),
width: double.infinity,
child: Stack(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(28)),
margin: EdgeInsets.only(left: ScreenUtil().setWidth(4), top: height, bottom: height),
width: double.infinity,
decoration: BoxDecoration(
color: ALColors.ColorFFFFFF,
image: DecorationImage(
image: AssetImage(imgUrl),
alignment: Alignment.centerLeft
)
),
child: Row(
children: <Widget>[
Text(
title,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold
)
),
SizedBox(
width: ScreenUtil().setWidth(16),
),
Container(
width: ScreenUtil().setWidth(200),
child: Text(
content,
style: TextStyle(
color: ALColors.Color8E8E8E,
fontSize: ScreenUtil().setSp(13)
),
maxLines: 1,
overflow: TextOverflow.ellipsis
)
)
],
),
),
getNum(count),
Positioned(
right: ScreenUtil().setWidth(14),
top: ScreenUtil().setHeight(12),
child: Hero(
tag: "arrow_right",
child: SvgPicture.asset(
"images/arrow_right.svg",
color: ALColors.Color323232,
)),
)
],
)
);
}
Widget getNum([int count]) {
if(count > 0) {
return Positioned(
right: 0,
top: ScreenUtil().setHeight(12),
child: Container(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(2), bottom: ScreenUtil().setHeight(2), left: ScreenUtil().setWidth(7), right: ScreenUtil().setWidth(7)),
decoration: BoxDecoration(
color: ALColors.Color323232,
borderRadius: BorderRadius.circular(22.0)
),
child: Text(
count.toString(),
style: TextStyle(
color: ALColors.ColorFFFFFF,
fontSize: ScreenUtil().setSp(11),
height: 1.0
),
)
),
);
} else {
return Container();
}
}
Widget messageList(list) {
var content = {
1: {'showText': '评论了你', 'opeUrl': 'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'},
2: {'showText': '评论了你的评论', 'opeUrl': 'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'},
3: {'showText': '评论了你', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'},
4: {'showText': '评论了你的评论', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'},
5: {'showText': '关注了你的问题', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}'}
};
return Container(
padding: EdgeInsets.only(left: width, right: width),
margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: (){
onClickButton('head_photo', {'business_id': list.userId.toString()});
jumpToNative('message_home', {"url": 'alpha://user_detail?user_id=${list.userId}'});
},
child: Container(
width: 42.0,
height: 42.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(list.icon)
)
)
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
GestureDetector(
onTap: (){
onClickButton('comment');
},
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Text(
list.name,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
content[list.repliedContent?.type]['showText'],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
)
)
],
),
Container(
width: ScreenUtil().setWidth(210),
child: Text(
list.content,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
),
maxLines: 1,
overflow: TextOverflow.ellipsis
),
),
Text(
MessageDate(list.time).diffTime(),
style: TextStyle(
color: Color(0xfff8e8e8e),
fontSize: ScreenUtil().setSp(10)
)
)
]
)
)
)
]
),
GestureDetector(
onTap: () {
onClickButton('photo', {'business_id': list.repliedContent.id.toString()});
jumpToNative('message_home', {"url": 'alpha://${content[list.repliedContent?.type]['openUrl']}'});
},
child: Image.network(
list.repliedContent.content,
width: ScreenUtil().setWidth(48),
fit: BoxFit.fill,
)
)
],
)
);
}
void onClickButton(buttonName, [params]) {
RouterCenterImpl()
.findBuriedRouter()
?.onEvent('on_click_button', {
'page_name': 'message_home',
'button_name': buttonName,
...?params
});
}
void onClickLike(buttonName, [params]) {
RouterCenterImpl()
.findBuriedRouter()
?.onEvent('on_click_button', {
'page_name': 'like_list',
'button_name': buttonName,
...?params
});
}
\ No newline at end of file
import 'package:cached_network_image/cached_network_image.dart'; 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/page/common.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LikePageEntity.dart'; import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LikePageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart'; import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart'; import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
...@@ -19,17 +20,24 @@ class LikeListItem extends StatelessWidget { ...@@ -19,17 +20,24 @@ class LikeListItem extends StatelessWidget {
maxLines: maxLines, maxLines: maxLines,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: ScreenUtil.instance.setSp(size), fontSize: ScreenUtil.instance.setSp(size),
color: color, color: color,
height: 1.38, height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal fontWeight: weight ? FontWeight.bold : FontWeight.normal),
),
); );
} }
Widget listItemHead() { Widget listItemHead() {
var businessId;
if (item.likeContent != null) {
businessId = item.likeContent.id.toString();
} else {
businessId = item.userId.toString();
}
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
onClickLike(
'head_photo', {'business_id': businessId, 'tab_name': ''});
jumpToNative('url_page', jumpToNative('url_page',
{"url": 'alpha://user_detail?user_id=${item.userId}'}); {"url": 'alpha://user_detail?user_id=${item.userId}'});
}, },
...@@ -57,8 +65,15 @@ class LikeListItem extends StatelessWidget { ...@@ -57,8 +65,15 @@ class LikeListItem extends StatelessWidget {
commentImg = 'http://alpha.iyanzhi.com/topic/2019/08/16/63ef62d019-w'; commentImg = 'http://alpha.iyanzhi.com/topic/2019/08/16/63ef62d019-w';
} }
} }
var businessId;
if (item.likeContent != null) {
businessId = item.likeContent.id.toString();
} else {
businessId = item.userId.toString();
}
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
onClickLike('photo', {'business_id': businessId, 'tab_name': ''});
if (item.likeContent.type == 0) { if (item.likeContent.type == 0) {
jumpToNative('url_page', { jumpToNative('url_page', {
"url": "alpha://topic_detail?topic_id=${item.likeContent.id}" "url": "alpha://topic_detail?topic_id=${item.likeContent.id}"
...@@ -83,54 +98,63 @@ class LikeListItem extends StatelessWidget { ...@@ -83,54 +98,63 @@ class LikeListItem extends StatelessWidget {
} }
Widget listItemInfo() { Widget listItemInfo() {
var commentInfo; var commentInfo;
var commenTime; var commenTime;
var textTop ; var textTop;
if(item.type != 2){ if (item.type != 2) {
if(item.likeContent.type == 0){ if (item.likeContent.type == 0) {
commentInfo = '赞了你的回答'; commentInfo = '赞了你的回答';
} } else {
else{ commentInfo = '赞了你的评论';
commentInfo = '赞了你的评论';
} }
commenTime = MessageDate(item.time).diffTime(); commenTime = MessageDate(item.time).diffTime();
} }
if(item.content != null){ if (item.content != null) {
textTop = 11.0 ; textTop = 11.0;
} else {
textTop = 0.0;
} }
else{ var businessId;
textTop = 0.0 ; if (item.likeContent != null) {
businessId = item.likeContent.id.toString();
} else {
businessId = item.userId.toString();
} }
return Expanded( return Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if (item.likeContent.type == 0) { onClickLike(
jumpToNative('url_page', { 'like_message', {'business_id': businessId, 'tab_name': ''});
"url": "alpha://topic_detail?topic_id=${item.likeContent.id}" if (item.likeContent.type == 0) {
}); jumpToNative('url_page',
} else if (item.likeContent.type == 1) { {"url": "alpha://topic_detail?topic_id=${item.likeContent.id}"});
jumpToNative('url_page', { } else if (item.likeContent.type == 1) {
"url": jumpToNative('url_page', {
"alpha://topic_detail?call_keyboard=1&open_comment=1&topic_id=${item.likeContent.id}" "url":
}); "alpha://topic_detail?call_keyboard=1&open_comment=1&topic_id=${item.likeContent.id}"
} });
}, }
child: Column( },
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Container( children: <Widget>[
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)), Container(
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)), margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', ALColors.Color666666, 13.0), padding:
), EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)),
Padding( child: myText(
padding: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)), '${item.name ?? ""}${item.content ?? ""}${commentInfo ?? ""}',
child: myText('${commenTime??""}', ALColors.Color999999, 10.0) ALColors.Color666666,
) 13.0),
], ),
), Padding(
) padding: EdgeInsets.only(
); left: ScreenUtil.instance.setWidth(10.0),
top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime ?? ""}', ALColors.Color999999, 10.0))
],
),
));
} }
Widget listItemButton() { Widget listItemButton() {
...@@ -156,7 +180,7 @@ class LikeListItem extends StatelessWidget { ...@@ -156,7 +180,7 @@ class LikeListItem extends StatelessWidget {
child: myText('查看', ALColors.Color323232, 13.0)), child: myText('查看', ALColors.Color323232, 13.0)),
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
......
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