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
f94bbd32a3a40cf4119bdfbf2f89edf8096b28c9
1 parent
716a61ed
晒选课尺寸不重新加载
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
template/www.yohobuy.com/partials/product/filter-box.phtml
web-static/js/product/filter.js
template/www.yohobuy.com/partials/product/filter-box.phtml
View file @
f94bbd3
...
...
@@ -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 @
f94bbd3
...
...
@@ -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'
);
}
});
}
}
});
...
...
Please
register
or
login
to post a comment