Authored by 梁志锋

Merge branch 'develop/wap' into beta/wap

@@ -120,6 +120,8 @@ class RegData @@ -120,6 +120,8 @@ class RegData
120 public static function sendCodeToMobile($area, $mobile) 120 public static function sendCodeToMobile($area, $mobile)
121 { 121 {
122 $param = Yohobuy::param(); 122 $param = Yohobuy::param();
  123 + $param['client_type'] = 'h5'; // 2016/02/18 hf: 根据JAVA邓新飞的发短信内容需要调整
  124 + $param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥
123 $param['method'] = 'app.register.sendRegCodeToMobile'; 125 $param['method'] = 'app.register.sendRegCodeToMobile';
124 $param['area'] = $area; 126 $param['area'] = $area;
125 $param['mobile'] = $mobile; 127 $param['mobile'] = $mobile;
@@ -71,6 +71,32 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) { @@ -71,6 +71,32 @@ function setEditModeWithSknId(sknId, isThisGoodSelected) {
71 isSelected = isThisGoodSelected; 71 isSelected = isThisGoodSelected;
72 } 72 }
73 73
  74 +function preventDefault(e) {
  75 + console.log(e);
  76 + if (e.target.localName === 'ul') return;
  77 + e = e || window.event;
  78 + if (e.preventDefault)
  79 + e.preventDefault();
  80 + e.returnValue = false;
  81 +}
  82 +
  83 +function disableScroll(e) {
  84 + if (window.addEventListener) // older FF
  85 + window.addEventListener('DOMMouseScroll', preventDefault, false);
  86 + window.onwheel = preventDefault; // modern standard
  87 + window.onmousewheel = document.onmousewheel = preventDefault; // older browsers, IE
  88 + window.ontouchmove = preventDefault; // mobile
  89 +}
  90 +
  91 +function enableScroll() {
  92 + if (window.removeEventListener)
  93 + window.removeEventListener('DOMMouseScroll', preventDefault, false);
  94 + window.onmousewheel = document.onmousewheel = null;
  95 + window.onwheel = null;
  96 + window.ontouchmove = null;
  97 + document.onkeydown = null;
  98 +}
  99 +
74 //删除面板 100 //删除面板
75 function removePannel() { 101 function removePannel() {
76 var $pannel = $('.chose-panel'), 102 var $pannel = $('.chose-panel'),
@@ -112,9 +138,7 @@ function disableNumEdit() { @@ -112,9 +138,7 @@ function disableNumEdit() {
112 138
113 139
114 function show(html, cb) { 140 function show(html, cb) {
115 - var $html = $('html, body');  
116 -  
117 - /*var scrollPosition = [ 141 + var scrollPosition = [
118 document.documentElement.scrollLeft || document.body.scrollLeft, 142 document.documentElement.scrollLeft || document.body.scrollLeft,
119 document.documentElement.scrollTop || document.body.scrollTop 143 document.documentElement.scrollTop || document.body.scrollTop
120 ], 144 ],
@@ -124,7 +148,7 @@ function show(html, cb) { @@ -124,7 +148,7 @@ function show(html, cb) {
124 $html.data('previous-overflow', $html.css('overflow')); 148 $html.data('previous-overflow', $html.css('overflow'));
125 $html.css('overflow', 'hidden'); 149 $html.css('overflow', 'hidden');
126 $html.css('height', '100%'); 150 $html.css('height', '100%');
127 - window.scrollTo(scrollPosition[0], scrollPosition[1]);*/ 151 + window.scrollTo(scrollPosition[0], scrollPosition[1]);
128 152
129 if (html) { 153 if (html) {
130 $chosePanel.html(html); 154 $chosePanel.html(html);
@@ -136,20 +160,22 @@ function show(html, cb) { @@ -136,20 +160,22 @@ function show(html, cb) {
136 $('.chose-panel').show(); 160 $('.chose-panel').show();
137 $num = $('#good-num'); 161 $num = $('#good-num');
138 cbFn = cb; 162 cbFn = cb;
  163 +
  164 + disableScroll();
139 } 165 }
140 166
141 //隐藏当前Panel 167 //隐藏当前Panel
142 function hide() { 168 function hide() {
143 - $html = $('html, body');  
144 -  
145 - /*var $html = $('html, body'), 169 + var $html = $('html, body'),
146 scrollPosition = $html.data('scroll-position'); 170 scrollPosition = $html.data('scroll-position');
147 171
148 // un-lock scroll position 172 // un-lock scroll position
149 $html.css('overflow', $html.data('previous-overflow')); 173 $html.css('overflow', $html.data('previous-overflow'));
150 $html.css('height', 'auto'); 174 $html.css('height', 'auto');
151 - window.scrollTo(scrollPosition[0], scrollPosition[1]);*/ 175 + window.scrollTo(scrollPosition[0], scrollPosition[1]);
152 $('.chose-panel').hide(); 176 $('.chose-panel').hide();
  177 +
  178 + enableScroll();
153 } 179 }
154 180
155 //修改加入购物车的文字和背景 181 //修改加入购物车的文字和背景
@@ -231,6 +257,7 @@ function changeColorChosed(newColorIndex) { @@ -231,6 +257,7 @@ function changeColorChosed(newColorIndex) {
231 257
232 init(); 258 init();
233 259
  260 +
234 $yohoPage.on('touchstart', '.chose-panel', function(e) { 261 $yohoPage.on('touchstart', '.chose-panel', function(e) {
235 var $cur = $(e.target); 262 var $cur = $(e.target);
236 263
@@ -241,6 +268,8 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) { @@ -241,6 +268,8 @@ $yohoPage.on('touchstart', '.chose-panel', function(e) {
241 //点击蒙版消失 268 //点击蒙版消失
242 hide(); 269 hide();
243 270
  271 + enableScroll();
  272 +
244 return false; 273 return false;
245 }); 274 });
246 275
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 */ 5 */
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
  8 + ellipsis = require('mlellipsis'),
8 lazyLoad = require('yoho.lazyload'), 9 lazyLoad = require('yoho.lazyload'),
9 Hammer = require('yoho.hammer'), 10 Hammer = require('yoho.hammer'),
10 tip = require('../plugin/tip'), 11 tip = require('../plugin/tip'),
@@ -17,6 +18,7 @@ var $page = $('.gift-advance-page'), @@ -17,6 +18,7 @@ var $page = $('.gift-advance-page'),
17 require('../common'); 18 require('../common');
18 19
19 lazyLoad($('.lazy')); 20 lazyLoad($('.lazy'));
  21 +ellipsis.init();
20 22
21 function getProductInfo(skn, promotionId) { 23 function getProductInfo(skn, promotionId) {
22 loading.showLoadingMask(); 24 loading.showLoadingMask();
@@ -50,10 +52,8 @@ $page.find('.chose').each(function(i, elem) { @@ -50,10 +52,8 @@ $page.find('.chose').each(function(i, elem) {
50 }); 52 });
51 }); 53 });
52 54
53 -// $page.on('touchend', '.chose', function() {  
54 -// var $this = $(this),  
55 -// id = $this.closest('.gift-advance-good').data('id'),  
56 -// promotionId = $this.closest('.advance-block').data('promotion-id');  
57 -//  
58 -// getProductInfo(id, promotionId);  
59 -// }); 55 +setTimeout(function() {
  56 + $('.gift-advance-good .name').each(function() {
  57 + this.mlellipsis(2);
  58 + });
  59 +}, 0);
@@ -55,7 +55,10 @@ @@ -55,7 +55,10 @@
55 .del-icon { 55 .del-icon {
56 position: absolute; 56 position: absolute;
57 right: 0.75rem; 57 right: 0.75rem;
58 - bottom: 0.25rem; 58 + width: 60rem / $pxConvertRem;
  59 + height: 60rem / $pxConvertRem;
  60 + line-height: 60rem / $pxConvertRem;
  61 + text-align: center;
59 color: #999; 62 color: #999;
60 } 63 }
61 } 64 }