|  | @@ -1,3 +1,4 @@
 | 
	
		
			
				|  |  | +<<<<<<< Updated upstream
 | 
	
		
			
				|  |  |  // import { Component } from '@angular/core';
 | 
	
		
			
				|  |  |  // import {
 | 
	
		
			
				|  |  |  //   IonHeader,
 | 
	
	
		
			
				|  | @@ -23,6 +24,34 @@
 | 
	
		
			
				|  |  |  //   fans: number;
 | 
	
		
			
				|  |  |  //   likes: number;
 | 
	
		
			
				|  |  |  // }
 | 
	
		
			
				|  |  | +=======
 | 
	
		
			
				|  |  | +import { Component } from '@angular/core';
 | 
	
		
			
				|  |  | +import { Router } from '@angular/router';
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  IonHeader,
 | 
	
		
			
				|  |  | +  IonToolbar,
 | 
	
		
			
				|  |  | +  IonTitle,
 | 
	
		
			
				|  |  | +  IonContent,
 | 
	
		
			
				|  |  | +  IonCard,
 | 
	
		
			
				|  |  | +  IonCardContent,
 | 
	
		
			
				|  |  | +  IonGrid,
 | 
	
		
			
				|  |  | +  IonRow,
 | 
	
		
			
				|  |  | +  IonCol,
 | 
	
		
			
				|  |  | +  IonAvatar,
 | 
	
		
			
				|  |  | +  IonButton,
 | 
	
		
			
				|  |  | +} from '@ionic/angular/standalone';
 | 
	
		
			
				|  |  | +import { CloudUser } from 'src/lib/cyxncloud';
 | 
	
		
			
				|  |  | +export interface User {
 | 
	
		
			
				|  |  | +  avatar: string;
 | 
	
		
			
				|  |  | +  username: string;
 | 
	
		
			
				|  |  | +  age: number | null;
 | 
	
		
			
				|  |  | +  sex: string;
 | 
	
		
			
				|  |  | +  email: string;
 | 
	
		
			
				|  |  | +  phoneNumber: string;
 | 
	
		
			
				|  |  | +  fans: number;
 | 
	
		
			
				|  |  | +  likes: number;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +>>>>>>> Stashed changes
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  // @Component({
 | 
	
		
			
				|  |  |  //   selector: 'app-tab4',
 | 
	
	
		
			
				|  | @@ -140,12 +169,42 @@ addIcons({ add })
 | 
	
		
			
				|  |  |           IonCardContent,IonCardSubtitle,IonCardTitle,
 | 
	
		
			
				|  |  |           IonCardHeader,IonCardSubtitle,IonCard]
 | 
	
		
			
				|  |  |  })
 | 
	
		
			
				|  |  | +<<<<<<< Updated upstream
 | 
	
		
			
				|  |  |  export class Tab4Page implements OnInit {
 | 
	
		
			
				|  |  | +=======
 | 
	
		
			
				|  |  | +export class Tab4Page {
 | 
	
		
			
				|  |  | +  is_login: boolean = false;
 | 
	
		
			
				|  |  | +  currentUser: CloudUser | null = null;
 | 
	
		
			
				|  |  | +  user: User = {
 | 
	
		
			
				|  |  | +    avatar: 'https://ionicframework.com/docs/img/demos/avatar.svg',
 | 
	
		
			
				|  |  | +    username: '请登录',
 | 
	
		
			
				|  |  | +    age: 0,
 | 
	
		
			
				|  |  | +    sex: '-',
 | 
	
		
			
				|  |  | +    email: '-',
 | 
	
		
			
				|  |  | +    phoneNumber: '-',
 | 
	
		
			
				|  |  | +    fans: 0,
 | 
	
		
			
				|  |  | +    likes: 0,
 | 
	
		
			
				|  |  | +  };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  constructor(private router: Router) {
 | 
	
		
			
				|  |  | +    let userCache = localStorage.getItem('userData');
 | 
	
		
			
				|  |  | +    if (userCache) {
 | 
	
		
			
				|  |  | +      let userData = JSON.parse(userCache);
 | 
	
		
			
				|  |  | +      this.user.avatar = userData.avatar;
 | 
	
		
			
				|  |  | +      this.user.username = userData.username;
 | 
	
		
			
				|  |  | +      this.user.age = userData.age;
 | 
	
		
			
				|  |  | +      this.user.sex = userData.sex;
 | 
	
		
			
				|  |  | +      this.user.email = userData.email;
 | 
	
		
			
				|  |  | +      this.user.phoneNumber = userData.phoneNumber;
 | 
	
		
			
				|  |  | +      this.user.fans = userData.fans;
 | 
	
		
			
				|  |  | +      this.user.likes = userData.likes;
 | 
	
		
			
				|  |  | +>>>>>>> Stashed changes
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    currentUser:CloudUser|undefined
 | 
	
		
			
				|  |  |    constructor(private modalCtrl:ModalController) {
 | 
	
		
			
				|  |  |      this.currentUser = new CloudUser();
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +<<<<<<< Updated upstream
 | 
	
		
			
				|  |  |    ngOnInit() {
 | 
	
		
			
				|  |  |      throw new Error('Method not implemented.');
 | 
	
		
			
				|  |  |    }
 | 
	
	
		
			
				|  | @@ -282,4 +341,35 @@ export class Tab4Page implements OnInit {
 | 
	
		
			
				|  |  |      // }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +=======
 | 
	
		
			
				|  |  | +  navigateTo(path: string) {
 | 
	
		
			
				|  |  | +    this.router.navigate([`/${path}`]);
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  // async login() {
 | 
	
		
			
				|  |  | +  //   this.is_login = true;
 | 
	
		
			
				|  |  | +  //   let user = new CloudUser();
 | 
	
		
			
				|  |  | +  //   this.currentUser = await user.login('cyx', 'cyx123456');
 | 
	
		
			
				|  |  | +  //   if (this.currentUser) {
 | 
	
		
			
				|  |  | +  //     console.log(this.currentUser);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  //     this.user.avatar = this.currentUser.data.avatar;
 | 
	
		
			
				|  |  | +  //     this.user.username = this.currentUser.data.username;
 | 
	
		
			
				|  |  | +  //     this.user.age = this.currentUser.data.age;
 | 
	
		
			
				|  |  | +  //     this.user.sex = this.currentUser.data.sex;
 | 
	
		
			
				|  |  | +  //     this.user.email = this.currentUser.data.email;
 | 
	
		
			
				|  |  | +  //     this.user.phoneNumber = this.currentUser.data.phoneNumber;
 | 
	
		
			
				|  |  | +  //     this.user.fans = this.currentUser.data.fans;
 | 
	
		
			
				|  |  | +  //     this.user.likes = this.currentUser.data.likes;
 | 
	
		
			
				|  |  | +  //     localStorage.setItem('userData', JSON.stringify(this.currentUser.data));
 | 
	
		
			
				|  |  | +  //     localStorage.setItem('is_login', 'true');
 | 
	
		
			
				|  |  | +  //   }
 | 
	
		
			
				|  |  | +  // }
 | 
	
		
			
				|  |  | +  async logout() {
 | 
	
		
			
				|  |  | +    this.is_login = false;
 | 
	
		
			
				|  |  | +    let user = new CloudUser();
 | 
	
		
			
				|  |  | +    let flag = await user.logout();
 | 
	
		
			
				|  |  | +    localStorage.removeItem('user');
 | 
	
		
			
				|  |  | +    localStorage.removeItem('is_login');
 | 
	
		
			
				|  |  | +>>>>>>> Stashed changes
 | 
	
		
			
				|  |  |    }
 |