Authored by 梁志锋

Merge branch 'develop/wap' into beta/wap

... ... @@ -120,6 +120,8 @@ class RegData
public static function sendCodeToMobile($area, $mobile)
{
$param = Yohobuy::param();
$param['client_type'] = 'h5'; // 2016/02/18 hf: 根据JAVA邓新飞的发短信内容需要调整
$param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥
$param['method'] = 'app.register.sendRegCodeToMobile';
$param['area'] = $area;
$param['mobile'] = $mobile;
... ...
... ... @@ -71,6 +71,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'),
... ... @@ -112,9 +138,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
],
... ... @@ -124,7 +148,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);
... ... @@ -136,20 +160,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();
}
//修改加入购物车的文字和背景
... ... @@ -231,6 +257,7 @@ function changeColorChosed(newColorIndex) {
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
var $cur = $(e.target);
... ... @@ -241,6 +268,8 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
//点击蒙版消失
hide();
enableScroll();
return false;
});
... ...
... ... @@ -5,6 +5,7 @@
*/
var $ = require('jquery'),
ellipsis = require('mlellipsis'),
lazyLoad = require('yoho.lazyload'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
... ... @@ -17,6 +18,7 @@ var $page = $('.gift-advance-page'),
require('../common');
lazyLoad($('.lazy'));
ellipsis.init();
function getProductInfo(skn, promotionId) {
loading.showLoadingMask();
... ... @@ -50,10 +52,8 @@ $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);
... ...
... ... @@ -55,7 +55,10 @@
.del-icon {
position: absolute;
right: 0.75rem;
bottom: 0.25rem;
width: 60rem / $pxConvertRem;
height: 60rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
text-align: center;
color: #999;
}
}
... ...