product.html 8.0 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>产品中心</title>

    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <style>
        .ce1_2,.ce1_3{
            display: none;
        }
    </style>
</head>
<body>
    <div class="aside">


    </div>
    <include file="public@nav"/>
    <div class="product_main">
        <div class="prp_tit">
            <a href="">首页</a>
            <img src="__TMPL__/public/assets/images/aicon09.png" alt="">
            <a href="">产品中心</a>
            <!--<img src="img/aicon09.png" alt="">-->
            <!--<a href="">诊断产品</a>-->
        </div>
        <div class="product_mainBox" style="margin-top: 10px">

            <div class="pro_left">
                <!-- <h1 class="proTitle" onclick="chanpin()">产品中心</h1> -->
            <volist name="shuju" id="vol">
                <div class="ce1">
                    <div class="ce1_title ce{$vol.id}" onclick="erji({$vol.id})">
                        <img src="__TMPL__/public/assets/images/aicon09.png" alt="">
                        <h2>{$vol.name}</h2>
                    </div>
                    <div class="ce1_2" style="margin-top: 28px;">
                        <volist name="$vol.son" id="vo">
                            <div class="ce1_2_Ul">
                                <div class="ce1_2_Li_title ce1{$vo.id}" onclick="neiro({$vo.id})" >

                                    <h3>{$vo.name}</h3>
                                </div>
                             <!--    <div class="ce1_3 tj{$vo.id}">


                             </div> -->

                            </div>
                        </volist>

                    </div>
                </div>
            </volist>




            </div>

            <div class="pro_right">
                <div class="pro_right_tit">
                    <!-- <p class="biaoti">{$zuixin.post_title}</p> -->
                    <p class="zhaiyao"> {$zuixin.post_excerpt}</p>
                </div>
                <!-- <img class="pro_rightImg" src="__TMPL__/public/assets/images/aicon12.png" alt=""> -->
                <div class="pro_right_txt pro_height">
               {$zuixin.post_content}
                </div>

                <!-- <div class='pro_btn'>显示更多</div> -->

            </div>
        </div>
    </div>

    <include file="public@footer" />


    <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.js"></script>
    <script>

    //点击查询类下的所有文章
   /*     function dianji(id){

           cunza = $('div').hasClass('cel'+id);

           if(cunza){
                $('.cel'+id).remove();
           }else{
                 $.post("{:url('Product/wenzhang')}", {id:id}, function(data) {
                                $shuju = JSON.parse(data);
                                for (var i = 0; i < $shuju.length; i++) {
                                    $('.tj'+id).append("<div class='cel_3_Li cel"+id+"' onclick='neiro("+$shuju[i].id+")'><h4>"+$shuju[i].post_title+"</h4><img src='__TMPL__/public/assets/images/aicon03.png' alt=''></div>");
                                }
                            });
           }
        }*/

        $('.pro_btn').click(function(){
                    $('.pro_right_txt').removeClass('pro_height');
                })




        //点击产品中心
        function chanpin(){

            $('.ce1_title').children('h2').css({color:""});
            $('.ce1_2_Li_title').children('h3').css({color:""});

            $.post("{:url('Product/chanpins')}", function(data) {
                shuju = JSON.parse(data);
                $('.biaoti').text(shuju.post_title);
                $('.zhaiyao').text(shuju.post_excerpt);
                $('.pro_right_txt').html(shuju.post_content);
            });

        }

        //点击二级分类
        function erji(id){

            $('.ce1_title').children('h2').css({color:""});
            $('.ce1_2_Li_title').children('h3').css({color:""});
            $('.ce'+id).children('h2').css({color:"red"});
            $.post("{:url('Product/erji')}",{id:id},function(data){
                shuju = JSON.parse(data);
                $('.biaoti').text(shuju.post_title);
                $('.zhaiyao').text(shuju.post_excerpt);
                $('.pro_right_txt').html(shuju.post_content);
            });

        }


    //点击查询单个文章
    function neiro(id){
        $('.ce1_title').children('h2').css({color:''});
        $('.ce1_2_Li_title').children('h3').css({color:''});
        $('.ce1'+id).children('h3').css({color:'red'});
        $.post("{:url('Product/danwz')}", {id:id}, function(data) {
            shuju = JSON.parse(data);
            $('.biaoti').text(shuju.post_title);
            $('.zhaiyao').text(shuju.post_excerpt);
            $('.pro_right_txt').html(shuju.post_content);
            /*$('.pro_btn').remove();
            $('.pro_right_txt').after("<div class='pro_btn'>显示更多</div>");*/
            $('.aside_son').remove();
            $.post("{:url('Product/commps')}", {id:id}, function(data) {
                coa = JSON.parse(data);
                for (var i = 0; i <coa.length; i++) {
                    if(coa[i].fenlei == 1){
                        $('.aside').append("<a href='{:url('Product/commp')}?id="+coa[i].id+"' class='aside_son'><div class='aside_1'><img src='__TMPL__/public/assets/images/aicon13.png'><p>说明书</p></div></a>");
                    }
                    if(coa[i].fenlei == 2){
                        $('.aside').append("<a href='{:url('Product/commp')}?id="+coa[i].id+"' class='aside_son'><div class='aside_1'><img src='__TMPL__/public/assets/images/aicon14.png'><p>文献</p></div></a>");
                    }
                    if(coa[i].fenlei == 3){
                        $('.aside').append("<a href='{:url('Product/commp')}?id="+coa[i].id+"' class='aside_son'><div class='aside_1'><img src='__TMPL__/public/assets/images/aicon15.png'><p>COA</p></div></a>");
                    }

                }
            });




        });
    }

    //跳转到详细页面
    function tiaozhuan(id){
        window.location.href = "{:url('Product/details')}?id="+id;
    }
    </script>
    <script>
        // 头部下拉
        $('.header2_box>ul>li').each(function () {
            $(this).mouseover(function () {
                $(this).children('.header2_box2').show();
            }).mouseout(function () {
                $(this).children('.header2_box2').hide();
            })
        });

        //左侧列表下拉
        $('.ce1_title').each(function () {
            $(this).click(function () {
                if($(this).children('img').attr('src') == "__TMPL__/public/assets/images/aicon09.png"){
                    $(this).children('img').attr('src','__TMPL__/public/assets/images/aicon10.png')
                    $(this).next('.ce1_2').slideToggle();
                }else {
                    $(this).children('img').attr('src','__TMPL__/public/assets/images/aicon09.png');
                    $(this).next('.ce1_2').slideToggle();
                }
            })
        });
        $('.ce1_2_Li_title').each(function () {
            $(this).click(function () {
                if($(this).children('img').attr('src') == "__TMPL__/public/assets/images/aicon09.png"){
                    $(this).children('img').attr('src','__TMPL__/public/assets/images/aicon10.png')
                    $(this).next('.ce1_3').slideToggle();
                }else {
                    $(this).children('img').attr('src','__TMPL__/public/assets/images/aicon09.png');
                    $(this).next('.ce1_3').slideToggle();
                }
            })
        })
        $('.cel_3_Li').each(function () {
            $(this).click(function () {
                $(this).addClass('cel_3_Li_act').siblings().removeClass('cel_3_Li_act');
            })
        })
    </script>
</body>
</html>