From b9c12e0deb1908a097733607c7270bcff93eccfa Mon Sep 17 00:00:00 2001 From: huxuejian Date: Tue, 3 Mar 2026 15:46:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E9=98=85=E8=AF=BB=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/article/article-detail.vue | 6 +++--- pages/article/article-list.vue | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/article/article-detail.vue b/pages/article/article-detail.vue index 4de34d3..a6f58fe 100644 --- a/pages/article/article-detail.vue +++ b/pages/article/article-detail.vue @@ -45,13 +45,13 @@ const articleData = ref({ let articleId = ""; const corpId = ref(""); -const markArticleRead = async () => { +const markArticleRead = async (sendId) => { const unionid = account.value?.unionid; if (!unionid || !articleId) return; try { await api( "addArticleReadRecord", - { corpId: corpId.value, articleId, unionid }, + { corpId: corpId.value, articleId, unionid, sendId }, false ); } catch (err) { @@ -130,7 +130,7 @@ onLoad((options) => { corpId.value = options.corpId; if (options.id) { articleId = options.id; - markArticleRead(); + markArticleRead(options.sendId || ''); loadArticle(); } else { error.value = "文章信息不完整"; diff --git a/pages/article/article-list.vue b/pages/article/article-list.vue index 88341a5..f37adaf 100644 --- a/pages/article/article-list.vue +++ b/pages/article/article-list.vue @@ -98,6 +98,7 @@ const pageSize = 20; const loading = ref(false); const inited = ref(false); const corpId = ref(''); +const teamId = ref(''); const selectTab = async (customerId) => { if (activeTab.value === customerId) return; @@ -139,6 +140,7 @@ const mapRowToView = (row) => { }; const loadArticleList = async (reset = false) => { + const customerIds = tabs.value.map(i => i.value).filter(Boolean); if (loading.value) return; const unionid = account.value?.unionid; const miniAppId = openid.value || uni.getStorageSync("openid"); @@ -152,6 +154,12 @@ const loadArticleList = async (reset = false) => { articles.value = []; total.value = 0; } + if (customerIds.length === 0) { + page.value = 1; + articles.value = []; + total.value = 0; + return + } loading.value = true; try { @@ -161,8 +169,9 @@ const loadArticleList = async (reset = false) => { miniAppId, page: page.value, pageSize, + customerIds }; - if (activeTab.value) params.customerId = activeTab.value; + if (activeTab.value) params.customerIds = [activeTab.value]; const res = await api("getMiniAppReceivedArticleList", params); if (res && res.success) { @@ -184,10 +193,11 @@ const loadArticleList = async (reset = false) => { function goToDetail(item) { if (!item?.articleId) return; - uni.navigateTo({ url: `/pages/article/article-detail?id=${item.articleId}&corpId=${corpId.value}` }); + uni.navigateTo({ url: `/pages/article/article-detail?sendId=${item._id}&id=${item.articleId}&corpId=${corpId.value}` }); } onLoad(opts => { corpId.value = opts.corpId; + teamId.value = opts.teamId; }) onShow(async () => {