Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
ydLife
Commits
566c09cc
Commit
566c09cc
authored
Jul 19, 2021
by
sunchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场景查询接口对接
parent
d7556d74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
20 deletions
+54
-20
src/app/my/my.service.ts
+7
-0
src/app/my/product/product.component.html
+8
-5
src/app/my/product/product.component.ts
+39
-15
No files found.
src/app/my/my.service.ts
View file @
566c09cc
...
@@ -661,4 +661,11 @@ export class MyService {
...
@@ -661,4 +661,11 @@ export class MyService {
return
this
.
http
return
this
.
http
.
post
(
url
,
JSON
.
stringify
(
param
));
.
post
(
url
,
JSON
.
stringify
(
param
));
}
}
//场景查询
tagViewQuery
(
param
){
const
url
=
this
.
ydapi
+
"/metadata/tagViewQuery"
;
return
this
.
http
.
post
(
url
,
JSON
.
stringify
(
param
));
}
}
}
src/app/my/product/product.component.html
View file @
566c09cc
...
@@ -2,15 +2,18 @@
...
@@ -2,15 +2,18 @@
<div
class=
"scrollContent"
style=
"height: 100%;"
>
<div
class=
"scrollContent"
style=
"height: 100%;"
>
<div
class=
"issueContainer"
>
<div
class=
"issueContainer"
>
<ul
class=
"left"
>
<ul
class=
"left"
>
<li
*
ngFor=
"let leftItem of leftList"
(
click
)="
switchCategory
(
leftItem
.
tagId
)"
<li
(
click
)="
switchCategory
(
null
)"
[
ngClass
]="{'
actived
'
:leftSelectedId=
==null}"
>
全部
</li>
[
ngClass
]="{'
actived
'
:leftSelectedId=
==leftItem.tagId}"
>
{{leftItem.name}}
<li
*
ngFor=
"let leftItem of leftList"
(
click
)="
switchCategory
(
leftItem
.
id
)"
[
ngClass
]="{'
actived
'
:leftSelectedId=
==leftItem.id}"
>
{{leftItem.tagName}}
</li>
</li>
</ul>
</ul>
<div
class=
"right"
>
<div
class=
"right"
>
<ul
class=
"right_header"
>
<ul
class=
"right_header"
>
<li>
家财需求
<span
class=
"iconfont icon-xiangxia"
></span></li>
<li
*
ngFor=
"let topItem of topList"
>
<li>
保险公司
<span
class=
"iconfont icon-xiangxia"
></span></li>
{{topItem.tagName}}
<li>
筛选
<img
src=
"assets/images/product_select.png"
alt=
"筛选"
style=
"width: 16px;height:16px;"
></li>
<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>
</ul>
</div>
</div>
</div>
</div>
...
...
src/app/my/product/product.component.ts
View file @
566c09cc
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
MyService
}
from
'../../my/my.service'
;
@
Component
({
@
Component
({
selector
:
'ydlife-product'
,
selector
:
'ydlife-product'
,
...
@@ -8,29 +9,52 @@ import { LifeCommonService } from '../../common/life-common.service';
...
@@ -8,29 +9,52 @@ import { LifeCommonService } from '../../common/life-common.service';
})
})
export
class
ProductComponent
implements
OnInit
{
export
class
ProductComponent
implements
OnInit
{
leftList
:
Array
<
any
>
;
leftList
:
Array
<
any
>
;
topList
:
Array
<
any
>
;
rightList
:
Array
<
any
>
;
leftSelectedId
:
number
=
null
;
leftSelectedId
:
number
=
null
;
constructor
(
public
lifeCommonService
:
LifeCommonService
)
{
}
constructor
(
p
rivate
myService
:
MyService
,
p
ublic
lifeCommonService
:
LifeCommonService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
lifeCommonService
.
setTitle
(
'产品库'
);
this
.
lifeCommonService
.
setTitle
(
'产品库'
);
this
.
leftList
=
[
this
.
tagViewQuery
(
2
);
{
name
:
'全部'
,
tagId
:
null
},
this
.
tagViewQuery
(
6
);
{
name
:
'推荐'
,
tagId
:
1
},
// this.leftList = [
{
name
:
'新品'
,
tagId
:
2
},
// {name:'全部',tagId:null},
{
name
:
'意外'
,
tagId
:
3
},
// {name:'推荐',tagId:1},
{
name
:
'医疗'
,
tagId
:
4
},
// {name:'新品',tagId:2},
{
name
:
'旅游'
,
tagId
:
5
},
// {name:'意外',tagId:3},
{
name
:
'重疾'
,
tagId
:
6
},
// {name:'医疗',tagId:4},
{
name
:
'年金'
,
tagId
:
7
},
// {name:'旅游',tagId:5},
{
name
:
'定寿'
,
tagId
:
8
},
// {name:'重疾',tagId:6},
{
name
:
'终身寿'
,
tagId
:
9
},
// {name:'年金',tagId:7},
{
name
:
'留学'
,
tagId
:
10
},
// {name:'定寿',tagId:8},
{
name
:
'高端医疗'
,
tagId
:
11
}
// {name:'终身寿',tagId:9},
]
// {name:'留学',tagId:10},
// {name:'高端医疗',tagId:11}
// ]
}
}
switchCategory
(
id
)
{
switchCategory
(
id
)
{
this
.
leftSelectedId
=
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'
];
}
}
})
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment