Commit 12d5c8d0 by 冷斌

fix bug

parent 82c614ae
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
}); });
} }
if(that.agree) { if(that.agree) {
var s = 0;
$.ajax({ $.ajax({
url: "{:U('course/PayVideo/payLibraryExams')}", url: "{:U('course/PayVideo/payLibraryExams')}",
data: { data: {
...@@ -85,9 +86,38 @@ ...@@ -85,9 +86,38 @@
async:false, async:false,
type:'post', type:'post',
success: function(data){ success: function(data){
let res = JSON.parse(data) let res2 = JSON.parse(data);
if(res.status == 1) { clearInterval(s);
if(res2.status == 1) {
var pay_pass_num = res2.data.pay_pass_num;
WeixinJSBridge.invoke(
'getBrandWCPayRequest',JSON.parse(res2.data.html),
function(res){
if(res.err_msg == "get_brand_wcpay_request:ok" ){
s = setInterval(function(){
$.ajax({
url: "{:U('course/PayVideo/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.data) ui.error(res.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