注册登录优化

This commit is contained in:
devil_gong 2019-05-16 18:42:22 +08:00
parent 5f8f1600da
commit 7754b16515
29 changed files with 893 additions and 767 deletions

View File

@ -0,0 +1,78 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\service\ConfigService;
/**
* 协议管理
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Agreement extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T12:39:08+0800
*/
public function __construct()
{
// 调用父类前置方法
parent::__construct();
// 登录校验
$this->IsLogin();
// 权限校验
$this->IsPower();
}
/**
* 配置列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-16
* @desc description
*/
public function Index()
{
// 配置信息
$this->assign('data', ConfigService::ConfigList());
// 编辑器文件存放地址
$this->assign('editor_path_type', 'agreement');
// 导航/视图
$nav_type = input('type', 'register');
$this->assign('nav_type', $nav_type);
return $this->fetch($nav_type);
}
/**
* 配置数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-16
* @desc description
*/
public function Save()
{
return ConfigService::ConfigSave($_POST);
}
}
?>

View File

@ -55,7 +55,7 @@ class Site extends Common
// 站点状态
$this->assign('site_site_state_list', lang('site_site_state_list'));
// 是否开启用户注册
// 用户注册类型列表
$this->assign('site_user_reg_state_list', lang('site_user_reg_state_list'));
// 是否开启用户登录

View File

@ -23,12 +23,6 @@ return array(
1 => array('value' => 1, 'name' => '开启'),
),
// 是否开启用户注册
'site_user_reg_state_list' => array(
0 => array('value' => 'sms', 'name' => '短信'),
1 => array('value' => 'email', 'name' => '邮箱'),
),
// 是否开启用户登录
'site_user_login_state_list' => array(
0 => array('value' => 0, 'name' => '关闭'),

View File

@ -0,0 +1,5 @@
<ul class="am-nav am-nav-pills table-nav m-b-10">
<li {{if $nav_type eq 'register'}}class="am-active"{{/if}} data-type="register">
<a href="{{:MyUrl('admin/agreement/index', ['nav_type'=>'register'])}}">用户注册协议</a>
</li>
</ul>

View File

@ -0,0 +1,33 @@
{{include file="public/header" /}}
<!-- right content start -->
<div class="content-right">
<div class="content">
<!-- table nav start -->
{{include file="agreement/nav" /}}
<!-- table nav end -->
<!-- form start -->
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/agreement/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/agreement/index', ['type'=>$nav_type])}}">
<div class="am-form-group">
<div class="am-cf">
<label>{{$data.common_agreement_userregister.name}}<span class="am-form-group-label-tips">{{$data.common_agreement_userregister.describe}}</span></label>
<a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank" class="am-fr">查看详情</a>
</div>
<textarea class="am-radius am-validate" name="{{$data.common_agreement_userregister.only_tag}}" maxlength="105000" id="editor-tag" data-validation-message="{{$data.common_agreement_userregister.error_tips}}">{{if !empty($data)}}{{$data.common_agreement_userregister.value|raw}}{{/if}}</textarea>
</div>
<div class="am-form-group am-form-group-refreshing">
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
<a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank">
<button type="button" class="am-btn am-btn-default am-btn-xs am-btn-block m-t-20">查看详情</button>
</a>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -0,0 +1,69 @@
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\service\ConfigService;
use app\service\SeoService;
/**
* 协议
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class Agreement extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
}
/**
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-16
* @desc description
*/
public function Index()
{
// 参数
$params = input();
// 获取协议内容
$data = [];
if(!empty($params['document']))
{
$key = 'common_agreement_'.$params['document'];
$ret = ConfigService::ConfigContentRow($key);
// 浏览器标题
if(!empty($ret['data']['name']))
{
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle($ret['data']['name']));
}
$data = $ret['data'];
}
$this->assign('data', $data);
return $this->fetch();
}
}
?>

View File

@ -126,11 +126,11 @@ class Common extends Controller
// 用户注册页面钩子
$this->assign('plugins_view_user_reg_info_data', Hook::listen('plugins_view_user_reg_info', ['hook_name'=>'plugins_view_user_reg_info', 'is_backend'=>false, 'user'=>$this->user]));
// 用户注册短信页面钩子
$this->assign('plugins_view_user_sms_reg_info_data', Hook::listen('plugins_view_user_sms_reg_info', ['hook_name'=>'plugins_view_user_sms_reg_info', 'is_backend'=>false, 'user'=>$this->user]));
// 用户注册页面顶部钩子
$this->assign('plugins_view_user_reg_info_top_data', Hook::listen('plugins_view_user_reg_info_top', ['hook_name'=>'plugins_view_user_reg_info_top', 'is_backend'=>false, 'user'=>$this->user]));
// 用户注册邮箱页面钩子
$this->assign('plugins_view_user_email_reg_info_data', Hook::listen('plugins_view_user_email_reg_info', ['hook_name'=>'plugins_view_user_email_reg_info', 'is_backend'=>false, 'user'=>$this->user]));
// 用户注册页面底部钩子
$this->assign('plugins_view_user_reg_info_bottom_data', Hook::listen('plugins_view_user_reg_info_bottom', ['hook_name'=>'plugins_view_user_reg_info_bottom', 'is_backend'=>false, 'user'=>$this->user]));
// 底部导航上面钩子
$this->assign('plugins_view_common_footer_top_data', Hook::listen('plugins_view_common_footer_top', ['hook_name'=>'plugins_view_common_footer_top', 'is_backend'=>false, 'user'=>$this->user]));

View File

