Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
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
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
2015-11-19 17:18:27 +0800
Commit
e18fb91a9c9ea5c3df156e594a085a8dd3f47483
1 parent
94393aa2
为您优选优化
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
19 deletions
library/Api/Yohobuy.php
static/js/product/recommend-for-you.js
static/sass/product/_recommend-for-you.scss
template/m.yohobuy.com/actions/index/home/index.phtml
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
library/Api/Yohobuy.php
View file @
e18fb91
...
...
@@ -17,7 +17,7 @@ use Plugin\Cache;
class
Yohobuy
{
//
/* 正式环境 */
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
...
...
static/js/product/recommend-for-you.js
View file @
e18fb91
...
...
@@ -9,9 +9,10 @@ var Swiper = require('yoho.iswiper');
var
recommendSwiper
;
recommendSwiper
=
new
Swiper
(
'.swiper-recommend'
,
{
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
slidesPerView
:
'auto'
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
\ No newline at end of file
...
...
static/sass/product/_recommend-for-you.scss
View file @
e18fb91
...
...
@@ -12,25 +12,28 @@
font-weight
:
bold
;
}
.swiper-
recommend
{
.swiper-
container
{
padding
:
pxToRem
(
20px
)
0
;
width
:
100%
;
height
:
pxToRem
(
252px
);
overflow
:
hidden
;
.swiper-slider
{
margin
:
0
pxToRem
(
10px
);
.swiper-slide
{
padding
:
0
pxToRem
(
10px
);
float
:
left
;
width
:
pxToRem
(
156px
);
&
:first-child
{
margin
-left
:
pxToRem
(
30px
);
padding
-left
:
pxToRem
(
30px
);
}
&
:last-child
{
margin
-right
:
pxToRem
(
30px
);
padding
-right
:
pxToRem
(
30px
);
}
img
{
width
:
pxToRem
(
156px
);
max-width
:
none
;
width
:
100%
;
height
:
pxToRem
(
208px
);
}
}
}
...
...
@@ -42,19 +45,21 @@
line-height
:
1
;
span
{
display
:
block
;
// chrome 最小支持12px, 设计图是 10px ,用CSS3变换
@include
transform
(
scale
(
0
.875
));
}
.sale-price
{
color
:
#d9134f
;
margin-left
:
pxToRem
(
-10px
);
}
.old-price
{
position
:
absolute
;
top
:
0
;
right
:
0
;
color
:
#ededed
;
right
:
pxToRem
(
-6px
);
color
:
#b0b0b0
;
}
.no-price
{
...
...
template/m.yohobuy.com/actions/index/home/index.phtml
View file @
e18fb91
...
...
@@ -96,6 +96,8 @@
</a>
</div>
{
{#isLogin
}
}
{
{>
product/recommend-for-you
}
}
{
{/isLogin
}
}
</div>
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
View file @
e18fb91
{
{#
recommendForYou
}
}
<div
class=
"recommend-for-you"
>
<div
class=
"title"
>为您优选新品</div>
<div
class=
"swiper-recommend"
>
<ul
class=
"swiper-wrapper"
>
<div
id=
"swiper-recommend"
class=
"swiper-container"
>
<ul
class=
"swiper-wrapper swiper-wrapper-recommend"
>
{
{#recommendList
}
}
<li
class=
"swiper-slider"
>
<img
class=
"img-box"
src=
"{{thumb}}"
>
<li
class=
"swiper-slide"
>
<img
class=
"swiper-lazy img-box"
data-src=
"{{thumb}}"
>
<div
class=
"price"
>
<span
class=
"sale-price {{^price}}no-price{{/price}}"
>¥
{
{salePrice
}
}</span>
{
{#price
}
}<span
class=
"old-price"
>¥
{
{.
}
}</span>
{
{/price
}
}
</div>
<div
class=
"swiper-lazy-preloader"
></div>
</li>
{
{/recommendList
}
}
</ul>
...
...
Please
register
or
login
to post a comment