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
ef88b594
Commit
ef88b594
authored
Mar 07, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改评论删除
parent
fdbfa0b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
29 deletions
+9
-29
articleDetail.vue
pagesArticle/articleDetail.vue
+9
-29
No files found.
pagesArticle/articleDetail.vue
View file @
ef88b594
...
...
@@ -17,10 +17,7 @@
<div
class=
"c-left"
>
<image
:src=
"info.avatarUrl"
></image>
</div>
<div
class=
"c-right"
@
touchstart=
"()=>handleTouchStart(info)"
@
touchend=
"()=>handleTouchEnd(info)"
>
<div
class=
"c-right"
@
click=
"()=>reply(info)"
>
<div
class=
"c-name"
>
{{
info
.
memNickName
}}
</div>
...
...
@@ -37,6 +34,9 @@
<image
@
click=
"()=>praise(info)"
:src=
"info.isLike == '0'? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"
></image>
{{
info
.
likeCount
}}
</div>
<view
v-if=
"articleInfo.createBy == userId || info.userId == userId"
class=
"action-item"
>
<image
@
click=
"()=>handleLongPress(info)"
:src=
" baseUrl+'/article/commentDelete.png'"
></image>
</view>
</div>
<view>
<view
...
...
@@ -48,10 +48,7 @@
<image
:src=
"children.avatarUrl"
></image>
</view>
<view
class=
"c-right"
@
touchstart
.
stop=
"()=>handleTouchStart(children)"
@
touchend=
"()=>handleTouchEnd(children)"
>
<view
class=
"c-right"
@
click
.
stop=
"()=>reply(children)"
>
<view
class=
"c-name"
>
{{
children
.
memNickName
}}
<view
style=
"color: #333; margin-top: 10rpx"
>
...
...
@@ -73,6 +70,9 @@
<image
@
click=
"()=>praise(children)"
:src=
"children.isLike == '0' ? baseUrl+'/article/105.png': baseUrl+'/article/105-no.png'"
></image>
{{
children
.
likeCount
}}
</view>
<view
v-if=
"articleInfo.createBy == userId || children.userId == userId"
class=
"action-item"
>
<image
@
click=
"()=>handleLongPress(children)"
:src=
" baseUrl+'/article/commentDelete.png'"
></image>
</view>
</view>
</view>
</view>
...
...
@@ -148,6 +148,7 @@ export default{
commentedUserId
:
null
,
//上级评论ID
parentId
:
null
,
userId
:
uni
.
getStorageSync
(
'userInfo'
).
businessId
,
tipMsg
:
''
,
isConfirm
:
false
,
isRejectConfirm
:
false
,
...
...
@@ -400,34 +401,13 @@ export default{
}
})
},
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