@@ -265,17 +265,23 @@
defaultInit();
function closeWindow() {
+ $(".payment_window").hide();
+ $(".payment_model").hide();
+ }
+ function showWindow(msg) {
-
+ $(".payment_window").show();
+ $(".payment_model").show();
+ $(".payment_window_img").children().next().text(msg);
}
$(".payment_window_close").click(function() {
- $(".payment_window").hide();
+ closeWindow();
});
$(".payment_window_confirm").click(function() {
- $(".payment_window").hide();
+ closeWindow();
});
$(".select_pay_info").click(function(){
@@ -289,6 +295,8 @@
$(this).siblings(".payment_rest_way").children("img").attr("src","__IMG__/pay_way/dagou1.png");
var img=$(this).children("div").children("img").attr("src");
var text = $(this).children("div").children("span").text();
+ //获取支付参数
+ if (payway == $(this).data("type")) return ;
//获取支付参数
payway = $(this).data("type");
payurl = $(this).data("url");
@@ -333,10 +341,13 @@
flag = false;
if (r.code == 200) {
window.location.href = r.url;
+ } else if(r.code == 1001) {
+ showWindow(r.msg);
} else {
- $(".tipmsg").html(result.msg);
- $(".msgdialog").show();
+ $(".tipmsg").html(r.msg);
+ $(".msgdialog").show();
}
+
}
});
@@ -373,9 +384,11 @@
}
}
}
- } else {
+ } else if(result.code == 1001) {
+ showWindow(result.msg);
+ }else {
$(".tipmsg").html(result.msg);
- $(".msgdialog").show();
+ $(".msgdialog").show();
}
}
});
@@ -393,9 +406,11 @@
flag = false;
if (r.code == 200) {
window.location.href = r.url;
+ } else if(r.code == 1001) {
+ showWindow(r.msg);
} else {
- $(".tipmsg").html(result.msg);
- $(".msgdialog").show();
+ $(".tipmsg").html(r.msg);
+ $(".msgdialog").show();
}
}
@@ -407,8 +422,37 @@
//快捷支付
function sqshorcut(){
+
+
+ var url = payurl;
flag = false;
- window.location.href =payurl;
+ $.ajax({
+ type:'post',
+ dataType:'json',
+ data:{sign: 1},
+ url:url,
+ success:function(result) {
+ if(result.code==200) {
+ window.location.href = url;
+ } else if(result.code==1001){
+ flag=false;
+ showWindow(result.msg);
+ } else {
+ flag=false;
+ $(".tipmsg").html(result.msg);
+ $(".msgdialog").show();
+ }
+ },
+ error:function(){
+ flag=false;
+ $(".tipmsg").html("接口请求错误");
+ $(".msgdialog").show();
+ }
+ });
+ return false;
+
+ // flag = false;
+ // window.location.href =payurl;
}
$(".payment_rest_btn").click(function(){
$(".payment_rest_btn").hide();