Authored by 郝肖肖

Merge branch 'feature/couponOptimi' into 'release/5.5'

优惠券埋点



See merge request !350
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 {{!--coupon-list start--}} 9 {{!--coupon-list start--}}
10 <div class="coupon-list coupon-tab1"> 10 <div class="coupon-list coupon-tab1">
11 {{#each list}} 11 {{#each list}}
12 - <div class="coupon-group"> 12 + <div class="coupon-group" data-coupon-id={{couponId}}>
13 <div class="coupon-header">{{couponDetailInfomation}}</div> 13 <div class="coupon-header">{{couponDetailInfomation}}</div>
14 <div class="coupon-content"> 14 <div class="coupon-content">
15 <div class="coupon-content-group1"> 15 <div class="coupon-content-group1">
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 {{#if employbg}} 28 {{#if employbg}}
29 <span class="employ"></span> 29 <span class="employ"></span>
30 {{else if bestowLink}} 30 {{else if bestowLink}}
31 - <a href="{{bestowLink}}" class="btn">立即使用</a> 31 + <a href="javascript:void(0);" data-link="{{bestowLink}}" class="btn">立即使用</a>
32 {{/if}} 32 {{/if}}
33 </div> 33 </div>
34 </div> 34 </div>
1 {{#each list}} 1 {{#each list}}
2 -<div class="coupon-group"> 2 +<div class="coupon-group" data-coupon-id={{couponId}}>
3 <div class="coupon-header">{{couponDetailInfomation}}</div> 3 <div class="coupon-header">{{couponDetailInfomation}}</div>
4 <div class="coupon-content"> 4 <div class="coupon-content">
5 <div class="coupon-content-group1"> 5 <div class="coupon-content-group1">
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 <div class="coupon-content-group2-table"> 10 <div class="coupon-content-group2-table">
11 <div> 11 <div>
12 {{couponValidity}} 12 {{couponValidity}}
13 - {{#if isSoonExpire}}<span class="coupon-soon-expire">(即将到期</span>{{/if}} 13 + {{#if overState}}<span class="coupon-soon-expire">{{overState}}</span>{{/if}}
14 </div> 14 </div>
15 <div> 15 <div>
16 <div class="left down info-btn">详细信息<i class="iconfont"></i></div> 16 <div class="left down info-btn">详细信息<i class="iconfont"></i></div>
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 {{#if employbg}} 18 {{#if employbg}}
19 <span class="employ"></span> 19 <span class="employ"></span>
20 {{else if bestowLink}} 20 {{else if bestowLink}}
21 - <a href="{{bestowLink}}" class="btn">立即使用</a> 21 + <a href="javascript:void(0);" data-link="{{bestowLink}}" class="btn">立即使用</a>
22 {{/if}} 22 {{/if}}
23 </div> 23 </div>
24 </div> 24 </div>
@@ -26,13 +26,18 @@ @@ -26,13 +26,18 @@
26 </div> 26 </div>
27 </div> 27 </div>
28 <div class="coupon-footer hide"> 28 <div class="coupon-footer hide">
29 - {{#if brandNameLimit}}  
30 - <p>限品牌:{{brandNameLimit}}</p>  
31 - {{else if sortNameLimit}}  
32 - <p>限品类:{{sortNameLimit}}</p>  
33 - {{else if isNoLimit}} 29 + {{#if isNoLimit}}
34 <p>全场通用</p> 30 <p>全场通用</p>
35 {{/if}} 31 {{/if}}
  32 +
  33 + {{#if brandNameLimits}}
  34 + <p>限品牌:{{brandNameLimits}}</p>
  35 + {{/if}}
  36 +
  37 + {{#if sortNameLimits}}
  38 + <p>限品类:{{sortNameLimits}}</p>
  39 + {{/if}}
  40 +
36 <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isDiscount}}、限量{{/if}}等)暂不支持使用优惠券。</p> 41 <p>特例商品(秒杀、限定、境外、预售{{#if isDiscount}}、3折以下{{/if}}{{#if isDiscount}}、限量{{/if}}等)暂不支持使用优惠券。</p>
37 {{#if explains}}<p>说明:{{explains}}</p>{{/if}} 42 {{#if explains}}<p>说明:{{explains}}</p>{{/if}}
38 </div> 43 </div>
@@ -106,6 +106,31 @@ $('.coupon-list').on('click', '.info-btn', function() { @@ -106,6 +106,31 @@ $('.coupon-list').on('click', '.info-btn', function() {
106 $this.removeClass('up').addClass('down'); 106 $this.removeClass('up').addClass('down');
107 $this.closest('.coupon-group').find('.coupon-footer').addClass('hide'); 107 $this.closest('.coupon-group').find('.coupon-footer').addClass('hide');
108 } 108 }
  109 +
  110 + // 优惠券埋点
  111 + window._yas && window._yas.sendCustomInfo({
  112 + op: 'YB_COUPON_DETAIL_C',
  113 + param: JSON.stringify({
  114 + C_ID: window._ChannelVary[window.cookie('_Channel')] || 1,
  115 + COUPON_ID: $this.closest('.coupon-group').data('coupon-id')
  116 + })
  117 + }, true);
  118 +});
  119 +
  120 +// 立即使用
  121 +$('.coupon-list').on('click', 'a.btn', function() {
  122 + var $this = $(this);
  123 +
  124 + // 优惠券埋点
  125 + window._yas && window._yas.sendCustomInfo({
  126 + op: 'YB_COUPON_IMMEDIATE_USE_C',
  127 + param: JSON.stringify({
  128 + C_ID: window._ChannelVary[window.cookie('_Channel')] || 1,
  129 + COUPON_ID: $this.closest('.coupon-group').data('coupon-id')
  130 + })
  131 + }, true);
  132 +
  133 + document.location.href = $this.data('link');
109 }); 134 });
110 135
111 // 首屏渲染无结果判断 136 // 首屏渲染无结果判断