Commit fe6baf90 authored by xishifeng's avatar xishifeng Committed by hujun

翻页修改

parent f2c2e1a3
......@@ -219,7 +219,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.modal-title-genjing-con>span:nth-of-type(1)').addClass('text-info').siblings().removeClass('text-info');
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
user.getInfor();
user.getInforNew();
});
//下一页 获取客户详情
_doc.on('click', '#user_down', function() {
......@@ -228,7 +228,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$('.modal-title-genjing-con>span:nth-of-type(1)').addClass('text-info').siblings().removeClass('text-info');
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
user.getInfor();
user.getInforNew();
});
//客户列表 收藏夹
_doc.on('click', '.user-favorites', function() {
......@@ -325,7 +325,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
//客户列表操作
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id'));
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&idindex=' + _$this.attr('data-index') + '&id=' + _$this.attr('data-id'));
});
//查看弹出框里的tab点击事件,客户动态 带看动态
_doc.on('click', '.modal-title-genjing-con>span', function(e){
......@@ -1620,6 +1620,12 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
var doTtmpl = doT.template(temp);
$("#follow_list").html(doTtmpl(data.data.data.list));
$('[href="#modal-record"]').each(function(i, v){
$(v).attr('data-index', i);
});
localStorage.setItem('pc_user_current_list', JSON.stringify(data.data.data.list));
/*分页代码*/
add_page(data.data.data.total,pageNo,user.pageSize,user.getList);
......@@ -1894,6 +1900,9 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}
});
},
getInforNew: function() {
console.log(user_type);
},
getInfor: function(params) {
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var params={};
......
......@@ -249,7 +249,7 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id')).show();
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&idindex=' + _$this.attr('data-index') + '&id=' + _$this.attr('data-id'));
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
......@@ -1348,6 +1348,14 @@ define(['doT', 'text!temp/callPhone_template_tpl.html', 'css!style/home.css', 'c
var temp = document.getElementById ('callPhone_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#callPhone_list").html (doTtmpl (data.data.list));
$('[href="#modal-record"]').each(function(i, v){
$(v).attr('data-index', i);
});
localStorage.setItem('pc_user_current_list', JSON.stringify(data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
},
......
......@@ -243,7 +243,7 @@ define(['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home
// user.user_id = $(this).attr("data-id");
// user.getGenjinLabel();
var _$this = $(this);
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&id=' + _$this.attr('data-id')).show();
$('#modal-record iframe').attr('src', '/index/userModalList?data=' + _$this.attr('data-item') + '&idindex=' + _$this.attr('data-index') + '&id=' + _$this.attr('data-id'));
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
......@@ -1461,6 +1461,13 @@ define(['doT', 'text!temp/my_collection_user_template_tpl.html', 'css!style/home
var temp = document.getElementById ('my_collection_user_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#label_list").html (doTtmpl (data.data.user_date));
$('[href="#modal-record"]').each(function(i, v){
$(v).attr('data-index', i);
});
localStorage.setItem('pc_user_current_list', JSON.stringify(data.data.user_date));
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
}
......
......@@ -22,8 +22,8 @@ define(['doT', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'bootstrapJs']
is_outpace_call_num = 1;//拨打电话0:未超过限制 1:超过限制
var cus_obj = JSON.parse(getUrlParam('data'));
console.log(parent.location.pathname);
var idIndex = getUrlParam('idindex');
var _tempUrl = parent.location.pathname;
if((_tempUrl === '/index/users_list') || (_tempUrl === '/index/RemarkFollowList')){
......@@ -307,7 +307,7 @@ define(['doT', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'bootstrapJs']
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
if(_tempUrl === '/index/users_list'){
user.getInfor();
user.getInforNew();
}else if(_tempUrl === '/index/RemarkFollowList'){
user.getInfor2();
}else{}
......@@ -320,7 +320,7 @@ define(['doT', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'bootstrapJs']
//初始化客户动态 带看动态两个表格切换
$('.follow-up-modal-list-area:nth-of-type(1)').show().siblings().hide();
if(_tempUrl === '/index/users_list'){
user.getInfor();
user.getInforNew();
}else if(_tempUrl === '/index/RemarkFollowList'){
user.getInfor2();
}else{}
......@@ -1459,6 +1459,32 @@ define(['doT', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'bootstrapJs']
}
});
},
getInforNew: function() {
if(user_type == 'next'){
++idIndex;
}else{
--idIndex;
};
console.log(idIndex);
if(idIndex>14){
alert('请翻页');
idIndex = 14;
return false;
}else if(idIndex<0){
alert('请翻页');
idIndex = 0;
return false;
}else{
var _tempListObj = JSON.parse(localStorage.getItem('pc_user_current_list'));
var _tempUserId = _tempListObj[idIndex].user_id;
if(_tempUrl === '/index/users_list'){
_tempUserId = _tempListObj[idIndex].id;
};
var aa = location.origin + location.pathname + '?data=' + JSON.stringify(_tempListObj[idIndex]) + '&idindex='+ idIndex +'&id=' +_tempUserId;
location.replace(aa);
}
},
getInfor: function(params) {//上一页 下一页 调用接口
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var params={};
......
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