Authored by yyq

hide detail entries

... ... @@ -579,6 +579,8 @@ module.exports = class extends global.yoho.BaseModel {
dest.cartInfo.soldOut = true;
} else if (notForSale) { // 非卖品
dest.cartInfo.notForSale = true;
} else if (dest.isPresale) { // 普通预售
dest.cartInfo.appBuy = 'preSale';
} else if (origin.is_deposit_advance === 'Y' || origin.is_limit_time_advance === 'Y') { // 定金预售,定金促销
dest.cartInfo.isDepositAdvance = true;
} else if (origin.isLimitBuy) { // 限购
... ... @@ -649,7 +651,8 @@ module.exports = class extends global.yoho.BaseModel {
if (origin.attribute * 1 === 3) {
if (result.cartInfo.addToCartUrl) {
result.cartInfo.addToCartUrl = false;
result.tickets = result.cartInfo.tickets = true;
result.cartInfo.appBuy = 'tickets';
result.tickets = true;
}
result.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm');
... ...
... ... @@ -23,11 +23,7 @@
<a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a>
{{/if}}
{{#if tickets}}
{{#if ticketsUrl}}
<a href="{{ticketsUrl}}" class="addto-cart add-to-cart-url">APP购买</a>
{{^}}
<a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
{{/if}}
<a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
{{/if}}
{{#if isDepositAdvance}}
<a id="isDepositAdvance" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
... ... @@ -53,6 +49,9 @@
{{#if noLimitCode}}
<a id="noLimitCode" href="javascript:;" class="sold-out limit">立即购买</a>
{{/if}}
{{#if appBuy}}
<a href="{{appBuyUrl}}" class="addto-cart add-to-cart-url">APP购买</a>
{{/if}}
</span>
<input type="hidden" id="limitCodeUrl" name="limitCodeUrl" value="{{limitCodeUrl}}">
<input type="hidden" id="limitProductPay" name="limitProductPay" value="{{limitProductPay}}">
... ...
... ... @@ -117,21 +117,21 @@ setTimeout(() => {
data.studentPrice = Math.round(data.studentPrice.toString().replace('¥', ''));
}
if (data.tickets && data.cartInfo) {
if (data.cartInfo && data.cartInfo.appBuy) {
let $downloadBtn = $('#download-go');
let ticketsUrl;
let appBuyUrl;
if ($downloadBtn.length) {
ticketsUrl = $downloadBtn.attr('href');
appBuyUrl = $downloadBtn.attr('href');
}
if (!ticketsUrl) {
if (!appBuyUrl) {
let mktCode = window._getMktCode ? window._getMktCode() : '';
ticketsUrl = `${DOWNLOAD_URL}?union_type=${mktCode}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.productSkn}}}`; // eslint-disable-line
appBuyUrl = `${DOWNLOAD_URL}?union_type=${mktCode}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.productSkn}}}`; // eslint-disable-line
}
data.cartInfo.ticketsUrl = ticketsUrl;
data.cartInfo.appBuyUrl = appBuyUrl;
}
$('#placeholder-pricedata').replaceWith(priceDataHbs(data));
... ...