...
|
...
|
@@ -5,13 +5,17 @@ |
|
|
*/
|
|
|
|
|
|
var $ = require('yoho-jquery'),
|
|
|
Swiper = require('yoho-swiper');
|
|
|
Swiper = require('yoho-swiper'),
|
|
|
ellipsis = require('yoho-mlellipsis'),
|
|
|
lazyload = require('yoho-jquery-lazyload');
|
|
|
|
|
|
var search = require('./sale/search');
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
search.start();
|
|
|
lazyload($('img.lazy'));
|
|
|
ellipsis.init();
|
|
|
|
|
|
$('.swiper-container').each(function() {
|
|
|
if ($(this).find('.swiper-slide').length > 1) {
|
...
|
...
|
@@ -28,9 +32,57 @@ $('.swiper-container').each(function() { |
|
|
});
|
|
|
|
|
|
$(function() {
|
|
|
var $body = $('body');
|
|
|
var $saleNavSelect = $('.sale-nav-select');
|
|
|
var $vipFloor = $('.vip-floor');
|
|
|
var $saleNavWrap = $('.sale-nav-wrap');
|
|
|
var $listNav = $saleNavWrap.find('#list-nav');
|
|
|
var $filterMask = $('.filter-mask');
|
|
|
|
|
|
$('.sale-nav').on('click', function() {
|
|
|
$saleNavSelect.toggleClass('show');
|
|
|
});
|
|
|
|
|
|
// 读取会员专享商品
|
|
|
$.ajax({
|
|
|
url: '/product/sale/search',
|
|
|
data: {
|
|
|
channel: window.queryString.channel || 'boys',
|
|
|
yh_channel: window.queryString.channel || 'boys',
|
|
|
saleType: '2',
|
|
|
type: 'all',
|
|
|
order: '0',
|
|
|
limit: '4'
|
|
|
}
|
|
|
}).then(function(res) {
|
|
|
if (/good-info/.test(res)) {
|
|
|
$vipFloor.html(res).addClass('goods-container');
|
|
|
lazyload($vipFloor.find('img.lazy'));
|
|
|
|
|
|
$('.good-detail-text .name').each(function() {
|
|
|
var $this = $(this),
|
|
|
$title = $this.find('a');
|
|
|
|
|
|
$title[0].mlellipsis(2);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$saleNavWrap.css({
|
|
|
height: $saleNavWrap.height()
|
|
|
});
|
|
|
|
|
|
$(window).on('scroll', function() {
|
|
|
if (!$filterMask.length) {
|
|
|
$filterMask = $('.filter-mask');
|
|
|
}
|
|
|
|
|
|
if ($body.scrollTop() > $saleNavWrap.offset().top) {
|
|
|
$listNav.addClass('fixed');
|
|
|
$filterMask.addClass('fixed');
|
|
|
} else {
|
|
|
$listNav.removeClass('fixed');
|
|
|
$filterMask.removeClass('fixed');
|
|
|
}
|
|
|
}).trigger('scroll');
|
|
|
}); |
...
|
...
|
|