Authored by 郝肖肖

判断是否是展览票

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