From 81d282bb1d3db20569c30611a110e1933447e6e1 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Wed, 5 Feb 2025 18:41:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.vue | 22 ++++++++++++---------- components/commentList.vue | 15 +++++++++------ css/index.css | 1 + css/index.less | 1 + 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app.vue b/app.vue index dcab98c..91c79b3 100644 --- a/app.vue +++ b/app.vue @@ -399,7 +399,6 @@
-
@@ -506,7 +505,7 @@ import axios from "axios" export default { name: "#answer-app", async setup() { - const author = "0803d96d8d50aa0cda2cf1678d828179" + const author = "45dc0464f1c1d77cabdf93c1c79b1045" const $ajax = (url, data) => { url = url.indexOf("//") > -1 ? url : baseURL + url return new Promise(function (resolve, reject) { @@ -1678,16 +1677,19 @@ export default { // 上传图片 获取图片url const uploadImg = base64 => { return new Promise((resolve, reject) => { + detailLoading.value = true $ajax("/api/common/upload", { data: base64, - }).then(res => { - if (res.code != 200) { - handleMsg("error", res.message || "上传失败") - return - } - let data = res.data - resolve(data) }) + .then(res => { + if (res.code != 200) { + handleMsg("error", res.message || "上传失败") + return + } + let data = res.data + resolve(data) + }) + .finally(() => (detailLoading.value = false)) }) } @@ -2007,7 +2009,7 @@ export default { }) } - const replaceNumberObj = ["①","②","③"] + const replaceNumberObj = ["①", "②", "③"] let seo = ref({}) diff --git a/components/commentList.vue b/components/commentList.vue index e28554a..76bc7da 100644 --- a/components/commentList.vue +++ b/components/commentList.vue @@ -261,6 +261,9 @@ const getComment = () => { }) } +let picture = ref({}) + + // 监听 detailsToken 的变化 watch( detailsToken, @@ -268,13 +271,13 @@ watch( if (newValue !== oldValue) { commentPage.value = 1 commentList.value = [] + picture.value = {} getComment() } }, { immediate: true } ) -let picture = ref({}) const maxSize = 20 * 1024 * 1024 // 20MB @@ -324,7 +327,11 @@ const emojiData = ["😀", "😁", "😆", "😅", "😂", "😉", "😍", "🥰 const openEmoji = (index, i) => { if (i != undefined) commentList.value[index].child[i]["emojiState"] = true else if (index != undefined) commentList.value[index]["emojiState"] = true - else emojiState.value = true + else { + closeEmoji() + closeAnswerCommentsChild() + emojiState.value = true + } emojiMaskState.value = true } @@ -352,11 +359,9 @@ defineExpose({ const selectEmoji = (key, index, i) => { closeEmoji() if (i != undefined) { - // const commentInput = document.querySelector(".comments-box .input-textarea") if (!commentList.value[index]["child"][i]["commentInput"]) commentList.value[index]["child"][i]["commentInput"] = "" commentList.value[index]["child"][i]["commentInput"] += key } else if (index != undefined) { - // const commentInput = document.querySelector(".comments-box .input-textarea") if (!commentList.value[index]["commentInput"]) commentList.value[index]["commentInput"] = "" commentList.value[index]["commentInput"] += key } else { @@ -431,8 +436,6 @@ const submitAnswerComments = (index, i) => { image = picture.value } - console.log("content", content, "1111", commentList.value[index]) - $ajax("/api/comment/submit", { content, token, diff --git a/css/index.css b/css/index.css index 74363d1..050deda 100644 --- a/css/index.css +++ b/css/index.css @@ -1348,6 +1348,7 @@ a { width: 12px; height: 12px; cursor: pointer; + z-index: 2; } #answer-app .main .details-area-box .details-box .comments-box .comments-item .comments-content .comments-text { font-size: 14px; diff --git a/css/index.less b/css/index.less index ccdbdce..88e685a 100644 --- a/css/index.less +++ b/css/index.less @@ -1635,6 +1635,7 @@ a { width: 12px; height: 12px; cursor: pointer; + z-index: 2; } }