fix: gretting page

This commit is contained in:
zzc
2026-02-03 11:01:58 +08:00
parent 82fc0f80a5
commit ad40704642
2 changed files with 21 additions and 10 deletions

View File

@@ -433,7 +433,7 @@ const cardId = ref("");
// 标题相关 // 标题相关
const titles = ref([]); const titles = ref([]);
const currentTitle = ref(null); const currentTitle = ref(titles.value[0]);
const titlePage = ref(1); const titlePage = ref(1);
const loadingTitles = ref(false); const loadingTitles = ref(false);
const hasMoreTitles = ref(true); const hasMoreTitles = ref(true);
@@ -908,6 +908,7 @@ const selectTitle = (title) => {
currentTitle.value = null; currentTitle.value = null;
} else { } else {
currentTitle.value = title; currentTitle.value = title;
// 切换标题时重置位置和缩放 // 切换标题时重置位置和缩放
titleState.value = { titleState.value = {
offsetX: 0, offsetX: 0,
@@ -982,6 +983,7 @@ const shareOrSave = async (id) => {
blessingTo: targetName.value, blessingTo: targetName.value,
blessingFrom: signatureName.value, blessingFrom: signatureName.value,
templateId: currentTemplate.value?.id || "", templateId: currentTemplate.value?.id || "",
titleId: currentTitle?.value?.id || "",
}); });
}; };

View File

@@ -58,9 +58,9 @@
<view class="action-btn" @tap.stop="onShare(item)"> <view class="action-btn" @tap.stop="onShare(item)">
<text class="action-emoji">🔗</text> <text class="action-emoji">🔗</text>
</view> </view>
<view class="action-btn" @tap.stop="onMore(item)"> <!-- <view class="action-btn" @tap.stop="onMore(item)">
<text class="action-emoji"></text> <text class="action-emoji"></text>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@@ -158,19 +158,28 @@ const formatDate = (dateStr) => {
}; };
const getTagText = (item) => { const getTagText = (item) => {
if (item.status === "draft") return "草稿"; // if (item.status === "draft") return "草稿";
return item.festival || "金榜"; return item?.title?.name || item.festival || "新春快乐";
};
const getTitle = (item) => {
// if (item.status === "draft") return "草稿";
return item.blessingTo + (item?.content?.content || "新春快乐");
}; };
const getTagClass = (item) => { const getTagClass = (item) => {
if (item.status === "draft") return "tag-draft"; if (item.status === "draft") return "tag-draft";
const tagMap = { const tagMap = {
春节: "tag-spring", 万事如意: "tag-spring",
金榜: "tag-gold", 新春快乐: "tag-gold",
马到: "tag-horse", 新春大吉: "tag-horse",
水墨: "tag-ink", 钱包鼓鼓: "tag-ink",
福气旺旺: "tag-spring",
龙马精神: "tag-horse",
马年纳祥: "tag-horse",
福马迎春: "tag-horse",
}; };
return tagMap[item.festival] || "tag-gold"; return tagMap[item?.title?.name || item.festival] || "tag-gold";
}; };
const onDetail = (item) => { const onDetail = (item) => {