Authored by 王水玲

星潮教室首页

... ... @@ -114,6 +114,7 @@ exports.index = (req, res) => {
articles: [
{
articleId: '48187',
isSwiper: true,
starAvatar: [
{
src: 'http://img11.static.yhbimg.com/yhb-img02/2016/04/28/02/01c3e9be0e46915b124962b97d752557cd.jpg?imageView/0/w/{width}/h/{height}',
... ...
... ... @@ -23,19 +23,28 @@
{{#each articles}}
<li data-id="{{articleId}}">
<div class="star-avatar">
<div class="article-avatar-swiper">
<ul class="clearfix swiper-wrapper">
{{#each starAvatar}}
<li class="swiper-slide">
<a href="{{avatarUrl}}">
<img class="swiper-lazy" data-src="{{image src 100 100}}" />
<p class="name">{{name}}</p>
<div class="swiper-lazy-preloader"></div>
</a>
</li>
{{/each}}
</ul>
</div>
{{#if isSwiper}}
<div class="article-avatar-swiper">
<ul class="clearfix swiper-wrapper">
{{#each starAvatar}}
<li class="swiper-slide">
<a href="{{avatarUrl}}">
<img class="swiper-lazy" data-src="{{image src 100 100}}" />
<p class="name">{{name}}</p>
<div class="swiper-lazy-preloader"></div>
</a>
</li>
{{/each}}
</ul>
</div>
{{else}}
{{# starAvatar}}
<a href="{{avatarUrl}}">
<img class="lazy" data-original="{{image src 100 100}}" />
<p class="name">{{name}}</p>
</a>
{{/ starAvatar}}
{{/if}}
</div>
<div class="star-article">
<i class="article-arrow"></i>
... ...
... ... @@ -97,7 +97,8 @@ if ($('.avatar-swiper .swiper-slide').length > 1) {
});
}
if ($('.star-avatar').length > 1) {
// 明星动态头像左右滑动
if ($('.article-avatar-swiper').find('li').length > 1) {
new Swiper('.article-avatar-swiper', {
initialSlide: 0,
lazyLoading: true,
... ...