0225263 il y a 4 mois
Parent
commit
263edeae97

+ 0 - 4
src/app/app-routing.module.ts

@@ -10,10 +10,6 @@ const routes: Routes = [
     path: 'tab4',
     loadChildren: () => import('./tab4/tab4.module').then( m => m.Tab4PageModule)
   },
-  {
-    path: 'login',
-    loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
-  },
   {
     path: 'feedback',
     loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule)

+ 1 - 0
src/app/app.module.ts

@@ -9,6 +9,7 @@ import { AppComponent } from './app.component';
 import { CommonModule } from '@angular/common';
 import { FormsModule } from '@angular/forms';
 
+
 @NgModule({
   declarations: [AppComponent],
   imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule,CommonModule,FormsModule],

+ 0 - 17
src/app/login/login-routing.module.ts

@@ -1,17 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { LoginPage } from './login.page';
-
-const routes: Routes = [
-  {
-    path: '',
-    component: LoginPage
-  }
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule],
-})
-export class LoginPageRoutingModule {}

+ 0 - 20
src/app/login/login.module.ts

@@ -1,20 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-
-import { IonicModule } from '@ionic/angular';
-
-import { LoginPageRoutingModule } from './login-routing.module';
-
-import { LoginPage } from './login.page';
-
-@NgModule({
-  imports: [
-    CommonModule,
-    FormsModule,
-    IonicModule,
-    LoginPageRoutingModule
-  ],
-  declarations: [LoginPage]
-})
-export class LoginPageModule {}

+ 0 - 46
src/app/login/login.page.html

@@ -1,46 +0,0 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-buttons slot="start">
-      <ion-back-button defaultHref="/tabs/tab4"></ion-back-button>
-    </ion-buttons>
-    <ion-title style="font-size:30px">登录</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content>
-  <ion-card>
-    <ion-card-header>
-      注册
-    </ion-card-header>
-    <ion-card-content>
-      <ion-item>
-        <ion-label position="floating">用户名</ion-label>
-        <ion-input type="text" [(ngModel)]="registerUsername"></ion-input>
-      </ion-item>
-      <ion-item>
-        <ion-label position="floating">密码</ion-label>
-        <ion-input type="password" [(ngModel)]="registerPassword"></ion-input>
-      </ion-item>
-      <ion-button expand="block" (click)="register()">注册</ion-button>
-    </ion-card-content>
-  </ion-card>
-
-  <ion-card>
-    <ion-card-header>
-      登录
-    </ion-card-header>
-    <ion-card-content>
-      <ion-item>
-        <ion-label position="floating">用户名</ion-label>
-        <ion-input type="text" [(ngModel)]="loginUsername"></ion-input>
-      </ion-item>
-      <ion-item>
-        <ion-label position="floating">密码</ion-label>
-        <ion-input type="password" [(ngModel)]="loginPassword"></ion-input>
-      </ion-item>
-      <ion-button expand="block" (click)="login()">登录</ion-button>
-    </ion-card-content>
-  </ion-card>
-</ion-content>
-
-

+ 0 - 0
src/app/login/login.page.scss


+ 0 - 17
src/app/login/login.page.spec.ts

@@ -1,17 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { LoginPage } from './login.page';
-
-describe('LoginPage', () => {
-  let component: LoginPage;
-  let fixture: ComponentFixture<LoginPage>;
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(LoginPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 41
src/app/login/login.page.ts

@@ -1,41 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { Parse } from 'parse';
-
-@Component({
-  selector: 'app-login',
-  templateUrl: './login.page.html',
-  styleUrls: ['./login.page.scss'],
-})
-export class LoginPage implements OnInit {
-  registerUsername: string = '';
-  registerPassword: string = '';
-  loginUsername: string = '';
-  loginPassword: string = '';
-
-  constructor() {private navCtrl: NavController }
-  
-  register() {
-    Parse.User.signUp(this.registerUsername, this.registerPassword).then((user) => {
-      console.log('User signed up', user);
-      // 注册成功后可以自动登录
-      this.login();
-    }).catch((error) => {
-      console.error('Error signing up', error);
-    });
-  }
-
-  login() {
-    Parse.User.logIn(this.loginUsername, this.loginPassword).then((user) => {
-      console.log('User logged in', user);
-      // 登录成功后导航到“我的”页面
-      this.navCtrl.navigateForward('/tabs/tab4');
-    }).catch((error) => {
-      console.error('Error logging in', error);
-    });
-  }
-}
-
-  ngOnInit() {
-  }
-
-}