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
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
fd6b8e7d7fa5a46a6b25b80a1474bb852ff54d6e
2 parents
452e6f42
5b211afe
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
framework
static/js/category/brand.js
framework
@
75bbc3b0
Subproject commit
119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit
75bbc3b075de19f239532f60c5995d06c5f814e2
...
...
static/js/category/brand.js
View file @
fd6b8e7
...
...
@@ -10,6 +10,8 @@ var $ = require('jquery'),
lazyLoad
=
require
(
'yoho.lazyload'
);
var
swiper
,
$brandText
,
$brandHref
,
$brandList
=
$
(
'.brand-list'
);
var
searchH
=
$
(
'.newbrand-search'
).
outerHeight
(),
...
...
@@ -137,14 +139,15 @@ function searchResult() {
$
(
'.search-result .brand-list p'
).
each
(
function
(
index
)
{
searchList
=
new
Hammer
(
$
(
'.search-result .brand-list p'
).
eq
(
index
)[
0
]);
searchList
.
on
(
'tap'
,
function
()
{
$brandText
=
$
(
'.search-result .brand-list p'
).
eq
(
index
).
find
(
'a'
).
html
();
$brandHref
=
$
(
'.search-result .brand-list p'
).
eq
(
index
).
find
(
'a'
).
attr
(
'href'
);
if
(
localStorage
.
getItem
(
'yohoHistory'
))
{
yohoHistory
=
localStorage
.
getItem
(
'yohoHistory'
);
searchArray
.
push
(
yohoHistory
);
}
searchArray
.
push
(
'{"searchName":"'
+
$
(
'.search-result .brand-list p'
).
eq
(
index
).
find
(
'a'
).
html
()
+
'","searchHref":"'
+
$
(
'.search-result .brand-list p'
)
.
eq
(
index
).
find
(
'a'
).
attr
(
'href'
)
+
'"}'
);
if
(
searchArray
.
toString
().
split
(
$brandText
).
length
<
2
)
{
searchArray
.
push
(
'{"searchName":"'
+
$brandText
+
'","searchHref":"'
+
$brandText
+
'"}'
);
}
localStorage
.
setItem
(
'yohoHistory'
,
searchArray
);
});
});
...
...
Please
register
or
login
to post a comment