fix: comment rick
This commit is contained in:
@@ -446,11 +446,18 @@ const submitMainComment = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
sending.value = true;
|
sending.value = true;
|
||||||
await props.publishHandler({
|
const res = await props.publishHandler({
|
||||||
content,
|
content,
|
||||||
mode: "comment",
|
mode: "comment",
|
||||||
replyTarget: null,
|
replyTarget: null,
|
||||||
});
|
});
|
||||||
|
if(res?.success === false) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res?.message || '发布失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (props.showSuccessToast) {
|
if (props.showSuccessToast) {
|
||||||
uni.showToast({ title: props.mainSuccessText, icon: "none" });
|
uni.showToast({ title: props.mainSuccessText, icon: "none" });
|
||||||
}
|
}
|
||||||
@@ -493,11 +500,18 @@ const submitReplyComment = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
sendingReply.value = true;
|
sendingReply.value = true;
|
||||||
await props.publishHandler({
|
const res = await props.publishHandler({
|
||||||
content,
|
content,
|
||||||
mode: "reply",
|
mode: "reply",
|
||||||
replyTarget: replyTarget.value,
|
replyTarget: replyTarget.value,
|
||||||
});
|
});
|
||||||
|
if(res?.success === false) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res?.message || '回复失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (props.showSuccessToast) {
|
if (props.showSuccessToast) {
|
||||||
uni.showToast({ title: props.replySuccessText, icon: "none" });
|
uni.showToast({ title: props.replySuccessText, icon: "none" });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,13 +371,19 @@ const handleSendComment = async (payload) => {
|
|||||||
try {
|
try {
|
||||||
isSendingComment.value = true;
|
isSendingComment.value = true;
|
||||||
uni.showLoading({ title: '发送中...' });
|
uni.showLoading({ title: '发送中...' });
|
||||||
await publishTopicComment({
|
const res = await publishTopicComment({
|
||||||
content: payload.content,
|
content: payload.content,
|
||||||
mode: 'comment',
|
mode: 'comment',
|
||||||
replyTarget: null
|
replyTarget: null
|
||||||
});
|
});
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
if(res?.success === false) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res?.message || '发送失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleCommentPublished({
|
handleCommentPublished({
|
||||||
mode: 'comment',
|
mode: 'comment',
|
||||||
content: payload.content,
|
content: payload.content,
|
||||||
|
|||||||
Reference in New Issue
Block a user