<%@ Page Title="" Language="C#" MasterPageFile="~/Master/UserPageMaster.master" CodeBehind="InitInfo.aspx.cs" Inherits="WAP2P.Web.PC.User.InitInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-container g-zindexmin g-ohide mt20 mb20 m-globalbox m-wholebox">
        <div class="m-title">
            <span><i class="iconfont fs30">&#xe630;</i> 基本资料向导</span>
        </div>
        <p class="m-infotip">为了保障您的资金安全以及更健康的网络环境，我们需要您提供相关资料并设置有效的支付密码。当设置成功后，方可在平台中进行相关的投资理财操作。<br />
            您也可以暂时不提交资料，<a href="/User/?rnd=true">先随便看看>></a></p>
         <ruson:Space runat="server" ID="stepnav" Visible="false">
        <div class="t-flowsteps js-stepnav">
            <ol class="ui-stepbar step-num2">
                <li class="first current">
                    <span>
                        <i>1</i>
                        <em>个人资料</em>
                    </span>
                </li>

                <li class="last">
                    <span>
                        <i>2</i>
                        <em>支付密码</em>
                    </span>
                </li>
            </ol>
        </div>
            </ruson:Space>
        <div class="form-big ml204">
            <form class="js-auto js-vsum <% =string.IsNullOrWhiteSpace(CurrentUser.PayPassowrd) ? "js-step" : string.Empty %>" action="<% =Request.RawUrl.UrlEncodeParam() %>" method="post" data-onsuccess="common.pageTip('<% =PageBase.TipType.Success %>', ' 资料设置成功。', '/User/', '会员首页');">
                <div class="<% =string.IsNullOrWhiteSpace(CurrentUser.PayPassowrd) ? "js-step" : string.Empty %>">
                    <div class="input-big mt40">
                        <label class="leftfont">帐户昵称</label>
                        <input type="text" name="nickname" class="text w332" maxlength="20" placeholder="请输入帐户昵称" data-vtype="must|ajax" data-vurl="?action=checkNickname" data-vmsg="请输入帐户昵称。|该昵称已被使用。" />
                        <span class="prompt">请勿设置与账号相同的昵称，以保障您的帐户安全。</span>
                    </div>
                    <ruson:Space runat="server" ID="phoneDiv">
                        <div class="input-big js-tip mt40">
                            <label class="leftfont">手机号码</label>
                            <input type="text" name="phone" id="phone" class="text w332" placeholder="请输入您的手机号码" data-vtype="phone" data-vmsg="请输入手机号码。" maxlength="11" />
                        </div>
                        <div class="input-big js-sendvcode" data-vcode-target="#phone">
                            <label class="leftfont">手机验证码</label>
                            <input type="text" name="validCode" class="text js-sendvcode-code" size="20" placeholder="请输入您收到的验证码" disabled="disabled" maxlength="6" data-vtype="length|fun" data-vfun="validPhoneCode" data-vmin="6" data-vmax="6" data-vmsg="请输入正确的验证码。|验证码不正确。" />
                            <input type="button" class="btn-nobordbig c-normal js-sendvcode-btn" value="发送验证码" />
                        </div>
                    </ruson:Space>
                    <ruson:Space runat="server" ID="idCardDiv">
                        <ruson:Space runat="server" id="cardUploadDiv" visible="false">                        
                            <div class="input-big t-uploadid">
                                <span class="uploadid-span">身份证照片</span>
                                <div class="uploadid-photobox mr10">
                                    <div class="uploadid-photo">
                                        <img src="/Res/core/Images/bg/id.png" id="cardImg1" />
                                    </div>
                                    <span class="img"></span>
                                    <input type="file" value="上传正面" id="btnCard1" style="display: none;"/>
                                    <input type="hidden" name="cardPhoto1" id="cardPhoto1" data-vtype="must" data-vmsg="请上传身份证正面。" />
                                </div>
                                <div class="uploadid-photobox">
                                    <div class="uploadid-photo">
                                        <img src="/Res/core/Images/bg/id.png" id="cardImg2" />
                                    </div>
                                    <span class="img"></span>
                                    <input type="file" value="上传反面" id="btnCard2" style="display: none;" />
                                    <input type="hidden" name="cardPhoto2" id="cardPhoto2" data-vtype="must" data-vmsg="请上传身份证反面。" />
                                </div>
                            </div>
                        </ruson:Space>
                        <div class="input-big g-clear">
                            <label class="leftfont">真实姓名</label>
                            <input type="text" class="text w332" name="realName" maxlength="50" data-vtype="must" data-vmsg="请输入真实姓名。" placeholder="请输入您的真实姓名" />
                        </div>
                        <div class="input-big">
                            <label class="leftfont">身份证号</label>
                            <input type="text" class="text w332" name="cardNumber" maxlength="50" data-vtype="custom|ajax" data-vurl="?action=existsCard" data-vreg="^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$" data-vmsg="请输入正确的身份证号码。|身份证号码已存在。" placeholder="请输入您的身份证证件号" />
                        </div>
                    </ruson:Space>
                    <div class="btn-submits ml99">                    
                        <ruson:Space runat="server" ID="submit" Visible="true">
                            <input type="submit" value="提 交 并 修 改" class="btn-bbord fs16 c-normal w366" />
                        </ruson:Space>
                        <ruson:Space runat="server" ID="nextstep" Visible="false">
                            <input type="submit" value="下 一 步" class="btn-nobordbig c-normal w172 g-left" /><a href="/User/?rnd=true" class="ml50 g-left mt10">先随便逛逛>></a>
                        </ruson:Space>
                        <div class="g-clear"></div>
                        <div class="w366"><em class="m-sumtip js-vsum"></em></div>
                    </div>
                </div>
                <ruson:Space runat="server" ID="newPayPwd" Visible="false">
                    <div class="js-step g-hide">
                        <div class="input-big mt40">
                            <label class="leftfont">支付密码</label>
                            <input type="password" class="text w332" name="newPayPwd" placeholder="请输入您的支付密码" id="password1" maxlength="50" data-vtype="must|length" data-vmin="6" data-vmax="50" data-vmsg="请输入密码。|密码长度过短。" />
                            <span class="prompt">支付密码是确认资金交易的重要凭证，不能与登录密码一致。</span>
                        </div>
                        <div class="input-big">
                            <label class="leftfont">密码确认</label>
                            <input type="password" class="text w332" placeholder="请再次输入您的支付密码" data-vtype="must|same" data-vref="password1" data-vmsg="请输入确认密码。|两次密码输入不一致。" />
                        </div>
                        <div class="btn-submits ml99">
                            <input type="submit" value="提 交 并 修 改" class="btn-bbord fs16 c-normal w366" />
                            <div class="w366"><em class="m-sumtip js-vsum"></em></div>
                        </div>
                    </div>
                </ruson:Space>
            </form>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script src="<% =this.ImportJsCss("~/res/uploadify/jquery.uploadify.min.js") %>"></script>
    <script>
        function validPhoneCode(val) {
            return common.sendValidCode.valid($('#phone').val(), val);
        };

        common.sendValidCode.initInput();

        var initUpload = function (n) {
            setTimeout(function () {
                $('#btnCard' + n).uploadify({
                    width: 136,
                    height: 36,
                    multi: false,
                    removeTimeout: 0,
                    swf: '/res/uploadify/uploadify.swf?v=<% =CryptoHelper.Random(100000,999999) %>',
                    uploader: '/res/uploadify/SwfUpload<% =PageExt %>?type=image&width=600',
                    buttonClass:'btn-nobordbig c-normal',
                    buttonText: n == 1 ?  '上传身份证正面' : '上传身份证反面',
                    fileTypeExts: '<% =WAP2P.Web.PC.Res.uploadify.SwfUpload.AllowImages %>',
                    formData: {
                        <% =WAP2P.Web.User.Membership.CookieName %> : '<% =Request.Cookies[WAP2P.Web.User.Membership.CookieName].Value %>'
                    },
                    onUploadSuccess: function(res, data) {
                        eval('var d = ' + data);                     
                        if (d.Success) {
                            $('#cardPhoto' + n).val(d.Message).trigger('blur');
                            $('#cardImg' + n).attr('src', d.Message);
                        } else {
                            alert(d.Message);
                        }
                    }
                });
            }, 10);
        };

        initUpload(1);
        initUpload(2);
    </script>
</asp:Content>
