Commit 2850fb13 by sunchao

重要公告bug修复

parent e7d273b3
......@@ -75,7 +75,8 @@
<div class="performance_wrapper notice">
<div style="position: relative;">
<h3 style="font-size: 16px;color: #ff002a;">公告</h3><i class="iconfont" style="color: #ff002a;">&#xe645;</i>
<div #hide style="font-size: 14px;" [innerHtml]="firstAnnouncement" ></div>
<div #hide style="font-size: 14px;position: absolute;z-index:-100" [innerHtml]="firstAnnouncement" ></div>
<div>{{this.firstAnnouncementTitle}}</div>
<span style="position:absolute;right:5px;font-size: 12px;color:#408dc9;" routerLink="importantAnnouncement">更多</span>
</div>
</div>
......
import {Component, OnInit} from '@angular/core';
import {Component, OnInit,ViewChild,ElementRef,AfterViewInit} from '@angular/core';
import {Router} from "@angular/router";
import {LifeCommonService} from "../../common/life-common.service";
import {environment} from "../../../environments/environment";
......@@ -12,7 +12,8 @@ declare var wx: any;
templateUrl: './my-center-home.component.html',
styleUrls: ['./my-center-home.component.scss']
})
export class MyCenterHomeComponent implements OnInit {
export class MyCenterHomeComponent implements OnInit,AfterViewInit {
@ViewChild('hide') hide:ElementRef
menuLists: Array<any>;
isNeedAlert: boolean;
dialogInfo: any;
......@@ -28,6 +29,7 @@ export class MyCenterHomeComponent implements OnInit {
products: Plans[];
productInfo: Plans;
inquiry: User;
firstAnnouncementTitle:string;
constructor(
private router: Router,
private lifeCommonService: LifeCommonService,
......@@ -101,6 +103,12 @@ export class MyCenterHomeComponent implements OnInit {
this.recommendPlanQuery();
}
ngAfterViewInit() {
setTimeout(() => {
this.firstAnnouncementTitle =this.getStr(this.hide.nativeElement.innerText, '28')
}, 500);
}
// 菜单导航
menuNavigation(item) {
if (item.routerLink) {
......@@ -139,7 +147,8 @@ export class MyCenterHomeComponent implements OnInit {
this.myService.announcementQuery(null, null).subscribe(res => {
if (res['success']) {
this.announcementLists = res['data']['announcementInfoList'];
this.firstAnnouncement = this.getStr(this.announcementLists[0]['title'],'36');
this.firstAnnouncement = this.announcementLists[0]['title'];
}
});
}
......
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