Commit ed439d69 authored by xishifeng's avatar xishifeng

客户收藏

parent 09370a92
......@@ -102,8 +102,9 @@
</div>
<div class="bottom-btn-area">
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/but_genjin_new.png" /></a>
<a href="javascript:;" id="mark_btn" data-ismark="0"><img src="/app/images/icon_collection@2x.png" /></a>
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look01@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/img_followup01@2x.png" /></a>
</div>
<div id="genjin_modal">
......
......@@ -300,24 +300,30 @@ span.dot-block>mark{
overflow: hidden;
position: fixed;
width: 7.5rem;
box-sizing: border-box;
padding: .1rem .2rem;
left: 0;
bottom: .1rem;
bottom: 0;
display: flex;
justify-content: space-between;
background-color: white;
box-shadow: 0 -.03rem .1rem rgba(0, 0, 0, .1);
}
.bottom-btn-area>a{
overflow: hidden;
flex: 1;
}
.bottom-btn-area>a:nth-of-type(1){
float: left;
margin-left: 1.04rem;
flex: 1.28rem 0 0;
}
.bottom-btn-area>a:nth-of-type(2){
float: right;
margin-right: 1.04rem;
.bottom-btn-area>a:nth-of-type(2),
.bottom-btn-area>a:nth-of-type(3){
flex: 2.6rem 0 0;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-btn-area>a>img{
float: left;
width: 2.24rem;
height: 1.6rem;
width: 100%;
}
/*跟进模态框区域*/
......
......@@ -61,7 +61,8 @@ function loadMain(){
url: ServerHostTempC + '/broker/useraction_search',
data: {
'AuthToken': _token,
'user_id': Number(_customerId)
'user_id': Number(_customerId),
'agent_id': Number(_userId)
},
timeout: 30000,
dataType: 'json',
......@@ -70,6 +71,11 @@ function loadMain(){
console.log(data);
if(typeof data === 'object') {
if (data.code == 200) {
if(data.data.is_collect == '1'){
//收藏状态 1:表示已经收藏 2:暂未收藏
$('#mark_btn').attr('data-ismark','1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
};
$('#customer_code').html(data['data']['user_info']['user_id']);
$('#customer_name, #name').html((data['data']['user_info']['user_name'] == null?'':data['data']['user_info']['user_name'])+(data['data']['user_info']['user_nick']?('('+data['data']['user_info']['user_nick']+')'):''));
if(data['data']['user_info']['sex']==2){
......@@ -161,6 +167,57 @@ function loadMain(){
$('.record-main>ul').html('<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>');
}
//点击收藏按钮触发的事件
$('#mark_btn').click(function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var isMark = ((_this.attr('data-ismark')=='1')?true:false);//点击的时候,是否是已经收藏的状态,记录
var isAjaxIng = false;//是否正在执行请求操作
if(!isAjaxIng){
//只有没有在执行请求操作的时候,才能进行请求
$.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/addCollectUser',
data: {
'AuthToken': _token,
'agents_id': _customerId,
'user_id': _userId,
'status': isMark?2:1
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {
isAjaxIng = true;
},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
if(isMark){
_this.attr('data-ismark', '0').find('img').attr('src', '/app/images/icon_collection@2x.png');
}else{
_this.attr('data-ismark', '1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
}
}else {
layerTipsX(data['msg']);
};
}else{
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus){
isAjaxIng = false;
if(textStatus === 'timeout'){
layerTipsX('请求超时');
};
}
});
}
});
//添加报备的点击事件
$('#baobei_btn').click(function(){
......
......@@ -13,7 +13,7 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
document.body.style.display = 'block';
$.ajax({
type: 'get',
url: ServerHostTempC+'/broker/getShopDetail',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4,//pc后台固定传4
......
......@@ -708,7 +708,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
getFollowupList: function(){
$.ajax({
'type': 'get',
'url': ServerHostTempC+'/broker/getListByHouseId',
'url': '/broker/getListByHouseId',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken
......@@ -743,7 +743,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
};
$.ajax({
'type': 'post',
'url': ServerHostTempC+'/broker/addShopFollowUp',
'url': '/broker/addShopFollowUp',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken,
......
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