登錄時進行相關(guān)信息保存:if(this.user.password=="1"){? ? ? ? ? ? ?//page3頁中
localStorage.username=this.user.username;
localStorage.Logined="true";
setTimeout(()=>{
loading.dismiss();//登錄進度條隱藏
this.viewController.dismiss(this.user.username);//將this.user.username參數(shù)傳過去以便刷新頁面時用
},1000);
}
使用Modal組件將一個頁面展示出來:
if(localStorage.Logined="true"){
this.user.headface="images/"+localStorage.username+".jpg";//設(shè)置登錄頭像
}
else{
let modal=Modal.create(Page3);
modal.onDismiss(data=>{
this.user.headface="images/"+data+".jpg";
});
this.nav.present(modal);
}