Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
Plain Diff
Browse Files
Authored by
陈峰
8 years ago
Commit
cf1236f549513f2eb7e7215b8548644734bc7b42
2 parents
683eb8b0
80ae09b5
Merge branch 'hotfix/newnew' into 'grey'
新品到着首页图片多种情况处理 See merge request
!208
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
24 deletions
apps/product/controllers/new.js
apps/product/views/action/new/index.hbs
apps/product/views/partial/new/handpick.hbs → apps/product/views/partial/new/handpick-one.hbs
apps/product/views/partial/new/handpick-three.hbs
apps/product/views/partial/new/handpick-two.hbs
config/common.js
public/js/product/new-arrival.page.js
public/scss/product/new/_handlepick.css
apps/product/controllers/new.js
View file @
cf1236f
...
...
@@ -72,7 +72,15 @@ const _newGoods = (req, res, next) => {
let
banner
=
_
.
get
(
result
,
'ads[0]'
,
{});
let
handPick
=
_
.
get
(
result
,
'ads[1]'
,
{});
// console.log(handPick)
if
(
handPick
.
data
)
{
if
(
handPick
.
data
.
length
>
2
)
{
handPick
.
three
=
true
;
}
else
if
(
handPick
.
data
.
length
===
2
)
{
handPick
.
two
=
true
;
}
else
if
(
handPick
.
data
.
length
===
1
)
{
handPick
.
one
=
true
;
}
}
res
.
render
(
'new/index'
,
{
module
:
'product'
,
...
...
apps/product/views/action/new/index.hbs
View file @
cf1236f
...
...
@@ -38,8 +38,14 @@
{{/if}}
{{!--精选抢先看--}}
{{#if
handPick
.
data
}}
{{>
'new/handpick'
swiper
=
handPick
.
data
}}
{{#if
handPick
.
three
}}
{{>
'new/handpick-three'
swiper
=
handPick
.
data
}}
{{/if}}
{{#if
handPick
.
two
}}
{{>
'new/handpick-two'
swiper
=
handPick
.
data
}}
{{/if}}
{{#if
handPick
.
one
}}
{{>
'new/handpick-one'
swiper
=
handPick
.
data
}}
{{/if}}
{{!--最新上架--}}
...
...
apps/product/views/partial/new/handpick.hbs → apps/product/views/partial/new/handpick
-one
.hbs
View file @
cf1236f
...
...
@@ -8,17 +8,17 @@
</header>
<main
class=
"panel-body"
>
<!-- Slider main container -->
<div
class=
"handpick-swiper swiper-container"
>
<div
class=
"handpick-swiper
-one
swiper-container"
>
<!-- Additional required wrapper -->
<div
class=
"swiper-wrapper"
>
<!-- Slides -->
{{#
each
swiper
}}
{{#
swiper
}}
<div
class=
"swiper-slide"
>
<a
href=
"
{{
url
}}
"
>
<img
class=
"swiper-lazy"
data-src=
"
{{
image2
src
w
=
332
h
=
194
q
=
60
}}
"
alt=
""
>
<img
src=
"
{{
image2
src
w
=
690
h
=
220
q
=
60
}}
"
alt=
""
>
</a>
</div>
{{/
each
}}
{{/
swiper
}}
</div>
</div>
</main>
...
...
apps/product/views/partial/new/handpick-three.hbs
0 → 100644
View file @
cf1236f
{{!-- 新品到着: 精选 --}}
<div
id=
"handpick"
class=
"panel handpick"
>
<header
class=
"panel-header"
>
<h4>
精选抢先看
</h4>
{{!--<a href="#javascript" class="panel-header-r more">
<i class="iconfont"></i>
</a>--}}
</header>
<main
class=
"panel-body"
>
<!-- Slider main container -->
<div
class=
"handpick-swiper-three swiper-container"
>
<!-- Additional required wrapper -->
<div
class=
"swiper-wrapper"
>
<!-- Slides -->
{{#
swiper
}}
<div
class=
"swiper-slide"
>
<a
href=
"
{{
url
}}
"
>
<img
class=
"swiper-lazy"
data-src=
"
{{
image2
src
w
=
330
h
=
220
q
=
60
}}
"
alt=
""
>
</a>
</div>
{{/
swiper
}}
</div>
</div>
</main>
</div>
\ No newline at end of file
...
...
apps/product/views/partial/new/handpick-two.hbs
0 → 100644
View file @
cf1236f
{{!-- 新品到着: 精选 --}}
<div
id=
"handpick"
class=
"panel handpick"
>
<header
class=
"panel-header"
>
<h4>
精选抢先看
</h4>
{{!--<a href="#javascript" class="panel-header-r more">
<i class="iconfont"></i>
</a>--}}
</header>
<main
class=
"panel-body"
>
<!-- Slider main container -->
<div
class=
"handpick-swiper-two swiper-container"
>
<!-- Additional required wrapper -->
<div
class=
"swiper-wrapper"
>
<!-- Slides -->
{{#
swiper
}}
<div
class=
"swiper-slide"
>
<a
href=
"
{{
url
}}
"
>
<img
src=
"
{{
image2
src
w
=
330
h
=
220
q
=
60
}}
"
alt=
""
>
</a>
</div>
{{/
swiper
}}
</div>
</div>
</main>
</div>
\ No newline at end of file
...
...
config/common.js
View file @
cf1236f
...
...
@@ -17,21 +17,21 @@ module.exports = {
assetUrl
:
'//127.0.0.1:5001'
,
testCode
:
'yoho4946abcdef#$%&!@'
,
domains
:
{
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
// imSocket: 'ws://im.yohobuy.com:10240',
// imCs: 'http://im.yohobuy.com/api',
// imServer: 'http://im.yohobuy.com/server'
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
liveApi
:
'http://testapi.live.yohops.com:9999/'
,
singleApi
:
'http://api-test3.yohops.com:9999/'
,
imSocket
:
'ws://im.yohobuy.com:10240'
,
imCs
:
'http://im.yohobuy.com/api'
,
imServer
:
'http://im.yohobuy.com/server'
api
:
'http://api.yoho.cn/'
,
service
:
'http://service.yoho.cn/'
,
liveApi
:
'http://api.live.yoho.cn/'
,
singleApi
:
'http://single.yoho.cn/'
,
imSocket
:
'wss://imsocket.yohobuy.com:443'
,
imCs
:
'https://imhttp.yohobuy.com/api'
,
imServer
:
'https://imhttp.yohobuy.com/server'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
// imSocket: 'wss://imsocket.yohobuy.com:443',
// imCs: 'https://imhttp.yohobuy.com/api',
// imServer: 'https://imhttp.yohobuy.com/server'
},
subDomains
:
{
host
:
'.m.yohobuy.com'
,
...
...
public/js/product/new-arrival.page.js
View file @
cf1236f
...
...
@@ -14,7 +14,7 @@ let $callback = $.Callbacks(); // eslint-disable-line
// 是否继续加载数据
let
isScroll
=
true
;
new
Swiper
(
'.handpick-swiper'
,
{
new
Swiper
(
'.handpick-swiper
-three
'
,
{
// Optional parameters
lazyLoading
:
true
,
lazyLoadingInPrevNext
:
true
,
...
...
public/scss/product/new/_handlepick.css
View file @
cf1236f
/* 精选抢先看 */
.handpick
{
.panel-body
{
padding-top
:
30px
;
padding-bottom
:
30px
;
}
.swiper-wrapper
{
align-items
:
center
;
}
.swiper-container
{
height
:
220
px
;
height
:
185
px
;
}
.swiper-slide
{
width
:
300px
;
height
:
1
73
px
;
height
:
1
85
px
;
background-color
:
#444
;
border-radius
:
6px
;
overflow
:
hidden
;
}
}
.handpick-swiper-two
{
.swiper-slide
{
margin-left
:
30px
;
width
:
277px
;
}
}
.handpick-swiper-one
{
.swiper-slide
{
width
:
580px
;
margin-left
:
30px
;
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment