-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38527a1
commit 9da8f89
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/app/feature/exception/exception/exception.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="g-exception" fxLayout="row" fxLayoutAlign="center center"> | ||
<div class="img-box" fxFlex="62.5%"> | ||
<div class="img" [style.backgroundImage]="_image"></div> | ||
</div> | ||
<section class="content" fxFlex="auto"> | ||
<h2 class="title"> | ||
<ng-content select="[title]"></ng-content> | ||
</h2> | ||
<p class="description"> | ||
<ng-content select="[description]"></ng-content> | ||
</p> | ||
<a routerLink="/" sim-button [color]="'primary'">返回首页</a> | ||
</section> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
src/app/feature/exception/exception/exception.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.g-exception { | ||
min-height: 500px; | ||
height: 80%; | ||
.img-box { | ||
padding-right: 152px; | ||
text-align: right; | ||
} | ||
.img { | ||
display: inline-block; | ||
height: 360px; | ||
width: 100%; | ||
max-width: 430px; | ||
background-repeat: no-repeat; | ||
background-position: 50% 50%; | ||
background-size: contain; | ||
} | ||
.title { | ||
color: #434e59; | ||
font-size: 72px; | ||
font-weight: 600; | ||
line-height: 72px; | ||
margin-bottom: 24px; | ||
} | ||
.description { | ||
color: rgba(0, 0, 0, 0.45); | ||
font-size: 20px; | ||
line-height: 28px; | ||
margin-bottom: 16px; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/feature/exception/exception/exception.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ExceptionComponent } from './exception.component'; | ||
|
||
describe('ExceptionComponent', () => { | ||
let component: ExceptionComponent; | ||
let fixture: ComponentFixture<ExceptionComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ExceptionComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ExceptionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
src/app/feature/exception/exception/exception.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-exception', | ||
templateUrl: './exception.component.html', | ||
styleUrls: ['./exception.component.scss'] | ||
}) | ||
export class ExceptionComponent implements OnInit { | ||
_image: string; | ||
@Input() | ||
get image(): string { | ||
return this._image; | ||
} | ||
set image(value: string) { | ||
if (value) { | ||
this._image = `url(${value})`; | ||
} | ||
|
||
} | ||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |