zl程序教程

您现在的位置是:首页 >  Javascript

当前栏目

js循环调用接口

2023-04-18 14:53:02 时间
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);
        }
    },
复制代码