Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
13564b29979558bd2628d66b53a9e3117e3bce2b
1 parent
66b9c8ea
fix css
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
15 deletions
apps/product/views/action/product/detail.hbs
public/js/plugins/lazy-load.js
public/js/product/detail.page.js
public/scss/product/_detail.css
apps/product/views/action/product/detail.hbs
View file @
13564b2
...
...
@@ -473,11 +473,11 @@
<div
class=
"shoppingCar-nav"
>
<ul>
<li><a
href=
"#goodsMessage"
class=
"fixed option"
>
●
商品信息
</a></li>
<li><a
href=
"#sizeTitle"
class=
"option"
>
●
尺码信息
</a></li>
<li><a
href=
"#goodsTitle"
class=
"option"
>
●
商品详情
</a></li>
<li><a
href=
"#judgeTitle"
class=
"option comment"
>
●
商品评价
</a></li>
<li><a
href=
"#goodsAskTitle"
class=
"option consult"
>
●
商品咨询
</a></li>
<li><a
data-el=
"#goodsMessage"
href=
"javascript:;"
class=
"fixed option"
>
●
商品信息
</a></li>
<li><a
data-el=
"#sizeTitle"
href=
"javascript:;"
class=
"option"
>
●
尺码信息
</a></li>
<li><a
data-el=
"#goodsTitle"
href=
"javascript:;"
class=
"option"
>
●
商品详情
</a></li>
<li><a
data-el=
"#judgeTitle"
href=
"javascript:;"
class=
"option comment"
>
●
商品评价
</a></li>
<li><a
data-el=
"#goodsAskTitle"
href=
"javascript:;"
class=
"option consult"
>
●
商品咨询
</a></li>
</ul>
</div>
</div>
...
...
public/js/plugins/lazy-load.js
View file @
13564b2
...
...
@@ -186,6 +186,7 @@ function dataLazyLoad(doc) {
Util
.
addEvent
(
window
,
"scroll"
,
$
.
throttle
(
500
,
true
,
_this
.
fn
));
Util
.
addEvent
(
window
,
"resize"
,
$
.
throttle
(
500
,
true
,
_this
.
fn
));
Util
.
addEvent
(
doc
.
body
,
"touchMove"
,
$
.
throttle
(
500
,
true
,
_this
.
fn
));
return
this
;
}
};
}
...
...
public/js/product/detail.page.js
View file @
13564b2
...
...
@@ -1101,6 +1101,7 @@ function loadComment() {
commentPage
[
type
]
=
commentPage
[
type
]
||
1
;
loadingComments
=
true
;
return
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/detail/comment'
,
...
...
@@ -1115,7 +1116,7 @@ function loadComment() {
// 购买评价
function
loadAllComments
(
type
,
nowPage
)
{
loadComments
(
type
,
nowPage
).
then
(
function
(
data
)
{
return
loadComments
(
type
,
nowPage
).
then
(
function
(
data
)
{
var
res
,
filter
,
$ul
,
totalnum
=
0
,
baseUrl
;
if
(
data
.
code
===
200
)
{
...
...
@@ -1203,7 +1204,7 @@ function loadComment() {
}
});
loadAllComments
(
currentType
);
return
loadAllComments
(
currentType
);
}
// 购买评价的相关事件
...
...
@@ -1265,7 +1266,7 @@ function loadConsult() {
loadingConsults
=
true
;
$
.
ajax
({
return
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/detail/consult'
,
data
:
{
...
...
@@ -1426,7 +1427,7 @@ function loadConsult() {
});
});
loadConsults
(
1
);
return
loadConsults
(
1
);
}
window
.
fetchConsult
=
window
.
once
(
loadConsult
);
...
...
@@ -1465,7 +1466,7 @@ function initPageYas() {
// 店铺推荐
function
loadRecommend
()
{
$
.
ajax
({
return
$
.
ajax
({
type
:
'GET'
,
url
:
'/product/detail/recommend'
,
data
:
{
...
...
@@ -1769,6 +1770,19 @@ function loadReturn() {
window
.
fetchReturn
=
window
.
once
(
loadReturn
);
function
_scrollTo
(
$ele
)
{
var
top
=
0
;
if
(
$ele
)
{
top
=
$ele
.
offset
().
top
-
20
;
}
$
(
'html,body'
).
animate
({
scrollTop
:
top
},
500
);
}
// 首屏加载后,对比数据是否变化,如果变化,重新渲染,重新绑定事件
bindEvent
.
fire
();
...
...
@@ -1796,6 +1810,10 @@ bindEvent.fire();
favorite
.
statusFav
(
shopId
,
brandId
).
then
(
function
()
{
$
(
'#brand-favour'
).
addClass
(
'coled'
);
});
// 数据懒加载
var
dataLoad
=
dataLazyLoad
.
init
({
cls
:
'.datalazyload'
,
threshold
:
0
});
//eslint-disable-line
dataLoad
.
fn
&&
dataLoad
.
fn
();
}());
$
(
window
).
scroll
(
function
()
{
...
...
@@ -1857,6 +1875,8 @@ $('.shoppingCar').on('click', '.option', function(e) {
window
.
fetchRecommend
();
}
_scrollTo
(
$
(
$this
.
data
(
'el'
)));
e
.
stopPropagation
();
});
...
...
@@ -1873,9 +1893,8 @@ $('.shoppingCar-btn').on('click', function() {
}
var
$addToCart
=
$
(
'#add-to-cart'
);
var
sc
=
$
(
document
);
sc
.
scrollTop
(
200
);
_scrollTo
(
);
if
(
maxStock
===
-
1
)
{
$
(
'#sizes'
).
children
(
'.size-warn'
).
removeClass
(
'hide'
);
...
...
@@ -1911,5 +1930,4 @@ $(function() {
yasAtBottom
.
yasBottom
();
// 数据懒加载
dataLazyLoad
.
init
({
cls
:
'.datalazyload'
,
threshold
:
0
});
...
...
public/scss/product/_detail.css
View file @
13564b2
...
...
@@ -816,9 +816,10 @@
.share-row
{
margin-top
:
20px
;
height
:
16px
;
.title
{
line-height
:
16px
!important
;
}
}
...
...
Please
register
or
login
to post a comment