123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>绑定邮箱-{eyou:global name='web_name' /}</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
- {eyou:static file="users/skin/css/basic.css" /}
- {eyou:static file="users/skin/css/eyoucms.css" /}
- <!-- 新样式 2020-11-25 -->
- {eyou:static file="users/skin/css/element/index.css" /}
- {eyou:static file="users/skin/css/e-user.css" /}
- {eyou:include file="users/skin/css/diy_css.htm" /}
-
- {eyou:static file="/public/static/common/js/jquery.min.js"/}
- {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
- {eyou:static file="/public/static/common/js/tag_global.js"/}
-
- </head>
- <body>
- <div class="el-row">
- <form name='theForm' id="theForm" method="post">
- <div class="ey-popup">
- <div class="el-form-item">
- <div class="el-input">
- <input type="text" name="email" id="email" {eyou:eq name='$users.is_email' value='0'} value="{$users.email}" {/eyou:eq} required class="el-input__inner" autocomplete="off" placeholder="新的邮箱地址">
- </div>
- </div>
- <div class="el-form-item">
- <div class="el-input el-input-group el-input-group--append el-input-group--prepend">
- <input type="text" class="el-input__inner" id="email_code" name="email_code" autocomplete="off" placeholder="邮箱验证码">
- <div class="el-input-group__append">
- <input type="button" id="email_button" onclick="get_email_code();" class="el-button el-button--default" value="点击发送" />
- </div>
- </div>
- </div>
- <div class="el-form-item mb0">
- <button type="button" class="el-button el-button--primary f14" style="width: 100%;" onclick="SubmitData();">确定</button>
- </div>
-
- </div>
-
- <!-- <div class="modal-body">
- <div class="form-group">
- <div class="input-group">
- <input type="text" name="email" id="email" {eyou:eq name='$users.is_email' value='0'} value="{$users.email}" {/eyou:eq} required class="form-control" autocomplete="off" placeholder="新的邮箱地址">
- </div>
- </div>
-
- <div class="form-group">
- <div class="input-group yxrz">
- <input type="text" class="form-control" id="email_code" name="email_code" autocomplete="off" placeholder="邮箱验证码">
- <input type="button" id="email_button" onclick="get_email_code();" class="btn btn-primary" value="点击发送" />
- </div>
- </div>
-
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-primary" style="width: 100%;" onclick="SubmitData();">确定</button>
- </div> -->
- </form>
- </div>
-
- <script type="text/javascript">
-
- function get_email_code()
- {
- var email = $("#email").val();
- var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
- // 邮箱格式不正确
- if(!reg.test(email)){
- layer.msg('请正确输入邮箱地址!', {time: 2000});
- return false;
- }
-
- $("#email_button").val('发送中…');
- $("#email_button").attr('disabled', 'disabled');
- var title = '{$title}';
- layer_loading('正在处理');
- $.ajax({
- url: "{eyou:url link='user/Smtpmail/send_email' /}",
- data: {email:email,title:title,type:'bind_email',scene:3},
- type:'post',
- dataType:'json',
- success:function(res){
- layer.closeAll();
- if(res.code == 1){
- countdown();
- layer.msg(res.msg, {time: 2000});
- }else{
- $("#email_button").val('点击发送');
- $("#email_button").removeAttr("disabled");
- showErrorAlert(res.msg);
- }
- },
- error : function(e) {
- layer.closeAll();
- $("#email_button").val('点击发送');
- $("#email_button").removeAttr("disabled");
- showErrorAlert(e.responseText);
- }
- });
- }
-
- function SubmitData()
- {
- var email = $("#email").val();
- var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i;
- // 邮箱格式不正确
- if(!reg.test(email)){
- layer.msg('请正确输入邮箱地址!', {time: 2000});
- return false;
- }
-
- var email_code = $("#email_code").val();
- if(!email_code){
- layer.msg('邮箱验证码不能为空!', {time: 2000});
- return false;
- }
-
- var _parent = parent;
- var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
-
- layer_loading('正在处理');
- $.ajax({
- url: "{eyou:url link='user/Users/bind_email' /}",
- data: $('#theForm').serialize(),
- type:'post',
- dataType:'json',
- success:function(res){
- layer.closeAll();
- if(res.code == 1){
- parent.layer.close(parentObj);
- parent.layer.msg(res.msg, {time: 1500}, function(){
- _parent.window.location.reload();
- });
- }else{
- showErrorAlert(res.msg);
- }
- },
- error : function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- };
-
-
- function countdown(){
- // 倒计时
- var setTime;
- var time = {php}echo config('global.email_send_time');{/php};
- setTime = setInterval(function(){
- if(0 >= time){
- clearInterval(setTime);
- return;
- }
- time--;
- $("#email_button").val(time+'秒');
- $("#email_button").attr('disabled', 'disabled');
-
- if(time == 0){
- $("#email_button").val('点击发送');
- $("#email_button").removeAttr("disabled");
- }
- },1000);
- };
- </script>
-
- </body>
- </html>
|