弹出窗口控制修改

This commit is contained in:
daihh
2022-12-23 15:08:30 +08:00
parent ffd44cf044
commit 8118d5877c

View File

@@ -29,6 +29,7 @@
baseUrl:process.env.VUE_APP_FILE_BASE_URL, baseUrl:process.env.VUE_APP_FILE_BASE_URL,
popupList:[],//需要弹出的窗口 popupList:[],//需要弹出的窗口
sessionKey:'alertpopup', sessionKey:'alertpopup',
localTimesKey:'popuptimes'
}; };
}, },
mounted() { mounted() {
@@ -84,12 +85,25 @@
}, },
methods:{ methods:{
countPopup(){ countPopup(){
// let newLogin = localStorage.getItem(this.$xpage.constants.newLoginKey); //let newLogin = localStorage.getItem(this.$xpage.constants.newLoginKey);
// this.popupList.forEach(item=>{ this.popupList.forEach(item=>{
// if(item.loginEd && newLogin && newLogin==1){ //次数检查
if(item.times>0){
var localKey=this.localTimesKey+item.id;
var curLocal=localStorage.getItem(localKey);
if(curLocal){
let times=parseInt(curLocal);
if(item.times< times){
item.show=false;
}else{
localStorage.setItem(localKey,curLocal+1);
}
}else{
localStorage.setItem(localKey,1);
}
// } }
// }) })
} }
} }
} }