Authored by htoooth

add limited 5.2

... ... @@ -32,7 +32,7 @@ const HeaderModel = require('../../../doraemon/models/header');
const BLANK_STR = ' ';
// 展览票
const EXHIBITION_TICKET = 51335912;
const YOHOOD_TICKET = 51335912;
const _getProductAdditionInfoAsync = (data) => {
return co(function * () {
... ... @@ -1207,6 +1207,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
result.openSoon = fashTopGoods.openSoon; // 即将开售
result.dis = fashTopGoods.dis; // 是否失效
result.buyNow = fashTopGoods.buyNow; // 是否立即购买
result.buyNowBase = helpers.urlFormat('/limited', null, 'shopping'); // 购买链接
}
}
... ... @@ -1215,14 +1216,12 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
let notForSale = propOrigin('attribute') === 2; // 非卖品
let virtualGoods = propOrigin('attribute') === 3; // 虚拟商品
if (virtualGoods) {
result.virtualGoods = virtualGoods;
// 是否显示虚拟商品,立即购买按钮
result.isVirtualBtn = soldOut ? false : true;
// 是否展览票
result.isTicket = propOrigin('product_skn') === EXHIBITION_TICKET;
}
if (!soldOut && !notForSale && !virtualGoods) {
... ... @@ -1239,10 +1238,14 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => {
// 已售磬
result.soldOut = true;
delete result.fashTopGoods;
} else if (virtualGoods) {
}
// 电子票
result.isTicket = propOrigin('product_skn') === YOHOOD_TICKET;
if (virtualGoods && result.isTicket) {
// 虚拟商品
result.buyNow = true; // 是否立即购买
result.buyNowBase = helpers.urlFormat('ticket', null, 'shopping');
result.buyNowBase = helpers.urlFormat('/ticket', null, 'shopping');
if (result.salePrice) {
result.advancePrice = result.salePrice; // 先行价格
delete result.salePrice;
... ...
... ... @@ -41,6 +41,14 @@ var $saleReturn = $('#saleReturn');
var dialogTpl = require('hbs/product/coupon-dialog.hbs');
function productUrl(s) {
return window.location.href + '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"' + s + '"}}';
}
function isEmpty(el) {
return !$.trim(el.html());
}
bindEvent.add(function() {
var $imgShow = $('#img-show'),
$thumbs = $('#thumbs > .thumb-wrap');
... ... @@ -60,6 +68,8 @@ bindEvent.add(function() {
var $lcContainer = $('.lc-container'),
$itemBuy = $('.item-buy');
var $qrcode = $('.qr-code');
var $descColor = $('#desc-color');
var thumbsLoaded = {};
... ... @@ -223,6 +233,7 @@ bindEvent.add(function() {
}());
require('../plugins/share');
require('yoho-jquery-qrcode');
// 颜色
$('.colors').on('click', 'li', function() {
... ... @@ -379,6 +390,15 @@ bindEvent.add(function() {
// 限购码
$('.get-lc:not(.dis)').hover(function() {
$lcContainer.removeClass('hide');
if (isEmpty($qrcode)) {
$qrcode.qrcode({
render: 'table',
size: 140,
text: productUrl(skn)
});
}
}, function() {
$lcContainer.addClass('hide');
});
... ...
... ... @@ -510,9 +510,8 @@
padding: 40px 25px 0;
.qr-code {
width: 137px;
height: 137px;
background: resolve("product/top-good-qr.png");
width: 140px;
height: 140px;
margin: 0 auto;
}
... ...