/**
 * [OEUI] (C)2010-2099 oelove.com Webapp
 * Email: service@phpcoo.com ,phpcoo@qq.com
 * $ Last update 2021/04/19 by CL $
*/
$(function () {
    
    //婚况声明
    function OEStatement() {
        this.rplogsn = null;
        
        this.init();
    }
    OEStatement.prototype = {
        
        //初始化
        init:function() {
            var _this = this;
            _this.rplogsn = $("#rplogsn").val();
            
            setTimeout(function(){
                _this.sendQuery();
            }, 200);
        },
        
        //发起查询
        sendQuery:function() {
            var _this = this;
            
            var loading = null;
            var timer = setTimeout(function () {
                loading = OEUI.showLoading({
                    type:2
                });
            }, 200);
            
            $.ajax({
                type: "POST",
                url: _ROOT_PATH+'index.php',
                cache: false,
                data: {
                    c:'rpzy', a:'querystatement', rplogsn:_this.rplogsn
                },
                dataType: "json",
                success: function(data) {
                    var response = data.response;
                    var result = data.result;
                    
                    clearTimeout(timer);
                    loading && loading.hideLoading();
                    timer = null;
                    
                    if (response == '1') {
                        setTimeout(function(){
                            window.location.reload();
                        }, 800);
                    }
                },
                error: function() {
                    clearTimeout(timer);
                    loading && loading.hideLoading();
                    timer = null;
                }
            });
        } 
    }
    new OEStatement();
});
