切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
anyv
6 years ago
提交
bdad5706e3a08492426d7d71b47d6295e40e4ca0
2 个父辈
574263b0
5c0749e4
Merge branch 'master' of
http://114.215.101.231:8099/anyv/xkeasy
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
116 行增加
和
0 行删除
app/portal/controller/ShareController.php
public/themes/simpleboot3/portal/share/information.html
app/portal/controller/ShareController.php
查看文件 @
bdad570
...
...
@@ -34,6 +34,7 @@ class ShareController extends WeChatBaseController
}
if
(
empty
(
$my_user
[
'phone'
])){
$this
->
error
(
'跳转补全信息页面'
,
''
,
''
,
''
);
$this
->
redirect
(
'information'
);
}
//判断有没有生成过
if
(
!
file_exists
(
'./upload/poster/poster_'
.
$user_id
.
".png"
)){
...
...
@@ -67,6 +68,28 @@ class ShareController extends WeChatBaseController
$this
->
assign
(
'share_image'
,
$share_image
);
return
$this
->
fetch
();
}
public
function
information
(){
$user_id
=
cmf_get_current_user_id
();
$data
=
Db
::
name
(
'my_user'
)
->
where
([
'uid'
=>
$user_id
])
->
find
();
$this
->
assign
(
'data'
,
$data
);
return
$this
->
fetch
();
}
public
function
information_save
(){
$param
=
$this
->
request
->
param
();
if
(
empty
(
$param
[
'name'
])){
$this
->
error
(
'姓名不能为空'
);
}
if
(
empty
(
$param
[
'phone'
])){
$this
->
error
(
'手机号不能为空'
);
}
$user_id
=
cmf_get_current_user_id
();
$result
=
Db
::
name
(
'my_user'
)
->
where
(
'uid'
,
$user_id
)
->
update
(
$param
);
if
(
empty
(
$result
)){
$this
->
error
(
'保存失败'
);
}
else
{
$this
->
success
(
'保存成功'
);
}
}
/**
* 分享链接
...
...
public/themes/simpleboot3/portal/share/information.html
0 → 100644
查看文件 @
bdad570
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html;charset=UTF-8"
/>
<meta
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
name=
"viewport"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
/>
<title>
学考无忧-补全信息
</title>
<link
rel=
"stylesheet"
href=
"__TMPL__/public/assets/css/reset.css"
/>
<link
rel=
"stylesheet"
href=
"__TMPL__/public/assets/css/log.css"
/>
<style
type=
"text/css"
>
/*log_third页面*/
.log_third_btn
{
position
:
fixed
;
bottom
:
0rem
;
}
</style>
</head>
<body>
<div
class=
"log_top_co"
>
<!-- 顶部 -->
<div
class=
" order_top log_top_co"
>
<a
href=
""
>
<img
src=
"__TMPL__/public/assets/images/left.png"
alt=
""
/>
</a>
<p>
补全信息
</p>
</div>
</div>
<div
class=
"log_two_input"
>
<div
class=
"log_two_input_one"
>
<div
class=
"log_two_input_title"
>
姓名
</div>
<div
class=
"log_two_input_contant"
>
<input
type=
"text"
id=
"name"
value=
"{$data.name}"
placeholder=
"请输入姓名"
/>
</div>
</div>
<div
class=
"log_two_input_one"
>
<div
class=
"log_two_input_title"
>
手机号
</div>
<div
class=
"log_two_input_contant"
>
<input
type=
"text"
placeholder=
"请输入手机号"
value=
"{$data.phone}"
maxlength=
"11"
id=
"phone"
/>
</div>
</div>
</div>
<!-- 保存 -->
<div
class=
"log_two_bottom_btn log_third_btn"
>
<a
class=
"save"
>
保存
</a>
</div>
<script
src=
"__TMPL__/public/assets/js/jquery.js"
></script>
<script
src=
"__TMPL__/public/assets/js/base.js"
></script>
<script>
function
checkPhone
()
{
}
$
(
'.save'
).
click
(
function
(){
var
name
=
$
(
'#name'
).
val
();
if
(
name
==
''
){
alert
(
"姓名不能为空"
);
return
false
}
var
phone
=
document
.
getElementById
(
'phone'
).
value
;
if
(
!
(
/^1
[
34578
]\d{9}
$/
.
test
(
phone
)))
{
alert
(
"手机号码有误,请重填"
);
return
false
;
}
$
.
ajax
({
url
:
"{:url('information_save')}"
,
type
:
"GET"
,
data
:{
'name'
:
name
,
'phone'
:
phone
},
success
:
function
(
res
){
if
(
res
.
code
==
1
){
alert
(
res
.
msg
);
window
.
location
.
href
=
"{:url('share/index')}"
;
}
else
{
alert
(
res
.
msg
);
}
},
error
:
function
(
res
){
alert
(
'与服务器断开连接'
);
}
})
})
</script>
</body>
</html>
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论