From 84fbd98fa9fa28a2caf02231173273016a2b1d9b Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Mon, 18 Sep 2023 11:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=85=A8=E5=B1=80=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/articlesBox/articlesBox.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/articlesBox/articlesBox.tsx b/src/components/articlesBox/articlesBox.tsx index 60e4edb..f27a84d 100644 --- a/src/components/articlesBox/articlesBox.tsx +++ b/src/components/articlesBox/articlesBox.tsx @@ -30,6 +30,15 @@ const ArticlesBox: FC = (props) => { articlesEvent.off(data.id) }) + Taro.useDidShow(()=>{ + articlesEvent.recordsOn(data.id, ({view}) => { + setData({ + ...data, + page_view: view + }) + }) + }) + const toArticlePage = () => { Taro.navigateTo({ url: `/pages/preview/brand/article/article?id=${data.id}`