Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
32330da3
Commit
32330da3
authored
May 13, 2020
by
陈超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
T
parent
1c28de4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
383 deletions
+121
-383
apps/basic/Tpl/default/Passport/reg_w3g.html
+121
-383
No files found.
apps/basic/Tpl/default/Passport/reg_w3g.html
View file @
32330da3
<include
file=
"__THEME__/_header_w3g"
/>
<include
file=
"__THEME__/_header_w3g"
/>
<script>
<script>
var
CLICK_VERIFY
=
"{:U('basic/Passport/clickVerify')}"
;
var
CLICK_VERIFY
=
"{:U('basic/Passport/clickVerify')}"
;
var
CLICK_UNAME
=
"{:U('basic/Passport/clickUname')}"
;
var
CLICK_UNAME
=
"{:U('basic/Passport/clickUname')}"
;
...
@@ -11,7 +10,7 @@
...
@@ -11,7 +10,7 @@
var
REG_ADDRESS
=
"{:U('basic/Passport/ajaxReg')}"
;
var
REG_ADDRESS
=
"{:U('basic/Passport/ajaxReg')}"
;
</script>
</script>
<style>
<!--
<style>
#emailReg .item input{float:none;}
#emailReg .item input{float:none;}
.login-bd input::-webkit-input-placeholder { /* WebKit, Blink, Edge */
.login-bd input::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color:#B7B7B7;
color:#B7B7B7;
...
@@ -30,8 +29,8 @@
...
@@ -30,8 +29,8 @@
font-weight:400;
font-weight:400;
}
}
.login-bd .item input{float:none;width:100%;}
.login-bd .item input{float:none;width:100%;}
</style>
</style>
-->
<div
class=
"loginbox"
>
<!--
<div class="loginbox" >
<a class="icon-colse" href="/"></a>
<a class="icon-colse" href="/"></a>
<if condition="$site.logo_head_h5 neq ''"><img src="{$site.logo_head_h5}">
<if condition="$site.logo_head_h5 neq ''"><img src="{$site.logo_head_h5}">
<else /><img src="{$site.logo_head_w3g|default=$site['logo_head']}" class="login-logo"></if>
<else /><img src="{$site.logo_head_w3g|default=$site['logo_head']}" class="login-logo"></if>
...
@@ -67,9 +66,6 @@
...
@@ -67,9 +66,6 @@
<div class="item">
<div class="item">
<input type="password" id="prpassword2" placeholder="确认密码">
<input type="password" id="prpassword2" placeholder="确认密码">
</div>
</div>
<!--
<p><input type="checkbox"><span>我已阅读并同意</span><a target="_blank" href="{:U('basic/Single/info',array('id'=>'reg'))}">《{$site['site_keyword']}服务协议》</a></p>
-->
<a class="login_btn" href="javascript:;" onclick="phoneNext()">完成</a>
<a class="login_btn" href="javascript:;" onclick="phoneNext()">完成</a>
<p>点击注册即代表您同意<a target="_blank" href="{:U('basic/Single/info',array('id'=>'reg'))}">《{$site['site_keyword']}服务协议》</a></p>
<p>点击注册即代表您同意<a target="_blank" href="{:U('basic/Single/info',array('id'=>'reg'))}">《{$site['site_keyword']}服务协议》</a></p>
...
@@ -99,9 +95,9 @@
...
@@ -99,9 +95,9 @@
<p>点击注册即代表您同意<a target="_blank" href="{:U('basic/Single/info',array('id'=>'reg'))}">《{$site['site_keyword']}服务协议》</a></p>
<p>点击注册即代表您同意<a target="_blank" href="{:U('basic/Single/info',array('id'=>'reg'))}">《{$site['site_keyword']}服务协议》</a></p>
</div>
</div>
</if>
</if>
</div>
</div>
-->
<!--
<div id="app">
<div
id=
"app"
>
<div
class=
"layout_v"
style=
"margin-top: 0.625rem;"
>
<div
class=
"layout_v"
style=
"margin-top: 0.625rem;"
>
<van-field
v-model=
"phone"
label=
"手机号"
type=
"number"
placeholder=
"请输入手机号"
></van-field>
<van-field
v-model=
"phone"
label=
"手机号"
type=
"number"
placeholder=
"请输入手机号"
></van-field>
<van-field
v-model=
"code"
label=
"验证码"
type=
"digit"
maxlength=
"6"
placeholder=
"请输入验证码"
>
<van-field
v-model=
"code"
label=
"验证码"
type=
"digit"
maxlength=
"6"
placeholder=
"请输入验证码"
>
...
@@ -116,388 +112,130 @@
...
@@ -116,388 +112,130 @@
<span>
注册并登录
</span>
<span>
注册并登录
</span>
</div>
</div>
</div>
</div>
</div>
-->
</div>
<script>
<script>
$
(
function
(){
$
(
function
(){
$
(
'.loginbox'
).
height
(
$
(
'.loginbox'
)[
0
].
clientHeight
);
$
(
"#preloader"
).
hide
();
var
codeSrc
=
"{:captcha_src('register',['imageW'=>128,'imageH'=>28])}&!"
+
Math
.
random
();
$
(
".resetcode"
).
attr
(
'src'
,
codeSrc
).
load
(
function
(){
$
(
"#verifyimg_loading"
).
remove
();
$
(
this
).
show
();
});
/** 刷新验证码 */
$
(
'.resetcode'
).
click
(
function
(){
$
(
".resetcode"
).
attr
(
'src'
,
function
(){
var
index
=
this
.
src
.
indexOf
(
'&!'
);
if
(
index
!==
-
1
){
return
this
.
src
.
substr
(
0
,
index
)
+
'&!'
+
Math
.
random
();
}
return
this
.
src
+
'&!'
+
Math
.
random
();
});
});
// 每60s 刷新一次验证码
setInterval
(
function
(){
$
(
".resetcode"
).
click
();
},
120
*
1000
);
});
//手机注册
function
phoneReg
(
cate
){
$
(
cate
).
addClass
(
"f3"
);
$
(
cate
).
prev
().
removeClass
();
$
(
"#phoneReg"
).
css
(
"display"
,
"block"
);
$
(
"#emailReg"
).
css
(
"display"
,
"none"
);
}
//邮箱注册
function
emailReg
(
cate
){
$
(
cate
).
addClass
(
"f3"
);
$
(
cate
).
prev
().
removeClass
();
$
(
"#emailReg"
).
css
(
"display"
,
"block"
);
$
(
"#phoneReg"
).
css
(
"display"
,
"none"
);
}
/**
* 发送手机验证码
*/
function
getPhoneVerify
(){
user
=
$
.
trim
(
$
(
"#prphone"
).
val
());
//获取用户手机号
var
phoneVerify
=
function
(){
//获取手机验证码
$
.
ajax
({
type
:
"POST"
,
url
:
GET_PHONEVERIFY
,
data
:
"phone="
+
user
,
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
status
==
'0'
){
ui
.
error
(
data
.
info
);
return
;
}
else
{
ui
.
success
(
data
.
info
);
$
(
'.width80'
).
css
(
"display"
,
"none"
);
$
(
'.width97'
).
removeAttr
(
"style"
);
timerc
=
60
;
dtime
();
return
;
}
}
});
}
//检查手机号格式
if
(
!
user
.
match
(
PHONE_MATCH
)){
ui
.
error
(
'请填写正确的手机号'
);
return
;
}
else
{
//验证此手机是否已被注册
$
.
ajax
({
type
:
"POST"
,
url
:
CLICK_PHONE
,
data
:
"phone="
+
user
,
dataType
:
"text"
,
success
:
function
(
data
){
if
(
data
==
0
){
ui
.
error
(
'此手机已被注册,请更换'
);
return
;
}
else
{
phoneVerify
();
}
}
});
}
}
var
timerc
;
function
dtime
(){
if
(
timerc
>
1
){
timerc
=
timerc
-
1
;
$
(
"#dtime"
).
text
(
timerc
);
setTimeout
(
"dtime()"
,
1000
);
//设置1000毫秒以后执行一次本函数
}
else
{
$
(
'.width97'
).
css
(
"display"
,
"none"
);
$
(
'.width80'
).
removeAttr
(
"style"
);
}
}
//邮箱注册下一部
function
onemaliNext
(){
user
=
$
.
trim
(
$
(
"#erusername"
).
val
());
//获取用户邮箱地址
verify
=
$
.
trim
(
$
(
"#erverify"
).
val
());
//获取验证码
uname
=
$
.
trim
(
$
(
"#eruname"
).
val
());
//获取用户昵称
password
=
$
.
trim
(
$
(
"#erpasswrod"
).
val
());
//获取密码
password2
=
$
.
trim
(
$
(
"#erpasswrod2"
).
val
());
//获取密码
mhm_id
=
$
.
trim
(
$
(
"#this_mhm_id"
).
val
());
//机构
invite_code
=
$
.
trim
(
$
(
"#invite_code"
).
val
());
//邀请码
//检查信息是否为空
if
(
user
==
""
){
ui
.
error
(
'请输入邮箱'
);
return
;
}
if
(
uname
==
""
){
ui
.
error
(
'请输入昵称'
);
return
;
}
if
(
password
==
""
){
ui
.
error
(
'请输入密码'
);
return
;
}
if
(
password2
==
""
){
ui
.
error
(
'请再次输入密码'
);
return
;
}
if
(
verify
==
""
){
ui
.
error
(
'请输入验证码'
);
return
;
}
//验证邮箱
if
(
!
user
.
match
(
/^
\w
+
((
-
\w
+
)
|
(\.\w
+
))
*
\@[
A-Za-z0-9
]
+
((\.
|-
)[
A-Za-z0-9
]
+
)
*
\.[
A-Za-z0-9
]
+$/
)){
ui
.
error
(
'邮箱格式错误'
);
return
;
}
//验证昵称
if
(
uname
.
length
>
10
){
ui
.
error
(
'昵称长度不能大于10位'
);
return
;
}
//检查密码
if
(
password
.
length
<
6
||
password
.
length
>
20
){
ui
.
error
(
'密码长度为6-20位'
);
return
;
}
if
(
password
!=
password2
){
ui
.
error
(
'两次输入密码不一致'
);
return
;
}
//检查验证码
})
if
(
verify
.
length
!=
4
){
ui
.
error
(
'验证码长度不正确'
);
let
CLICK_PHONE
=
"{:U('basic/Passport/clickPhone')}"
;
return
;
let
GET_PHONEVERIFY
=
"{:U('basic/Passport/getVerify')}"
;
}
$
.
ajax
({
async
:
false
,
type
:
"POST"
,
url
:
REG_ADDRESS
,
data
:
"email="
+
user
+
"&uname="
+
uname
+
"&password="
+
password
+
"&type=1&verify="
+
verify
+
"&mhm_id="
+
mhm_id
+
"&invite_code="
+
invite_code
,
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
status
==
'0'
){
ui
.
error
(
data
.
info
);
return
;
}
else
{
ui
.
success
(
"注册成功"
);
location
=
data
.
data
;
}
}
});
}
//手机注册下一部
function
phoneNext
(){
user
=
$
.
trim
(
$
(
"#prphone"
).
val
());
//获取用户邮箱地址
verify
=
$
.
trim
(
$
(
"#prverify"
).
val
());
//获取验证码
uname
=
$
.
trim
(
$
(
"#uname"
).
val
());
//获取用户昵称
password
=
$
.
trim
(
$
(
"#prpassword"
).
val
());
//获取密码
password2
=
$
.
trim
(
$
(
"#prpassword2"
).
val
());
//获取密码
mhm_id
=
$
.
trim
(
$
(
"#this_mhm_id"
).
val
());
//机构
invite_code
=
$
.
trim
(
$
(
"#invite_code"
).
val
());
//邀请码
//检查信息是否为空
if
(
user
==
""
){
ui
.
error
(
'请输入手机号'
);
return
;
}
if
(
verify
==
""
){
ui
.
error
(
'请输入验证码'
);
return
;
}
if
(
uname
==
""
){
ui
.
error
(
'请输入昵称'
);
return
;
}
if
(
password
==
""
){
ui
.
error
(
'请输入密码'
);
return
;
}
if
(
password2
==
""
){
ui
.
error
(
'请再次输入密码'
);
return
;
}
//检查手机号格式
if
(
!
user
.
match
(
PHONE_MATCH
)){
ui
.
error
(
'请填写正确的手机号'
);
return
;
}
//检查验证码
if
(
verify
.
length
!=
6
){
ui
.
error
(
'手机验证码长度不正确'
);
return
;
}
//验证昵称
if
(
uname
.
length
>
10
){
ui
.
error
(
'昵称长度不能大于10位'
);
return
;
}
//检查密码
if
(
password
.
length
<
6
||
password
.
length
>
20
){
ui
.
error
(
'密码长度为6-20位'
);
return
;
}
if
(
password
!=
password2
){
ui
.
error
(
'两次输入密码不一致'
);
return
;
}
$
.
ajax
({
async
:
false
,
type
:
"POST"
,
url
:
REG_ADDRESS
,
data
:
"phone="
+
user
+
"&uname="
+
uname
+
"&password="
+
password
+
"&type=2&verify="
+
verify
+
"&mhm_id="
+
mhm_id
+
"&invite_code="
+
invite_code
,
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
status
==
'0'
){
ui
.
error
(
data
.
info
);
return
;
}
else
{
ui
.
success
(
"注册成功"
);
location
=
data
.
data
;
}
}
});
}
// let CLICK_PHONE="{:U('basic/Passport/clickPhone')}";
// let GET_PHONEVERIFY="{:U('basic/Passport/getVerify')}";
//
String.prototype.isMobile = function() {
String
.
prototype
.
isMobile
=
function
()
{
//
return (/^1[3|4|5|6|7|8|9]\d{9}$/.test(this));
return
(
/^1
[
3|4|5|6|7|8|9
]\d{9}
$/
.
test
(
this
));
//
}
}
//
String.prototype.isCode = function() {
String
.
prototype
.
isCode
=
function
()
{
//
return this.length == 4 || this.length == 6
return
this
.
length
==
4
||
this
.
length
==
6
//
}
}
//
String.prototype.isPwd = function() {
String
.
prototype
.
isPwd
=
function
()
{
//
return this.length >= 6 && this.length
<=
16
return
this
.
length
>=
6
&&
this
.
length
<=
16
//
}
}
//
new Vue({
new
Vue
({
//
el: '#app',
el
:
'#app'
,
//
data: function() {
data
:
function
()
{
//
return {
return
{
//
counting: false,
counting
:
false
,
//
count: 60,
count
:
60
,
//
phone: "",
phone
:
""
,
//
code: "",
code
:
""
,
//
password: ""
password
:
""
//
}
}
//
},
},
//
computed: {
computed
:
{
//
valid: function() {
valid
:
function
()
{
//
return !this.counting
return
!
this
.
counting
//
},
},
//
codeText: function() {
codeText
:
function
()
{
//
return this.counting ? (this.count + 's') : '发验证码'
return
this
.
counting
?
(
this
.
count
+
's'
)
:
'发验证码'
//
},
},
//
isOk: function() {
isOk
:
function
()
{
//
return this.phone.isMobile() && this.code.isCode() && this.password.isPwd()
return
this
.
phone
.
isMobile
()
&&
this
.
code
.
isCode
()
&&
this
.
password
.
isPwd
()
//
}
}
//
},
},
//
methods: {
methods
:
{
//
onConfirm: function() {
onConfirm
:
function
()
{
//
let user = this.phone//获取用户邮箱地址
let
user
=
this
.
phone
//获取用户邮箱地址
//
let verify = this.code//获取验证码
let
verify
=
this
.
code
//获取验证码
//
let uname = "用户" + parseInt(Math.random() * 1000)//获取用户昵称
let
uname
=
"用户"
+
parseInt
(
Math
.
random
()
*
1000
)
//获取用户昵称
//
let password = this.password//获取密码
let
password
=
this
.
password
//获取密码
//
let mhm_id = ''//机构
let
mhm_id
=
''
//机构
//
let invite_code = ''//邀请码
let
invite_code
=
''
//邀请码
//
$.ajax({
$
.
ajax
({
//
async:false,
async
:
false
,
//
type: "POST",
type
:
"POST"
,
//
url:REG_ADDRESS,
url
:
REG_ADDRESS
,
//
data:"phone="+user+"&uname="+uname+"&password="+password+"&type=2&verify="+verify+"&mhm_id="+mhm_id+"&invite_code="+invite_code,
data
:
"phone="
+
user
+
"&uname="
+
uname
+
"&password="
+
password
+
"&type=2&verify="
+
verify
+
"&mhm_id="
+
mhm_id
+
"&invite_code="
+
invite_code
,
//
dataType:"json",
dataType
:
"json"
,
//
success:function(data){
success
:
function
(
data
){
//
if( data.status == '0'){
if
(
data
.
status
==
'0'
){
//
ui.error(data.info)
ui
.
error
(
data
.
info
)
//
return
return
//
}else{
}
else
{
//
ui.success("注册成功")
ui
.
success
(
"注册成功"
)
//
location = data.data
location
=
data
.
data
//
}
}
//
}
}
//
})
})
//
},
},
//
onSendCode: function() {
onSendCode
:
function
()
{
//
this.checkPhone(this.readyToSend)
this
.
checkPhone
(
this
.
readyToSend
)
//
},
},
//
readyToSend: function() {
readyToSend
:
function
()
{
//
let that = this
let
that
=
this
//
if(!this.counting) {
if
(
!
this
.
counting
)
{
//
let phone = that.phone
let
phone
=
that
.
phone
//
$.ajax({
$
.
ajax
({
//
type: "POST",
type
:
"POST"
,
//
url:GET_PHONEVERIFY,
url
:
GET_PHONEVERIFY
,
//
data:"phone="+phone,
data
:
"phone="
+
phone
,
//
dataType:"json",
dataType
:
"json"
,
//
success:function(data){
success
:
function
(
data
){
//
if(data.status=='0'){
if
(
data
.
status
==
'0'
){
//
ui.error(data.info)
ui
.
error
(
data
.
info
)
//
return
return
//
}else{
}
else
{
//
that.counting = true
that
.
counting
=
true
//
that.onTick()
that
.
onTick
()
//
return
return
//
}
}
//
}
}
//
})
})
//
}
}
//
},
},
//
checkPhone: function(call) {
checkPhone
:
function
(
call
)
{
//
let phone = this.phone
let
phone
=
this
.
phone
//
//验证此手机是否已被注册
//验证此手机是否已被注册
//
$.ajax({
$
.
ajax
({
//
type: "POST",
type
:
"POST"
,
//
url:CLICK_PHONE,
url
:
CLICK_PHONE
,
//
data:"phone="+phone,
data
:
"phone="
+
phone
,
//
dataType:"text",
dataType
:
"text"
,
//
success:function(data){
success
:
function
(
data
){
//
if(data==0){
if
(
data
==
0
){
//
ui.error('此手机已被注册,请更换');
ui
.
error
(
'此手机已被注册,请更换'
);
//
return;
return
;
//
}else{
}
else
{
//
call && call()
call
&&
call
()
//
}
}
//
}
}
//
});
});
//
},
},
//
onTick: function() {
onTick
:
function
()
{
//
if(this.count > 0) {
if
(
this
.
count
>
0
)
{
//
this.count -= 1
this
.
count
-=
1
//
setTimeout(this.onTick, 1000)
setTimeout
(
this
.
onTick
,
1000
)
//
} else {
}
else
{
//
this.count = 60
this
.
count
=
60
//
this.counting = false
this
.
counting
=
false
//
}
}
//
}
}
//
}
}
//
})
})
</script>
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment