Commit cc25e433 by Sweet Zhang

我的提问bug修改

parent b53bcbcd
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div [routerLink]="'/underwriting_knowledge'"> <div [routerLink]="'/underwriting_knowledge'">
<img src="assets/images/ask.gif" alt="" srcset=""> <img src="assets/images/ask.gif" alt="" srcset="">
</div> </div>
<div class="closeIcon" (click)="askIconFlag=menuShowFlag=iconShowFlag=false">X</div> <div class="closeIcon" (click)="close()">X</div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -41,6 +41,7 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -41,6 +41,7 @@ export class AppComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
sessionStorage.setItem('iconShowFlag','true')
this.loginId = localStorage.getItem('lifeCustomerInfo')?JSON.parse(localStorage.getItem('lifeCustomerInfo')).mobileNo:null; this.loginId = localStorage.getItem('lifeCustomerInfo')?JSON.parse(localStorage.getItem('lifeCustomerInfo')).mobileNo:null;
this.authService.obtainToken(this.loginId).subscribe(res => { this.authService.obtainToken(this.loginId).subscribe(res => {
if (res['success']) { if (res['success']) {
...@@ -116,4 +117,9 @@ export class AppComponent implements OnInit, OnDestroy { ...@@ -116,4 +117,9 @@ export class AppComponent implements OnInit, OnDestroy {
}) })
} }
close(){
this.askIconFlag=this.iconShowFlag=false
sessionStorage.setItem('iconShowFlag',this.iconShowFlag+'')
}
} }
import { Directive, ElementRef, HostListener } from '@angular/core'; import { Directive, ElementRef, HostListener, Input } from '@angular/core';
@Directive({ @Directive({
selector: '[ydlifeScroll]' selector: '[ydlifeScroll]'
}) })
export class ScrollDirective { export class ScrollDirective {
@Input('display') display:string;
constructor(private el:ElementRef) { } constructor(private el:ElementRef) { }
...@@ -19,8 +20,13 @@ export class ScrollDirective { ...@@ -19,8 +20,13 @@ export class ScrollDirective {
@HostListener('touchend') onTouchcancel(){ @HostListener('touchend') onTouchcancel(){
setTimeout(()=>{ setTimeout(()=>{
if(this.el.nativeElement.querySelector('#menuContainer')){ if(this.el.nativeElement.querySelector('#menuContainer')){
if(sessionStorage.getItem('iconShowFlag')=='false'){
this.el.nativeElement.querySelector('#menuContainer').style.display = 'none'
}else{
this.el.nativeElement.querySelector('#menuContainer').style.display = 'block'
this.el.nativeElement.querySelector('#menuContainer').style.transform = 'translateX(0)' this.el.nativeElement.querySelector('#menuContainer').style.transform = 'translateX(0)'
} }
}
},1000) },1000)
} }
} }
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