<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<!doctype html>
<html>
<head>
    <title>企业基本信息</title>
    <meta charset="utf-8">
    <jsp:include page="../common/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="../common/body_header.jsp"></jsp:include>
<jsp:include page="../common/user_center_header.jsp"></jsp:include>

    <div class="user-mid2">
    <div class="xinxi0">
        <div class="user-mid0">
            <div class="if">
                <span onclick="fnBaseInfoId()" id="baseInfoId" class="xx0" ><a>基本信息</a></span>
                <span onclick="fnVerifyId()" id="verifyId" class="xx"><a>实名认证</a></span>
                <span onclick="fnPasswordId()" id="passwordId" class="xx"><a>修改密码</a></span>
            </div>
            <div class="clearfix"></div>
            <div class="xx-main" id="fnBaseInfoIdView">
                <table>
                    <tr>
                        <td>账户名：</td>
                        <td>${outputModel.username}</td>
                    </tr>
                    <tr>
                        <td>实名认证：</td>
                        <td>${outputModel.authState}</td>
                    </tr>
                    <tr>
                        <td>APIkey：</td>
                        <td>未完成认证</td>
                    </tr>
                    <tr>
                        <td>scretKey：</td>
                        <td>未完成认证</td>
                    </tr>
                    <tr>
                        <td>手机号码：</td>
                        <td>${outputModel.phone}</td>
                    </tr>
                    <tr>
                        <td>用户类型：</td>
                        <td>${outputModel.userType}</td>
                    </tr>
                </table>
            </div>
            <div class="xx-main" id="fnVerifyIdView">
                    <div class="rz1">
                        <div>
                            <span ></span> &nbsp;
                            <span class="rzfont" onclick="geren()" id="gerenId"><a>个人</a></span>
                        </div>
                        <div class="clearfix"></div>
                        <div >
                            <span ></span> &nbsp;
                            <span class="rzfont" onclick="qiye()" id="qiyeId" ><a>企业</a></span>
                        </div>
                    </div>
                <%--////////个人////////////////--%>
                    <div class="rz-neirong" id="gerenView">
                        <form id="personalverifyId" method="post">
                        <div class="form03">
                                        <span class="font">
                                            用户名
                                        </span>
                            <div class="form12">
                                ${outputModel.username}
                            </div>
                        </div>
                        <div class="form03">
                                        <span class="font1">
                                            <span class="xinghao" >*</span>姓名
                                        </span>
                            <div class="form1">
                                <input type="text" class="input4" name="fullName" placeholder="请输入姓名">
                                <div class="tishi4"></div>
                            </div>
                        </div>
                        <div class="form03">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>认证方式
                                        </span>
                            <div class="form13">
                                <input type="radio" value="身份证认证" name="authMethod" checked="checked" onchange="fnAuthMethod(this)">身份证认证&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" value="手机认证" name="authMethod" onchange="fnAuthMethod(this)">手机认证&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" value="银行卡号认证" name="authMethod" onchange="fnAuthMethod(this)">银行卡号认证
                            </div>
                        </div>
                        <div class="form03" style="display: none" id="authIdCardId">
                                    <span class="font01">
                                        <span class="xinghao" >*</span>身份证号码
                                    </span>
                            <div class="form1">
                                <input type="text" class="input4" name="idCard" placeholder="请填写身份证号码">
                                <div class="tishi4"></div>
                            </div>
                        </div>
                        <div class="form03" style="display: none" id="authPhoneId">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>手机号码
                                        </span>
                            <div class="form1">
                                <input type="text" class="input4" name="authPhone" placeholder="请输入手机号码">
                                <div class="tishi4"></div>
                            </div>
                        </div>
                        <div class="form03" style="display: none"  id="authBankId">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>银行卡号
                                        </span>
                            <div class="form1">
                                <input type="text" class="input4" name="bankCard" placeholder="请输入银行卡号">
                                <div class="tishi4"></div>
                            </div>
                        </div>
                        <input type="button" class="queren2" value="确认" id="personId" onclick="fnPersonalVerify()">
                    </form>
                    </div>
                <%--/////////////////////////////--%>
                <%--//////////企业///////////////////--%>
                    <div class="rz-neirong0" id="qiyeView">
                        <form  id="companyverifyId" method="post" enctype="multipart/form-data">
                            <div class="rz-neirong11">
                                <div class="cp">企业信息</div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>公司名称
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="companyName" placeholder="请输入有效的公司名称">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>详细地址
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="address" placeholder="请填写详细的地址">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>营业执照编号
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="commercialInstrument" placeholder="请输入有效的营业执照编号">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            税务登记证编号
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="taxRegistrationCertificate" placeholder="请输入有效的税务登记证编号">
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            组织机构编号
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="orgCode" placeholder="请输入新密码">
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>营业执照副本
                                        </span>
                                    <div class="form1">
                                        <input type="file" name="commercialInstrumentCopyImg"/>
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                            </div>

                            <div class="rz-neirong21">
                                <div class="cp">联系人信息</div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>联系人姓名
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="contact" placeholder="请输入有效的联系人姓名">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>联系人身份证号
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="idCard" placeholder="请填写有效的身份证号">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao" >*</span>手机号码
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="authPhone" placeholder="请输入有效的手机号码">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                                <div class="form031">
                                        <span class="font01">
                                            <span class="xinghao">*</span>公司邮箱
                                        </span>
                                    <div class="form1">
                                        <input type="text" class="input4" name="email" placeholder="请输入有效的邮箱地址">
                                        <div class="tishi4"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="rz-neirong3">
                                <div class="cp">添加服务商标签</div>
                                <div class="fabu-0211">
                                    <span class="font01"><span class="xinghao">*</span>行业领域</span>
                                    <span class="radio011">
                                            <input type="checkbox" name="serviceCategory" value="教育" class="radio">教育&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="工作就业" class="radio">工作就业&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="数据" class="radio">数据&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="医疗卫生" class="radio">医疗卫生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="交通出行" class="radio">交通出行&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="旅游" class="radio">旅游&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="文化体育" class="radio">文化体育&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="生活服务" class="radio">生活服务&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="城市管理" class="radio">城市管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>
                                            <input type="checkbox" name="serviceCategory" value="产业发展" class="radio">产业发展&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="金融" class="radio">金融&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="checkbox" name="serviceCategory" value="政民互动" class="radio">政民互动&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <div class="tishi4"></div>
                                        </span>
                                </div>
                                <div class="fabu-0511">
                                    <span class="fabufont11"><span class="xinghao"></span>服务标签</span>
                                    <span class="fabu-button8"><input type="text" class="input-0110" name="serviceTag" placeholder="请输入服务标签"></span>
                                    <%--<span><button class="xuanze">选择</button></span>--%>
                                </div>
                                <div class="clearfix"></div>
                                <div class="cp-xieyi">
                                    <input type="checkbox" checked="checked">我已阅读并接受<a target="_blank" href="<%=basePath%>/open/static/agreement_real_name">《用户实名认证协议》</a>
                                </div>
                            </div>
                            <input type="button" class="queren4" value="提交" id="companyId" onclick="fnCompanyVerify()"/>
                        </form>
                    </div>
                <%--/////////////////////////////--%>
                </div>
            </div>
            <div class="xx-main" id="fnPasswordIdView">
                <div class="window1">
                    <div class="top01">
                        <span class="p00">&nbsp;</span>
                    </div>
                    <div class="form11">
                        <form id="changePasswordId" method="post">
                            <div class="form0">
                                <span class="font">
                                    <span class="xinghao" >*</span>旧密码
                                </span>
                                <div class="form1">
                                    <input type="password" class="input4" name="oldpassword" placeholder="请输入旧密码">
                                    <div class="tishi4"></div>
                                </div>
                            </div>
                            <div class="form0">
                                <span class="font">
                                    <span class="xinghao" >*</span>新密码
                                </span>
                                <div class="form1">
                                    <input type="password" class="input4" name="newpassword" placeholder="请输入新密码">
                                    <div class="tishi4"></div>
                                </div>
                            </div>
                            <div class="form0">
                                <span class="font01">
                                    <span class="xinghao" >*</span>确认新密码
                                </span>
                                <div class="form1">
                                    <input type="password" class="input4" name="renewpassword" placeholder="请再次填写新密码">
                                    <div class="tishi4"></div>
                                </div>
                            </div>
                            <div class="form010">
                                注意：密码只能包含数字字母下划线中划线，8到20位
                            </div>
                            <input type="button" class="queren1" onclick="fnSubimt()" value="确认"/>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

