Commit 15737d2e by Sweet Zhang

首页增加未读消息

parent 97fb086d
......@@ -98,7 +98,9 @@ export class CourseDetailComponent implements OnInit,OnDestroy {
} else {
this.fileUploadItemList = res['data']['fileUploadItemList'];
}
}else{
clearInterval(this.timer);
clearInterval(this.timer2);
}
})
}
......@@ -140,6 +142,9 @@ export class CourseDetailComponent implements OnInit,OnDestroy {
param['totalTime']=this.video.nativeElement.duration;
param['viewTime']= this.video.nativeElement.currentTime;
param['playbackStatus']=this.video.nativeElement.currentTime >= this.video.nativeElement.duration ? 2 : 1;
if(param['totalTime'] == param['viewTime']){
clearInterval()
}
}
this.myService.saveVideoPlayback(param).subscribe(res => {
......@@ -187,6 +192,7 @@ export class CourseDetailComponent implements OnInit,OnDestroy {
}
selectVideo(val) {
clearInterval();
if (val.learningStatus == '3') {
this.state.modal1 = true;
} else {
......
......@@ -14,6 +14,7 @@
></SearchBar>
<i [routerLink]="'/news'">
<img src="assets/images/indexIcons/news.png" alt="" srcset="">
<span *ngIf="messageUnreadCount">{{messageUnreadCount}}</span>
</i>
</section>
<section style="margin-top:-85px;">
......
......@@ -13,6 +13,23 @@
padding: 7px 10px 90px;
i{
flex-basis: 24px;
position: relative;
span{
position: absolute;
right: -4px;
top: -8px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #EF6C40;
color: #fff;
font-size: 10px;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
font-style: normal;
}
}
.indexSearchBar{
flex: auto;
......
......@@ -9,6 +9,7 @@ declare var wx: any;
styleUrls: ['./my-center-home.component.scss'],
})
export class MyCenterHomeComponent implements OnInit {
messageUnreadCount:string;
productInfo: any;
inquiry: any;
public announcementInfo: string;
......@@ -38,6 +39,19 @@ export class MyCenterHomeComponent implements OnInit {
this.router.navigate(['/product', { queryName: value.trim() }])
}
}
querySystemMessage(){
this.myService.querySystemMessage({practitionerId:localStorage.getItem('lifeCustomerInfo') ? JSON.parse(localStorage.getItem('lifeCustomerInfo')).practitionerId : null}).subscribe(res=>{
if(res['success']){
this.messageUnreadCount = res['data']['unReadcount'];
if(Number(this.messageUnreadCount) > 99){
this.messageUnreadCount = '99+';
}
}else{
this.messageUnreadCount = null;
}
})
}
searchProduct() {
// 查询互联网产品
......@@ -140,6 +154,8 @@ export class MyCenterHomeComponent implements OnInit {
this.queryproductlistbytag(119, 'hotProductLists');
// 查询最新一条公告
this.announcementQuery();
// 查询未读消息总数
this.querySystemMessage();
}
}
......
......@@ -13,7 +13,7 @@
<p>{{systemMessageInfo?.createdAt}}</p>
</div>
<div class="contentDetail">
<div [innerHTML]="systemMessageInfo?.content"></div>
<div [innerHTML]="systemMessageInfo?.context"></div>
</div>
</div>
</div>
......
......@@ -11,7 +11,7 @@
>div:first-child{
margin-right: 7px;
width: 0;
height: 104px;
height: 114px;
background-color: #ccc;
overflow: hidden;
flex: 0 0 114px;
......
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