Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
e4a1ffb28951fd6b813881206f06346cf201fca3
2 parents
716a61ed
1ed20d72
Merge branch 'feature/web/search' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
template/www.yohobuy.com/partials/product/filter-box.phtml
web-static/js/product/filter.js
web-static/js/product/product.js
template/www.yohobuy.com/partials/product/filter-box.phtml
View file @
e4a1ffb
...
...
@@ -179,7 +179,7 @@
</div>
{{/if}}
<div class="size section {{#unless size}}hide{{/unless}}">
<div class="size section {{#unless size}}hide{{/unless}}"
{{#if size}}data-load="true"{{/if}}
>
<span class="title">尺码:</span>
<div class="attr-content clearfix">
...
...
web-static/js/product/filter.js
View file @
e4a1ffb
...
...
@@ -111,26 +111,28 @@ $('.sort-pre').on('click', 'li', function() {
$sortSub
.
children
(
':not(.hide)'
).
addClass
(
'hide'
);
$sortSub
.
children
(
':eq('
+
index
+
')'
).
removeClass
(
'hide'
);
if
(
sizeCache
[
id
])
{
$sizeWrap
.
find
(
'.attr-content'
).
html
(
sizeCache
[
id
]);
$sizeWrap
.
removeClass
(
'hide'
);
}
else
{
$
.
ajax
({
url
:
'/product/search/sortSize'
,
data
:
{
msort
:
id
}
}).
then
(
function
(
res
)
{
if
(
$
.
type
(
res
)
===
'array'
&&
res
.
length
)
{
sizeCache
[
id
]
=
sizeTmpl
({
size
:
res
});
$sizeWrap
.
find
(
'.attr-content'
).
html
(
sizeCache
[
id
]);
$sizeWrap
.
removeClass
(
'hide'
);
}
else
{
$sizeWrap
.
addClass
(
'hide'
);
}
});
if
(
!
$sizeWrap
.
data
(
'load'
))
{
if
(
sizeCache
[
id
])
{
$sizeWrap
.
find
(
'.attr-content'
).
html
(
sizeCache
[
id
]);
$sizeWrap
.
removeClass
(
'hide'
);
}
else
{
$
.
ajax
({
url
:
'/product/search/sortSize'
,
data
:
{
msort
:
id
}
}).
then
(
function
(
res
)
{
if
(
$
.
type
(
res
)
===
'array'
&&
res
.
length
)
{
sizeCache
[
id
]
=
sizeTmpl
({
size
:
res
});
$sizeWrap
.
find
(
'.attr-content'
).
html
(
sizeCache
[
id
]);
$sizeWrap
.
removeClass
(
'hide'
);
}
else
{
$sizeWrap
.
addClass
(
'hide'
);
}
});
}
}
});
...
...
web-static/js/product/product.js
View file @
e4a1ffb
...
...
@@ -14,7 +14,8 @@ var $goodsContainer = $('.goods-container'),
$goodInfoMain
=
$goodsContainer
.
find
(
'.good-info-main'
),
$goodSelectColor
=
$goodsContainer
.
find
(
'.good-select-color'
),
$productListNav
=
$
(
'.product-list-nav'
),
productList
;
productList
,
getProductAjax
;
lazyLoad
(
$
(
'img.lazy'
));
...
...
@@ -95,7 +96,12 @@ exports.init = function(num) {
wrapperPt
,
//鼠标移入时弹层的上内边距
containerPt
;
//商品列表容器的上内边距
$
.
ajax
({
// 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误
if
(
getProductAjax
)
{
getProductAjax
.
abort
();
}
getProductAjax
=
$
.
ajax
({
type
:
'POST'
,
url
:
'/product/list/getProductPic'
,
dataType
:
'json'
,
...
...
Please
register
or
login
to post a comment