Commit ecc7b134 by Chao Sun

添加过渡

parent ffe8b4eb
import {Component, OnInit} from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {CommonService} from "./common.service"; import { CommonService } from "./common.service";
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
...@@ -12,11 +12,15 @@ export class AppComponent implements OnInit { ...@@ -12,11 +12,15 @@ export class AppComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
setTimeout(() => {
if (!this.commonService.getQueryString('t_reload')) { if (!this.commonService.getQueryString('t_reload')) {
let {search, href} = window.location; let { search, href } = window.location;
href = href.replace(/&?t_reload=(\d+)/g, ''); href = href.replace(/&?t_reload=(\d+)/g, '');
window.location.href = href + (search ? '&' : '?') + 't_reload=' + new Date().getTime(); window.location.href = href + (search ? '&' : '?') + 't_reload=' + new Date().getTime();
} }
}, 300)
console.log(this.commonService.getQueryString('t_reload'))
let customerId = this.commonService.getQueryString('customerId'); let customerId = this.commonService.getQueryString('customerId');
const double12_customerInfo = localStorage.getItem('double12_customerInfo') ? JSON.parse(localStorage.getItem('double12_customerInfo')) : null; const double12_customerInfo = localStorage.getItem('double12_customerInfo') ? JSON.parse(localStorage.getItem('double12_customerInfo')) : null;
if (double12_customerInfo) { if (double12_customerInfo) {
......
import {Injectable} from '@angular/core'; import { Injectable } from '@angular/core';
import {environment} from './../environments/environment'; import { environment } from './../environments/environment';
import {HttpClient, HttpHeaders} from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import {Subject} from "rxjs/index"; import { Subject } from "rxjs/index";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
...@@ -65,7 +65,7 @@ export class CommonService { ...@@ -65,7 +65,7 @@ export class CommonService {
const res = await this.obtainToken(); const res = await this.obtainToken();
this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']); this.httpOptions.headers = this.httpOptions.headers.set('X-Authorization', res['data']['token']);
return this.http return this.http
.post(url, JSON.stringify({orderId: orderId}), this.httpOptions).toPromise().then(response => { .post(url, JSON.stringify({ orderId: orderId }), this.httpOptions).toPromise().then(response => {
return response; return response;
}); });
} }
......
<div class="limbo"> <div class="limbo">
<img *ngIf="advFlag" src="assets/images/first.jpg">
<div *ngIf="!advFlag">
<div class="title" *ngIf="!picFlag"> <div class="title" *ngIf="!picFlag">
<img src="assets/images/bg_1.png"/> <img src="assets/images/bg_1.png" />
</div> </div>
<div class="specialWrapper" *ngIf="picFlag"> <div class="specialWrapper" *ngIf="picFlag">
<div class="specialContent part1"> <div class="specialContent part1">
...@@ -40,6 +42,8 @@ ...@@ -40,6 +42,8 @@
<div class="footer" routerLink="/family"> <div class="footer" routerLink="/family">
<div>开始评测</div> <div>开始评测</div>
</div> </div>
</div>
</div> </div>
<!--分享引导页--> <!--分享引导页-->
......
import {ChangeDetectorRef, Component, OnInit} from '@angular/core'; import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import {CommonService} from "../common.service"; import { CommonService } from "../common.service";
import {ActivatedRoute} from "@angular/router"; import { ActivatedRoute } from "@angular/router";
import {environment} from "../../environments/environment"; import { environment } from "../../environments/environment";
import set = Reflect.set; import set = Reflect.set;
declare const wx: any; declare const wx: any;
@Component({ @Component({
...@@ -16,7 +16,7 @@ export class TransitComponent implements OnInit { ...@@ -16,7 +16,7 @@ export class TransitComponent implements OnInit {
customerId: string; customerId: string;
deviceType: number; deviceType: number;
dialogTips: string; dialogTips: string;
advFlag: boolean = true;
constructor(private commonService: CommonService, private activatedRoute: ActivatedRoute, private changeDetectorRef: ChangeDetectorRef) { constructor(private commonService: CommonService, private activatedRoute: ActivatedRoute, private changeDetectorRef: ChangeDetectorRef) {
} }
...@@ -34,9 +34,12 @@ export class TransitComponent implements OnInit { ...@@ -34,9 +34,12 @@ export class TransitComponent implements OnInit {
if (this.deviceType === 3) { if (this.deviceType === 3) {
this.configWX(); this.configWX();
} }
setTimeout(() => {
this.advFlag = false;
}, 1000)
} }
// 分享给朋友 // 分享给朋友
wxShare() { wxShare() {
this.wxShareFlag = true; this.wxShareFlag = true;
if (this.customerId) { if (this.customerId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment