diff --git a/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue index 7a9d642..b3285d5 100644 --- a/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue +++ b/src/views/creative-generation-workshop/explore/detail/components/ai-suggest/index.vue @@ -74,23 +74,33 @@ export default { const isCollapse = ref(false); const comment = ref(''); const isReplay = ref(false); - const commentId = ref(undefined); + const replayTarget = ref({}); const deleteCommentModalRef = ref(null); + const closeReplay = () => { + isReplay.value = false; + replayTarget.value = {}; + }; + + const onReplay = (item) => { + isReplay.value = true; + replayTarget.value = item; + }; + const onComment = async () => { const { code, data } = await postShareWorksComments(props.dataSource.id, route.params.shareCode, { content: comment.value, - comment_id: commentId.value, + comment_id: replayTarget.value.id, }); if (code === 200) { emit('updateComment'); - comment.value = ''; + // comment.value = ''; } }; const onClearComment = () => { isReplay.value = false; - commentId.value = undefined; + replayTarget.value = {}; comment.value = ''; }; @@ -123,6 +133,98 @@ export default { deleteShareWorksComments(props.dataSource.id, comment_id, route.params.shareCode); }; + const renderTextareaBox = () => { + return ( +
+ 评论 + {props.dataSource.comments?.length > 0 && ( + {props.dataSource.comments?.length} + )} +
+- 评论 - {props.dataSource.comments?.length > 0 && ( - {props.dataSource.comments?.length} - )} -
-- {getCommentName(item)} - {formatRelativeTime(item.created_at)} -
- -{item.content}
-
+ {getCommentName(item)} + {formatRelativeTime(item.created_at)} +
+{item.content}
+