0
点赞
收藏
分享

微信扫一扫

js循环调用接口



longPolling: function()
{
var _this = this;
var obj = {
passport: _this.params.passport,
};


if(!_this.params.messagelock){
Pub.post('/admin/vip.new.message', Pub.postParams(obj), function(response){
if(response.code === 0){


/* $('#alertContent').html('有新的消息');
$('#winpop').modal('show');*/

_this.params.messagelock =false;

if(response.data.recharge_record != 0 || response.data.transfer_record != 0 || response.data.withdrawal_record != 0){
_this.params.message = response.data;
_this.playsound();
_this.titleBlink();
setTimeout(function(){
_this.longPolling();
},60*1000);
}else {
document.title=_this.params.myTitle;
setTimeout(function(){
_this.longPolling();
},20000);
}

}else{
setTimeout(function(){
_this.longPolling();
_this.params.messagelock =true;
},20000);

}
});
}else {

setTimeout(function(){
_this.params.messagelock =true;
_this.longPolling();
},60*1000);
}
},


举报

相关推荐

0 条评论