From 4c6391053d727b834ae2e3126fd05256f3d0d877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Fri, 21 Nov 2025 14:52:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(cms):=20=E6=B7=BB=E5=8A=A0=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=86=85=E5=AE=B9=E6=94=AF=E6=8C=81=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=96=87=E7=AB=A0=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在文章详情页添加视频播放功能,支持视频宽度自适应 - 优化文章加载逻辑,确保内容存在时才进行解析 - 添加视频元素的条件渲染判断 --- src/cms/detail/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cms/detail/index.tsx b/src/cms/detail/index.tsx index f92c890..8d0c717 100644 --- a/src/cms/detail/index.tsx +++ b/src/cms/detail/index.tsx @@ -17,7 +17,7 @@ function Detail() { const reload = async () => { const item = await getCmsArticle(Number(params.id)) - if (item) { + if (item && item.content) { item.content = wxParse(item.content) setItem(item) Taro.setNavigationBarTitle({ @@ -43,6 +43,10 @@ function Detail() {
{item?.title}
{item?.createTime}
+ {/*如果有视频就显示视频 视频沾满宽度*/} + {item?.video && + + }