From a3b5d71855fee67af1d621c14ecfbcf501498955 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 3 Jun 2020 14:41:51 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BA=91=E7=9B=98=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=20header=20=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/is-login.service.ts | 12 +++ src/app/navigation/navigation.component.html | 35 ++++--- src/app/tabbar/tabbar.component.html | 83 +++++----------- src/app/tabbar/tabbar.component.scss | 39 +------- src/app/tabbar/tabbar.component.ts | 99 ++++++------------- .../changeuserdata.component.html | 20 ++++ .../changeuserdata.component.scss | 0 .../changeuserdata.component.spec.ts | 25 +++++ .../changeuserdata.component.ts | 22 +++++ src/app/ui/login/login.component.html | 29 ++++++ src/app/ui/login/login.component.scss | 45 +++++++++ src/app/ui/login/login.component.spec.ts | 25 +++++ src/app/ui/login/login.component.ts | 24 +++++ src/app/ui/ui.module.ts | 4 +- 14 files changed, 284 insertions(+), 178 deletions(-) create mode 100644 src/app/is-login.service.ts create mode 100644 src/app/ui/changeuserdata/changeuserdata.component.html create mode 100644 src/app/ui/changeuserdata/changeuserdata.component.scss create mode 100644 src/app/ui/changeuserdata/changeuserdata.component.spec.ts create mode 100644 src/app/ui/changeuserdata/changeuserdata.component.ts create mode 100644 src/app/ui/login/login.component.html create mode 100644 src/app/ui/login/login.component.scss create mode 100644 src/app/ui/login/login.component.spec.ts create mode 100644 src/app/ui/login/login.component.ts diff --git a/src/app/is-login.service.ts b/src/app/is-login.service.ts new file mode 100644 index 0000000..a09ddb1 --- /dev/null +++ b/src/app/is-login.service.ts @@ -0,0 +1,12 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class IsLoginService { + + constructor() { } + + isLogin:boolean = false; //登录状态 + +} diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 1f07c23..01e78c1 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -1,24 +1,23 @@ - - -
- -
- +
- + -
- - -
+
+ + +
diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index 596defb..e0080ce 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -1,63 +1,30 @@ - - -

用户信息采集平台

- - - - - + - - + +

学习演练平台

- - + + - - + + + + - - - - - - --> + + +
\ No newline at end of file diff --git a/src/app/tabbar/tabbar.component.scss b/src/app/tabbar/tabbar.component.scss index 115d3d0..56b67c3 100644 --- a/src/app/tabbar/tabbar.component.scss +++ b/src/app/tabbar/tabbar.component.scss @@ -1,41 +1,12 @@ mat-toolbar{ - position: relative; - padding-left: 65px; -} -.logo{ - height: 64px; - widows: 64px; + position: relative; + padding-left: 65px; } -h1{ - line-height: 64px; - color: white; -} mat-icon{ - color: white; + color: white; } .login{ - position: absolute; - right:30px; -} -.fullscreen{ - position: absolute; - right:60px; -} -.setting{ - position: absolute; - right:120px; -} -.lockscreen{ - position: absolute; - right:160px; -} -.darktheme{ - position: absolute; - right:140px; - display: none; -} - -.boxed{ - width: 1200px; + position: absolute; + right:60px; } \ No newline at end of file diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index 151cb9c..bc410da 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -1,16 +1,22 @@ import { Component, OnInit,Output,EventEmitter } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Router,ActivatedRoute } from '@angular/router' - -import {CacheTokenService} from '../http-interceptors/cache-token.service'//引入服务 import { MatDialog } from '@angular/material/dialog'; import {ChangepasswordComponent} from '../ui/changepassword/changepassword.component' +import {ChangeuserdataComponent} from '../ui/changeuserdata/changeuserdata.component' +import {LoginComponent} from '../ui/login/login.component' +import {CacheTokenService} from '../http-interceptors/cache-token.service'//引入服务 +import {IsLoginService} from '../is-login.service'//引入服务 + + + @Component({ selector: 'app-tabbar', templateUrl: './tabbar.component.html', styleUrls: ['./tabbar.component.scss'] }) export class TabbarComponent implements OnInit { + theme: boolean = true; @Output() toggle = new EventEmitter(); @@ -20,83 +26,42 @@ export class TabbarComponent implements OnInit { defaulttheme = new EventEmitter(); @Output() redtheme = new EventEmitter(); - // @Output() - // boxed = new EventEmitter(); - onChange(eventValue: boolean){ - this.toggleDarkTheme.emit(eventValue); - } - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog) { } - ngOnInit() { - } - boxed(css){ - const Element = document.body; - Element.style.width = '1200px' - } - standard(){ - const Element = document.body; - Element.style.width = '100%' - } - isfullscreen:boolean = false; - fullscreenToggle(){ - const docElmWithBrowsersFullScreenFunctions = document.documentElement as HTMLElement & { - mozRequestFullScreen(): Promise; - webkitRequestFullscreen(): Promise; - msRequestFullscreen(): Promise; - }; - - if (docElmWithBrowsersFullScreenFunctions.requestFullscreen) { - docElmWithBrowsersFullScreenFunctions.requestFullscreen(); - } else if (docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen) { /* Firefox */ - docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen(); - } else if (docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen) { /* Chrome, Safari and Opera */ - docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen(); - } else if (docElmWithBrowsersFullScreenFunctions.msRequestFullscreen) { /* IE/Edge */ - docElmWithBrowsersFullScreenFunctions.msRequestFullscreen(); - } + constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,public isLogin:IsLoginService) { } + + ngOnInit() { - this.isfullscreen = true; - } - closefullscreen(){ - const docWithBrowsersExitFunctions = document as Document & { - mozCancelFullScreen(): Promise; - webkitExitFullscreen(): Promise; - msExitFullscreen(): Promise; - }; - if (docWithBrowsersExitFunctions.exitFullscreen) { - docWithBrowsersExitFunctions.exitFullscreen(); - } else if (docWithBrowsersExitFunctions.mozCancelFullScreen) { /* Firefox */ - docWithBrowsersExitFunctions.mozCancelFullScreen(); - } else if (docWithBrowsersExitFunctions.webkitExitFullscreen) { /* Chrome, Safari and Opera */ - docWithBrowsersExitFunctions.webkitExitFullscreen(); - } else if (docWithBrowsersExitFunctions.msExitFullscreen) { /* IE/Edge */ - docWithBrowsersExitFunctions.msExitFullscreen(); - } - this.isfullscreen = false; + + + + //登录系统 + login () { + let dialogRef = this.dialog.open(LoginComponent); + dialogRef.afterClosed().subscribe( data=>{ + console.log(data) + } ); } + + //退出系统 - signOut = () => { + signOut () { let out = confirm("您确定要退出吗") if(out) { - this.http.post('/api/Account/SignOut',{}).subscribe( - data=> { - this.token.delete() - sessionStorage.clear() - window.localStorage.clear() - alert('成功退出') - this.router.navigate(['/login']) - } - ) + } } - //修改密码 - changpsw() { - let dialogRef = this.dialog.open(ChangepasswordComponent, - {width:'348px'}); + //修改用户资料 + changeUserData () { + let dialogRef = this.dialog.open(ChangeuserdataComponent); + dialogRef.afterClosed().subscribe(); + } + //修改密码 + changPassword() { + let dialogRef = this.dialog.open(ChangepasswordComponent); dialogRef.afterClosed().subscribe(); } diff --git a/src/app/ui/changeuserdata/changeuserdata.component.html b/src/app/ui/changeuserdata/changeuserdata.component.html new file mode 100644 index 0000000..ec4b487 --- /dev/null +++ b/src/app/ui/changeuserdata/changeuserdata.component.html @@ -0,0 +1,20 @@ +
+ 修改资料 +
+
+ +
+ + + + + +
+ + +
+ +
+
\ No newline at end of file diff --git a/src/app/ui/changeuserdata/changeuserdata.component.scss b/src/app/ui/changeuserdata/changeuserdata.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/ui/changeuserdata/changeuserdata.component.spec.ts b/src/app/ui/changeuserdata/changeuserdata.component.spec.ts new file mode 100644 index 0000000..9cde5cc --- /dev/null +++ b/src/app/ui/changeuserdata/changeuserdata.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ChangeuserdataComponent } from './changeuserdata.component'; + +describe('ChangeuserdataComponent', () => { + let component: ChangeuserdataComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ChangeuserdataComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ChangeuserdataComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/changeuserdata/changeuserdata.component.ts b/src/app/ui/changeuserdata/changeuserdata.component.ts new file mode 100644 index 0000000..e1ab304 --- /dev/null +++ b/src/app/ui/changeuserdata/changeuserdata.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +@Component({ + selector: 'app-changeuserdata', + templateUrl: './changeuserdata.component.html', + styleUrls: ['./changeuserdata.component.scss'] +}) +export class ChangeuserdataComponent implements OnInit { + + constructor(private http:HttpClient,) { } + + ngOnInit(): void { + + } + + //修改资料 + onSubmit (e) { + console.log(e) + } + +} diff --git a/src/app/ui/login/login.component.html b/src/app/ui/login/login.component.html new file mode 100644 index 0000000..adb4633 --- /dev/null +++ b/src/app/ui/login/login.component.html @@ -0,0 +1,29 @@ +
+
+ +
+
+ +
+ account_box + + + +
+ +
+ lock + + + +
+ +
+ {{errmsg}} +
+ + +
+
+ +
diff --git a/src/app/ui/login/login.component.scss b/src/app/ui/login/login.component.scss new file mode 100644 index 0000000..c1dc33e --- /dev/null +++ b/src/app/ui/login/login.component.scss @@ -0,0 +1,45 @@ +.header { + margin: 0 auto; + width: 50px; + height: 50px; + border-radius: 50%; + img { + width: 100%; + height: 100%; + } +} + +.content { + margin: 20px 0; + text-align: center; + .alert-danger { + text-align: left; + font-size: 14px; + color: red; + } + .loginBtn { + width: 90%; + border-radius: 5px; + margin-top: 10px; + } +} +.input { + margin-left: 22px; + position: relative; +} +.icon { + width: 24px; + color: #666; + font-size: 24px; + position: absolute; + top: 17px; + left: -24px; +} +.icon2 { + width: 24px; + color: #666; + font-size: 24px; + position: absolute; + top: 17px; + left: -24px; +} \ No newline at end of file diff --git a/src/app/ui/login/login.component.spec.ts b/src/app/ui/login/login.component.spec.ts new file mode 100644 index 0000000..d6d85a8 --- /dev/null +++ b/src/app/ui/login/login.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/login/login.component.ts b/src/app/ui/login/login.component.ts new file mode 100644 index 0000000..bf6967a --- /dev/null +++ b/src/app/ui/login/login.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.scss'] +}) +export class LoginComponent implements OnInit { + + constructor(private http:HttpClient,) { } + + ngOnInit(): void { + + } + + errmsg:any; //err信息 + + //登录 + onSubmit (e) { + console.log(e) + } + +} diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index c56d91b..3dad637 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -52,9 +52,11 @@ import {ConfirmpswDirective} from './changepassword/equal-validator.directive' import { TimePipe } from '../pipes/time.pipe'; import { FileUploadModule } from 'ng2-file-upload' import { AllFileComponent } from './all-file/all-file.component'; +import { ChangeuserdataComponent } from './changeuserdata/changeuserdata.component'; +import { LoginComponent } from './login/login.component'; @NgModule({ - declarations: [PersonaldataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe, AllFileComponent], + declarations: [PersonaldataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe, AllFileComponent, ChangeuserdataComponent, LoginComponent], imports: [ CommonModule,