@extends('theme::template')

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


@section('anchor')
<div id="anchor">
	<div class="container-fluid">
		<span class="anchor clearfix">
			<a href="{{ url('/') }}">{{ inject('setting')->langs('system', 'home') }}</a> > 
			{{ $root->description->cname or '' }} > 
			<a href="{{ $page->linkurl ?: url('/page/'.$page->slug . '.html') }}">{{ $page->description->title or '' }}</a>
		</span>
	</div>
</div>
@stop

@section('left')
<div class="hidden-xs hidden-sm">
	<h3 class="left-title">{{ $root->description->cname or '' }}</h3>
	<div class="edge">
		<div class="edge-inside"></div>
	</div>
	<ul class="cate-list" {{ inject('visual')->url('page-cate') }}>
		@foreach ($cateList as $value)
		<a class="list-title {{ $value->slug == $page->slug ? 'active' : ''}}" href="{{ $value->present()->url('page') }}" title="{{ $value->description->title or '' }}" alt="{{ $value->description->title or '' }}">
			{{ $value->description->title or '' }}
		</a>
		@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>{{ $root->description->cname or '' }}</h3>
            </div>
            <div class="xypg-left-con">
                <ul class="xypg-left-nav" {{ inject('visual')->url('page-cate') }}>
					@foreach ($cateList as $value)
                    <li>
                        <a href="{{ $value->present()->url('page') }}" title="{{ $value->description->title or '' }}">{{ $value->description->title or '' }}</a>
                    </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')
@stop

@section('right')

@if($page->id == 1)

<div class="content mt-20"  style="border: none;" {{ inject('visual')->url('page', $page) }}>
	{!! contentTag($page->description->content) !!}
</div>


<div class="contact2 wow fadeInUp">
	<div class="contact2-con">
		<h2 class="text-center fz-36 text-uppcase mb-30">{{ inject('setting')->langs('system', 'message') }}</h2>
		<div class="contact2-message">
			{!! Form::open(['route' => 'message.store', 'class'=>'form-horizontal mt-20 form-submit', 'novalidate' => true]) !!}
			<div class="clearfix">
				<div class="mb-20 col-md-6 pl-10 pr-10">
					<div class="form-input">
						{!! Form::text('subject', '', ['class'=>'form-control len-full subject', 'placeholder'=>inject('setting')->langs('web', 'subject')]) !!}
					</div>
				</div>
				<div class="mb-20 col-md-6 pl-10 pr-10">
					<div class="form-input">
						{!! Form::text('company', '', ['class'=>'form-control len-full company', 'placeholder'=>inject('setting')->langs('web', 'company')]) !!}
					</div>
				</div>
			</div>
			<div class="clearfix">
				<div class="mb-20 col-md-6 pl-10 pr-10">
					<div class="form-input">
						{!! Form::email('email', '', ['class'=>'form-control len-full email', 'placeholder'=>inject('setting')->langs('web', 'email') . '*', 'required' => true]) !!}
						<div class="invalid-feedback">
						{{ inject('setting')->langs('system', 'valid_email') }}
						</div>
					</div>
				</div>
				<div class="mb-20 col-md-6 pl-10 pr-10">
					<div class="form-input">
						{!! Form::text('phone', '', ['class'=>'form-control len-full phone', 'placeholder'=>inject('setting')->langs('web', 'phone')]) !!}
					</div>
				</div>
			</div>
			<div class="mb-20 pl-10 pr-10">
				<div class="form-input">
					{!! Form::textarea('content', '', ['class'=>'form-control len-full content', 'rows'=>8, 'placeholder'=>inject('setting')->langs('web', 'inquiry_tips')]) !!}
				</div>
			</div>
			<div class="clearfix">
				{{-- 人机验证和验证切换渲染html结构 --}}
				@include('theme::common.grecaptcha', ['key' => 'message'])
			</div>
			<div class="mb-15 mt-20 pl-10 text-center">
				<button type="submit" id="subBtn_message" class="btn btn-primary">{{ inject('setting')->langs('system', 'send_inquiry') }}</button>
			</div>
			{!! Form::close() !!}
		</div>
	</div>
</div>

   
@else


	<div class="content mt-20" {{ inject('visual')->url('page', $page) }}>
		{!! contentTag($page->description->content) !!}
	</div>

    
@endif

@stop

@section('foot')
<script type="text/javascript">
	var pages = new Vue({
		el: '#page-wrap',
		data: {
			isActive1: true,
			isActive2: false,
		},
		methods: {
			change: function(message) {
				if (message == "active1") {
					this.isActive1 = true;
					this.isActive2 = false;
				} else {
					this.isActive1 = false;
					this.isActive2 = true;
				}
			}
		}
	});
</script>

<script type="text/javascript">
	// 内页手机端端 做的导航弹出特效
	$(".xymob-page-navbtn").click(function () {
		$(".xymob-menu-click").addClass('click');
		$('html,body').addClass('no-scroll');
	});
	$(".xymob-left-close-btn").click(function () {
		$(".xymob-menu-click").removeClass('click');
		$('html,body').removeClass('no-scroll');
	});

	//返回顶部
	$('.xymob-page-backtop').click(function () {
		$('html, body').animate({
			scrollTop: '0'
		}, 300);
	});

	// 内页左侧当前分类颜色高亮
	$(".xypg-left-nav li a[href='" + window.location.href + "']").closest('li').addClass('clicked');

</script>

@stop