Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
736a59cb
Commit
736a59cb
authored
Jan 21, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了动态点赞bug
parent
792b0dce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
index.js
api/article/index.js
+2
-2
List.vue
pages/components/article/List.vue
+3
-1
articleDetail.vue
pagesArticle/articleDetail.vue
+3
-3
No files found.
api/article/index.js
View file @
736a59cb
...
@@ -22,7 +22,7 @@ export function publishArticle(data) {
...
@@ -22,7 +22,7 @@ export function publishArticle(data) {
// 动态点赞
// 动态点赞
export
function
like
(
data
)
{
export
function
like
(
data
)
{
return
request
({
return
request
({
url
:
'/app/opmArticle/like?articleId='
+
data
.
i
d
+
'&praiseType='
+
data
.
praiseType
,
url
:
'/app/opmArticle/like?articleId='
+
data
.
articleI
d
+
'&praiseType='
+
data
.
praiseType
,
data
:
{},
data
:
{},
method
:
'POST'
,
method
:
'POST'
,
})
})
...
@@ -31,7 +31,7 @@ export function like(data) {
...
@@ -31,7 +31,7 @@ export function like(data) {
// 评论点赞
// 评论点赞
export
function
likeComment
(
data
)
{
export
function
likeComment
(
data
)
{
return
request
({
return
request
({
url
:
'/app/opmArticle/likeComment?
articleId='
+
data
.
id
+
'&praiseType='
+
data
.
praiseType
,
url
:
'/app/opmArticle/likeComment?
commentId='
+
data
.
commentId
+
'&praiseType='
+
data
.
praiseType
,
data
:
{},
data
:
{},
method
:
'POST'
,
method
:
'POST'
,
})
})
...
...
pages/components/article/List.vue
View file @
736a59cb
...
@@ -90,9 +90,11 @@
...
@@ -90,9 +90,11 @@
console
.
log
(
'this.tabIndex:'
,
this
.
tabIndex
)
console
.
log
(
'this.tabIndex:'
,
this
.
tabIndex
)
if
(
newVal
===
this
.
tabIndex
)
{
if
(
newVal
===
this
.
tabIndex
)
{
if
(
newVal
===
0
){
if
(
newVal
===
0
){
//关注
this
.
articleType
=
'0'
this
.
articleType
=
'0'
}
}
if
(
newVal
===
2
){
if
(
newVal
===
2
){
//话题
this
.
getTopicList
()
this
.
getTopicList
()
}
}
// 懒加载,当滑动到当前的item时,才去加载
// 懒加载,当滑动到当前的item时,才去加载
...
@@ -267,7 +269,7 @@
...
@@ -267,7 +269,7 @@
item
.
likeCount
+=
1
item
.
likeCount
+=
1
}
}
const
params
=
{
const
params
=
{
i
d
:
item
.
businessId
,
articleI
d
:
item
.
businessId
,
praiseType
:
type
praiseType
:
type
}
}
like
(
params
).
then
(
res
=>
{
like
(
params
).
then
(
res
=>
{
...
...
pagesArticle/articleDetail.vue
View file @
736a59cb
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<!--
{{
children
.
replyCount
}}
-->
<!--
{{
children
.
replyCount
}}
-->
</view>
</view>
<view
class=
"action-item"
>
<view
class=
"action-item"
>
<image
@
click=
"()=>praise(children)"
:src=
"children.isLike == '0'? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"
></image>
<image
@
click=
"()=>praise(children)"
:src=
"children.isLike == '0'
? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"
></image>
{{
children
.
likeCount
}}
{{
children
.
likeCount
}}
</view>
</view>
</view>
</view>
...
@@ -157,7 +157,7 @@ export default{
...
@@ -157,7 +157,7 @@ export default{
},
},
// 点赞
// 点赞
praise
(
item
)
{
praise
(
item
)
{
console
.
log
(
'
1111111'
,
item
)
console
.
log
(
'
item'
,
item
)
var
type
=
''
var
type
=
''
if
(
item
.
isLike
==
'1'
)
{
if
(
item
.
isLike
==
'1'
)
{
//取消点赞
//取消点赞
...
@@ -167,7 +167,7 @@ export default{
...
@@ -167,7 +167,7 @@ export default{
type
=
'praise'
type
=
'praise'
}
}
const
params
=
{
const
params
=
{
i
d
:
item
.
businessId
,
commentI
d
:
item
.
businessId
,
praiseType
:
type
praiseType
:
type
}
}
likeComment
(
params
).
then
(
res
=>
{
likeComment
(
params
).
then
(
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