Authored by 郝肖肖

判断是否是展览票

... ... @@ -165,7 +165,8 @@
</div>
</div>
<div class="chose-size row clearfix">
<div class="chose-size row clearfix {{#if isTicket}} hide {{/if}}">
<input type="hidden" name="isTicket" value="{{isTicket}}" />
<span class="title pull-left">
选区域:
</span>
... ... @@ -269,7 +270,7 @@
{{#if virtualGoods}}
{{!-- 电子门票按钮 --}}
<form name="ticket-form" action="/cart/index/ticketEnsure" method="POST" class="hide"></form>
<span id="buy-ticket" class="buy-btn buy-now item-buy{{#if dis}} dis{{/if}}" >立即购买</span>
<span id="buy-ticket" class="buy-ticket buy-now item-buy{{#if dis}} dis{{/if}}" >立即购买</span>
{{^}}
{{!-- 各颜色下所有尺码均售罄则只显示售罄按钮 --}}
{{#unless soldOut}}
... ...
... ... @@ -268,7 +268,7 @@ var TicketCat = {
if (data.code === 200) {
window.location.href = '/shopping/pay?ordercode=' + data.data.order_code;
} else {
new dialog.Alert('去付款失败!<br /><br />' + data.message).show();
new dialog.Alert(data.message).show();
}
}).always(function() {
el.$loading.hide();
... ...
... ... @@ -32,7 +32,8 @@ var $descColor = $('#desc-color');
var thumbsLoaded = {};
var $main = $('.main'),
id = $main.data('id');
id = $main.data('id'),
isTicket = $('input[name="isTicket"]').length > 0 && $('input[name="isTicket"]').val();
var maxStock = -1; //记录当前选中的颜色-尺码的库存量,若为-1,代表未选择尺码
... ... @@ -197,6 +198,12 @@ $('.colors').on('click', 'li', function() {
//切换尺码显示
$sizes.not('.hide').addClass('hide').children('li').removeClass('focus');
$sizes.eq(index).removeClass('hide');
//是否展览票
if (isTicket) {
$sizes.eq(index).children('li').trigger('click');
$('.chose-size').addClass('hide');
}
}
resetNum();
... ...
... ... @@ -437,7 +437,7 @@
}
}
.buy-btn {
.buy-btn, .buy-ticket {
display: inline-block;
margin-right: 10px;
height: 48px;
... ...
... ... @@ -151,6 +151,9 @@ class ItemModel
$soldOut = $baseInfo['status'] == 0 || $totalStorageNum === 0;
$notForSale = $baseInfo['attribute'] == 2;//非卖品
$virtualGoods = $baseInfo['attribute'] == 3;//虚拟商品
//是否展览票
$goodsInfo['isTicket'] = $goodsInfo['skn'] * 1 === EXHIBITION_TICKET;
if (!$soldOut && !$notForSale && !$virtualGoods) {
$goodsInfo['addToCart'] = true;
//立即购买或者即将开售存在
... ...