uniapp彈窗24小時之後彈

weixin_53474871發表於2020-12-29

onShow() {
// 剛進入頁面 1607484711876 1607484752268
let timestamp = uni.getStorageSync(“timestamp”);
let timestampNew = new Date().getTime();
if(timestamp && timestamp > timestampNew){
this.layerNewFree = false;
}else{
this.layerNewFree = true;
}
},
method:{
layShow(){
this.islayShow = state.val;
this.layerNewFree = false;
let timestamp = new Date().getTime()+86400*1000;
uni.setStorageSync(“timestamp”,timestamp);
}
}

相關文章