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

submit message

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