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
4dd0cf5b
Commit
4dd0cf5b
authored
Apr 23, 2021
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存用户轨迹
parent
1c98bb3c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
12 deletions
+77
-12
src/app/my/article-detail/article-detail.component.html
+4
-4
src/app/my/article-detail/article-detail.component.ts
+69
-4
src/app/my/article/article.component.html
+2
-1
src/app/my/article/article.component.ts
+1
-2
src/app/my/my-routing.module.ts
+1
-1
No files found.
src/app/my/article-detail/article-detail.component.html
View file @
4dd0cf5b
...
@@ -5,17 +5,17 @@
...
@@ -5,17 +5,17 @@
<div
id=
"img-content"
class=
"rich_media_wrp"
>
<div
id=
"img-content"
class=
"rich_media_wrp"
>
<button
(
click
)="
getWxUserInfo
()"
>
getWxUserInfo
</button>
<button
(
click
)="
getWxUserInfo
()"
>
getWxUserInfo
</button>
<h2
class=
"rich_media_title"
id=
"activity-name"
>
<h2
class=
"rich_media_title"
id=
"activity-name"
>
{{articleInfo.title}}
{{articleInfo
?
.title}}
</h2>
</h2>
<div
id=
"meta_content"
class=
"rich_media_meta_list"
>
<div
id=
"meta_content"
class=
"rich_media_meta_list"
>
<span
class=
"rich_media_meta rich_media_meta_nickname"
id=
"profileBt"
>
<span
class=
"rich_media_meta rich_media_meta_nickname"
id=
"profileBt"
>
<a
href=
"javascript:void(0);"
id=
"js_name"
>
银盾保险在线
</a>
<a
href=
"javascript:void(0);"
id=
"js_name"
>
银盾保险在线
</a>
</span>
</span>
<em
id=
"publish_time"
<em
id=
"publish_time"
class=
"rich_media_meta rich_media_meta_text"
>
{{(articleInfo.updatedAt).substr(0,10)}}
</em>
class=
"rich_media_meta rich_media_meta_text"
>
{{(articleInfo
?
.updatedAt).substr(0,10)}}
</em>
</div>
</div>
<div
class=
"rich_media_content "
id=
"js_content"
style=
"visibility: visible;"
>
<div
class=
"rich_media_content "
id=
"js_content"
style=
"visibility: visible;"
>
<div
[
innerHTML
]="
articleInfo
.
fileContent
|
safeHtml
"
>
<div
[
innerHTML
]="
articleInfo
?
.
fileContent
|
safeHtml
"
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</div>
</div>
</div>
</div>
<!--经纪人名片-->
<!--经纪人名片-->
<div
class=
"agentInfoContainer"
>
<div
class=
"agentInfoContainer"
*
ngIf=
"agentInfo"
>
<div
style=
"display: flex"
>
<div
style=
"display: flex"
>
<div
class=
"portrait"
>
<div
class=
"portrait"
>
<img
<img
...
...
src/app/my/article-detail/article-detail.component.ts
View file @
4dd0cf5b
...
@@ -3,6 +3,8 @@ import {MyService} from '../../my/my.service';
...
@@ -3,6 +3,8 @@ import {MyService} from '../../my/my.service';
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
Subscription
}
from
"rxjs/index"
;
import
{
Subscription
}
from
"rxjs/index"
;
import
{
OnDestroy
}
from
"@angular/core"
;
import
{
OnDestroy
}
from
"@angular/core"
;
import
{
ActivatedRoute
,
Router
}
from
"@angular/router"
;
import
*
as
uuid
from
'uuid'
;
declare
const
wx
:
any
;
declare
const
wx
:
any
;
@
Component
({
@
Component
({
...
@@ -19,15 +21,27 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
...
@@ -19,15 +21,27 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
agentInfo
:
any
;
agentInfo
:
any
;
shareAbled
:
boolean
=
false
;
shareAbled
:
boolean
=
false
;
subscription
:
Subscription
;
subscription
:
Subscription
;
articleId
:
number
;
shareCode
:
string
;
articleShareCodeSaveInfo
:
any
;
sharePractitionerInfo
:
any
;
constructor
(
private
myService
:
MyService
,
public
lifeCommonService
:
LifeCommonService
)
{
constructor
(
private
myService
:
MyService
,
public
lifeCommonService
:
LifeCommonService
,
public
router
:
Router
,
public
activatedRoute
:
ActivatedRoute
)
{
this
.
subscription
=
lifeCommonService
.
shareStatus$
.
subscribe
(
status
=>
{
this
.
subscription
=
lifeCommonService
.
shareStatus$
.
subscribe
(
status
=>
{
this
.
shareAbled
=
!
(
status
==
'0'
);
this
.
shareAbled
=
!
(
status
==
'0'
);
});
});
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
articleInfo
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'articleInfo'
));
this
.
articleId
=
this
.
activatedRoute
.
snapshot
.
params
[
'id'
];
this
.
shareCode
=
this
.
activatedRoute
.
snapshot
.
queryParams
[
'shareCode'
]
?
this
.
activatedRoute
.
snapshot
.
queryParams
[
'shareCode'
]
:
uuid
.
v4
();
if
(
this
.
activatedRoute
.
snapshot
.
queryParams
[
'shareCode'
])
{
this
.
practitionerFileSharingList
(
null
,
this
.
shareCode
);
this
.
articleTrackSave
();
}
else
{
this
.
practitionerFileSharingList
(
this
.
articleId
,
null
);
}
this
.
lifeCustomerInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
:
null
;
this
.
lifeCustomerInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
?
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))
:
null
;
if
(
this
.
lifeCustomerInfo
)
{
if
(
this
.
lifeCustomerInfo
)
{
this
.
customerId
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))[
'customerId'
]
this
.
customerId
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))[
'customerId'
]
...
@@ -41,7 +55,6 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
...
@@ -41,7 +55,6 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
qrCodePath
:
this
.
lifeCustomerInfo
.
practitionerBasicInfo
.
qrCodePath
,
qrCodePath
:
this
.
lifeCustomerInfo
.
practitionerBasicInfo
.
qrCodePath
,
mobileNo
:
this
.
lifeCustomerInfo
.
mobileNo
mobileNo
:
this
.
lifeCustomerInfo
.
mobileNo
};
};
this
.
lifeCommonService
.
wxShare
(
this
.
articleInfo
.
title
,
`来自银盾经纪人
${
this
.
agentInfo
.
agentName
}
的分享`
,
`
${
window
.
location
.
href
}
`
,
this
.
articleInfo
.
coverUrl
);
if
(
this
.
lifeCommonService
.
checkDeviceType
()
==
'3'
&&
!
this
.
customerId
)
{
if
(
this
.
lifeCommonService
.
checkDeviceType
()
==
'3'
&&
!
this
.
customerId
)
{
this
.
getWxUserInfo
();
this
.
getWxUserInfo
();
}
}
...
@@ -64,12 +77,64 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
...
@@ -64,12 +77,64 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
// 点击分享
// 点击分享
share
()
{
share
()
{
this
.
shareAbled
=
!
this
.
shareAbled
;
this
.
shareAbled
=
!
this
.
shareAbled
;
this
.
lifeCommonService
.
wxShare
(
this
.
articleInfo
.
title
,
`来自银盾经纪人
${
this
.
agentInfo
.
agentName
}
的分享`
,
`
${
window
.
location
.
href
}
`
,
this
.
articleInfo
.
coverUrl
);
this
.
lifeCommonService
.
wxShare
(
this
.
articleInfo
.
title
,
`来自银盾经纪人
${
this
.
agentInfo
.
agentName
}
的分享`
,
`
${
window
.
location
.
href
}
?shareCode=
${
this
.
shareCode
}
`
,
this
.
articleInfo
.
coverUrl
);
this
.
articleShareCodeSave
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
shareAbled
=
false
;
this
.
shareAbled
=
false
;
},
6000
);
},
6000
);
}
}
// 通过文章ID或者分享码查询文章详情
practitionerFileSharingList
(
id
,
shareCode
)
{
this
.
myService
.
practitionerFileSharingList
({
shareCode
:
shareCode
,
id
:
id
,
practitionerFileShares
:
{
pageNum
:
1
,
pageSize
:
5
}
}).
subscribe
(
res
=>
{
this
.
articleInfo
=
res
[
'data'
].
practitionerFileShares
.
list
[
'0'
];
this
.
sharePractitionerInfo
=
res
[
'data'
].
sharePractitionerInfo
;
this
.
agentInfo
=
{
headImagePath
:
this
.
sharePractitionerInfo
.
headImagePath
,
agentName
:
this
.
sharePractitionerInfo
.
name
,
insurerBranchName
:
this
.
sharePractitionerInfo
.
insurerBranchName
,
qrCodePath
:
this
.
sharePractitionerInfo
.
qrCodePath
,
mobileNo
:
this
.
sharePractitionerInfo
.
mobileNo
};
this
.
lifeCommonService
.
wxShare
(
this
.
articleInfo
.
title
,
`来自银盾经纪人
${
this
.
agentInfo
.
agentName
}
的分享`
,
`
${
window
.
location
.
href
}
`
,
this
.
articleInfo
.
coverUrl
);
});
}
// 保存文章code
articleShareCodeSave
()
{
this
.
articleShareCodeSaveInfo
=
{
itemId
:
this
.
articleId
,
shareCode
:
this
.
shareCode
,
practitionerId
:
this
.
lifeCustomerInfo
.
practitionerId
?
this
.
lifeCustomerInfo
.
practitionerId
:
this
.
sharePractitionerInfo
.
practitionerId
,
customerId
:
this
.
lifeCustomerInfo
.
customerId
?
this
.
lifeCustomerInfo
.
customerId
:
this
.
sharePractitionerInfo
.
customerId
,
os
:
this
.
lifeCommonService
.
checkOs
(),
channel
:
1
,
url
:
window
.
location
.
href
};
this
.
myService
.
articleShareCodeSave
(
this
.
articleShareCodeSaveInfo
).
subscribe
(
res
=>
{
// console.log(res);
});
}
// 保存客户痕迹:
// 有id就是出 没id就是进
articleTrackSave
()
{
const
param
=
{
id
:
null
,
shareCode
:
this
.
shareCode
,
nickname
:
null
,
gender
:
null
,
imagePath
:
null
,
deviceType
:
this
.
lifeCommonService
.
checkDeviceType
()
};
this
.
myService
.
articleTrackSave
(
param
).
subscribe
(
res
=>
{
console
.
log
(
res
);
})
}
// 判断是get请求还是post请求进行支付请求
// 判断是get请求还是post请求进行支付请求
getOrPost
(
action
,
params
,
charset
,
actionType
)
{
getOrPost
(
action
,
params
,
charset
,
actionType
)
{
...
...
src/app/my/article/article.component.html
View file @
4dd0cf5b
<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;"
>
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<div
class=
"left"
>
<div
class=
"left"
>
<div
class=
"title"
>
{{articleItem.title}}
</div>
<div
class=
"title"
>
{{articleItem.title}}
</div>
<div
class=
"digest"
>
{{lifeCommonService.getTwenty(articleItem.digest,46)}}
</div>
<div
class=
"digest"
>
{{lifeCommonService.getTwenty(articleItem.digest,46)}}
</div>
<div
class=
"updateAt"
style=
"font-size: 12px;color:#8a8a8a;margin-top: 3px;"
>
{{articleItem.updatedAt}}
</div>
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<img
[
src
]="
articleItem
.
coverUrl
"
>
<img
[
src
]="
articleItem
.
coverUrl
"
>
...
...
src/app/my/article/article.component.ts
View file @
4dd0cf5b
...
@@ -74,8 +74,7 @@ export class ArticleComponent implements OnInit {
...
@@ -74,8 +74,7 @@ export class ArticleComponent implements OnInit {
//设置缓存并跳转到文章详情
//设置缓存并跳转到文章详情
articleDetail
(
articleItem
){
articleDetail
(
articleItem
){
sessionStorage
.
setItem
(
'articleInfo'
,
JSON
.
stringify
(
articleItem
));
this
.
router
.
navigate
([
'/articleDetail'
,
articleItem
.
id
]);
this
.
router
.
navigate
([
'/articleDetail'
]);
}
}
}
}
src/app/my/my-routing.module.ts
View file @
4dd0cf5b
...
@@ -108,7 +108,7 @@ const myRoutes: Routes = [
...
@@ -108,7 +108,7 @@ const myRoutes: Routes = [
{
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'
,
component
:
ArticleComponent
},
{
path
:
'articleDetail'
,
component
:
ArticleDetailComponent
}
{
path
:
'articleDetail
/:id
'
,
component
:
ArticleDetailComponent
}
];
];
@
NgModule
({
@
NgModule
({
...
...
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