wechatqrcode.js
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* 微信支付页面
*/
var $ = require('yoho.jquery'),
$wOdetail = $('.w-odetail'),
$payHost = $('#payHost').val(),
$paySuccessUrl = $('#paySuccessUrl').val(),
$wPerm = $('.w-p-erm');
require('../../plugin/jquery.qrcode');
$wOdetail.click(function() {
$('.w-addrinfo').slideToggle('slow');
if ($wOdetail.find('i').hasClass('up')) {
$wOdetail.html('收起详情<i class="down"></i>');
} else {
$wOdetail.html('订单详情<i class="up"></i>');
}
});
$.ajax({
url: $wPerm.data('url'),
dataType: 'jsonp',
success: function(res) {
if (res.code === '200') {
$wPerm.qrcode(res.qrcode_url);
}
}
});
function checkPayStatus() {
console.log('ll');
$.ajax({
url: $payHost,
dataType: 'jsonp',
success: function(data) {
if (data.status === 'success') {
window.location.href = $paySuccessUrl;
}
}
});
}
setInterval(checkPayStatus, 3000);