|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
window = {};
|
|
|
|
|
window = window || {};
|
|
|
|
|
$(function () {
|
|
|
|
|
'use strict';
|
|
|
|
|
var winHeight = $(window).height();
|
|
|
|
@ -6,7 +6,11 @@ $(function () {
|
|
|
|
|
if (ua.indexOf('micromessenger') >= 0) {
|
|
|
|
|
$(".weixin-tip").show().css("height", winHeight);
|
|
|
|
|
} else {
|
|
|
|
|
location.href = window.target_href;
|
|
|
|
|
if (!window.retry_flag) {
|
|
|
|
|
location.href = window.target_href;
|
|
|
|
|
} else {
|
|
|
|
|
checkOrderStd(window.client_moniker, window.parent_order_id, true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
decode();
|
|
|
|
|
|
|
|
|
@ -17,21 +21,59 @@ $(function () {
|
|
|
|
|
$('#complete').bind('touchstart', function () {
|
|
|
|
|
checkOrderStd(window.client_moniker, window.partner_order_id, false);
|
|
|
|
|
});
|
|
|
|
|
$('#refresh').bind('touchstart', function () {
|
|
|
|
|
if (window.refresh_cooldown > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
window.refresh_cooldown = 10;
|
|
|
|
|
|
|
|
|
|
function replaceTxt() {
|
|
|
|
|
window.refresh_cooldown = window.refresh_cooldown - 1
|
|
|
|
|
if (window.refresh_cooldown > 0) {
|
|
|
|
|
$('#refresh').find('a').text('正在查询订单,请' + window.refresh_cooldown + '秒后重试')
|
|
|
|
|
setTimeout(replaceTxt, 1000)
|
|
|
|
|
} else {
|
|
|
|
|
$('#refresh').find('a').text('已完成付款')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTimeout(replaceTxt, 1000)
|
|
|
|
|
replaceTxt()
|
|
|
|
|
|
|
|
|
|
checkOrderStd(window.client_moniker, window.partner_order_id, false);
|
|
|
|
|
});
|
|
|
|
|
$('#retry_btn').bind('touchstart', function () {
|
|
|
|
|
location.href = window.target_href;
|
|
|
|
|
})
|
|
|
|
|
$('#continue_use_browser').bind('touchstart', function () {
|
|
|
|
|
location.href = window.target_href;
|
|
|
|
|
});
|
|
|
|
|
$('#copy_link').bind('touchstart', function () {
|
|
|
|
|
var current_href = location.href;
|
|
|
|
|
$("#copy_link_btn").attr("data-clipboard-text", current_href);
|
|
|
|
|
var btn = document.getElementById('copy_link_btn');
|
|
|
|
|
var clipboard = new ClipboardJS(btn);
|
|
|
|
|
clipboard.on('success', function (e) {
|
|
|
|
|
alert("复制成功!");
|
|
|
|
|
e.clearSelection();
|
|
|
|
|
});
|
|
|
|
|
clipboard.on('error', function (e) {
|
|
|
|
|
alert("复制失败!");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function decode() {
|
|
|
|
|
var redirect = window.redirect;
|
|
|
|
|
while (redirect.indexOf('://') < 0) {
|
|
|
|
|
redirect = decodeURIComponent(redirect);
|
|
|
|
|
if (redirect == window.redirect) {
|
|
|
|
|
if (redirect === window.redirect) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
window.redirect = redirect;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
|
|
|
|
|
if (!clientMoniker || !merchantOrderId) {
|
|
|
|
|
return;
|
|
|
|
|