/**
 * [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 OELike () {
        this.wake()
    }
    
    OELike.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 == 'listen') {
                    $url += "&c=listen&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=fans&a=nopower";
                        window.location.href = $url;
                        return;
                    }
                    else {
                        $url += "&c=fans&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 OELike();
});