Commit ed439d69 authored by xishifeng's avatar xishifeng

客户收藏

parent 09370a92
...@@ -102,8 +102,9 @@ ...@@ -102,8 +102,9 @@
</div> </div>
<div class="bottom-btn-area"> <div class="bottom-btn-area">
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look@2x.png" /></a> <a href="javascript:;" id="mark_btn" data-ismark="0"><img src="/app/images/icon_collection@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/but_genjin_new.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>
<div id="genjin_modal"> <div id="genjin_modal">
......
...@@ -300,24 +300,30 @@ span.dot-block>mark{ ...@@ -300,24 +300,30 @@ span.dot-block>mark{
overflow: hidden; overflow: hidden;
position: fixed; position: fixed;
width: 7.5rem; width: 7.5rem;
box-sizing: border-box;
padding: .1rem .2rem;
left: 0; 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{ .bottom-btn-area>a{
overflow: hidden; flex: 1;
} }
.bottom-btn-area>a:nth-of-type(1){ .bottom-btn-area>a:nth-of-type(1){
float: left; flex: 1.28rem 0 0;
margin-left: 1.04rem;
} }
.bottom-btn-area>a:nth-of-type(2){ .bottom-btn-area>a:nth-of-type(2),
float: right; .bottom-btn-area>a:nth-of-type(3){
margin-right: 1.04rem; flex: 2.6rem 0 0;
display: flex;
align-items: center;
justify-content: center;
} }
.bottom-btn-area>a>img{ .bottom-btn-area>a>img{
float: left; width: 100%;
width: 2.24rem;
height: 1.6rem;
} }
/*跟进模态框区域*/ /*跟进模态框区域*/
......
...@@ -61,7 +61,8 @@ function loadMain(){ ...@@ -61,7 +61,8 @@ function loadMain(){
url: ServerHostTempC + '/broker/useraction_search', url: ServerHostTempC + '/broker/useraction_search',
data: { data: {
'AuthToken': _token, 'AuthToken': _token,
'user_id': Number(_customerId) 'user_id': Number(_customerId),
'agent_id': Number(_userId)
}, },
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
...@@ -70,6 +71,11 @@ function loadMain(){ ...@@ -70,6 +71,11 @@ function loadMain(){
console.log(data); console.log(data);
if(typeof data === 'object') { if(typeof data === 'object') {
if (data.code == 200) { 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_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']+')'):'')); $('#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){ if(data['data']['user_info']['sex']==2){
...@@ -161,6 +167,57 @@ function loadMain(){ ...@@ -161,6 +167,57 @@ function loadMain(){
$('.record-main>ul').html('<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'); $('.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(){ $('#baobei_btn').click(function(){
......
...@@ -13,7 +13,7 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function ...@@ -13,7 +13,7 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
document.body.style.display = 'block'; document.body.style.display = 'block';
$.ajax({ $.ajax({
type: 'get', type: 'get',
url: ServerHostTempC+'/broker/getShopDetail', url: '/broker/getShopDetail',
data: { data: {
'id': shop_id, 'id': shop_id,
'site_area': 4,//pc后台固定传4 'site_area': 4,//pc后台固定传4
......
...@@ -708,7 +708,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -708,7 +708,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
getFollowupList: function(){ getFollowupList: function(){
$.ajax({ $.ajax({
'type': 'get', 'type': 'get',
'url': ServerHostTempC+'/broker/getListByHouseId', 'url': '/broker/getListByHouseId',
data: { data: {
'house_id': business.id, 'house_id': business.id,
'AuthToken': business.AuthToken 'AuthToken': business.AuthToken
...@@ -743,7 +743,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -743,7 +743,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
}; };
$.ajax({ $.ajax({
'type': 'post', 'type': 'post',
'url': ServerHostTempC+'/broker/addShopFollowUp', 'url': '/broker/addShopFollowUp',
data: { data: {
'house_id': business.id, 'house_id': business.id,
'AuthToken': business.AuthToken, '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