Authored by 王水玲

秒杀模版修改

... ... @@ -709,6 +709,19 @@ function formatTime(time) {
}
function setSeckillProductData(curProdcutList, products) {
let num = curProdcutList.data('num');
let $curOutProductList = curProdcutList.parents('.seckill').find('.out-product-list');
if (products && products.length > num) {
products = products.slice(0, num);
}
if (products.length <= 3) {
$curOutProductList.addClass('less-than-3');
} else {
$curOutProductList.removeClass('less-than-3');
}
curProdcutList.html(seckillProductTpl({
isApp: yoho.isApp,
list: products,
... ... @@ -722,20 +735,6 @@ function setSeckillProductData(curProdcutList, products) {
}
function viewSeckillProduct(products, dom) {
let $productList = $('.seckill .product-list');
let num = $productList.data('num');
let $curOutProductList = dom ? dom.parents('.seckill').find('.out-product-list') : $('.out-product-list');
if (products && products.length > num) {
products = products.slice(0, num);
}
if (products.length <= 3) {
$curOutProductList.addClass('less-than-3');
} else {
$curOutProductList.removeClass('less-than-3');
}
if (dom) {
setSeckillProductData(dom.parents('.seckill').find('.product-list'), products);
} else {
... ...