|
|
var $ = require('yoho.zepto'),
|
|
|
Swiper = require('yoho.iswiper'),
|
|
|
lazyLoad = require('yoho.zeptolazyload');
|
|
|
lazyLoad = require('yoho.zeptolazyload'),
|
|
|
tip = require('../../plugin/tip');
|
|
|
|
|
|
var $curNav,
|
|
|
$navList = $('#discount-nav'),
|
...
|
...
|
@@ -14,7 +15,32 @@ var swiper, |
|
|
loadMoreH = $('#load-more').height(),
|
|
|
loading = false,
|
|
|
page = 0,
|
|
|
pd = "";
|
|
|
pd = '';
|
|
|
|
|
|
/**
|
|
|
* 根据用户的选择获取商品折扣值
|
|
|
* @param int index
|
|
|
* @return string
|
|
|
*/
|
|
|
function getSalePdByChoose(index) {
|
|
|
var pd = '0.1,0.3';
|
|
|
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
pd = '0.1,0.3';
|
|
|
break;
|
|
|
case 1:
|
|
|
pd = '0.4,0.6';
|
|
|
break;
|
|
|
case 2:
|
|
|
pd = '0.7,0.9';
|
|
|
break;
|
|
|
case 3:
|
|
|
pd = '0.1,0.9';
|
|
|
break;
|
|
|
}
|
|
|
return pd;
|
|
|
}
|
|
|
|
|
|
// slide 个数大于 1 时,使用 swiper ,否则只显示单张图片
|
|
|
if ($('.swiper-container .swiper-slide').length > 1) {
|
...
|
...
|
@@ -76,8 +102,8 @@ $(window).scroll(function () { |
|
|
|
|
|
$goodList.append(data);
|
|
|
|
|
|
//lazyLoad
|
|
|
//lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
|
|
|
// lazyLoad
|
|
|
// lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
|
|
|
lazyLoad($('.good-info').find('img.lazy'));
|
|
|
|
|
|
loading = false;
|
...
|
...
|
@@ -91,28 +117,3 @@ $(window).scroll(function () { |
|
|
}
|
|
|
|
|
|
}); |
|
|
|
|
|
/**
|
|
|
* 根据用户的选择获取商品折扣值
|
|
|
*
|
|
|
* @param int index
|
|
|
* @return string
|
|
|
*/
|
|
|
function getSalePdByChoose(index) {
|
|
|
var pd = "0.1,0.3";
|
|
|
switch (index) {
|
|
|
case 0:
|
|
|
pd = "0.1,0.3";
|
|
|
break;
|
|
|
case 1:
|
|
|
pd = "0.4,0.6";
|
|
|
break;
|
|
|
case 2:
|
|
|
pd = "0.7,0.9";
|
|
|
break;
|
|
|
case 3:
|
|
|
pd = "0.1,0.9";
|
|
|
break;
|
|
|
}
|
|
|
return pd;
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|