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
4dd63ce1
Commit
4dd63ce1
authored
Mar 06, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改评论删除
parent
1a397e22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
index.js
api/article/index.js
+9
-0
articleDetail.vue
pagesArticle/articleDetail.vue
+64
-3
No files found.
api/article/index.js
View file @
4dd63ce1
...
@@ -78,4 +78,13 @@ export function delArticle(id) {
...
@@ -78,4 +78,13 @@ export function delArticle(id) {
method
:
'delete'
,
method
:
'delete'
,
headers
:
{}
headers
:
{}
})
})
}
//删除评论
export
function
deleteComment
(
data
)
{
return
request
({
url
:
'/app/deleteComment/'
+
data
.
bussinessId
,
method
:
'delete'
,
data
:
data
})
}
}
\ No newline at end of file
pagesArticle/articleDetail.vue
View file @
4dd63ce1
...
@@ -17,7 +17,10 @@
...
@@ -17,7 +17,10 @@
<div
class=
"c-left"
>
<div
class=
"c-left"
>
<image
:src=
"info.avatarUrl"
></image>
<image
:src=
"info.avatarUrl"
></image>
</div>
</div>
<div
class=
"c-right"
@
click=
"()=>reply(info)"
>
<div
class=
"c-right"
@
touchstart=
"()=>handleTouchStart(info)"
@
touchend=
"()=>handleTouchEnd(info)"
>
<div
class=
"c-name"
>
<div
class=
"c-name"
>
{{
info
.
memNickName
}}
{{
info
.
memNickName
}}
</div>
</div>
...
@@ -45,7 +48,10 @@
...
@@ -45,7 +48,10 @@
<image
:src=
"children.avatarUrl"
></image>
<image
:src=
"children.avatarUrl"
></image>
</view>
</view>
<view
class=
"c-right"
@
click
.
stop=
"()=>reply(children)"
>
<view
class=
"c-right"
@
touchstart
.
stop=
"()=>handleTouchStart(children)"
@
touchend=
"()=>handleTouchEnd(children)"
>
<view
class=
"c-name"
>
<view
class=
"c-name"
>
{{
children
.
memNickName
}}
{{
children
.
memNickName
}}
<view
style=
"color: #333; margin-top: 10rpx"
>
<view
style=
"color: #333; margin-top: 10rpx"
>
...
@@ -109,12 +115,13 @@
...
@@ -109,12 +115,13 @@
</view>
</view>
<ELM
ref=
"elm"
:msg=
"tipMsg"
:isConfirm=
"isConfirm"
confirmName=
"认证"
@
confirm=
"confirm"
></ELM>
<ELM
ref=
"elm"
:msg=
"tipMsg"
:isConfirm=
"isConfirm"
confirmName=
"认证"
@
confirm=
"confirm"
></ELM>
<ELM
ref=
"elmReject"
:msg=
"tipMsg"
:isConfirm=
"isRejectConfirm"
:isCancel=
"false"
@
confirm=
"rejectConfirm"
></ELM>
<ELM
ref=
"elmReject"
:msg=
"tipMsg"
:isConfirm=
"isRejectConfirm"
:isCancel=
"false"
@
confirm=
"rejectConfirm"
></ELM>
<ELM
ref=
"elmDelete"
:msg=
"tipMsg"
:isConfirm=
"isDeleteConfirm"
confirmName=
"删除"
@
confirm=
"deleteConfirm"
></ELM>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
ArticleItem
from
'./components/articleItem.vue'
import
ArticleItem
from
'./components/articleItem.vue'
import
{
articleDetail
,
comment
,
getOssUrl
,
likeComment
}
from
'../api/article/index'
import
{
articleDetail
,
comment
,
deleteComment
,
getOssUrl
,
likeComment
}
from
'../api/article/index'
import
{
getCity
,
getValue
}
from
"../common/options"
;
import
{
getCity
,
getValue
}
from
"../common/options"
;
import
{
calculateAge
,
parseDate
}
from
"../common"
;
import
{
calculateAge
,
parseDate
}
from
"../common"
;
import
{
isStopAccount
,
userDetail
}
from
"../api/user"
;
import
{
isStopAccount
,
userDetail
}
from
"../api/user"
;
...
@@ -144,6 +151,11 @@ export default{
...
@@ -144,6 +151,11 @@ export default{
tipMsg
:
''
,
tipMsg
:
''
,
isConfirm
:
false
,
isConfirm
:
false
,
isRejectConfirm
:
false
,
isRejectConfirm
:
false
,
isDeleteConfirm
:
false
,
deleteId
:
''
,
deleteParentId
:
''
,
longPressedItem
:
null
,
longPressTimeout
:
null
,
}
}
},
},
onLoad
(
params
){
onLoad
(
params
){
...
@@ -293,6 +305,9 @@ export default{
...
@@ -293,6 +305,9 @@ export default{
}
}
},
},
getArticleDetail
(){
getArticleDetail
(){
this
.
commentPlaceholder
=
'走心,说点好听的.....'
this
.
commentedUserId
=
null
this
.
parentId
=
null
articleDetail
(
this
.
articleId
).
then
(
res
=>
{
articleDetail
(
this
.
articleId
).
then
(
res
=>
{
this
.
articleInfo
=
res
.
data
.
data
this
.
articleInfo
=
res
.
data
.
data
//处理动态图片
//处理动态图片
...
@@ -367,6 +382,52 @@ export default{
...
@@ -367,6 +382,52 @@ export default{
},
},
rejectConfirm
(){
rejectConfirm
(){
this
.
isRejectConfirm
=
false
;
this
.
isRejectConfirm
=
false
;
},
deleteConfirm
(){
const
params
=
{
bussinessId
:
this
.
deleteId
,
parentId
:
this
.
deleteParentId
,
articleId
:
this
.
articleInfo
.
businessId
}
deleteComment
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
this
.
getArticleDetail
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
}
})
},
handleTouchStart
(
item
)
{
// 清除之前的定时器
if
(
this
.
longPressTimeout
!==
null
)
clearTimeout
(
this
.
longPressTimeout
);
// 设置新的定时器
this
.
longPressTimeout
=
setTimeout
(()
=>
{
this
.
reply
(
item
);
// 处理点击事件逻辑
},
100
);
// 设置长按时间为1秒
this
.
longPressTimeout
=
setTimeout
(()
=>
{
this
.
handleLongPress
(
item
);
// 处理长按逻辑
},
1000
);
// 设置长按时间为1秒
},
handleTouchEnd
()
{
// 清除定时器,因为手指离开屏幕即取消长按
if
(
this
.
longPressTimeout
!==
null
)
{
clearTimeout
(
this
.
longPressTimeout
);
this
.
longPressTimeout
=
null
;
}
},
handleLongPress
(
item
)
{
if
(
this
.
articleInfo
.
createBy
==
uni
.
getStorageSync
(
'userInfo'
).
businessId
||
item
.
userId
==
uni
.
getStorageSync
(
'userInfo'
).
businessId
)
{
this
.
longPressedItem
=
item
;
this
.
deleteId
=
item
.
businessId
;
this
.
deleteParentId
=
item
.
parentId
;
this
.
tipMsg
=
'是否删除当前评论'
;
this
.
isDeleteConfirm
=
true
;
this
.
$refs
.
elmDelete
.
showDialog
();
}
}
}
}
}
}
}
...
...
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