~~~
$.post(posturl,postdata,function(res){
if(res.type == -1){
layer.msg(res.data);
}else{
if(pay_type.indexOf('xin_paywx') == 0||pay_type.indexOf('xin_payqq') == 0){
location.href = "/api/xinpay/index?bpprice="+res.bpprice+"&paytype="+res.paytype+"&uid="+res.uid+"&bpid="+res.bpid;
}
if(pay_type=='paywx'){
location.href = res;
}
}
}
~~~