Skip to content

Commit 15e4f7e

Browse files
committed
style: update navigation app
1 parent 6cb42bc commit 15e4f7e

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

src/app/navigation/navigation.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
</mat-card>
77
</div>
88

9+
910
<div fxLayout="row" fxLayoutWrap>
1011
<div fxFlex="100" fxFlex.gt-md="20" fxFlex.gt-sm="33.3" fxFlex.gt-xs="50" *ngFor="let navigation of currentNum">
1112
<stbui-loading-skeleton></stbui-loading-skeleton>
@@ -14,7 +15,7 @@
1415
<div fxFlex="100" fxFlex.gt-md="20" fxFlex.gt-sm="33.3" fxFlex.gt-xs="50" *ngFor="let list of lists">
1516
<mat-card class="nav-item">
1617
<div class="nav-item-mask">
17-
<div class="nav-item-logo" style=""></div>
18+
<div class="nav-item-logo" [ngStyle]="{'background-image': ''}"></div>
1819
</div>
1920

2021
<mat-card-header>

src/app/navigation/navigation.component.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Component, OnInit, Inject } from '@angular/core';
66
styleUrls: ['./navigation.component.scss']
77
})
88
export class NavigationComponent implements OnInit {
9-
109
navigations;
1110
categories: object;
1211
currentPage;
@@ -16,32 +15,32 @@ export class NavigationComponent implements OnInit {
1615
// skeleton screen
1716
currentNum = new Array(20);
1817

19-
lists
18+
lists;
2019

21-
constructor(@Inject('NavigationService') private service) {
22-
}
20+
constructor(@Inject('NavigationService') private service) {}
2321

2422
ngOnInit() {
2523
this.getNavs();
2624
this.getCategories();
2725

28-
this.service.getList().subscribe(res => {
29-
this.lists = res;
30-
})
26+
// this.service.getList().subscribe(res => {
27+
// this.lists = res;
28+
// })
3129
}
3230

3331
getNavs(id: any = '', page: any = '') {
3432
this.service.getNavs(id, page);
3533
this.service.navigations.subscribe(res => {
36-
this.navigations = res.data;
34+
// this.navigations = res.data;
35+
this.lists = res.data;
3736
this.totalPages = res.totalPages;
3837
this.currentPage = res.currentPage;
3938
this.hideLoading();
4039
});
4140
}
4241

4342
getCategories() {
44-
this.service.getCategories().subscribe(res => this.categories = res.data);
43+
this.service.getCategories().subscribe(res => (this.categories = res.data));
4544
}
4645

4746
findNavLists(id: any) {
@@ -59,15 +58,14 @@ export class NavigationComponent implements OnInit {
5958

6059
hideLoading() {
6160
// 延时显示效果
62-
setTimeout(() => this.currentNum = new Array(0), 1000);
61+
setTimeout(() => (this.currentNum = new Array(0)), 1000);
6362
}
6463

6564
showLoading() {
6665
this.currentNum = new Array(20);
6766
}
6867

6968
selectedTagChange(tag) {
70-
console.log(tag);
7169
this.findNavLists(tag.id);
7270
}
7371
}

src/app/navigation/navigation.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
22
import { HttpModule } from '@angular/http';
33

44
import { SharedModule } from '../shared/shared.module';
5-
import { TagSelectModule, LoadingModule } from '../component';
5+
import { TagSelectModule, LoadingModule, GithubButtonModule } from '../component';
66

77
import { NavigationComponent } from './navigation.component';
88
import { NavigationRoutingModule } from './navigation.routing';
@@ -16,7 +16,8 @@ import { PaginationModule } from '../component';
1616
NavigationRoutingModule,
1717
PaginationModule,
1818
TagSelectModule,
19-
LoadingModule
19+
LoadingModule,
20+
GithubButtonModule
2021
],
2122
declarations: [NavigationComponent],
2223
providers: [{ provide: 'NavigationService', useClass: NavigationService }]

src/assets/data/navigation/links.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
"numsPerPage": 20,
55
"currentPage": 1,
66
"data": [
7+
{
8+
"id": 1,
9+
"title": "angular-material-app",
10+
"link": "https://github.com/stbui/angular-material-app",
11+
"description": "基于最新Angular 5框架与Material 2技术的企业级通用管理系统快速开发框架",
12+
"link_github": "https://github.com/stbui/angular-material-app",
13+
"tag": "",
14+
"image_link": "",
15+
"sort_order": 1,
16+
"user_id": 1,
17+
"catalog_id": 621,
18+
"topic_id": 8,
19+
"status_is": "Y",
20+
"create_time": 0
21+
},
722
{
823
"id": 4357,
924
"title": "WebStorm",

0 commit comments

Comments
 (0)