From 94f8883bd8eed12f37f37c543ca1380f92e75f1c Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 7 Jan 2025 16:30:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=88=86=E4=BA=AB=E4=BF=A1=E6=81=AF=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E4=BA=86=E6=B5=B7=E6=8A=A5=E4=BF=A1=E6=81=AF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=A0=81=E8=8E=B7=E5=8F=96=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/components/s-layout/s-layout.vue | 12 ++++++------ sheep/components/s-share-modal/s-share-modal.vue | 1 - sheep/platform/share.js | 9 +++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sheep/components/s-layout/s-layout.vue b/sheep/components/s-layout/s-layout.vue index 5bcd4c0d..e132ed5a 100644 --- a/sheep/components/s-layout/s-layout.vue +++ b/sheep/components/s-layout/s-layout.vue @@ -197,17 +197,17 @@ // 微信小程序分享好友 onShareAppMessage(() => { return { - title: shareInfo.value.title, - path: shareInfo.value.path, - imageUrl: shareInfo.value.image, + title: shareInfo.value.forward.title, + path: shareInfo.value.forward.path, + imageUrl: shareInfo.value.forward.image, }; }); // 微信小程序分享朋友圈 onShareTimeline(() => { return { - title: shareInfo.value.title, - query: shareInfo.value.path, - imageUrl: shareInfo.value.image, + title: shareInfo.value.forward.title, + query: shareInfo.value.forward.path, + imageUrl: shareInfo.value.forward.image, }; }); // #endif diff --git a/sheep/components/s-share-modal/s-share-modal.vue b/sheep/components/s-share-modal/s-share-modal.vue index 717940e6..0f0b92db 100644 --- a/sheep/components/s-share-modal/s-share-modal.vue +++ b/sheep/components/s-share-modal/s-share-modal.vue @@ -92,7 +92,6 @@ showAuthModal(); return; } - console.log(props.shareInfo); unref(SharePosterRef).getPoster(); state.showPosterModal = true; }; diff --git a/sheep/platform/share.js b/sheep/platform/share.js index c238e0e4..9b8f1cc5 100644 --- a/sheep/platform/share.js +++ b/sheep/platform/share.js @@ -35,6 +35,7 @@ const getShareInfo = ( link: '', // 分享Url+参数 query: '', // 分享参数 poster, // 海报所需数据 + forward: {} // 转发所需参数 }; const app = $store('app'); @@ -55,10 +56,10 @@ const getShareInfo = ( console.log('请在平台设置中配置默认转发信息'); } // 设置自定义分享信息 - shareInfo.title = scene.title || shareConfig.forwardInfo.title; - shareInfo.image = $url.cdn(scene.image || shareConfig.forwardInfo.image); - shareInfo.desc = scene.desc || shareConfig.forwardInfo.subtitle; - shareInfo.path = buildSpmPath(query); + shareInfo.forward.title = scene.title || shareConfig.forwardInfo.title; + shareInfo.forward.image = $url.cdn(scene.image || shareConfig.forwardInfo.image); + shareInfo.forward.desc = scene.desc || shareConfig.forwardInfo.subtitle; + shareInfo.forward.path = buildSpmPath(query); } return shareInfo;