Commit ad2f2122 authored by clone's avatar clone

1

parent bf820544
...@@ -307,4 +307,27 @@ class LookShop extends Basic ...@@ -307,4 +307,27 @@ class LookShop extends Basic
{ {
return view("/look_shop/whitelist"); return view("/look_shop/whitelist");
} }
public function deleteWhitelist()
{
$params = $this->params;
/* $params = array(
"id" => 1,
);*/
if (!isset($params["id"])) {
return $this->response("101", "请求参数错误");
}
$id = $params["id"];
$aLookShopWhitelistModel = new ALookShopWhitelist();
$where_["id"] = $id;
$update_["is_del"] = 1;
$is_ok = $aLookShopWhitelistModel->updateWhitelist($where_, $update_);
if( $is_ok > 0 ){
return $this->response("200","success");
}else{
return $this->response("101","修改失败");
}
}
} }
\ No newline at end of file
...@@ -615,6 +615,7 @@ Route::group('index', [ ...@@ -615,6 +615,7 @@ Route::group('index', [
'getWhitelist' => ['index/LookShop/getWhitelist', ['method' => 'get']], 'getWhitelist' => ['index/LookShop/getWhitelist', ['method' => 'get']],
'addWhitelist' => ['index/LookShop/addWhitelist', ['method' => 'post']], 'addWhitelist' => ['index/LookShop/addWhitelist', ['method' => 'post']],
'setAgentLookNum' => ['index/LookShop/setAgentLookNum', ['method' => 'get | post']], 'setAgentLookNum' => ['index/LookShop/setAgentLookNum', ['method' => 'get | post']],
'deleteWhitelist' => ['index/LookShop/deleteWhitelist', ['method' => 'get | post']],
]); ]);
......
...@@ -36,6 +36,19 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b ...@@ -36,6 +36,19 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
params.submit_agent_id = user_info_obj.id; params.submit_agent_id = user_info_obj.id;
whitelist.upLookShop(params); whitelist.upLookShop(params);
}); });
$("#confirm_delete").click(function(){
var params = {};
params.id = $("#delete_agent_id").val();
if (!params.id || params.id == null) {
alert("要删除的经纪人id不能为空");
return false;
}
whitelist.deleteLookShop(params);
});
$("#search").click(function () { $("#search").click(function () {
var params = {}; var params = {};
var name = $("#name").val(); var name = $("#name").val();
...@@ -63,6 +76,9 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b ...@@ -63,6 +76,9 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
$(document).delegate(".up_look_shop", "click", function () { $(document).delegate(".up_look_shop", "click", function () {
$("#up_agent_id").val($(this).attr("data-agent_id")); $("#up_agent_id").val($(this).attr("data-agent_id"));
}); });
$(document).delegate(".delete_look_shop", "click", function () {
$("#delete_agent_id").val($(this).attr("data-id"));
});
$(document).delegate(".phone_jia", "click", function () { $(document).delegate(".phone_jia", "click", function () {
/*手机检索姓名*/ /*手机检索姓名*/
...@@ -163,6 +179,7 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b ...@@ -163,6 +179,7 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
$("#modal-add-do").modal('hide'); $("#modal-add-do").modal('hide');
if (data.code == "101") { if (data.code == "101") {
alert(data.msg); alert(data.msg);
return false; return false;
...@@ -202,6 +219,24 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b ...@@ -202,6 +219,24 @@ define(['doT', 'text!temp/whitelist_template_tpl.html', 'css!style/home.css', 'b
$(obj).parent().hide(); $(obj).parent().hide();
$("#agents_list").html(''); $("#agents_list").html('');
return; return;
},
deleteLookShop: function (params) {
$.ajax({
url: '/admin.php/index/deleteWhitelist',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function (data) {
$("#modal-delete").modal('hide');
if (data.code == "101") {
alert(data.msg);
return false;
}
whitelist.getWhitelist();
}
});
} }
}; };
return whitelist return whitelist
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
data-agent_id="[%= it[item]['agent_id'] %]" > data-agent_id="[%= it[item]['agent_id'] %]" >
升级查看铺数 升级查看铺数
</a> </a>
<a class="btn1 btn-success delete_look_shop" href="#modal-delete" data-toggle="modal"
data-id="[%= it[item]['id'] %]" >
删除
</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
...@@ -23,6 +27,35 @@ ...@@ -23,6 +27,35 @@
[% } %] [% } %]
</script> </script>
<!-- /#wrapper -->
<!-- /#删除模态框 -->
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
删除白名单
</h4>
</div>
<div class="modal-body">
<div class="modal-body">
<input type="hidden" value="" id="delete_agent_id"/>
确认删除吗?
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
确认
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- /#wrapper --> <!-- /#wrapper -->
<!-- /#删除模态框 --> <!-- /#删除模态框 -->
<div class="modal fade" id="modal-up" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="modal-up" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment