fix: gretting page
This commit is contained in:
@@ -397,7 +397,7 @@
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import { getBavBarHeight, getDeviceInfo } from "@/utils/system";
|
||||
import { generateObjectId } from "@/utils/common";
|
||||
import { generateObjectId, getShareToken } from "@/utils/common";
|
||||
|
||||
import {
|
||||
createCardTmp,
|
||||
@@ -825,36 +825,46 @@ const loadMoreTemplates = () => {
|
||||
getTemplateList(true);
|
||||
};
|
||||
|
||||
onShareAppMessage(async () => {
|
||||
onShareAppMessage(async (options) => {
|
||||
getShareReward({ scene: "card_generate" });
|
||||
if (!isLoggedIn.value) {
|
||||
return {
|
||||
title: "新春祝福",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
}
|
||||
// 1. 确保有 cardId (如果内容有变动,最好是新建)
|
||||
const id = createCard();
|
||||
if (!id) {
|
||||
return {
|
||||
title: "新春祝福",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
}
|
||||
if (options.from === "button") {
|
||||
if (!isLoggedIn.value) {
|
||||
return {
|
||||
title: "新春祝福",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
}
|
||||
// 1. 确保有 cardId (如果内容有变动,最好是新建)
|
||||
const id = createCard();
|
||||
if (!id) {
|
||||
return {
|
||||
title: "新春祝福",
|
||||
path: "/pages/index/index",
|
||||
};
|
||||
}
|
||||
|
||||
const deviceInfo = getDeviceInfo();
|
||||
const shareTokenRes = await createShareToken({
|
||||
scene: "card_generate",
|
||||
targetId: id,
|
||||
...deviceInfo,
|
||||
});
|
||||
shareOrSave(id);
|
||||
return {
|
||||
title: "我刚做了一张祝福卡片,送给你",
|
||||
path: "/pages/detail/index?shareToken=" + shareTokenRes.shareToken,
|
||||
imageUrl:
|
||||
"https://file.lihailezzc.com/resource/13ec1134e6614feadeeaaa9ef21ea96e.png",
|
||||
};
|
||||
const deviceInfo = getDeviceInfo();
|
||||
const shareTokenRes = await createShareToken({
|
||||
scene: "card_generate",
|
||||
targetId: id,
|
||||
...deviceInfo,
|
||||
});
|
||||
shareOrSave(id);
|
||||
return {
|
||||
title: "我刚做了一张祝福卡片,送给你",
|
||||
path: "/pages/detail/index?shareToken=" + shareTokenRes.shareToken,
|
||||
imageUrl:
|
||||
"https://file.lihailezzc.com/resource/13ec1134e6614feadeeaaa9ef21ea96e.png",
|
||||
};
|
||||
} else {
|
||||
const shareTokenRes = await getShareToken("card_generate_index", "");
|
||||
return {
|
||||
title: "新春祝福",
|
||||
path: `/pages/index/index?shareToken=${shareTokenRes.shareToken}`,
|
||||
imageUrl:
|
||||
"https://file.lihailezzc.com/resource/cfed2edbfa19250b836a87a4bbf0d5ad.png",
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const displayedGreetings = ref([]);
|
||||
|
||||
Reference in New Issue
Block a user