...
|
...
|
@@ -16,6 +16,7 @@ export default { |
|
|
},
|
|
|
data(){
|
|
|
return {
|
|
|
timer:null,
|
|
|
domainName:sessionStorage.getItem('domainName'),
|
|
|
apiUrl:'/api-web/sxview/getbizListByUser?access_token=',
|
|
|
checkId:0,//当前选中的tabs
|
...
|
...
|
@@ -41,10 +42,40 @@ export default { |
|
|
proxy.listArray=navTabsData;
|
|
|
proxy.checkId=navTabsData[0].busId;
|
|
|
busId.value=navTabsData[0].busId
|
|
|
proxy.startInterval();
|
|
|
}
|
|
|
})
|
|
|
|
|
|
})
|
|
|
const startInterval=()=>{
|
|
|
if (proxy.timer) {
|
|
|
clearInterval(proxy.timer)
|
|
|
}
|
|
|
proxy.timer=setInterval(function (){
|
|
|
let listArray=[];
|
|
|
proxy.listArray.map((item,index)=>{
|
|
|
listArray.push(item.busId)
|
|
|
})
|
|
|
let index=listArray.indexOf(proxy.checkId)
|
|
|
|
|
|
if(index!=-1){
|
|
|
if(index>=4){
|
|
|
proxy.arrowClick('right')
|
|
|
}
|
|
|
if(index+1==listArray.length){
|
|
|
proxy.checkId=listArray[0]
|
|
|
proxy.arrowClick('left')
|
|
|
|
|
|
}else{
|
|
|
proxy.checkId=listArray[index+1]
|
|
|
|
|
|
}
|
|
|
|
|
|
proxy.clickTabs(proxy.checkId)
|
|
|
|
|
|
}
|
|
|
},4000)
|
|
|
}
|
|
|
|
|
|
const arrowClick=(val)=>{
|
|
|
if(val=='right'){
|
...
|
...
|
@@ -76,6 +107,7 @@ export default { |
|
|
arrowClick,
|
|
|
nextPage,
|
|
|
prePage,
|
|
|
startInterval,
|
|
|
clickTabs
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -85,8 +117,16 @@ export default { |
|
|
let end = Math.min((this.currentPage+1)*this.pageSize, this.listArray.length)
|
|
|
return this.listArray.slice(start, end)
|
|
|
},
|
|
|
isDiv:function (){
|
|
|
let length=this.dataShow.length;
|
|
|
let num=5-length;
|
|
|
return num;
|
|
|
},
|
|
|
pageNum: function(){
|
|
|
return Math.ceil(this.listArray.length / this.pageSize) || 1 ;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
unmounted () {
|
|
|
clearInterval(this.timer)
|
|
|
},
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|