<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存设置'); ?></button>
            <?php echo $this->HelpUrl('customerSet'); ?>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"><?php echo $this->translate('基本设置'); ?></a></li>
                        <li><a href="#tab_2" data-toggle="tab"><?php echo $this->translate('客户协议'); ?></a></li>
                        <li><a href="#tab_3" data-toggle="tab"><?php echo $this->translate('登录注册'); ?></a></li>
                        <li><a href="#tab_4" data-toggle="tab"><?php echo $this->translate('第三方登录'); ?></a></li>
                        <li><a href="#tab_5" data-toggle="tab"><?php echo $this->translate('充值与提现'); ?></a></li>
                        <!--li><a href="#tab_6" data-toggle="tab"><?php echo $this->translate('验证设置'); ?></a></li-->
                    </ul>
                    <div class="tab-content">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="tab-pane active" id="tab_1">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('客户注册状态'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('register_status')); ?>
                                        <?php echo $this->formElementErrors($form->get('register_status'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('注册关闭显示内容'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('register_close_message')); ?>
                                        <?php echo $this->formElementErrors($form->get('register_close_message'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('默认头像'); ?></label>
                                    <div class="col-sm-3">
                                        <img src="<?php echo $this->basePath($form->get('default_user_avatar')->getValue()) . '?v='.time(); ?>" style="max-width: 60px;padding-bottom: 5px;">
                                        <?php echo $this->formElement($form->get('default_user_avatar')); ?>
                                        <?php echo $this->formElementErrors($form->get('default_user_avatar'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('客户注册默认分组'); ?><span class="must_add_value">*</span></label>
                                    <div class="col-sm-2">
                                        <?php echo $this->formElement($form->get('default_user_group_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('default_user_group_id'), ['class'=>'error-message']); ?>
                                    </div>
                                    <p class="form-control-static"><small><?php echo $this->translate('必须是未启用等级积分的客户组'); ?></small></p>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('新客户注册验证'); ?></label>
                                    <div class="col-sm-2">
                                        <?php echo $this->formElement($form->get('user_register_audit')); ?>
                                        <?php echo $this->formElementErrors($form->get('user_register_audit'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('客户账号注册保留字'); ?></label>
                                    <div class="col-sm-4">
                                        <?php echo $this->formElement($form->get('user_register_retain')); ?>
                                        <?php echo $this->formElementErrors($form->get('user_register_retain'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('发送欢迎邮件'); ?></label>
                                    <div class="col-sm-4">
                                        <label class="checkbox-inline">
                                            <?php echo $this->formElement($form->get('register_welcome_email')); ?> <?php echo $this->translate('启用'); ?>
                                            <?php echo $this->formElementErrors($form->get('register_welcome_email'), ['class'=>'error-message']); ?>
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('欢迎电邮标题'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('welcome_email_title')); ?>
                                        <?php echo $this->formElementErrors($form->get('welcome_email_title'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('欢迎电邮内容'); ?></label>
                                    <div class="col-sm-8">
                                        <script id="welcome_email_body" name="welcome_email_body" type="text/plain"><?php echo $this->welcomeEmailBody; ?></script>
                                        <?php echo $this->formElementErrors($form->get('welcome_email_body'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_2">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label"><?php echo $this->translate('注册协议'); ?></label>
                                    <div class="col-sm-11">
                                        <script id="register_agreement" name="register_agreement" type="text/plain"><?php echo $this->registerAgreement; ?></script>
                                        <?php echo $this->formElementErrors($form->get('register_agreement'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_3">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><strong><?php echo $this->translate('客户注册'); ?></strong></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('电子邮箱'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('register_email_state')); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                        <?php echo $this->formElementErrors($form->get('register_email_state'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('手机号码'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('register_phone_state')); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                        <?php echo $this->formElementErrors($form->get('register_phone_state'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('手机验证码'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('register_phone_captcha')); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                        <?php echo $this->formElementErrors($form->get('register_phone_captcha'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><strong><?php echo $this->translate('客户登录'); ?></strong></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('可用登录项'); ?></label>
                                    <div class="col-sm-4">
                                        <label class="checkbox-inline"><input type="checkbox" checked disabled><?php echo $this->translate('登录账号'); ?></label>
                                        <?php echo $this->formElement($form->get('login_item')); ?>
                                        <?php echo $this->formElementErrors($form->get('login_item'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_4">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('微信登录(微信内)'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('weixin_login_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('weixin_login_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('授权回调域'); ?></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><?php echo str_replace(['https://', 'http://'], '', $this->serverUrl()); ?></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP ID'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('weixin_app_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('weixin_app_id'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP KEY'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('weixin_app_key')); ?>
                                        <?php echo $this->formElementErrors($form->get('weixin_app_key'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('微信登录(网站)'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('weixin_web_login_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('weixin_web_login_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('授权回调域'); ?></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><?php echo str_replace(['https://', 'http://'], '', $this->serverUrl()); ?></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP ID'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('weixin_web_app_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('weixin_web_app_id'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP KEY'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('weixin_web_app_key')); ?>
                                        <?php echo $this->formElementErrors($form->get('weixin_web_app_key'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('QQ互联登录'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('qq_login_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('qq_login_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('回调地址'); ?></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><?php echo str_replace(['https://', 'http://'], '', $this->url('shop-user', ['action' => 'otherLoginCallBack', 'id' => 'qq'], ['force_canonical' => true])); ?></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP ID'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('qq_app_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('qq_app_id'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('APP KEY'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('qq_app_key')); ?>
                                        <?php echo $this->formElementErrors($form->get('qq_app_key'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('支付宝登录'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('alipay_login_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('alipay_login_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('回调地址'); ?></label>
                                    <div class="col-sm-8">
                                        <p class="form-control-static"><?php echo str_replace(['https://', 'http://'], '', $this->url('shop-user', ['action' => 'otherLoginCallBack'], ['force_canonical' => true])); ?></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('AppID'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('alipay_app_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('alipay_app_id'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('私钥'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('alipay_private_key')); ?>
                                        <?php echo $this->formElementErrors($form->get('alipay_private_key'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('公钥'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('alipay_public_key')); ?>
                                        <?php echo $this->formElementErrors($form->get('alipay_public_key'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_5">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('余额充值'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('recharge_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('recharge_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('余额提现'); ?></label>
                                    <div class="col-sm-4">
                                        <div class="checkbox">
                                            <label>
                                                <?php echo $this->formElement($form->get('withdraw_state')); ?>
                                                <?php echo $this->formElementErrors($form->get('withdraw_state'), ['class'=>'error-message']); ?>
                                                <?php echo $this->translate('启用'); ?>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--div class="tab-pane" id="tab_6">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('登录密码修改'); ?></label>
                                    <div class="col-sm-3">
                                        <?php //echo $this->formElement($form->get('user_login_password_edit')); ?>
                                        <?php //echo $this->formElementErrors($form->get('user_login_password_edit'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('支付密码修改'); ?></label>
                                    <div class="col-sm-3">
                                        <?php //echo $this->formElement($form->get('user_pay_password_edit')); ?>
                                        <?php //echo $this->formElementErrors($form->get('user_pay_password_edit'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('电子邮箱修改'); ?></label>
                                    <div class="col-sm-3">
                                        <?php //echo $this->formElement($form->get('user_email_edit')); ?>
                                        <?php //echo $this->formElementErrors($form->get('user_email_edit'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('手机号码修改'); ?></label>
                                    <div class="col-sm-3">
                                        <?php //echo $this->formElement($form->get('user_phone_edit')); ?>
                                        <?php //echo $this->formElementErrors($form->get('user_phone_edit'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div-->
                    </div>
                </div>
            </div>
        </div>
    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<?php echo $this->partial('common/editor',['edit_array' => ['welcome_email_body', 'register_agreement'], 'edit_config' => ["toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold']]", "initialFrameHeight:200"]]); ?>