Authored by 陈峰

Merge branch 'hotfix/presale-cart-message' into 'release/6.8.6'

预售商品增减时不显示预售提示



See merge request !425
@@ -203,7 +203,6 @@ const cart = (req, res, next) => { @@ -203,7 +203,6 @@ const cart = (req, res, next) => {
203 203
204 req.ctx(service).getCartData(uid, shoppingKey) 204 req.ctx(service).getCartData(uid, shoppingKey)
205 .then(ret => { 205 .then(ret => {
206 -  
207 return res.render('cart', { 206 return res.render('cart', {
208 title: '购物车 | ' + (res.locals.title || ''), 207 title: '购物车 | ' + (res.locals.title || ''),
209 module: 'cart', 208 module: 'cart',
@@ -119,7 +119,6 @@ const getCartDelList = (req, res, addsStr, delSkuId) => { @@ -119,7 +119,6 @@ const getCartDelList = (req, res, addsStr, delSkuId) => {
119 * @return array 处理之后的购物车商品数据 119 * @return array 处理之后的购物车商品数据
120 */ 120 */
121 const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analysis) => { 121 const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analysis) => {
122 -  
123 return _.map(cartGoods, (it) => { 122 return _.map(cartGoods, (it) => {
124 let goods = { 123 let goods = {
125 id: it.product_sku, 124 id: it.product_sku,
@@ -142,7 +141,8 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys @@ -142,7 +141,8 @@ const formatCartGoods = (cartGoods, isAdvanceCart, inValid, isOffShelves, analys
142 productSubtotal: transPrice(it.last_vip_price * it.buy_number), 141 productSubtotal: transPrice(it.last_vip_price * it.buy_number),
143 promotionId: it.promotion_id || 0, 142 promotionId: it.promotion_id || 0,
144 isLimitSkn: it.is_limit_skn === 'Y', // is_limit_skn=Y 不支持7天无理由退货 143 isLimitSkn: it.is_limit_skn === 'Y', // is_limit_skn=Y 不支持7天无理由退货
145 - isAdvance: isAdvanceCart 144 + isAdvance: isAdvanceCart,
  145 + saleTimeStr: !!it.sale_time_str
146 }; 146 };
147 147
148 // 划线的价格 148 // 划线的价格
@@ -435,7 +435,6 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => { @@ -435,7 +435,6 @@ const formatPoolPromotionInfos = (infoList, selectedGiftsList) => {
435 * 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中 435 * 格式化子优惠池信息,返回商品列表,子优惠列表放在每个商品中
436 */ 436 */
437 const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => { 437 const formatSubPromotionPools = (pools, selectedGiftsList, isAdvance, analysis) => {
438 -  
439 let goodsListPool = _.map(pools, p => { 438 let goodsListPool = _.map(pools, p => {
440 let pool = { 439 let pool = {
441 poolType: p.pool_type, 440 poolType: p.pool_type,
@@ -539,7 +538,6 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => { @@ -539,7 +538,6 @@ const formatSoldOutPools = (pools, selectedGiftsList, isAdvance, analysis) => {
539 }; 538 };
540 539
541 const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => { 540 const formatCart = (cartDataRet, uid, shoppingKey, cartDelList) => {
542 -  
543 let analysisData = { 541 let analysisData = {
544 ids: [], 542 ids: [],
545 criteo: [] 543 criteo: []
1 <li class="pre-sell-box tr 1 <li class="pre-sell-box tr
  2 + {{#saleTimeStr}}presale{{/saleTimeStr}}
2 {{#isChecked}}active{{/isChecked}} 3 {{#isChecked}}active{{/isChecked}}
3 {{#inValid}}tr-disabled {{#unless sku}}tr-disabled-none{{/unless}}{{/inValid}} 4 {{#inValid}}tr-disabled {{#unless sku}}tr-disabled-none{{/unless}}{{/inValid}}
4 {{#isSamebrandWithNext}} tr-group {{/isSamebrandWithNext}}" 5 {{#isSamebrandWithNext}} tr-group {{/isSamebrandWithNext}}"
@@ -25,7 +26,7 @@ @@ -25,7 +26,7 @@
25 {{#if inValid}} 26 {{#if inValid}}
26 <i class="cart-item-disabled iconfont"></i> 27 <i class="cart-item-disabled iconfont"></i>
27 {{else}} 28 {{else}}
28 - <i class="cart-item-check iconfont {{#isChecked}}cart-item-checked{{/isChecked}}" 29 + <i class="cart-item-check iconfont {{#isChecked}}cart-item-checked{{/isChecked}} {{#saleTimeStr}}presale{{/saleTimeStr}}"
29 data-role="cart-item-check" 30 data-role="cart-item-check"
30 data-goodstype="{{goodsType}}" 31 data-goodstype="{{goodsType}}"
31 {{#isTipNoStore}}data-tipnostore="true"{{/isTipNoStore}} 32 {{#isTipNoStore}}data-tipnostore="true"{{/isTipNoStore}}
@@ -90,6 +90,7 @@ @@ -90,6 +90,7 @@
90 </div> 90 </div>
91 91
92 {{#pools}} 92 {{#pools}}
  93 +
93 <div class="promotion-pool {{#unless @first}}mt20{{/unless}}" data-role="promotion-pool"> 94 <div class="promotion-pool {{#unless @first}}mt20{{/unless}}" data-role="promotion-pool">
94 {{#eq poolType 3}} 95 {{#eq poolType 3}}
95 {{>mix/cart/cart-pool-title}} 96 {{>mix/cart/cart-pool-title}}
@@ -471,7 +471,6 @@ Cart = { @@ -471,7 +471,6 @@ Cart = {
471 var oprType = $this.hasClass('minus') ? 'decreaseNum' : 'increaseNum'; 471 var oprType = $this.hasClass('minus') ? 'decreaseNum' : 'increaseNum';
472 472
473 countJSON[oprType] = 1; 473 countJSON[oprType] = 1;
474 -  
475 if ($this.siblings('input').val() === '1' && $this.hasClass('minus')) { 474 if ($this.siblings('input').val() === '1' && $this.hasClass('minus')) {
476 return false; 475 return false;
477 } 476 }
@@ -486,7 +485,7 @@ Cart = { @@ -486,7 +485,7 @@ Cart = {
486 activity_id: $item.data('pool-id') 485 activity_id: $item.data('pool-id')
487 })); 486 }));
488 487
489 - if (!$btn.hasClass('cart-item-checked')) { 488 + if (!$btn.hasClass('cart-item-checked') && !$btn.hasClass('presale')) {
490 $btn.click(); 489 $btn.click();
491 } 490 }
492 }, 491 },
@@ -140,7 +140,6 @@ function refreshCart(data) { @@ -140,7 +140,6 @@ function refreshCart(data) {
140 140
141 // checkbox提交ajax 141 // checkbox提交ajax
142 function choiceOut(items) { 142 function choiceOut(items) {
143 -  
144 var skuList = $.isArray(items) ? items : [items]; 143 var skuList = $.isArray(items) ? items : [items];
145 var hasPromotion = false; 144 var hasPromotion = false;
146 145
@@ -238,7 +237,6 @@ cartItemNumChg = (function() { @@ -238,7 +237,6 @@ cartItemNumChg = (function() {
238 url: '/cart/cart/modifyNum', 237 url: '/cart/cart/modifyNum',
239 data: data 238 data: data
240 }).then(function(d) { 239 }).then(function(d) {
241 -  
242 if (d.code === 200) { 240 if (d.code === 200) {
243 refreshCart(d.data); 241 refreshCart(d.data);
244 } else { 242 } else {