<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{eju:global name='web_title' /}_地图找房</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui" />
    <meta name="description" content="{eju:global name='web_description' /}" />
    <meta name="keywords" content="{eju:global name='web_keywords' /}" />
    <link href="{eju:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eju:static file="map/css/public.css" /}
    {eju:static file="map/css/ditu.css" /}
    {eju:static file="map/css/map.css" /}
    {eju:static file="map/css/reset.css" /}
    {eju:static file="map/css/common.css" /}

    {eju:static file="skin/css/format_dom.css" /}
    {eju:static file="skin/css/main.css" /}
    {eju:static file="skin/css/so_map.css" /}

    {eju:static file="map/js/jquery-1.10.2.min.js" /}

    <!--[if IE 6]>
    {eju:static file="map/css/ie6.css" /}
    {eju:static file="map/js/dd_belatedpng_0.0.8a.js" /}
    <script type="text/javascript">
        DD_belatedPNG.fix('*');
    </script>
    <![endif]-->
</head>
<body>
<div id="activitypop" style="display:none"> <a target="_blank" href="#" class="bot-float-520">
    <div class="wrap1200"> <i class="close" id="float-close">×</i> </div>
</a> <a href="#" class="bot-float-slide"></a> </div>

{eju:include file="map/header.htm"/}

<script>
    $(document).ready(function() {
        var isMobile = {
            Android: function() {
                return navigator.userAgent.match(/Android/i) ? true : false;
            },
            BlackBerry: function() {
                return navigator.userAgent.match(/BlackBerry/i) ? true : false;
            },
            iOS: function() {
                return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
            },
            Windows: function() {
                return navigator.userAgent.match(/IEMobile/i) ? true : false;
            },
            any: function() {
                return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
            }
        };
        if( isMobile.any() )
        {
            var path="";
            window.location.href = path;
        }
    });
</script>
<div class="ditu-main map" id="ditumain">
    <div id="jw-map" style="left: 400px;"></div>
    <div class="side-con newtop" id="conselect">
        <div class="search-box">
            <form  id="form-map">
                <div class="clearfix">
                    <div class="search-inp fl" id="searchDiv" style="width:340px;">
                        <input type="text" class="txt-sty" id="keyword" name="keyword" placeholder="输入小区名称"/>
                        <input type="hidden" class="txt-sty" id="orderby" name="orderby" placeholder=""/>
                        <input type="hidden" class="txt-sty" id="orderway" name="orderway" placeholder=""/>
                        <button class="btn-sty search-btn" id="search-map" data-url="{eju:diyurl type='mapxiaoqulist' /}"></button>
                        <div class="search-inp-list" >
                            <ul id="m_newcon_ul">
                            </ul>
                        </div>
                    </div>
                    <div class="subway-search fl pr"></div>
                </div>
                <ul class="search-type clearfix">
                    {eju:screening id='field' addfields='average_price,characteristic,manage_type,fitment,building_type' typeid='10' currentstyle='active' alltxt='off' }
                    {eju:volist name='$field.list' id='vo'}
                    <li>
                        <div class="">
                            <!--<span class="sel-text">{$vo.title}</span>-->
                            <select name="{$vo.name}" id="{$vo.name}" class="select_search">
                                <option value="">{$vo.title}</option>
                                {eju:volist name='$vo.dfvalue' id='vo2'}
                                <option value="{$vo2.id}">{$vo2.name}</option>
                                {/eju:volist}
                            </select>
                        </div>
                    </li>
                    {/eju:volist}
                    {$field.hidden}
                    {/eju:screening}
                </ul>
            </form>
        </div>
        <div class="list-box">
            <div class="list-h clearfix">
                <!--<span class="fl" id="bnum">为您找到<em class="green">0</em>个新盘</span>-->
                <div class="fr clearfix sort" >
                    {eju:orderlist id='field' addfields='average_price' typeid='10' currentstyle='active' upstyle='icon-asc' downstyle='icon-desc' alltxt='默认排序' }
                    {eju:volist name='$field.list' id='vo'}
                    <a href="javascript:;"  class="fl ml30 {$vo.currentstyle} {$vo.classstyle}" data-order="{$vo.name}" data-orderway="asc">{$vo.title}
                        {eju:notempty name='$vo.classstyle'}
                        <i></i>
                        {/eju:notempty}
                    </a>
                    {/eju:volist}
                    {$field.hidden}
                    {/eju:orderlist}
                </div>
            </div>
            <div class="list-con" id="right_map_content">
                <ul class="list-lou" id="right_map_ul">

                </ul>
            </div>
            <p class="list-btn" data-status="expand"></p>
        </div>
    </div>
