<div class="main">
    <div class="tabcontent" data-tab-params="tabName:'基本资料'">
        <form method="post" id="_form" class="form-horizontal form  form-control-sm ui-validForm" data-custom-params="beforeSubmit:'BeforeSubmit'" data-source="@ViewBag.MemberData">
            @{
                string beforeSubmitJs = "";
                var data = new ViewDataDictionary();
                data.Add("from", "member");
                data.Add("currentUser", ViewBag.CurrentUser);
                data.Add("i", 0);
                IEnumerable<dynamic> FieldData = ViewBag.FieldData;
                int i = 0;
                if (FieldData != null)
                {
                    foreach (var row in FieldData)
                    {
                        data["i"] = i;
                        beforeSubmitJs += row.BeforeSubmitJs;
                        Html.RenderPartial("~/Areas/E/Views/CustomForm/FormPartial.cshtml", (object)row, data);
                        i++;
                    }
                }

            }
            <script type="text/javascript">
                function BeforeSubmit() {
                    @beforeSubmitJs
                    return true;
                }
            </script>

            <div class="postarea">
                <div class="control-group">
                    <div class="controls">
                        @Html.AntiForgeryToken()
                        <input type="hidden" id="Id" name="Id" value="0" />
                        <input type="hidden" id="Guid" name="Guid" value="@ViewBag.Guid" />
                        <input type="hidden" id="State" name="State" value="1" />
                        <input type="hidden" id="IsAdmin" name="IsAdmin" value="0" />
                        <input type="hidden" id="Logins" name="Logins" value="0" />
                        <input type="hidden" id="Password" name="Password" value="" />
                        <input type="hidden" id="MemberGroupId" name="MemberGroupId" value="0" />
                        <input type="hidden" id="DepartmentId" name="DepartmentId" value="0" />
                        <input type="hidden" name="Email" id="Email" value="">
                        <input type="hidden" name="Mobile" id="Mobile" value="">
                        <input type="hidden" id="Username" name="Username" />
                        <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action("Edit")'">提交</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="tabcontent" data-tab-params="tabName:'邮箱绑定'">
        <form method="post" id="_form" class="form-horizontal form form-control-sm ui-validForm" data-custom-params="beforeSubmit:'BeforeSubmit'" data-source="@ViewBag.MemberData">

            <div class="control-group">
                <label class="control-label">绑定邮箱</label>
                <div class="controls form-inline">
                    <input type="password" class="form-control form-control-sm" name="email" id="email" data-validate="dataType:'email',nullMsg:'请填写绑定的邮箱!',errorMsg:''" maxlength="40">
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">邮件验证码</label>
                <div class="controls form-inline">
                    <input type="text" id="_EmailCode" name="_EmailCode" class="form-control form-control-sm" maxlength="6" placeholder="邮件验证码" data-validate="dataType:'numeric',minLength:6,minLengthErrorMsg:'邮件验证码为6位数字！',nullMsg:'请填写邮件验证码',checkUrl:'/E/EmailCode/Validate',checkError:'邮件验证码填写错误',additionals:'#email'">
                    <button type="button" class="btn btn-default form-control ui-btn-sendCode" data-send-params="type:'email',seconds:90,accordingObj:'#email'">发送验证码</button>
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="postarea">
                <div class="control-group">
                    <div class="controls">
                        @Html.AntiForgeryToken()
                        <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action("ModifyPassword")'">提交</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="tabcontent" data-tab-params="tabName:'手机绑定'">
        <form method="post" id="_form" class="form-horizontal form  form-control-sm ui-validForm" data-custom-params="beforeSubmit:'BeforeSubmit'" data-source="@ViewBag.MemberData">

            <div class="control-group">
                <label class="control-label">绑定手机</label>
                <div class="controls">
                    <input type="text" id="mobile" name="mobile" class="form-control form-control-sm" maxlength="15" placeholder="手机号码" data-validate="dataType:'mobile',nullMsg:'请填写手机号码',errorMsg:'手机号码格式错误'@if(ViewBag.MobileOnlyOne =="1"){<text>,checkUrl: '@Url.Action("CheckRegMobile","CheckRepeate",new {id=Request.QueryString["id"],area = "E" })',checkError: '此手机号已经被注册'</text>}">
                    <span class="help-block"></span>
                </div>
            </div>

      
            <div class="control-group">
                <label class="control-label">手机验证码</label>
                <div class="controls form-inline">
                    <input type="text" id="_SmsCode" name="_SmsCode" class="form-control form-control-sm" maxlength="6" placeholder="手机验证码" data-validate="dataType:'numeric',minLength:6,minLengthErrorMsg:'手机验证码为6位数字！',nullMsg:'请填写手机验证码！',checkUrl:'/E/SmsCode/Validate',checkError:'手机验证码填写错误',additionals:'#mobile'">
                    <button type="button" class="btn btn-default form-control ui-btn-sendCode" data-send-params="type:'mobile',seconds:90,accordingObj:'#mobile'">发送验证码</button>
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="postarea">
                <div class="control-group">
                    <div class="controls">
                        @Html.AntiForgeryToken()
                        <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action("ModifyPassword")'">提交</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="tabcontent" data-tab-params="tabName:'密码修改'">
        <form method="post" id="_form" class="form-horizontal form  form-control-sm ui-validForm" data-custom-params="beforeSubmit:'BeforeSubmit'" data-source="@ViewBag.MemberData">

            <div class="control-group">
                <label class="control-label">旧密码</label>
                <div class="controls form-inline">
                    <input type="password" class="form-control form-control-sm" name="oldPassword" id="oldPassword" data-validate="dataType:'*',nullMsg:'请填旧密码!',errorMsg:''" maxlength="16">
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">新密码</label>
                <div class="controls form-inline">
                    <input type="password" class="form-control form-control-sm" name="newPassword"  id="newPassword" data-validate="dataType:'password',nullMsg:'请填写新密码!',errorMsg:''" maxlength="16">
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">新确认密码</label>
                <div class="controls form-inline">
                    <input type="password" class="form-control form-control-sm" name="password1" data-validate="dataType:'*',nullMsg:'请填写确认密码!',errorMsg:'两次密码输入不一致!',compare:'#newPassword'" maxlength="16">
                    <span class="help-block"></span>
                </div>
            </div>

            <div class="postarea">
                <div class="control-group">
                    <div class="controls">
                        @Html.AntiForgeryToken()
                        <button type="button" class="btn btn-primary btn-sm ui-pagePost" data-custom-params="url:'@Url.Action("ModifyPassword")'">提交</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">
    $(".tabcontent").InitTab(); //初始化选项卡，并设置回调函数为LoadData()
    $("#_form").FormBind({ dataSourceFrom: "attr" });
</script>
