Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cof_vip
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
houdong
cof_vip
Commits
9c20db14
Commit
9c20db14
authored
Jun 30, 2022
by
houdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册的弹框 用户名改成昵称
parent
82f12c74
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
22 deletions
+28
-22
pk.js
Public/js/pk.js
+5
-4
IndexAction.class.php
app/Lib/Action/Vip/IndexAction.class.php
+17
-15
index.html
app/Tpl/Vip/Index/index.html
+1
-1
pop.html
app/Tpl/Vip/Index/pop.html
+5
-2
No files found.
Public/js/pk.js
View file @
9c20db14
...
@@ -60,15 +60,16 @@ function submitBaoming(userType,tradeUrl){
...
@@ -60,15 +60,16 @@ function submitBaoming(userType,tradeUrl){
// layer.alert('请先获取验证码', 8);return;
// layer.alert('请先获取验证码', 8);return;
}
}
if
(
userType
==
2
){
if
(
userType
==
2
){
var
userName
=
$
(
"#userName
"
).
val
();
var
nick
=
$
(
"#nick
"
).
val
();
if
(
userName
==
''
){
layer
.
alert
(
'请设置用户名'
,
8
);
return
;}
//
if(userName==''){layer.alert('请设置用户名', 8);return;}
if
(
userName
.
length
<
6
){
layer
.
alert
(
'用户名长度至少6位'
,
8
);
return
;
}
//
if(userName.length<6){ layer.alert('用户名长度至少6位', 8);return; }
var
password
=
$
(
"#password"
).
val
();
var
password
=
$
(
"#password"
).
val
();
if
(
password
==
''
){
layer
.
alert
(
'请设置登录密码'
,
8
);
return
;}
if
(
password
==
''
){
layer
.
alert
(
'请设置登录密码'
,
8
);
return
;}
if
(
password
.
length
<
6
){
layer
.
alert
(
'密码长度至少6位'
,
8
);
return
;
}
if
(
password
.
length
<
6
){
layer
.
alert
(
'密码长度至少6位'
,
8
);
return
;
}
var
password2
=
$
(
"#password2"
).
val
();
var
password2
=
$
(
"#password2"
).
val
();
if
(
password
!=
password2
){
layer
.
alert
(
'两次密码不一致,请重新输入'
,
8
);
return
;}
if
(
password
!=
password2
){
layer
.
alert
(
'两次密码不一致,请重新输入'
,
8
);
return
;}
param
=
{
mobile
:
$
(
".phone-input"
).
val
(),
smsCode
:
$
(
".code-input"
).
val
(),
userName
:
userName
,
password
:
password
};
// param={mobile:$(".phone-input").val(),smsCode:$(".code-input").val(),userName:userName,password:password};
param
=
{
mobile
:
$
(
".phone-input"
).
val
(),
smsCode
:
$
(
".code-input"
).
val
(),
nick
:
nick
,
password
:
password
};
}
else
{
}
else
{
param
=
{
mobile
:
$
(
".phone-input"
).
val
(),
smsCode
:
$
(
".code-input"
).
val
()};
param
=
{
mobile
:
$
(
".phone-input"
).
val
(),
smsCode
:
$
(
".code-input"
).
val
()};
}
}
...
...
app/Lib/Action/Vip/IndexAction.class.php
View file @
9c20db14
...
@@ -230,6 +230,8 @@ class IndexAction extends IdentityAction {
...
@@ -230,6 +230,8 @@ class IndexAction extends IdentityAction {
$inviterId
=
I
(
'inviterId'
,
''
);
$inviterId
=
I
(
'inviterId'
,
''
);
$userName
=
I
(
'userName'
,
''
);
$userName
=
I
(
'userName'
,
''
);
$nick
=
I
(
'nick'
,
''
);
$password
=
I
(
'password'
,
''
);
$password
=
I
(
'password'
,
''
);
$referer
=
I
(
'referer'
,
''
);
$referer
=
I
(
'referer'
,
''
);
$groupInfo
=
M
(
'Group'
)
->
field
(
'group_id,web_id,category,name,startTime,endTime'
)
->
where
(
array
(
'group_id'
=>
$groupId
))
->
find
();
$groupInfo
=
M
(
'Group'
)
->
field
(
'group_id,web_id,category,name,startTime,endTime'
)
->
where
(
array
(
'group_id'
=>
$groupId
))
->
find
();
...
@@ -263,34 +265,34 @@ class IndexAction extends IdentityAction {
...
@@ -263,34 +265,34 @@ class IndexAction extends IdentityAction {
//测试
//测试
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
'验证码失效或者错误!'
));
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
'验证码失效或者错误!'
));
}
}
//新用户,使用用户输入的用户名注册
// if($userType==0){
$uc
=
uc_get_user
([
'token'
=>
$mobile
]);
//
// }
$uc
=
uc_get_user
(
array
(
'token'
=>
$mobile
));
$ucData
=
$uc
[
'data'
];
$ucData
=
$uc
[
'data'
];
// var_dump($ucData);exit;
// var_dump($ucData);exit;
//没有该用户,开始注册,status0有该用户,111表示用户不存在
//没有该用户,开始注册,status0有该用户,111表示用户不存在
if
(
$uc
[
'status'
]
==
111
){
if
(
$uc
[
'status'
]
==
111
){
// $username = randUsername('股神',$mobile);
//页面输入的用户名改成昵称
$userName
=
randUsername
(
'股神'
,
$mobile
);
// $password = substr(md5($username), 18);
// $password = substr(md5($username), 18);
//检查用户输入的用户名是否存在
//检查用户输入的用户名是否存在
$result
=
uc_user_checkname
(
$userName
);
// $result = uc_user_checkname($userName);
//用户名已存在
// //用户名已存在
if
(
$result
[
'status'
]
==
122
){
// if($result['status']==122){
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
'该用户名已存在,请更换!'
));
// $this->ajaxReturn(array('status' => 0, 'info' => '该用户名已存在,请更换!'));
}
// }
$uc
=
uc_user_register
(
array
(
'userName'
=>
$userName
,
'password'
=>
$password
,
'ip'
=>
get_client_ip
(),
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
,
'sourse'
=>
'www'
));
$uc
=
uc_user_register
([
'userName'
=>
$userName
,
'password'
=>
$password
,
'ip'
=>
get_client_ip
(),
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
,
'sourse'
=>
'www'
,
'nick'
=>
$nick
]);
// var_dump($uc);exit;
// var_dump($uc);exit;
//status0是注册成功
//status0是注册成功
if
(
$uc
[
'status'
])
{
if
(
$uc
[
'status'
])
{
$this
->
ajaxReturn
(
array
(
'status'
=>
0
,
'info'
=>
'注册失败!'
)
);
$this
->
ajaxReturn
(
[
'status'
=>
0
,
'info'
=>
'注册失败!('
.
$uc
[
'error'
]
.
')'
,
'debug'
=>
json_encode
(
$uc
)]
);
}
}
//注册成功
//注册成功
$ucData
=
$uc
[
'data'
];
$ucData
=
$uc
[
'data'
];
// var_dump($ucData['user_name']);exit;
// var_dump($ucData['user_name']);exit;
$info
=
array
(
'user_id'
=>
$ucData
[
'user_id'
],
'user_name'
=>
$userName
,
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
);
$info
=
[
'user_id'
=>
$ucData
[
'user_id'
],
'user_name'
=>
$userName
,
'mobile'
=>
$mobile
,
'mobile_status'
=>
1
];
$info
[
'nick'
]
=
$nick
;
$res
=
$this
->
_addUser
(
$info
);
$res
=
$this
->
_addUser
(
$info
);
...
...
app/Tpl/Vip/Index/index.html
View file @
9c20db14
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/layer/layer.min.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/layer/layer.min.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/clipboard.min.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/clipboard.min.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/slider/js/jquery.bxslider.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/slider/js/jquery.bxslider.js"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/pk.js{$Think.config.js_version}11"
></script>
<script
type=
"text/javascript"
src=
"__PUBLIC__/js/pk.js{$Think.config.js_version}11
1
"
></script>
<script
src=
"../../../../Public/js/pk.js"
></script>
<script
src=
"../../../../Public/js/pk.js"
></script>
</head>
</head>
...
...
app/Tpl/Vip/Index/pop.html
View file @
9c20db14
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
<span
class=
"part-line"
>
|
</span><input
type=
"button"
class=
"code-btn"
value=
"获取验证码"
>
<span
class=
"part-line"
>
|
</span><input
type=
"button"
class=
"code-btn"
value=
"获取验证码"
>
</div>
</div>
<div
class=
"form-info-input"
style=
"display: none"
>
<div
class=
"form-info-input"
style=
"display: none"
>
<input
class=
"phone-input"
placeholder=
"请设置用户名"
maxlength=
"27"
id=
"userName"
autocomplete=
"off"
>
<!--<input class="phone-input" placeholder="请设置用户名" maxlength="27" id="userName" autocomplete="off">-->
<input
class=
"phone-input"
placeholder=
"请设置昵称"
maxlength=
"27"
id=
"nick"
autocomplete=
"off"
>
</div>
</div>
<div
class=
"form-info-input"
style=
"display: none"
>
<div
class=
"form-info-input"
style=
"display: none"
>
<input
type=
"password"
class=
"phone-input"
placeholder=
"请设置密码"
maxlength=
"20"
id=
"password"
autocomplete=
"off"
>
<input
type=
"password"
class=
"phone-input"
placeholder=
"请设置密码"
maxlength=
"20"
id=
"password"
autocomplete=
"off"
>
...
@@ -110,7 +111,9 @@
...
@@ -110,7 +111,9 @@
//0未点击获取验证码,1老用户,2新用户
//0未点击获取验证码,1老用户,2新用户
userType
=
data
.
userType
;
userType
=
data
.
userType
;
if
(
userType
==
2
){
if
(
userType
==
2
){
$
(
'#userName'
).
parent
().
show
();
// $('#userName').parent().show();
$
(
'#nick'
).
parent
().
show
();
$
(
'#password'
).
parent
().
show
();
$
(
'#password'
).
parent
().
show
();
$
(
'#password2'
).
parent
().
show
();
$
(
'#password2'
).
parent
().
show
();
}
}
...
...
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