Commit 2fa3f27c authored by 何碧荣's avatar 何碧荣

like页埋点添加

parent 841b1bc5
...@@ -222,4 +222,14 @@ void onClickButton(buttonName, [params]) { ...@@ -222,4 +222,14 @@ void onClickButton(buttonName, [params]) {
'button_name': buttonName, 'button_name': buttonName,
...?params ...?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/res/value/ALColors.dart'; import 'package:gmalpha_flutter/res/value/ALColors.dart';
...@@ -8,7 +9,7 @@ import 'package:gmalpha_flutter/res/value/ALColors.dart'; ...@@ -8,7 +9,7 @@ import 'package:gmalpha_flutter/res/value/ALColors.dart';
class LikeListItem extends StatelessWidget { class LikeListItem extends StatelessWidget {
final Data item; final Data item;
LikeListItem(this.item); LikeListItem(this.item);
Text myText( Text myText(
String text, String text,
Color color, Color color,
...@@ -30,16 +31,29 @@ class LikeListItem extends StatelessWidget { ...@@ -30,16 +31,29 @@ class LikeListItem extends StatelessWidget {
} }
Widget listItemHead() { Widget listItemHead() {
var businessId;
if(item.likeContent != null){
businessId = item.likeContent.id.toString() ;
}
else{
businessId = item.userId.toString();
}
return ClipOval( return ClipOval(
child: Container( child: GestureDetector(
color: ALColors.ColorE4E4E4, onTap: () {
child: CachedNetworkImage( onClickLike('head_photo',{'business_id':businessId,'tab_name':''});
width: 42.0, },
height: 42.0, child: Container(
imageUrl: item.icon, color: ALColors.ColorE4E4E4,
fit: BoxFit.cover, child: CachedNetworkImage(
), width: 42.0,
) height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
)
)
); );
} }
...@@ -53,16 +67,28 @@ class LikeListItem extends StatelessWidget { ...@@ -53,16 +67,28 @@ 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 Container( return Container(
child: Container( child: GestureDetector(
color: ALColors.ColorE4E4E4, onTap: () {
child: CachedNetworkImage( onClickLike('photo',{'business_id':businessId,'tab_name':''});
width: 42.0, },
height: 42.0, child: Container(
imageUrl: commentImg, color: ALColors.ColorE4E4E4,
fit: BoxFit.cover, child: CachedNetworkImage(
), width: 42.0,
) height: 42.0,
imageUrl: commentImg,
fit: BoxFit.cover,
),
)
),
); );
} }
...@@ -85,21 +111,33 @@ class LikeListItem extends StatelessWidget { ...@@ -85,21 +111,33 @@ class LikeListItem extends StatelessWidget {
else{ else{
textTop = 0.0 ; textTop = 0.0 ;
} }
var businessId;
if(item.likeContent != null){
businessId = item.likeContent.id.toString() ;
}
else{
businessId = item.userId.toString();
}
return Expanded( return Expanded(
child: Column( child: GestureDetector(
crossAxisAlignment: CrossAxisAlignment.start, onTap: () {
children: <Widget>[ onClickLike('like_message',{'business_id':businessId,'tab_name':''});
Container( },
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)), child: Column(
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)), crossAxisAlignment: CrossAxisAlignment.start,
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', ALColors.Color666666, 13.0), children: <Widget>[
Container(
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)),
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', 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)
)
],
), ),
Padding( )
padding: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime??""}', ALColors.Color999999, 10.0)
)
],
),
); );
} }
......
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