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
02bed373
Commit
02bed373
authored
Apr 25, 2021
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取被分享者头像
parent
50061c98
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
5 deletions
+22
-5
src/app/common/life-common.service.ts
+15
-0
src/app/my/article-detail/article-detail.component.html
+0
-1
src/app/my/article-detail/article-detail.component.ts
+5
-2
src/app/my/my.service.ts
+2
-2
No files found.
src/app/common/life-common.service.ts
View file @
02bed373
...
...
@@ -26,6 +26,21 @@ export class LifeCommonService {
}
/**
* url中的参数
* @param name
* @returns {any}
*/
getQueryString
(
name
)
{
const
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
const
r
=
decodeURIComponent
(
window
.
location
.
search
).
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
{
return
r
[
2
];
}
return
null
;
}
/**
* 检测操作系统
*/
checkOs
()
{
...
...
src/app/my/article-detail/article-detail.component.html
View file @
02bed373
<button
(
click
)="
getWxUserInfo
()"
>
getWxUserInfo
</button>
<div
id=
"js_article"
class=
"rich_media"
>
<div
class=
"rich_media_inner"
>
<div
id=
"page-content"
class=
"rich_media_area_primary"
>
...
...
src/app/my/article-detail/article-detail.component.ts
View file @
02bed373
...
...
@@ -65,8 +65,8 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
}
// 从后台获取到获取微信code的URL
getWxUserInfo
()
{
this
.
myService
.
getWxUserInfo
().
subscribe
(
res
=>
{
getWxUserInfo
(
trackId
)
{
this
.
myService
.
getWxUserInfo
(
trackId
).
subscribe
(
res
=>
{
if
(
res
[
'success'
])
{
this
.
paymentForm
=
res
[
'data'
].
paymentForm
;
this
.
getOrPost
(
this
.
paymentForm
.
action
,
this
.
paymentForm
.
param
,
this
.
paymentForm
.
charset
,
this
.
paymentForm
.
actionType
);
...
...
@@ -137,6 +137,9 @@ export class ArticleDetailComponent implements OnInit, OnDestroy {
};
this
.
myService
.
articleTrackSave
(
param
).
subscribe
(
res
=>
{
sessionStorage
.
setItem
(
'articleTrackId'
,
res
[
'data'
][
'id'
]);
if
(
this
.
lifeCommonService
.
getQueryString
(
'state'
)
!=
'1'
)
{
this
.
getWxUserInfo
(
res
[
'data'
][
'id'
]);
}
})
}
...
...
src/app/my/my.service.ts
View file @
02bed373
...
...
@@ -610,9 +610,9 @@ export class MyService {
/**
* 获取微信用户的详细信息
*/
getWxUserInfo
()
{
getWxUserInfo
(
trackId
)
{
const
url
=
this
.
API
+
'/getWxUserInfo'
;
const
cs
=
{};
const
cs
=
{
trackId
:
trackId
};
return
this
.
http
.
post
(
url
,
cs
).
pipe
((
res
)
=>
{
return
res
;
});
...
...
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