Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
241b258a579a47ba69f72ba55666ff8dc6dd5e7e
1 parent
34522ab3
男首和女首,猜你喜欢埋点
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
2 deletions
static/js/common.js
static/js/home/maybe-like.js
static/js/common.js
View file @
241b258
...
...
@@ -10,6 +10,9 @@ var $footer = $('#yoho-footer'),
$yohoPage
=
$
(
'.yoho-page'
),
$header
=
$
(
'.yoho-header'
);
//为您优选-40位随机数指纹请求id
var
RECID
=
new
Date
().
getTime
()
+
'_WEB_'
+
Math
.
floor
(
Math
.
random
()
*
10
);
function
cookie
(
name
)
{
var
cookies
=
document
.
cookie
,
cookieVal
,
...
...
@@ -272,6 +275,57 @@ function reMarginFooter(fixedElement) {
}
}());
//为您优选埋点 http://redmine.yoho.cn/issues/10117
function
givePoint
(
parameter
)
{
var
CID
=
1
;
if
(
!
window
.
_yas
.
sendCustomInfo
)
{
return
false
;
}
//男:1,女:2,潮童:3,创意生活:4
switch
(
cookie
(
'_Channel'
))
{
case
'boys'
:
CID
=
1
;
break
;
case
'girls'
:
CID
=
2
;
break
;
case
'kids'
:
CID
=
3
;
break
;
case
'lifestyle'
:
CID
=
4
;
break
;
}
parameter
=
$
.
extend
({
'REC_POSE'
:
''
,
'REC_ID'
:
RECID
,
'PRD_ID'
:
''
,
'PRD_NUM'
:
0
,
'C_ID'
:
CID
,
'ACTION_ID'
:
0
,
'page_num'
:
1
},
parameter
);
console
.
log
({
'op'
:
'YB_CHOOSE_FOR_YOU_Y'
,
'uid'
:
getUid
(),
'param'
:
parameter
},
'yas=WEB=='
);
if
(
parameter
.
REC_POSE
===
''
||
parameter
.
PRD_ID
===
''
)
{
return
true
;
}
window
.
_yas
.
sendCustomInfo
({
'op'
:
'YB_CHOOSE_FOR_YOU_Y'
,
'uid'
:
getUid
(),
'param'
:
parameter
},
true
);
}
/*$(document).ready(function() {
setTimeout(function() {
var arr = document.querySelectorAll('.buriedpoint').find('a'),
...
...
@@ -385,3 +439,5 @@ window.getShoppingKey = getShoppingKey;
window
.
rePosFooter
=
rePosFooter
;
window
.
reMarginFooter
=
reMarginFooter
;
window
.
givePoint
=
givePoint
;
...
...
static/js/home/maybe-like.js
View file @
241b258
...
...
@@ -19,7 +19,8 @@ module.exports = function(specificGender) {
page
=
0
,
gender
=
null
,
num
,
url
;
url
,
RECPOSE
=
'110001'
;
//The kidsType can be specified by the parameter. Add by @ZhaoBiao
var
kidsType
=
specificGender
===
'kids'
||
$
(
'.mobile-wrap'
).
hasClass
(
'kids-wrap'
)
?
true
:
false
,
...
...
@@ -64,6 +65,13 @@ module.exports = function(specificGender) {
url
=
'/product/recom/newPreference?template_id='
+
$
.
queryString
().
template_id
;
}
//首页男生和女生,推荐位ID,埋点
if
(
window
.
location
.
pathname
===
'/boys'
)
{
RECPOSE
=
'110001'
;
}
else
if
(
window
.
location
.
pathname
===
'/girls'
)
{
RECPOSE
=
'110002'
;
}
$curNav
=
$navList
.
children
(
'.focus'
);
if
(
lifestyleType
)
{
...
...
@@ -114,7 +122,7 @@ module.exports = function(specificGender) {
page
:
page
+
1
},
success
:
function
(
data
)
{
var
PRDID
=
[];
if
(
data
===
' '
)
{
searching
=
false
;
loading
.
hideLoadingMask
();
...
...
@@ -171,6 +179,19 @@ module.exports = function(specificGender) {
$title
[
0
].
mlellipsis
(
2
);
});
//为您优选埋点 start
$
(
data
).
closest
(
'.good-info'
).
each
(
function
()
{
PRDID
.
push
(
$
(
this
).
data
(
'id'
));
});
window
.
givePoint
({
'REC_POSE'
:
RECPOSE
,
'PRD_ID'
:
PRDID
.
join
(
','
),
'PRD_NUM'
:
$
(
data
).
closest
(
'.good-info'
).
length
,
'ACTION_ID'
:
0
,
'page_num'
:
page
+
1
});
//为您优选埋点 end
},
error
:
function
()
{
tip
.
show
(
'网络断开连接了~'
);
...
...
@@ -199,4 +220,18 @@ module.exports = function(specificGender) {
$
(
window
).
scroll
(
function
()
{
window
.
requestAnimationFrame
(
scrollHandler
);
});
//为您优选埋点 http://redmine.yoho.cn/issues/10116
$
(
'.maybe-like .goods-list'
).
on
(
'click'
,
'a'
,
function
()
{
var
index
=
$
(
this
).
closest
(
'.good-info'
).
index
()
+
1
,
pageNum
=
50
;
window
.
givePoint
({
'REC_POSE'
:
RECPOSE
,
'PRD_ID'
:
$
(
this
).
closest
(
'.good-info'
).
data
(
'id'
),
'PRD_NUM'
:
index
%
pageNum
===
0
?
pageNum
:
index
%
pageNum
,
'ACTION_ID'
:
1
,
'page_num'
:
Math
.
ceil
(
index
/
pageNum
)
});
return
false
;
});
};
...
...
Please
register
or
login
to post a comment