切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
王晓刚
6 years ago
提交
1f928d3b6aa41ccae7291891685ff015d826c7be
2 个父辈
cb369cf8
af241d0a
1 个管道 的构建
通过
耗费 0 秒
合并分支 'wangxiaogang' 到 'master'
补全信息页面 查看合并请求
!78
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
47 行增加
和
12 行删除
app/portal/controller/ShareController.php
public/themes/simpleboot3/portal/share/information.html
app/portal/controller/ShareController.php
查看文件 @
1f928d3
...
...
@@ -74,6 +74,22 @@ class ShareController extends WeChatBaseController
$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
)
->
insert
(
$param
);
if
(
empty
(
$result
)){
$this
->
error
(
'保存失败'
);
}
else
{
$this
->
success
(
'保存成功'
);
}
}
/**
* 分享链接
...
...
public/themes/simpleboot3/portal/share/information.html
查看文件 @
1f928d3
...
...
@@ -42,7 +42,7 @@
手机号
</div>
<div
class=
"log_two_input_contant"
>
<input
type=
"text"
placeholder=
"请输入手机号"
value=
"{$data.phone}"
maxlength=
"11"
id=
"phone"
onblur=
"checkPhone()"
/>
<input
type=
"text"
placeholder=
"请输入手机号"
value=
"{$data.phone}"
maxlength=
"11"
id=
"phone"
/>
</div>
</div>
...
...
@@ -50,24 +50,43 @@
<!-- 保存 -->
<div
class=
"log_two_bottom_btn log_third_btn"
>
<a
href=
"log_first.html
"
>
保存
</a>
<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
()
{
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
;
}
}
$
(
'.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>
...
...
请
注册
或
登录
后发表评论