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
Email Patches
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
b24661854be0bff36dca878bc419658649395f2c
1 parent
704d95f0
代码整理
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
web-static/js/product/product.js
web-static/js/product/product.js
View file @
b246618
...
...
@@ -14,8 +14,7 @@ var $goodsContainer = $('.goods-container'),
$goodInfoMain
=
$goodsContainer
.
find
(
'.good-info-main'
),
$goodSelectColor
=
$goodsContainer
.
find
(
'.good-select-color'
),
$productListNav
=
$
(
'.product-list-nav'
),
productList
,
getProductAjax
;
productList
;
lazyLoad
(
$
(
'img.lazy'
));
...
...
@@ -97,11 +96,11 @@ exports.init = function(num) {
containerPt
;
//商品列表容器的上内边距
// 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误
// if (getProductAjax) {
// if (getProductAjax
&& getProductAjax.readyState!= 4
) {
// getProductAjax.abort();
// }
getProductAjax
=
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
url
:
'/product/list/getProductPic'
,
dataType
:
'json'
,
...
...
@@ -110,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请求的颜色的数量
...
...
@@ -157,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