From 727b335b457fa781beddf2aad5b6b03d907df52d Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 26 Apr 2020 16:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestResourceController.class.php | 10 +++-- .../View/TestResource/supportNumberList.html | 38 ++++++++++++++++--- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/TestResourceController.class.php b/Application/Admin/Controller/TestResourceController.class.php index 77f8b8667..ebce9748f 100644 --- a/Application/Admin/Controller/TestResourceController.class.php +++ b/Application/Admin/Controller/TestResourceController.class.php @@ -118,10 +118,12 @@ class TestResourceController extends ThinkController $id =I('id',''); } else { $this->error('请选择资源后再进行操作'); + $this->ajaxReturn(['status'=>0, 'msg'=> '请选择资源后再进行操作']); } if (!I('status','')&&I('status','')!='0') { - $this->error('请选择状态后在进行操作'); + $this->ajaxReturn(['status'=>0, 'msg'=> '请选择状态后在进行操作']); +// $this->error('请选择状态后在进行操作'); } // $resourceData = M('test_resource','tab_') @@ -161,11 +163,13 @@ class TestResourceController extends ThinkController if ($isFreeze) { - $this->success('操作成功',U('supportNumberList')); +// $this->success('操作成功',U('supportNumberList')); + $this->ajaxReturn(['status'=>1, 'msg'=> '操作成功']); } else { - $this->error('操作失败',U('supportNumberList')); + $this->ajaxReturn(['status'=>1, 'msg'=> '操作失败']); +// $this->error('操作失败',U('supportNumberList')); } diff --git a/Application/Admin/View/TestResource/supportNumberList.html b/Application/Admin/View/TestResource/supportNumberList.html index c4309060b..341c8abf6 100644 --- a/Application/Admin/View/TestResource/supportNumberList.html +++ b/Application/Admin/View/TestResource/supportNumberList.html @@ -234,7 +234,7 @@ layer.msg('请选择要操作的数据',{skin:'textColor'}); return false; } - var url = "{:U('batchFreeze','','')}" + '/id/' + param + '/status/0'; + var url = "{:U('batchFreeze','','')}"; layer.confirm('是否冻结选中推广员下的资源账号?', { title:'冻结资源账号', @@ -242,8 +242,22 @@ skin:'textColor', btn: ['冻结','取消'] //按钮 }, function(){ - - window.location.href = url; + $.ajax({ + type: "POST", + url: url, + data: {id:param,status:0}, + dataType: 'json', + async: false, + success:function(data){ + if(data.status==1){ + layer.msg(data.msg,{time: 1000,skin:'msgClolor'}); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); + // window.location.href = url; }, function(){ layer.close(); @@ -264,7 +278,7 @@ layer.msg('请选择要操作的数据',{skin:'textColor'}); return false; } - var url = "{:U('batchFreeze','','')}" + '/id/' + param + '/status/1'; + var url = "{:U('batchFreeze','','')}"; layer.confirm('是否冻结选中推广员下的资源账号?', { title:'冻结资源账号', @@ -273,7 +287,21 @@ btn: ['冻结','取消'] //按钮 }, function(){ - window.location.href = url; + $.ajax({ + type: "POST", + url: url, + data: {id:param,status:1}, + dataType: 'json', + async: false, + success:function(data){ + if(data.status==1){ + layer.msg(data.msg,{time: 1000,skin:'msgClolor'}); + setTimeout(function(){ + window.location.reload(); + },1500); + } + } + }); }, function(){ layer.close();