Commit d6b74536 authored by 郑智刚's avatar 郑智刚

Merge branch 'dx/message' of git.wanmeizhensuo.com:mobile/gmalpha_flutter into dx/message

parents 1ca8ceec ce4244dd
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/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/res/value/ALColors.dart'; import 'package:gmalpha_flutter/res/value/ALColors.dart';
...@@ -16,7 +18,7 @@ messageTitle(String text) { ...@@ -16,7 +18,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 +78,7 @@ messageTop(imgUrl, title, content, count) { ...@@ -76,7 +78,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,8 +104,14 @@ getNum([int count]) { ...@@ -102,8 +104,14 @@ getNum([int count]) {
} }
} }
messageList(list) { Widget messageList(list) {
var contentText = {1: '评论了你', 2: '评论了你的评论', 3: '评论了你', 4: '评论了你的评论', 5: '关注了你的问题'}; 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( return Container(
padding: EdgeInsets.only(left: width, right: width), padding: EdgeInsets.only(left: width, right: width),
margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)), margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)),
...@@ -115,18 +123,28 @@ messageList(list) { ...@@ -115,18 +123,28 @@ messageList(list) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( 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, width: 42.0,
height: 42.0, height: 42.0,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage(list.icon) image: NetworkImage(list.icon)
), )
), )
)
), ),
SizedBox(width: ScreenUtil().setWidth(10)), SizedBox(width: ScreenUtil().setWidth(10)),
Container( GestureDetector(
onTap: (){
onClickButton('comment');
},
child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
...@@ -143,7 +161,7 @@ messageList(list) { ...@@ -143,7 +161,7 @@ messageList(list) {
), ),
SizedBox(width: ScreenUtil().setWidth(10)), SizedBox(width: ScreenUtil().setWidth(10)),
Text( Text(
contentText[list.repliedContent?.type], content[list.repliedContent?.type]['showText'],
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13) fontSize: ScreenUtil().setSp(13)
...@@ -170,17 +188,35 @@ messageList(list) { ...@@ -170,17 +188,35 @@ messageList(list) {
fontSize: ScreenUtil().setSp(10) fontSize: ScreenUtil().setSp(10)
) )
) )
], ]
),
) )
], )
)
]
), ),
Image.network( 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, list.repliedContent.content,
width: ScreenUtil().setWidth(48), width: ScreenUtil().setWidth(48),
fit: BoxFit.fill, 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