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/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/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
......@@ -16,7 +18,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 +78,7 @@ messageTop(imgUrl, title, content, count) {
);
}
getNum([int count]) {
Widget getNum([int count]) {
if(count > 0) {
return Positioned(
right: 0,
......@@ -102,8 +104,14 @@ getNum([int count]) {
}
}
messageList(list) {
var contentText = {1: '评论了你', 2: '评论了你的评论', 3: '评论了你', 4: '评论了你的评论', 5: '关注了你的问题'};
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)),
......@@ -115,18 +123,28 @@ messageList(list) {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
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,
height: 42.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(list.icon)
),
),
)
)
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
Container(
GestureDetector(
onTap: (){
onClickButton('comment');
},
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
......@@ -143,7 +161,7 @@ messageList(list) {
),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
contentText[list.repliedContent?.type],
content[list.repliedContent?.type]['showText'],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
......@@ -170,17 +188,35 @@ messageList(list) {
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,
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