Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmalpha_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmalpha_flutter
Commits
2fa3f27c
Commit
2fa3f27c
authored
Oct 30, 2019
by
何碧荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
like页埋点添加
parent
841b1bc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
32 deletions
+81
-32
common.dart
lib/NewMessageModel/page/common.dart
+11
-0
LikeListItem.dart
lib/NewMessageModel/page/likePage/LikeListItem.dart
+70
-32
No files found.
lib/NewMessageModel/page/common.dart
View file @
2fa3f27c
...
@@ -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
lib/NewMessageModel/page/likePage/LikeListItem.dart
View file @
2fa3f27c
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
)
)
],
),
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment