/**
 * Created by Administrator on 2021/4/5.
 */
define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
    //数据存储
    var module = {
        data: {

        },
    };
    var tools = new Tools();

    module.init = function (page) {
        var tabs = $('.tab').find('li');
        var tabsSecond = $('.tabSecond').find('li');
        var assets = $('.assets_table').find('a');
        var informationBox = $("#information_box > div");
        tabs.on('click', function (e) {

            e.preventDefault();//防止打开链接

            var index = $(this).data('index');

            $('.tabSecond').css("display",'none');

            if(index == 1 || index == 10){
                $('.tabSecond').css("display",'block');
            }

            tabs.removeClass('active');

            tabsSecond.removeClass('active');

            informationBox.css("display",'none');

            $(this).addClass('active');

            $('#'+index).css("display",'block')

            $($(".tabSecond").children("li").get(0)).addClass('active');
        });

        tabsSecond.on('click', function (e) {

            e.preventDefault();//防止打开链接

            var index = $(this).data('index');

            console.log(index)

            tabsSecond.removeClass('active');

            informationBox.css("display",'none');

            $(this).addClass('active');

            $('#'+index).css("display",'block')

        });

        assets.on('click', function (e) {

            e.preventDefault();//防止打开链接

            var index = $(this).data('index');

            console.log(index)

            informationBox.css("display",'none');

            $('#'+index).css("display",'block')

        });
    };


    return module;
});