Commit 566c09cc by sunchao

场景查询接口对接

parent d7556d74
......@@ -661,4 +661,11 @@ export class MyService {
return this.http
.post(url, JSON.stringify(param));
}
//场景查询
tagViewQuery(param){
const url = this.ydapi + "/metadata/tagViewQuery";
return this.http
.post(url, JSON.stringify(param));
}
}
......@@ -2,15 +2,18 @@
<div class="scrollContent" style="height: 100%;">
<div class="issueContainer">
<ul class="left">
<li *ngFor="let leftItem of leftList" (click)="switchCategory(leftItem.tagId)"
[ngClass]="{'actived':leftSelectedId===leftItem.tagId}">{{leftItem.name}}
<li (click)="switchCategory(null)" [ngClass]="{'actived':leftSelectedId===null}">全部</li>
<li *ngFor="let leftItem of leftList" (click)="switchCategory(leftItem.id)"
[ngClass]="{'actived':leftSelectedId===leftItem.id}">{{leftItem.tagName}}
</li>
</ul>
<div class="right">
<ul class="right_header">
<li>家财需求 <span class="iconfont icon-xiangxia"></span></li>
<li>保险公司 <span class="iconfont icon-xiangxia"></span></li>
<li>筛选 <img src="assets/images/product_select.png" alt="筛选" style="width: 16px;height:16px;"></li>
<li *ngFor="let topItem of topList">
{{topItem.tagName}}
<span class="iconfont icon-xiangxia"></span>
</li>
<li>筛选 <img src="assets/images/product_select.png" alt="筛选" style="width: 16px;height:16px;" (click)="tagViewQuery(3)"></li>
</ul>
</div>
</div>
......
import { Component, OnInit } from '@angular/core';
import { LifeCommonService } from '../../common/life-common.service';
import { MyService } from '../../my/my.service';
@Component({
selector: 'ydlife-product',
......@@ -8,29 +9,52 @@ import { LifeCommonService } from '../../common/life-common.service';
})
export class ProductComponent implements OnInit {
leftList:Array<any>;
topList:Array<any>;
rightList:Array<any>;
leftSelectedId:number = null;
constructor(public lifeCommonService:LifeCommonService) { }
constructor(private myService:MyService,public lifeCommonService:LifeCommonService) { }
ngOnInit() {
this.lifeCommonService.setTitle('产品库');
this.leftList = [
{name:'全部',tagId:null},
{name:'推荐',tagId:1},
{name:'新品',tagId:2},
{name:'意外',tagId:3},
{name:'医疗',tagId:4},
{name:'旅游',tagId:5},
{name:'重疾',tagId:6},
{name:'年金',tagId:7},
{name:'定寿',tagId:8},
{name:'终身寿',tagId:9},
{name:'留学',tagId:10},
{name:'高端医疗',tagId:11}
]
this.tagViewQuery(2);
this.tagViewQuery(6);
// this.leftList = [
// {name:'全部',tagId:null},
// {name:'推荐',tagId:1},
// {name:'新品',tagId:2},
// {name:'意外',tagId:3},
// {name:'医疗',tagId:4},
// {name:'旅游',tagId:5},
// {name:'重疾',tagId:6},
// {name:'年金',tagId:7},
// {name:'定寿',tagId:8},
// {name:'终身寿',tagId:9},
// {name:'留学',tagId:10},
// {name:'高端医疗',tagId:11}
// ]
}
switchCategory(id) {
this.leftSelectedId = id;
}
//type:2左侧,6上侧,3筛选
tagViewQuery(type){
const param = {
isActive:1,
tagViewType:type
}
this.myService.tagViewQuery(param).subscribe((res)=>{
if(res['success']){
if(type == 2){
this.leftList = res['data']['tagViewQueryInfos'];
}else if(type == 6){
this.topList = res['data']['tagViewQueryInfos']
}else{
this.rightList = res['data']['tagViewQueryInfos'];
}
}
})
}
}
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