fix: share reward
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||
import { getPageDetail } from "@/api/system.js";
|
||||
import { getPageDetail, getShareReward } from "@/api/system";
|
||||
import { getAvatarRecommendList } from "@/api/avatar.js";
|
||||
import { getShareToken, saveViewRequest } from "@/utils/common.js";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
@@ -147,6 +147,7 @@ onLoad((options) => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const token = await getShareToken("avatar_download", detailData.value?.id);
|
||||
getShareReward({ scene: "avatar_download" });
|
||||
return {
|
||||
title: "快来看看我刚领到的新年专属头像 🎊",
|
||||
path: `/pages/avatar/detail?shareToken=${token}`,
|
||||
|
||||
@@ -132,7 +132,7 @@ import {
|
||||
onShareAppMessage,
|
||||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { getPageDetail } from "@/api/system.js";
|
||||
import { getPageDetail, getShareReward } from "@/api/system";
|
||||
import { getShareToken, saveViewRequest } from "@/utils/common.js";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
|
||||
@@ -194,6 +194,7 @@ onUnload(() => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const token = await getShareToken("card_generate", cardDetail.value?.id);
|
||||
getShareReward({ scene: "card_generate" });
|
||||
return {
|
||||
title: "送你一张精美的新春祝福卡片 🎊",
|
||||
path: `/pages/detail/index?shareToken=${token || ""}`,
|
||||
|
||||
@@ -137,7 +137,12 @@ import {
|
||||
onShow,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { getBavBarHeight } from "@/utils/system";
|
||||
import { getRecommendList, getRandomGreeting, getTipsList } from "@/api/system";
|
||||
import {
|
||||
getRecommendList,
|
||||
getRandomGreeting,
|
||||
getTipsList,
|
||||
getShareReward,
|
||||
} from "@/api/system";
|
||||
import { getShareToken, saveViewRequest, trackRecord } from "@/utils/common.js";
|
||||
|
||||
const countdownText = ref("");
|
||||
@@ -210,6 +215,7 @@ onLoad((options) => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const shareToken = await getShareToken("index");
|
||||
getShareReward({ scene: "index" });
|
||||
return {
|
||||
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
|
||||
path: `/pages/index/index?shareToken=${shareToken}`,
|
||||
|
||||
@@ -300,9 +300,11 @@ import {
|
||||
watchAdReward,
|
||||
getRandomRecommendList,
|
||||
getCardSpecialTopic,
|
||||
getShareReward,
|
||||
} from "@/api/system";
|
||||
import { getUserSignInfo, userSignIn, getUserLuckInfo } from "@/api/user";
|
||||
import calendar from "@/utils/lunar";
|
||||
import { getShareToken } from "@/utils/common.js";
|
||||
|
||||
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
|
||||
import LuckyPopup from "@/components/LuckyPopup/LuckyPopup.vue";
|
||||
@@ -581,10 +583,16 @@ const handleAdReward = async (token) => {
|
||||
}
|
||||
};
|
||||
|
||||
onShareAppMessage(() => {
|
||||
onShareAppMessage(async () => {
|
||||
const shareToken = await getShareToken("index");
|
||||
getShareReward().then((res) => {
|
||||
if (isLoggedIn && res && res.success) {
|
||||
userStore.fetchUserAssets();
|
||||
}
|
||||
});
|
||||
return {
|
||||
title: "开启你的2026新春好运!",
|
||||
path: "/pages/index/index",
|
||||
path: "/pages/index/index?shareToken=" + shareToken,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -103,6 +103,7 @@ import {
|
||||
import { getMyCard } from "@/api/mine.js";
|
||||
import NavBar from "@/components/NavBar/NavBar.vue";
|
||||
import { getShareToken, trackRecord } from "@/utils/common.js";
|
||||
import { getShareReward } from "@/api/system";
|
||||
|
||||
const list = ref([]);
|
||||
const page = ref(1);
|
||||
@@ -134,6 +135,7 @@ onShareAppMessage(async (options) => {
|
||||
"card_generate",
|
||||
options?.target?.dataset?.item?.id,
|
||||
);
|
||||
getShareReward({ scene: "card_generate" });
|
||||
return {
|
||||
title: "我刚做了一张祝福卡片,送给你",
|
||||
path: "/pages/detail/index?shareToken=" + shareToken,
|
||||
@@ -142,6 +144,7 @@ onShareAppMessage(async (options) => {
|
||||
};
|
||||
} else {
|
||||
const shareToken = await getShareToken("greeting_page", "");
|
||||
getShareReward({ scene: "greeting_page" });
|
||||
return {
|
||||
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
|
||||
path: `/pages/index/index?shareToken=${shareToken}`,
|
||||
|
||||
@@ -138,6 +138,7 @@ import { ref, computed, onMounted } from "vue";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
import { onShareAppMessage } from "@dcloudio/uni-app";
|
||||
import { getShareToken, trackRecord } from "@/utils/common";
|
||||
import { getShareReward } from "@/api/system";
|
||||
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -174,6 +175,7 @@ onMounted(() => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const shareToken = await getShareToken("mine");
|
||||
getShareReward({ scene: "mine" });
|
||||
return {
|
||||
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
|
||||
path: "/pages/index/index?shareToken=" + shareToken,
|
||||
|
||||
@@ -119,6 +119,7 @@ import {
|
||||
onShareTimeline,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { getBavBarHeight } from "@/utils/system";
|
||||
import { getShareReward } from "@/api/system";
|
||||
import { getShareToken } from "@/utils/common";
|
||||
|
||||
const features = ref([
|
||||
@@ -230,10 +231,12 @@ const share = () => {
|
||||
uni.showShareMenu && uni.showShareMenu();
|
||||
};
|
||||
|
||||
onShareAppMessage(() => {
|
||||
onShareAppMessage(async () => {
|
||||
const shareToken = await getShareToken("spring_index");
|
||||
getShareReward({ scene: "spring_index" });
|
||||
return {
|
||||
title: "2026 丙午马年,送你一份新春祝福 🎊",
|
||||
path: "/pages/spring/index",
|
||||
path: `/pages/spring/index?shareToken=${shareToken}`,
|
||||
imageUrl:
|
||||
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
|
||||
};
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
import { ref, computed } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||
import { getBavBarHeight } from "@/utils/system";
|
||||
import { getPageDetail } from "@/api/system";
|
||||
import { getPageDetail, getShareReward } from "@/api/system";
|
||||
import { getWallpaperSameList } from "@/api/wallpaper";
|
||||
import {
|
||||
getShareToken,
|
||||
@@ -155,6 +155,7 @@ onLoad(async (options) => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const token = await getShareToken("wallpaper_download", detailData.value?.id);
|
||||
getShareReward({ scene: "wallpaper_download" });
|
||||
return {
|
||||
title: "快来看看我刚领到的新年精美壁纸 🖼",
|
||||
path: `/pages/wallpaper/detail?shareToken=${token || ""}`,
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
import { ref } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShareTimeline } from "@dcloudio/uni-app";
|
||||
import { getBavBarHeight } from "@/utils/system";
|
||||
import { getPageDetail } from "@/api/system";
|
||||
import { getPageDetail, getShareReward } from "@/api/system";
|
||||
import { getWallpaperRecommendList } from "@/api/wallpaper";
|
||||
import { getShareToken, saveViewRequest } from "@/utils/common.js";
|
||||
|
||||
@@ -150,6 +150,7 @@ onLoad(async (options) => {
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
const token = await getShareToken("wallpaper_download", detailData.value?.id);
|
||||
getShareReward({ scene: "wallpaper_download" });
|
||||
return {
|
||||
title: "快来看看我刚领到的新年精美壁纸 🖼",
|
||||
path: `/pages/wallpaper/detail?shareToken=${token || ""}`,
|
||||
|
||||
Reference in New Issue
Block a user