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
unknown
9 years ago
Commit
4da0a289fe464f9f87c55f9ea83f5873a1f53a81
2 parents
4230e011
b2466185
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
31 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 @
4da0a28
...
...
@@ -94,12 +94,16 @@
{{#unless hideMore}}
<div class="brand-opt">
<span id="brand-more" class="brand-more">
<em>更多</em>
<i class="iconfont"></i>
</span>
{{#if showMore}}
<span id="brand-more" class="brand-more">
<em>更多</em>
<i class="iconfont"></i>
</span>
{{/if}}
<span id="brand-multi" class="multi-select">多选 +</span>
{{#if showMulti}}
<span id="brand-multi" class="multi-select">多选 +</span>
{{/if}}
</div>
{{/unless}}
...
...
@@ -179,7 +183,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 @
4da0a28
...
...
@@ -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 @
4da0a28
...
...
@@ -95,6 +95,11 @@ exports.init = function(num) {
wrapperPt
,
//鼠标移入时弹层的上内边距
containerPt
;
//商品列表容器的上内边距
// 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误
// if (getProductAjax && getProductAjax.readyState!= 4) {
// getProductAjax.abort();
// }
$
.
ajax
({
type
:
'POST'
,
url
:
'/product/list/getProductPic'
,
...
...
@@ -104,11 +109,8 @@ exports.init = function(num) {
}
}).
then
(
function
(
data
)
{
//setTimeout(function () {
removeHtmlFn
();
ulStr
=
createColorList
(
data
.
pics
).
colorListStr
;
//ajax请求的颜色列表
ulNum
=
createColorList
(
data
.
pics
).
ulNum
;
//ajax请求的颜色的数量
...
...
@@ -151,8 +153,6 @@ exports.init = function(num) {
if
(
data
.
pics
[
0
]
&&
data
.
pics
[
0
].
src
)
{
$goodInfoMain
.
find
(
'.good-thumb img'
).
attr
(
'src'
,
data
.
pics
[
0
].
src
);
}
//}, 1000);
});
});
...
...
Please
register
or
login
to post a comment