Commit 0b5f40b7 authored by xishifeng's avatar xishifeng

1

parent 371fad74
......@@ -142,17 +142,17 @@
<section v-show="dataCode!=200"></section>
</main>
<div id="call_modal" style="display: block;">
<div id="call_modal">
<div class="call-modal-main">
<p class="call-modal-main-title">选择本机手机号</p>
<ol id="call_modal_phone_list">
<li class="call-select"><input placeholder="请输入本机手机号" maxlength="11" type="tel" id="call_modal_phone_self" readonly="">
<li class="call-select"><input placeholder="请输入本机手机号" maxlength="11" type="tel" id="call_modal_phone_self" readonly="" />
<div class="call-edit-icon">完成</div>
<div class="call-submit-ing-icon">提交中ing</div>
<div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png"></div>
<div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div>
</li>
<li class="call-add"><input placeholder="请输入本机手机号" maxlength="11" type="tel"><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png"></div></li></ol>
<div id="add_phone_btn" style="display: none;">增加手机号</div>
</ol>
<div id="add_phone_btn">增加手机号</div>
<p class="call-modal-main-tip">请确认选择的手机号和本机号码相同,否则提示为空号</p>
</div>
<div class="call-btn-area">
......
'use strict';
require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function(Vue, VConsole){
require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'], function(Vue, VConsole) {
var shop_id = getUrlParam('shop_id');
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
var vm = new Vue({
el: '#app',
data: {
user_info_obj,
dataCode: '',
maskShowFlag: false,//弹出窗层是否显示
callShowFlag: false,//拨打电话弹出窗层是否显示
telHide: '',//拨打隐号返回的号码
activeLandlordPhone: '',//当前点击的房东号码
maskShowFlag: false, //弹出窗层是否显示
callShowFlag: false, //拨打电话弹出窗层是否显示
telHide: '', //拨打隐号返回的号码
activeLandlordPhone: '', //当前点击的房东号码
d: {}
},
created: function() {
var _this = this;
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4,//pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4, //pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
mounted: function() {
var _thisV = this;
$('#call_modal_phone_self').val(localStorage.getItem('userphone'));
//拨打电话模态框,获取电话列表
_this.user_info_obj.id && $.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/agentsPhone',
data: {
'AuthToken': _this.user_info_obj.AuthToken,
'agents_id': _this.user_info_obj.id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li class="{0}"><input placeholder="请输入本机手机号" maxlength="11" type="tel" value="{1}" {2} /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div></li>'.stringFormatObj({
'0': '',
'1': item['phone'],
'2': 'readonly',
});
});
$('.call-modal-main>ol').append(_htmlTemp);
}else {
layerTipsX(data['msg']);
};
}else{
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
layerTipsX('请求超时');
};
}
_thisV.user_info_obj.id && $.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/agentsPhone',
data: {
'AuthToken': _thisV.user_info_obj.AuthToken,
'agents_id': _thisV.user_info_obj.id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li class="{0}"><input placeholder="请输入本机手机号" maxlength="11" type="tel" value="{1}" {2} /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div></li>'.stringFormatObj({
'0': '',
'1': item['phone'],
'2': 'readonly',
});
});
$('.call-modal-main>ol').append(_htmlTemp);
} else {
layerTipsX(data['msg']);
};
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
layerTipsX('请求超时');
};
}
});
var _doc = $(document);
var _genjinModal = $('#genjin_modal'),//跟进模态框dom
_callModal = $('#call_modal'),//拨打电话模态框dom
_markAreaObj = $('.genjin-mark-area-zhuangtai>.genjin-mark-area-alink'),//跟进标签列表状态标签区域dom
_markAreaObj2 = $('.genjin-mark-area-putong>.genjin-mark-area-alink'),//跟进标签列表普通标签区域dom
_beizhuObj = $('#content'),//跟进的备注内容
_genjinCloseBtn = $('#close_btn'),//跟进模态框关闭按钮
_btnSave = $('#btn_save'),//跟进的保存按钮
_btnSaveTemp = $('#btn_save_temp'),//跟进保存按钮临时
_userId = Number(localStorage.getItem('userid')),//当前用户id
isCallFlag = true,//是否是电话跟进,默认不是
_addPhoneBtn = $('#add_phone_btn'),//添加电话按钮
_addPhoneListObj = $('#call_modal_phone_list'),//添加电话列表对象dom
_userPhone = localStorage.getItem('userphone'),//当前用户的手机号
_selectPhone = '',//拨号列表里选择的号码,也是当前用户对应的手机号,可能和_userPhone是一样的
_customerPhone = '',//当前客户的手机号
_backPhone = '';//绑定之后返回的号码
_doc.on('click', '#call_modal_phone_list>li>.call-edit-icon', function(e) {
e.preventDefault();
e.stopPropagation();
var _this = $(this),
_phoneTemp = $.trim(_this.prev().val());
if(!is_mobile(_phoneTemp)) {
layerTipsX('请输入正确的手机号码');
return false;
};
$.ajax({
type: 'POST',
url: ServerHostTempC + '/broker/agentsPhone',
data: {
'AuthToken': _thisV.user_info_obj.AuthToken,
'agents_id': _thisV.user_info_obj.id,
'phone': _phoneTemp
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {
_this.hide();
_this.next().show();
},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
_this.prev().attr('readonly', 'readonly').parent().removeClass('call-add').addClass('call-select').siblings().removeClass('call-select');
_addPhoneBtn.show();
} else {
layerTipsX(data['msg']);
};
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus) {
_this.next().hide();
_this.parent().hasClass('call-add') && _this.show();
if(textStatus === 'timeout') {
layerTipsX('请求超时');
};
}
});
});
//拨打电话模态框,取消按钮点击事件
$('#call_btn_cancel').click(function(e) {
e.preventDefault();
e.stopPropagation();
_callModal.hide();
});
//点击头部区域拨打电话出现弹窗部分
$('.call-tel-btn').click(function(e) {
e.preventDefault();
e.stopPropagation();
_callModal.show();
});
_doc.on('click', '#call_modal_phone_list>li', function(e) {
e.preventDefault();
e.stopPropagation();
var _this = $(this);
if(_this.find('input')[0].readOnly) {
if(!_this.hasClass('call-select')) {
_this.addClass('call-select').siblings().removeClass('call-select');
};
};
});
_addPhoneBtn.click(function(e) {
e.preventDefault();
e.stopPropagation();
if(_addPhoneListObj.find('li').length >= 3) {
layerTipsX('可添加的号码最多为3');
return false;
} else {
_addPhoneBtn.hide();
_addPhoneListObj.append('<li class="call-add"><input placeholder="请输入本机手机号" maxlength="11" type="tel" /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div></li>').find('.call-add>input').focus();
};
});
_doc.on('click', '#call_modal_phone_list>li>.call-edit-icon', function(e) {
e.preventDefault();
e.stopPropagation();
var _this = $(this),
_phoneTemp = $.trim(_this.prev().val());
if(!is_mobile(_phoneTemp)) {
layerTipsX('请输入正确的手机号码');
return false;
};
$.ajax({
type: 'POST',
url: ServerHostTempC + '/broker/agentsPhone',
data: {
'AuthToken': _token,
'agents_id': _userId,
'phone': _phoneTemp
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {
_this.hide();
_this.next().show();
},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
_this.prev().attr('readonly', 'readonly').parent().removeClass('call-add').addClass('call-select').siblings().removeClass('call-select');
_addPhoneBtn.show();
} else {
layerTipsX(data['msg']);
};
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus) {
_this.next().hide();
_this.parent().hasClass('call-add') && _this.show();
if(textStatus === 'timeout') {
layerTipsX('请求超时');
};
}
});
});
var _callFlag = true;
$('#call_btn_ok').click(function(e) {
e.preventDefault();
e.stopPropagation();
if(!_callFlag) {
return false;
};
var _selectObj = $('.call-select');
if(_selectObj.length != 1) {
layerTipsX('选择出错');
return false;
} else {
_selectPhone = $.trim(_selectObj.find('input').val());
};
if(_selectPhone && _customerPhone) {
$.ajax({
type: 'POST',
url: ServerHostTempC + '/broker/bindAXB',
data: {
'AuthToken': _token,
'phone_a': _selectPhone,
'phone_b': _customerPhone
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {
_callFlag = false;
$('#call_btn_ok').hide();
$('#call_btn_ok_temp').show();
},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
_backPhone = data['data']['phone'];
console.log(_backPhone);
Compatible({
paraIos: {
'route': 'call',
'phone': _backPhone
},
fnAndroid: function() {
window.android.onPhoneCall(_backPhone);
},
fn: function() {
console.warn('error');
}
});
_callModal.hide(); //拨打电话模态框隐藏
_genjinCloseBtn.hide(); //跟进模态框关闭按钮隐藏
_markAreaObj2.parent().show(); //普通跟进标签列表显示
_beizhuObj.val(''); //清空跟进输入框内容
_markAreaObj2.find('a').removeClass('genjin-mark-active'); //清空普通跟进标签选择数据
setTimeout(function() {
_genjinModal.show(); //跟进模态框打开
}, 1000);
} else {
layerTipsX(data['msg']);
};
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus) {
$('#call_btn_ok_temp').hide();
$('#call_btn_ok').show();
_callFlag = true;
if(textStatus === 'timeout') {
layerTipsX('请求超时');
};
}
});
};
});
},
methods: {
......@@ -97,99 +327,99 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
},
signRule() {
let _this = this;
return '付'+_this.d.payment_month+'押'+_this.d.deposit_month+' '+_this.d.age_limit+'年';
return '付' + _this.d.payment_month + '押' + _this.d.deposit_month + ' ' + _this.d.age_limit + '年';
},
//点击拨打,调用隐号接口
callHide(t) {
let _this = this;
_this.activeLandlordPhone = t;
_this.maskShowFlag = true;
_this.callShowFlag = true;
// _this.maskShowFlag = true;
// _this.callShowFlag = true;
$.ajax({
type: 'post',
url: '/index/bindAXB',
data: {
'phone_a': _this.user_info_obj.phone,
'phone_b': t,
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(_data['code'] == '200') {
_this.telHide = _data.data.data.phone;
} else {
layerTipsX(_data['msg']);
}
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
type: 'post',
url: '/index/bindAXB',
data: {
'phone_a': _this.user_info_obj.phone,
'phone_b': t,
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(_data['code'] == '200') {
_this.telHide = _data.data.data.phone;
} else {
layerTipsX(_data['msg']);
}
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
//点击未打通,释放号码的接口
releaseTel() {
let _this = this;
$.ajax({
type: 'post',
url: '/index/agentsUnBind',
data: {
'phone_a': _this.user_info_obj.phone,//经纪人手机号
'phone_b': _this.activeLandlordPhone,//客户手机号
'phone_x': _this.telHide,//中间号
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(_data['code'] == '200') {
_this.maskShowFlag = false;
_this.callShowFlag = false;
} else {
layerTipsX(_data['msg']);
}
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
type: 'post',
url: '/index/agentsUnBind',
data: {
'phone_a': _this.user_info_obj.phone, //经纪人手机号
'phone_b': _this.activeLandlordPhone, //客户手机号
'phone_x': _this.telHide, //中间号
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(_data['code'] == '200') {
_this.maskShowFlag = false;
_this.callShowFlag = false;
} else {
layerTipsX(_data['msg']);
}
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
}
},
computed: {
dealPrice: function(){
dealPrice: function() {
let _this = this;
if(_this.d.rent_type == '1'){
if(_this.d.rent_type == '1') {
return '租金均价 :' + _this.d.rent_price + '元/月';
}else if(_this.d.rent_type == '2'){
} else if(_this.d.rent_type == '2') {
return '营业额扣点 :' + _this.d.rent_price + '%';
}else{
} else {
return '租金均价 :' + _this.d.rent_price + '元/天/m²';
}
},
dealArea: function(){
dealArea: function() {
let _this = this;
if(_this.d.shop_type){
if(_this.d.shop_type) {
//街铺
return _this.d.shop_area_start + '㎡';
}else{
} else {
//商场
return _this.d.shop_area_start + '㎡—' + _this.d.shop_area_end + '㎡';
}
}
}
});
});
});
\ No newline at end of file
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