登录时进行相关信息保存: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参数传过去以便刷新页面时用
},1000);
}
使用Modal组件将一个页面展示出来:
if(localStorage.Logined="true"){
this.user.headface="images/"+localStorage.username+".jpg";//设置登录头像
}
else{
let modal=Modal.create(Page3);
modal.onDismiss(data=>{
this.user.headface="images/"+data+".jpg";
});
this.nav.present(modal);
}