Commit cc25e433 by Sweet Zhang

我的提问bug修改

parent b53bcbcd
......@@ -7,12 +7,12 @@
<div><i class="iconfont icon-shouye"></i></div>
<div>首页</div>
</div>
<div class="questionContainer" id="menuContainer" *ngIf="iconShowFlag" appDrag>
<div class="questionContainer" id="menuContainer" *ngIf="iconShowFlag" appDrag>
<div style="position: relation;" *ngIf="askIconFlag">
<div [routerLink]="'/underwriting_knowledge'">
<img src="assets/images/ask.gif" alt="" srcset="">
</div>
<div class="closeIcon" (click)="askIconFlag=menuShowFlag=iconShowFlag=false">X</div>
<div class="closeIcon" (click)="close()">X</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -41,6 +41,7 @@ export class AppComponent implements OnInit, OnDestroy {
ngOnInit() {
sessionStorage.setItem('iconShowFlag','true')
this.loginId = localStorage.getItem('lifeCustomerInfo')?JSON.parse(localStorage.getItem('lifeCustomerInfo')).mobileNo:null;
this.authService.obtainToken(this.loginId).subscribe(res => {
if (res['success']) {
......@@ -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({
selector: '[ydlifeScroll]'
})
export class ScrollDirective {
@Input('display') display:string;
constructor(private el:ElementRef) { }
......@@ -19,7 +20,12 @@ export class ScrollDirective {
@HostListener('touchend') onTouchcancel(){
setTimeout(()=>{
if(this.el.nativeElement.querySelector('#menuContainer')){
this.el.nativeElement.querySelector('#menuContainer').style.transform = 'translateX(0)'
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)'
}
}
},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