From 11fdfc16c6e49c6e3c9cba94028d2f87e5752dd4 Mon Sep 17 00:00:00 2001 From: "34701892@qq.com" <34701892@qq.com> Date: Fri, 26 Dec 2025 12:19:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=88=86=E4=BA=AB):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E8=AF=A6=E6=83=85=E9=A1=B5=E7=9A=84=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=88=86=E4=BA=AB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在indexNewsInfo.vue中添加微信小程序分享功能,包含用户类型、手机号和ID等信息。同时注释掉index.html中重复的分享代码以避免冲突。 --- index.html | 16 ++++++++-------- src/pages/detail/indexNewsInfo.vue | 13 +++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index c8d757c..e801852 100644 --- a/index.html +++ b/index.html @@ -19,14 +19,14 @@ console.log("🚀 ~ window.location.href:", window.location.href); const urlParams = parseUrlParams(); - wx.miniProgram.postMessage({ - data: { - type: "share_info", - userType: urlParams?.userType || null, - phone: urlParams?.phone || null, - id: urlParams?.id || null, - }, - }); + // wx.miniProgram.postMessage({ + // data: { + // type: "share_info", + // userType: urlParams?.userType || null, + // phone: urlParams?.phone || null, + // id: urlParams?.id || null, + // }, + // }); // const currentRoute = getCurrentRoute(); // console.log("当前纯路由地址:", currentRoute); // 输出:/pages/detail/indexNewsInfo diff --git a/src/pages/detail/indexNewsInfo.vue b/src/pages/detail/indexNewsInfo.vue index df153d0..d59775e 100644 --- a/src/pages/detail/indexNewsInfo.vue +++ b/src/pages/detail/indexNewsInfo.vue @@ -125,6 +125,19 @@ onLoad(async (option: any) => { columnName.value = res.data.columnName1; newList(res.data.columnId1); wxShare(); + + wx.miniProgram.postMessage({ + data: { + type: "share_info", + userType: option?.userType || null, + phone: option?.phone || null, + id: option?.id || null, + + path: "https://cankao.cs.com.cn/jnh/#/pages/detail/indexNewsInfo", + title: data.value.title, + imageUrl: "", + }, + }); } } if (option?.phone) {