Showing
2 changed files
with
64 additions
and
0 deletions
| @@ -60,6 +60,18 @@ class Area extends Common | @@ -60,6 +60,18 @@ class Area extends Common | ||
| 60 | return $this->fetch(); | 60 | return $this->fetch(); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | + public function addagent(){ | ||
| 64 | + if(Request::isAjax()){ | ||
| 65 | + $data = Request::except('file'); | ||
| 66 | + //获取运营人员列表 | ||
| 67 | + $list= file_get_contents(ON_LINE.'App.Agent.addAgent&areaid='.$data['areaid'].'&agent_name='.$data['agent_name'].'&agent_phone='.$data['agent_phone']); | ||
| 68 | + $array = json_decode($list,TRUE); | ||
| 69 | + return $result = ['code'=>0,'msg'=>'添加成功!','data'=>$array['data'],'rel'=>1];#'count'=>$array['data'][0]['total'] | ||
| 70 | + } | ||
| 71 | + $this->assign ( 'title','代理商管理'); | ||
| 72 | + return $this->fetch(); | ||
| 73 | + } | ||
| 74 | + | ||
| 63 | /** | 75 | /** |
| 64 | * 商家list | 76 | * 商家list |
| 65 | */ | 77 | */ |
application/admin/view/area/addagent.html
0 → 100644
| 1 | +{include file="common/head"/} | ||
| 2 | +<div class="admin-main fadeInUp animated" ng-app="hd" ng-controller="ctrl"> | ||
| 3 | + <fieldset class="layui-elem-field layui-field-title"> | ||
| 4 | + <legend>{$title}</legend> | ||
| 5 | + </fieldset> | ||
| 6 | + <form class="layui-form layui-form-pane"> | ||
| 7 | + <div class="layui-form-item"> | ||
| 8 | + <label class="layui-form-label">代理商名称</label> | ||
| 9 | + <div class="layui-input-4"> | ||
| 10 | + <input type="text" name="agent_name" ng-model="field.title" lay-verify="required" class="layui-input"> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + <div class="layui-form-item"> | ||
| 14 | + <label class="layui-form-label">代理商手机号</label> | ||
| 15 | + <div class="layui-input-4"> | ||
| 16 | + <input type="text" name="agent_phone" ng-model="field.title" lay-verify="required" class="layui-input"> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + <div class="layui-form-item"> | ||
| 20 | + <div class="layui-input-block"> | ||
| 21 | + <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button> | ||
| 22 | + <a href="{:url('addagent')}" class="layui-btn layui-btn-primary">{:lang('back')}</a> | ||
| 23 | + </div> | ||
| 24 | + </div> | ||
| 25 | + </form> | ||
| 26 | +</div> | ||
| 27 | +{include file="common/foot"/} | ||
| 28 | +<script src="/static/common/js/angular.min.js"></script> | ||
| 29 | +<script> | ||
| 30 | + var m = angular.module('hd',[]); | ||
| 31 | + m.controller('ctrl',['$scope',function($scope) { | ||
| 32 | + $scope.field = '{$info|raw}'!='null'?{$info|raw}:{title:''}; | ||
| 33 | + layui.use(['form', 'layer'], function () { | ||
| 34 | + var form = layui.form, layer = layui.layer,$= layui.jquery; | ||
| 35 | + form.on('submit(submit)', function (data) { | ||
| 36 | + loading = layer.load(1,{shade:[0.1,'#fff']}); | ||
| 37 | + // 提交到方法 默认为本身 | ||
| 38 | + data.field.group_id = $scope.field.group_id; | ||
| 39 | + $.post("", data.field, function (res) { | ||
| 40 | + layer.close(loading); | ||
| 41 | + if (res.code > 0) { | ||
| 42 | + layer.msg(res.msg, {time: 1800, icon: 1}, function () { | ||
| 43 | + location.href = res.url; | ||
| 44 | + }); | ||
| 45 | + } else { | ||
| 46 | + layer.msg(res.msg, {time: 1800, icon: 2}); | ||
| 47 | + } | ||
| 48 | + }); | ||
| 49 | + }) | ||
| 50 | + }); | ||
| 51 | + }]); | ||
| 52 | +</script> |
-
Please register or login to post a comment