Commit 91b0c8eb by sunchao

文章列表记录上一次tab

parent e6f02939
<div class="salesWrapper">
<ul class="tab">
<li *ngFor="let titleItem of titleList" (click)="selectTab(titleItem.id)"
[ngClass]="{selected:mdDropOptionId===titleItem.id}">
[ngClass]="{selected:mdDropOptionId==titleItem.id}">
<div style="position: relative;">
<h3>{{titleItem.dropOptionName}}
</h3>
......
......@@ -11,7 +11,7 @@ import { ModalService, ToastService } from 'ng-zorro-antd-mobile';
})
export class ArticleComponent implements OnInit {
titleList:Array<any>;
mdDropOptionId:number = null;
mdDropOptionId:any;
paginationInfo:any;
articleList:Array<any>;
totalPage:number;
......@@ -20,7 +20,8 @@ export class ArticleComponent implements OnInit {
public lifeCommonService:LifeCommonService,
private router:Router,
private _modal: ModalService,
private _toast: ToastService) {
private _toast: ToastService,
public activatedRoute: ActivatedRoute) {
this.paginationInfo = {
pageNum: 1,
pageSize: 5
......@@ -28,6 +29,7 @@ export class ArticleComponent implements OnInit {
}
ngOnInit() {
this.mdDropOptionId = this.activatedRoute.snapshot.params['mdDropOptionId'];
this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
this.dropOptionsQuery();
}
......@@ -37,14 +39,19 @@ export class ArticleComponent implements OnInit {
.subscribe((res) => {
if (res["success"]) {
this.titleList =res["data"]["dropMasterInfoList"][0]["dropOptionsInfoList"];
this.mdDropOptionId = this.titleList[0]['id'];
this.practitionerFileSharingList(null);
if(this.mdDropOptionId!='null'){
this.selectTab(this.mdDropOptionId)
}else{
this.mdDropOptionId = this.titleList[0]['id'];
this.practitionerFileSharingList(null);
}
}
});
}
selectTab(id) {
this.mdDropOptionId = id;
this.router.navigate(['/article', this.mdDropOptionId], {replaceUrl: true});
this.paginationInfo = {
pageNum: 1,
pageSize: 5
......
......@@ -93,7 +93,7 @@ export class MyCenterHomeComponent implements OnInit, AfterViewInit {
{ 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: 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 },
],
isShow: true
......
......@@ -108,7 +108,7 @@ const myRoutes: Routes = [
{ path: 'suggestion',component:SuggestionComponent,data: [{ title: '问题反馈' }],canActivate:[AuthGuard]},
{ path: 'historical_rank', component: HistoricalRankComponent, canActivate: [AuthGuard] },
{ path: 'team_area',component:TeamAreaPanelComponent, canActivate: [AuthGuard]},
{ path: 'article', component:ArticleComponent},
{ path: 'article/:mdDropOptionId', component:ArticleComponent},
{ path: 'articleDetail/:id',component:ArticleDetailComponent},
{ 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