0
0
Files
Babyclass/resources/views/index/location.blade.php
2020-08-04 10:17:22 +08:00

107 lines
4.0 KiB
PHP

@extends('layouts.app')
@section('content')
<!-- 搜索 Start -->
<div class="home_top" >
<div class="home_search">
<form action="{{ route('index.getlocation') }}" method="get" accept-charset="utf-8">
<input type="text" name="title" value="" placeholder="请输入城市名称" class="input home_search_input">
<button type="button" class="btn home_search_btn"><i class="icon-search"></i></button>
</form>
</div>
</div>
<!-- 搜索 End -->
<!-- 选择区县 Start -->
<div class="location_region">
<div class="location_now text-nowrap ajax-get" data-href="{{ route('index.getlocation',['area'=>$real_area,'city'=>$real_area->name??'','callback'=>Request::input('callback')]) }}">当前地区:<i class="icon-map-marker" style="color: #39a6ad"></i>&nbsp;{{ $real_area->name }}</div>
</div>
<!-- 选择区县 End -->
<!-- 选择区县 Start -->
<div class="location_region">
<div class="location_now text-nowrap ajax-get" data-href="{{ route('index.getlocation',['area'=>$area,'city'=>$area->name??'','callback'=>Request::input('callback')]) }}">选择地区:{{ $area->name }}</div>
<div class="location_change">切换区县&nbsp;<i class="meet-i icon-angle-down"></i></div>
<ul class="location_change_list">
@foreach($lists as $value)
<li class="@if($value->id==$area->id) current @endif text-nowrap ajax-get" data-href="{{ route('index.getlocation',['area'=>$value,'city'=>$value->name,'callback'=>Request::input('callback')]) }}">{{ $value->name }}</li>
@endforeach
</ul>
</div>
<!-- 选择区县 End -->
<!-- 最近访问 Start -->
<div class="lately">
<div class="lately_title">定位/最近访问</div>
<ul class="lately_list">
@if($historys)
@foreach($historys as $history)
<li class="text-nowrap ajax-get" data-href="{{ route('index.getlocation',['area'=>$history,'city'=>$history->name,'callback'=>Request::input('callback')]) }}">{{ $history->name }}</li>
@endforeach
@else
<li class="text-nowrap" data-href=""></li>
@endif
</ul>
</div>
<!-- 最近访问 End -->
<!-- 热门城市 Start -->
<div class="lately" style="padding-top: 0">
<div class="lately_title">热门城市</div>
<ul class="lately_list">
@if(!$hots->isEmpty())
@foreach($hots as $hot)
<li class="text-nowrap ajax-get" data-href="{{ route('index.getlocation',['area'=>$hot,'city'=>$hot->name,'callback'=>Request::input('callback')]) }}">{{ $hot->name }}</li>
@endforeach
@endif
</ul>
</div>
<!-- 热门城市 End -->
<!-- 选择城市 Start -->
@if(!$all_list->isEmpty())
@php $first = 'a'; @endphp
<!-- <div class="letter_key">A</div> -->
<ul class="city_choose">
@foreach($all_list as $area)
<li class="ajax-get" data-href="{{ route('index.getlocation',['area'=>$area,'city'=>$area->name,'callback'=>Request::input('callback')]) }}">{{ $area->name }}</li>
@if($area->name_first_char!=$first)
@php $first = $area->name_first_char; @endphp
</ul>
<!-- <div class="letter_key">{{ $area->name_first_char }}</div> -->
<ul class="city_choose">
@endif
@endforeach
</ul>
@endif
<!-- 选择城市 End -->
@endsection
@section('script')
<script type="text/javascript">
//展开选择区县
$(".location_change").on("click",function(){
var me = $(this),
atr = me.attr("abc");
if(atr == 1){
$(this).parent().removeClass("location_show");
$(this).parent().addClass("location_hidden");
me.attr("abc",0);
$(this).parent().find('.meet-i').removeClass("icon-angle-up");
$(this).parent().find('.meet-i').addClass("icon-angle-down");
}else {
$(this).parent().removeClass("location_hidden");
$(this).parent().addClass("location_show");
me.attr("abc", 1);
$(this).parent().find('.meet-i').removeClass("icon-angle-down");
$(this).parent().find('.meet-i').addClass("icon-angle-up");
}
});
</script>
@endsection