支付跳转修改

master
zhengchanglong 5 years ago
parent c5221795ec
commit 1a62aed2d4

@ -142,6 +142,11 @@ class Ipa365Controller extends BaseController{
$this->display();
}
public function paytip($jump_url){
$this->assign("jump_url",$jump_url);
$this->display();
}
/**
* 下载页面 判断订单是否支付成功
*/

@ -15,7 +15,7 @@
<link href="__CSS__/ssg/pay-center.css" rel="stylesheet" type="text/css">
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/jquery.base64.js" type="text/javascript"></script>
</head>
<body>
@ -69,7 +69,7 @@
<span>{$price}元</span>
</div>
<a class="order-payinfo-item"
href="{$url}"
href="#;" onclick="jump('{$url}')"
title="支付宝">
<div class="order-payinfo-icon">
<img src="__IMG__/ssg/alipay/zfb-pic.jpg" alt="支付宝">
@ -86,6 +86,13 @@
</div>
</body>
<script>
function jump($pay_url) {
if(isWeiXin()){
window.location.href = "/sdk.php/Ipa365/paytip/jump_url/"+$.base64.encode($pay_url);
}else{
window.location.href=$pay_url;
}
}
//判断是否是微信浏览器的函数
function isWeiXin(){
//window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息这个属性可以用来判断浏览器类型

@ -12,6 +12,25 @@
<!--<link href="./img/favicon.ico" type="image/x-icon" rel="shortcut icon">-->
<link href="__CSS__/ssg/pay-center.css" rel="stylesheet" type="text/css">
<script src="__JS__/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="__JS__/jquery.base64.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
if(isWeiXin()==false){
window.location.href=$.base64.decode('{$jump_url}');
}
});
//判断是否是微信浏览器的函数
function isWeiXin(){
//window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息这个属性可以用来判断浏览器类型
var ua = window.navigator.userAgent.toLowerCase();
//通过正则表达式匹配ua中是否含有MicroMessenger字符串
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
return true;
}else{
return false;
}
}
</script>
</head>
<body>
<div class="topbar">
@ -26,10 +45,10 @@
<div class="m-order hidden">
<div class="m-order-base">
<div class="m-order-item">
<label>收款方:</label><span>福建云峰网络科技有限公司</span>
<label>收款方:</label><span>天下游戏平台</span>
</div>
<div class="m-order-item">
<label>订单号:</label><span>201909231287512597767135279</span>
<label>订单号:</label><span>{$order_id}</span>
</div>
<div class="m-order-item">
<label>商品名称:</label><span>超级签购买</span>
@ -38,14 +57,14 @@
<label>商品描述:</label><span></span>
</div>
<div class="m-order-item">
<label>交易金额:</label><span>10.00</span>
<label>交易金额:</label><span>{$price}</span>
</div>
</div>
<div class="m-order-qrcode">
<div class="m-weixin-alipay-hintinfo">由于微信不支持支付宝直接支付请点击微信右上角菜单在Safari中打开</div>
<div class="m-weixin-alipay-qrcode-foot">
<a class="fail-pay" href="http://apipay.37376.com/pay/payreturn?TradeNo=201909231287512597767135279&amp;SignatureStamp=1569242244&amp;SignatureMD5=256B903183112B9BA4A826E579E89142">支付遇到问题</a>
&nbsp;&nbsp; <a class="success-pay" href="http://apipay.37376.com/pay/payreturn?TradeNo=201909231287512597767135279&amp;SignatureStamp=1569242244&amp;SignatureMD5=256B903183112B9BA4A826E579E89142">支付完成</a>
<a class="success-pay" href="http://apipay.37376.com/pay/payreturn?TradeNo=201909231287512597767135279&amp;SignatureStamp=1569242244&amp;SignatureMD5=256B903183112B9BA4A826E579E89142">支付完成</a>
</div>
</div>
</div>

