mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
弹出窗口控制修改
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
popupList:[],//需要弹出的窗口
|
||||
sessionKey:'alertpopup',
|
||||
localTimesKey:'popuptimes'
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -84,12 +85,25 @@
|
||||
},
|
||||
methods:{
|
||||
countPopup(){
|
||||
// let newLogin = localStorage.getItem(this.$xpage.constants.newLoginKey);
|
||||
// this.popupList.forEach(item=>{
|
||||
// if(item.loginEd && newLogin && newLogin==1){
|
||||
//let newLogin = localStorage.getItem(this.$xpage.constants.newLoginKey);
|
||||
this.popupList.forEach(item=>{
|
||||
//次数检查
|
||||
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);
|
||||
}
|
||||
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user