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
ba58ecff6ea69e9b0426828afc54654f311d1e69
1 parent
b0ac2e6a
add zomm
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
29 deletions
apps/product/models/detail-service.js
apps/product/views/partial/product/detail-header.hbs
config/common.js
public/js/product/detail.page.js
public/scss/product/_detail.css
apps/product/models/detail-service.js
View file @
ba58ecf
...
...
@@ -308,7 +308,7 @@ const _getSkuDataByProductBaseInfo = (data) => {
if
(
good
.
image_url
)
{
goodsGroup
.
thumbs
.
push
({
url
:
''
,
shower
:
helpers
.
image
(
good
.
image_url
,
420
,
560
)
,
shower
:
good
.
image_url
,
img
:
helpers
.
image
(
good
.
image_url
,
75
,
100
)
});
}
...
...
apps/product/views/partial/product/detail-header.hbs
View file @
ba58ecf
...
...
@@ -30,13 +30,13 @@
{{/
tags
}}
</div>
<div
id=
"min-img"
class=
"position:relation;"
>
<div
id=
"min-img"
class=
"position:relation;
z-index:1
"
>
<img
id=
"img-show"
class=
"img-show"
src=
"
{{
img
}}
"
>
<div
class=
"move-object hide"
></div>
</div>
<div
id=
"max"
class=
"max"
>
<img
src=
""
class=
""
src=
""
>
<div
class=
"move-over"
></div>
<div
id=
"max"
class=
"max hide"
>
<img
id=
'big'
src=
""
>
</div>
</div>
<div
class=
"share-row"
><span
class=
"title pull-left"
>
分享:
</span>
{{>
common
/
share
}}
</div>
...
...
@@ -46,7 +46,8 @@
<div
class=
"thumb-wrap
{{#
unless
focus
}}
hide
{{/
unless
}}
"
>
{{#if
focus
}}
{{#
thumbs
}}
<img
class=
"thumb"
src=
"
{{
img
}}
"
data-shower=
"
{{
shower
}}
"
>
<img
class=
"thumb"
src=
"
{{
img
}}
"
data-shower=
"
{{
image
shower
420
560
}}
"
data-origin=
"
{{
image
shower
1001
1333
}}
"
>
{{/
thumbs
}}
{{^}}
{{#
thumbs
}}
...
...
config/common.js
View file @
ba58ecf
...
...
@@ -17,11 +17,11 @@ module.exports = {
cookieDomain
:
'.yohobuy.com'
,
domains
:
{
favApi
:
'http://192.168.102.31:8092/brower'
,
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
//api: 'http://api-test3.yohops.com:9999/',
//service: 'http://service-test3.yohops.com:9999/',
//
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
api
:
'http://api.yoho.cn/'
,
service
:
'http://service.yoho.cn/'
,
//api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
...
...
public/js/product/detail.page.js
View file @
ba58ecf
...
...
@@ -158,12 +158,18 @@ bindEvent.add(function() {
$imgShow
.
attr
(
'src'
,
src
);
}
function
bigImgShow
(
src
)
{
$
(
'#big'
).
attr
(
'src'
,
src
);
}
// 查看详情功能
var
moveWidth
=
135
;
var
w
=
420
;
var
h
=
560
;
var
_w
=
1000
;
var
radio
=
w
/
_w
;
var
$moveObj
=
$
(
'.move-object'
);
var
$max
=
$
(
'.max'
);
function
move
(
e
)
{
var
x
=
e
.
pageX
-
$imgShow
.
offset
().
left
;
...
...
@@ -172,15 +178,8 @@ bindEvent.add(function() {
var
_x
=
x
-
moveWidth
/
2
;
var
_y
=
y
-
moveWidth
/
2
;
var
_rx
=
x
+
moveWidth
/
2
;
var
_ry
=
y
+
moveWidth
/
2
;
if
(
_y
<
0
)
{
_y
=
0
;
}
else
if
(
_y
>=
_ry
)
{
_y
=
_maxY
;
}
var
_maxX
=
w
-
moveWidth
;
var
_maxY
=
h
-
moveWidth
;
if
(
_x
<
0
)
{
_x
=
0
;
...
...
@@ -188,6 +187,12 @@ bindEvent.add(function() {
_x
=
_maxX
;
}
if
(
_y
<
0
)
{
_y
=
0
;
}
else
if
(
_y
>=
_maxY
)
{
_y
=
_maxY
;
}
var
offX
=
_x
/
radio
;
var
offY
=
_y
/
radio
;
...
...
@@ -195,15 +200,25 @@ bindEvent.add(function() {
left
:
_x
,
top
:
_y
});
$max
.
get
(
0
).
scrollLeft
=
offX
;
$max
.
get
(
0
).
scrollTop
=
offY
;
}
$imgShow
.
hover
(
function
()
{
$
(
'.move-object'
).
removeClass
(
'hide'
);
},
function
()
{
$
(
'.move-over'
).
mouseleave
(
function
()
{
$
(
'.move-object'
).
addClass
(
'hide'
);
$max
.
addClass
(
'hide'
);
});
$imgShow
.
mousemove
(
function
(
e
)
{
$
(
'.move-over'
).
mousemove
(
function
(
e
)
{
if
(
$moveObj
.
hasClass
(
'hide'
))
{
$moveObj
.
removeClass
(
'hide'
);
}
if
(
$max
.
hasClass
(
'hide'
))
{
$max
.
removeClass
(
'hide'
);
}
move
(
e
);
});
...
...
@@ -373,7 +388,14 @@ bindEvent.add(function() {
// 缩略图鼠标移入显示
$
(
'#thumbs'
).
on
(
'mouseenter'
,
'.thumb'
,
function
()
{
imgShow
(
$
(
this
).
data
(
'shower'
));
var
$this
=
$
(
this
);
imgShow
(
$this
.
data
(
'shower'
));
bigImgShow
(
$this
.
data
(
'origin'
));
if
(
!
$this
.
hasClass
(
'active'
))
{
$this
.
siblings
(
'.active'
).
removeClass
(
'active'
).
end
().
addClass
(
'active'
);
}
});
// 尺码
...
...
public/scss/product/_detail.css
View file @
ba58ecf
...
...
@@ -145,9 +145,14 @@
.thumb
{
display
:
block
;
width
:
7
5
px
;
width
:
7
1
px
;
cursor
:
pointer
;
margin-bottom
:
2px
;
margin-bottom
:
15px
;
border
:
2px
solid
white
;
&.active
{
border
:
2px
solid
black
;
}
}
.name
{
...
...
@@ -2189,11 +2194,22 @@
.max
{
width
:
560px
;
height
:
560px
;
border
:
1px
solid
red
;
border
:
2px
solid
#b0b0b0
;
display
:
block
;
position
:
absolute
;
overflow
:
hidden
;
left
:
515px
;
top
:
0
;
z-index
:
100
;
}
.m
ax
img
{
.m
ove-over
{
position
:
absolute
;
width
:
420px
;
height
:
560px
;
z-index
:
2
;
top
:
0
;
left
:
0
;
}
/****套餐弹出框***/
...
...
Please
register
or
login
to post a comment