Commit 25c285fd authored by renjie's avatar renjie

支付宝接口

parent b28528b7
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1</title>
<script src="https://www.fangguanlian.cn/home/js/plugin/jq.min.js"></script>
</head>
<body>
<div id="test">
</div>
<script>
test();
function test(str = location.href.split('?')[1]){
let token = decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[0]
let html =decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[1].split("&html_get_pay_money=")[0]
let total =decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[1].split("&html_get_pay_money=")[1]
$("#test").append(html)
}
function getUrlParams() {
const bundleUrl = location.href;
let params = bundleUrl.split('?')[1];
params = params ? paramsToObj(params) : {};
return params;
}
function paramsToObj(str) {
let obj = {};
try {
obj = JSON.parse('{"' + decodeURI(str).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
} catch (e) {
console.log(e);
}
return obj;
}
</script>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1</title>
<script src="https://www.fangguanlian.cn/home/js/plugin/jq.min.js"></script>
</head>
<body>
<div id="buy">
</div>
<script>
buy();
function buy(str = location.href.split('?')[1]){
let token = decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[0]
let html =decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[1].split("&html_get_pay_money=")[0]
let total =decodeURIComponent(str).split("token_get_pay=")[1].split("&html_get_pay=")[1].split("&html_get_pay_money=")[1]
$("#buy").append(html)
}
function getUrlParams() {
const bundleUrl = location.href;
let params = bundleUrl.split('?')[1];
params = params ? paramsToObj(params) : {};
return params;
}
function paramsToObj(str) {
let obj = {};
try {
obj = JSON.parse('{"' + decodeURI(str).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
} catch (e) {
console.log(e);
}
return obj;
}
</script>
</body>
</html>
\ 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