Commit 3549fb50 authored by agping's avatar agping

修改

parent cfead1a5
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* User: liu yin ping
* Date: 2018/8/7
* Time: 15:48
*/
use app\index\extend\Basic;
class MyCollectionUser extends Basic
{
public function myCollectionUserList()
{
if (!$this->request->isAjax()) {
return view('myCollectionUser/myCollectionUserList');
}
}
}
{layout name="global/frame_tpl" /}
<!--商铺标签页面-->
<input type="hidden" class="page-load" id="myCollectionUserList" />
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">我收藏的客户</a></li>
<!--<li class="active">新增</li>-->
<div class="pull-right">
<ul class="bread_btn">
<li>
<!--<a href="#modal-edit" data-toggle="modal" class="btn btn-default edit_add"><i class="icon-plus"></i>
新增</a>-->
</li>
</ul>
</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed text-center">
<thead>
<tr>
<th class="text-center">客户ID</th>
<th class="text-center">客户姓名</th>
<th class="text-center">客户电话</th>
<!--<th class="text-center">创建时间</th>
<th class="text-center">最后跟进时间</th>-->
<th class="text-center">客户状态</th>
<th class="text-center">业态</th>
<th class="text-center">价格</th>
<th class="text-center">面积</th>
<!--<th class="text-center">产生类型</th>-->
<th class="text-center">操作</th>
</tr>
</thead>
<tbody id="label_list">
</tbody>
</table>
</div>
<!-- /#page-content-wrapper//分页 -->
<div class="text-right pageinfo" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--编辑-->
<div class="modal fade" id="modal-edit" 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">
×
</button>
<h4 class="modal-title">
角色信息
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-3 control-label">新增标签:</label>
<input class="form-control btn6" data-rule-buga="false" data-rule-required="true" name="title" placeholder="不能多于5个字" type="text" value="" id="title">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_edit" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
......@@ -267,6 +267,7 @@ Route::group('index', [
'realtimePerformance' => [ 'index/RealTimePerformance/realtimePerformanceList', [ 'method' => 'GET' ] ],//实时业绩liu
'shopinspectionLog' => [ 'index/ShopInspectionLog/shopinspectionLogList', [ 'method' => 'POST|GET' ] ],//商铺查看日志liu
'performancesubsidiaryList' => [ 'index/PerformanceSubsidiary/performancesubsidiaryList', [ 'method' => 'POST|GET' ] ],//商铺查看日志liu
'myCollectionUserList' => [ 'index/myCollectionUser/myCollectionUserList', [ 'method' => 'POST|GET' ] ],//商铺查看日志liu
'lookShopIndex' => [ 'index/LookShop/lookShopIndex', [ 'method' => 'GET' ] ],//商铺查看日志
......
define (['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home.css','pagination','bootstrapJs'], function (doT, template) {
label = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
pageNum:10,
init: function () {
//初始化dot
$ ("body").append (template);
label.getList (1);
label.event ();
},
event: function () {
$ (document).delegate (".edit", "click", function () {//点击编辑
label.house_id = $ (this).attr ("data-id");
label.Edit();
});
$ (document).delegate (".submit_edit", "click", function () {//提交编辑
label.Submit_edit();
label.getList();
});
},
Edit:function(){//获取
$.ajax({
'type': 'GET',
'url' : '/index/labelEdit',//获取编辑数据
data: {"id":label.house_id},
dataType: "json",
success: function(data){
if (data.data) {
$("input[name = title]").val(data.data.name);
}
else {
alert('获取失败!');
}
}
});
},
Submit_edit:function(){//提交编辑的信息
var par={};
par.id= label.house_id;
par.name=$("input[name =title]").val();
par.type="0";
$.ajax({
'type': 'POST',
'url' : '/index/labelEdit',
data:par,
dataType: "json",
success: function(data){
if(data.code==200){
}else{
alert(data.msg);
}
}
});
},
getList: function (pageNo) {
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
label.pageNo = pageNo;
console.log(user_info_obj);
var params = {};
params.agents_id = user_info_obj.id;
params.pageNo = label.pageNo;
params.pageSize = label.pageSize;
params.AuthToken = user_info_obj.AuthToken;
$.ajax ({
// url: 'https://pre2.tonglianjituan.com'+'/broker/getCollectUserListt',//我的收藏
url: '/broker/getCollectUserList',//列表数据
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('my_collection_user_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#label_list").html (doTtmpl (data.data.user_date));
/*分页代码*/
add_page(data.data.total,pageNo,label.pageSize,label.getList);
/* $ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: label.pageSize,
onClick: function (el) {
label.getList (el.num.current);
}
});*/
}
});
}
};
return label;
});
\ No newline at end of file
......@@ -72,6 +72,43 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
e.stopPropagation();
$(this).parent().remove();
});
//收藏 取消收藏
$(document).delegate(".is_show", "click", function() { //点击禁用
if(!confirm('是否继续?')) {
return;
}
// agent.id = $(this).attr("data-id");
var params = {
};
params.id = $(this).attr("data-id");
var str = $.trim($(this).html());
if(str == "收藏") {
$(this).attr('class', 'btn1 btn-default is_show');
params.type = 1;
$(this).html('取消收藏');
} else if(str == "取消收藏") {
$(this).attr('class', 'btn1 btn-info is_show');
params.type = 0;
$(this).html('收藏');
} else {
params.type = 2;
}
$.ajax({ //禁用
'type': 'POST',
'url': '/broker/addCollectUser',//客户收藏 取消收藏
data: {
// "ids": agent.id,
"status": params.type
},
dataType: "json",
success: function(data) {
if(data.code != 200) {
alert("禁用失败!")
}
}
});
});
//城市 区域 筛选
_doc.on('input', '#user_city_add,#user_city_edit,#user_city_choose', function() {
console.log(222);
......
<script id="my_collection_user_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<!--<th class="text-center">客户ID</th>
<th class="text-center">客户姓名</th>
<th class="text-center">客户电话</th>
<th class="text-center">创建时间0</th>
<th class="text-center">最后跟进时间0</th>
<th class="text-center">客户状态</th>
<th class="text-center">业态</th>
<th class="text-center">价格</th>
<th class="text-center">面积</th>
<th class="text-center">产生类型0</th>
<th class="text-center">操作</th>-->
<td>[%= it[item]["user_id"] %]</td>
<td>[%= it[item]["user_name"] %]</td>
<td>[%= it[item]["user_phone"] %]</td>
<td>[%= it[item]["user_status"] %]</td>
<td>[%= it[item]["industry_type"] %]</td>
<td>[%= it[item]["price_demand"] %]</td>
<td>[%= it[item]["area_demand"] %]</td>
<td>
<a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
......@@ -47,7 +47,14 @@
<a class="btn1 caozuo genj_ure caozuo-add-color [%= getLoaclId(it[item]['id']) %]" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]' data-agentId='[%= it[item]["agent_id"] %]' data-name='[%= it[item]["user_name"] %]'>详情/跟进</a>&nbsp;
[% if(it[item]['agent_id'] == it[item]['current_agent_id']) { %]
<!--[% if(it[item]["status"] == 0) { %]-->
<a class="btn1 btn-info is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>收藏</a>
<!--[% }else if(it[item]["status"] == 1) { %]-->
<!--<a class="btn1 btn-default is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>冻结</a>
[% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %]-->
<a class="btn1 btn-success caozuo" href="#modal-record-edit" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>客户编辑</a>&nbsp;
[% } %]
<!--<a class="btn1 btn-success genj_ure" href="#modal-add" data-toggle="modal" data-id='[%= it[item]["id"] %]'>跟进</a>&nbsp;-->
......
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