Commit 814f5430 authored by 杜欣's avatar 杜欣

submit message

parent c9136b8e
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/MessageModel.dart'; import 'package:gmalpha_flutter/NewMessageModel/page/MessageModel.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/common.dart'; import 'package:gmalpha_flutter/NewMessageModel/page/common.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart'; import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart';
...@@ -155,9 +154,7 @@ class _MessagePageState extends State<MessagePage> { ...@@ -155,9 +154,7 @@ class _MessagePageState extends State<MessagePage> {
var content = data.data?.data?.content ?? '没有新的通知'; var content = data.data?.data?.content ?? '没有新的通知';
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
RouterCenterImpl() onClickButton('notice');
.findBuriedRouter()
?.onClick(pageName(), "on_click_button");
jumpToAttentionPage(context); jumpToAttentionPage(context);
}, },
child: messageTop('images/message_noti.png', '通知', content == '' ? '没有新的通知' : content, 0) child: messageTop('images/message_noti.png', '通知', content == '' ? '没有新的通知' : content, 0)
...@@ -174,9 +171,7 @@ class _MessagePageState extends State<MessagePage> { ...@@ -174,9 +171,7 @@ class _MessagePageState extends State<MessagePage> {
var voteCount = data.data?.data?.voteCount ?? 0; var voteCount = data.data?.data?.voteCount ?? 0;
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
RouterCenterImpl() onClickButton('like');
.findBuriedRouter()
?.onClick(pageName(), "on_click_button");
jumpToAttentionPage(context); jumpToAttentionPage(context);
}, },
child: messageTop('images/message_like.png', 'Like!', voteCount == 0 ? '还没有人给你Like!哦~' : '有$voteCount个人Like!了你', voteCount) child: messageTop('images/message_like.png', 'Like!', voteCount == 0 ? '还没有人给你Like!哦~' : '有$voteCount个人Like!了你', voteCount)
...@@ -193,9 +188,7 @@ class _MessagePageState extends State<MessagePage> { ...@@ -193,9 +188,7 @@ class _MessagePageState extends State<MessagePage> {
var count = data.data?.data?.count ?? 0; var count = data.data?.data?.count ?? 0;
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
RouterCenterImpl() onClickButton('attention');
.findBuriedRouter()
?.onClick(pageName(), "on_click_button");
jumpToAttentionPage(context); jumpToAttentionPage(context);
}, },
child: messageTop('images/message_att.png', '关注', count == 0 ? '还没有人给你关注哦~' : '有$count个人关注了你', count) child: messageTop('images/message_att.png', '关注', count == 0 ? '还没有人给你关注哦~' : '有$count个人关注了你', count)
...@@ -221,11 +214,6 @@ class _MessagePageState extends State<MessagePage> { ...@@ -221,11 +214,6 @@ class _MessagePageState extends State<MessagePage> {
); );
} }
@override
String pageName() {
return "message_home";
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
......
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/message_date.dart'; import 'package:gmalpha_flutter/NewMessageModel/page/message_date.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart'; import 'package:gmalpha_flutter/res/value/ALColors.dart';
...@@ -16,7 +17,7 @@ messageTitle(String text) { ...@@ -16,7 +17,7 @@ messageTitle(String text) {
var width = ScreenUtil().setWidth(16); var width = ScreenUtil().setWidth(16);
messageTop(imgUrl, title, content, count) { Widget messageTop(imgUrl, title, content, count) {
var height = ScreenUtil().setHeight(12); var height = ScreenUtil().setHeight(12);
return Container( return Container(
padding: EdgeInsets.only(left: width, right: width), padding: EdgeInsets.only(left: width, right: width),
...@@ -76,7 +77,7 @@ messageTop(imgUrl, title, content, count) { ...@@ -76,7 +77,7 @@ messageTop(imgUrl, title, content, count) {
); );
} }
getNum([int count]) { Widget getNum([int count]) {
if(count > 0) { if(count > 0) {
return Positioned( return Positioned(
right: 0, right: 0,
...@@ -102,7 +103,7 @@ getNum([int count]) { ...@@ -102,7 +103,7 @@ getNum([int count]) {
} }
} }
messageList(list) { Widget messageList(list) {
var contentText = {1: '评论了你', 2: '评论了你的评论', 3: '评论了你', 4: '评论了你的评论', 5: '关注了你的问题'}; var contentText = {1: '评论了你', 2: '评论了你的评论', 3: '评论了你', 4: '评论了你的评论', 5: '关注了你的问题'};
return Container( return Container(
padding: EdgeInsets.only(left: width, right: width), padding: EdgeInsets.only(left: width, right: width),
...@@ -115,72 +116,98 @@ messageList(list) { ...@@ -115,72 +116,98 @@ messageList(list) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( GestureDetector(
width: 42.0, onTap: (){
height: 42.0, onClickButton('head_photo', {'business_id': list.userId.toString()});
decoration: BoxDecoration( },
shape: BoxShape.circle, child: Container(
image: DecorationImage( width: 42.0,
image: NetworkImage(list.icon) height: 42.0,
), decoration: BoxDecoration(
), shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(list.icon)
)
)
)
), ),
SizedBox(width: ScreenUtil().setWidth(10)), SizedBox(width: ScreenUtil().setWidth(10)),
Container( GestureDetector(
child: Column( onTap: (){
crossAxisAlignment: CrossAxisAlignment.start, onClickButton('comment');
mainAxisAlignment: MainAxisAlignment.start, },
children: <Widget>[ child: Container(
Row( child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Text( mainAxisAlignment: MainAxisAlignment.start,
list.name, children: <Widget>[
style: TextStyle( Row(
color: ALColors.Color323232, children: <Widget>[
fontSize: ScreenUtil().setSp(13), Text(
fontWeight: FontWeight.bold list.name,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
contentText[list.repliedContent?.type],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
)
) )
), ],
SizedBox(width: ScreenUtil().setWidth(10)), ),
Text( Container(
contentText[list.repliedContent?.type], width: ScreenUtil().setWidth(210),
child: Text(
list.content,
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13) fontSize: ScreenUtil().setSp(13)
) ),
) maxLines: 1,
], overflow: TextOverflow.ellipsis
),
Container(
width: ScreenUtil().setWidth(210),
child: Text(
list.content,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
), ),
maxLines: 1,
overflow: TextOverflow.ellipsis
), ),
), Text(
Text( MessageDate(list.time).diffTime(),
MessageDate(list.time).diffTime(), style: TextStyle(
style: TextStyle( color: Color(0xfff8e8e8e),
color: Color(0xfff8e8e8e), fontSize: ScreenUtil().setSp(10)
fontSize: ScreenUtil().setSp(10) )
) )
) ]
], )
), )
) )
], ]
), ),
Image.network( GestureDetector(
list.repliedContent.content, onTap: () {
width: ScreenUtil().setWidth(48), onClickButton('photo', {'business_id': list.repliedContent.id.toString()});
fit: BoxFit.fill, },
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
});
}
\ No newline at end of file
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