|
|
@@ -697,21 +697,54 @@ export default {
|
|
|
},
|
|
|
getFirstEnterStatus(){
|
|
|
let data = window.localStorage.getItem('showDialog');
|
|
|
+ let first = window.localStorage.getItem('firstEnter');
|
|
|
if(data){
|
|
|
data = JSON.parse(data)
|
|
|
if(data.type==1){
|
|
|
- if((new Date().getTime()-data.time)<=(1000*60)){
|
|
|
- return window.localStorage.removeItem('showDialog')
|
|
|
- };
|
|
|
- this.dialogMessage = `同學仔,歡迎返嚟!請問你想要繼續學習,定係想同我傾吓偈呢?`
|
|
|
+ // if((new Date().getTime()-data.time)<=(1000*60)){
|
|
|
+ // return window.localStorage.removeItem('showDialog')
|
|
|
+ // };
|
|
|
+ let msg = `同學仔,歡迎返嚟!請問你想要繼續學習,定係想同我傾吓偈呢?`
|
|
|
+ if(first){
|
|
|
+ let index = 0;
|
|
|
+ let timer = setInterval(()=>{
|
|
|
+ if(index<msg.length){
|
|
|
+ this.dialogMessage+= msg[index];
|
|
|
+ index+=1;
|
|
|
+ }else{
|
|
|
+ clearInterval(timer);
|
|
|
+ this.dialogMessage = msg
|
|
|
+ timer = null;
|
|
|
+ window.localStorage.removeItem('firstEnter')
|
|
|
+ }
|
|
|
+ },200)
|
|
|
+ }else{
|
|
|
+ this.dialogMessage = msg
|
|
|
+ }
|
|
|
this.showDialog = true;
|
|
|
+ return window.localStorage.removeItem('showDialog')
|
|
|
}else if(data.type==2){
|
|
|
- if((new Date().getTime()-data.time)<=(1000*60)){
|
|
|
- return window.localStorage.removeItem('showDialog')
|
|
|
- };
|
|
|
- this.dialogMessage = `同學仔,歡迎返嚟!請問你想要繼續學習,定係想同我傾吓偈呢?`
|
|
|
- this.showDialog = true;
|
|
|
+
|
|
|
+ let msg = `同學仔,歡迎返嚟!請問你想要繼續學習,定係想同我傾吓偈呢?`
|
|
|
+ if(first){
|
|
|
+ let index = 0;
|
|
|
+ let timer = setInterval(()=>{
|
|
|
+ if(index<msg.length){
|
|
|
+ this.dialogMessage+= msg[index];
|
|
|
+ index+=1;
|
|
|
+ }else{
|
|
|
+ clearInterval(timer);
|
|
|
+ this.dialogMessage = msg
|
|
|
+ timer = null;
|
|
|
+ window.localStorage.removeItem('firstEnter')
|
|
|
+ }
|
|
|
+ },200)
|
|
|
+ }else{
|
|
|
+ this.dialogMessage = `同學仔,歡迎返嚟!請問你想要繼續學習,定係想同我傾吓偈呢?`
|
|
|
+ }
|
|
|
|
|
|
+ this.showDialog = true;
|
|
|
+ return window.localStorage.removeItem('showDialog')
|
|
|
}
|
|
|
|
|
|
}else{
|