/**
 * [OElove Webapp] (C)2010-2099 oelove.com Webapp
 * Email: service@phpcoo.com ,phpcoo@qq.com
 * This is NOT a freeware, use is subject to license terms
 * $ Last update 2020/03/13 by bo $
*/
$(function () {
    function OEVisitme () {
        this.wake()
    }
    
    OEVisitme.prototype = {
        
        //触发
        wake:function() {
            var _this = this;
            
            //切换模块
            $(document).on("click", "[f='switch']", function(){
                $(this).addClass('current').siblings().removeClass('current');
                var $type = $(this).attr("data-type");
                
                var $url = WAP_APPFILE;
                if ($type == 'visit') {
                    $url += "&c=visit&a=list&datatype=json";
                }
                else {
                    
                    var $view_power = $("#view_power").val();
                    if (typeof($view_power) == 'undefined') {
                        $view_power = '0';
                    }
                    if ($view_power == '0') {
                        $url += "&c=visitme&a=nopower";
                        window.location.href = $url;
                        return;
                    }
                    else {
                        $url += "&c=visitme&a=list&datatype=json";
                    }
                }
                if (oeui_cache) {
                    oeui_cache.clearCache();
                }
                
                $('#reqs_url').val($url);
                $('#page').val('1');
                $('#pull_data').html('');
                _inst_oepage.scroll.refresh();
                
            });
            
        }
    }
    new OEVisitme();
});