|
|
var $ = require('jquery'),
|
|
|
Hammer = require('yoho.hammer');
|
|
|
|
|
|
Swiper = require('yoho.iswiper'),
|
|
|
lazyLoad = require('yoho.lazyload');
|
|
|
Hammer = require('yoho.hammer'),
|
|
|
Swiper = require('yoho.iswiper'),
|
|
|
lazyLoad = require('yoho.lazyload');
|
|
|
|
|
|
var page = 1,
|
|
|
winH,
|
|
|
hotnav,
|
|
|
listTop,
|
|
|
navSwiper,
|
|
|
sort = '',
|
|
|
id = '';
|
|
|
|
|
|
function hotrank(page, sort, tab_id) {
|
|
|
function hotrank(page, sort, tabId) {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/newsale/selectHotrank',
|
...
|
...
|
@@ -18,7 +19,7 @@ function hotrank(page, sort, tab_id) { |
|
|
data: {
|
|
|
page: page,
|
|
|
sort: sort,
|
|
|
tab_id: tab_id
|
|
|
tab_id: tabId
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (page === 1) {
|
...
|
...
|
@@ -27,6 +28,7 @@ function hotrank(page, sort, tab_id) { |
|
|
$('#hotRank').append(data);
|
|
|
lazyLoad($('img.lazy'));
|
|
|
$('#yoho-footer').css('position', 'static');
|
|
|
$('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
|
|
|
navSwiper = new Swiper('.s-goods-nav', {
|
|
|
grabCursor: true,
|
|
|
slidesPerView: 'auto',
|
...
|
...
|
@@ -38,8 +40,11 @@ function hotrank(page, sort, tab_id) { |
|
|
$('.s-goods-nav .nav-item').each(function(index) {
|
|
|
hotnav = new Hammer($('.s-goods-nav .nav-item')[index]);
|
|
|
hotnav.on('tap', function(e) {
|
|
|
id = $('.s-goods-nav .nav-item').eq(index).data('id'),
|
|
|
sort = parseInt($('.s-goods-nav .nav-item').eq(index).data('sort').split('=')[1]);
|
|
|
var navItme = $('.s-goods-nav .nav-item').eq(index);
|
|
|
|
|
|
id = navItme.data('id') ? navItme.data('id') : '';
|
|
|
sort = navItme.data('sort') ? navItme.data('sort') : '';
|
|
|
page = 1;
|
|
|
hotrank(page, sort, id);
|
|
|
});
|
|
|
});
|
...
|
...
|
|