Authored by 周少峰

Merge branch 'feature/cartEvent' into release/5.3.1

@@ -718,7 +718,8 @@ class Helpers @@ -718,7 +718,8 @@ class Helpers
718 $oneGoods['productSubtotal'] = self::transPrice( floatval($value['last_vip_price']) * intval($value['buy_number']) ); 718 $oneGoods['productSubtotal'] = self::transPrice( floatval($value['last_vip_price']) * intval($value['buy_number']) );
719 $oneGoods['promotionId'] = empty($value['promotion_id']) ? '0' : $value['promotion_id']; 719 $oneGoods['promotionId'] = empty($value['promotion_id']) ? '0' : $value['promotion_id'];
720 $oneGoods['isLimitSkn'] = $value['is_limit_skn'] === 'Y'; //is_limit_skn=Y 不支持7天无理由退货 720 $oneGoods['isLimitSkn'] = $value['is_limit_skn'] === 'Y'; //is_limit_skn=Y 不支持7天无理由退货
721 - 721 + $oneGoods['productSkn'] = $value['product_skn'];
  722 + $oneGoods['productSku'] = $value['product_sku'];
722 // 已下架 723 // 已下架
723 if ($isOffShelves) { 724 if ($isOffShelves) {
724 $oneGoods['isTipNoStore'] = true; 725 $oneGoods['isTipNoStore'] = true;
@@ -274,7 +274,7 @@ @@ -274,7 +274,7 @@
274 {{/isVipPrice}} 274 {{/isVipPrice}}
275 </td> 275 </td>
276 <td>{{yohoIcon}}个</td> 276 <td>{{yohoIcon}}个</td>
277 - <td class="product-num">{{productNum}}</td> 277 + <td class="product-num" data-skn ="{{productSkn}}" data-sku="{{productSku}}">{{productNum}}</td>
278 <td class="cart-sub-total {{#xForOne}}xforone{{/xForOne}}"> 278 <td class="cart-sub-total {{#xForOne}}xforone{{/xForOne}}">
279 {{#if xForOne}} 279 {{#if xForOne}}
280 <del>{{productSubtotal}}</del> 280 <del>{{productSubtotal}}</del>
@@ -57,4 +57,5 @@ @@ -57,4 +57,5 @@
57 {{/ payNotice}} 57 {{/ payNotice}}
58 </div> 58 </div>
59 {{> pay/pay-analysis}} 59 {{> pay/pay-analysis}}
60 -{{> layout/footer}}  
  60 +{{> layout/footer}}
  61 +{{> pay/point}}
@@ -35,4 +35,5 @@ @@ -35,4 +35,5 @@
35 </div> 35 </div>
36 {{/ payData}} 36 {{/ payData}}
37 </div> 37 </div>
38 -{{> layout/footer}}  
  38 +{{> layout/footer}}
  39 +{{> pay/point}}
  1 +{{# point}}
  2 +<script type="text/javascript">
  3 + window.onload = function () {
  4 + // 埋点
  5 + window.addPoint('YB_SC_PAYMENT_TOPAY_CLICK', {ORDER_CODE: "{{orderCode}}", PAY_RES: "{{result}}", ORDER_AMOUNT: "{{amount}}", PAY_STYLE: "{{payWayId}}", PRD_SKN: "{{proSkn}}", PRD_SKU: "{{proSku}}"});
  6 + }
  7 +</script>
  8 +{{/ point}}
@@ -778,8 +778,10 @@ $('.to-play input.submit').click(function() { @@ -778,8 +778,10 @@ $('.to-play input.submit').click(function() {
778 redEnvelopes = $('.use-envelopes input:checked').attr('data-use'), 778 redEnvelopes = $('.use-envelopes input:checked').attr('data-use'),
779 $juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked'), 779 $juangroupInput = $('.play-juan.is-select input[name="juangroup"]:checked'),
780 codeVal = $juangroupInput.val(), 780 codeVal = $juangroupInput.val(),
781 - juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();  
782 - subTip = ''; 781 + juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val(),
  782 + subTip = '',
  783 + productSkn = [],
  784 + productSku = [];
783 785
784 if ($invoiceCheck.hasClass('active')) { 786 if ($invoiceCheck.hasClass('active')) {
785 invoiceType = $('.invoice-upload-type').html(); 787 invoiceType = $('.invoice-upload-type').html();
@@ -794,7 +796,7 @@ $('.to-play input.submit').click(function() { @@ -794,7 +796,7 @@ $('.to-play input.submit').click(function() {
794 return; 796 return;
795 } 797 }
796 798
797 - $this.attr('disabled', 'disabled'); 799 + $this.attr('disabled', 'disabled');
798 800
799 $.ajax({ 801 $.ajax({
800 type: 'POST', 802 type: 'POST',
@@ -861,10 +863,10 @@ $('.to-play input.submit').click(function() { @@ -861,10 +863,10 @@ $('.to-play input.submit').click(function() {
861 // 去付款按钮埋点 863 // 去付款按钮埋点
862 $('.product-num').each(function() { 864 $('.product-num').each(function() {
863 productNum += parseInt($(this).html()); 865 productNum += parseInt($(this).html());
  866 + productSkn.push($(this).attr('data-skn'));
  867 + productSku.push($(this).attr('data-sku'));
864 }); 868 });
865 -  
866 - window.addPoint('YB_SC_TOPAY_CLICK', {ORDER_CODE: d.data.order_code, PRD_NUM: productNum, ORDER_AMOUNT: d.data.order_amount, UNIONCOOKIE: d.data.unionKey});  
867 - 869 + window.addPoint('YB_SC_TOPAY_CLICK', {ORDER_CODE: d.data.order_code, PRD_NUM: productNum, ORDER_AMOUNT: d.data.order_amount, PRO_SKN: productSkn.join(','), PRO_SKU:productSku.join(','), UNIONCOOKIE: d.data.unionKey});
868 window.location.href = d.data.payUrl; 870 window.location.href = d.data.payUrl;
869 } 871 }
870 } else { 872 } else {
@@ -40,7 +40,7 @@ class NoticeController extends WebAction @@ -40,7 +40,7 @@ class NoticeController extends WebAction
40 $res = $this->getParseResponse($_GET, 2); 40 $res = $this->getParseResponse($_GET, 2);
41 UdpLog::info("【支付宝同步】,function:alipayreturnAction,参数", array('pars' => $_GET, 'res' => $res)); 41 UdpLog::info("【支付宝同步】,function:alipayreturnAction,参数", array('pars' => $_GET, 'res' => $res));
42 $dealResult = $this->payResultProc($res, 2); 42 $dealResult = $this->payResultProc($res, 2);
43 - $dealResult['payData'] = array('payWay' => '支付宝'); 43 + $dealResult['payData'] = array('payWay' => '支付宝', 'payWayId' => 2);
44 $this->commonShowResult($dealResult); 44 $this->commonShowResult($dealResult);
45 } 45 }
46 46
@@ -66,7 +66,7 @@ class NoticeController extends WebAction @@ -66,7 +66,7 @@ class NoticeController extends WebAction
66 $res = $this->getParseResponse($_GET, 17); 66 $res = $this->getParseResponse($_GET, 17);
67 UdpLog::info("【支付宝二维码支付同步】,function:alibarcodereturnAction,参数", array('pars' => $_GET, 'res' => $res)); 67 UdpLog::info("【支付宝二维码支付同步】,function:alibarcodereturnAction,参数", array('pars' => $_GET, 'res' => $res));
68 $dealResult = $this->payResultProc($res, 17); 68 $dealResult = $this->payResultProc($res, 17);
69 - $dealResult['payData'] = array('payWay' => '支付宝'); 69 + $dealResult['payData'] = array('payWay' => '支付宝', 'payWayId' => 17);
70 $this->commonShowResult($dealResult); 70 $this->commonShowResult($dealResult);
71 } 71 }
72 72
@@ -90,7 +90,7 @@ class NoticeController extends WebAction @@ -90,7 +90,7 @@ class NoticeController extends WebAction
90 { 90 {
91 $res = $this->getParseResponse($_POST, 16); 91 $res = $this->getParseResponse($_POST, 16);
92 $dealResult = $this->payResultProc($res, 16); 92 $dealResult = $this->payResultProc($res, 16);
93 - $dealResult['payData'] = array('payWay' => '通联支付'); 93 + $dealResult['payData'] = array('payWay' => '通联支付', 'payWayId' => 16);
94 $this->commonShowResult($dealResult); 94 $this->commonShowResult($dealResult);
95 } 95 }
96 96
@@ -101,7 +101,7 @@ class NoticeController extends WebAction @@ -101,7 +101,7 @@ class NoticeController extends WebAction
101 { 101 {
102 $res = $this->getParseResponse($_GET, 13); 102 $res = $this->getParseResponse($_GET, 13);
103 $dealResult = $this->payResultProc($res, 13); 103 $dealResult = $this->payResultProc($res, 13);
104 - $dealResult['payData'] = array('payWay' => '支付宝'); 104 + $dealResult['payData'] = array('payWay' => '支付宝', 'payWayId' => 13);
105 $this->commonShowResult($dealResult); 105 $this->commonShowResult($dealResult);
106 } 106 }
107 107
@@ -139,7 +139,7 @@ class NoticeController extends WebAction @@ -139,7 +139,7 @@ class NoticeController extends WebAction
139 { 139 {
140 $res = $this->getParseResponse($_GET, 12); 140 $res = $this->getParseResponse($_GET, 12);
141 $dealResult = $this->payResultProc($res, 12); 141 $dealResult = $this->payResultProc($res, 12);
142 - $dealResult['payData'] = array('payWay' => '银行卡'); 142 + $dealResult['payData'] = array('payWay' => '银行卡', 'payWayId' => 12);
143 $this->commonShowResult($dealResult); 143 $this->commonShowResult($dealResult);
144 } 144 }
145 145
@@ -150,7 +150,7 @@ class NoticeController extends WebAction @@ -150,7 +150,7 @@ class NoticeController extends WebAction
150 { 150 {
151 $res = $this->getParseResponse($_POST, 4); 151 $res = $this->getParseResponse($_POST, 4);
152 $dealResult = $this->payResultProc($res, 4); 152 $dealResult = $this->payResultProc($res, 4);
153 - $dealResult['payData'] = array('payWay' => '网银在线'); 153 + $dealResult['payData'] = array('payWay' => '网银在线', 'payWayId' => 4);
154 $this->commonShowResult($dealResult); 154 $this->commonShowResult($dealResult);
155 } 155 }
156 156
@@ -176,7 +176,7 @@ class NoticeController extends WebAction @@ -176,7 +176,7 @@ class NoticeController extends WebAction
176 { 176 {
177 $res = $this->getParseResponse($_GET, 1); 177 $res = $this->getParseResponse($_GET, 1);
178 $dealResult = $this->payResultProc($res, 1); 178 $dealResult = $this->payResultProc($res, 1);
179 - $dealResult['payData'] = array('payWay' => '财付通'); 179 + $dealResult['payData'] = array('payWay' => '财付通', 'payWayId' => 1);
180 $this->commonShowResult($dealResult); 180 $this->commonShowResult($dealResult);
181 } 181 }
182 182
@@ -188,7 +188,7 @@ class NoticeController extends WebAction @@ -188,7 +188,7 @@ class NoticeController extends WebAction
188 { 188 {
189 $res = $this->getParseResponse($_POST, 11); 189 $res = $this->getParseResponse($_POST, 11);
190 $dealResult = $this->payResultProc($res, 11); 190 $dealResult = $this->payResultProc($res, 11);
191 - $dealResult['payData'] = array('payWay' => '盛付通'); 191 + $dealResult['payData'] = array('payWay' => '盛付通', 'payWayId' => 11);
192 $this->commonShowResult($dealResult); 192 $this->commonShowResult($dealResult);
193 } 193 }
194 194
@@ -255,7 +255,7 @@ class NoticeController extends WebAction @@ -255,7 +255,7 @@ class NoticeController extends WebAction
255 $res = $payService->parseResponse(array('orderCode' => $orderCode)); 255 $res = $payService->parseResponse(array('orderCode' => $orderCode));
256 UdpLog::info("【微信扫码支付返回】,function:wechatqrcodereturnAction,参数", array('pars' => $_GET, 'res' => $res)); 256 UdpLog::info("【微信扫码支付返回】,function:wechatqrcodereturnAction,参数", array('pars' => $_GET, 'res' => $res));
257 $dealResult = $this->payResultProc($res, 21); 257 $dealResult = $this->payResultProc($res, 21);
258 - $dealResult['payData'] = array('payWay' => '微信扫码支付'); 258 + $dealResult['payData'] = array('payWay' => '微信扫码支付', 'payWayId' => 21);
259 } while (false); 259 } while (false);
260 260
261 $this->commonShowResult($dealResult); 261 $this->commonShowResult($dealResult);
@@ -269,7 +269,7 @@ class NoticeController extends WebAction @@ -269,7 +269,7 @@ class NoticeController extends WebAction
269 UdpLog::info("【银联web支付同步返回】,function:unionpaywebreturn,json参数", json_encode($_REQUEST)); 269 UdpLog::info("【银联web支付同步返回】,function:unionpaywebreturn,json参数", json_encode($_REQUEST));
270 $res = $this->getParseResponse($_REQUEST, 25); 270 $res = $this->getParseResponse($_REQUEST, 25);
271 $dealResult = $this->payResultProc($res, 25); 271 $dealResult = $this->payResultProc($res, 25);
272 - $dealResult['payData'] = array('payWay' => '银联在线支付'); 272 + $dealResult['payData'] = array('payWay' => '银联在线支付', 'payWayId' => 25);
273 $this->commonShowResult($dealResult); 273 $this->commonShowResult($dealResult);
274 } 274 }
275 275
@@ -334,19 +334,43 @@ class NoticeController extends WebAction @@ -334,19 +334,43 @@ class NoticeController extends WebAction
334 { 334 {
335 $code = $dealResult['code']; 335 $code = $dealResult['code'];
336 $view = 'wechatqrcodereturn'; 336 $view = 'wechatqrcodereturn';
  337 + $sknArr = array();
  338 + $skuArr = array();
  339 +
  340 + if ($dealResult['data']['items']) {
  341 + foreach($dealResult['data']['items'] as $val) {
  342 + $sknArr[] = $val['product_skn'];
  343 + $skuArr[] = $val['product_sku'];
  344 + }
  345 + }
  346 +
  347 + // 埋点数据
  348 + $point = array(
  349 + 'orderCode' => $dealResult['data']['orderNum'],
  350 + 'payResult' => 2, // 1 支付成功/2 支付失败
  351 + 'amount' => $dealResult['data']['pay'],
  352 + 'payStyle' => $dealResult['payData']['payWayId'],
  353 + 'proSkn' => implode($sknArr, ','),
  354 + 'proSku' => implode($skuArr, ','),
  355 + );
  356 +
337 $data = array( 357 $data = array(
338 'headerData' => true, 358 'headerData' => true,
339 - 'payData' => $dealResult['payData'] 359 + 'payData' => $dealResult['payData'],
  360 + 'point' => $point
340 ); 361 );
341 362
342 if ($code == 200) { 363 if ($code == 200) {
343 $view = 'index'; 364 $view = 'index';
  365 + $point['payResult'] = 1;// 支付结果
  366 +
344 $data = array( 367 $data = array(
345 'payNotice' => $dealResult['data'], 368 'payNotice' => $dealResult['data'],
346 'criteo' => array(// 统计代码有关数据 369 'criteo' => array(// 统计代码有关数据
347 'orderNum' => $dealResult['data']['orderNum'], 370 'orderNum' => $dealResult['data']['orderNum'],
348 'items' => $dealResult['data']['items'] 371 'items' => $dealResult['data']['items']
349 - ) 372 + ),
  373 + 'point' => $point
350 ); 374 );
351 } 375 }
352 376
@@ -23,9 +23,9 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关 @@ -23,9 +23,9 @@ define('USE_INTER_FACE_SHUNT', false);//分流开关
23 #dev环境 23 #dev环境
24 define('API_URL', 'http://api-test3.yohops.com:9999'); 24 define('API_URL', 'http://api-test3.yohops.com:9999');
25 define('SERVICE_URL', 'http://service-test3.yohops.com:9999/'); 25 define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
26 - define('YOHOBUY_URL', 'http://www.yohobuy.com/');  
27 - define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/');  
28 - define('API_OLD', 'http://devservice.yoho.cn:58077/'); 26 +define('YOHOBUY_URL', 'http://www.yohobuy.com/');
  27 +define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/');
  28 +define('API_OLD', 'http://devservice.yoho.cn:58077/');
29 29
30 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini'); 30 $application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
31 $application->bootstrap()->run(); 31 $application->bootstrap()->run();