Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
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
Lynnic
2015-11-24 14:22:56 +0800
Commit
fe99f9786d54c5b9a40c39c5538cd15eb765ca3e
2 parents
0e102dcf
09ca316d
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
22 deletions
static/js/product/recommend-for-you.js
template/m.yohobuy.com/actions/index/home/recommend-content.phtml
template/m.yohobuy.com/partials/product/recommend-content.phtml
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
static/js/product/recommend-for-you.js
View file @
fe99f97
...
...
@@ -5,14 +5,23 @@
*/
var
Swiper
=
require
(
'yoho.iswiper'
);
var
Swiper
=
require
(
'yoho.iswiper'
),
$
=
require
(
'jquery'
);
var
recommendSwiper
;
var
recommendSwiper
,
$recommendForYou
=
$
(
'.recommend-for-you'
);
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
$
.
get
(
'/home/preference'
).
then
(
function
(
html
)
{
$recommendForYou
.
html
(
html
);
if
(
$
(
'#swiper-recommend'
).
length
)
{
recommendSwiper
=
new
Swiper
(
'#swiper-recommend'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'li'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
}
}).
fail
(
function
()
{
$recommendForYou
.
hide
();
});
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/recommend-content.phtml
0 → 100644
View file @
fe99f97
{
{>
product/recommend-content
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/recommend-content.phtml
0 → 100644
View file @
fe99f97
<div class="title">为您优选新品</div>
<div id="swiper-recommend" class="swiper-container">
<ul class="swiper-wrapper swiper-wrapper-recommend">
{{#recommendList}}
<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>
</div>
\ No newline at end of file
...
...
template/m.yohobuy.com/partials/product/recommend-for-you.phtml
View file @
fe99f97
{
{#
recommendForYou
}
}
<div
class=
"recommend-for-you"
>
<div
class=
"title"
>为您优选新品</div>
<div
id=
"swiper-recommend"
class=
"swiper-container"
>
<ul
class=
"swiper-wrapper swiper-wrapper-recommend"
>
{
{#recommendList
}
}
<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>
</div>
</div>
{
{/
recommendForYou
}
}
\ No newline at end of file
<div class="recommend-for-you">
</div>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment