...
|
...
|
@@ -5496,6 +5496,32 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) { |
|
|
isSelected = isThisGoodSelected;
|
|
|
}
|
|
|
|
|
|
function preventDefault(e) {
|
|
|
console.log(e);
|
|
|
if (e.target.localName === 'ul') return;
|
|
|
e = e || window.event;
|
|
|
if (e.preventDefault)
|
|
|
e.preventDefault();
|
|
|
e.returnValue = false;
|
|
|
}
|
|
|
|
|
|
function disableScroll(e) {
|
|
|
if (window.addEventListener) // older FF
|
|
|
window.addEventListener('DOMMouseScroll', preventDefault, false);
|
|
|
window.onwheel = preventDefault; // modern standard
|
|
|
window.onmousewheel = document.onmousewheel = preventDefault; // older browsers, IE
|
|
|
window.ontouchmove = preventDefault; // mobile
|
|
|
}
|
|
|
|
|
|
function enableScroll() {
|
|
|
if (window.removeEventListener)
|
|
|
window.removeEventListener('DOMMouseScroll', preventDefault, false);
|
|
|
window.onmousewheel = document.onmousewheel = null;
|
|
|
window.onwheel = null;
|
|
|
window.ontouchmove = null;
|
|
|
document.onkeydown = null;
|
|
|
}
|
|
|
|
|
|
//删除面板
|
|
|
function removePannel() {
|
|
|
var $pannel = $('.chose-panel'),
|
...
|
...
|
@@ -5537,9 +5563,7 @@ function disableNumEdit() { |
|
|
|
|
|
|
|
|
function show(html, cb) {
|
|
|
var $html = $('html, body');
|
|
|
|
|
|
/*var scrollPosition = [
|
|
|
var scrollPosition = [
|
|
|
document.documentElement.scrollLeft || document.body.scrollLeft,
|
|
|
document.documentElement.scrollTop || document.body.scrollTop
|
|
|
],
|
...
|
...
|
@@ -5549,7 +5573,7 @@ function show(html, cb) { |
|
|
$html.data('previous-overflow', $html.css('overflow'));
|
|
|
$html.css('overflow', 'hidden');
|
|
|
$html.css('height', '100%');
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);*/
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);
|
|
|
|
|
|
if (html) {
|
|
|
$chosePanel.html(html);
|
...
|
...
|
@@ -5561,20 +5585,22 @@ function show(html, cb) { |
|
|
$('.chose-panel').show();
|
|
|
$num = $('#good-num');
|
|
|
cbFn = cb;
|
|
|
|
|
|
disableScroll();
|
|
|
}
|
|
|
|
|
|
//隐藏当前Panel
|
|
|
function hide() {
|
|
|
$html = $('html, body');
|
|
|
|
|
|
/*var $html = $('html, body'),
|
|
|
var $html = $('html, body'),
|
|
|
scrollPosition = $html.data('scroll-position');
|
|
|
|
|
|
// un-lock scroll position
|
|
|
$html.css('overflow', $html.data('previous-overflow'));
|
|
|
$html.css('height', 'auto');
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);*/
|
|
|
window.scrollTo(scrollPosition[0], scrollPosition[1]);
|
|
|
$('.chose-panel').hide();
|
|
|
|
|
|
enableScroll();
|
|
|
}
|
|
|
|
|
|
//修改加入购物车的文字和背景
|
...
|
...
|
@@ -5656,6 +5682,7 @@ function changeColorChosed(newColorIndex) { |
|
|
|
|
|
init();
|
|
|
|
|
|
|
|
|
$yohoPage.on('touchstart', '.chose-panel', function(e) {
|
|
|
var $cur = $(e.target);
|
|
|
|
...
|
...
|
@@ -5666,6 +5693,8 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { |
|
|
//点击蒙版消失
|
|
|
hide();
|
|
|
|
|
|
enableScroll();
|
|
|
|
|
|
return false;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -9574,7 +9603,7 @@ $('.down').on('touchend', function() { |
|
|
});
|
|
|
|
|
|
});
|
|
|
define("js/cart/gift-advance", ["jquery","lazyload","hammer"], function(require, exports, module){
|
|
|
define("js/cart/gift-advance", ["jquery","mlellipsis","lazyload","hammer"], function(require, exports, module){
|
|
|
/**
|
|
|
* 赠品/加价购
|
|
|
* @author: xuqi<qi.xu@yoho.cn>
|
...
|
...
|
@@ -9582,6 +9611,7 @@ define("js/cart/gift-advance", ["jquery","lazyload","hammer"], function(require, |
|
|
*/
|
|
|
|
|
|
var $ = require("jquery"),
|
|
|
ellipsis = require("mlellipsis"),
|
|
|
lazyLoad = require("lazyload"),
|
|
|
Hammer = require("hammer"),
|
|
|
tip = require("js/plugin/tip"),
|
...
|
...
|
@@ -9594,6 +9624,7 @@ var $page = $('.gift-advance-page'), |
|
|
require("js/common");
|
|
|
|
|
|
lazyLoad($('.lazy'));
|
|
|
ellipsis.init();
|
|
|
|
|
|
function getProductInfo(skn, promotionId) {
|
|
|
loading.showLoadingMask();
|
...
|
...
|
@@ -9627,13 +9658,11 @@ $page.find('.chose').each(function(i, elem) { |
|
|
});
|
|
|
});
|
|
|
|
|
|
// $page.on('touchend', '.chose', function() {
|
|
|
// var $this = $(this),
|
|
|
// id = $this.closest('.gift-advance-good').data('id'),
|
|
|
// promotionId = $this.closest('.advance-block').data('promotion-id');
|
|
|
//
|
|
|
// getProductInfo(id, promotionId);
|
|
|
// });
|
|
|
setTimeout(function() {
|
|
|
$('.gift-advance-good .name').each(function() {
|
|
|
this.mlellipsis(2);
|
|
|
});
|
|
|
}, 0);
|
|
|
|
|
|
});
|
|
|
define("js/cart/order-ensure", ["jquery","lazyload","hammer","handlebars","source-map"], function(require, exports, module){
|
...
|
...
|
|