Commit 038e20fc authored by wangchunxiang's avatar wangchunxiang

init

parents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title></title>
<style>
.imgBg {
width: 100%;
text-align: center;
margin: 50% auto;
}
img {
width: 38%;
/* margin: 50% auto; */
}
p {
margin: 0.2rem auto;
font-size: 0.4rem;
}
button {
border: 1px solid #000;
border-radius: 0.07rem;
background: 0;
outline: none;
display: inline-block;
font-size: 0.4rem;
padding: 0.1rem 0.5rem;
text-align: center;
margin-top: 1rem;
}
</style>
<script src="./js/jquery.min.js"></script>
</head>
<body>
<div class="containers" id="wrap">
<div class="imgBg">
<img src="./images/wait.gif" alt="">
<p>Success!</p>
<button onclick="handleClick()">Close</button>
</div>
</div>
</body>
<script>
var rootResize = function () {
var baseFontSize = 100;
var baseWidth = 750;
var minWidth = 320;
var clientWidth = document.documentElement.clientWidth || window.innerWidth;
var innerWidth = Math.max(Math.min(clientWidth, baseWidth), minWidth);
var mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator
.userAgent); // /(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent); //绉诲姩绔�
// if (window.orientation == 180 || window.orientation == 0) {
// // 绔栧睆
// baseWidth = 750;
// }
// if (window.orientation == 90 || window.orientation == -90) {
// // 妯睆
// baseWidth = 1334;
// }
var rem = clientWidth / (baseWidth / baseFontSize);
if (innerWidth == 750 || innerWidth == 1334 || innerWidth == 320) {
rem = innerWidth / (baseWidth / baseFontSize)
}
document.querySelector('html').style.fontSize = rem + 'px';
if (mobile) {
document.getElementById("wrap").style.width = "100%";
} else {
document.getElementById("wrap").style.width = "750px";
}
};
rootResize();
window.onresize = function () {
rootResize()
};
</script>
<script src="./js/request.js"></script>
<script>
let MAX_RETRY_COUNT = 10;
let QUERY_MILLIS = 5000;
var status = false;
var code;
var msg;
function queryOrderStatus(retryCount) {
if (retryCount >= MAX_RETRY_COUNT) {
$('p').html('Fail!')
$('img').attr('src', './images/fail_03.png')
return;
}
$.ajax({
url: api.baseUrl + "/payermax/query?orderId=" + api.orderId,
// data: {name: 'jenny'},
type: "GET",
dataType: "json",
success: function (res) {
code = res.code;
msg = res.message;
if (res.code == 0) {
var status = res.data.status;
if (status == 0) {
$('p').html('Loading!');
$('img').attr('src', './images/wait.gif')
setTimeout(function () {
queryOrderStatus(retryCount + 1)
}, QUERY_MILLIS);
}
if (status == 1) {
status = true;
$('p').html('Success!');
$('img').attr('src', './images/succ_03.png');
} else if (status == 2) {
$('p').html('Fail!')
$('img').attr('src', './images/fail_03.png')
}
} else {
$('p').html('Loading!');
$('img').attr('src', './images/wait.gif');
setTimeout(function () {
queryOrderStatus(retryCount + 1)
}, QUERY_MILLIS);
}
}
});
}
queryOrderStatus(1);
function handleClick() {
window.android.close(status, code, msg)
}
</script>
</html>
\ No newline at end of file
This diff is collapsed.
var api = {
// baseUrl: 'https://admin.sky-shark.com',
baseUrl:'https://overseas-paycenter.sky-shark.com',
orderId:getUrlParam('orderId'),
}
// 处理md5
function handleMD5(data) {
var keys = []
keys = Object.keys(data);
keys.sort();
var signs = ''
keys.map((item, index) => {
if (index == 0) {
signs = item + '=' + encodeURIComponent(data[item])
} else {
signs += '&' + item + '=' + encodeURIComponent(data[item])
}
})
return signs;
}
//获取url中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) {
return unescape(r[2]);
}
return null; //返回参数值
}
function time(time = +new Date()) {
var date = new Date(time*1000 + 8 * 3600 * 1000);
return date.toJSON().substr(0, 19).replace('T', ' ').replace(/-/g, '.');
}
// 过滤特殊字符
function stripscript(s) {
var pattern = new RegExp(/[-_.!~*'()\s+]/g)
var rs = '';
for (var i = 0; i < s.length; i++) {
rs = rs + s.substr(i, 1).replace(pattern, '');
}
return rs;
}
/*判断客户端*/
function judgeClient(){
let client = '';
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS
client = 'iOS';
} else if (/(Android)/i.test(navigator.userAgent)) { //判断Android
client = 'Android';
} else {
client = 'PC';
}
return client;
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment