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
e6f02939
Commit
e6f02939
authored
May 11, 2021
by
sunchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跟踪用户信息
parent
c7af2c1c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
104 additions
and
15 deletions
+104
-15
src/app/common/life-common.service.ts
+14
-0
src/app/my/article-read/article-read.component.html
+6
-5
src/app/my/article-read/article-read.component.scss
+9
-1
src/app/my/article-read/article-read.component.ts
+38
-2
src/app/my/article/article.component.html
+7
-3
src/app/my/article/article.component.scss
+3
-0
src/app/my/article/article.component.ts
+19
-4
src/app/my/my.service.ts
+8
-0
No files found.
src/app/common/life-common.service.ts
View file @
e6f02939
...
@@ -548,4 +548,18 @@ export class LifeCommonService {
...
@@ -548,4 +548,18 @@ export class LifeCommonService {
}
}
return
str
;
return
str
;
}
}
//判断是否为空
isEmpty
(
date
)
{
if
(
date
==
null
||
date
==
undefined
||
date
==
""
||
date
==
"null"
||
date
==
[]
)
{
return
"暂无"
;
}
return
date
;
}
}
}
src/app/my/article-read/article-read.component.html
View file @
e6f02939
...
@@ -5,14 +5,14 @@
...
@@ -5,14 +5,14 @@
<li>
性别
</li>
<li>
性别
</li>
<li>
阅读时间
</li>
<li>
阅读时间
</li>
</ul>
</ul>
<ul>
<ul
*
ngFor=
"let readerItem of readerList"
>
<li>
<li>
<div
class=
"headimg"
>
<div
class=
"headimg"
>
<img
src=
"
/assets/images/icons/meng.png
"
alt=
"头像"
>
<img
src=
"
{{getDefaultHead(readerItem.imagePath)}}
"
alt=
"头像"
>
</div>
</div>
</li>
</li>
<li>
曲终人未散
</li>
<li>
{{lifeCommonService.isEmpty(readerItem.nickName)}}
</li>
<li>
女
</li>
<li>
{{getGender(readerItem.gender)}}
</li>
<li>
2021-05-08 11:41
</li>
<li>
{{readerItem.trackInTime.substr(0,16)}}
</li>
</ul>
</ul>
</div>
</div>
\ No newline at end of file
src/app/my/article-read/article-read.component.scss
View file @
e6f02939
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
margin-bottom
:
10px
;
li
{
li
{
height
:
45px
;
height
:
45px
;
line-height
:
45px
;
line-height
:
45px
;
...
@@ -16,13 +17,19 @@
...
@@ -16,13 +17,19 @@
margin
:
0
auto
;
margin
:
0
auto
;
overflow
:
hidden
;
overflow
:
hidden
;
border-radius
:
50%
;
border-radius
:
50%
;
img
{
border-radius
:
50%
;
}
}
}
}
}
li
:nth-child
(
1
)
{
width
:
18%
;
}
li
:nth-child
(
3
)
{
li
:nth-child
(
3
)
{
width
:
10%
;
width
:
10%
;
}
}
li
:nth-child
(
4
)
{
li
:nth-child
(
4
)
{
width
:
3
0
%
;
width
:
3
5
%
;
}
}
}
}
}
}
\ No newline at end of file
src/app/my/article-read/article-read.component.ts
View file @
e6f02939
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
MyService
}
from
'../../my/my.service'
;
import
{
ActivatedRoute
,
Router
}
from
"@angular/router"
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
@
Component
({
@
Component
({
selector
:
'ydlife-article-read'
,
selector
:
'ydlife-article-read'
,
...
@@ -6,10 +9,43 @@ import { Component, OnInit } from '@angular/core';
...
@@ -6,10 +9,43 @@ import { Component, OnInit } from '@angular/core';
styleUrls
:
[
'./article-read.component.scss'
]
styleUrls
:
[
'./article-read.component.scss'
]
})
})
export
class
ArticleReadComponent
implements
OnInit
{
export
class
ArticleReadComponent
implements
OnInit
{
articleId
:
any
;
constructor
()
{
}
practitionerId
:
any
;
readerList
:
Array
<
any
>
;
constructor
(
public
activatedRoute
:
ActivatedRoute
,
private
myService
:
MyService
,
public
lifeCommonService
:
LifeCommonService
,
private
router
:
Router
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
articleId
=
this
.
activatedRoute
.
snapshot
.
params
[
'id'
];
this
.
practitionerId
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))[
'practitionerId'
];
this
.
articleTrackQuery
();
}
articleTrackQuery
(){
this
.
myService
.
articleTrackQuery
(
this
.
practitionerId
,
this
.
articleId
).
subscribe
((
res
)
=>
{
if
(
res
[
'success'
]){
this
.
readerList
=
res
[
'data'
][
'articleTrackQueryInfos'
];
}
})
}
}
//获取默认头像
getDefaultHead
(
headImagePath
){
if
(
!
headImagePath
){
return
'assets/images/icons/meng.png'
;
}
else
{
return
headImagePath
;
}
}
//判断性别
getGender
(
sex
){
if
(
!
sex
){
return
'暂无'
}
else
{
return
sex
==
1
?
'男'
:
'女'
}
}
}
}
src/app/my/article/article.component.html
View file @
e6f02939
...
@@ -19,9 +19,13 @@
...
@@ -19,9 +19,13 @@
<div
class=
"right"
(
click
)="
articleDetail
(
articleItem
)"
>
<div
class=
"right"
(
click
)="
articleDetail
(
articleItem
)"
>
<img
[
src
]="
articleItem
.
coverUrl
"
>
<img
[
src
]="
articleItem
.
coverUrl
"
>
</div>
</div>
<div
class=
"read"
(
click
)="
whoRead
(
articleItem
)"
>
<div
class=
"read"
>
<span>
72人已阅读
</span>
<span>
总阅读量:{{articleItem.totalNum}}
</span>
<span
class=
"iconfont icon-ar-r"
></span></div>
<div
(
click
)="
whoRead
(
articleItem
)"
>
<span>
个人分享阅读量:{{articleItem.num}}
</span>
<span
class=
"iconfont icon-ar-r"
></span>
</div>
</div>
</li>
</li>
<div
class=
"more"
*
ngIf=
"paginationInfo?.pageNum<totalPage"
(
click
)="
lookMore
()"
>
<div
class=
"more"
*
ngIf=
"paginationInfo?.pageNum<totalPage"
(
click
)="
lookMore
()"
>
查看更多
查看更多
...
...
src/app/my/article/article.component.scss
View file @
e6f02939
...
@@ -37,12 +37,14 @@
...
@@ -37,12 +37,14 @@
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
.right
{
.right
{
width
:
40%
;
width
:
40%
;
margin-bottom
:
10px
;
img
{
img
{
border-radius
:
8px
;
border-radius
:
8px
;
}
}
}
}
.left
{
.left
{
width
:
55%
;
width
:
55%
;
margin-bottom
:
10px
;
.title
{
.title
{
color
:
#333333
;
color
:
#333333
;
font-size
:
16px
;
font-size
:
16px
;
...
@@ -58,6 +60,7 @@
...
@@ -58,6 +60,7 @@
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
baseline
;
align-items
:
baseline
;
width
:
100%
;
}
}
}
}
li
:last-child
{
li
:last-child
{
...
...
src/app/my/article/article.component.ts
View file @
e6f02939
...
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
...
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import
{
MyService
}
from
'../../my/my.service'
;
import
{
MyService
}
from
'../../my/my.service'
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
LifeCommonService
}
from
'../../common/life-common.service'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
parse
}
from
'querystring
'
;
import
{
ModalService
,
ToastService
}
from
'ng-zorro-antd-mobile
'
;
@
Component
({
@
Component
({
selector
:
'ydlife-article'
,
selector
:
'ydlife-article'
,
...
@@ -15,7 +15,12 @@ export class ArticleComponent implements OnInit {
...
@@ -15,7 +15,12 @@ export class ArticleComponent implements OnInit {
paginationInfo
:
any
;
paginationInfo
:
any
;
articleList
:
Array
<
any
>
;
articleList
:
Array
<
any
>
;
totalPage
:
number
;
totalPage
:
number
;
constructor
(
private
myService
:
MyService
,
public
lifeCommonService
:
LifeCommonService
,
private
router
:
Router
)
{
practitionerId
:
any
;
constructor
(
private
myService
:
MyService
,
public
lifeCommonService
:
LifeCommonService
,
private
router
:
Router
,
private
_modal
:
ModalService
,
private
_toast
:
ToastService
)
{
this
.
paginationInfo
=
{
this
.
paginationInfo
=
{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
5
pageSize
:
5
...
@@ -23,6 +28,7 @@ export class ArticleComponent implements OnInit {
...
@@ -23,6 +28,7 @@ export class ArticleComponent implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
practitionerId
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
))[
'practitionerId'
];
this
.
dropOptionsQuery
();
this
.
dropOptionsQuery
();
}
}
...
@@ -50,7 +56,8 @@ export class ArticleComponent implements OnInit {
...
@@ -50,7 +56,8 @@ export class ArticleComponent implements OnInit {
practitionerFileSharingList
(
flag
){
practitionerFileSharingList
(
flag
){
const
param
=
{
const
param
=
{
mdDropOptionId
:
this
.
mdDropOptionId
,
mdDropOptionId
:
this
.
mdDropOptionId
,
practitionerFileShares
:
this
.
paginationInfo
practitionerFileShares
:
this
.
paginationInfo
,
practitionerId
:
this
.
practitionerId
}
}
this
.
myService
.
practitionerFileSharingList
(
param
).
subscribe
((
res
)
=>
{
this
.
myService
.
practitionerFileSharingList
(
param
).
subscribe
((
res
)
=>
{
if
(
res
[
'success'
]){
if
(
res
[
'success'
]){
...
@@ -78,6 +85,14 @@ export class ArticleComponent implements OnInit {
...
@@ -78,6 +85,14 @@ export class ArticleComponent implements OnInit {
}
}
whoRead
(
articleItem
){
whoRead
(
articleItem
){
this
.
router
.
navigate
([
'/article_read'
,
articleItem
.
id
])
if
(
articleItem
.
num
>
0
){
this
.
router
.
navigate
([
'/article_read'
,
articleItem
.
id
])
}
else
{
const
toast
=
ToastService
.
show
(
'暂时无人阅读您分享的文章!'
,
0
);
setTimeout
(()
=>
{
ToastService
.
hide
();
},
3000
);
return
;
}
}
}
}
}
src/app/my/my.service.ts
View file @
e6f02939
...
@@ -633,4 +633,12 @@ export class MyService {
...
@@ -633,4 +633,12 @@ export class MyService {
return
res
;
return
res
;
});
});
}
}
//用户信息跟踪
articleTrackQuery
(
practitionerId
,
sharingId
){
const
url
=
this
.
ydapi
+
'/practitionerArticle/articleTrackQuery?practitionerId='
+
practitionerId
+
'&sharingId='
+
sharingId
;
return
this
.
http
.
get
(
url
).
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