From fa409a0f88297b24daf7e4b36d5dddea5cdb916c Mon Sep 17 00:00:00 2001 From: panqihua <1029559041@qq.com> Date: Wed, 19 Feb 2020 03:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=A8=A1=E5=9D=97=20?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E6=A8=A1=E5=9D=97=20?= =?UTF-8?q?=E8=AE=BA=E5=9D=9B=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- .../{ => account}/login/login.component.html | 14 +++-- .../{ => account}/login/login.component.scss | 0 .../login/login.component.spec.ts | 0 .../{ => account}/login/login.component.ts | 12 ++-- .../account/register/register.component.html | 55 +++++++++++++++++++ .../account/register/register.component.scss | 0 .../register/register.component.spec.ts | 25 +++++++++ .../account/register/register.component.ts | 30 ++++++++++ .../account/resetpwd/resetpwd.component.html | 39 +++++++++++++ .../account/resetpwd/resetpwd.component.scss | 0 .../resetpwd/resetpwd.component.spec.ts | 25 +++++++++ .../account/resetpwd/resetpwd.component.ts | 35 ++++++++++++ src/app/app-routing.module.ts | 16 +++++- src/app/app.component.html | 9 +++ src/app/app.component.ts | 40 ++++++++++++-- src/app/app.module.ts | 11 +++- src/app/forum/forum.component.html | 12 ++++ src/app/forum/forum.component.scss | 19 +++++++ src/app/forum/forum.component.spec.ts | 25 +++++++++ src/app/forum/forum.component.ts | 15 +++++ src/app/height.ts | 4 ++ src/assets/i18n/en-US.json | 21 ++++++- src/assets/i18n/zh-CN.json | 21 ++++++- 24 files changed, 404 insertions(+), 27 deletions(-) rename src/app/{ => account}/login/login.component.html (67%) rename src/app/{ => account}/login/login.component.scss (100%) rename src/app/{ => account}/login/login.component.spec.ts (100%) rename src/app/{ => account}/login/login.component.ts (71%) create mode 100644 src/app/account/register/register.component.html create mode 100644 src/app/account/register/register.component.scss create mode 100644 src/app/account/register/register.component.spec.ts create mode 100644 src/app/account/register/register.component.ts create mode 100644 src/app/account/resetpwd/resetpwd.component.html create mode 100644 src/app/account/resetpwd/resetpwd.component.scss create mode 100644 src/app/account/resetpwd/resetpwd.component.spec.ts create mode 100644 src/app/account/resetpwd/resetpwd.component.ts create mode 100644 src/app/forum/forum.component.html create mode 100644 src/app/forum/forum.component.scss create mode 100644 src/app/forum/forum.component.spec.ts create mode 100644 src/app/forum/forum.component.ts create mode 100644 src/app/height.ts diff --git a/package.json b/package.json index bc0f510..541f92b 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "jquery": "^3.4.1", "popper.js": "^1.16.1", "rxjs": "~6.5.4", + "rxjs-compat": "^6.5.4", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, @@ -49,6 +50,6 @@ "protractor": "~5.4.3", "ts-node": "~8.3.0", "tslint": "~5.18.0", - "typescript": "~3.7.5" + "typescript": "~3.6.4" } } diff --git a/src/app/login/login.component.html b/src/app/account/login/login.component.html similarity index 67% rename from src/app/login/login.component.html rename to src/app/account/login/login.component.html index f9ba7b5..a1a768c 100644 --- a/src/app/login/login.component.html +++ b/src/app/account/login/login.component.html @@ -3,29 +3,31 @@
-
+
{{ 'login.manager_name' | translate }}
- +
-
+
{{ 'login.password' | translate }}
- +
- +
+ +
- +
diff --git a/src/app/login/login.component.scss b/src/app/account/login/login.component.scss similarity index 100% rename from src/app/login/login.component.scss rename to src/app/account/login/login.component.scss diff --git a/src/app/login/login.component.spec.ts b/src/app/account/login/login.component.spec.ts similarity index 100% rename from src/app/login/login.component.spec.ts rename to src/app/account/login/login.component.spec.ts diff --git a/src/app/login/login.component.ts b/src/app/account/login/login.component.ts similarity index 71% rename from src/app/login/login.component.ts rename to src/app/account/login/login.component.ts index 962f256..ffac637 100644 --- a/src/app/login/login.component.ts +++ b/src/app/account/login/login.component.ts @@ -1,5 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {FormBuilder} from '@angular/forms'; +import {Height} from '../../height'; @Component({ selector: 'app-login', @@ -7,16 +8,15 @@ import {FormBuilder} from '@angular/forms'; styleUrls: ['./login.component.scss'] }) // 登陆模块 -export class LoginComponent implements OnInit { - // 表单组 +export class LoginComponent extends Height implements OnInit { + // 登陆表单 loginForm = this.fb.group({ managerName: [''], password: [''] }); - // 页面高度 - height = 'height:' + screen.height / 2 + 'px'; constructor(private fb: FormBuilder) { + super(); } ngOnInit(): void { @@ -28,9 +28,5 @@ export class LoginComponent implements OnInit { alert('执行登陆操作'); } - // 注册方法 - register() { - alert('执行注册方法'); - } } diff --git a/src/app/account/register/register.component.html b/src/app/account/register/register.component.html new file mode 100644 index 0000000..2923632 --- /dev/null +++ b/src/app/account/register/register.component.html @@ -0,0 +1,55 @@ + +
+
+ + +
+
+ {{ 'login.manager_name' | translate }} +
+ +
+ + +
+
+ {{ 'login.password' | translate }} +
+ +
+ + + +
+
+ {{ 'register.confirm_pwd' | translate }} +
+ +
+ + +
+
+ {{ 'register.mobie' | translate }} +
+ +
+ + +
+
+ {{ 'register.email' | translate }} +
+ +
+ +
+ + + + +
+ +
+
diff --git a/src/app/account/register/register.component.scss b/src/app/account/register/register.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/account/register/register.component.spec.ts b/src/app/account/register/register.component.spec.ts new file mode 100644 index 0000000..6c19551 --- /dev/null +++ b/src/app/account/register/register.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegisterComponent } from './register.component'; + +describe('RegisterComponent', () => { + let component: RegisterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegisterComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegisterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/account/register/register.component.ts b/src/app/account/register/register.component.ts new file mode 100644 index 0000000..6d07bfd --- /dev/null +++ b/src/app/account/register/register.component.ts @@ -0,0 +1,30 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder} from '@angular/forms'; +import {Height} from '../../height'; +@Component({ + selector: 'app-register', + templateUrl: './register.component.html', + styleUrls: ['./register.component.scss'] +}) +// 注册模块 +export class RegisterComponent extends Height implements OnInit { + // 注册表单 + registerForm = this.fb.group({ + managerName: [], + password: [], + confirmPassword: [], + mobie: [], + email: [] + }); + + constructor(private fb: FormBuilder) { + super(); + } + + ngOnInit(): void { + } + + register() { + alert('确认注册'); + } +} diff --git a/src/app/account/resetpwd/resetpwd.component.html b/src/app/account/resetpwd/resetpwd.component.html new file mode 100644 index 0000000..923289d --- /dev/null +++ b/src/app/account/resetpwd/resetpwd.component.html @@ -0,0 +1,39 @@ + +
+
+ +
+
+ {{ 'login.manager_name' | translate }} +
+ +
+ + +
+
+ {{ 'register.email' | translate }} +
+ +
+ +
+
+ + +
+
+ {{ 'reset_pwd.code' | translate }} +
+ +
+ +
+ + + + +
+
+
diff --git a/src/app/account/resetpwd/resetpwd.component.scss b/src/app/account/resetpwd/resetpwd.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/account/resetpwd/resetpwd.component.spec.ts b/src/app/account/resetpwd/resetpwd.component.spec.ts new file mode 100644 index 0000000..cbd3f27 --- /dev/null +++ b/src/app/account/resetpwd/resetpwd.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ResetpwdComponent } from './resetpwd.component'; + +describe('ResetpwdComponent', () => { + let component: ResetpwdComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ResetpwdComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ResetpwdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/account/resetpwd/resetpwd.component.ts b/src/app/account/resetpwd/resetpwd.component.ts new file mode 100644 index 0000000..d101ba6 --- /dev/null +++ b/src/app/account/resetpwd/resetpwd.component.ts @@ -0,0 +1,35 @@ +import { Component, OnInit } from '@angular/core'; +import { FormBuilder } from '@angular/forms'; +import {Height} from '../../height'; + +@Component({ + selector: 'app-resetpwd', + templateUrl: './resetpwd.component.html', + styleUrls: ['./resetpwd.component.scss'] +}) +// 重置密码模块 +export class ResetpwdComponent extends Height implements OnInit { + + // 重置密码表单 + resetForm = this.fb.group({ + managerName: [], + email: [], + verificationCode: [] + }); + + constructor(private fb: FormBuilder) { + super(); + } + + ngOnInit(): void { + } + + sendCode(){ + alert('发送验证码'); + } + + resetPwd(){ + alert('重置密码'); + } + +} diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8d8f37a..4996507 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,10 +1,20 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import {LoginComponent} from './login/login.component'; - +import {LoginComponent} from './account/login/login.component'; +import {RegisterComponent} from './account/register/register.component'; +import {ResetpwdComponent} from './account/resetpwd/resetpwd.component'; +import {ForumComponent} from './forum/forum.component'; +// 路由配置 export const routes: Routes = [ - {path: 'login', component: LoginComponent} + // 登陆 + {path: 'login', component: LoginComponent}, + // 注册 + {path: 'register', component: RegisterComponent}, + // 重置密码 + {path: 'reset_pwd', component: ResetpwdComponent}, + // 论坛管理' + {path: 'forum', component: ForumComponent} ]; @NgModule({ diff --git a/src/app/app.component.html b/src/app/app.component.html index a9190f7..9782e59 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -3,6 +3,8 @@ {{ 'APP_TITLE' | translate }} + {{ 'forum.name' | translate }} +