fix: daily page
This commit is contained in:
18
pages.json
18
pages.json
@@ -1,5 +1,14 @@
|
||||
{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新春祝福",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/greeting/daily",
|
||||
"style": {
|
||||
@@ -16,15 +25,6 @@
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新春祝福",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/make/index",
|
||||
"style": {
|
||||
|
||||
@@ -138,7 +138,12 @@
|
||||
import { ref, computed, onMounted, watch } from "vue";
|
||||
import { getBavBarHeight } from "@/utils/system";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
import { onShareAppMessage } from "@dcloudio/uni-app";
|
||||
import {
|
||||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
onShow,
|
||||
onLoad,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -266,18 +271,43 @@ const saveCard = () => {
|
||||
// });
|
||||
// };
|
||||
|
||||
onShareAppMessage(() => {
|
||||
onShareAppMessage((res) => {
|
||||
const fromUser = userStore.userInfo?.nickName || "神秘好友";
|
||||
const fromAvatar = userStore.userInfo?.avatarUrl || "";
|
||||
return {
|
||||
title: `${fromUser}给你发来了一份今日问候`,
|
||||
path: `/pages/greeting/share?content=${encodeURIComponent(
|
||||
|
||||
// Log the share attempt and path
|
||||
console.log("Sharing daily greeting", {
|
||||
res,
|
||||
fromUser,
|
||||
content: currentQuote.value.text,
|
||||
});
|
||||
|
||||
const path = `/pages/greeting/share?content=${encodeURIComponent(
|
||||
currentQuote.value.text,
|
||||
)}&author=${encodeURIComponent(
|
||||
authorName.value || currentQuote.value.author,
|
||||
)}&fromUser=${encodeURIComponent(fromUser)}&fromAvatar=${encodeURIComponent(
|
||||
fromAvatar,
|
||||
)}`;
|
||||
|
||||
console.log("Share path:", path);
|
||||
|
||||
return {
|
||||
title: `${fromUser}给你发来了一份今日问候`,
|
||||
path: path,
|
||||
};
|
||||
});
|
||||
|
||||
onShareTimeline(() => {
|
||||
const fromUser = userStore.userInfo?.nickName || "神秘好友";
|
||||
return {
|
||||
title: `${fromUser}给你发来了一份今日问候`,
|
||||
query: `content=${encodeURIComponent(
|
||||
currentQuote.value.text,
|
||||
)}&author=${encodeURIComponent(
|
||||
authorName.value || currentQuote.value.author,
|
||||
)}`,
|
||||
imageUrl: "", // Optional: add a custom image if needed
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user