@extends('admin.master')

@section('top')
	<div class="top-breadcrumb pull-left">
        <h5>站点设置</h5>
    </div>
@endsection

@section('ordersearch')
<div class="nav-tabs-box">
	<ul class="nav nav-tabs margin-top-15" role="tablist">
		<li role="presentation" onclick="updateTab('tab-1')" class="@if($tab == 'tab-1') active @endif"><a href="#tab-1" aria-controls="tab-1" role="tab" data-toggle="tab">基本信息</a></li>
		<li role="presentation" onclick="updateTab('tab-2')" class="@if($tab == 'tab-2') active @endif"><a href="#tab-2" aria-controls="tab-2" role="tab" data-toggle="tab">公司信息</a></li>
		<li role="presentation" onclick="updateTab('tab-3')" class="@if($tab == 'tab-3') active @endif"><a href="#tab-3" aria-controls="tab-3" role="tab" data-toggle="tab">联系方式</a></li>
		<li role="presentation" onclick="updateTab('tab-4')" class="@if($tab == 'tab-4') active @endif"><a href="#tab-4" aria-controls="tab-4" role="tab" data-toggle="tab">社交媒体</a></li>
		<li role="presentation" onclick="updateTab('tab-6')" class="@if($tab == 'tab-6') active @endif"><a href="#tab-6" aria-controls="tab-6" role="tab" data-toggle="tab">品牌信息</a></li>
    <li role="presentation" onclick="updateTab('tab-7')" class="@if($tab == 'tab-7') active @endif"><a href="#tab-7" aria-controls="tab-7" role="tab" data-toggle="tab">企业邮箱</a></li>
    <li role="presentation" onclick="updateTab('tab-8')" class="@if($tab == 'tab-8') active @endif"><a href="#tab-8" aria-controls="tab-8" role="tab" data-toggle="tab">在线客服</a></li>
	</ul>
</div>

@if(config('managerLang') == config('setting.lang'))
	<div class="order-search mb-10 @if($tab == 'tab-2') active @else display-none @endif" data-tab="tab-2">
		@include('admin.common.translate_models', ['translateModel' => 'setting', 'translateModelName' => '公司信息', 'translateSettings' => ['title' => '公司名称', 'company' => '公司简介', 'address' => '公司地址', 'contact' => '联系人']])
	</div>
@endif

@if(config('managerLang') == config('setting.lang'))
  <div class="order-search mb-10 @if($tab == 'tab-8') active @else display-none @endif" data-tab="tab-8">
    @include('admin.common.translate_models', ['translateModel' => 'setting', 'translateModelName' => '客服信息', 'translateSettings' => ['kf_title' => '名称', 'kf_text1' => '回复内容1', 'kf_text2' => '回复内容2', 'kf_text3' => '回复内容3']])
  </div>
@endif
@endsection

