...
|
...
|
@@ -123,6 +123,20 @@ function rePosFooter() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* add extra margin-bottom for footer to show yoho copyright when there is fixed bottom element on page
|
|
|
* @param {String} The jquery selecor of the fixed bottom element
|
|
|
* @return undefined
|
|
|
*/
|
|
|
function reMarginFooter(fixedElement) {
|
|
|
var fixedElH = $(fixedElement).outerHeight();
|
|
|
|
|
|
if (fixedElement) {
|
|
|
$footer.css('margin-bottom', fixedElH + 'px');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//页面通用底部位置及status设置
|
|
|
(function() {
|
|
|
var $op = $footer.children('.op-row');
|
...
|
...
|
@@ -231,6 +245,8 @@ window.getShoppingKey = getShoppingKey; |
|
|
|
|
|
window.rePosFooter = rePosFooter;
|
|
|
|
|
|
window.reMarginFooter = reMarginFooter;
|
|
|
|
|
|
});
|
|
|
define("js/category/entry", ["jquery","hammer","swiper","lazyload","index"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -1592,7 +1608,7 @@ $('.overlay').on('touchstart', function(e) { |
|
|
});
|
|
|
|
|
|
//点击一级导航,弹出二级导航
|
|
|
$sideNav.on('touchstart', 'li', function (e) {
|
|
|
$sideNav.on('touchstart', 'li', function(e) {
|
|
|
if ($(this).find('.sub-nav').size() > 0) {
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
$(this).find('.sub-nav').addClass('show');
|
...
|
...
|
@@ -1605,8 +1621,8 @@ $sideNav.on('touchstart', 'li', function (e) { |
|
|
});
|
|
|
|
|
|
//返回一级导航,收起二级导航
|
|
|
$subNav.each(function () {
|
|
|
$(this).find('li').eq(0).on('touchstart', function (e) {
|
|
|
$subNav.each(function() {
|
|
|
$(this).find('li').eq(0).on('touchstart', function(e) {
|
|
|
$('.sub-nav').removeClass('show');
|
|
|
e.stopPropagation();
|
|
|
return false;
|
...
|
...
|
@@ -1668,7 +1684,7 @@ if ($('.trend-topic-swiper').find('li').size() > 1) { |
|
|
}
|
|
|
|
|
|
//潮流上装/经典裤装等轮播
|
|
|
$('.category-swiper').each(function (i, index) {
|
|
|
$('.category-swiper').each(function(i, index) {
|
|
|
swiperClass = 'category-swiper' + i;
|
|
|
$(this).addClass(swiperClass);
|
|
|
if ($('.' + swiperClass).find('.swiper-slide').size() > 1) {
|
...
|
...
|
@@ -1684,7 +1700,7 @@ $('.category-swiper').each(function (i, index) { |
|
|
});
|
|
|
|
|
|
//logo动画
|
|
|
requestFrame = (function () {
|
|
|
requestFrame = (function() {
|
|
|
var tempFunc = null,
|
|
|
prefixList = ['webkit', 'moz', 'ms'];
|
|
|
|
...
|
...
|
@@ -1697,11 +1713,11 @@ requestFrame = (function () { |
|
|
}
|
|
|
|
|
|
if (supportCss3) {
|
|
|
return function (callback) {
|
|
|
return function(callback) {
|
|
|
window[tempFunc](callback);
|
|
|
};
|
|
|
}
|
|
|
return function (callback) {
|
|
|
return function(callback) {
|
|
|
window.setTimeout(callback, 67);
|
|
|
};
|
|
|
})();
|
...
|
...
|
@@ -1728,7 +1744,7 @@ function tsAnimate() { |
|
|
if (start % 360 === 0) {
|
|
|
window.setTimeout(tsAnimate, 60 * 1000);
|
|
|
} else {
|
|
|
requestFrame(function () {
|
|
|
requestFrame(function() {
|
|
|
tsAnimate();
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -1744,9 +1760,7 @@ $('.home-header .iconfont').on('touchstart', function() { |
|
|
});
|
|
|
|
|
|
// 底部留出tab 的高度
|
|
|
$('#yoho-footer').css({
|
|
|
'margin-bottom': '2.5rem'
|
|
|
});
|
|
|
window.reMarginFooter('.footer-tab');
|
|
|
|
|
|
//set cookie
|
|
|
exports.set = function(c) {
|
...
|
...
|
@@ -1755,6 +1769,7 @@ exports.set = function(c) { |
|
|
domain: '.m.yohobuy.com'
|
|
|
});
|
|
|
};
|
|
|
|
|
|
});
|
|
|
define("js/home/maybe-like", ["jquery","hammer","lazyload"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -3762,7 +3777,7 @@ var opt = {}; |
|
|
|
|
|
var paramStr = window.location.search.split('?')[1];
|
|
|
|
|
|
var keyVal = paramStr.split('&');
|
|
|
var keyVal = paramStr ? paramStr.split('&') : [];
|
|
|
|
|
|
var i, key, val;
|
|
|
|
...
|
...
|
@@ -3773,52 +3788,25 @@ for (i = keyVal.length; i > 0; i--) { |
|
|
key = key[0];
|
|
|
|
|
|
//初始化默认参数
|
|
|
switch (key) {
|
|
|
case 'gender':
|
|
|
opt.gender = val;
|
|
|
break;
|
|
|
case 'brand':
|
|
|
opt.brand = val;
|
|
|
break;
|
|
|
case 'sort':
|
|
|
opt.sort = val;
|
|
|
break;
|
|
|
case 'msort':
|
|
|
opt.msort = val;
|
|
|
break;
|
|
|
case 'misort':
|
|
|
opt.misort = val;
|
|
|
break;
|
|
|
case 'color':
|
|
|
opt.color = val;
|
|
|
break;
|
|
|
case 'size':
|
|
|
opt.size = val;
|
|
|
break;
|
|
|
case 'price':
|
|
|
opt.price = val;
|
|
|
break;
|
|
|
case 'discount':
|
|
|
opt.discount = val;
|
|
|
break;
|
|
|
case 'query':
|
|
|
opt.query = val;
|
|
|
break;
|
|
|
case 'style':
|
|
|
opt.style = val;
|
|
|
break;
|
|
|
case 'limit':
|
|
|
opt.limit = val;
|
|
|
break;
|
|
|
case 'channel':
|
|
|
opt.channel = val;
|
|
|
break;
|
|
|
case 'p_d':
|
|
|
opt.p_d = val;
|
|
|
opt[key] = val;
|
|
|
|
|
|
//discount = p_d,同时需要两个参数
|
|
|
if (key === 'discount' || key === 'p_d') {
|
|
|
opt.discount = val;
|
|
|
opt.p_d = val;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (typeof opt.gender === 'undefined') {
|
|
|
switch (window.cookie('_Channel')) {
|
|
|
case 'boys':
|
|
|
opt.gender = '1,3';
|
|
|
break;
|
|
|
case 'dayLimit':
|
|
|
opt.dayLimit = val;
|
|
|
case 'girls':
|
|
|
opt.gender = '2,3';
|
|
|
break;
|
|
|
default:
|
|
|
opt.gender = '1,2,3';
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -4698,7 +4686,8 @@ var goodsSwiper, |
|
|
require("js/product/detail/desc");
|
|
|
require("js/product/detail/comments-consults");
|
|
|
|
|
|
|
|
|
//add extra marign-bottom for footer to show the yoho copyright
|
|
|
window.reMarginFooter('.cart-bar');
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
...
|
...
|
@@ -4730,6 +4719,7 @@ $('.goodsDiscount .dropdown').on('click', function() { |
|
|
}
|
|
|
});
|
|
|
require("js/product/detail/like");
|
|
|
|
|
|
});
|
|
|
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -5359,7 +5349,7 @@ var $navLi = $('#fav-tab > li'), |
|
|
$brandLoadMore = $('.fav-brand-load-more'),
|
|
|
winH = $(window).height(),
|
|
|
$favProductList = $('.fav-product-list'),
|
|
|
$favBrandList = $('.fav-brand-swiper'),
|
|
|
$favBrandList = $('.fav-brand-swiper-wrapper'),
|
|
|
pageId = 1,
|
|
|
brandPageId = 1, //收藏品牌的当前页数
|
|
|
lockId = true,
|
...
|
...
|
@@ -5703,7 +5693,7 @@ $likeBtn.bind('click', function() { |
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$that.closest('.suggest-type').removeClass('show');
|
|
|
$('.suggest-good').addClass('show');
|
|
|
$that.closest('.suggest-item').find('.suggest-good').addClass('show');
|
|
|
}
|
|
|
}).fail(function(data) {
|
|
|
|
...
|
...
|
@@ -5730,7 +5720,7 @@ $disLikeBtn.bind('click', function() { |
|
|
}).then(function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$that.closest('.suggest-type').removeClass('show');
|
|
|
$('.suggest-bad').addClass('show');
|
|
|
$that.closest('.suggest-item').find('.suggest-bad').addClass('show');
|
|
|
}
|
|
|
}).fail(function(data) {
|
|
|
|
...
|
...
|
@@ -6668,7 +6658,7 @@ function couponAJAX(statu, page) { |
|
|
url: '/home/couponData',
|
|
|
dataType: 'html',
|
|
|
data: {
|
|
|
statu: statu,
|
|
|
status: statu,
|
|
|
page: page
|
|
|
},
|
|
|
success: function(data) {
|
...
|
...
|
@@ -6765,6 +6755,7 @@ $confim.on('touchend', '.cancel', function() { |
|
|
$confim.hide();
|
|
|
}).on('touchend', '.confim', function() {
|
|
|
loading.showLoadingMask();
|
|
|
$confim.hide();
|
|
|
$.ajax({
|
|
|
method: 'POST',
|
|
|
url: '/home/delAddress',
|
...
|
...
|
@@ -6777,15 +6768,15 @@ $confim.on('touchend', '.cancel', function() { |
|
|
}
|
|
|
if (res.code !== 200) {
|
|
|
tip.show(res.message || '网络出了点问题~');
|
|
|
loading.hideLoadingMask();
|
|
|
} else {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
tip.show('网络出了点问题~');
|
|
|
loading.hideLoadingMask();
|
|
|
}).always(function() {
|
|
|
deleteId = null;
|
|
|
$confim.hide();
|
|
|
loading.hideLoadingMask();
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -6809,7 +6800,7 @@ $action.on('touchend', '.del', function() { |
|
|
|
|
|
$submit.on('touchend', function() {
|
|
|
if (security.hasDangerInput(false)) {
|
|
|
return false;
|
|
|
return false;
|
|
|
}
|
|
|
$addressForm.submit();
|
|
|
return false;
|
...
|
...
|
@@ -6819,7 +6810,6 @@ $submit.on('touchend', function() { |
|
|
$(this).removeClass('highlight');
|
|
|
});
|
|
|
|
|
|
|
|
|
});
|
|
|
define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){
|
|
|
/**
|
...
|
...
|
@@ -6957,11 +6947,12 @@ var $addressForm = $('.edit-address'), |
|
|
$submit = $('.submit'),
|
|
|
$editAddressPage = $('.my-edit-address-page'),
|
|
|
$addressListPage = $('.my-address-list-page'),
|
|
|
$area = $('.area'),
|
|
|
$footer = $('#yoho-footer'),
|
|
|
$backBtn = $('.nav-back'),
|
|
|
$navTitle = $('.nav-title'),
|
|
|
$input = $('input, textarea'),
|
|
|
navTitle = $navTitle.html(),
|
|
|
$area = $('.area'),
|
|
|
isSubmiting,
|
|
|
currentPage = 'edit',
|
|
|
newArea = [];
|
...
|
...
|
@@ -6984,7 +6975,7 @@ $backBtn.on('touchend', function(e) { |
|
|
|
|
|
// 恢复默认的三级选择
|
|
|
$addressListPage.hide();
|
|
|
$addressListPage.find('ul').hide();
|
|
|
$addressListPage.find('ul').hide().find('li').removeClass('highlight');
|
|
|
$addressListPage.children('ul').show().children('li').show();
|
|
|
newArea = [];
|
|
|
} else {
|
...
|
...
|
@@ -7045,6 +7036,7 @@ $addressForm.on('submit', function() { |
|
|
});
|
|
|
|
|
|
$submit.on('touchend', function() {
|
|
|
$input.blur();
|
|
|
$addressForm.submit();
|
|
|
return false;
|
|
|
}).on('touchstart', function() {
|
...
|
...
|
@@ -7053,71 +7045,80 @@ $submit.on('touchend', function() { |
|
|
$(this).removeClass('highlight');
|
|
|
});
|
|
|
|
|
|
// 省市区
|
|
|
$area.on('touchend', function() {
|
|
|
$editAddressPage.hide();
|
|
|
$addressListPage.show(1, function() {
|
|
|
$footer.hide();
|
|
|
});
|
|
|
currentPage = 'list';
|
|
|
$navTitle.html('地区选择');
|
|
|
$input.on('focus', function() {
|
|
|
$footer.hide();
|
|
|
}).on('blur', function() {
|
|
|
$footer.show();
|
|
|
});
|
|
|
|
|
|
// touchend 在下滑的时候会触发
|
|
|
// 省市区联动
|
|
|
$addressListPage.find('.address').each(function(i, elem) {
|
|
|
var addressHammer = new Hammer(elem);
|
|
|
// 省市区列表异步加载
|
|
|
$.get('/home/locationList').then(function(html) {
|
|
|
$addressListPage.html(html);
|
|
|
|
|
|
addressHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target);
|
|
|
// 省市区
|
|
|
$area.on('touchend', function() {
|
|
|
$editAddressPage.hide();
|
|
|
$addressListPage.show(1, function() {
|
|
|
$footer.hide();
|
|
|
});
|
|
|
currentPage = 'list';
|
|
|
$navTitle.html('地区选择');
|
|
|
});
|
|
|
|
|
|
newArea.push($this.children('.caption').text());
|
|
|
$this.siblings().hide();
|
|
|
$this.children('ul').show().children('li').show();
|
|
|
// touchend 在下滑的时候会触发
|
|
|
// 省市区联动
|
|
|
$addressListPage.find('.address').each(function(i, elem) {
|
|
|
var addressHammer = new Hammer(elem);
|
|
|
|
|
|
$(this).removeClass('highlight');
|
|
|
e.srcEvent.preventDefault();
|
|
|
e.srcEvent.stopPropagation();
|
|
|
addressHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target);
|
|
|
|
|
|
if (e.target.tagName !== 'li') {
|
|
|
$this = $this.parent('li');
|
|
|
}
|
|
|
newArea.push($this.children('.caption').text());
|
|
|
$this.siblings().hide();
|
|
|
$this.children('ul').show().children('li').show();
|
|
|
|
|
|
e.srcEvent.preventDefault();
|
|
|
e.srcEvent.stopPropagation();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$addressListPage.find('.address-last').each(function(i, elem) {
|
|
|
var addressLastHammer = new Hammer(elem);
|
|
|
$addressListPage.find('.address-last').each(function(i, elem) {
|
|
|
var addressLastHammer = new Hammer(elem);
|
|
|
|
|
|
addressLastHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target);
|
|
|
addressLastHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target);
|
|
|
|
|
|
// 填结果到 html
|
|
|
newArea.push($this.children('.caption').text());
|
|
|
$('[name="area"]').val(newArea.join(' '));
|
|
|
$('[name="area_code"]').val($this.data('id'));
|
|
|
// 填结果到 html
|
|
|
newArea.push($this.children('.caption').text());
|
|
|
$('[name="area"]').val(newArea.join(' '));
|
|
|
$('[name="area_code"]').val($this.data('id'));
|
|
|
|
|
|
$editAddressPage.show();
|
|
|
currentPage = 'edit';
|
|
|
$navTitle.html(navTitle);
|
|
|
$footer.show();
|
|
|
$editAddressPage.show();
|
|
|
currentPage = 'edit';
|
|
|
$navTitle.html(navTitle);
|
|
|
$footer.show();
|
|
|
|
|
|
// 恢复默认的三级选择
|
|
|
$addressListPage.hide();
|
|
|
$addressListPage.find('ul').hide();
|
|
|
$addressListPage.children('ul').show().children('li').show();
|
|
|
newArea = [];
|
|
|
// 恢复默认的三级选择
|
|
|
$addressListPage.hide();
|
|
|
$addressListPage.find('ul').hide().find('li').removeClass('highlight');
|
|
|
$addressListPage.children('ul').show().children('li').show();
|
|
|
newArea = [];
|
|
|
|
|
|
e.srcEvent.preventDefault();
|
|
|
e.srcEvent.stopPropagation();
|
|
|
e.srcEvent.preventDefault();
|
|
|
e.srcEvent.stopPropagation();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
$addressListPage.on('touchstart', 'li', function() {
|
|
|
$(this).addClass('highlight');
|
|
|
}).on('touchend touchcancel', 'li', function() {
|
|
|
$(this).removeClass('highlight');
|
|
|
});
|
|
|
|
|
|
$('input, textarea').on('focus', function() {
|
|
|
$footer.hide();
|
|
|
}).on('blur', function() {
|
|
|
$footer.show();
|
|
|
$addressListPage.on('touchstart', 'li', function() {
|
|
|
$(this).addClass('highlight');
|
|
|
}).on('touchend touchcancel', 'li', function() {
|
|
|
$(this).removeClass('highlight');
|
|
|
});
|
|
|
}).fail(function() {
|
|
|
tip.show('获取省市区列表失败');
|
|
|
});
|
|
|
|
|
|
}); |
...
|
...
|
|