...
|
...
|
@@ -1697,7 +1697,8 @@ var $ = require("jquery"), |
|
|
recommendSwiper,
|
|
|
hotBrandsSwiper,
|
|
|
trendTopicSwiper,
|
|
|
goodsSwiper;
|
|
|
goodsSwiper,
|
|
|
freshSwiper;
|
|
|
|
|
|
var start = 0,
|
|
|
swiperClass,
|
...
|
...
|
@@ -1733,12 +1734,12 @@ function hideSideBar() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
$('.overlay').on('touchstart', function(e) {
|
|
|
$overlay.on('touchstart', function() {
|
|
|
hideSideBar();
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
$sideNav.on('touchmove', function(e) {
|
|
|
$sideNav.on('touchmove scroll', function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -1758,13 +1759,14 @@ $sideNav.on('touchend', 'li', function(e) { |
|
|
|
|
|
// 返回一级导航,收起二级导航
|
|
|
$subNav.each(function() {
|
|
|
$(this).find('li').eq(0).on('touchend', function() {
|
|
|
$(this).find('li').eq(0).on('touchstart', function() {
|
|
|
|
|
|
$sideNav.css('pointer-events', 'none');
|
|
|
setTimeout(function() {
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
$sideNav.css('pointer-events', 'auto');
|
|
|
}, 400);
|
|
|
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
});
|
|
|
}).on('touchstart', function(e) {
|
|
|
if (e.currentTarget !== e.target) {
|
...
|
...
|
@@ -1827,6 +1829,17 @@ if ($('.trend-topic-swiper').find('li').size() > 1) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 新人专享轮播
|
|
|
if ($('.fresh-list-swiper').find('li').size() > 1) {
|
|
|
freshSwiper = new Swiper('.fresh-list-swiper', {
|
|
|
lazyLoading: true,
|
|
|
lazyLoadingInPrevNext: true,
|
|
|
grabCursor: true,
|
|
|
slidesPerView: 'auto',
|
|
|
slideElement: 'li'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 潮流上装/经典裤装等轮播
|
|
|
$('.category-swiper').each(function(i, index) {
|
|
|
swiperClass = 'category-swiper' + i;
|
...
|
...
|
@@ -3582,7 +3595,8 @@ function getInstance() { |
|
|
return dialogTemplate;
|
|
|
}
|
|
|
|
|
|
exports.showDialog = function(data, callback, callbackForLeft) {
|
|
|
// fullWithBtn是供详情页获取限购码使用的特殊参数
|
|
|
exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
|
|
|
|
|
|
var dialogTemplate = getInstance(),
|
|
|
dialogStr = dialogTemplate(data),
|
...
|
...
|
@@ -3596,6 +3610,8 @@ exports.showDialog = function(data, callback, callbackForLeft) { |
|
|
|
|
|
$dialogBox = $('.dialog-box');
|
|
|
$dialogWrapper = $('.dialog-wrapper');
|
|
|
|
|
|
|
|
|
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
|
|
|
|
|
|
// 显示
|
...
|
...
|
@@ -3607,6 +3623,15 @@ exports.showDialog = function(data, callback, callbackForLeft) { |
|
|
$dialogWrapper.fadeIn();
|
|
|
}
|
|
|
|
|
|
if (fullWithBtn) {
|
|
|
$('.dialog-wrapper .dialog-footer > span').css('width', '100%');
|
|
|
$('.dialog-wrapper .dialog-content').css({
|
|
|
'padding-left': '1.85rem',
|
|
|
'padding-right': '1.85rem'
|
|
|
});
|
|
|
$dialogWrapper.css('z-index', '10');
|
|
|
}
|
|
|
|
|
|
$dialogBox.css({
|
|
|
top: '50%',
|
|
|
marginTop: -($dialogBox.height() / 2)
|
...
|
...
|
@@ -3738,7 +3763,7 @@ $btnSure.on('touchstart', function() { |
|
|
});
|
|
|
|
|
|
});
|
|
|
define("js/product/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){
|
|
|
define("js/product/entry", ["jquery","swiper","lazyload","hammer","handlebars","source-map","index"], function(require, exports, module){
|
|
|
/**
|
|
|
* 产品打包入口
|
|
|
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
|
...
|
...
|
@@ -5236,7 +5261,7 @@ $listNav.on('touchstart', 'li', function() { |
|
|
});
|
|
|
|
|
|
});
|
|
|
define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){
|
|
|
define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","handlebars","source-map","index"], function(require, exports, module){
|
|
|
/**
|
|
|
* 商品详情
|
|
|
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
|
...
|
...
|
@@ -5257,6 +5282,11 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), |
|
|
|
|
|
var $cart = $('.cart-bar');
|
|
|
|
|
|
var limitSaleBtn = document.getElementById('limit-sale'),
|
|
|
limitSaleHammer = limitSaleBtn && new Hammer(limitSaleBtn);
|
|
|
|
|
|
var dialog = require("js/me/dialog");
|
|
|
|
|
|
//add extra marign-bottom for footer to show the yoho copyright
|
|
|
function showFooter() {
|
|
|
var $cartBar = $('.cart-bar');
|
...
|
...
|
@@ -5314,6 +5344,25 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
limitSaleHammer ? limitSaleHammer.on('tap', function(e) {
|
|
|
e.srcEvent.stopPropagation();
|
|
|
dialog.showDialog({
|
|
|
dialogText: '进入有货APP尖货频道分享\n以获取限购码',
|
|
|
hasFooter: {
|
|
|
rightBtnText: '打开Yoho!Buy有货APP'
|
|
|
}
|
|
|
}, function() {
|
|
|
console.log('111');
|
|
|
}, undefined, true);
|
|
|
|
|
|
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
|
|
|
e.stopPropagation();
|
|
|
if ($(e.target).hasClass('dialog-wrapper')) {
|
|
|
dialog.hideDialog();
|
|
|
}
|
|
|
});
|
|
|
}) : null;
|
|
|
|
|
|
require("js/product/detail/desc");
|
|
|
require("js/product/detail/comments-consults");
|
|
|
require("js/product/recommend-for-you-product-desc");
|
...
|
...
|
@@ -7206,6 +7255,15 @@ $(document).on('touchend', '.swiper-header', function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.invalidGoods').on('touchstart touchend', function() {
|
|
|
var $this = $(e.target).closest('span');
|
|
|
|
|
|
if ($this.hasClass('del-fav')) {
|
|
|
return;
|
|
|
}
|
|
|
tip.show('商品已下架');
|
|
|
return false;
|
|
|
});
|
|
|
});
|
|
|
define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -8509,8 +8567,9 @@ define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","ha |
|
|
|
|
|
var $ = require("jquery");
|
|
|
|
|
|
var lazyLoad = require("lazyload");
|
|
|
var load = require("js/plugin/loading");
|
|
|
var lazyLoad = require("lazyload"),
|
|
|
load = require("js/plugin/loading"),
|
|
|
tip = require("js/plugin/tip");
|
|
|
|
|
|
var dialog = require("js/me/dialog");
|
|
|
|
...
|
...
|
@@ -8630,6 +8689,15 @@ $('.deps').on('touchstart', 'span', function() { |
|
|
$(this).css('background', 'transparent');
|
|
|
});
|
|
|
|
|
|
$('.invalidGoods').on('touchstart touchend', function() {
|
|
|
var $this = $(e.target).closest('span');
|
|
|
|
|
|
if ($this.hasClass('del-icon')) {
|
|
|
return;
|
|
|
}
|
|
|
tip.show('商品已下架');
|
|
|
return false;
|
|
|
});
|
|
|
});
|
|
|
define("js/me/address-act", ["jquery","hammer"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -9358,6 +9426,13 @@ $('.btn-balance').on('touchend', function() { |
|
|
});
|
|
|
|
|
|
$('.off-shell-goods').on('touchstart touchend', function() {
|
|
|
var $this = $(e.target).closest('span');
|
|
|
|
|
|
if ($this.hasClass('icon-del')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
tip.show('商品已下架');
|
|
|
return false;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -9555,11 +9630,6 @@ $('.icon-edit').on('touchstart', function(e) { |
|
|
$('.icon-del').on('touchstart', function(e) {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.parents('.off-shell-goods').length) {
|
|
|
tip.show('商品已下架');
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
dialog.showDialog({
|
...
|
...
|
|