Commit 145e70d9 by 冷斌

fix bug

parent 9d012045
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
ui.error("购买必须同意《{$site['site_keyword']}购买协议》") ui.error("购买必须同意《{$site['site_keyword']}购买协议》")
return return
} }
var s = 0;
$.ajax({ $.ajax({
url: "{:U('classroom/Pay/buyGoods')}", url: "{:U('classroom/Pay/buyGoods')}",
data: { data: {
...@@ -138,12 +139,39 @@ ...@@ -138,12 +139,39 @@
}, },
async:false, async:false,
type:'post', type:'post',
success: function(res) { success: function(data) {
console.log(res) if(data.status == 1) {
if(res.status == 1) { var pay_pass_num = data.data.pay_pass_num;
WeixinJSBridge.invoke(
'getBrandWCPayRequest',JSON.parse(data.data.html),
function(res){
if(res.err_msg == "get_brand_wcpay_request:ok" ){
s = setInterval(function(){
$.ajax({
url: "{:U('classroom/Pay/getPayStatus')}",
data:{pay_pass_num:pay_pass_num},
type:'post',
success: function(res){
try{
res = JSON.parse(res);
if(res.status == 1){
clearInterval(s);
ui.success('购买成功');
setTimeout(function(){
window.location.href = res.data;
},1500);
}
}catch(e){
return;
}
}
});
},1800);
}
}
);
} else { } else {
ui.error(res.info ? res.info : res.data) ui.error(data.info ? data.info : data.data)
} }
} }
}) })
......
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