From bfdde46cc3481fccb6fba043517a29aacf18a397 Mon Sep 17 00:00:00 2001 From: huxuejian Date: Fri, 29 May 2026 15:27:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/message/article-detail.vue | 38 ++++++++++++++++++++++++++++---- pages/message/article-list.vue | 7 +++++- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pages/message/article-detail.vue b/pages/message/article-detail.vue index 2925580..ce8baee 100644 --- a/pages/message/article-detail.vue +++ b/pages/message/article-detail.vue @@ -22,7 +22,15 @@ @@ -63,7 +71,9 @@ const article = ref({}); const accountStore = useAccountStore(); const { doctorInfo, account } = storeToRefs(accountStore); const userId = computed(() => doctorInfo.value?.userid || ""); -const { useLoad } = useGuard() +const { useLoad } = useGuard(); +const canSend = ref(false); +const eventName = ref(""); const showStar = computed(() => { const isMine = article.value && article.value.creatorSignature && article.value.creatorSignature.person && article.value.creatorSignature.person.userId === userId.value; @@ -135,7 +145,8 @@ const loadArticle = async () => { } }; -async function star() { +async function starArticle() { + console.log(11111) showLoading(); const res = await api("starArticle", { articleId: articleId, userId: userId.value, star: !article.value.star }); hideLoading(); @@ -147,12 +158,19 @@ async function star() { } } +function send() { + uni.$emit(eventName.value); + back() +} + function back() { uni.navigateBack(); } useLoad((options) => { if (options.id) { + canSend.value = options.canSend === 'YES'; + eventName.value = options.eventName; articleId = options.id; loadArticle(); } else { @@ -244,4 +262,16 @@ useLoad((options) => { height: auto !important; display: block; } + +.ml-10 { + margin-left: 20rpx; +} + +.bg-deep-gray { + background-color: #bbb; +} + +.z-10 { + z-index: 10; +} diff --git a/pages/message/article-list.vue b/pages/message/article-list.vue index 9ff7b68..e64b956 100644 --- a/pages/message/article-list.vue +++ b/pages/message/article-list.vue @@ -281,9 +281,14 @@ const processRichTextContent = (html) => { // 预览文章 const previewArticle = async (article) => { + const eventName = `previewArticle_${Date.now()}` uni.navigateTo({ - url: `/pages/message/article-detail?id=${article._id}`, + url: `/pages/message/article-detail?id=${article._id}&eventName=${eventName}&canSend=${isSelectMode.value ? '' : 'YES'}`, }); + uni.$once(eventName, () => { + console.log('预览文章:', article) + handlePrimaryAction(article); + }) }; // 关闭预览