...
|
...
|
@@ -50,45 +50,89 @@ export default { |
|
|
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')
|
|
|
proxy.preOrNext(0);
|
|
|
},10000)
|
|
|
}
|
|
|
const preOrNext=(val)=>{
|
|
|
console.log("click",val)
|
|
|
let listArray=[];
|
|
|
proxy.listArray.map((item,index)=>{
|
|
|
listArray.push(item.busId)
|
|
|
})
|
|
|
let index=listArray.indexOf(proxy.checkId)
|
|
|
if(index!=-1){
|
|
|
if(index+1==listArray.length){
|
|
|
proxy.checkId=listArray[0]
|
|
|
if(val==0){
|
|
|
proxy.preNext()
|
|
|
|
|
|
}else{
|
|
|
if(val=='left'){
|
|
|
proxy.checkId=listArray[index+1]
|
|
|
}else{
|
|
|
proxy.preNext()
|
|
|
}
|
|
|
}
|
|
|
if(index+1==listArray.length){
|
|
|
proxy.checkId=listArray[0]
|
|
|
proxy.arrowClick('left')
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if(val=='left'){
|
|
|
if(index==0){
|
|
|
proxy.checkId=listArray[listArray.length-1]
|
|
|
proxy.clickNext()
|
|
|
}else{
|
|
|
proxy.checkId=listArray[index-1]
|
|
|
}
|
|
|
}else{
|
|
|
proxy.checkId=listArray[index+1]
|
|
|
if(index>=4){
|
|
|
proxy.clickNext()
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
proxy.clickTabs(proxy.checkId)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
},10000)
|
|
|
}
|
|
|
|
|
|
const arrowClick=(val)=>{
|
|
|
if(val=='right'){
|
|
|
proxy.$refs.cardShow.next();
|
|
|
proxy.nextPage();
|
|
|
proxy.clickTabs(proxy.checkId)
|
|
|
|
|
|
}
|
|
|
/*if(val){
|
|
|
if (proxy.timer) {
|
|
|
clearInterval(proxy.timer)
|
|
|
|
|
|
}
|
|
|
if(val=='right'){
|
|
|
proxy.clickNext()
|
|
|
|
|
|
}else{
|
|
|
proxy.preNext()
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
proxy.$refs.cardShow.prev();
|
|
|
proxy.prePage();
|
|
|
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
}
|
|
|
|
|
|
const arrowClick=(val)=>{
|
|
|
proxy.preOrNext(val);
|
|
|
|
|
|
}
|
|
|
const clickNext=()=>{
|
|
|
proxy.$refs.cardShow.next();
|
|
|
proxy.nextPage();
|
|
|
}
|
|
|
const preNext=()=>{
|
|
|
proxy.$refs.cardShow.next();
|
|
|
proxy.prePage();
|
|
|
}
|
|
|
const nextPage= ()=>{
|
|
|
if (proxy.currentPage == proxy.pageNum - 1) return;
|
|
|
proxy.currentPage++;
|
...
|
...
|
@@ -105,6 +149,9 @@ export default { |
|
|
|
|
|
return{
|
|
|
arrowClick,
|
|
|
clickNext,
|
|
|
preNext,
|
|
|
preOrNext,
|
|
|
nextPage,
|
|
|
prePage,
|
|
|
startInterval,
|
...
|
...
|
|