default.html 9.1 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{block name='title'}{$title['title']}{/block}</title>
    <link rel="stylesheet" href="/statis/bootstrap/bootstrap.min.css">
    <link rel="stylesheet" href="/statis/css/base.css">
    <link rel="stylesheet" href="/statis/css/index.css">
    <link rel="stylesheet" href="/statis/css/public.css">
    <link rel="stylesheet" href="/statis/css/swiper.min.css">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=d6PnuoA0EWXbee3HpVP84MT2GsflcVQk"></script>
    <script src="/statis/js/swiper.min.js"></script>
    <script src="/statis/js/jquery.js"></script>
    <script src="/statis/js/include.js"></script>
    <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    {block name="style"}

    {/block}
</head>

<body>
<div class="indexBox">
    <!-- 顶部 -->
    <div class="top_bg">
        <div class="top_width">
            <!-- 最上面 -->
            <div class="top_item clearfix">
                <div class="top_itemL clearfix">
                    <img class="top_itemImg" src="/statis/image/gonggao_img.png" alt="">
                    <div class="top_itemTxt">公告:<a id="demo1" href="/index/gg/detail?id={$titlegg[0]['id']}&style=1">{$titlegg[0]["title"]}</a><a id="demo2"
                            href="/index/gg/detail?id={$titlegg[0]['id']}&style=1"></a></div>
                </div>
                <div class="top_itemR">
                    <span><a href="/index/index/contactMe">联系我们</a></span>|
                    <span><a href="/index/release/index">发布留言</a></span>|
                    <span>添加收藏</span>
                </div>
            </div>
            <!-- 第二部分 -->
            <div class="top_item2 clearfix">
                <div class="top_item2L clearfix">
                    <!-- logo -->
                    <div class="top_item2Img"><img src="{$logo}" alt=""></div>
                    <div class="top_item2Box">
                        <h2>中关村国联绿色产业服务创新联盟</h2>
                        <p>Zhongguancun Green Industry Alliance</p>
                    </div>
                </div>
                <div class="top_item2R clearfix" style="{:session('login')?'display:none':''}">
                    <form id="formLog" class="top_item2Form">
                        <div class="top_formLi">
                            <label for="">帐号:</label>
                            <input type="hidden" name="location" id="location2">
                            <input type="text" name="tel">
                        </div>
                        <div class="top_formLi">
                            <label for="">密码:</label>
                            <input type="text" name="user_password">
                        </div>
                    </form>
                    <div class="top_item2Box2" >
                        <div class="top_item2Box3 clearfix">
                            <div class="top_item2_Txt login">会员登录</div>
                            <div class="top_item2_img"><img src="/statis/image/qq_icon.png" alt=""></div>
                            <div class="top_item2_img"><img src="/statis/image/weixin_icon.png" alt=""></div>
                        </div>
                        <div class="top_item2Box4">
                            <a href="/index/login/register">新用户注册</a>
                            <a href="/index/login/password">密码找回</a>
                        </div>
                    </div>
                </div>
                <div class="top_item2R" style="{:session('login')?'':'display:none'}">
                    <div class="top_item2Box5 clearfix">
                        <a href="/index/index/personal">
                            <div class="top_item2Img2"><img src="{:session('user')['image']==''?'/statis/image/touxiang_imh.png':session('user')['image']}" alt=""></div>
                            <div class="top_item2Box6">
                                <div class="top_item2Name one-txt-cut">{:session('user')['user_name']}</div>
                                <div class="top_item2Area one-txt-cut" id="location">天津</div>
                            </div>
                        </a>
                        <a href="/index/gg/index?style=3"><div class="top_item2News">消息<span>({$nums})</span></div></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 导航 -->
    <div class="nav">
        <div class="nav_width">
            <div class="nav_imag">
                <a href="/">
                    <img src="/statis/image/zhuye_icon.png" alt="">
                </a>
            </div>
            <div class="nav_List">
                <ul>
                    {foreach $menu as $v }
                        <li data-id="{$v.id}" data-url="{$v.url}">
                            <a href="{$v.url}?pid={$v.id}" onmouseover="move('{$v.id}','{$v.url}',this)">
                                <div  class="nav_Txt one-txt-cut">{$v.title}</div>
                            </a>
                            <div class="nav_down">
                            </div>
                        </li>
                    {/foreach}
                </ul>
            </div>
        </div>
    </div>
    {block name="content"}
    {/block}
    <!-- footer -->
    <footer class="footer">
        <div class="footer_top">
            <div class="footer_width">
                <div class="footer_Txt">
                    |{foreach $menu as $v }
                    <a href="{$v.url}?pid={$v.id}">
                        <span>{$v.title}</span>|
                    </a>
                    {/foreach}
                </div>
                <p class="footer_Txt2">版权所有:<span>中关村国联绿色产业服务创新联盟</span></p>
                <p class="footer_Txt2">北京市大兴区同济中路甲7号院</p>
                <p class="footer_Txt2">京ICP备05052419号</p>
            </div>
        </div>
        <div class="footer_bot"></div>
    </footer>
    <script>
        $("#location").html(returnCitySN["cname"]);
        $("#location1").html(returnCitySN["cname"]);
        $("#location2").val(returnCitySN["cname"]);
    </script>
