diff --git a/config/index.ts b/config/index.ts index db3f3bd79a50436e9cf286daf9528ef1652c1e16..349af2098088f5bdf9cd202c21619ed47fd3f6e2 100644 --- a/config/index.ts +++ b/config/index.ts @@ -16,9 +16,6 @@ export const webpLanguage = [ 'Git' ]; -// 网站运行开始时间 -export const start = new Date(2018, 3, 26, 0, 0, 0, 0); - // 如果没有请赋值空字符串 export const git = 'https://github.com/xjh22222228/nav'; diff --git a/data/utilityTool/devops.ts b/data/utilityTool/devops.ts index b6d95223b7583c76b3ec5bb4a922eb864af40566..29957e9639e29c99131f513ab5e32ec11870071e 100644 --- a/data/utilityTool/devops.ts +++ b/data/utilityTool/devops.ts @@ -349,6 +349,12 @@ const nav = { desc: '一个简单的公共IP地址API', link: 'https://www.ipify.org/', }, + { + icon: '', + name: '归属地查询', + desc: '淘宝免费归属地查询', + link: 'https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=13333333333', + }, ] }, ] diff --git a/src/app/app.component.html b/src/app/app.component.html index 17ca13e53155c4a66140d99810ee87472fbc2216..4552defaeefd06761e4e1ec7e4821e190c1128e3 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -6,7 +6,7 @@ class="github-link" *ngIf="git" > - + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a4135d9255289b55e302be2b6200dafe5644240d..2e7367d1cfc232988d0ca9061dda5b3317402945 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,39 +13,20 @@ export class AppComponent { constructor (private router: Router, private activatedRoute: ActivatedRoute) {} nav: Array = nav; - page: number = 0; includeTotal: number = 0; git: string = git; caseNumber: string = caseNumber; ngOnInit() { - const screenWidth = window.innerWidth; const hash = window.location.hash; const params = new URLSearchParams(hash.slice(hash.indexOf('?'))); const page = params.get('page'); const id = params.get('id'); const q = params.get('q'); - const queryParams = { - page, - id, - q - }; + const queryParams = { page, id, q }; - if (screenWidth < 768) { - this.router.navigate(['/app'], { queryParams }); - } else { - this.router.navigate(['/index'], { queryParams }); - } + this.goRoute(queryParams); - this.activatedRoute.queryParams.subscribe(query => { - const page = +query.page || 0; - if (page > this.nav.length - 1) { - this.page = this.nav.length - 1; - } else { - this.page = page; - } - }); - this.computedTotal(); } @@ -53,6 +34,16 @@ export class AppComponent { setInterval(this.setBackground, 10000); } + goRoute(queryParams: object) { + const screenWidth = window.innerWidth; + + if (screenWidth < 768) { + this.router.navigate(['/app'], { queryParams }); + } else { + this.router.navigate(['/index'], { queryParams }); + } + } + // 计算收录个数 computedTotal() { let total = 0; diff --git a/src/view/index.component.scss b/src/view/index.component.scss index 7c6ef31641dee6095d4446e242acca8393f6396f..be0fe28564ef5ac29ff3ad0504721f576d3b7d50 100644 --- a/src/view/index.component.scss +++ b/src/view/index.component.scss @@ -157,6 +157,7 @@ border-radius: 50%; pointer-events: none; border: 1px solid #eee; + background-color: #fff; } .name {