Commit 2850fb13 by sunchao

重要公告bug修复

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