</div>

</body>

</html>
<script>
    $(".login").on("click",function () {
        var data=$("#formLog").serialize();
        ajax("/index/login/login",data,"post",function (res) {
            w(res.msg);
            if(res.code==200){
                setTimeout(function () {
                    location.href="/index/index/index";
                },500)
            }
        },"false");
    })
    function move(id,href,e) {
        var data={'id':id};
        ajax("/index/index/menu",data,"post",function (res) {
            if(res.msg!=""){
                console.log(1212);
                var msg=res.msg;
                var html='';
                for(var i=0;i<msg.length;i++){
                    var href1=href+"?pid="+msg[i].id;
                    html+='<div class="nav_Txt2">'+
                        '   <a class="one-txt-cut" href="'+href1+'">'+msg[i].title+'</a>'+
                        '</div>'+
                        ''+
                        '';
                }
                $(e).parent().find(".nav_down").html(html);
            }
        },"false");
    }
    $('.nav_List ul li').mouseover(function() {
        console.log($(this));
        // move($(this).data("id"),$(this).data("url"),this);
        $(this).find('.nav_down').stop().slideDown(300).parents('li').siblings().find('.nav_down').stop().slideUp(300);
    }).mouseout(function() {
        $(this).find('.nav_down').stop().slideUp(300);
    })

    var container = document.getElementsByClassName("top_itemTxt")[0];
        main = document.getElementById('demo1'),
        ext = document.getElementById('demo2');
    var div,span,span2,i,timer;
    function init(){
        setInterval(ttb,50);
    }
    function ttb(){
        div = getId('container');
        span = getId('main');
        span2 = getId('ext');

        ext.innerHTML = main.innerHTML;
        if(main.offsetWidth <= container.scrollLeft){
            container.scrollLeft -= main.offsetWidth;

        }
        else {
            container.scrollLeft++;
        }

    }
    function getId(Id){
        return document.getElementById(Id);
    }
    window.onload = init();
    // var container = document.getElementsByClassName("top_itemTxt")[0];
    //     main = document.getElementById('demo1'),
    //     ext = document.getElementById('demo2');
    // ext.innerHTML = main.innerHTML;
    // function move() {
    //     container.scrollLeft++;
    //     if (container.scrollLeft >= main.scrollWidth) {
    //         container.scrollLeft = 0;
    //     }else {
    //     }
    // }
    // var timer = window.setInterval(move,10);
    // container.onmouseover = function(){
    //     window.clearInterval(timer);
    // }
    // container.onmouseout = function(){
    //     timer = window.setInterval(move,10);
    // }
</script>