<style>
    .auth-binding-down {
    line-height: 38px;
    /* margin-left: 10px !important; */
}
</style>
<title>认证管理</title>

<div class="layui-card layadmin-header">
<div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">控制台</a>
    <a><cite>认证审核</cite></a>
</div>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
          <div class="layui-card">
              <div class="layui-tab layui-tab-brief layadmin-latestData" lay-filter="atb">
                <ul class="layui-tab-title">
                    <li lay-id="ad" class="layui-this">专家/企业审核</li>
                    <li lay-id="adc">实名审核</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <!-- 认证列表 -->
                        <div style="padding-bottom: 10px;">
                          <a href="wendasns/homerecod/remove" class="layui-btn J_req" title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
                        </div>               
                        <table id="J_table_list" lay-filter="J_table_list"></table>
                        <script type="text/html" id="mous-table-cz">
                            <a href="#J_view" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="popup" title="审核"><i class="layui-icon layui-icon-edit"></i>审核</a> 
                          </script> 
                          <script type="text/html" id="mous-table-type">
                            {{# if(d.authtype == 2) {}} 企业认证 {{# } else { }} 专家认证 {{# } }}                  
                          </script>
                          <script type="text/html" id="J_table_authimage">
                            <div>{{# if(d.id_card_image){ }}<a href="{{d.id_card_image}}" target="_blank"><img src="{{d.id_card_image}}"/></a><a class="J_photos" style="float: right;" href="{{d.id_card_image}}" target="_blank" title="看大图"><i class="layui-icon layui-icon-search"></i></a>{{# }else{ }}<img src="{{d.id_card_image}}"/>{{# } }}</div>
                        </script>
                        <script type="text/html" id="J_table_authskill">
                            <div>{{# if(d.skill_image){ }}<a href="{{d.skill_image}}" target="_blank"><img src="{{d.skill_image}}"/></a><a class="J_photos" style="float: right;" href="{{d.skill_image}}" target="_blank" title="看大图"><i class="layui-icon layui-icon-search"></i></a>{{# }else{ }}<img src="{{d.skill_image}}"/>{{# } }}</div>
                        </script>
                    </div>

                    <div class="layui-tab-item">
                        <!-- 审核通过 -->
                        <div style="padding-bottom: 10px;">
                            <a href="wendasns/homerecod/remove" class="layui-btn J_req" title="确定要删除吗？"><i class="layui-icon layui-icon-delete"></i>删除</a>
                          </div>               
                          <table id="J_table_rlists" lay-filter="J_table_list"></table>
                          <script type="text/html" id="mous-table-real">
                            <a href="#J_view" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="popup" title="审核"><i class="layui-icon layui-icon-edit"></i>审核</a> 
                            </script> 
                            <script type="text/html" id="mous-table-rtype">                         
                              实名认证                                          
                            </script>
                            <script type="text/html" id="J_table_authpic">
                                <div>{{# if(d.id_card_image){ }}<a href="{{d.id_card_image}}" target="_blank"><img src="{{d.id_card_image}}"/></a><a class="J_photos" style="float: right;" href="{{d.id_card_image}}" target="_blank" title="看大图"><i class="layui-icon layui-icon-search"></i></a>{{# }else{ }}<img src="{{d.id_card_image}}"/>{{# } }}</div>
                            </script>
                    </div>
                </div>
              </div>              
          </div>
      </div>
  </div>
</div>
<script>
;!function(){
    var $ = layui.$
  ,form = layui.form
  ,element = layui.element
  ,upload = layui.upload
  ,table =layui.table
  ,router = layui.router()
  ,laydate = layui.laydate

  form.render();

    table.render({
      elem: '#J_table_list'
      ,height: 'auto'
      ,url: '{:url('wendasns/userauth/list')}' //数据接口
      ,page: true //开启分页
      ,limit: 16
      ,cols: [[ //表头
      	{type:'checkbox'}
        ,{field:'type',title:'认证类型',width:120,align:'center',templet:'#mous-table-type'}
        ,{field:'real_name',title:'企业名称',Width:120,align:'center'}
      ,{field:'id_card',title:'企业执照号',minWidth:120,align:'center'}
      ,{field:'field',title:'认证领域',width:120,align:'center'}
      ,{field:'skill_image',title:'附件一',Width:120,align:'center',templet:'#J_table_authimage'}
      ,{field:'id_organ_image',title:'附件二',Width:120,align:'center',templet:'#J_table_authskill'}
      ,{field:'cz',title:'操作选项',width:180, toolbar: '#mous-table-cz',align:'center'}
  
      ]]
      ,text: {
        none: '无任何数据！' //默认：无数据。
      }
    });

    //实名审核
    table.render({
      elem: '#J_table_rlists'
      ,height: 'auto'
      ,url: '{:url('wendasns/userauth/rlists')}' //数据接口
      ,page: true //开启分页
      ,limit: 16
      ,cols: [[ //表头
      	{type:'checkbox'}
        ,{field:'type',title:'认证类型',width:120,align:'center',templet:'#mous-table-rtype'}
        ,{field:'real_name',title:'姓名',width:120,align:'center'}
      ,{field:'id_card',title:'身份证号',minWidth:120,align:'center'}
      ,{field:'id_card_image',title:'身份证照片',Width:120,align:'center',templet:'#J_table_authpic'}
      ,{field:'cz',title:'操作选项',width:180, toolbar: '#mous-table-real',align:'center'}
  
      ]]
      ,text: {
        none: '无任何数据！' //默认：无数据。
      }
    });


    //驳回
    $("body").on('click','#comfirm_bohui',function(){
        $(this).html("确定驳回");

        $("#m_bohui").show();
        var reason = $.trim($("#reason").val());
        if(reason == ''){
        layer.msg("请输入驳回原因!",{icon:2});
        return false;
        }

    });

    /* Hash地址的定位 */
    var layid = router.hash.replace(/^#home=/, '');
      layid && element.tabChange('atb', layid);
      
      element.on('tab(atb)', function(elem){
        location.hash = '/'+ layui.router().path.join('/') + '#home=' + $(this).attr('lay-id');
      });
    
}();

</script>
<script type="text/html" id="J_view">
    <form class="layui-form" action="{:url('wendasns/Userauth/status')}" method="POST">
        <input type="hidden" name="authtype" value="{{d.authtype||''}}">
        <input type="hidden" name="auths" value="{{d.auths||''}}">
        <input type="hidden" name="id" value="{{d.id||0}}">
        <div class="layui-form-item">
            <label class="layui-form-label">认证类型：</label>
            <div class="layui-input-block auth-binding-down">
                {{# if(d.auths == 1) { }}
                实名认证
                {{# } else if(d.authtype==2) { }}  
                企业认证
                {{# } else { }} 
                专家认证
                {{# }}}

            </div>
        </div>
        {{# if(d.field) { }}
        <div class="layui-form-item">
            <label class="layui-form-label">认证领域：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.field||''}}
            </div>
        </div>
        {{# }}}

        {{# if(d.real_name) { }}

        <div class="layui-form-item">
            <label class="layui-form-label">自我介绍：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.description||''}}
            </div>
        </div>

        {{# if(d.authtype == 3) { }}
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.real_name||''}}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 85px;">身份证号码：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.id_card||''}}
            </div>
        </div>
        {{# } else { }}
        <div class="layui-form-item">
            <label class="layui-form-label">机构名称：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.real_name||''}}
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">执照代码：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.id_card||''}}
            </div>
        </div>
        {{# }}}

        <div class="layui-form-item">
            <label class="layui-form-label">附件一：</label>
            <div class="layui-input-block auth-binding-down">
                <img src="{{d.id_card_image||''}}" alt="">
                
            </div>
        </div>
        {{# }}}

        {{# if(d.skill_image) { }}   
        <div class="layui-form-item">
            <label class="layui-form-label">附件二：</label>
            <div class="layui-input-block auth-binding-down">
                <img src="{{d.skill_image||''}}" alt="" width="50%">
            </div>
        </div>
        {{# }}}
        <div class="layui-form-item">
            <label class="layui-form-label">提交时间：</label>
            <div class="layui-input-block auth-binding-down">
                {{d.create_time||''}}
            </div>
        </div>
        
        <button type="button" lay-submit lay-filter="J_ajax_submit_btn" class="layui-btn user-login-codeimg button" title="确定提交">提交</button>
        <button id="comfirm_bohui" lay-submit lay-filter="J_ajax_submit_btn" class="layui-btn user-login-codeimg button" title="驳回">驳回</button>
        <div class="layui-form-item"></div>

        <div class="layui-form-item" style="display:none;" id="m_bohui">
            <div class="layui-input-inline" style="width: 390px;">
                <textarea name="id_reason" placeholder="请输入驳回原因!" autocomplete="off" id="reason" class="layui-textarea"></textarea>
            </div>
        </div>
    </form> 

</script>