Authored by 周少峰

gulp ge

... ... @@ -8937,13 +8937,16 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() {
};
choiceOut(dataJSON);
});
// 滚动到第一个选中的商品
function scrollToFirst(){
function scrollToFirst() {
var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked');
var top = 0;
if($selected.length > 0){
if ($selected.length > 0) {
$selected = $selected.eq(0);
}
top = $selected.offset().top - 50;
$('html,body').scrollTop(top);
return false;
... ... @@ -9008,8 +9011,8 @@ function getTogetherProduct($obj, url, page) {
});
}
// 最近浏览
getTogetherProduct($histroy, '/cart/index/getHistroyProduct');
// 为你优选
getTogetherProduct($histroy, '/cart/index/getRecommendProduct');
// 凑单商品
getTogetherProduct($together, '/cart/index/getTogetherProduct');
... ... @@ -9022,7 +9025,7 @@ $together.on('click', '.pagenext, .pageprev', function() {
});
//凑单商品,历史商品商品折叠
//凑单商品,为你优选商品商品折叠
$shopCart.on('click', '.icon-minus, .icon-add', function() {
if ($(this).hasClass('icon-minus')) {
$(this).parents('.title').next('.main').hide();
... ... @@ -9043,7 +9046,7 @@ $histroy.on('click', '.pagenext, .pageprev', function() {
} else {
--pageNum > 0 || (pageNum = 1);
}
getTogetherProduct($histroy, '/cart/index/getHistroyProduct', {
getTogetherProduct($histroy, '/cart/index/getRecommendProduct', {
page: pageNum
});
... ... @@ -9088,15 +9091,16 @@ function productInfo(data) {
$('.detail-bigpic:not(.none) .bigpic:gt(0)').hide();
$('.showSizeBox:not(.none)').find('span').each(function() {
if ($(this).hasClass('null-atcivec')) {
$('.addcart').addClass('none');
$('.btn_sellout').removeClass('none');
} else {
$('.addcart').removeClass('none');
$('.btn_sellout').addClass('none');
return false;
}
});
if ($(this).hasClass('null-atcivec')) {
$('.addcart').addClass('none');
$('.btn_sellout').removeClass('none');
} else {
$('.addcart').removeClass('none');
$('.btn_sellout').addClass('none');
return false;
}
});
});
}
... ... @@ -9121,7 +9125,7 @@ $payWapper.on('click', '.cart-add-btn', function() {
});
});
//凑单商品,历史商品商品记录
//凑单商品,为你优选商品商品记录
$('.clearfix').on('click', '.btn_view_s', function() {
productId = $(this).data('id');
promotionId = $(this).parents('table').data('promotion');
... ... @@ -9697,7 +9701,8 @@ $payWapper.on('selectstart', function() {
});
$goodsDetail.on('selectstart', function() {
return false;
});
});
scrollToFirst();
});
define("js/guang/entry", ["jquery","lazyload","dot","jquery-pjax"], function(require, exports, module){
... ... @@ -10141,56 +10146,93 @@ $('#close-message').click(function() {
$('.message-tip').slideUp(200);
});
/**
*
* @param self 点击的控件
* @param $ul 列表父
* @param page 总共页数
* @param itemWith 子元素宽
* @param curPage 当前页码
* @param num 一页商品数量
*/
function pageChange(self, $ul, page, itemWith, curPage, num) {
var $this = self,
left;
if ($this.hasClass('next')) {
//第2页显示前翻按钮
if (curPage === 2) {
$this.siblings().removeClass('no-visible');
}
//最后一页隐藏后翻按钮
if (curPage === page) {
$this.addClass('no-visible');
}
} else {
//倒数第2页显示后翻按钮
if (curPage === page - 1) {
$this.siblings().removeClass('no-visible');
}
//第1页隐藏前翻按钮
if (curPage === 1) {
$this.addClass('no-visible');
}
}
left = -num * (curPage - 1) * itemWith;
$ul.animate({
marginLeft: left
}, 400);
}
//新品上架
(function() {
var $naPager = $('.na-pager'),
$rcPager = $('.rc-pager'),
$naUl = $('.new-arrival ul'),
$rcUl = $('.recommend ul'),
naPage = Math.ceil($naUl.children('li').length / 5),
rcPage = Math.ceil($rcUl.children('li').length / 6),
naItemWith = $naUl.children('li:last-child').outerWidth(),
naCurPage = 1;
rcItemWith = $rcUl.children('li:last-child').outerWidth(),
naCurPage = 1,
rcCurPage = 1;
$naUl.width($naUl.width() * naPage);
$rcUl.width($rcUl.width() * rcPage);
//最新上架翻页
$naPager.click(function() {
var $this = $(this),
left;
if ($this.hasClass('next')) {
//后翻
++naCurPage;
//第2页显示前翻按钮
if (naCurPage === 2) {
$this.siblings().removeClass('no-visible');
}
var $this = $(this);
//最后一页隐藏后翻按钮
if (naCurPage === naPage) {
$this.addClass('no-visible');
if (naPage > 1) {
if ($this.hasClass('next')) {
++naCurPage;
} else {
--naCurPage;
}
} else {
pageChange($this, $naUl, naPage, naItemWith, naCurPage, 5);
}
});
//前翻
--naCurPage;
//为你推荐翻页
$rcPager.click(function() {
var $this = $(this);
//倒数第2页显示后翻按钮
if (naCurPage === naPage - 1) {
$this.siblings().removeClass('no-visible');
if (rcPage > 1) {
if ($this.hasClass('next')) {
++rcCurPage;
} else {
--rcCurPage;
}
//第1页隐藏前翻按钮
if (naCurPage === 1) {
$this.addClass('no-visible');
}
pageChange($this, $rcUl, rcPage, rcItemWith, rcCurPage, 6);
}
left = -5 * (naCurPage - 1) * naItemWith;
$naUl.animate({
marginLeft: left
}, 400);
});
}());
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

23.7 KB | W: | H:

38.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin