search_salesman_goods.html 6.2 KB
<!DOCTYPE html>
<html lang="en">

<head>
    header('Cache-control:private,must-revalidate');
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>学考无忧-搜索页</title>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <style>
        .se_searchNo input{
            color: white;
            border: 0;
            outline: none;
            font-size: 0.28rem;
            margin-left: 0.16rem;
            background: none;
        }
    </style>
</head>

<body>
<!-- search -->
<div class="search_box">
    <!-- 顶部搜索 -->
    <form action="{:url('Index/search_salesman_goods')}" method="post">
        <div class="se_search">
        <a href="{:url('Index/index')}"><img class="search_left" src="__TMPL__/public/assets/images/25.png" alt=""></a>
            <div class="se_input">
                <img src="__TMPL__/public/assets/images/1.png" alt="">
                    <input type="text" name="book_name" placeholder="请输入搜索内容">
            </div>
            <p class="se_searchNo"><input type="submit" placeholder="搜索" value="搜索"></p>
        </div>
    </form>
    <input type="hidden" name="search_content" value="{$search_content}">
    <!-- 搜索导航 -->
    <div class="se_nav">
        <ul>
            <li class="se_navactvie" onclick="classify_synthesis()">综合</li>
            <li onclick="classify_sales()">销量
                <img src="__TMPL__/public/assets/images/24.png" alt="">
            </li>
            <li onclick="classify_price()">价格
                <img src="__TMPL__/public/assets/images/24.png" alt="">
            </li>
        </ul>
    </div>
    <!-- 搜索内容 -->
    <div class="in_hot_shop se_con">
        <volist name="data_salesman_goods" id="vo">
            <div class="in_hotLi">
                <a href="{:url('Goodsdetails/Goods_details',array('goods_id'=>$vo.id))}">
                    <div class="in_hotImg">
                        <img src="{:cmf_get_image_url($vo.show_img)}" alt="">
                    </div>
                    <div class="in_hotText">
                        <div class="in_hotName txt-cut"><span>{$vo.name}</span>{$vo.book_name}</div>
                        <div class="in_cam_shopPrice">
                            <div class="in_hotPrice1"><span>{$vo.price0}</span>.{$vo.price1}</div>
                            <div class="in_cam_shopY">¥{$vo.pricing}</div>
                        </div>
                    </div>
                </a>
            </div>
        </volist>
    </div>
    <!-- 底部更多 -->
    <div class="in_what">—— 已经到底了哦 ——</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script>
    $('.se_nav ul li').click(function() {
        $(this).addClass('se_navactvie').siblings().removeClass('se_navactvie');
        $(this).addClass('se_navactvie').siblings().children('img').attr('src', '__TMPL__/public/assets/images/s1.png')
        if ($(this).children('img').attr('src') == "__TMPL__/public/assets/images/s1.png") {
            $(this).children('img').attr('src', '__TMPL__/public/assets/images/s2.png')
        } else {
            $(this).children('img').attr('src', '__TMPL__/public/assets/images/s1.png')
        }
    });

    /**
     *销量排序
     */
    function classify_sales(){
        search_content = $("input[name='search_content']").val();
        $.post("{:url('Index/search_sales_order')}",{search_content:search_content},function(data){
            $('.in_hotLi').remove();
            data_arr = JSON.parse(data);
            for(var i=0;i<data_arr.length;i++){
                show_img = data_arr[i].show_img;
                url = "{:url('Goodsdetails/Goods_details')}?goods_id="+data_arr[i].id;
                $('.se_con').append("<div class='in_hotLi'><a href='"+url+"'><div class='in_hotImg'><img src='"+show_img+"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span></span>"+data_arr[i].book_name+"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"+data_arr[i].price0+"</span>."+data_arr[i].price1+"</div></div></div></a></div>");
            }
        });
    }

    /**
     *价格排序
     */
    function classify_price(){
        search_content = $("input[name='search_content']").val();
        $.post("{:url('Index/search_price_order')}",{search_content:search_content},function(data){
            $('.in_hotLi').remove();
            data_arr = JSON.parse(data);
            for(var i=0;i<data_arr.length;i++){
                show_img = data_arr[i].show_img;
                url = "{:url('Goodsdetails/Goods_details')}?goods_id="+data_arr[i].id;
                $('.se_con').append("<div class='in_hotLi'><a href='"+url+"'><div class='in_hotImg'><img src='"+show_img+"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span></span>"+data_arr[i].book_name+"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"+data_arr[i].price0+"</span>."+data_arr[i].price1+"</div></div></div></a></div>");
            }
        });
    }

    /**
     * 点击综合
     */
    function classify_synthesis(){
        search_content = $("input[name='search_content']").val();
        $.post("{:url('Index/search_synthesis_order')}",{search_content:search_content},function(data){
            $('.in_hotLi').remove();
            data_arr = JSON.parse(data);
            for(var i=0;i<data_arr.length;i++){
                show_img = data_arr[i].show_img;
                url = "{:url('Goodsdetails/Goods_details')}?goods_id="+data_arr[i].id;
                $('.se_con').append("<div class='in_hotLi'><a href='"+url+"'><div class='in_hotImg'><img src='"+show_img+"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span></span>"+data_arr[i].book_name+"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"+data_arr[i].price0+"</span>."+data_arr[i].price1+"</div></div></div></a></div>");
            }
        });
    }
</script>
</body>

</html>