Commit 148e3f13 authored by agping's avatar agping

收藏客户修改

parent 52ef868a
......@@ -132,7 +132,7 @@ define(['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home
dataType: "json",
success: function(data) {
if(data.code != 200) {
alert("禁用失败!")
alert(data.msg)
}
}
});
......
......@@ -163,27 +163,35 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$(this).parent().remove();
});
//收藏 取消收藏
$(document).delegate(".is_show", "click", function() { //点击禁用
$(document).delegate(".is_show", "click", function() { //点击收藏 取消收藏
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
user.baohu = $(this).attr("data-baohu");
user.agentbaohu = $(this).attr("data-agent");
if(!confirm('是否继续?')) {
return;
}
user.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 = 2;
$(this).html('收藏');
} else {
params.type = 3;
};
if((user_info_obj.id*1 == user.agentbaohu*1) || user.baohu*1){
user.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 = 2;
$(this).html('收藏');
} else {
params.type = 3;
};
}else{
alert('该客户在保护期内,暂不能收藏');
return;
}
checkLogin();
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({ //禁用
......
......@@ -52,7 +52,7 @@
<td width="16%">
[% if((check_auth('auth_vip') && it[item]['vip']*1) || (it[item]['agent_id']*1 == 0) || (it[item]['agent_id']*1 == it[item]['current_agent_id']*1) || (check_auth('index/useraction_search') && it[item]['vip']*1 == 0)) { %]
<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-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]'>详情/跟进</a>&nbsp;
<a class="btn1 is_show [%= sw(it[item]['is_collect']) %]" data-id='[%= it[item]["id"] %]' data-cid='[%= it[item]["is_collect"] %]'>
<a class="btn1 is_show [%= sw(it[item]['is_collect']) %]" data-id='[%= it[item]["id"] %]' data-cid='[%= it[item]["is_collect"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]'>
[% if(it[item]["is_collect"] == 2) { %]
收藏
[% }else if(it[item]["is_collect"] == 1 ) { %]
......
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