Authored by biao

详情页增加获取限购码

... ... @@ -37,7 +37,8 @@ function getInstance() {
return dialogTemplate;
}
exports.showDialog = function(data, callback, callbackForLeft) {
// fullWithBtn是供详情页获取限购码使用的特殊参数
exports.showDialog = function(data, callback, callbackForLeft, fullWithBtn) {
var dialogTemplate = getInstance(),
dialogStr = dialogTemplate(data),
... ... @@ -51,6 +52,8 @@ exports.showDialog = function(data, callback, callbackForLeft) {
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
... ... @@ -62,6 +65,15 @@ exports.showDialog = function(data, callback, callbackForLeft) {
$dialogWrapper.fadeIn();
}
if (fullWithBtn) {
$('.dialog-wrapper .dialog-footer > span').css('width', '100%');
$('.dialog-wrapper .dialog-content').css({
'padding-left': '1.85rem',
'padding-right': '1.85rem'
});
$dialogWrapper.css('z-index', '10');
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
... ...
... ... @@ -18,6 +18,11 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
var $cart = $('.cart-bar');
var limitSaleBtn = document.getElementById('limit-sale'),
limitSaleHammer = limitSaleBtn && new Hammer(limitSaleBtn);
var dialog = require('../../me/dialog');
//add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
var $cartBar = $('.cart-bar');
... ... @@ -75,6 +80,25 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
});
}
limitSaleHammer ? limitSaleHammer.on('tap', function(e) {
e.srcEvent.stopPropagation();
dialog.showDialog({
dialogText: '进入有货APP尖货频道分享\n以获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
console.log('111');
}, undefined, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(e) {
e.stopPropagation();
if ($(e.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
}) : null;
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
... ...
... ... @@ -276,6 +276,7 @@ $basicBtnC:#eb0313;
}
}
.price-date {
position: relative;
width: 100%;
color: $subFontC;
height: pxToRem(88px);
... ... @@ -284,6 +285,30 @@ $basicBtnC:#eb0313;
background-color: #fff;
border-bottom: 1px solid $borderC;
}
.limit-sale {
position: absolute;
right: pxToRem(84px);
top: pxToRem(24px);
color: #d0021b;
border: 2px solid #d0021b;
background-color: #fff;
border-radius: pxToRem(40px);
padding: pxToRem(4px) pxToRem(20px);
font-size: pxToRem(24px);
font-weight: bold;
}
.limit-sale:active {
background-color: #f0f0f0;
}
.got-limit-sale {
@extend .limit-sale;
color: #ccc;
border-color: #ccc;
}
.goodsPrice {
float: left;
font-size: pxToRem(34.59px);
... ... @@ -367,7 +392,7 @@ $basicBtnC:#eb0313;
}
.goodsDiscount {
display: block;
width: 100%;
width: 100%;
height:auto;
font-size: pxToRem(28px);
color: $mainFontC;
... ...