Authored by QC-L

修复未自动轮播的问题

... ... @@ -34,7 +34,6 @@ function goodsTab(req, res, next) {
function newIndex(req, res, next) {
req.ctx(GroupService).newGroupIndex().then(result => {
console.log(result);
return res.render('group/newIndex', {
title: '有货福利团',
page: 'group',
... ...
... ... @@ -21,7 +21,7 @@
{{/ifcond}}
{{#ifcond layout_float '==' 'C'}}
{{#if data.prdList}}
<div class="resource-collage-buy-prd-list-c" data-prd-list-length="{{data.prdList.length}}">
<div class="resource-collage-buy-prd-list-c" data-prd-list-length="{{data.prdList.length}}" data-prd-speed="{{speed}}">
<div class="collage-buy-title">{{../template_intro}}</div>
<div class="swiper-container">
<div class="swiper-wrapper">
... ... @@ -31,7 +31,7 @@
<div class="product-image-bg">
<img src="{{image2 defaultImages w=188 h=250 q=60 mode=3}}"></img>
</div>
<div class="product-name">{{brandName}}</div>
<div class="product-name">{{productName}}</div>
<div class='product-price-wrap'>
<span class='product-people-number'>{{joinPeopleNum}}人团</span>
<span class='product-price'>{{formatCollagePrice}}</span>
... ...
... ... @@ -315,11 +315,16 @@ class Group extends Page {
}
swiperGroup() {
if ($('.resource-collage-buy-prd-list-c').data('prd-list-length') > 0) {
let list = $('.resource-collage-buy-prd-list-c');
let speed = list.data('prd-speed');
if (list.data('prd-list-length') > 0) {
new Swiper('.swiper-container', {
slidesPerView: 3,
spaceBetween: 20,
slidesPerGroup: 3,
autoplay: speed * 1000,
autoplayDisableOnInteraction: false,
pagination: '.swiper-pagination',
paginationClickable: true,
});
... ...