@ -2,8 +2,21 @@ $(function() {
remInit(100, 375);
selectProductInit();
copyInit();
close_page();
});
function close_page(){
window.onbeforeunload = onbeforeunload_handler;
//window.onunload = onunload_handler;
}
function onbeforeunload_handler(){
sessionStorage.clear();
//alert("确认关闭www.someabcd.com?");
//你的业务操作。。。。
}
function remInit(screenSize, picSize) {
$(window)
.on("resize", function(e) {

@ -0,0 +1,122 @@
/*!
* jquery.base64.js 0.1 - https://github.com/yckart/jquery.base64.js
* Makes Base64 en & -decoding simpler as it is.
*
* Based upon: https://gist.github.com/Yaffle/1284012
*
* Copyright (c) 2012 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/02/10
**/
;(function($) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
a256 = '',
r64 = [256],
r256 = [256],
i = 0;
var UTF8 = {
/**
* Encode multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only)
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars
*
* @param {String} strUni Unicode string to be encoded as UTF-8
* @returns {String} encoded string
*/
encode: function(strUni) {
// use regular expressions & String.replace callback function for better efficiency
// than procedural approaches
var strUtf = strUni.replace(/[\u0080-\u07ff]/g, // U+0080 - U+07FF => 2 bytes 110yyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xc0 | cc >> 6, 0x80 | cc & 0x3f);
})
.replace(/[\u0800-\uffff]/g, // U+0800 - U+FFFF => 3 bytes 1110xxxx, 10yyyyyy, 10zzzzzz
function(c) {
var cc = c.charCodeAt(0);
return String.fromCharCode(0xe0 | cc >> 12, 0x80 | cc >> 6 & 0x3F, 0x80 | cc & 0x3f);
});
return strUtf;
},
/**
* Decode utf-8 encoded string back into multi-byte Unicode characters
*
* @param {String} strUtf UTF-8 string to be decoded back to Unicode
* @returns {String} decoded string
*/
decode: function(strUtf) {
// note: decode 3-byte chars first as decoded 2-byte strings could appear to be 3-byte char!
var strUni = strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g, // 3-byte chars
function(c) { // (note parentheses for precence)
var cc = ((c.charCodeAt(0) & 0x0f) << 12) | ((c.charCodeAt(1) & 0x3f) << 6) | (c.charCodeAt(2) & 0x3f);
return String.fromCharCode(cc);
})
.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g, // 2-byte chars
function(c) { // (note parentheses for precence)
var cc = (c.charCodeAt(0) & 0x1f) << 6 | c.charCodeAt(1) & 0x3f;
return String.fromCharCode(cc);
});
return strUni;
}
};
while(i < 256) {
var c = String.fromCharCode(i);
a256 += c;
r256[i] = i;
r64[i] = b64.indexOf(c);
++i;
}
function code(s, discard, alpha, beta, w1, w2) {
s = String(s);
var buffer = 0,
i = 0,
length = s.length,
result = '',
bitsInBuffer = 0;
while(i < length) {
var c = s.charCodeAt(i);
c = c < 256 ? alpha[c] : -1;
buffer = (buffer << w1) + c;
bitsInBuffer += w1;
while(bitsInBuffer >= w2) {
bitsInBuffer -= w2;
var tmp = buffer >> bitsInBuffer;
result += beta.charAt(tmp);
buffer ^= tmp << bitsInBuffer;
}
++i;
}
if(!discard && bitsInBuffer > 0) result += beta.charAt(buffer << (w2 - bitsInBuffer));
return result;
}
var Plugin = $.base64 = function(dir, input, encode) {
return input ? Plugin[dir](input, encode) : dir ? null : this;
};
Plugin.btoa = Plugin.encode = function(plain, utf8encode) {
plain = Plugin.raw === false || Plugin.utf8encode || utf8encode ? UTF8.encode(plain) : plain;
plain = code(plain, false, r256, b64, 8, 6);
return plain + '===='.slice((plain.length % 4) || 4);
};
Plugin.atob = Plugin.decode = function(coded, utf8decode) {
coded = String(coded).split('=');
var i = coded.length;
do {--i;
coded[i] = code(coded[i], true, r64, a256, 6, 8);
} while (i > 0);
coded = coded.join('');
return Plugin.raw === false || Plugin.utf8decode || utf8decode ? UTF8.decode(coded) : coded;
};
}(jQuery));
Loading…
Cancel
Save