添加首页分享
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { onShow, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import AppFooter from "@/components/AppFooter.vue";
|
||||
import AppBackground from "@/components/AppBackground.vue";
|
||||
@@ -97,6 +97,21 @@ const comingSoon = () => {
|
||||
icon: "none",
|
||||
});
|
||||
};
|
||||
|
||||
onShareAppMessage(() => {
|
||||
return {
|
||||
title: "快来和我一起玩射箭!", // 分享卡片的标题
|
||||
path: "/pages/index", // 用户点击分享卡片后跳转的页面路径
|
||||
imageUrl: "/static/share-bg.png", // 分享卡片的配图,可以是本地或网络图片
|
||||
};
|
||||
});
|
||||
onShareTimeline(() => {
|
||||
return {
|
||||
title: "我发现了一个超好玩的射箭小程序,一起来玩吧!", // 分享到朋友圈的标题
|
||||
query: "from=timeline", // 用户通过朋友圈点击后,在页面 onShow 的 options 中可以获取到的参数
|
||||
imageUrl: "/static/share-bg.png", // 分享到朋友圈的配图
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user