Authored by 郝肖肖

weixin openid

@@ -11,7 +11,7 @@ var loading = require('../plugin/loading'), @@ -11,7 +11,7 @@ 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 openId = document.getElementById('openId').value; 14 +var weixinOpenId = document.getElementById('openId').value;
15 15
16 var wxPayEl = document.getElementById('weixin'), 16 var wxPayEl = document.getElementById('weixin'),
17 wxHammer = wxPayEl && new Hammer(wxPayEl); 17 wxHammer = wxPayEl && new Hammer(wxPayEl);
@@ -55,7 +55,7 @@ function jsApiCall(orderCode, jsApiParameters) { @@ -55,7 +55,7 @@ function jsApiCall(orderCode, jsApiParameters) {
55 'getBrandWCPayRequest', 55 'getBrandWCPayRequest',
56 jsApiParameters, 56 jsApiParameters,
57 function(res) { 57 function(res) {
58 - window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=' + openId; 58 + window.location.href = '/home/orders/detail?order_code=' + orderCode + '&openId=' + weixinOpenId;
59 } 59 }
60 ); 60 );
61 } 61 }
@@ -73,13 +73,12 @@ function callpay(orderCode) { @@ -73,13 +73,12 @@ function callpay(orderCode) {
73 document.attachEvent('onWeixinJSBridgeReady', jsApiCall); 73 document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
74 } 74 }
75 } else { 75 } else {
76 - console.log(openId, '=====');  
77 $.ajax({ 76 $.ajax({
78 type: 'GET', 77 type: 'GET',
79 url: '/shopping/pay/wechatwapapi', 78 url: '/shopping/pay/wechatwapapi',
80 data: { 79 data: {
81 'order_code': orderCode, 80 'order_code': orderCode,
82 - 'openId': openId, 81 + 'openId': weixinOpenId,
83 }, 82 },
84 dataType: 'json', 83 dataType: 'json',
85 success: function(res) { 84 success: function(res) {