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
fd284c21e0ec4b99788fa1ff330fa61328c0902a
2 parents
b7980ca8
bee84425
Merge branch 'release/4.5' of
http://git.dev.yoho.cn/web/yohobuywap
into release/4.5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
static/js/category/write-search.js
template/m.yohobuy.com/actions/category/brand/search.phtml
static/js/category/write-search.js
View file @
fd284c2
...
...
@@ -15,11 +15,11 @@ function getRanToken() {
/**
* 增加单条记录
*/
function
addHistory
(
brand
Id
)
{
function
addHistory
(
brand
Name
)
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/category/brand/addBrandSearch'
,
data
:
'brand
Id='
+
brandId
,
data
:
'brand
Name='
+
brandName
,
success
:
function
(
data
)
{
},
error
:
function
()
{
...
...
@@ -30,20 +30,24 @@ function addHistory(brandId) {
//绑定提交前的存local操作
function
bindWirteLocal
(
$brandList
)
{
$brandList
.
on
(
'click'
,
'p'
,
function
(
e
)
{
var
a
,
brandName
,
brandId
,
url
;
var
query
=
brandName
+
url
,
var
brandName
,
brandId
,
url
;
var
a
=
$
(
this
).
find
(
'a'
);
var
query
=
a
.
attr
(
'brandName'
)
+
a
.
attr
(
'href'
),
historys
;
e
.
preventDefault
();
a
=
$
(
this
).
find
(
'a'
);
brandName
=
a
.
attr
(
'brandName'
);
brandId
=
a
.
attr
(
'brandId'
);
url
=
a
.
attr
(
'href'
);
e
.
preventDefault
();
if
(
$
(
'.net-search'
).
length
>
0
)
{
addHistory
(
brandName
);
location
.
href
=
url
;
return
;
}
if
(
localStorage
)
{
historys
=
localStorage
.
getItem
(
'historys-brand'
);
...
...
@@ -64,9 +68,7 @@ function bindWirteLocal($brandList) {
localStorage
.
setItem
(
'historys-brand'
,
historys
);
}
if
(
$
(
'.net-search'
).
length
>
0
)
{
addHistory
(
brandId
);
}
location
.
href
=
url
;
});
...
...
template/m.yohobuy.com/actions/category/brand/search.phtml
View file @
fd284c2
...
...
@@ -19,7 +19,7 @@
{
{#if
historySearch
}
}
<div
class=
"history-search net-search hide"
>
<h
3
><span
class=
"iconfont"
>
64
a;</span>最近搜索
<button
id=
"clear-history"
class=
"clear-icon iconfont hide"
>
64
c;
;
</button>
<button
id=
"clear-history"
class=
"clear-icon iconfont hide"
>
64
c;</button>
</h
3
>
<ul
class=
"history clearfix"
>
{
{#
history
}
}
...
...
Please
register
or
login
to post a comment