@ -202,62 +202,6 @@ class User extends Common
}
}
/**
* [EmailRegInfo 用户注册页面-邮箱]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-10T12:18:17+0800
*/
public function EmailRegInfo()
{
if(in_array('email', MyC('home_user_reg_state')))
{
if(empty($this->user))
{
// 浏览器名称
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户邮箱注册', 1));
$this->assign('referer_url', $this->GetrefererUrl());
return $this->fetch();
} else {
$this->assign('msg', '已经登录了,如要注册新账户,请先退出当前账户');
return $this->fetch('public/tips_error');
}
} else {
$this->assign('msg', '暂时关闭邮箱注册');
return $this->fetch('public/tips_error');
}
}
/**
* [SmsRegInfo 用户注册页面-短信]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-02T22:48:35+0800
*/
public function SmsRegInfo()
{
if(in_array('sms', MyC('home_user_reg_state')))
{
if(empty($this->user))
{
// 浏览器名称
$this->assign('home_seo_site_title', SeoService::BrowserSeoTitle('用户短信注册', 1));
$this->assign('referer_url', $this->GetrefererUrl());
return $this->fetch();
} else {
$this->assign('msg', '已经登录了,如要注册新账户,请先退出当前账户');
return $this->fetch('public/tips_error');
}
} else {
$this->assign('msg', '暂时关闭短信注册');
return $this->fetch('public/tips_error');
}
}
/**
* [LoginInfo 用户登录页面]
* @author Devil

View File

@ -0,0 +1,35 @@
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- content -->
<div class="am-container">
{{if !empty($data)}}
<article class="am-article am-margin-top-lg xo-padding-horizontal-md-xs">
<div class="am-article-hd am-text-center">
<h1 class="am-article-title am-text-default">{{$data.name}}</h1>
<p class="am-article-meta am-margin-top-xs">{{$data.upd_time_time}}</p>
</div>
<hr data-am-widget="divider" class="am-divider am-divider-default" />
<div class="am-article-bd am-margin-top-lg">
{{$data.value|raw}}
</div>
</article>
{{else /}}
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
{{/if}}
</div>
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

View File

@ -383,7 +383,7 @@
{{/if}}
<!-- tab -->
<div class="am-tabs" data-am-tabs id="goods-tabs">
<div class="am-tabs" data-am-tabs="{noSwipe: 1}">
<ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs" data-am-sticky="{animation: 'slide-top'}">
<li class="am-active">
<a href="javascript:;">

View File

@ -67,7 +67,7 @@
{{if MyC('home_user_login_state') eq 1}}
<a class="am-btn-primary btn" href="{{:MyUrl('index/user/loginInfo')}}">登录</a>
{{/if}}
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state')) or in_array('username', MyC('home_user_reg_state'))}}
<a class="am-btn-primary btn" href="{{:MyUrl('index/user/regInfo')}}">注册</a>
{{/if}}
</div>

View File

@ -10,7 +10,7 @@
{{if MyC('home_user_login_state') eq 1}}
[<a href="{{:MyUrl('index/user/logininfo')}}">登录</a>]
{{/if}}
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state')) or in_array('username', MyC('home_user_reg_state'))}}
[<a href="{{:MyUrl('index/user/regInfo')}}">注册</a>]
{{/if}}
{{else /}}

View File

@ -1,131 +0,0 @@
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- conntent start -->
<div class="am-g my-content">
<div class="am-u-md-6 am-u-sm-centered">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<fieldset>
{{if MyC('home_user_login_state') eq 1}}
<span>已有帐号?</span>
<a href="{{:MyUrl('index/user/logininfo')}}">
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius">立即登录</button>
</a>
{{/if}}
<!-- 用户注册邮箱页面钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_email_reg_info</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_email_reg_info_data) and is_array($plugins_view_user_email_reg_info_data)}}
{{foreach $plugins_view_user_email_reg_info_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<hr />
<div class="am-form-group am-form-group-refreshing">
<label>电子邮箱
{{if in_array('sms', MyC('home_user_reg_state'))}}
<a href="{{:MyUrl('index/user/smsreginfo')}}" class="reg-switch-tips">没邮箱?使用手机号码注册</a>
{{/if}}
</label>
<input type="email" name="accounts" class="am-radius" id="accounts" placeholder="电子邮箱" data-validation-message="电子邮箱格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<input type="hidden" name="type" value="email" />
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
<a href="{{:MyUrl('index/user/forgetpwdinfo')}}" class="am-fr m-t-5">忘记密码?</a>
</div>
</fieldset>
</form>
<!-- form end -->
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">看不清换一张</a>
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
</div>
</div>
</div>
<!-- verify win end -->
</div>
</div>
<!-- conntent end -->
{{include file="public/footer" /}}
<script type="text/javascript">
// 注册成功回调
function RegisterSuccessBack(e)
{
if(e.code == 0)
{
$.AMUI.progress.done();
Prompt(e.msg, 'success');
// 登录返回html处理
if((e.data.body_html || null) != null)
{
$('body').append(e.data.body_html);
}
setTimeout(function()
{
window.location.href = '{{$referer_url}}';
}, 1500);
} else {
$('form.form-validation').find('button[type="submit"]').button('reset');
$.AMUI.progress.done();
Prompt(e.msg);
}
}
</script>

View File

@ -13,66 +13,72 @@
{{include file="public/goods_category" /}}
<!-- conntent start -->
<div class="am-g my-content">
<div class="am-u-md-6 am-u-sm-centered">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/forgetpwd')}}" request-type="ajax-url" request-value="{{:MyUrl('index/user/logininfo')}}">
<fieldset>
<div class="am-container user-forgetpwd-container">
<div class="am-hide-sm-only am-u-md-6 am-u-lg-8 am-vertical-align am-text-center container-left">
<img src="http://b2b2c.shopnctest.com/dema/data/upload/shop/login/4.jpg" class="am-vertical-align-middle" />
</div>
<div class="am-u-sm-10 am-u-md-6 am-u-lg-4 container-right">
<div class="forgetpwd-top">
{{if MyC('home_user_login_state') eq 1}}
<span>已有帐号?</span>
<a href="{{:MyUrl('index/user/logininfo')}}" class="am-btn am-btn-secondary am-btn-xs am-radius">立即登录</a>
<hr />
{{/if}}
<div class="am-form-group am-form-group-refreshing">
<label>手机/邮箱</label>
<input type="text" name="accounts" class="am-radius" id="accounts" minlength="1" placeholder="手机/邮箱" data-validation-message="手机/邮箱格式有误" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/forgetpwdverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
<div class="user-form-container">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/forgetpwd')}}" request-type="ajax-url" request-value="{{:MyUrl('index/user/logininfo')}}">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>手机/邮箱</label>
<input type="text" name="accounts" class="am-radius" id="accounts" minlength="1" placeholder="手机/邮箱" data-validation-message="手机/邮箱格式有误" required />
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">确认</button>
</div>
</fieldset>
</form>
<!-- form end -->
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'forget'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'forget'])}}#'+Math.random();">看不清换一张</a>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/forgetpwdverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}" data-form-tag="form.form-validation">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
<div class="am-form-group am-form-group-refreshing business-form-block">
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-block am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">确认</button>
</div>
</form>
<!-- form end -->
</div>
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'forget'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'forget'])}}#'+Math.random();">看不清换一张</a>
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
</div>
</div>
</div>
<!-- verify win end -->
</div>
<!-- verify win end -->
</div>
</div>
<!-- conntent end -->

View File

@ -14,16 +14,18 @@
<!-- conntent start -->
<div class="am-g my-content">
<div class="am-u-md-6 am-u-sm-centered">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/login')}}" request-type="ajax-fun" request-value="LoginSuccessBack">
<fieldset>
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
<span class="">还没有帐号?</span>
<a href="{{:MyUrl('index/user/reginfo')}}" class="am-btn am-btn-secondary am-btn-xs am-radius">立即注册</a>
{{/if}}
<div class="am-container user-login-container">
<div class="am-hide-sm-only am-u-md-6 am-u-lg-8 am-vertical-align am-text-center container-left">
<img src="http://b2b2c.shopnctest.com/dema/data/upload/shop/login/2.jpg" class="am-vertical-align-middle" />
</div>
<div class="am-u-sm-10 am-u-md-6 am-u-lg-4 container-right">
<div class="forgetpwd-top">
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state'))}}
<span class="">还没有帐号?</span>
<a href="{{:MyUrl('index/user/reginfo')}}" class="am-btn am-btn-secondary am-btn-xs am-radius">立即注册</a>
{{/if}}
<!-- 用户登录页面顶部钩子 -->
<!-- 用户登录页面顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_login_info_top</span>
@ -36,26 +38,29 @@
{{/if}}
{{/foreach}}
{{/if}}
<hr />
</div>
<div class="user-form-container">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/login')}}" request-type="ajax-fun" request-value="LoginSuccessBack">
<div class="am-form-group am-form-group-refreshing">
<label>登录账号</label>
<input type="text" name="accounts" class="am-radius" minlength="1" placeholder="用户名/手机/邮箱" data-validation-message="请填写登录账号" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<label>登录账号</label>
<input type="text" name="accounts" class="am-radius" minlength="1" placeholder="用户名/手机/邮箱" data-validation-message="请填写登录账号" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<label>登录密码</label>
<input type="password" name="pwd" class="am-radius" placeholder="登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '登录中...'}">登录</button>
<a href="{{:MyUrl('index/user/forgetpwdinfo')}}" class="am-fr">忘记密码?</a>
</div>
</fieldset>
</form>
<!-- form end -->
</div>
<div class="am-form-group am-form-group-refreshing">
<label>登录密码</label>
<input type="password" name="pwd" class="am-radius" placeholder="登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '登录中...'}">登录</button>
<a href="{{:MyUrl('index/user/forgetpwdinfo')}}" class="am-fr">忘记密码?</a>
</div>
</form>
<!-- form end -->
</div>
</div>
</div>
</div>
<!-- conntent end -->

View File

@ -13,185 +13,243 @@
{{include file="public/goods_category" /}}
<!-- conntent start -->
<div class="am-g my-content">
<div class="am-u-md-8 am-u-lg-5 am-u-sm-centered">
<div class="register-container">
<div class="register-top">
{{if MyC('home_user_login_state') eq 1}}
<span>已有帐号?</span>
<a href="{{:MyUrl('index/user/logininfo')}}">
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius">立即登录</button>
</a>
<div class="am-g my-content user-register-container">
<div class="am-container">
<!-- 用户注册页面顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_reg_info_top</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_reg_info_top_data) and is_array($plugins_view_user_reg_info_top_data)}}
{{foreach $plugins_view_user_reg_info_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
</div>
{{/foreach}}
{{/if}}
<div data-am-widget="tabs" class="am-tabs am-tabs-d2">
<ul class="am-tabs-nav am-cf">
<li class="am-active"><a href="[data-tab-panel-0]">账号注册</a></li>
<li class=""><a href="[data-tab-panel-1]">手机注册</a></li>
<li class=""><a href="[data-tab-panel-2]">邮箱注册</a></li>
</ul>
<div class="am-tabs-bd">
<div data-tab-panel-0 class="am-tab-panel am-active">
<!-- form start -->
<form class="am-form form-validation-username" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>用户名</label>
<input type="text" name="accounts" class="am-radius" id="accounts" placeholder="用户名" data-validation-message="请填写有效的用户名" required />
</div>
<div class="am-u-sm-10 am-u-md-6 am-u-lg-5 am-u-sm-centered">
<div class="register-container">
<div class="register-top">
{{if MyC('home_user_login_state') eq 1}}
<span>我已经注册,现在就</span>
<a href="{{:MyUrl('index/user/logininfo')}}">
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius">登录</button>
</a>
{{/if}}
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<span class="am-btn am-btn-default am-radius form-verify">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="form-verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="form-verify-tips" onClick="document.getElementById('form-verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">更换一张</a>
</span>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="username" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
<div data-tab-panel-1 class="am-tab-panel ">
<!-- form start -->
<form class="am-form form-validation-mobile" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>手机号码</label>
<input type="text" name="accounts" class="am-radius" id="accounts" placeholder="手机号码" pattern="{{:lang('common_regex_mobile')}}" data-validation-message="手机号码格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="sms" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
<div data-tab-panel-2 class="am-tab-panel ">
<!-- form start -->
<form class="am-form form-validation-email" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>电子邮箱</label>
<input type="email" name="accounts" class="am-radius" id="accounts" placeholder="电子邮箱" data-validation-message="电子邮箱格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="email" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
<!-- 用户注册页面钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_reg_info</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_reg_info_data) and is_array($plugins_view_user_reg_info_data)}}
{{foreach $plugins_view_user_reg_info_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</div>
</div>
<div class="register-bottom am-cf">
<a href="{{:MyUrl('index/user/forgetpwdinfo')}}" class="am-fr m-t-5">忘记密码?</a>
</div>
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">看不清换一张</a>
<div class="register-content">
{{if in_array('sms', MyC('home_user_reg_state')) or in_array('email', MyC('home_user_reg_state')) or in_array('username', MyC('home_user_reg_state'))}}
<div data-am-widget="tabs" class="am-tabs am-tabs-d2" data-am-tabs="{noSwipe: 1}">
<ul class="am-tabs-nav am-cf">
{{if in_array('username', MyC('home_user_reg_state'))}}
<li class="am-active"><a href="[data-tab-panel-0]">账号注册</a></li>
{{/if}}
{{if in_array('sms', MyC('home_user_reg_state'))}}
<li class="{{if !in_array('username', MyC('home_user_reg_state'))}}am-active{{/if}}"><a href="[data-tab-panel-1]">手机注册</a></li>
{{/if}}
{{if in_array('email', MyC('home_user_reg_state'))}}
<li class="{{if !in_array('username', MyC('home_user_reg_state')) and !in_array('sms', MyC('home_user_reg_state'))}}am-active{{/if}}"><a href="[data-tab-panel-2]">邮箱注册</a></li>
{{/if}}
</ul>
<div class="am-tabs-bd">
{{if in_array('username', MyC('home_user_reg_state'))}}
<div data-tab-panel-0 class="am-tab-panel am-active">
<!-- form start -->
<form class="am-form form-validation-username" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>用户名</label>
<input type="text" name="accounts" class="am-radius" placeholder="请使用字母、数字、下划线 2~18 个字符" pattern="{{:lang('common_regex_username')}}" data-validation-message="用户名格式由 字母数字下划线 2~18 个字符" required />
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
{{if MyC('home_img_verify_state') eq 1}}
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<span class="am-btn am-btn-default am-radius form-verify">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="form-verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="form-verify-tips" onClick="document.getElementById('form-verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">更换一张</a>
</span>
</span>
</div>
</div>
{{/if}}
<div class="agreement">
<label class="am-checkbox am-success c-p">
<input type="checkbox" value="1" name="is_agree_agreement" data-validation-message="请同意注册协议" data-am-ucheck required /> 阅读并同意
</label>
<a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank">《服务协议》</a>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="username" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
{{/if}}
{{if in_array('sms', MyC('home_user_reg_state'))}}
<div data-tab-panel-1 class="am-tab-panel {{if !in_array('username', MyC('home_user_reg_state'))}}am-active{{/if}}">
<!-- form start -->
<form class="am-form form-validation-sms" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>手机号码</label>
<input type="text" name="accounts" class="am-radius" placeholder="请输入手机号码" pattern="{{:lang('common_regex_mobile')}}" data-validation-message="手机号码格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}" data-form-tag="form.form-validation-sms">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="agreement">
<label class="am-checkbox am-success c-p">
<input type="checkbox" value="1" name="is_agree_agreement" data-validation-message="请同意注册协议" data-am-ucheck required /> 阅读并同意
</label>
<a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank">《服务协议》</a>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="sms" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
{{/if}}
{{if in_array('email', MyC('home_user_reg_state'))}}
<div data-tab-panel-2 class="am-tab-panel {{if !in_array('username', MyC('home_user_reg_state')) and !in_array('sms', MyC('home_user_reg_state'))}}am-active{{/if}}">
<!-- form start -->
<form class="am-form form-validation-email" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>电子邮箱</label>
<input type="email" name="accounts" class="am-radius" placeholder="请输入电子邮箱" data-validation-message="电子邮箱格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}" data-form-tag="form.form-validation-email">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="agreement">
<label class="am-checkbox am-success c-p">
<input type="checkbox" value="1" name="is_agree_agreement" data-validation-message="请同意注册协议" data-am-ucheck required /> 阅读并同意
</label>
<a href="{{:MyUrl('index/agreement/index', ['document'=>'userregister'])}}" target="_blank">《服务协议》</a>
</div>
<div class="am-form-group am-form-group-refreshing business-form-block">
<input type="hidden" name="type" value="email" />
<button type="submit" class="am-btn am-btn-primary am-btn-block am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
</div>
</form>
<!-- form end -->
</div>
{{/if}}
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
</div>
{{if MyC('home_img_verify_state') eq 1}}
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">看不清换一张</a>
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
</div>
</div>
</div>
<!-- verify win end -->
{{/if}}
{{else /}}
<div class="am-text-center am-padding-vertical-lg register-close"><i class="am-icon-warning"></i> 暂时关闭了注册</div>
{{/if}}
</div>
</div>
<!-- verify win end -->
</div>
<!-- <div class="reg-switch-view">
{{if in_array('sms', MyC('home_user_reg_state'))}}
<a href="{{:MyUrl('index/user/smsreginfo')}}" class="am-btn am-btn-primary"><i class="am-icon-comment-o am-icon-sm"></i> 短信注册</a>
{{else /}}
<a class="am-btn am-btn-danger am-disabled" href="javascript:;"><i class="am-icon-comment-o am-icon-sm"></i> 暂时关闭短信注册</a>
{{/if}}
{{if in_array('email', MyC('home_user_reg_state'))}}
<a href="{{:MyUrl('index/user/emailreginfo')}}" class="am-btn am-btn-secondary"><i class="am-icon-envelope-o am-icon-sm"></i> 邮箱注册</a>
{{else /}}
<a class="am-btn am-btn-danger am-disabled" href="javascript:;"><i class="am-icon-envelope-o am-icon-sm"></i> 暂时关闭邮箱注册</a>
{{/if}}
用户注册页面钩子
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_reg_info</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_reg_info_data) and is_array($plugins_view_user_reg_info_data)}}
{{foreach $plugins_view_user_reg_info_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</div> -->
<!-- 用户注册页面底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_reg_info_bottom</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_reg_info_bottom_data) and is_array($plugins_view_user_reg_info_bottom_data)}}
{{foreach $plugins_view_user_reg_info_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</div>
</div>
<!-- conntent end -->
@ -218,7 +276,7 @@ function RegisterSuccessBack(e)
window.location.href = '{{$referer_url}}';
}, 1500);
} else {
$('form.form-validation').find('button[type="submit"]').button('reset');
$('.register-container form.am-form').find('button[type="submit"]').button('reset');
$.AMUI.progress.done();
Prompt(e.msg);
}

View File

@ -1,130 +0,0 @@
{{include file="public/header" /}}
<!-- header top nav -->
{{include file="public/header_top_nav" /}}
<!-- search -->
{{include file="public/nav_search" /}}
<!-- header nav -->
{{include file="public/header_nav" /}}
<!-- goods category -->
{{include file="public/goods_category" /}}
<!-- conntent start -->
<div class="am-g my-content">
<div class="am-u-md-6 am-u-sm-centered">
<!-- form start -->
<form class="am-form form-validation" method="post" action="{{:MyUrl('index/user/reg')}}" request-type="ajax-fun" request-value="RegisterSuccessBack">
<fieldset>
{{if MyC('home_user_login_state') eq 1}}
<span>已有帐号?</span>
<a href="{{:MyUrl('index/user/logininfo')}}">
<button type="button" class="am-btn am-btn-secondary am-btn-xs am-radius">立即登录</button>
</a>
{{/if}}
<!-- 用户注册短信页面钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div class="plugins-tag">
<span>plugins_view_user_sms_reg_info</span>
</div>
{{/if}}
{{if !empty($plugins_view_user_sms_reg_info_data) and is_array($plugins_view_user_sms_reg_info_data)}}
{{foreach $plugins_view_user_sms_reg_info_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
<hr />
<div class="am-form-group am-form-group-refreshing">
<label>手机号码
{{if in_array('email', MyC('home_user_reg_state'))}}
<a href="{{:MyUrl('index/user/emailreginfo')}}" class="reg-switch-tips">没手机?使用邮箱注册</a>
{{/if}}
</label>
<input type="text" name="accounts" class="am-radius" id="accounts" placeholder="手机号码" pattern="{{:lang('common_regex_mobile')}}" data-validation-message="手机号码格式错误" required />
</div>
<div class="am-form-group am-form-group-refreshing">
<label>验证码</label>
<div class="am-input-group am-input-group-sm">
<input type="number" name="verify" class="am-radius" placeholder="验证码" minlength="6" maxlength="6" data-validation-message="验证码格式 6 位数字" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-url="{{:MyUrl('index/user/regverifysend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="获取验证码" data-send-text="还有 {time} 秒" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">获取验证码</button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<label>设置登录密码</label>
<div class="am-input-group am-input-group-sm">
<input type="password" name="pwd" class="am-radius" placeholder="设置登录密码" pattern="{{:lang('common_regex_pwd')}}" data-validation-message="密码格式 6~18 个字符之间" required />
<span class="am-input-group-btn">
<button class="am-btn am-btn-default am-radius am-icon-eye eye-submit" type="button"></button>
</span>
</div>
</div>
<div class="am-form-group am-form-group-refreshing">
<input type="hidden" name="type" value="sms" />
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-sm btn-loading-example" data-am-loading="{loadingText: '处理中...'}">注册</button>
<a href="{{:MyUrl('index/user/forgetpwdinfo')}}" class="am-fr m-t-5">忘记密码?</a>
</div>
</fieldset>
</form>
<!-- form end -->
<!-- verify win start -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
<div class="am-modal-dialog am-radius">
<div class="am-modal-hd">
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>&times;</a>
</div>
<div class="am-modal-bd">
<div class="base">
<input type="text" placeholder="图形验证码" maxlength="6" id="verify-img-value" data-validation-message="请输入有效的图形验证码" class="am-form-field am-radius" />
<div class="am-fl">
<img src="{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}" class="am-radius c-p" id="verify-img" onClick="this.src=this.src+'#'+Math.random();" />
<a href="javascript:;" class="verify-tips" onClick="document.getElementById('verify-img').src='{{:MyUrl('index/user/userverifyentry', ['type'=>'reg'])}}#'+Math.random();">看不清换一张</a>
</div>
</div>
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'发送中...'}" data-win="1">确认</button>
</div>
</div>
</div>
<!-- verify win end -->
</div>
</div>
<!-- conntent end -->
{{include file="public/footer" /}}
<script type="text/javascript">
// 注册成功回调
function RegisterSuccessBack(e)
{
if(e.code == 0)
{
$.AMUI.progress.done();
Prompt(e.msg, 'success');
// 登录返回html处理
if((e.data.body_html || null) != null)
{
$('body').append(e.data.body_html);
}
setTimeout(function()
{
window.location.href = '{{$referer_url}}';
}, 1500);
} else {
$('form.form-validation').find('button[type="submit"]').button('reset');
$.AMUI.progress.done();
Prompt(e.msg);
}
}
</script>

View File

@ -25,6 +25,13 @@ return array(
'1.4.0' => array('value' => '1.4.0', 'name' => 'v1.4.0'),
'1.5.0' => array('value' => '1.5.0', 'name' => 'v1.5.0'),
),
// 用户注册类型列表
'site_user_reg_state_list' => array(
0 => array('value' => 'sms', 'name' => '短信'),
1 => array('value' => 'email', 'name' => '邮箱'),
2 => array('value' => 'username', 'name' => '用户名'),
),
// 性别
'common_gender_list' => array(

View File

@ -46,8 +46,7 @@ class Hook extends Controller
// 用户登录页面顶部
case 'plugins_view_user_login_info_top' :
case 'plugins_view_user_sms_reg_info' :
case 'plugins_view_user_email_reg_info' :
case 'plugins_view_user_reg_info' :
$ret = $this->UserLoginInfoHtml($params);
break;

View File

@ -29,10 +29,7 @@
"plugins_view_user_login_info_top":[
"app\\plugins\\touristbuy\\Hook"
],
"plugins_view_user_sms_reg_info":[
"app\\plugins\\touristbuy\\Hook"
],
"plugins_view_user_email_reg_info":[
"plugins_view_user_reg_info":[
"app\\plugins\\touristbuy\\Hook"
],
"plugins_service_navigation_header_handle":[

View File

@ -22,6 +22,17 @@ use app\service\ResourcesService;
*/
class ConfigService
{
// 富文本,不实例化的字段
public static $rich_text_list = [
'home_footer_info',
'common_email_currency_template',
'home_email_user_reg',
'home_email_user_forget_pwd',
'home_email_user_email_binding',
'home_site_close_reason',
'common_agreement_userregister',
];
/**
* 配置列表唯一标记作为key
* @author Devil
@ -75,21 +86,13 @@ class ConfigService
// 循环保存数据
$success = 0;
// 不实例化的字段
$no_all = array(
'home_footer_info',
'common_email_currency_template',
'home_email_user_reg',
'home_email_user_forget_pwd',
'home_email_user_email_binding',
'home_site_close_reason',
);
// 开始更新数据
foreach($params as $k=>$v)
{
if(!in_array($k, $no_all))
if(in_array($k, self::$rich_text_list))
{
$v = ResourcesService::ContentStaticReplace($v, 'add');
} else {
$v = htmlentities($v);
}
if(Db::name('Config')->where(['only_tag'=>$k])->update(['value'=>$v, 'upd_time'=>time()]))
@ -137,6 +140,16 @@ class ConfigService
{
$data['home_user_reg_state'] = explode(',', $data['home_user_reg_state']);
}
// 富文本字段处理
foreach($data as $k=>$v)
{
if(in_array($k, self::$rich_text_list))
{
$data[$k] = ResourcesService::ContentStaticReplace($v, 'get');
}
}
cache($key, $data);
}
}
@ -194,5 +207,30 @@ class ConfigService
}
return DataReturn('无需处理', 0);
}
/**
* 根据唯一标记获取条配置内容
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-05-16
* @desc description
* @param [string] $only_tag [唯一标记]
*/
public static function ConfigContentRow($only_tag)
{
// 获取内容
$data = Db::name('Config')->where(['only_tag'=>$only_tag])->field('name,value,type,upd_time')->find();
if(!empty($data))
{
// 富文本处理
if(in_array($only_tag, self::$rich_text_list))
{
$data['value'] = ResourcesService::ContentStaticReplace($data['value'], 'get');
}
$data['upd_time_time'] = empty($data['upd_time']) ? null : date('Y-m-d H:i:s', $data['upd_time']);
}
return DataReturn('操作成功', 0, $data);
}
}
?>

View File

@ -992,13 +992,15 @@ class UserService
'error_msg' => '密码不能为空',
],
[
'checked_type' => 'empty',
'checked_type' => 'in',
'key_name' => 'type',
'checked_data' => array_column(lang('site_user_reg_state_list'), 'value'),
'error_msg' => '注册类型有误',
],
[
'checked_type' => 'empty',
'key_name' => 'verify',
'is_checked' => 2,
'error_msg' => '验证码不能为空',
],
];
@ -1029,19 +1031,25 @@ class UserService
if($params['type'] == 'sms')
{
$obj = new \base\Sms($verify_param);
} else {
} else if($params['type'] == 'email') {
$obj = new \base\Email($verify_param);
}
// 是否已过期
if(!$obj->CheckExpire())
// 验证码校验
if(isset($obj) && is_object($obj))
{
return DataReturn('验证码已过期', -10);
}
// 是否正确
if(!$obj->CheckCorrect($params['verify']))
{
return DataReturn('验证码错误', -11);
// 是否已过期
if(!$obj->CheckExpire())
{
return DataReturn('验证码已过期', -10);
}
// 是否正确
if(!$obj->CheckCorrect($params['verify']))
{
return DataReturn('验证码错误', -11);
}
}
// 是否需要审核
$common_register_is_enable_audit = MyC('common_register_is_enable_audit', 0);
@ -1058,8 +1066,10 @@ class UserService
if($params['type'] == 'sms')
{
$data['mobile'] = $params['accounts'];
} else {
} else if($params['type'] == 'email') {
$data['email'] = $params['accounts'];
} else {
$data['username'] = $params['accounts'];
}
// 数据添加
@ -1067,7 +1077,10 @@ class UserService
if($user_ret['code'] == 0)
{
// 清除验证码
$obj->Remove();
if(isset($obj) && is_object($obj))
{
$obj->Remove();
}
// 是否需要审核
if($common_register_is_enable_audit == 1)
@ -1097,42 +1110,46 @@ class UserService
*/
private static function UserRegAccountsCheck($params = [])
{
// 参数
$type = $params['type'];
$accounts = $params['accounts'];
if(empty($accounts) || empty($type) || !in_array($type, array('sms', 'email')))
switch($params['type'])
{
return DataReturn('参数错误', -1);
}
// 手机
case 'sms' :
// 手机号码格式
if(!CheckMobile($params['accounts']))
{
return DataReturn('手机号码格式错误', -2);
}
// 手机号码
if($type == 'sms')
{
// 手机号码格式
if(!CheckMobile($accounts))
{
return DataReturn('手机号码格式错误', -2);
}
// 手机号码是否已存在
if(self::IsExistAccounts($params['accounts'], 'mobile'))
{
return DataReturn('手机号码已存在', -3);
}
break;
// 手机号码是否已存在
if(self::IsExistAccounts($accounts, 'mobile'))
{
return DataReturn('手机号码已存在', -3);
}
// 邮箱
case 'email' :
// 电子邮箱格式
if(!CheckEmail($params['accounts']))
{
return DataReturn('电子邮箱格式错误', -2);
}
// 电子邮箱
} else {
// 电子邮箱格式
if(!CheckEmail($accounts))
{
return DataReturn('电子邮箱格式错误', -2);
}
// 电子邮箱是否已存在
if(self::IsExistAccounts($params['accounts'], 'email'))
{
return DataReturn('电子邮箱已存在', -3);
}
break;
// 电子邮箱是否已存在
if(self::IsExistAccounts($accounts, 'email'))
{
return DataReturn('电子邮箱已存在', -3);
}
// 用户名
case 'username' :
// 用户名格式
if(!CheckUserName($params['accounts']))
{
return DataReturn('用户名格式由 字母数字下划线 2~18 个字符', -2);
}
break;
}
return DataReturn('操作成功', 0);
}
@ -1203,8 +1220,9 @@ class UserService
'error_msg' => '账号不能为空',
],
[
'checked_type' => 'empty',
'checked_type' => 'in',
'key_name' => 'type',
'checked_data' => array_column(lang('site_user_reg_state_list'), 'value'),
'error_msg' => '注册类型有误',
],
];
@ -1220,13 +1238,6 @@ class UserService
return DataReturn('暂时关闭用户注册');
}
// 账户校验
$ret = self::UserRegAccountsCheck($params);
if($ret['code'] != 0)
{
return $ret;
}
// 验证码公共基础参数
$verify_params = array(
'key_prefix' => 'reg',
@ -1241,13 +1252,20 @@ class UserService
return $verify;
}
// 账户校验
$ret = self::UserRegAccountsCheck($params);
if($ret['code'] != 0)
{
return $ret;
}
// 发送验证码
$code = GetNumberCode(6);
if($params['type'] == 'sms')
{
$obj = new \base\Sms($verify_params);
$status = $obj->SendCode($params['accounts'], $code, MyC('home_sms_user_reg'));
} else {
} else if($params['type'] == 'email') {
$obj = new \base\Email($verify_params);
$email_param = array(
'email' => $params['accounts'],
@ -1256,6 +1274,8 @@ class UserService
'code' => $code,
);
$status = $obj->SendHtml($email_param);
} else {
return DataReturn('该类型不支持验证码发送', -2);
}
// 状态
@ -1289,13 +1309,6 @@ class UserService
return DataReturn('参数错误', -10);
}
// 账户是否存在
$ret = self::UserForgetAccountsCheck($params['accounts']);
if($ret['code'] != 0)
{
return $ret;
}
// 验证码公共基础参数
$verify_params = array(
'key_prefix' => 'forget',
@ -1310,6 +1323,13 @@ class UserService
return $verify;
}
// 账户是否存在
$ret = self::UserForgetAccountsCheck($params['accounts']);
if($ret['code'] != 0)
{
return $ret;
}
// 验证码
$code = GetNumberCode(6);

