Toggle navigation
This project
Loading...
Sign in
najixian
/
xt_dc_admin
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Download as
Email Patches
Plain Diff
Browse Files
Commit
dd6fa88382f68bce75af322343a7e693f008bd90
Authored by
pengye
2019-12-19 18:11:31 +0800
1 parent
42762f73
build: skipped
no message
Changes
2
Builds
0
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
application/admin/controller/Area.php
application/admin/view/area/addagent.html
application/admin/controller/Area.php
View file @
dd6fa88
...
...
@@ -60,6 +60,18 @@ class Area extends Common
return
$this
->
fetch
();
}
public
function
addagent
(){
if
(
Request
::
isAjax
()){
$data
=
Request
::
except
(
'file'
);
//获取运营人员列表
$list
=
file_get_contents
(
ON_LINE
.
'App.Agent.addAgent&areaid='
.
$data
[
'areaid'
]
.
'&agent_name='
.
$data
[
'agent_name'
]
.
'&agent_phone='
.
$data
[
'agent_phone'
]);
$array
=
json_decode
(
$list
,
TRUE
);
return
$result
=
[
'code'
=>
0
,
'msg'
=>
'添加成功!'
,
'data'
=>
$array
[
'data'
],
'rel'
=>
1
];
#'count'=>$array['data'][0]['total']
}
$this
->
assign
(
'title'
,
'代理商管理'
);
return
$this
->
fetch
();
}
/**
* 商家list
*/
...
...
application/admin/view/area/addagent.html
0 → 100644
View file @
dd6fa88
{include file="common/head"/}
<div
class=
"admin-main fadeInUp animated"
ng-app=
"hd"
ng-controller=
"ctrl"
>
<fieldset
class=
"layui-elem-field layui-field-title"
>
<legend>
{$title}
</legend>
</fieldset>
<form
class=
"layui-form layui-form-pane"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
代理商名称
</label>
<div
class=
"layui-input-4"
>
<input
type=
"text"
name=
"agent_name"
ng-model=
"field.title"
lay-verify=
"required"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
代理商手机号
</label>
<div
class=
"layui-input-4"
>
<input
type=
"text"
name=
"agent_phone"
ng-model=
"field.title"
lay-verify=
"required"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
type=
"button"
class=
"layui-btn"
lay-submit=
""
lay-filter=
"submit"
>
{:lang('submit')}
</button>
<a
href=
"{:url('addagent')}"
class=
"layui-btn layui-btn-primary"
>
{:lang('back')}
</a>
</div>
</div>
</form>
</div>
{include file="common/foot"/}
<script
src=
"/static/common/js/angular.min.js"
></script>
<script>
var
m
=
angular
.
module
(
'hd'
,[]);
m
.
controller
(
'ctrl'
,[
'$scope'
,
function
(
$scope
)
{
$scope
.
field
=
'{$info|raw}'
!=
'null'
?{
$info
|
raw
}:{
title
:
''
};
layui
.
use
([
'form'
,
'layer'
],
function
()
{
var
form
=
layui
.
form
,
layer
=
layui
.
layer
,
$
=
layui
.
jquery
;
form
.
on
(
'submit(submit)'
,
function
(
data
)
{
loading
=
layer
.
load
(
1
,{
shade
:[
0.1
,
'#fff'
]});
// 提交到方法 默认为本身
data
.
field
.
group_id
=
$scope
.
field
.
group_id
;
$
.
post
(
""
,
data
.
field
,
function
(
res
)
{
layer
.
close
(
loading
);
if
(
res
.
code
>
0
)
{
layer
.
msg
(
res
.
msg
,
{
time
:
1800
,
icon
:
1
},
function
()
{
location
.
href
=
res
.
url
;
});
}
else
{
layer
.
msg
(
res
.
msg
,
{
time
:
1800
,
icon
:
2
});
}
});
})
});
}]);
</script>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment