Просмотр исходного кода

Added start, login, and signup pages

shakila 6 лет назад
Родитель
Сommit
30bc0a41f2

+ 3
- 2
zlg/src/app/app.component.ts Просмотреть файл

@@ -3,12 +3,13 @@ import { Platform } from 'ionic-angular';
3 3
 import { StatusBar } from '@ionic-native/status-bar';
4 4
 import { SplashScreen } from '@ionic-native/splash-screen';
5 5
 
6
-import { HomePage } from '../pages/home/home';
6
+// import { HomePage } from '../pages/home/home';
7
+import { StartPage } from '../pages/start/start';
7 8
 @Component({
8 9
   templateUrl: 'app.html'
9 10
 })
10 11
 export class MyApp {
11
-  rootPage:any = HomePage;
12
+  rootPage:any = StartPage;
12 13
 
13 14
   constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
14 15
     platform.ready().then(() => {

+ 11
- 2
zlg/src/app/app.module.ts Просмотреть файл

@@ -12,11 +12,17 @@ const config: SocketIoConfig = { url: 'http://localhost:8080/vault-socket', opti
12 12
 import { MyApp } from './app.component';
13 13
 import { HomePage } from '../pages/home/home';
14 14
 import { WebsocketProvider } from '../providers/websocket/websocket';
15
+import { LoginPage } from '../pages/login/login';
16
+import { SignupPage } from '../pages/signup/signup';
17
+import { StartPage } from '../pages/start/start';
15 18
 
16 19
 @NgModule({
17 20
   declarations: [
18 21
     MyApp,
19
-    HomePage
22
+    HomePage,
23
+    LoginPage,
24
+    SignupPage,
25
+    StartPage
20 26
   ],
21 27
   imports: [
22 28
     BrowserModule,
@@ -26,7 +32,10 @@ import { WebsocketProvider } from '../providers/websocket/websocket';
26 32
   bootstrap: [IonicApp],
27 33
   entryComponents: [
28 34
     MyApp,
29
-    HomePage
35
+    HomePage,
36
+    LoginPage,
37
+    SignupPage,
38
+    StartPage
30 39
   ],
31 40
   providers: [
32 41
     StatusBar,

+ 31
- 0
zlg/src/pages/login/login.html Просмотреть файл

@@ -0,0 +1,31 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <br>
4
+    <button ion-button menuToggle>
5
+      <ion-icon name="menu"></ion-icon>
6
+    </button>
7
+    <ion-title align="middle">The Vault</ion-title>
8
+  </ion-navbar>
9
+</ion-header>
10
+
11
+<ion-buttons side="right" class="has-header">
12
+  <button class="button icon ion-android-settings"></button>
13
+</ion-buttons>
14
+<ion-content padding="true" style="background: url(../assets/img/0iNAJ9CJQ1qT57JTEweX_palePurpVault.png) no-repeat center;background-size:cover;"
15
+  class="has-header">
16
+  
17
+  <form id="login-form1" class="list">
18
+    <ion-list id="login-list2" class="codystar">
19
+      <label class="item item-input" id="login-input1">
20
+        <span class="input-label">Username</span>
21
+        <input type="text" class="form-control" [(ngModel)]="user.userName" name="username" placeholder="Username" required>
22
+      </label>
23
+      <label class="item item-input" id="newKey-input2">
24
+        <span class="input-label">Password</span>
25
+        <input type="password" class="form-control" [(ngModel)]="user.password" name="password" placeholder="Password" required>
26
+      </label>
27
+    </ion-list>
28
+    <button (click)="login()" id="login-button1" style="font-weight:600; font-size:20px;" class="codystar button button-royal button-block button-small">Log in</button>
29
+  </form>
30
+</ion-content>
31
+</ion-view>

+ 3
- 0
zlg/src/pages/login/login.scss Просмотреть файл

@@ -0,0 +1,3 @@
1
+page-login {
2
+
3
+}

+ 25
- 0
zlg/src/pages/login/login.ts Просмотреть файл

@@ -0,0 +1,25 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { MenuController } from "ionic-angular";
3
+
4
+import { NavController } from "ionic-angular";
5
+
6
+@Component({
7
+  selector: "page-login",
8
+  templateUrl: "login.html"
9
+})
10
+export class LoginPage implements OnInit {
11
+  user = {
12
+    userName: "",
13
+    password: ""
14
+  };
15
+
16
+  constructor(public navCtrl: NavController, public menu: MenuController) {
17
+    this.menu.enable(true);
18
+  }
19
+
20
+  ngOnInit() {
21
+    this.login();
22
+  }
23
+
24
+  login() {}
25
+}

+ 38
- 0
zlg/src/pages/signup/signup.html Просмотреть файл

@@ -0,0 +1,38 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <br>
4
+    <button ion-button menuToggle>
5
+      <ion-icon name="menu"></ion-icon>
6
+    </button>
7
+    <ion-title align="middle">The Vault</ion-title>
8
+  </ion-navbar>
9
+</ion-header>
10
+
11
+<ion-buttons side="right" class="has-header">
12
+  <button class="button icon ion-android-settings"></button>
13
+</ion-buttons>
14
+<ion-content padding="true" style="background: url(../assets/img/0iNAJ9CJQ1qT57JTEweX_palePurpVault.png) no-repeat center;background-size:cover;"
15
+  class="has-header">
16
+  <form id="signup-form1" class="list">
17
+    <ion-list id="signup-list3" class="codystar">
18
+      <label class="item item-input" id="signup-input1">
19
+        <span class="input-label">Username</span>
20
+        <input type="text" class="form-control" [(ngModel)]="user.userName" name="username" placeholder="Username" required>
21
+      </label>
22
+      <label class="item item-input" id="newKey-input2">
23
+        <span class="input-label">Name</span>
24
+        <input type="text" class="form-control" [(ngModel)]="user.name" name="name" placeholder="Name" required>
25
+      </label>
26
+      <label class="item item-input" id="newKey-input3">
27
+        <span class="input-label">Email</span>
28
+        <input type="email" class="form-control" [(ngModel)]="user.email" name="email" placeholder="Email" required>
29
+      </label>
30
+      <label class="item item-input" id="newKey-input4">
31
+        <span class="input-label">Password</span>
32
+        <input type="password" class="form-control" [(ngModel)]="user.password" name="password" placeholder="Password" required>
33
+      </label>
34
+    </ion-list>
35
+    <button (click)="createUser()" id="signup-button1" style="font-weight:600; font-size:20px;" class="codystar button button-royal button-block button-small">Sign up</button>
36
+  </form>
37
+</ion-content>
38
+</ion-view>

+ 3
- 0
zlg/src/pages/signup/signup.scss Просмотреть файл

@@ -0,0 +1,3 @@
1
+page-signup {
2
+
3
+}

+ 32
- 0
zlg/src/pages/signup/signup.ts Просмотреть файл

@@ -0,0 +1,32 @@
1
+import { Component, OnInit } from '@angular/core';
2
+import { MenuController } from 'ionic-angular';
3
+
4
+import { NavController } from 'ionic-angular';
5
+
6
+@Component({
7
+  selector: 'page-signup',
8
+  templateUrl: 'signup.html'
9
+})
10
+export class SignupPage implements OnInit {
11
+  user = {
12
+    name: '',
13
+    userName: '',
14
+    email: '',
15
+    password: ''
16
+  };
17
+
18
+  constructor(public navCtrl: NavController, public menu: MenuController) {
19
+    this.menu.enable(true);
20
+
21
+  }
22
+
23
+
24
+  ngOnInit() {
25
+    this.createUser();
26
+  }
27
+
28
+  createUser() {
29
+
30
+  }
31
+
32
+}

+ 24
- 0
zlg/src/pages/start/start.html Просмотреть файл

@@ -0,0 +1,24 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <br>
4
+    <button ion-button menuToggle>
5
+      <ion-icon name="menu"></ion-icon>
6
+    </button>
7
+    <ion-title align="middle">The Vault</ion-title>
8
+  </ion-navbar>
9
+</ion-header>
10
+
11
+<ion-buttons side="right" class="has-header">
12
+  <button class="button icon ion-android-settings"></button>
13
+</ion-buttons>
14
+<ion-content padding="true" style="background: url(../assets/img/0iNAJ9CJQ1qT57JTEweX_palePurpVault.png) no-repeat center;background-size:cover;"
15
+  class="has-header">
16
+
17
+  <form id="start-form1" class="list">
18
+    <ion-list id="start-list1" class="codystar">
19
+    <button [navPush]="loginPage" id="login-button1" style="font-weight:600; font-size:20px;" class="codystar button button-royal button-block button-small">Log in</button>
20
+    <button [navPush]="signupPage" id="login-button2" style="font-weight:600; font-size:20px;" class="codystar button button-royal button-block button-small">Sign Up</button>
21
+  </ion-list>
22
+  </form>
23
+</ion-content>
24
+</ion-view>

+ 3
- 0
zlg/src/pages/start/start.scss Просмотреть файл

@@ -0,0 +1,3 @@
1
+page-start {
2
+
3
+}

+ 32
- 0
zlg/src/pages/start/start.ts Просмотреть файл

@@ -0,0 +1,32 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { MenuController } from "ionic-angular";
3
+
4
+import { NavController } from "ionic-angular";
5
+import { LoginPage } from "../login/login";
6
+import { SignupPage } from "../signup/signup";
7
+
8
+@Component({
9
+  selector: "page-start",
10
+  templateUrl: "start.html"
11
+})
12
+export class StartPage implements OnInit {
13
+  loginPage = LoginPage;
14
+  signupPage = SignupPage;
15
+
16
+  constructor(public navCtrl: NavController, public menu: MenuController) {
17
+    this.menu.enable(true);
18
+  }
19
+
20
+  ngOnInit() {
21
+    // this.login();
22
+    // this.signup();
23
+  }
24
+
25
+  // login() {
26
+
27
+  // }
28
+
29
+  // signup(){
30
+
31
+  // }
32
+}