Authored by 郝肖肖

oepnid

... ... @@ -11,7 +11,6 @@ var loading = require('../plugin/loading'),
// 点击微信显示加载
var $loadingToast = $(".loading-toast");
var theOrderCode = document.getElementById('ordercode').value;
var weixinOpenId = document.getElementById('openId').value;
var wxPayEl = document.getElementById('weixin'),
wxHammer = wxPayEl && new Hammer(wxPayEl);
... ... @@ -55,7 +54,7 @@ function jsApiCall(orderCode, jsApiParameters) {
'getBrandWCPayRequest',
jsApiParameters,
function(res) {
window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=' + weixinOpenId;
window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=true';
}
);
}
... ... @@ -77,8 +76,7 @@ function callpay(orderCode) {
type: 'GET',
url: '/shopping/pay/wechatwapapi',
data: {
'order_code': orderCode,
'openId': weixinOpenId,
'order_code': orderCode
},
dataType: 'json',
success: function(res) {
... ...
... ... @@ -2,7 +2,6 @@
<div class="pay-page yoho-page">
{{#if orderCode}}
<input id='ordercode' type="hidden" value="{{orderCode}}">
<input id='openId' type="hidden" value="{{openId}}">
{{/if}}
<div class="payapp-list">
{{# payAppInfo}}
... ...
... ... @@ -979,7 +979,7 @@ class HomeController extends AbstractAction
if (!empty($orderDetail['isPay'])) {
$this->go(Helpers::url('/home/orderdetail', array('order_code' => $orderCode)));
}
$openId = '';
$hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false;
if ($hasWxShare) {
$openId = $this->getSession('weixinOpenId' . $orderCode);
... ... @@ -1013,7 +1013,6 @@ class HomeController extends AbstractAction
),
),
'hasWxShare' => $hasWxShare,
'openId' => $openId,
'orderCode' => $orderCode,
'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0,
'orderTotalFormat' => isset($orderDetail['goodsAmount']) ? sprintf("%d", $orderDetail['goodsAmount']) : 0,
... ...
... ... @@ -124,11 +124,6 @@ class PayController extends AbstractAction
$openId = $this->getSession('weixinOpenId' . $orderCode);
if (empty($openId)) {
$openId = $this->get('openId');
UdpLog::info('【wechat支付】通过get 获取openId: ', array('orderCode' => $orderCode, 'uid' => $uid, 'openId' => $openId));
}
if (empty($openId)) {
UdpLog::info('【wechat支付】获取wechat标识为空', array('orderCode' => $orderCode, 'uid' => $uid, 'openId' => $openId));
break;
}
... ...