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;