@section('content')
{!! Form::model($config, ['route' => ['admin.setting.update'], 'method'=>'post', 'class'=>'form-horizontal form-detail']) !!}
<div class="tab-content">
	<input type="hidden" name="action" value="web">
	<input type="hidden" id="tab-name" name="tab" value="{{ $tab }}">
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-1') active @endif change-setting" id="tab-1">
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">域名</label>
			<div class="col-sm-5">
				{!! Form::text('domain', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">询盘通知</label>
			<div class="col-sm-5">
				<div class="change-setting-box">
					<p>联系方式用于接收新询盘信息</p>
					<div class="change-setting-form">
						<div class="change-setting-form-group mb-15">
							<div class="change-setting-form-title" style="width: 80px;">
								<i class="iconfont icon-a-pingguoshouji1"></i>
								<span>手机</span>
							</div>
              <div style="width: 100%">
							  {!! Form::text('message_mobile', null, ['class'=>'form-control']) !!}
              </div>
						</div>
						<div class="change-setting-form-group">
							<div class="change-setting-form-title" style="width: 80px;">
								<i class="iconfont icon-a-youjian1"></i>
								<span>邮箱</span>
							</div>
              <div style="width: 100%;display: flex;flex-wrap: wrap;margin: 0 -5px">
                <input class="form-control" name="message_email[]" type="text" value="{{ json_decode($config['message_email'], true)[0] ?? '' }}" style="width: calc(33.33333% - 10px);margin: 5px">
                <input class="form-control" name="message_email[]" type="text" value="{{ json_decode($config['message_email'], true)[1] ?? '' }}" style="width: calc(33.33333% - 10px);margin: 5px">
                <input class="form-control" name="message_email[]" type="text" value="{{ json_decode($config['message_email'], true)[2] ?? '' }}" style="width: calc(33.33333% - 10px);margin: 5px">
                <input class="form-control" name="message_email[]" type="text" value="{{ json_decode($config['message_email'], true)[3] ?? '' }}" style="width: calc(33.33333% - 10px);margin: 5px">
                <input class="form-control" name="message_email[]" type="text" value="{{ json_decode($config['message_email'], true)[4] ?? '' }}" style="width: calc(33.33333% - 10px);margin: 5px">
                <div style="width: 100%;color: #999">(可设置多个email接收询盘邮件，最多5个)</div>
              </div>
						</div>
					</div>
				</div>
			</div>
		</div>

    <div id="wx-push">
      <div class="form-group">
        <label class="col-sm-2 control-label label-width">询盘微信推送</label>
        <div class="col-sm-5">
          <div class="change-setting-inline">
            <span class="text-muted">开启后，使用公众号推送信息，需要扫码授权</span>
            <div class="pretty p-switch p-fill">
              <input type="hidden" name="wx_push" v-model="wx_push">
              <input type="checkbox" class="wx-checkbox" {{ $config['wx_push'] == 1 ? 'checked' : '' }} @change="openWx">
              <div class="state"><label></label></div>
            </div>
          </div>
        </div>
      </div>

      <div class="form-group wx-auth @if ($config['wx_push'] == 0)display-none @endif">
        <label class="col-sm-2 control-label label-width">微信扫码授权</label>
        <div class="col-sm-5">
          <ul class="attachments">
              <li class="thumbnail" style="background: none;border: none">
                <div><img id="wx-img" :src="wxInfo.qr_url" style="width: 120px;height: 120px"></div>
                <div v-if="wxInfo.is_bind == 1">
                  <a class='thumbnail-remove' @click="uninstallWx(wxInfo.id)" href='javascript:;'>解绑</a>
                </div>
                <div v-else>您还未绑定微信，请扫码绑定</div>
              </li>
          </ul>
        </div>
      </div>
    </div>

		<div class="form-group">
			<label class="col-sm-2 control-label label-width">Logo</label>
			<div class="col-sm-5">
				<div class="upload-wrap" data-name="description[{{ $managerLang }}][logoes]">
					<div class="upload-wrap-btn {{ (isset($descriptions[$managerLang]) && $descriptions[$managerLang]->pluck('value', 'name')->get('logoes')) ? 'display-none' : ''}}">
						<span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
						<span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
					</div>
					<ul id="picfram" class="upload-wrap-lists attachments clearfix">
						@if(isset($descriptions[$managerLang]) && $descriptions[$managerLang]->pluck('value', 'name')->get('logoes'))
							<li class="thumbnail" data-img="{{ $descriptions[$managerLang]->pluck('value', 'name')->get('logoes') }}">
								<input name="description[{{ $managerLang }}][logoes]" value="{{ $descriptions[$managerLang]->pluck('value', 'name')->get('logoes') }}" type="hidden">
								<a class="thumbnail-img"><img src="{{ url($descriptions[$managerLang]->pluck('value', 'name')->get('logoes')) }}"></a>
								<a class="thumbnail-remove" data-id='fileupload' href="javascript:;">删除</a>
							</li>
						@endif
					</ul>
				</div>
			</div>
		</div>
    <div class="form-group">
      <label class="col-sm-2 control-label label-width">二维码</label>
      <div class="col-sm-5">
        <div class="upload-wrap" data-name="qr_code">
          <div class="upload-wrap-btn {{ $config['qr_code'] ? 'display-none' : ''}}">
            <span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
            <span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
          </div>
          <ul id="picfram" class="upload-wrap-lists attachments clearfix">
            @if($config['qr_code'])
              <li class="thumbnail" data-img="{{ $config['qr_code'] }}">
                <input name="qr_code" value="{{ $config['qr_code'] }}" type="hidden">
                <a class="thumbnail-img"><img src="{{ $config['qr_code'] }}"></a>
                <a class="thumbnail-remove" data-id='fileupload1' data-name="qr_code" href="javascript:;">删除</a>
              </li>
            @endif
          </ul>
        </div>
      </div>
    </div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">流量统计代码</label>
			<div class="col-sm-5">
				{!! Form::textarea('traffic_code', null, ['class'=>'form-control', 'rows'=>5]) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">聊天工具代码</label>
			<div class="col-sm-5">
				{!! Form::textarea('chat_code', null, ['class'=>'form-control', 'rows'=>5]) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">Google 验证代码</label>
			<div class="col-sm-5">
				{!! Form::text('google_code', null, ['class'=>'form-control']) !!}
			</div>
		</div> 
    <div class="form-group">
      <label class="col-sm-2 control-label label-width">AI新闻发布条数</label>
      <div class="col-sm-5">
        {!! Form::text('ai_publish_num', null, ['class'=>'form-control']) !!}
      </div>
			<div class="col-sm-2 pt-7">
        <span class="text-muted">( 每天最多发布 {{ config('system.ai_max_num') }} 条 )</span>
			</div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">AI新闻发布状态</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
          <span class="text-muted">开启后，AI采集的新闻默认发布</span>
          <div class="pretty p-switch p-fill">
            <input type="hidden" name="ai_publish_flag" value="{{ $config['ai_publish_flag'] }}">
            <input type="checkbox" {{ $config['ai_publish_flag'] == 1 ? 'checked' : '' }}>
            <div class="state"><label></label></div>
          </div>
        </div>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">分页数量</label>
      <div class="col-sm-5">
        <label class="pr-10 font-normal">产品：</label>{!! Form::number('product_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">新闻：</label>{!! Form::number('news_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">案例：</label>{!! Form::number('case_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">相册：</label>{!! Form::number('album_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">下载：</label>{!! Form::number('download_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">招聘：</label>{!! Form::number('job_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
        <label class="pl-5 pr-10 font-normal">视频：</label>{!! Form::number('video_paginate', null, ['class'=>'form-control len70 inline-block', 'min' => 1]) !!}
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">语言跳转</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
					<span class="text-muted">开启后，会根据浏览器语言跳转首次访问语言</span>
					<div class="pretty p-switch p-fill">
						<input type="hidden" name="open_browser" value="{{ $config['open_browser'] }}">
						<input type="checkbox" {{ $config['open_browser'] == 1 ? 'checked' : '' }}>
						<div class="state"><label></label></div>
					</div>
				</div>
      </div>
    </div>

		<div class="form-group">
      <label class="col-sm-2 control-label label-width">产品SEO</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
					<span class="text-muted">开启后，录入产品支持单独设置TDK</span>
					<div class="pretty p-switch p-fill">
						<input type="hidden" name="product_seo" value="{{ $config['product_seo'] }}">
						<input type="checkbox" {{ $config['product_seo'] == 1 ? 'checked' : '' }}>
						<div class="state"><label></label></div>
					</div>
				</div>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">产品OG</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
          <span class="text-muted">开启后，录入产品支持单独设置OG</span>
          <div class="pretty p-switch p-fill">
            <input type="hidden" name="product_og" value="{{ $config['product_og'] }}">
            <input type="checkbox" {{ $config['product_og'] == 1 ? 'checked' : '' }}>
            <div class="state"><label></label></div>
          </div>
        </div>
      </div>
    </div>

		<div class="form-group">
			<label class="col-sm-2 control-label label-width">在线客服</label>
			<div class="col-sm-5">
				<div class="change-setting-box">
					<div class="change-setting-inline">
						<span class="text-muted">开启后，设置对应的平台账号，网站右侧将会出现客服图标</span>
						<div class="pretty p-switch p-fill">
							<input type="hidden" name="service" value="{{ $config['service'] }}">
							<input type="checkbox" class="service-checkbox" {{ $config['service'] == 1 ? 'checked' : '' }}>
							<div class="state"><label></label></div>
						</div>
					</div>
					<div class="change-setting-form service-box @if ($config['service'] == 0)display-none @endif">
						<div class="change-setting-form-group mb-15">
							<div class="change-setting-form-title" style="width: 100px">
								<i class="iconfont icon-Whatsapp1"></i>
								<span>Whatsapp</span>
							</div>
							{!! Form::text('whatsapp', null, ['class'=>'form-control']) !!}
						</div>
            <div class="change-setting-form-group">
              <div class="change-setting-form-title" style="width: 100px">
                <i class="iconfont icon-sign_qq"></i>
                <span>QQ</span>
              </div>
              {!! Form::text('qq', null, ['class'=>'form-control']) !!}
            </div>
					</div>
				</div>
			</div>
		</div>

		<div class="form-group">
      <label class="col-sm-2 control-label label-width">自动翻译（新增内容）</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
					<span class="text-muted">开启后，选择自动翻译的语言，新增内容一键翻译</span>
					<div class="pretty p-switch p-fill">
						<input type="hidden" name="auto_translate" value="{{ $config['auto_translate'] }}">
						<input type="checkbox" class="translate-checkbox" {{ $config['auto_translate'] == 1 ? 'checked' : '' }}>
						<div class="state"><label></label></div>
					</div>
				</div>
      </div>
    </div>

    <div class="form-group translate-lang @if ($config['auto_translate'] == 0)display-none @endif">
      <label class="col-sm-2 control-label label-width">翻译语言</label>
      <div class="col-sm-5">
        <div class="pretty-box pretty-check-all clearfix">
          <div class="pretty p-default p-smooth">
            <input id="checkTranslateLangAll" type="checkbox" @if($langs->count() == count(json_decode($config['translate_langs'], true))) checked="checked" @endif onclick="checkAll(this, 'translate_langs[]')">
            <div class="state p-success ml-10"><label>全选</label></div>
          </div>
        </div>
        @if(!$langs->isEmpty())
          <div class="edition-cont clearfix">
            @foreach ($langs as $val)
                <div class="pretty p-default p-smooth mt-10 mb-10 col-xs-2" style="margin-right: 0;">
                  <input name="translate_langs[]" class="platform-id" type="checkbox" value="{{ $val['slug'] }}" @if(in_array($val['slug'], json_decode($config['translate_langs'], true))) checked @endif onclick="checkItem(this, 'checkTranslateLangAll')">
                  <div class="state p-success ml-5"><label style="text-indent: 10px;">{{ $val->name }}</label></div>
                </div>
            @endforeach
          </div>
        @endif
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">自动翻译（编辑内容）</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
          <span class="text-muted">开启后，选择自动翻译的语言，编辑内容一键翻译</span>
          <div class="pretty p-switch p-fill">
            <input type="hidden" name="edit_auto_translate" value="{{ $config['edit_auto_translate'] }}">
            <input type="checkbox" class="translate-checkbox-edit" {{ $config['edit_auto_translate'] == 1 ? 'checked' : '' }}>
            <div class="state"><label></label></div>
          </div>
        </div>
      </div>
    </div>

    <div class="form-group translate-lang-edit @if ($config['edit_auto_translate'] == 0)display-none @endif">
      <label class="col-sm-2 control-label label-width">翻译语言</label>
      <div class="col-sm-5">
        <div class="pretty-box pretty-check-all clearfix">
          <div class="pretty p-default p-smooth">
            <input id="checkTranslateLangAll" type="checkbox" @if($langs->count() == count(json_decode($config['translate_edit_langs'], true))) checked="checked" @endif onclick="checkAll(this, 'translate_edit_langs[]')">
            <div class="state p-success ml-10"><label>全选</label></div>
          </div>
        </div>
        @if(!$langs->isEmpty())
          <div class="edition-cont clearfix">
            @foreach ($langs as $val)
              <div class="pretty p-default p-smooth mt-10 mb-10 col-xs-2" style="margin-right: 0;">
                <input name="translate_edit_langs[]" class="platform-id" type="checkbox" value="{{ $val['slug'] }}" @if(in_array($val['slug'], json_decode($config['translate_edit_langs'], true))) checked @endif onclick="checkItem(this, 'checkTranslateLangAll')">
                <div class="state p-success ml-5"><label style="text-indent: 10px;">{{ $val->name }}</label></div>
              </div>
            @endforeach
          </div>
        @endif
      </div>
    </div>

		<div class="form-group">
      <label class="col-sm-2 control-label label-width">Webp格式</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
					<span class="text-muted">使用Webp格式的图片，压缩图片大小，提高网站的速度</span>
					<div class="pretty p-switch p-fill">
						<input type="hidden" name="is_webp" value="{{ $config['is_webp'] }}">
						<input type="checkbox" {{ $config['is_webp'] == 1 ? 'checked' : '' }}>
						<div class="state"><label></label></div>
					</div>
				</div>
      </div>
    </div>

		<div class="form-group">
			<label class="col-sm-2 control-label label-width">表单验证方式</label>
			<div class="col-sm-5">
				<div class="pretty-box" style="height: 36px;">
					<div class="pretty p-default p-round p-smooth">
						{!! Form::radio('message_verify_type', 1, null) !!}
						<div class="state p-success-o"><label>验证码</label></div>
					</div>
					<div class="pretty p-default p-round p-smooth">
						{!! Form::radio('message_verify_type', 2, null) !!}
						<div class="state p-success-o"><label>Google人机验证</label></div>
					</div>
				</div>
				<div class="change-setting-form message_verify_recaptcha" style="display: @if($config['message_verify_type'] == 2) block @else none @endif;">
					<div class="change-setting-form-group mb-15">
						<label class="change-setting-form-title">公钥：</label>
						<div class="change-setting-form-input">
							{!! Form::text('re_captcha_web_secret', null, ['class'=>'form-control']) !!}
							<span class="pl-10 mt-5 text-muted inline-block">( 在您的网站提供给用户的 HTML 代码中使用此网站密钥 )</span>
						</div>
					</div>
					<div class="change-setting-form-group mb-15">
						<label class="change-setting-form-title">私钥：</label>
						<div class="change-setting-form-input">
							{!! Form::text('re_captcha_secret', null, ['class'=>'form-control']) !!}
							<span class="pl-10 mt-5 text-muted inline-block">( 此密钥用于您的网站和 reCAPTCHA 之间的通信 )</span>
						</div>
					</div>
					<div class="change-setting-form-group">
						<label class="change-setting-form-title">备注：</label>
						<div class="change-setting-form-input">
							<div class="text-muted" style="padding-top: 7px;">谷歌人机验证秘钥申请地址：<a href="https://www.google.com/recaptcha/admin?hl=zh-cn" target="_blank">注册 API 密钥对</a></div>
						</div>
					</div>
				</div>
			</div>
		</div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">手机底部悬浮设置</label>
      <div class="col-sm-5">
        <div class="pretty-box" style="height: 36px;">
          <div class="change-setting-inline" style="display: inline-block">
            <div class="pretty p-switch p-fill">
              <input type="hidden" name="whatsapp_status" value="{{ $config['whatsapp_status'] }}">
              <input type="checkbox" {{ $config['whatsapp_status'] == 1 ? 'checked' : '' }}>
              <div class="state p-success-o"><label><span style="font-size: 15px">Whatsapp</span></label></div>
            </div>
          </div>
          <div class="change-setting-inline" style="display: inline-block">
            <div class="pretty p-switch p-fill">
              <input type="hidden" name="phone_status" value="{{ $config['phone_status'] }}">
              <input type="checkbox" {{ $config['phone_status'] == 1 ? 'checked' : '' }}>
              <div class="state p-success-o"><label><span style="font-size: 15px">Phone</span></label></div>
            </div>
          </div>
          <div class="change-setting-inline" style="display: inline-block">
            <div class="pretty p-switch p-fill">
              <input type="hidden" name="email_status" value="{{ $config['email_status'] }}">
              <input type="checkbox" {{ $config['email_status'] == 1 ? 'checked' : '' }}>
              <div class="state p-success-o"><label><span style="font-size: 15px">E-mail</span></label></div>
            </div>
          </div>
          <div class="change-setting-inline" style="display: inline-block">
            <div class="pretty p-switch p-fill">
              <input type="hidden" name="message_status" value="{{ $config['message_status'] }}">
              <input type="checkbox" {{ $config['message_status'] == 1 ? 'checked' : '' }}>
              <div class="state p-success-o"><label><span style="font-size: 15px">Message</span></label></div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">Cookie政策</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
          <span class="text-muted">开启后，网站底部将会出现Cookie政策内容</span>
          <div class="pretty p-switch p-fill">
            <input type="hidden" name="is_cookie" value="{{ $config['is_cookie'] }}">
            <input type="checkbox" {{ $config['is_cookie'] == 1 ? 'checked' : '' }}>
            <div class="state"><label></label></div>
          </div>
        </div>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">分类产品展示方式</label>
      <div class="col-sm-5">
        <div class="pretty-box" style="height: 36px;">
          <div class="pretty p-default p-round p-smooth">
            {!! Form::radio('product_display', 1, null) !!}
            <i class="iconfont icon-liebiao1"></i>
          </div>
          <div class="pretty p-default p-round p-smooth">
            {!! Form::radio('product_display', 2, null) !!}
            <i class="iconfont icon-List"></i>
          </div>
        </div>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-2 control-label label-width">禁止国内访问</label>
      <div class="col-sm-5">
        <div class="change-setting-inline">
          <span class="text-muted">开启后，禁止国内IP访问</span>
          <div class="pretty p-switch p-fill">
            <input type="hidden" name="access_denied" value="{{ $config['access_denied'] }}">
            <input type="checkbox" {{ $config['access_denied'] == 1 ? 'checked' : '' }}>
            <div class="state"><label></label></div>
          </div>
        </div>
      </div>
    </div>

	</div>
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-2') active @endif" id="tab-2">
		<div class="tab-content">
			<div role="tabpanel" class="tab-pane active" id="language-{{ $managerLang }}">
				<div class="form-group">
					<label class="col-sm-2 control-label label-width">公司名称：</label>
					<div class="col-sm-5">
						{!! Form::text("description[{$managerLang}][title]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('title') : '', ['class'=>'form-control']) !!}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label label-width">公司简介：</label>
					<div class="col-sm-10">
						{!! Form::textarea("description[{$managerLang}][company]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('company') : '', ['id'=>"editor-{$managerLang}", 'class'=>'len-full']) !!}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label label-width">公司地址：</label>
					<div class="col-sm-5">
						{!! Form::text("description[{$managerLang}][address]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('address') : '', ['class'=>'form-control']) !!}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label label-width">联系人：</label>
					<div class="col-sm-5">
						{!! Form::text("description[{$managerLang}][contact]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('contact') : '', ['class'=>'form-control']) !!}
					</div>
				</div>
			</div>
		</div>
	</div>
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-3') active @endif" id="tab-3">
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">座机：</label>
			<div class="col-sm-5">
				{!! Form::text('telephone', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">手机号：</label>
			<div class="col-sm-5">
				{!! Form::text('tel', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">邮箱：</label>
			<div class="col-sm-5">
				{!! Form::text('email', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">传真：</label>
			<div class="col-sm-5">
				{!! Form::text('fax', null, ['class'=>'form-control']) !!}
			</div>
		</div>
	</div>
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-4') active @endif change-setting" id="tab-4">
		<div class="change-setting-alert">
			<i class="iconfont icon-zhuyi1"></i>
			<span>链接多个媒体平台，全渠道获客，帮助企业搭建以独立官网为核心的多渠道全方位营销网络。</span>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban61 iconfont"></i>
					<span>Facebook</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('facebook', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban51 iconfont"></i>
					<span>Twitter</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('twitter', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban71 iconfont"></i>
					<span>Youtube</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('youtube', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban33 iconfont"></i>
					<span>LinkedIn</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('linkedin', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban12 iconfont"></i>
					<span>Google+</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('google', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">
				<div class="control-label-inline">
					<i class="icon-a-huaban11 iconfont"></i>
					<span>Instagram</span>
				</div>
			</label>
			<div class="col-sm-5">
				{!! Form::text('instagram', null, ['class'=>'form-control']) !!}
			</div>
		</div>
	</div>
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-6') active @endif" id="tab-6">
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">名称：</label>
			<div class="col-sm-5">
				{!! Form::text('brand_name', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">登录LOGO图片：</label>
			<div class="col-sm-5">
				<div class="upload-wrap" data-name="brand_login_logo">
					<div class="upload-wrap-btn {{ $config['brand_login_logo'] ? 'display-none' : ''}}">
						<span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
						<span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
					</div>
					<ul id="picfram" class="upload-wrap-lists attachments clearfix">
						@if($config['brand_login_logo'])
							<li class="thumbnail" data-img="{{ $config['brand_login_logo'] }}">
								<input name="brand_login_logo" value="{{ $config['brand_login_logo'] }}" type="hidden">
								<a class="thumbnail-img"><img src="{{ $config['brand_login_logo'] }}"></a>
								<a class="thumbnail-remove" data-id='fileupload3' data-name="brand_login_logo" href="javascript:;">删除</a>
							</li>
						@endif
					</ul>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">管理页LOGO图片：</label>
			<div class="col-sm-5">
				<div class="upload-wrap" data-name="brand_manager_logo">
					<div class="upload-wrap-btn {{ $config['brand_manager_logo'] ? 'display-none' : ''}}">
						<span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
						<span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
					</div>
					<ul id="picfram" class="upload-wrap-lists attachments clearfix">
						@if($config['brand_manager_logo'])
							<li class="thumbnail" data-img="{{ $config['brand_manager_logo'] }}">
								<input name="brand_manager_logo" value="{{ $config['brand_manager_logo'] }}" type="hidden">
								<a class="thumbnail-img"><img src="{{ $config['brand_manager_logo'] }}"></a>
								<a class="thumbnail-remove" data-id='fileupload3' data-name="brand_manager_logo" href="javascript:;">删除</a>
							</li>
						@endif
					</ul>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">ICO图标：</label>
			<div class="col-sm-5">
				<div class="upload-wrap" data-name="brand_ico">
					<div class="upload-wrap-btn {{ $config['brand_ico'] ? 'display-none' : ''}}">
						<span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
						<span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
					</div>
					<ul id="picfram" class="upload-wrap-lists attachments clearfix">
						@if($config['brand_ico'])
							<li class="thumbnail" data-img="{{ $config['brand_ico'] }}">
								<input name="brand_ico" value="{{ $config['brand_ico'] }}" type="hidden">
								<a class="thumbnail-img"><img src="{{ $config['brand_ico'] }}"></a>
								<a class="thumbnail-remove" data-id='fileupload3' data-name="brand_ico" href="javascript:;">删除</a>
							</li>
						@endif
					</ul>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">Copyright名称：</label>
			<div class="col-sm-5">
				{!! Form::text('brand_copyright_name', null, ['class'=>'form-control']) !!}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label label-width">网址：</label>
			<div class="col-sm-5">
				{!! Form::text('brand_url', null, ['class'=>'form-control']) !!}
			</div>
		</div>
	</div>
	<div role="tabpanel" class="tab-pane @if($tab == 'tab-7') active @endif" id="tab-7">
		<div class="form-group">
		  <label class="col-sm-2 control-label label-width">邮箱地址：</label>
		  <div class="col-sm-5">
			{!! Form::text('mail_address', null, ['class'=>'form-control']) !!}
		  </div>
		</div>
		<div class="form-group">
		  <label class="col-sm-2 control-label label-width">密码：</label>
		  <div class="col-sm-5">
			{!! Form::text('mail_password', null, ['class'=>'form-control']) !!}
		  </div>
		</div>
		<div class="form-group">
		  <label class="col-sm-2 control-label label-width">发信名称：</label>
		  <div class="col-sm-5">
			{!! Form::text('mail_name', null, ['class'=>'form-control']) !!}
		  </div>
		</div>
		<div class="form-group">
		  <label class="col-sm-2 control-label label-width">发送服务器(SMTP)：</label>
		  <div class="col-sm-5">
			{!! Form::text('mail_host', null, ['class'=>'form-control']) !!}
		  </div>
		</div>
  </div>
  <div role="tabpanel" class="tab-pane @if($tab == 'tab-8') active @endif" id="tab-8">
    <div class="tab-content">
      <div role="tabpanel" class="tab-pane active" id="language-{{ $managerLang }}">
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">名称：</label>
          <div class="col-sm-5">
            {!! Form::text("description[{$managerLang}][kf_title]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('kf_title') : '', ['class'=>'form-control']) !!}
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">图标：</label>
          <div class="col-sm-5">
            <div class="upload-wrap" data-name="kf_logo">
              <div class="upload-wrap-btn {{ $config['kf_logo'] ? 'display-none' : ''}}">
                <span class="btn btn-default" data-toggle="modal" data-target="#media-dialog-modal">媒体上传</span>
                <span class="text-muted pl-10">(允许上传的媒体类型：jpg、gif、png)</span>
              </div>
              <ul id="picfram" class="upload-wrap-lists attachments clearfix">
                @if($config['kf_logo'])
                  <li class="thumbnail" data-img="{{ $config['kf_logo'] }}">
                    <input name="kf_logo" value="{{ $config['kf_logo'] }}" type="hidden">
                    <a class="thumbnail-img"><img src="{{ $config['kf_logo'] }}"></a>
                    <a class="thumbnail-remove" data-id='fileupload3' data-name="kf_logo" href="javascript:;">删除</a>
                  </li>
                @endif
              </ul>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">回复内容1：</label>
          <div class="col-sm-5">
            {!! Form::text("description[{$managerLang}][kf_text1]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('kf_text1') : '', ['class'=>'form-control']) !!}
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">回复内容2：</label>
          <div class="col-sm-5">
            {!! Form::text("description[{$managerLang}][kf_text2]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('kf_text2') : '', ['class'=>'form-control']) !!}
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">回复内容3：</label>
          <div class="col-sm-5">
            {!! Form::text("description[{$managerLang}][kf_text3]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('kf_text3') : '', ['class'=>'form-control']) !!}
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label label-width">回复内容4：</label>
          <div class="col-sm-5">
            {!! Form::text("description[{$managerLang}][kf_text4]", isset($descriptions[$managerLang]) ? $descriptions[$managerLang]->pluck('value', 'name')->get('kf_text4') : '', ['class'=>'form-control']) !!}
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-3 control-label label-width"></label>
    <div class="col-sm-5">
      {!! Form::submit('提交', ['class'=>'btn btn-primary']) !!}
    </div>
  </div>
</div>
{!! Form::close() !!}
@endsection

@section('foot')
<script src="{{ asset('data/assets/js/ueditor/ueditor.config.js') }}"></script>
<script src="{{ asset('data/assets/js/ueditor/ueditor.all.min.js') }}"></script>
<script>
function updateTab(tab) {
	document.getElementById("tab-name").value = tab
	$(".order-search[data-tab]").hide();
	$("[data-tab='"+tab+"']").show()
}
$(function(){
	UE.getEditor('editor-' + '{{ config('managerLang')  }}');
});


$('.service-checkbox').on('change', function(){
    if (this.checked) {
        $('.service-box').show();
    } else {
			$('.service-box').hide();
    }
});

$('.translate-checkbox').on('change', function(){
    if (this.checked) {
        $('.translate-lang').show();
    } else {
        $('.translate-lang').hide();
    }
});
$('.translate-checkbox-edit').on('change', function(){
    if (this.checked) {
        $('.translate-lang-edit').show();
    } else {
        $('.translate-lang-edit').hide();
    }
});
$('[name="message_verify_type"]').on('change', function(){
	console.log(this.value)
    if (this.value == 2) {
        $('.message_verify_recaptcha').show();
    } else {
        $('.message_verify_recaptcha').hide();
    }
});
$('.p-switch [type="checkbox"]').change(function() {
	$(this).prev().prop('value', $(this).prop('checked') ? 1 : 0);
});
</script>

<script>
    new Vue({
        el: '#wx-push',
        data: {
            wxInfo: {},
            wx_push: "{{ $config['wx_push'] }}",
            timer: null
        },
        created: function() {
            if (this.wx_push == 1) {
                this.bindWx()
            }
        },
        watch: {//深度 watcher
            'wx_push': {
                handler: function (val, oldVal) {
                    if (this.wx_push) {
                        this.bindWx()
                    }
                },
                deep: true
            }
        },
        methods: {
            openWx: function (e) {
                if (e.target.checked) {
                    this.wx_push = 1
                    $('.wx-auth').show();
                } else {
                    this.wx_push = 0
                    $('.wx-auth').hide();
                }
            },
            bindWx: function () {
                var _this = this;
                $.ajax({
                    type: "GET",
                    url: "{{ config('setting.api_url') }}" + "/wechat-info",
                    data: {},
                    success: function(json) {
                        if (json.status == 'success') {
                            _this.wxInfo = json.data
                            _this.timer = setInterval(() => {
                                _this.getWxInfo()
                            }, 4000)
                        } else {
                            // swal({
                            //     title: "",
                            //     text: "暂时不可绑定微信！",
                            //     type: "warning",
                            //     showConfirmButton: false,
                            //     timer: 1500,
                            // });
                        }
                    }
                });
            },
            getWxInfo: function () {
                $.ajax({
                    type: "GET",
                    url: "{{ config('setting.api_url') }}" + "/wechat-info",
                    data: {},
                    success: function(json) {
                        if (json.status == 'success') {
                            this.wxInfo = json.data
                        }
                    }
                });
            },
            uninstallWx: function (id) {
                var _this = this
                swal({
                    title: "解绑微信",
                    text: "解除绑定后您将无法及时接收线索提醒，是否解除微信绑定？",
                    type: "warning",
                    showConfirmButton: true,
                    confirmButtonText: "确定",
                    showCancelButton: true,
                    cancelButtonText: "取消"
                }, function (isConfirm) {
                    if (isConfirm) {
                        $.ajax({
                            type: "delete",
                            url: "{{ config('setting.api_url') }}" + "/wechat-info/" + id,
                            data: {},
                            success: function(json) {
                                if (json.status == 'success') {
                                    _this.bindWx()
                                    swal({
                                        title: "",
                                        text: "微信解绑成功！",
                                        type: "success",
                                        showConfirmButton: false,
                                        timer: 1500,
                                    });
                                }
                            }
                        });
                    }
                });
            }
        }
    })
</script>
{{--媒体库 start--}}
@include('admin.common.media', ['type' => 'jpg,gif,png'])
{{--媒体库 end--}}
@endsection