View File

@ -108,11 +108,7 @@ return array (
array (
0 => 'app\\plugins\\touristbuy\\Hook',
),
'plugins_view_user_sms_reg_info' =>
array (
0 => 'app\\plugins\\touristbuy\\Hook',
),
'plugins_view_user_email_reg_info' =>
'plugins_view_user_reg_info' =>
array (
0 => 'app\\plugins\\touristbuy\\Hook',
),

File diff suppressed because one or more lines are too long

View File

@ -327,4 +327,40 @@ button.colorpicker-submit img {
.form-search .so-list tr td:last-child { padding-top:0px !important; }
.form-search .chosen-container-single .chosen-search input[type="text"] { width: 100% !important; }
.form-search .so-list select, .form-search .so-list .chosen-container, .form-search .input input { width: calc(100% - 44px) !important; display: -webkit-inline-box; }
}
}
/**
* 自定义辅助类
*/
@media only screen and (max-width: 641px) {
/* 水平方向内边距 */
.xo-padding-horizontal-md-xs {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.xo-padding-horizontal-md-sm {
padding-left: 1rem;
padding-right: 1rem;
}
}
@media only screen and (min-width: 640px) {
/* 水平方向内边距 */
.xo-padding-horizontal-md-xs {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.xo-padding-horizontal-md-sm {
padding-left: 1rem;
padding-right: 1rem;
}
}
@media only screen and (min-width: 1025px) {
/* 水平方向内边距 */
.xo-padding-horizontal-md-xs,
.xo-padding-horizontal-md-sm {
padding-left: 0;
padding-right: 0;
}
}

View File

@ -1,12 +1,147 @@
/**
* 登录/注册
* 公共
*/
form.form-validation, .reg-switch-view { margin: 30px 0; }
.reg-switch-view .am-btn { width: 49%; line-height: 100px; font-size: 16px; }
.my-content {
background-color: #FAFAFA;
}
@media only screen and (min-width:641px) {
.my-content {
padding: 30px 0 50px 0;
}
.my-content .container-left {
padding-left: 5px;
}
.my-content .container-left img {
max-width: calc(100% - 1.5rem);
max-height: 100%;
}
.my-content .container-right {
padding-right: 5px;
}
.user-forgetpwd-container .container-left {
height: 375px;
}
.user-login-container .container-left {
height: 295px;
}
}
@media only screen and (min-width:1025px) {
.my-content .container-left {
padding-left: 0;
}
.my-content .container-right {
padding-right: 0;
}
}
@media only screen and (max-width:641px) {
.my-content {
padding: 20px 0;
}
.my-content .container-right {
float: none !important;
margin-left: auto;
margin-right: auto;
}
}
.verify-submit-win { margin-top: 20px; display: block; }
.reg-switch-tips { font-weight: 100; font-size: 12px; color: #f87689; margin-left: 20px; }
#verify-win .am-modal-bd { margin-top: 10px; }
#verify-win .am-modal-bd .base { overflow: hidden; }
#verify-win .am-modal-bd .base .verify-tips { font-size: 12px; }
form.am-form .am-form-group { padding: 0 !important; }
/**
* 表单
*/
.user-form-container, .register-container .register-content {
background: rgba(0,0,0,0.15);
padding: 10px;
margin-top: 20px;
}
.my-content form.am-form {
background: #fff;
overflow: hidden;
padding-top: 10px;
}
.my-content form.am-form .am-form-group {
padding: 5px 10px !important;
}
/**
* 注册
*/
.user-register-container {
background: #FAFAFA url(../images/register-bg.png);
width: 100%;
overflow: hidden;
}
.register-container .am-tabs {
margin: 0;
}
.register-container .am-tabs .am-tabs-bd, .register-container .register-content .register-close {
background: #fff;
}
.register-container .register-content .register-close {
color: #666;
}
.register-container .am-tabs-d2 .am-tabs-nav a {
text-decoration: none;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active a {
color: #d2364c;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active {
border-bottom: 2px solid #d2364c;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active:after {
border-bottom-color: #d2364c;
}
/**
* 表单验证码
*/
.register-container form.form-validation-username .form-verify {
padding: 0;
}
.register-container form.form-validation-username .form-verify img {
height: 26px;
}
.register-container form.form-validation-username .form-verify a.form-verify-tips {
font-size: 12px;
text-decoration: none;
line-height: 28px;
color: #FFF;
filter: progid:DXImageTransform.Microsoft.gradient(enabled='true', startColorstr='#7F000000', endColorstr='#7F000000');
background: rgba(0,0,0,0.5);
text-align: center;
display: none;
width: 83px;
height: 28px;
position: absolute;
z-index: 1;
top: -1px;
left: -1px;
}
.register-container form.form-validation-username .form-verify:hover a.form-verify-tips {
display: block;
}
/**
* 注册协议
*/
.register-container .agreement {
margin: 10px 0;
}
.register-container .agreement label {
display: initial;
}
.register-container .agreement a {
color: #d2364c;
}
/**
* 弹窗图片验证码
*/
.my-content .verify-submit-win{ margin-top: 20px; display: block; }
.my-content .reg-switch-tips { font-weight: 100; font-size: 12px; color: #f87689; margin-left: 20px; }
.my-content #verify-win .am-modal-bd { margin-top: 10px; }
.my-content #verify-win .am-modal-bd .base { overflow: hidden; }
.my-content #verify-win .am-modal-bd .base .verify-tips { font-size: 12px; }
.my-content #verify-img { vertical-align: middle; }

View File

@ -1,79 +0,0 @@
/**
* 中间
*/
.my-content {
background: #FAFAFA url(http://b2b2c.shopnctest.com/dema/member/templates/default/images/register_bg.png);
width: 100%;
overflow: hidden;
padding-bottom: 50px;
}
.register-container, .register-container .am-tabs {
margin: 20px 0 0 0;
}
.register-container {
padding-top: 10px;
}
.register-container .am-tabs {
background: rgba(0,0,0,0.15);
padding: 10px;
}
.register-container .am-tabs .am-tabs-bd {
background: #fff;
}
.register-container form.am-form .am-form-group {
padding: 5px 0 !important;
}
.register-container .am-tabs-d2 .am-tabs-nav a {
text-decoration: none;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active a {
color: #d2364c;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active {
border-bottom: 2px solid #d2364c;
}
.register-container .am-tabs-d2 .am-tabs-nav > .am-active:after {
border-bottom-color: #d2364c;
}
.register-container .register-bottom {
margin-top: 10px;
}
/**
* 表单验证码
*/
.register-container form.form-validation-username .form-verify {
padding: 0;
}
.register-container form.form-validation-username .form-verify img {
height: 26px;
}
.register-container form.form-validation-username .form-verify a.form-verify-tips {
font-size: 12px;
text-decoration: none;
line-height: 28px;
color: #FFF;
filter: progid:DXImageTransform.Microsoft.gradient(enabled='true', startColorstr='#7F000000', endColorstr='#7F000000');
background: rgba(0,0,0,0.5);
text-align: center;
display: none;
width: 83px;
height: 28px;
position: absolute;
z-index: 1;
top: -1px;
left: -1px;
}
.register-container form.form-validation-username .form-verify:hover a.form-verify-tips {
display: block;
}
/**
* 弹窗图片验证码
*/
.register-container .verify-submit-win{ margin-top: 20px; display: block; }
.register-container .reg-switch-tips { font-weight: 100; font-size: 12px; color: #f87689; margin-left: 20px; }
.register-container #verify-win .am-modal-bd { margin-top: 10px; }
.register-container #verify-win .am-modal-bd .base { overflow: hidden; }
.register-container #verify-win .am-modal-bd .base .verify-tips { font-size: 12px; }
.register-container #verify-img { vertical-align: middle; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@ -1,12 +1,10 @@
// 表单初始化
FromInit('form.form-validation-username');
FromInit('form.form-validation-mobile');
FromInit('form.form-validation-sms');
FromInit('form.form-validation-email');
$(function()
{
$verify_win = $('#verify-win');
// 查看密码
$('.eye-submit').on('click', function()
{
@ -25,8 +23,17 @@ $(function()
// 短信验证码获取
$('.verify-submit, .verify-submit-win').on('click', function()
{
// 表单发送按钮
var form_tag = $(this).data('form-tag') || null;
if(form_tag != null)
{
$('body').attr('data-form-tag', form_tag);
}
// 验证账户
var $this = $(this);
var $accounts = $('#accounts');
var $form_tag = $($('body').attr('data-form-tag'));
var $accounts = $form_tag.find('input[name="accounts"]');
var $verify = $('#verify-img-value');
var $verify_img = $('#verify-img');
var verify = '';
@ -36,6 +43,7 @@ $(function()
if($this.data('verify') == 1)
{
// 开启图片验证码窗口
var $verify_win = $('#verify-win');
$verify_win.modal('open');
$verify_img.trigger("click");
$verify.focus();
@ -46,7 +54,7 @@ $(function()
var is_win = $(this).data('win');
if(is_win == 1)
{
$this = $('.verify-submit');
$this = $form_tag.find('.verify-submit');
// 验证码参数处理
verify = $verify.val().replace(/\s+/g, '');
@ -73,7 +81,7 @@ $(function()
$.ajax({
url:$('.verify-submit').data('url'),
type:'POST',
data:{"accounts":$accounts.val(), "verify":verify, "type":$('form input[name="type"]').val()},
data:{"accounts":$accounts.val(), "verify":verify, "type":$form_tag.find('input[name="type"]').val()},
dataType:'json',
success:function(result)
{
@ -118,7 +126,10 @@ $(function()
}
});
} else {
$verify_win.modal('close');
if($('#verify-win').length > 0)
{
$('#verify-win').modal('close');
}
$accounts.focus();
}
});