Showing
3 changed files
with
14 additions
and
12 deletions
@@ -579,6 +579,8 @@ module.exports = class extends global.yoho.BaseModel { | @@ -579,6 +579,8 @@ module.exports = class extends global.yoho.BaseModel { | ||
579 | dest.cartInfo.soldOut = true; | 579 | dest.cartInfo.soldOut = true; |
580 | } else if (notForSale) { // 非卖品 | 580 | } else if (notForSale) { // 非卖品 |
581 | dest.cartInfo.notForSale = true; | 581 | dest.cartInfo.notForSale = true; |
582 | + } else if (dest.isPresale) { // 普通预售 | ||
583 | + dest.cartInfo.appBuy = 'preSale'; | ||
582 | } else if (origin.is_deposit_advance === 'Y' || origin.is_limit_time_advance === 'Y') { // 定金预售,定金促销 | 584 | } else if (origin.is_deposit_advance === 'Y' || origin.is_limit_time_advance === 'Y') { // 定金预售,定金促销 |
583 | dest.cartInfo.isDepositAdvance = true; | 585 | dest.cartInfo.isDepositAdvance = true; |
584 | } else if (origin.isLimitBuy) { // 限购 | 586 | } else if (origin.isLimitBuy) { // 限购 |
@@ -649,7 +651,8 @@ module.exports = class extends global.yoho.BaseModel { | @@ -649,7 +651,8 @@ module.exports = class extends global.yoho.BaseModel { | ||
649 | if (origin.attribute * 1 === 3) { | 651 | if (origin.attribute * 1 === 3) { |
650 | if (result.cartInfo.addToCartUrl) { | 652 | if (result.cartInfo.addToCartUrl) { |
651 | result.cartInfo.addToCartUrl = false; | 653 | result.cartInfo.addToCartUrl = false; |
652 | - result.tickets = result.cartInfo.tickets = true; | 654 | + result.cartInfo.appBuy = 'tickets'; |
655 | + result.tickets = true; | ||
653 | } | 656 | } |
654 | result.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm'); | 657 | result.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm'); |
655 | 658 |
@@ -23,11 +23,7 @@ | @@ -23,11 +23,7 @@ | ||
23 | <a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a> | 23 | <a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a> |
24 | {{/if}} | 24 | {{/if}} |
25 | {{#if tickets}} | 25 | {{#if tickets}} |
26 | - {{#if ticketsUrl}} | ||
27 | - <a href="{{ticketsUrl}}" class="addto-cart add-to-cart-url">APP购买</a> | ||
28 | - {{^}} | ||
29 | - <a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a> | ||
30 | - {{/if}} | 26 | + <a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a> |
31 | {{/if}} | 27 | {{/if}} |
32 | {{#if isDepositAdvance}} | 28 | {{#if isDepositAdvance}} |
33 | <a id="isDepositAdvance" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a> | 29 | <a id="isDepositAdvance" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a> |
@@ -53,6 +49,9 @@ | @@ -53,6 +49,9 @@ | ||
53 | {{#if noLimitCode}} | 49 | {{#if noLimitCode}} |
54 | <a id="noLimitCode" href="javascript:;" class="sold-out limit">立即购买</a> | 50 | <a id="noLimitCode" href="javascript:;" class="sold-out limit">立即购买</a> |
55 | {{/if}} | 51 | {{/if}} |
52 | + {{#if appBuy}} | ||
53 | + <a href="{{appBuyUrl}}" class="addto-cart add-to-cart-url">APP购买</a> | ||
54 | + {{/if}} | ||
56 | </span> | 55 | </span> |
57 | <input type="hidden" id="limitCodeUrl" name="limitCodeUrl" value="{{limitCodeUrl}}"> | 56 | <input type="hidden" id="limitCodeUrl" name="limitCodeUrl" value="{{limitCodeUrl}}"> |
58 | <input type="hidden" id="limitProductPay" name="limitProductPay" value="{{limitProductPay}}"> | 57 | <input type="hidden" id="limitProductPay" name="limitProductPay" value="{{limitProductPay}}"> |
@@ -117,21 +117,21 @@ setTimeout(() => { | @@ -117,21 +117,21 @@ setTimeout(() => { | ||
117 | data.studentPrice = Math.round(data.studentPrice.toString().replace('¥', '')); | 117 | data.studentPrice = Math.round(data.studentPrice.toString().replace('¥', '')); |
118 | } | 118 | } |
119 | 119 | ||
120 | - if (data.tickets && data.cartInfo) { | 120 | + if (data.cartInfo && data.cartInfo.appBuy) { |
121 | let $downloadBtn = $('#download-go'); | 121 | let $downloadBtn = $('#download-go'); |
122 | - let ticketsUrl; | 122 | + let appBuyUrl; |
123 | 123 | ||
124 | if ($downloadBtn.length) { | 124 | if ($downloadBtn.length) { |
125 | - ticketsUrl = $downloadBtn.attr('href'); | 125 | + appBuyUrl = $downloadBtn.attr('href'); |
126 | } | 126 | } |
127 | 127 | ||
128 | - if (!ticketsUrl) { | 128 | + if (!appBuyUrl) { |
129 | let mktCode = window._getMktCode ? window._getMktCode() : ''; | 129 | let mktCode = window._getMktCode ? window._getMktCode() : ''; |
130 | 130 | ||
131 | - ticketsUrl = `${DOWNLOAD_URL}?union_type=${mktCode}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.productSkn}}}`; // eslint-disable-line | 131 | + appBuyUrl = `${DOWNLOAD_URL}?union_type=${mktCode}&openby:yohobuy={"action":"go.productDetail","params":{"product_skn":${data.productSkn}}}`; // eslint-disable-line |
132 | } | 132 | } |
133 | 133 | ||
134 | - data.cartInfo.ticketsUrl = ticketsUrl; | 134 | + data.cartInfo.appBuyUrl = appBuyUrl; |
135 | } | 135 | } |
136 | 136 | ||
137 | $('#placeholder-pricedata').replaceWith(priceDataHbs(data)); | 137 | $('#placeholder-pricedata').replaceWith(priceDataHbs(data)); |
-
Please register or login to post a comment