Commit 15737d2e by Sweet Zhang

首页增加未读消息

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