Authored by 梁志锋

gulp ge提交

@@ -1733,12 +1733,12 @@ function hideSideBar() { @@ -1733,12 +1733,12 @@ function hideSideBar() {
1733 } 1733 }
1734 } 1734 }
1735 1735
1736 -$('.overlay').on('touchstart', function(e) { 1736 +$overlay.on('touchstart', function() {
1737 hideSideBar(); 1737 hideSideBar();
1738 return false; 1738 return false;
1739 }); 1739 });
1740 1740
1741 -$sideNav.on('touchmove', function(e) { 1741 +$sideNav.on('touchmove scroll', function() {
1742 return false; 1742 return false;
1743 }); 1743 });
1744 1744
@@ -1758,13 +1758,14 @@ $sideNav.on('touchend', 'li', function(e) { @@ -1758,13 +1758,14 @@ $sideNav.on('touchend', 'li', function(e) {
1758 1758
1759 // 返回一级导航,收起二级导航 1759 // 返回一级导航,收起二级导航
1760 $subNav.each(function() { 1760 $subNav.each(function() {
1761 - $(this).find('li').eq(0).on('touchend', function() { 1761 + $(this).find('li').eq(0).on('touchstart', function() {
  1762 +
1762 $sideNav.css('pointer-events', 'none'); 1763 $sideNav.css('pointer-events', 'none');
1763 setTimeout(function() { 1764 setTimeout(function() {
  1765 + $('.sub-nav').removeClass('show');
1764 $sideNav.css('pointer-events', 'auto'); 1766 $sideNav.css('pointer-events', 'auto');
1765 }, 400); 1767 }, 400);
1766 1768
1767 - $('.sub-nav').removeClass('show');  
1768 }); 1769 });
1769 }).on('touchstart', function(e) { 1770 }).on('touchstart', function(e) {
1770 if (e.currentTarget !== e.target) { 1771 if (e.currentTarget !== e.target) {
@@ -3582,7 +3583,8 @@ function getInstance() { @@ -3582,7 +3583,8 @@ function getInstance() {
3582 return dialogTemplate; 3583 return dialogTemplate;
3583 } 3584 }
3584 3585
3585 -exports.showDialog = function(data, callback, callbackForLeft) { 3586 +// fullWithBtn是供详情页获取限购码使用的特殊参数
  3587 +exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
3586 3588
3587 var dialogTemplate = getInstance(), 3589 var dialogTemplate = getInstance(),
3588 dialogStr = dialogTemplate(data), 3590 dialogStr = dialogTemplate(data),
@@ -3596,6 +3598,8 @@ exports.showDialog = function(data, callback, callbackForLeft) { @@ -3596,6 +3598,8 @@ exports.showDialog = function(data, callback, callbackForLeft) {
3596 3598
3597 $dialogBox = $('.dialog-box'); 3599 $dialogBox = $('.dialog-box');
3598 $dialogWrapper = $('.dialog-wrapper'); 3600 $dialogWrapper = $('.dialog-wrapper');
  3601 +
  3602 +
3599 dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper')); 3603 dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
3600 3604
3601 // 显示 3605 // 显示
@@ -3607,6 +3611,15 @@ exports.showDialog = function(data, callback, callbackForLeft) { @@ -3607,6 +3611,15 @@ exports.showDialog = function(data, callback, callbackForLeft) {
3607 $dialogWrapper.fadeIn(); 3611 $dialogWrapper.fadeIn();
3608 } 3612 }
3609 3613
  3614 + if (fullWithBtn) {
  3615 + $('.dialog-wrapper .dialog-footer > span').css('width', '100%');
  3616 + $('.dialog-wrapper .dialog-content').css({
  3617 + 'padding-left': '1.85rem',
  3618 + 'padding-right': '1.85rem'
  3619 + });
  3620 + $dialogWrapper.css('z-index', '10');
  3621 + }
  3622 +
3610 $dialogBox.css({ 3623 $dialogBox.css({
3611 top: '50%', 3624 top: '50%',
3612 marginTop: -($dialogBox.height() / 2) 3625 marginTop: -($dialogBox.height() / 2)
@@ -3738,7 +3751,7 @@ $btnSure.on('touchstart', function() { @@ -3738,7 +3751,7 @@ $btnSure.on('touchstart', function() {
3738 }); 3751 });
3739 3752
3740 }); 3753 });
3741 -define("js/product/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ 3754 +define("js/product/entry", ["jquery","swiper","lazyload","hammer","handlebars","source-map","index"], function(require, exports, module){
3742 /** 3755 /**
3743 * 产品打包入口 3756 * 产品打包入口
3744 * @author: liangzhifeng<zhifeng.liang@yoho.cn> 3757 * @author: liangzhifeng<zhifeng.liang@yoho.cn>
@@ -5236,7 +5249,7 @@ $listNav.on('touchstart', 'li', function() { @@ -5236,7 +5249,7 @@ $listNav.on('touchstart', 'li', function() {
5236 }); 5249 });
5237 5250
5238 }); 5251 });
5239 -define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","index"], function(require, exports, module){ 5252 +define("js/product/detail/detail", ["jquery","swiper","hammer","lazyload","handlebars","source-map","index"], function(require, exports, module){
5240 /** 5253 /**
5241 * 商品详情 5254 * 商品详情
5242 * @author: liangzhifeng<zhifeng.liang@yoho.cn> 5255 * @author: liangzhifeng<zhifeng.liang@yoho.cn>
@@ -5257,6 +5270,11 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), @@ -5257,6 +5270,11 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
5257 5270
5258 var $cart = $('.cart-bar'); 5271 var $cart = $('.cart-bar');
5259 5272
  5273 +var limitSaleBtn = document.getElementById('limit-sale'),
  5274 + limitSaleHammer = limitSaleBtn && new Hammer(limitSaleBtn);
  5275 +
  5276 +var dialog = require("js/me/dialog");
  5277 +
5260 //add extra marign-bottom for footer to show the yoho copyright 5278 //add extra marign-bottom for footer to show the yoho copyright
5261 function showFooter() { 5279 function showFooter() {
5262 var $cartBar = $('.cart-bar'); 5280 var $cartBar = $('.cart-bar');
@@ -5314,6 +5332,25 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { @@ -5314,6 +5332,25 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
5314 }); 5332 });
5315 } 5333 }
5316 5334
  5335 +limitSaleHammer ? limitSaleHammer.on('tap', function(e) {
  5336 + e.srcEvent.stopPropagation();
  5337 + dialog.showDialog({
  5338 + dialogText: '进入有货APP尖货频道分享\n以获取限购码',
  5339 + hasFooter: {
  5340 + rightBtnText: '打开Yoho!Buy有货APP'
  5341 + }
  5342 + }, function() {
  5343 + console.log('111');
  5344 + }, undefined, true);
  5345 +
  5346 + $('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
  5347 + e.stopPropagation();
  5348 + if ($(e.target).hasClass('dialog-wrapper')) {
  5349 + dialog.hideDialog();
  5350 + }
  5351 + });
  5352 +}) : null;
  5353 +
5317 require("js/product/detail/desc"); 5354 require("js/product/detail/desc");
5318 require("js/product/detail/comments-consults"); 5355 require("js/product/detail/comments-consults");
5319 require("js/product/recommend-for-you-product-desc"); 5356 require("js/product/recommend-for-you-product-desc");
@@ -7206,6 +7243,15 @@ $(document).on('touchend', '.swiper-header', function() { @@ -7206,6 +7243,15 @@ $(document).on('touchend', '.swiper-header', function() {
7206 } 7243 }
7207 }); 7244 });
7208 7245
  7246 +$('.invalidGoods').on('touchstart touchend', function() {
  7247 + var $this = $(e.target).closest('span');
  7248 +
  7249 + if ($this.hasClass('del-fav')) {
  7250 + return;
  7251 + }
  7252 + tip.show('商品已下架');
  7253 + return false;
  7254 +});
7209 }); 7255 });
7210 define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){ 7256 define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
7211 /** 7257 /**
@@ -8509,8 +8555,9 @@ define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","ha @@ -8509,8 +8555,9 @@ define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","ha
8509 8555
8510 var $ = require("jquery"); 8556 var $ = require("jquery");
8511 8557
8512 -var lazyLoad = require("lazyload");  
8513 -var load = require("js/plugin/loading"); 8558 +var lazyLoad = require("lazyload"),
  8559 + load = require("js/plugin/loading"),
  8560 + tip = require("js/plugin/tip");
8514 8561
8515 var dialog = require("js/me/dialog"); 8562 var dialog = require("js/me/dialog");
8516 8563
@@ -8630,6 +8677,15 @@ $('.deps').on('touchstart', 'span', function() { @@ -8630,6 +8677,15 @@ $('.deps').on('touchstart', 'span', function() {
8630 $(this).css('background', 'transparent'); 8677 $(this).css('background', 'transparent');
8631 }); 8678 });
8632 8679
  8680 +$('.invalidGoods').on('touchstart touchend', function() {
  8681 + var $this = $(e.target).closest('span');
  8682 +
  8683 + if ($this.hasClass('del-icon')) {
  8684 + return;
  8685 + }
  8686 + tip.show('商品已下架');
  8687 + return false;
  8688 +});
8633 }); 8689 });
8634 define("js/me/address-act", ["jquery","hammer"], function(require, exports, module){ 8690 define("js/me/address-act", ["jquery","hammer"], function(require, exports, module){
8635 /** 8691 /**
@@ -9358,6 +9414,13 @@ $('.btn-balance').on('touchend', function() { @@ -9358,6 +9414,13 @@ $('.btn-balance').on('touchend', function() {
9358 }); 9414 });
9359 9415
9360 $('.off-shell-goods').on('touchstart touchend', function() { 9416 $('.off-shell-goods').on('touchstart touchend', function() {
  9417 + var $this = $(e.target).closest('span');
  9418 +
  9419 + if ($this.hasClass('icon-del')) {
  9420 + return;
  9421 + }
  9422 +
  9423 + tip.show('商品已下架');
9361 return false; 9424 return false;
9362 }); 9425 });
9363 9426
@@ -9555,11 +9618,6 @@ $('.icon-edit').on('touchstart', function(e) { @@ -9555,11 +9618,6 @@ $('.icon-edit').on('touchstart', function(e) {
9555 $('.icon-del').on('touchstart', function(e) { 9618 $('.icon-del').on('touchstart', function(e) {
9556 var $this = $(this); 9619 var $this = $(this);
9557 9620
9558 - if ($this.parents('.off-shell-goods').length) {  
9559 - tip.show('商品已下架');  
9560 - return false;  
9561 - }  
9562 -  
9563 e.stopPropagation(); 9621 e.stopPropagation();
9564 9622
9565 dialog.showDialog({ 9623 dialog.showDialog({
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.