// var GAP = 1000 * 60 * 60 * 8;
var GAP = 1000 * 10;
var visted = $cookies.get('surveyVisitedCount');
var timestamp = new Date().getTime();
var oldtime = $cookies.get('surveyTimestamp');
if(oldtime !== undefined) {
if((timestamp - GAP) > parseInt(oldtime, 10)) {
// increment
console.log('Need to increment!');
// increment visits cookie, then check if it's past 3
if (visted < 3){
$cookies.put('surveyVisitedCount', visted++);
console.log('visted1' , visted);
} else {
//we add the banner
console.log('we add the banner');
console.log('visted2' , visted);
}
}else{
console.log('dont need to increment');
}
}
$cookies.put('surveyTimestamp', timestamp);
}
我想添加一個橫幅與計數器。當用戶在一段時間內來到網站時,他們被要求填寫調查表。 問題是我似乎無法讓櫃檯增加。我可能做錯了什麼。謝謝。我將如何實現一個計數器
伊夫改變它,它仍然來,只有使用增量因爲背部不確定 – ronoc4