Authored by 郝肖肖

oepnid

@@ -11,7 +11,6 @@ var loading = require('../plugin/loading'), @@ -11,7 +11,6 @@ var loading = require('../plugin/loading'),
11 // 点击微信显示加载 11 // 点击微信显示加载
12 var $loadingToast = $(".loading-toast"); 12 var $loadingToast = $(".loading-toast");
13 var theOrderCode = document.getElementById('ordercode').value; 13 var theOrderCode = document.getElementById('ordercode').value;
14 -var weixinOpenId = document.getElementById('openId').value;  
15 14
16 var wxPayEl = document.getElementById('weixin'), 15 var wxPayEl = document.getElementById('weixin'),
17 wxHammer = wxPayEl && new Hammer(wxPayEl); 16 wxHammer = wxPayEl && new Hammer(wxPayEl);
@@ -55,7 +54,7 @@ function jsApiCall(orderCode, jsApiParameters) { @@ -55,7 +54,7 @@ function jsApiCall(orderCode, jsApiParameters) {
55 'getBrandWCPayRequest', 54 'getBrandWCPayRequest',
56 jsApiParameters, 55 jsApiParameters,
57 function(res) { 56 function(res) {
58 - window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=' + weixinOpenId; 57 + window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=true';
59 } 58 }
60 ); 59 );
61 } 60 }
@@ -77,8 +76,7 @@ function callpay(orderCode) { @@ -77,8 +76,7 @@ function callpay(orderCode) {
77 type: 'GET', 76 type: 'GET',
78 url: '/shopping/pay/wechatwapapi', 77 url: '/shopping/pay/wechatwapapi',
79 data: { 78 data: {
80 - 'order_code': orderCode,  
81 - 'openId': weixinOpenId, 79 + 'order_code': orderCode
82 }, 80 },
83 dataType: 'json', 81 dataType: 'json',
84 success: function(res) { 82 success: function(res) {
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 <div class="pay-page yoho-page"> 2 <div class="pay-page yoho-page">
3 {{#if orderCode}} 3 {{#if orderCode}}
4 <input id='ordercode' type="hidden" value="{{orderCode}}"> 4 <input id='ordercode' type="hidden" value="{{orderCode}}">
5 - <input id='openId' type="hidden" value="{{openId}}">  
6 {{/if}} 5 {{/if}}
7 <div class="payapp-list"> 6 <div class="payapp-list">
8 {{# payAppInfo}} 7 {{# payAppInfo}}
@@ -979,7 +979,7 @@ class HomeController extends AbstractAction @@ -979,7 +979,7 @@ class HomeController extends AbstractAction
979 if (!empty($orderDetail['isPay'])) { 979 if (!empty($orderDetail['isPay'])) {
980 $this->go(Helpers::url('/home/orderdetail', array('order_code' => $orderCode))); 980 $this->go(Helpers::url('/home/orderdetail', array('order_code' => $orderCode)));
981 } 981 }
982 - $openId = ''; 982 +
983 $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; 983 $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false;
984 if ($hasWxShare) { 984 if ($hasWxShare) {
985 $openId = $this->getSession('weixinOpenId' . $orderCode); 985 $openId = $this->getSession('weixinOpenId' . $orderCode);
@@ -1013,7 +1013,6 @@ class HomeController extends AbstractAction @@ -1013,7 +1013,6 @@ class HomeController extends AbstractAction
1013 ), 1013 ),
1014 ), 1014 ),
1015 'hasWxShare' => $hasWxShare, 1015 'hasWxShare' => $hasWxShare,
1016 - 'openId' => $openId,  
1017 'orderCode' => $orderCode, 1016 'orderCode' => $orderCode,
1018 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0, 1017 'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0,
1019 'orderTotalFormat' => isset($orderDetail['goodsAmount']) ? sprintf("%d", $orderDetail['goodsAmount']) : 0, 1018 'orderTotalFormat' => isset($orderDetail['goodsAmount']) ? sprintf("%d", $orderDetail['goodsAmount']) : 0,
@@ -124,11 +124,6 @@ class PayController extends AbstractAction @@ -124,11 +124,6 @@ class PayController extends AbstractAction
124 $openId = $this->getSession('weixinOpenId' . $orderCode); 124 $openId = $this->getSession('weixinOpenId' . $orderCode);
125 125
126 if (empty($openId)) { 126 if (empty($openId)) {
127 - $openId = $this->get('openId');  
128 - UdpLog::info('【wechat支付】通过get 获取openId: ', array('orderCode' => $orderCode, 'uid' => $uid, 'openId' => $openId));  
129 - }  
130 -  
131 - if (empty($openId)) {  
132 UdpLog::info('【wechat支付】获取wechat标识为空', array('orderCode' => $orderCode, 'uid' => $uid, 'openId' => $openId)); 127 UdpLog::info('【wechat支付】获取wechat标识为空', array('orderCode' => $orderCode, 'uid' => $uid, 'openId' => $openId));
133 break; 128 break;
134 } 129 }