重复点击支付

master
tpingzhang 5 years ago
parent 3afd358384
commit 64aba79409

@ -234,10 +234,10 @@ function small_program(status) {
} }
$(function() { $(function() {
$("#wxpay").one('click', function() { var flag = false;
$(this).removeAttr("one", ""); $("#wxpay").on('click', function() {
$("#alipaybtn").removeAttr("one", ""); if (flag) return ;
flag = true;
$r = small_program("{:C('sqpay.wx_small')}"); $r = small_program("{:C('sqpay.wx_small')}");
if ($r) { if ($r) {
window.location.href = $(this).data('url'); window.location.href = $(this).data('url');
@ -257,9 +257,9 @@ $(function() {
window.location.href = url; window.location.href = url;
}); });
$('#alipaybtn').one('click',function() { $('#alipaybtn').on('click',function() {
$(this).removeAttr("one", ""); if (flag) return ;
$("#wxpay").removeAttr("one", ""); flag = true;
var that = $(this),url = $.trim(that.attr('data-url')); var that = $(this),url = $.trim(that.attr('data-url'));
if(that.hasClass('disabledbtn')){return false;} if(that.hasClass('disabledbtn')){return false;}

@ -60,16 +60,16 @@
<script> <script>
$(function(){ $(function(){
var flag = false;
$("#wxpay").one('click', function() { $("#wxpay").on('click', function() {
$(this).removeAttr("one", ""); if (flag) return ;
$("#alipaybtn").removeAttr("one", ""); flag = true;
window.location.href = $(this).data('url'); window.location.href = $(this).data('url');
}); });
$('#alipaybtn').one('click',function() { $('#alipaybtn').on('click',function() {
$(this).removeAttr("one", ""); if (flag) return ;
$("#wxpay").removeAttr("one", ""); flag = true;
var that = $(this),url = $.trim(that.attr('data-url')); var that = $(this),url = $.trim(that.attr('data-url'));
if(that.hasClass('disabledbtn')){return false;} if(that.hasClass('disabledbtn')){return false;}
@ -92,10 +92,14 @@ $(function(){
else { else {
var u = navigator.userAgent; var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
if (isAndroid) if (isAndroid) {
window.txyxsdk.getZFBPay(data.url); window.txyxsdk.getZFBPay(data.url);
else } else {
try {
window.webkit.messageHandlers.noticeAppResult.postMessage(data.url); window.webkit.messageHandlers.noticeAppResult.postMessage(data.url);
} catch(err) {
}
}
} }
} else { } else {
layer.open({ layer.open({

Loading…
Cancel
Save