Authored by lijing

秒杀详情动态数据

... ... @@ -60,7 +60,7 @@ exports.index = (req, res, next) => {
res.render('detail/detail', {
pageHeader: headerData,
result: result,
page: 'detail',
page: 'seckill-detail',
title: result.goodsName,
pageFooter: true
});
... ... @@ -94,7 +94,7 @@ exports.indexSkn = (req, res, next) => {
res.render('detail/detail', {
pageHeader: headerData,
result: result,
page: 'detail',
page: 'seckill-detail',
title: result.goodsName,
pageFooter: true
});
... ...
... ... @@ -623,7 +623,6 @@ let getProductData = (data) => {
finalResult.enterStore = info[0];
finalResult.isStudent = data.isStudent;
Object.assign(finalResult.feedbacks, info[2]);
Object.assign(finalResult, {isSecKill: result.isSecKill});
finalResult.goodsPrice.previousPrice = '¥' + result.marketPrice;
/* 预售商品不能购买 */
... ...
... ... @@ -232,7 +232,5 @@
<input type="hidden" id="showPannel" value="1">
{{/if}}
<input type="hidden" id="isSecKill" value = "{{isSecKill}}">
</div>
{{/ result}}
... ...
... ... @@ -23,10 +23,6 @@ var dialog = require('../plugin/dialog');
require('../common');
if ($('#isSecKill').val() === 'Y') {
require('./tick');
}
// add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
var $cartBar = $('.cart-bar');
... ...
/**
* 商品详情
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/20
*/
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
Hammer = require('yoho-hammer'),
lazyLoad = require('yoho-jquery-lazyload');
var $discountFolder = $('.goods-discount .discount-folder'),
$discountArrow = $('.goods-discount .first-item span');
var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl),
$discountFirstItem = $(goodsDiscountEl).find('.first-item');
var $cart = $('.cart-bar');
var appUrl = $('input[name="limitCodeUrl"]').val();
var dialog = require('../plugin/dialog');
require('../common');
require('./tick');
// add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
var $cartBar = $('.cart-bar');
var timer = setInterval(function() {
if ($cartBar) {
window.reMarginFooter('.cart-bar');
clearInterval(timer);
} else {
$cartBar = $('.cart-bar');
}
}, 200);
}
showFooter();
lazyLoad($('img.lazy'));
if ($('#goodsDiscount h1').length < 1) {
$('.dropdown').remove();
}
// 顶部swiper
new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
paginationClickable: true,
pagination: '.banner-top .pagination-inner',
nextButton: '.my-swiper-button-next',
prevButton: '.my-swiper-button-prev',
spaceBetween: 3
});
// 初始化goods-discount
if ($discountFolder.children().length === 0) {
$discountFolder.css('display', 'none');
$discountArrow.html('');
}
// goods-discount下拉按钮点击事件
if (goodsDiscountHammer && $discountFolder.children().length > 0) {
goodsDiscountHammer.on('tap', function() {
if ($discountFolder.is(':hidden')) {
$discountFirstItem.removeClass('short-text');
$discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');
$discountFolder.slideDown();
} else {
$discountFirstItem.addClass('short-text');
$discountArrow.removeClass('icon-up').addClass('icon-down').html('&#xe609;');
$discountFolder.slideUp();
}
});
}
$('#limit-sale').on('touchend', function(e) {
var loginUrl = $('#loginUrl').val(),
time,
ifr;
e.stopPropagation();
if (loginUrl) {
window.location = loginUrl;
} else {
dialog.showDialog({
dialogText: '进入有货APP,获取限购码',
hasFooter: {
rightBtnText: '打开Yoho!Buy有货APP'
}
}, function() {
ifr = document.createElement('iframe');
ifr.src = appUrl;
ifr.style.display = 'none';
document.body.appendChild(ifr);
window.location.href = appUrl;
time = Date.now();
window.setTimeout(function() {
document.body.removeChild(ifr);
if (Date.now() - time < 3200) {
window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho';
}
}, 3000);
}, null, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(para) {
para.stopPropagation();
if ($(para.target).hasClass('dialog-wrapper')) {
dialog.hideDialog();
}
});
}
});
require('./detail/like');
require('./detail/desc');
require('./detail/comments-consults');
require('./detail/consultform');
require('./detail/recommend-for-you-product-desc');
// 购物车商品数量
$.ajax({
type: 'GET',
url: '/cart/index/count',
success: function(data) {
var count;
if (data.code === 200) {
count = data.data.cart_goods_count || 0;
if (count === 0) {
return false;
}
if (count > 99) {
count = '99+';
}
$cart.find('.num-tag').html(count).removeClass('hide');
}
}
});
if ($('.good-detail-page').length > 0) {
$('#yoho-footer').css('border-top', '1px solid #e0e0e0');
}
... ...