<jsp:include page="../common/body_footer.jsp"></jsp:include>
</body>
<script type="text/javascript">

    //tab页切换
    /*if ($("#type").val() ==1){
        fnApplyData();
    }else{
        fnFollowData();
    }*/

    fnBaseInfoId();

    function fnBaseInfoId(){
        $('#fnBaseInfoIdView').show();
        $('#fnVerifyIdView').hide();
        $('#fnPasswordIdView').hide();
        $("#baseInfoId").addClass("xx01");
        $("#verifyId").removeClass("xx01");
        $("#passwordId").removeClass("xx01");
    }
    function fnVerifyId(){
        $('#fnBaseInfoIdView').hide();
        $('#fnVerifyIdView').show();
        $('#fnPasswordIdView').hide();
        $("#baseInfoId").removeClass("xx01");
        $("#verifyId").addClass("xx01");
        $("#passwordId").removeClass("xx01");
    }

    function fnPasswordId(){
        $('#fnBaseInfoIdView').hide();
        $('#fnVerifyIdView').hide();
        $('#fnPasswordIdView').show();
        $("#baseInfoId").removeClass("xx01");
        $("#verifyId").removeClass("xx01");
        $("#passwordId").addClass("xx01");
    }

    //个人和企业认证页面
    if(true){
        geren();
    }
    function geren() {
        $('#gerenView').show();
        $('#qiyeView').hide();
        $('#gerenId').prev().attr("class","dian");
        $('#qiyeId').prev().attr("class","dian1");
    }

    function qiye(){
        $('#gerenView').hide();
        $('#qiyeView').show();
        $('#gerenId').prev().attr("class","dian1");
        $('#qiyeId').prev().attr("class","dian");
    }

    //个人认证
    function fnPersonalVerify(){
        $('.tishi4').text('');//清空验证
        $.post("<%=basePath%>/open/userverify/verifyPersonal.action",$('#personalverifyId').serialize(),function(result){
            if(result.stateCode==200){
                swal(result.msg)
                window.location.href="<%=basePath%>/open/userverify/detail.htm";
            }else{
                if(result.data ==null){
                    swal(result.msg);//弹出发布失败提示
                }else{
                    for(var item in result.data){
                        $("[name='"+item+"']").next().text("! "+result.data[item]);
                        $("[name='"+item+"']").next().show();
                    }
                }
            }
        })
    }
    //公司认证
    function fnCompanyVerify(){
        var formData = new FormData($('#companyverifyId')[0]);//图片上传
        $.ajax({
            url:'<%=basePath%>/open/userverify/verifyCompany.action',
            type:'post',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result){
                $('.tishi4').text('');//清空验证
                if(result.stateCode==200){
                    swal(result.msg);
                    window.location.href="<%=basePath%>/open/userverify/detail.htm";
                }else{
                    if(result.data ==null){
                        swal(result.msg);//弹出发布失败提示
                    }else{
                        for(var item in result.data){
                            $("[name='"+item+"']").next().text("! "+result.data[item]);
                            $("[name='"+item+"']").next().show();
                        }
                    }
                }
            }
        });
    }
    //修改密码
    function fnSubimt(){
        $('.tishi4').text('');//清空验证验证
        $.get("<%=basePath%>/open/userverify/changePassword.action",$('#changePasswordId').serialize(),function(result){
            if(result.stateCode==200){
                swal(result.msg);
                $("#changePasswordId input[type='password']").val("");
            }else{
                if(result.data ==null){
                    swal(result.msg);//弹出修改失败提示
                }else{
                    for(var item in result.data){
                        $("[name='"+item+"']").next().text("! "+result.data[item]);
                        $("[name='"+item+"']").next().show();
                    }
                }
            }
        })
    }
    //显示反馈页面
    /*function showDiv(tr){
        $('#area11').text($(tr).parent().children('input:eq(0)').val());
        var option=$(tr).parent().children('input:eq(1)').val()
        $('#area22').text(option==''?'无':option);
        $('#area33').text($(tr).parent().children('input:eq(2)').val());
        $('#feekbackId').show();
    }
    //关闭
    function closeDivApply(){
        $('#feekbackId').hide();
    }*/

    function fnAuthMethod(obj){
        var str=$(obj).val();
        if(str==='银行卡号认证'){
            $('#authBankId').show()
            $('#authPhoneId').hide()
            $('#authIdCardId').hide()
        }else if(str==='手机认证'){
            $('#authPhoneId').show()
            $('#authBankId').hide()
            $('#authIdCardId').show()
        }else{
            $('#authIdCardId').show()
            $('#authBankId').hide()
            $('#authPhoneId').hide()
        }

    }
    (function(){$('#authIdCardId').show()}())
</script>
</html>
