Authored by 李靖

秒杀优化,详情页支持线下店商品

... ... @@ -24,7 +24,7 @@ const newDetail = {
.then(result => {
let data = {};
if (result.data) {
if (_.get(result, 'data') && !_.isArray(result.data)) {
data = result.data;
if (data.storageSum > 0) {
data.storageSum = 1;
... ...
... ... @@ -115,7 +115,10 @@ setTimeout(() => {
});
}, 200);
$(window).trigger('seckill', [data]);
// 没有线下店标示的商品绑定秒杀js
if (!($('.cart-bar.store-good').length > 0)) {
$(window).trigger('seckill', [data]);
}
}
if (productId && (goodsId || productSkn)) {
... ...
... ... @@ -127,7 +127,7 @@ $(window).on('seckill', function(event, detailData) {
'</div>'
);
$('.sold-out').hide();
$('.cart-bar').append('<a href="javascript:;" class="sold-out">即将开抢</a>');
$('.btn-c').append('<a href="javascript:;" class="sold-out">即将开抢</a>');
$('.addto-cart').hide();
$('.cart-bar').show();
$('.current-price').show();
... ... @@ -190,7 +190,7 @@ $(window).on('seckill', function(event, detailData) {
}
if (seckillNum === 0) {
$('.sold-out').hide();
$('.cart-bar').append('<a href="javascript:;" class="sold-out">已售罄</a>');
$('.btn-c').append('<a href="javascript:;" class="sold-out">已售罄</a>');
$('.addto-cart').hide();
}
$('.current-price').show();
... ...