@extends('theme::template2')


@section('banner')
	<div class="nbanner" {{ inject('visual')->url('ad', 4) }} data-position-top="80px">
		<img src="{{ inject('ad')->single(4, 1, 'img') }}" alt="{{ inject('ad')->single(4, 1, 'title') }}">
	</div>
@stop

@section('anchor')
<div id="anchor">
	<div class="max-all clearfix">
		<span class="anchor">
			<a href="{{ url('/') }}">{{ inject('setting')->langs('system', 'home') }}</a> > 
			<a href="{{ url('/product') }}">{{ inject('setting')->langs('web', 'product') }}</a>
		</span>
	</div>
</div>
@stop

@section('left')
<div class="hidden-xs hidden-sm">
	<h3 class="left-title">{{ inject('setting')->langs('web', 'product') }}<i class="visible-xs iconfont icon-zhankai"></i></h3>
	 <ul class="p_c_content mb-20" {{ inject('visual')->url('product-cate') }}>
		@foreach (inject('category')->cate() as $value)
			<li>
                <div class="p_c_title1">
                    <a href="{{ $value->present()->url }}" title="{{ $value->description->cname }}">
                        <span>{{ $value->description->cname }}</span>
                    </a>
                     @if(!$value->children->isEmpty())
                    <span class="p_arrbtm"></span>
                    @endif
                </div>
		
                @if(!$value->children->isEmpty())
                <ul class="deep-2">
                    @foreach ($value->children as $val)
                        <li>
                            <div class="p_c_title2">
                                <a href="{{ $val->present()->url }}"><span>{{ $val->description->cname }}</span></a>
                            </div>
                        </li>
                    @endforeach
                </ul>
				@endif
			</li>
		@endforeach
	</ul>
</div>


<div class="page-wrap-left xymob-menu-click">
    <div class="xymob-left-close-btn"><i class="icon-font icon-close"></i></div>
    <div class="xypg-left">
        <div class="xypg-left-box xypg-left-menu">
            <div class="xypg-left-title">
                <h3>{{ inject('setting')->langs('web', 'product') }}</h3>
            </div>
            <div class="xypg-left-con">
                <ul class="xypg-left-nav" {{ inject('visual')->url('product-cate') }}>
					@foreach (inject('category')->cate() as $value)
                    <li>
                        <a href="{{ $value->present()->url }}">{{ $value->cname }}</a>
                        <div class="first-nav-btn"></div>
						@if(!$value->children->isEmpty())
						<ul class="xypg-left-subnav">
							@foreach ($value->children as $val)
							<li><a href="{{ $val->present()->url }}">{{ $val->cname }}</a></li>
							@endforeach
						</ul>
						@endif
                    </li>
					@endforeach
                </ul>
            </div>
        </div>
        
    </div>
</div>

<div class="page-mob-tool">
    <ul>
        <li class="xymob-page-navbtn"><span></span></li>
        <li class="xymob-page-backtop"><i class="icon-font icon-top"></i></li>
    </ul>
</div>


@include('theme::common.left_side')
@include('theme::common.inquiry')
@endsection

@section('right')
	<?php $products = inject('list')->lists('product', 0, inject('setting')->config('product_paginate') ?: 6, 1)  ?>
	@if(!$products->isEmpty())
    <div class="poorder hidden">
      <dl class="tab-list">
        <dt>{{ inject('setting')->langs('system', 'views') }}&nbsp;&nbsp;</dt>
        <dd class="list"><span id="ert"></span></dd>&nbsp;
        <dd class="list1"><span id="uioi"></span></dd>
      </dl>
    </div>
		<div class="product-list" {{ inject('visual')->url('product') }}>

			<ul class="x-product-list">
                @foreach ($products as $value)
                <li>
                    <a href="{{ $value->present()->url }}" title="{{ $value->description->title or '' }}">
                        <div class="img com-img">
                            <img src="{{ $value->description->present()->image('800*800') }}">
                        </div>
                        <div class="txt">
                            <h3 class="tit clamp2">{{ $value->description->title or '' }}</h3>
                            <p class="pp">{{ $value->description->summary or '' }}</p>
                            <div class="lemore"><span>{!! inject('block')->block('learn-more', 'title') !!}</span></div>
                        </div>
                    </a>
                </li>
                @endforeach
            </ul>

		</div>
		@if(!empty($products->render()))
		<div class="page-content clearfix">
			<div class="page-left pull-left">{{ inject('setting')->langs('system', 'gong') }}{{ $products->total() }}, {{ inject('setting')->langs('system', 'meiye') }}：{!! $products->perPage() !!}{{ inject('setting')->langs('system', 'tiao') }}</div>
			<div class="pull-right">{!! $products->render() !!}</div>
		</div>
		@endif
	@else
		<div class="no-information">{{ inject('setting')->langs('system', 'no_information') }}</div>
	@endif


@endsection

@section('foot')
  <script>
      $('.product-list a.more').click(function (){
          let id = $(this).data('id')
              title = $(this).data('title')
              img = $(this).data('img')
              summary = $(this).data('summary')
          let modal = $('#inquiry-dialog-modal')
          modal.find('input[name="product_id"]').val(id)
          modal.find('.message-product img').attr('src', img)
          modal.find('.message-product-title').html(title)
          modal.find('.message-product-summary').html(summary)
          modal.find('input[name="subject"]').val(title)
          modal.modal('show')
      })

      if (!getCookie('prolist')) {
          toggleClass("{{ inject('setting')->config('product_display') }}")
      }

      $(".left-title i").click(function () {
          $(".product-cate").slideToggle()
          $(this).toggleClass("close");
      })
  </script>
@stop