</div>
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak={:config('global.baidu_map_ak')}"></script>
<script type="text/html" id="template">
    {{# for(var i = 0, len = d.length; i < len; i++){ }}
    <li onmouseover="" onmouseout=""  onclick="openInfo('{{d[i].aid}}')">
        <a href="#"  class="clearfix" id="bid_{{d[i].aid}}">
            <div class="img">
                <img src="{{d[i].litpic}}" alt="">
                <em class="shou">{{d[i].sale_status_name}}</em>
            </div>
            <div class="text">
                <p class="mt5 clearfix">
                    <span class="name text-ellip">{{d[i].title}}</span>
                    <span class="unit-pri text-ellip">
                        <em class="orange fz16">{{d[i].average_price}}{{d[i].price_units}}</em>
                    </span>
                </p>
                <p class="mt15 c666">
                    {{# if(d[i].is_discount){ }}
                    <i class="tuan">惠</i>{{d[i].discount}}
                    {{# } }}
                </p>
            </div>
        </a>
    </li>
    {{# } }}
</script>
{eju:static file="map/js/layer.js" /}
{eju:static file="map/js/laytpl.js" /}
{eju:static file="map/js/cate_select_eju.js" /}
{eju:static file="map/js/map_xiaoqu.js" /}
<script type="text/javascript">
    $(function(){
//        $('.J_city_select').cate_select({field:'city',parent_id:'select_city',top_option:'选择区域',id:'J_city_select'});
        var lng = '{$lng}';
        var lat = '{$lat}';
        BMapApplication.init({'lng' : lng, 'lat' : lat, 'mapContainerId' : 'jw-map'});
        BMapApplication.requestUrl = $('#search-map').data('url');
        BMapApplication.requestParam = getParam();
        BMapApplication.getMap();
        //按条件筛选
        $('.search-btn').on('click',function(){
            search();
            return false;
        });
        //筛选
        $('.select_search').on('change',function(){
            search();
        });
        //排序
        $('.sort a').on('click',function(){
            var order = $(this).attr('data-order');
            $(this).addClass('active').siblings('.active').removeClass('active');
            if($(this).hasClass('icon-desc'))
            {
                $(this).removeClass('icon-desc').addClass('icon-asc');
                $(this).attr('data-orderway','asc');
            }else if($(this).hasClass('icon-asc')){
                $(this).removeClass('icon-asc').addClass('icon-desc');
                $(this).attr('data-orderway','desc');
            }
            var orderway = $(this).attr('data-orderway');
            $("#orderby").val(order);
            $("#orderway").val(orderway);

            search()
        });
        function search(){
            BMapApplication.viewArea = true;
            BMapApplication.requestParam = getParam();
            BMapApplication.getData();
            return false;
        }
    });
    function openInfo(aid){
        BMapApplication.makeInfoWindow(aid);
    }
    function getParam()
    {
        var result = $('#form-map').serializeArray();
        var param = {};
        $.each(result, function(i, field){
            param[field.name] = field.value;
        });

        return param;
    }
    $('#select_city').on('change','.J_city_select',function(){
        var city = $(this).val();
        var  url = $('#select_city').data('url');
        var param = {
            city : city
        };
        $.get(url,param,function(result){
            if(result.code == 1)
            {
                BMapApplication.requestParam.city = city;
                BMapApplication.setCenter(result.data.lng,result.data.lat,result.data.name);
                BMapApplication.getData();
            }
        });
    });
</script>
</body>
</html>