Commit 91b0c8eb by sunchao

文章列表记录上一次tab

parent e6f02939
<div class="salesWrapper"> <div class="salesWrapper">
<ul class="tab"> <ul class="tab">
<li *ngFor="let titleItem of titleList" (click)="selectTab(titleItem.id)" <li *ngFor="let titleItem of titleList" (click)="selectTab(titleItem.id)"
[ngClass]="{selected:mdDropOptionId===titleItem.id}"> [ngClass]="{selected:mdDropOptionId==titleItem.id}">
<div style="position: relative;"> <div style="position: relative;">
<h3>{{titleItem.dropOptionName}} <h3>{{titleItem.dropOptionName}}
</h3> </h3>
......
...@@ -11,7 +11,7 @@ import { ModalService, ToastService } from 'ng-zorro-antd-mobile'; ...@@ -11,7 +11,7 @@ import { ModalService, ToastService } from 'ng-zorro-antd-mobile';
}) })
export class ArticleComponent implements OnInit { export class ArticleComponent implements OnInit {
titleList:Array<any>; titleList:Array<any>;
mdDropOptionId:number = null; mdDropOptionId:any;
paginationInfo:any; paginationInfo:any;
articleList:Array<any>; articleList:Array<any>;
totalPage:number; totalPage:number;
...@@ -20,7 +20,8 @@ export class ArticleComponent implements OnInit { ...@@ -20,7 +20,8 @@ export class ArticleComponent implements OnInit {
public lifeCommonService:LifeCommonService, public lifeCommonService:LifeCommonService,
private router:Router, private router:Router,
private _modal: ModalService, private _modal: ModalService,
private _toast: ToastService) { private _toast: ToastService,
public activatedRoute: ActivatedRoute) {
this.paginationInfo = { this.paginationInfo = {
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5
...@@ -28,6 +29,7 @@ export class ArticleComponent implements OnInit { ...@@ -28,6 +29,7 @@ export class ArticleComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.mdDropOptionId = this.activatedRoute.snapshot.params['mdDropOptionId'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId']; this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.dropOptionsQuery(); this.dropOptionsQuery();
} }
...@@ -37,14 +39,19 @@ export class ArticleComponent implements OnInit { ...@@ -37,14 +39,19 @@ export class ArticleComponent implements OnInit {
.subscribe((res) => { .subscribe((res) => {
if (res["success"]) { if (res["success"]) {
this.titleList =res["data"]["dropMasterInfoList"][0]["dropOptionsInfoList"]; this.titleList =res["data"]["dropMasterInfoList"][0]["dropOptionsInfoList"];
if(this.mdDropOptionId!='null'){
this.selectTab(this.mdDropOptionId)
}else{
this.mdDropOptionId = this.titleList[0]['id']; this.mdDropOptionId = this.titleList[0]['id'];
this.practitionerFileSharingList(null); this.practitionerFileSharingList(null);
} }
}
}); });
} }
selectTab(id) { selectTab(id) {
this.mdDropOptionId = id; this.mdDropOptionId = id;
this.router.navigate(['/article', this.mdDropOptionId], {replaceUrl: true});
this.paginationInfo = { this.paginationInfo = {
pageNum: 1, pageNum: 1,
pageSize: 5 pageSize: 5
......
...@@ -93,7 +93,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit { ...@@ -93,7 +93,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
{ no: 13, subtitle: '我的商机', icon: 'line', path: '', routerLink: 'business',showSubMenu:true }, { no: 13, subtitle: '我的商机', icon: 'line', path: '', routerLink: 'business',showSubMenu:true },
{ no: 9, subtitle: '执业证书', icon: 'card', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}?source=0`, routerLink: '',showSubMenu:true }, { no: 9, subtitle: '执业证书', icon: 'card', path: `https://${window.location.host}/brokerQry/#/brokerDetail/${this.lifeCustomerInfo.practitionerId}?source=0`, routerLink: '',showSubMenu:true },
{ no: 10, subtitle: '职业类别', icon: 'job', path: 'https://www.ydinsurance.cn/occupationQry/', routerLink: '',showSubMenu:true }, { no: 10, subtitle: '职业类别', icon: 'job', path: 'https://www.ydinsurance.cn/occupationQry/', routerLink: '',showSubMenu:true },
{ no: 7, subtitle: '文章分享', icon: 'article', path: '', routerLink: 'article' ,showSubMenu:true}, { no: 7, subtitle: '文章分享', icon: 'article', path: '', routerLink: 'article/null' ,showSubMenu:true},
{ no: 3, subtitle: '产品海报', icon: 'poster_p', path: '/salesDetail', routerLink: 'material',showSubMenu:true }, { no: 3, subtitle: '产品海报', icon: 'poster_p', path: '/salesDetail', routerLink: 'material',showSubMenu:true },
], ],
isShow: true isShow: true
......
...@@ -108,7 +108,7 @@ const myRoutes: Routes = [ ...@@ -108,7 +108,7 @@ const myRoutes: Routes = [
{ path: 'suggestion',component:SuggestionComponent,data: [{ title: '问题反馈' }],canActivate:[AuthGuard]}, { path: 'suggestion',component:SuggestionComponent,data: [{ title: '问题反馈' }],canActivate:[AuthGuard]},
{ path: 'historical_rank', component: HistoricalRankComponent, canActivate: [AuthGuard] }, { path: 'historical_rank', component: HistoricalRankComponent, canActivate: [AuthGuard] },
{ path: 'team_area',component:TeamAreaPanelComponent, canActivate: [AuthGuard]}, { path: 'team_area',component:TeamAreaPanelComponent, canActivate: [AuthGuard]},
{ path: 'article', component:ArticleComponent}, { path: 'article/:mdDropOptionId', component:ArticleComponent},
{ path: 'articleDetail/:id',component:ArticleDetailComponent}, { path: 'articleDetail/:id',component:ArticleDetailComponent},
{ path: 'article_read/:id',component:ArticleReadComponent,canActivate:[AuthGuard]} { path: 'article_read/:id',component:ArticleReadComponent,canActivate:[AuthGuard]}
]; ];
......
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