Commit 97fb086d by Sweet Zhang

消息列表

parent b6caea33
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> </div>
<div class="courseTitle"> <div class="courseTitle">
<h4>{{fileUploadItem?.itemName}}</h4> <h4>{{fileUploadItem?.itemName}}</h4>
<span class="viewpdf" *ngIf="fileUploadItem?.filePath && fileUploadItem?.filePath.indexOf('.pdf') > -1" [routerLink]="['/pdfView',fileId]" (click)="saveVideoPlayback()">立即阅读</span> <span class="viewpdf" *ngIf="fileUploadItem?.filePath && fileUploadItem?.filePath.indexOf('.pdf') > -1 && (fileUploadItem.learningStatus == 1 || fileUploadItem.learningStatus == 2)" (click)="viewPdfDetail(fileId)">立即阅读</span>
</div> </div>
<div class="courseIntroContent"> <div class="courseIntroContent">
<div class="tab"> <div class="tab">
......
...@@ -125,22 +125,34 @@ export class CourseDetailComponent implements OnInit,OnDestroy { ...@@ -125,22 +125,34 @@ export class CourseDetailComponent implements OnInit,OnDestroy {
menuPrevent() { menuPrevent() {
return false; return false;
} }
saveVideoPlayback() { saveVideoPlayback(type=1) {
// playbackStatus 视频播放状态(1:未播放完;2:已播放完) 【必填】 // playbackStatus 视频播放状态(1:未播放完;2:已播放完) 【必填】
const param = { let param = {
id: '', id: '',
customerId: this.lifeCustomerInfo.customerId, customerId: this.lifeCustomerInfo.customerId,
practitionerId: this.lifeCustomerInfo.practitionerId, practitionerId: this.lifeCustomerInfo.practitionerId,
fileId: this.fileId, fileId: this.fileId,
totalTime: this.video.nativeElement.duration,
viewTime: this.video.nativeElement.currentTime,
playbackStatus: this.video.nativeElement.currentTime >= this.video.nativeElement.duration ? 2 : 1,
} }
if(type===2){
param['playbackStatus'] = 2;
param['totalTime'] = param['viewTime'] = 0;
}else{
param['totalTime']=this.video.nativeElement.duration;
param['viewTime']= this.video.nativeElement.currentTime;
param['playbackStatus']=this.video.nativeElement.currentTime >= this.video.nativeElement.duration ? 2 : 1;
}
this.myService.saveVideoPlayback(param).subscribe(res => { this.myService.saveVideoPlayback(param).subscribe(res => {
}) })
} }
// 立即阅读
viewPdfDetail(fileId){
this.saveVideoPlayback(2);
this.router.navigate(['/pdfView',fileId]);
}
queryVideoPlayback(type) { queryVideoPlayback(type) {
const param = { const param = {
id: null, id: null,
...@@ -186,6 +198,7 @@ export class CourseDetailComponent implements OnInit,OnDestroy { ...@@ -186,6 +198,7 @@ export class CourseDetailComponent implements OnInit,OnDestroy {
behavior: 'smooth'}) behavior: 'smooth'})
} }
} }
} }
<div class="wrapper"> <div class="wrapper">
<div class="item" [routerLink]="['/thanks']"> <div class="clearMessage">
<span>银盾保险经纪董事长欢迎信</span> <div></div>
<div class="content"> <div (click)="oneKeyRead()">
<span class="iconfont icon-ar-r"></span> <img src="assets/images/icons/delete.png" alt="" srcset="">
<span>清除未读</span>
</div> </div>
</div> </div>
<div class="item" [routerLink]="['/newsDetail/2']"> <div class="item" *ngFor="let item of newsLists" (click)="goDetail(item)">
<span>银盾保险经纪置顶公众号操作指南</span> <div class="noticeIcon">
<img src="assets/images/icons/noticeTip.png" alt="">
</div>
<div class="newsSummary">
<h4>{{item.title}}</h4>
<p>{{item.context}}</p>
</div>
<div class="content"> <div class="content">
<div><span>{{item.createdAt | date:'yyyy-MM-dd'}}</span><span class="redDots" *ngIf="item.isRead=='0'"></span></div>
<span class="iconfont icon-ar-r"></span> <span class="iconfont icon-ar-r"></span>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -26,6 +26,52 @@ ...@@ -26,6 +26,52 @@
height: 35px; height: 35px;
margin-right: 10px; margin-right: 10px;
} }
.noticeIcon{
width: 0;
flex: 0 0 41px;
}
.newsSummary{
width: 0;
flex: 0 0 85%;
p{
width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.content{
display: flex;
flex-direction: column;
align-items: end;
white-space: nowrap;
width: 0;
.redDots{
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #F24949;
margin-left: 15px;
}
}
}
.clearMessage{
display: flex;
justify-content: space-between;
padding-right: 15px;
div{
display: flex;
align-items: center;
img{
width: 20px;
}
span{
color: #666;
font-size: 12px;
margin-left: 2px;
}
}
} }
.lifeList{ .lifeList{
display: flex; display: flex;
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { MyService } from '../my.service';
@Component({ @Component({
selector: 'ydlife-my-news', selector: 'ydlife-my-news',
...@@ -6,10 +8,56 @@ import { Component, OnInit } from '@angular/core'; ...@@ -6,10 +8,56 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./my-news.component.scss'] styleUrls: ['./my-news.component.scss']
}) })
export class MyNewsComponent implements OnInit { export class MyNewsComponent implements OnInit {
private customerInfo:any;
public newsLists = [
{id:'01',title:'银盾保险经纪董事长欢迎信',context:'',link:'/thanks',createdAt:'',isCommonDetsil:false,isRead:'1'},
{id:'000',title:'银盾保险经纪置顶公众号操作指南',context:'',link:'/newsDetail',createdAt:'',isCommonDetsil:true,isRead:'1'},
]
constructor() { }
goDetail(val){
if(val.isCommonDetsil){
this.router.navigate([val.link,val.id])
}else{
this.router.navigate([val.link])
}
}
// 查询消息列表
querySystemMessage(){
const param = {
practitionerId:this.customerInfo.practitionerId
}
this.myService.querySystemMessage(param).subscribe(res=>{
console.log(res);
if(res['success']){
res['data']['dataList'].forEach(item=>{
item.link = '/newsDetail';
item.isCommonDetsil = true;
})
// 赋值前先初始化
this.newsLists = [
{id:'000',title:'银盾保险经纪董事长欢迎信',context:'',link:'/thanks',createdAt:'',isCommonDetsil:false,isRead:'1'},
{id:'000',title:'银盾保险经纪置顶公众号操作指南',context:'',link:'/newsDetail',createdAt:'',isCommonDetsil:true,isRead:'1'}
]
this.newsLists = this.newsLists.concat(res['data']['dataList']);
}
})
}
// 一键已读
oneKeyRead(){
this.myService.oneKeyRead({practitionerId:this.customerInfo.practitionerId}).subscribe(res=>{
if(res['success']){
this.querySystemMessage()
}
})
}
constructor(private router:Router,private myService:MyService) { }
ngOnInit() { ngOnInit() {
this.customerInfo = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
this.querySystemMessage();
} }
} }
...@@ -112,7 +112,7 @@ const myRoutes: Routes = [ ...@@ -112,7 +112,7 @@ const myRoutes: Routes = [
{ path: 'thanks', component: ThanksComponent, canActivate: [AuthGuard] ,data:[{title:'感谢信'}]}, { path: 'thanks', component: ThanksComponent, canActivate: [AuthGuard] ,data:[{title:'感谢信'}]},
{ path: 'setting', component: MySettingComponent, canActivate: [AuthGuard],data:[{title:'设置'}] }, { path: 'setting', component: MySettingComponent, canActivate: [AuthGuard],data:[{title:'设置'}] },
{ path: 'setting/:uploadType', component: MySettingDetailComponent, canActivate: [AuthGuard],data:[{title:'设置'}] }, { path: 'setting/:uploadType', component: MySettingDetailComponent, canActivate: [AuthGuard],data:[{title:'设置'}] },
{ path: 'news', component: MyNewsComponent, canActivate: [AuthGuard] ,data:[{title:'我的消息'}]}, { path: 'news', component: MyNewsComponent, canActivate: [AuthGuard] ,data:[{title:'消息列表'}]},
{ path: 'target', component: MyTargetComponent, canActivate: [AuthGuard],data:[{title:'目标设置'}] }, { path: 'target', component: MyTargetComponent, canActivate: [AuthGuard],data:[{title:'目标设置'}] },
{ path: 'teamPanel', component: TeamPanelComponent, canActivate: [AuthGuard],data:[{title:'我的团队'}] }, { path: 'teamPanel', component: TeamPanelComponent, canActivate: [AuthGuard],data:[{title:'我的团队'}] },
{ path: 'teamPanel/:type', component: TeamSalesScoreComponent, canActivate: [AuthGuard] ,data:[{title:'活动量得分'}]}, { path: 'teamPanel/:type', component: TeamSalesScoreComponent, canActivate: [AuthGuard] ,data:[{title:'活动量得分'}]},
......
...@@ -906,4 +906,22 @@ export class MyService { ...@@ -906,4 +906,22 @@ export class MyService {
const url = this.API + "/college/lecturerQuery"; const url = this.API + "/college/lecturerQuery";
return this.http.post(url,JSON.stringify(params)) return this.http.post(url,JSON.stringify(params))
} }
// 消息列表
querySystemMessage(params){
const url = this.API + "/systemMessage/querySystemMessage";
return this.http.post(url,JSON.stringify(params))
}
// 消息详情
querySystemMessageDetail(params){
const url = this.API + "/systemMessage/querySystemMessageDetail";
return this.http.post(url,JSON.stringify(params))
}
// 一键已读
oneKeyRead(params){
const url = this.API + "/systemMessage/oneKeyRead";
return this.http.post(url,JSON.stringify(params))
}
} }
<div class="newsDetailContainer"> <div class="newsDetailContainer">
<div class="newsDetailContent"> <div class="newsDetailContent" *ngIf="messageId==='000'">
<div> <div>
<div><img src="assets/images/topOfficalAccountGuideBg.png" alt=""></div> <div><img src="assets/images/topOfficalAccountGuideBg.png" alt=""></div>
<h3>为了便于更好的服务您,三步就可轻松置顶银盾保险经纪公众号哦~<img src="assets/images/downArrow.gif" alt="" style="width: 25px"></h3> <h3>为了便于更好的服务您,三步就可轻松置顶银盾保险经纪公众号哦~<img src="assets/images/downArrow.gif" alt="" style="width: 25px"></h3>
<div><img src="assets/images/topOfficalAccountGuide1.png" alt=""></div> <div><img src="assets/images/topOfficalAccountGuide1.png" alt=""></div>
</div> </div>
</div> </div>
<div class="messageDetailContent" *ngIf="messageId!=='000'">
<div style="background: #fff;padding: 10px;">
<div class="title">
<h4>{{systemMessageInfo?.title}}</h4>
<p>{{systemMessageInfo?.createdAt}}</p>
</div>
<div class="contentDetail">
<div [innerHTML]="systemMessageInfo?.content"></div>
</div>
</div>
</div>
<div class="closeBtn"> <div class="closeBtn">
<i class="iconfont icon-jia" (click)="close()"></i> <i class="iconfont icon-jia" (click)="close()"></i>
</div> </div>
......
.newsDetailContainer{ .newsDetailContainer{
background-color: rgba(0, 0, 0, 0.5); background-color: #f5f5f5;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; padding: 20px;
padding: 30px; min-height: calc(100vh - 70px);
.newsDetailContent{ .newsDetailContent{
background-color: #fff; background-color: #fff;
padding-bottom: 10px; padding-bottom: 10px;
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
line-height: 42px; line-height: 42px;
margin: 10px auto; margin: 10px auto;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #333;
transform: rotate(45deg); transform: rotate(45deg);
} }
} }
...@@ -40,4 +40,21 @@ h3{ ...@@ -40,4 +40,21 @@ h3{
img{ img{
margin-left: 6px; margin-left: 6px;
} }
}
.messageDetailContent{
.title{
border-bottom: 1px solid #F2F2F2;
padding-bottom: 6px;
font-size: 12px;
color: #999;
h4{
color: #333;
font-size: 16px;
}
}
.contentDetail{
color: #333;
font-size: 12px;
}
} }
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { MyService } from '../my.service';
@Component({ @Component({
selector: 'ydlife-news-detail', selector: 'ydlife-news-detail',
...@@ -8,12 +9,17 @@ import { ActivatedRoute, Router } from '@angular/router'; ...@@ -8,12 +9,17 @@ import { ActivatedRoute, Router } from '@angular/router';
}) })
export class NewsDetailComponent implements OnInit { export class NewsDetailComponent implements OnInit {
type:string; type:string;
constructor(private router:Router,private activatedRoute:ActivatedRoute) { messageId:string;
this.type = activatedRoute.snapshot.queryParams['type'] systemMessageInfo:any;
constructor(private router:Router,private activatedRoute:ActivatedRoute,private myService:MyService) {
this.type = activatedRoute.snapshot.queryParams['type'];
this.messageId = activatedRoute.snapshot.params['id'];
} }
ngOnInit() { ngOnInit() {
if(this.messageId!=='000'){
this.querySystemMessageDetail();
}
} }
close() close()
...@@ -24,5 +30,13 @@ export class NewsDetailComponent implements OnInit { ...@@ -24,5 +30,13 @@ export class NewsDetailComponent implements OnInit {
this.router.navigate(['/news']) this.router.navigate(['/news'])
} }
} }
// 查询消息详情
querySystemMessageDetail(){
this.myService.querySystemMessageDetail({systemMessageId:this.messageId}).subscribe(res=>{
if(res['success']){
this.systemMessageInfo = res['data']['systemMessageInfo'];
}
})
}
} }
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