Compare commits

...

13 Commits

Author SHA1 Message Date
zzc
b37bfcfd02 fix: user gretting record 2026-03-13 10:05:53 +08:00
zzc
952acbbf1f fix: scene list 2026-03-13 03:12:52 +08:00
zzc
1865b1cfcd fix: scene list 2026-03-13 02:56:05 +08:00
zzc
edfa8a2d3a fix: xinchun 2026-03-13 02:54:15 +08:00
zzc
d28b083630 fix: xinchun 2026-03-13 02:26:22 +08:00
zzc
ff8d9836d5 fix: lock resousers 2026-03-12 10:56:03 +08:00
zzc
f653e6659a fix: lock resousers 2026-03-11 17:44:24 +08:00
zzc
9c4f0c5650 fix: lock resousers 2026-03-11 16:36:54 +08:00
zzc
c2b889ac8f fix: lock resousers 2026-03-11 14:45:27 +08:00
zzc
c624bc2d1d fix: user deduct point 2026-03-10 11:47:19 +08:00
zzc
2d3cefa43e fix: user deduct point 2026-03-10 11:41:05 +08:00
zzc
d8c5c3a919 fix: user deduct point 2026-03-10 10:39:31 +08:00
zzc
14d8e0b349 fix: user deduct point 2026-03-10 10:21:43 +08:00
28 changed files with 697 additions and 348 deletions

View File

@@ -14,3 +14,10 @@ export const createCardShareToken = async (data) => {
data,
});
};
export const getGreetingSceneList = async (exclude) => {
return request({
url: `/api/blessing/greeting-scene/list?exclude=${exclude}`,
method: "GET",
});
};

View File

@@ -1,4 +1,6 @@
import { request } from "@/utils/request.js";
import { useUserStore } from "@/stores/user";
const userStore = useUserStore();
export const abilityCheck = async (scene) => {
return request({
@@ -23,11 +25,16 @@ export const getPageDetail = async (shareToken) => {
};
export const getShareReward = async (data) => {
return request({
const res = await request({
url: "/api/reward/share",
method: "POST",
data,
});
console.log("getShareReward res", res);
if (res && res.success) {
userStore.fetchUserAssets();
}
return res;
};
export const saveRecord = async (data) => {
@@ -103,19 +110,22 @@ export const createTracking = async (data) => {
});
};
export const watchAdReward = async (token) => {
export const watchAdReward = async (token, scene, type, resourceId) => {
return request({
url: "/api/blessing/ad/reward",
url: "/api/ad/reward",
method: "POST",
data: {
rewardToken: token,
scene,
type,
resourceId,
},
});
};
export const watchAdStart = async () => {
return request({
url: "/api/blessing/ad/start",
url: "/api/ad/start",
method: "POST",
data: {
adPlacementId: "adunit-d7a28e0357d98947",

View File

@@ -3,7 +3,7 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "新春祝福",
"navigationBarTitleText": "祝福 壁纸 头像",
"enablePullDownRefresh": true,
"navigationStyle": "custom",
"backgroundColor": "#FFFFFF"
@@ -36,7 +36,7 @@
{
"path": "pages/mine/greeting",
"style": {
"navigationBarTitleText": "我的新春祝福",
"navigationBarTitleText": "我的祝福",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
@@ -44,7 +44,7 @@
{
"path": "pages/mine/wallpaper",
"style": {
"navigationBarTitleText": "我的新春壁纸",
"navigationBarTitleText": "我的壁纸",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
@@ -92,7 +92,7 @@
{
"path": "pages/avatar/index",
"style": {
"navigationBarTitleText": "新春头像挂饰",
"navigationBarTitleText": "头像挂饰",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
@@ -124,7 +124,7 @@
{
"path": "pages/detail/index",
"style": {
"navigationBarTitleText": "新春祝福详情",
"navigationBarTitleText": "祝福详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
@@ -139,7 +139,7 @@
{
"path": "pages/fortune/index",
"style": {
"navigationBarTitleText": "新年运势",
"navigationBarTitleText": "每日好运",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
@@ -147,7 +147,7 @@
{
"path": "pages/fortune/detail",
"style": {
"navigationBarTitleText": "新年运势",
"navigationBarTitleText": "每日好运",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}

View File

@@ -15,9 +15,9 @@
<text class="nickname">{{
detailData.from?.nickname || "神秘用户"
}}</text>
<view class="tag">马年专属</view>
<view class="tag">专属头像</view>
</view>
<text class="action-text">换上了新春头像</text>
<text class="action-text">换上了专属头像</text>
</view>
</view>
@@ -36,7 +36,7 @@
</view>
<!-- Decorative Elements -->
<view class="card-footer-text">
<text class="icon">🌸</text> 2026 丙午马年限定
<text class="icon">🌸</text> 专属限定
</view>
</view>
</view>
@@ -53,7 +53,7 @@
<view class="section-header">
<view class="left">
<view class="bar"></view>
<text class="title">热门新春头像</text>
<text class="title">热门头像</text>
</view>
<text class="more" @tap="goToMake">查看全部</text>
</view>
@@ -69,10 +69,10 @@
</view>
<text class="frame-name">{{
item.type === "decor"
? "新春饰品"
? "精美饰品"
: item.type === "avatar"
? "新春头像"
: "新春相框"
? "爆款头像"
: "热门相框"
}}</text>
</view>
</view>
@@ -84,8 +84,8 @@
<text>🏮</text>
</view>
<view class="banner-content">
<text class="banner-title">去抽取新年运势</text>
<text class="banner-desc">每日一签开启你的新年好运</text>
<text class="banner-title">去抽取今日运势</text>
<text class="banner-desc">每日一签开启你的今日好运</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -94,8 +94,8 @@
<text>🧧</text>
</view>
<view class="banner-content">
<text class="banner-title">制作新年贺卡</text>
<text class="banner-desc">定制专属祝福传递浓浓年味</text>
<text class="banner-title">制作一张祝福贺卡</text>
<text class="banner-desc">写下心意把祝福送给重要的人</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -104,8 +104,8 @@
<text>🖼</text>
</view>
<view class="banner-content">
<text class="banner-title">去挑选新年壁纸</text>
<text class="banner-desc">精选新年壁纸让手机也过年</text>
<text class="banner-title">去挑选精美壁纸</text>
<text class="banner-desc">换上精选壁纸让手机也焕新</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -114,10 +114,10 @@
<view class="page-footer">
<view class="footer-line">
<text class="line"></text>
<text class="text">2026 HAPPY NEW YEAR</text>
<text class="text">LUCKY EVERY DAY</text>
<text class="line"></text>
</view>
<text class="footer-sub">新春祝福 · 传递温情</text>
<text class="footer-sub">专属头像</text>
</view>
</view>
</view>
@@ -149,7 +149,7 @@ onShareAppMessage(async () => {
const token = await getShareToken("avatar_download", detailData.value?.id);
getShareReward({ scene: "avatar_download" });
return {
title: "快来看看我刚领到的新年专属头像 🎊",
title: "快来看看我刚领到的专属头像 🎊",
path: `/pages/avatar/detail?shareToken=${token}`,
imageUrl:
detailData.value?.imageUrl ||
@@ -160,7 +160,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const token = await getShareToken("avatar_download", detailData.value?.id);
return {
title: "快来看看我刚领到的新年专属头像 🎊",
title: "快来看看我刚领到的专属头像 🎊",
query: `shareToken=${token}`,
imageUrl:
detailData.value?.imageUrl ||

View File

@@ -143,7 +143,7 @@ onShareAppMessage(async (options) => {
if (!isLoggedIn.value) {
const shareToken = await getShareToken("avatar_download_index", "");
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -156,13 +156,13 @@ onShareAppMessage(async (options) => {
options?.target?.dataset?.item?.id,
);
return {
title: "快来挑选喜欢的新春头像吧",
title: "快来挑选喜欢的专属头像吧",
path: `/pages/avatar/download?shareToken=${shareToken}`,
};
} else {
const shareToken = await getShareToken("avatar_download_index", "");
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -173,7 +173,7 @@ onShareAppMessage(async (options) => {
onShareTimeline(async () => {
const shareToken = await getShareToken("avatar_timeline");
return {
title: "精选新年头像,定制专属祝福 🧧",
title: "精选头像,定制专属祝福 🧧",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -314,10 +314,7 @@ const downloadAvatar = async (item) => {
return;
}
const canProceed = await checkAbilityAndHandle(
"avatar_download",
rewardAdRef,
);
const canProceed = await checkAbilityAndHandle("avatar_download");
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });

View File

@@ -29,7 +29,7 @@
<text>分享或保存即可去除水印</text>
</view>
<view class="preview-square">
<view class="watermark">年禧集.马年春节祝福</view>
<view class="watermark">精美头像壁纸祝福</view>
<image
class="avatar-img"
:src="currentAvatar?.imageUrl"
@@ -61,7 +61,16 @@
</view>
<view class="action-buttons">
<button class="btn secondary" @tap="saveAndUse">保存</button>
<view class="points-display" v-if="isLoggedIn">
<text class="label">当前积分</text>
<text class="value">{{ userPoints }}</text>
</view>
<button class="btn secondary" @tap="saveAndUse">
<view class="btn-content">
<text>保存</text>
<text class="btn-sub">消耗 20 积分</text>
</view>
</button>
<button class="btn primary" open-type="share">分享给朋友</button>
</view>
@@ -82,7 +91,7 @@
></uni-icons>
<view class="btn-texts">
<text class="btn-title">上传我的照片</text>
<text class="btn-sub">制作专属新年头像</text>
<text class="btn-sub">制作专属头像</text>
</view>
</view>
<uni-icons
@@ -122,6 +131,18 @@
>
<image :src="item.imageUrl" class="grid-img" mode="aspectFill" />
<view v-if="selectedFrame?.id === item.id" class="check"></view>
<!-- Lock Overlay -->
<view v-if="!item.isUnlock && item.unlockType" class="lock-overlay">
<!-- Badge -->
<view class="unlock-badge" :class="item.unlockType">
{{ getUnlockLabel(item.unlockType) }}
</view>
<!-- Center Lock -->
<view class="center-lock">
<uni-icons type="locked-filled" size="18" color="#fff" />
</view>
</view>
</view>
</view>
<view v-if="frameLoading" class="loading-more">加载中...</view>
@@ -141,6 +162,18 @@
>
<image :src="item.imageUrl" class="grid-img" mode="aspectFill" />
<view v-if="selectedDecor?.id === item.id" class="check"></view>
<!-- Lock Overlay -->
<view v-if="!item.isUnlock && item.unlockType" class="lock-overlay">
<!-- Badge -->
<view class="unlock-badge" :class="item.unlockType">
{{ getUnlockLabel(item.unlockType) }}
</view>
<!-- Center Lock -->
<view class="center-lock">
<uni-icons type="locked-filled" size="18" color="#fff" />
</view>
</view>
</view>
</view>
<view v-if="decorLoading" class="loading-more">加载中...</view>
@@ -162,6 +195,7 @@
@logind="handleLogind"
:share-token="shareToken"
/>
<RewardAd ref="rewardAdRef" @onReward="handleAdReward" />
<!-- More Avatar Popup -->
<!-- <uni-popup ref="morePopup" type="bottom" background-color="#fff">
@@ -204,13 +238,14 @@ import {
onReachBottom,
} from "@dcloudio/uni-app";
import { useUserStore } from "@/stores/user";
import { getShareReward, abilityCheck } from "@/api/system.js";
import { checkAbilityAndHandle, getUnlockLabel } from "@/utils/ability.js";
import {
getAvatarSystemList,
getAvatarFrameList,
getAvatarDecorList,
avatarCreateComplete,
} from "@/api/avatar.js";
import { getShareReward, watchAdReward } from "@/api/system.js";
import {
saveRecordRequest,
getShareToken,
@@ -221,11 +256,15 @@ import {
import { trackRecord } from "@/utils/common.js";
import NavBar from "@/components/NavBar/NavBar.vue";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
import RewardAd from "@/components/RewardAd/RewardAd.vue";
const userStore = useUserStore();
const loginPopupRef = ref(null);
const rewardAdRef = ref(null);
const currentUnlockItem = ref(null);
const isLoggedIn = computed(() => !!userStore.userInfo.nickName);
const userPoints = computed(() => userStore.userInfo.points || 0);
const systemAvatars = ref([]);
const frames = ref([]);
@@ -305,6 +344,7 @@ const loadFrames = async () => {
if (list.length > 0) {
frames.value.push(
...list.map((item) => ({
...item,
id: item.id,
imageUrl: item.imageUrl,
})),
@@ -332,6 +372,7 @@ const loadDecors = async () => {
if (list.length > 0) {
decors.value.push(
...list.map((item) => ({
...item,
id: item.id,
imageUrl: item.imageUrl,
})),
@@ -412,6 +453,10 @@ const toggleAvatar = (avatar) => {
};
const toggleFrame = (frame) => {
if (frame.unlockType && !frame.isUnlock) {
handleUnlock(frame);
return;
}
trackRecord({
eventName: "avatar_frame_click",
eventType: `select`,
@@ -425,6 +470,10 @@ const toggleFrame = (frame) => {
};
const toggleDecor = (decor) => {
if (decor.unlockType && !decor.isUnlock) {
handleUnlock(decor);
return;
}
trackRecord({
eventName: "avatar_decor_click",
eventType: `select`,
@@ -437,6 +486,93 @@ const toggleDecor = (decor) => {
}
};
const handleUnlock = (item) => {
switch (item.unlockType) {
case "vip":
uni.navigateTo({
url: "/pages/mine/vip",
});
break;
case "ad":
currentUnlockItem.value = item;
rewardAdRef.value.show();
break;
case "sing1":
uni.showToast({
title: "需要连续签到1天解锁",
icon: "none",
});
break;
case "sing3":
uni.showToast({
title: "需要连续签到3天解锁",
icon: "none",
});
break;
case "sing5":
uni.showToast({
title: "需要连续签到5天解锁",
icon: "none",
});
break;
case "sing7":
uni.showToast({
title: "需要连续签到7天解锁",
icon: "none",
});
break;
default:
uni.showToast({
title: "未满足解锁条件",
icon: "none",
});
}
};
const handleAdReward = async (token) => {
try {
const res = await watchAdReward(
token,
"unlock",
activeTool.value === "frame" ? "avatar_frame" : "avatar_decor",
currentUnlockItem.value.id,
);
if (res) {
uni.showToast({
title: "解锁成功",
icon: "success",
});
// 解锁成功后,更新本地状态,允许使用
if (currentUnlockItem.value) {
currentUnlockItem.value.isUnlock = true;
if (activeTool.value === "frame") {
const index = frames.value.findIndex(
(t) => t.id === currentUnlockItem.value.id,
);
if (index !== -1) {
frames.value[index].isUnlock = true;
}
toggleFrame(currentUnlockItem.value);
} else if (activeTool.value === "decor") {
const index = decors.value.findIndex(
(t) => t.id === currentUnlockItem.value.id,
);
if (index !== -1) {
decors.value[index].isUnlock = true;
}
toggleDecor(currentUnlockItem.value);
}
currentUnlockItem.value = null;
}
}
} catch (e) {
console.error("Reward claim failed", e);
uni.showToast({ title: "奖励发放失败", icon: "none" });
}
};
// 挂饰状态
const decorState = ref({
x: 300, // 初始中心 X (rpx)
@@ -674,29 +810,20 @@ const saveAndUse = async () => {
loginPopupRef.value.open();
return;
}
const abilityRes = await abilityCheck("avatar_download");
if (!abilityRes.canUse) {
if (
abilityRes?.blockType === "need_share" &&
abilityRes?.message === "分享可继续"
) {
uni.showToast({
title: "分享给好友可继续使用",
icon: "none",
});
return;
}
uni.showToast({
title: "您今日头像下载次数已用完,明日再试",
icon: "none",
});
return;
}
const canProceed = await checkAbilityAndHandle("avatar_download");
if (!canProceed) return;
const tempPath = await saveByCanvas(true);
const id = createAvatarId();
saveRecordRequest(tempPath, id, "avatar_download");
completeCardInfo(id);
if (userStore?.userInfo?.points >= 20) {
userStore.userInfo.points -= 20;
}
// userStore.fetchUserAssets();
return;
// 调用avatarDownloadRecord API记录下载次数
// await avatarDownloadRecord({
@@ -759,7 +886,6 @@ const completeCardInfo = async (id) => {
};
onShareAppMessage(async (options) => {
getShareReward({ scene: "avatar_download" });
if (options.from === "button") {
if (!isLoggedIn.value) {
loginPopupRef.value.open();
@@ -771,9 +897,10 @@ onShareAppMessage(async (options) => {
getShareToken("avatar_download", id),
completeCardInfo(id),
]);
getShareReward({ scene: "avatar_download" });
uni.hideLoading();
return {
title: "3 秒生成新春专属头像,真的好看😆",
title: "3 秒生成专属头像,真的好看😆",
path: `/pages/avatar/detail?shareToken=${shareToken}`,
imageUrl:
imageUrl +
@@ -781,8 +908,9 @@ onShareAppMessage(async (options) => {
};
} else {
const shareToken = await getShareToken("avatar_download_not_login", "");
getShareReward({ scene: "avatar_index" });
return {
title: "3 秒生成新春专属头像,真的好看😆",
title: "3 秒生成专属头像,真的好看😆",
path: `/pages/avatar/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -793,7 +921,7 @@ onShareAppMessage(async (options) => {
onShareTimeline(async () => {
const shareToken = await getShareToken("avatar_timeline");
return {
title: "快来定制你的新年专属头像 🎊",
title: "快来定制你的专属头像 🎊",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -1025,17 +1153,56 @@ onShareTimeline(async () => {
display: flex;
gap: 20rpx;
margin-bottom: 30rpx;
position: relative;
.points-display {
position: absolute;
top: -60rpx;
right: 30rpx;
background: rgba(255, 255, 255, 0.9);
padding: 8rpx 20rpx;
border-radius: 30rpx;
display: flex;
align-items: center;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
.label {
font-size: 24rpx;
color: #666;
}
.value {
font-size: 28rpx;
color: #ff3b30;
font-weight: bold;
margin-left: 4rpx;
}
}
.btn {
flex: 1;
height: 88rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 44rpx;
border-radius: 48rpx;
font-size: 30rpx;
font-weight: bold;
.btn-content {
display: flex;
flex-direction: column;
align-items: center;
line-height: 1.2;
.btn-sub {
font-size: 20rpx;
opacity: 0.8;
font-weight: normal;
margin-top: 2rpx;
}
}
&.primary {
background: #ff3b30;
color: #fff;
@@ -1106,6 +1273,69 @@ onShareTimeline(async () => {
font-size: 20rpx;
padding: 4rpx 8rpx;
border-radius: 0 0 0 16rpx;
z-index: 2;
}
/* 锁定遮罩样式 */
.lock-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 10;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
pointer-events: none; /* 让点击事件穿透到 grid-item */
}
.unlock-badge {
position: absolute;
top: 0;
right: 0;
background: linear-gradient(
135deg,
#ff9a9e 0%,
#fecfef 99%,
#fecfef 100%
);
color: #fff;
font-size: 16rpx;
padding: 4rpx 10rpx;
border-radius: 0 0 0 12rpx;
font-weight: bold;
z-index: 20;
&.vip {
background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
}
&.ad {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
&.sing1,
&.sing3,
&.sing5,
&.sing7 {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
}
.center-lock {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 48rpx;
height: 48rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(4px);
}
&.upload-card {

View File

@@ -16,7 +16,7 @@
/>
<view class="user-meta">
<view class="user-name">{{ cardDetail?.blessingFrom }}</view>
<view class="user-msg">给你发来了一条新春祝福</view>
<view class="user-msg">给你发来了一条专属祝福</view>
<view class="year-tag">
<text class="fire-icon">🎉</text> {{ cardDetail?.year || 2026 }}
{{ cardDetail?.festival || "丙午马年" }}
@@ -83,8 +83,8 @@
<text>🏮</text>
</view>
<view class="banner-content">
<text class="banner-title">去抽取新年运势</text>
<text class="banner-desc">每日一签开启你的新年好运</text>
<text class="banner-title">去抽取今日运势</text>
<text class="banner-desc">每日一签开启你的好运</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -93,8 +93,8 @@
<text>🧧</text>
</view>
<view class="banner-content">
<text class="banner-title">去制作新年头像</text>
<text class="banner-desc">定制专属头像传递浓浓年味</text>
<text class="banner-title">换个好看头像</text>
<text class="banner-desc">精选头像合集找到你的专属风格</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -103,8 +103,8 @@
<text>🖼</text>
</view>
<view class="banner-content">
<text class="banner-title">去挑选新年壁纸</text>
<text class="banner-desc">精选新年壁纸让手机也过年</text>
<text class="banner-title">去挑选精美壁纸</text>
<text class="banner-desc">换上精选壁纸让手机也焕新</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -113,10 +113,10 @@
<view class="page-footer">
<view class="footer-line">
<text class="line"></text>
<text class="text">2026 HAPPY NEW YEAR</text>
<text class="text">HAPPY EVERY DAY</text>
<text class="line"></text>
</view>
<view class="footer-sub">新春祝福 · 传递温情</view>
<view class="footer-sub">专属祝福 · 传递温情</view>
</view>
</view>
</scroll-view>
@@ -196,7 +196,7 @@ onShareAppMessage(async () => {
const token = await getShareToken("card_generate", cardDetail.value?.id);
getShareReward({ scene: "card_generate" });
return {
title: "送你一张精美的新春祝福卡片 🎊",
title: "送你一张精美的专属祝福卡片 🎊",
path: `/pages/detail/index?shareToken=${token || ""}`,
imageUrl:
cardDetail.value?.imageUrl ||
@@ -207,7 +207,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const token = await getShareToken("card_generate", cardDetail.value?.id);
return {
title: "送你一张精美的新春祝福卡片 🎊",
title: "送你一张精美的专属祝福卡片 🎊",
query: `shareToken=${token}`,
imageUrl:
cardDetail.value?.imageUrl ||

View File

@@ -16,9 +16,9 @@
/>
<text class="banner-icon" v-else-if="!inviterName"></text>
<text class="banner-text" v-if="inviterName"
>你的好友 {{ inviterName }} 正在抽取2026新年运势</text
>你的好友 {{ inviterName }} 正在抽取今日运势</text
>
<text class="banner-text" v-else>2026 灵马贺岁 · 开启你的新年好运</text>
<text class="banner-text" v-else>今日运势 · 开启你的好运</text>
</view>
<view class="mini-btn" @click="goTest">
我也要测 <text class="mini-arrow"></text>
@@ -78,7 +78,7 @@
<!-- <view class="qr-box">
<view class="qr-placeholder"></view>
</view> -->
<view class="footer-text">2026 灵马贺岁 · 测出你的新年锦鲤关键词</view>
<view class="footer-text">2026 灵马贺岁 · 测出你的锦鲤关键词</view>
<view class="footer-sub">2026 HAPPY NEW YEAR</view>
</view>
</view>

View File

@@ -1,6 +1,6 @@
<template>
<view class="fortune-page">
<NavBar title="2026 新年运势" :transparent="true" color="#ffd700" />
<NavBar title="每日运势" :transparent="true" color="#ffd700" />
<!-- 初始状态签筒 -->
<view class="state-initial" v-if="status !== 'result'">
@@ -68,7 +68,7 @@
<text class="result-title">{{ currentFortune.title }}</text>
<view class="divider"></view>
<text class="result-desc">{{ currentFortune.desc }}</text>
<text class="result-sub">旧岁千般皆如意新年万事定称心</text>
<text class="result-sub">过往千般皆如意此后万事定称心</text>
</view>
<view class="card-footer">
<view class="footer-left">
@@ -125,19 +125,19 @@ import {
onShareAppMessage,
onShareTimeline,
} from "@dcloudio/uni-app";
import { abilityCheck } from "@/api/system.js";
import { drawFortune } from "@/api/fortune.js";
import { getShareReward } from "@/api/system.js";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
import { useUserStore } from "@/stores/user";
import {
getShareToken,
saveRemoteImageToLocal,
saveRecordRequest,
saveRemoteImageToLocal,
getShareToken,
saveViewRequest,
trackRecord,
} from "@/utils/common.js";
import { drawFortune } from "@/api/fortune.js";
import { abilityCheck } from "@/api/system.js";
import { checkAbilityAndHandle } from "@/utils/ability.js";
import { useUserStore } from "@/stores/user";
import LoginPopup from "@/components/LoginPopup/LoginPopup.vue";
import NavBar from "@/components/NavBar/NavBar.vue";
import { trackRecord } from "@/utils/common.js";
const userStore = useUserStore();
const loginPopupRef = ref(null);
@@ -185,7 +185,7 @@ onShareAppMessage(async () => {
const shareToken = await getShareToken("fortune_draw", cardId.value);
getRewardByShare();
return {
title: "马年运势我已经抽过了,你的会是什么?",
title: "今日运势我已经抽过了,你的会是什么?",
path: `${cardId.value ? `/pages/fortune/detail?shareToken=${shareToken}` : `/pages/fortune/index?shareToken=${shareToken}`}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -195,7 +195,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const shareToken = await getShareToken("fortune_timeline");
return {
title: "新春到,抽灵签!快来测测你的年运势 🏮",
title: "好运到,抽灵签!快来测测你的年运势 🏮",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -238,10 +238,8 @@ const startShake = async () => {
return;
}
if (remainingCount.value <= 0) {
uni.showToast({ title: "今日次数已用完", icon: "none" });
return;
}
const canProceed = await checkAbilityAndHandle("fortune_draw");
if (!canProceed) return;
status.value = "shaking";

View File

@@ -8,12 +8,12 @@
<uni-icons type="sun-filled" size="24" color="#ff9800" />
<text class="header-title">{{ greetingTitle }}</text>
</view>
<view class="streak-badge">
<!-- <view class="streak-badge">
<text>已连续问候</text>
<text class="streak-count">{{ streakDays }}</text>
<text></text>
<text class="fire-icon">🔥</text>
</view>
</view> -->
</view>
<!-- Main Card -->
@@ -86,7 +86,7 @@
</view>
<!-- Hot List -->
<view class="hot-list-section">
<!-- <view class="hot-list-section">
<view class="section-title-row">
<view class="title-bar"></view>
<text class="section-title">今日最热榜单</text>
@@ -125,7 +125,7 @@
<uni-icons type="right" size="16" color="#ccc" />
</view>
</view>
</view>
</view> -->
<!-- Bottom Actions -->
<view class="bottom-actions safe-area-bottom">
@@ -384,7 +384,8 @@ onShareTimeline(() => {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15rpx;
margin-bottom: 40rpx;
margin-top: 40rpx;
}
.header-left {
@@ -433,7 +434,7 @@ onShareTimeline(() => {
/* Main Card */
.main-card-container {
padding: 0 40rpx;
margin-bottom: 60rpx;
margin-bottom: 80rpx;
}
.quote-card {

View File

@@ -8,9 +8,9 @@
</view>
<view class="hero-title">
<text class="year">2026</text>
<text class="main">新春祝福</text>
<text class="main">专属祝福</text>
</view>
<text class="hero-sub">新年快乐万事如意!</text>
<text class="hero-sub">送你一份好运祝福万事如意!</text>
<!-- <image class="hero-decor" src="https://file.lihailezzc.com/resource/58c8d19e5f2d9c958a7b8b9f44b8c3e3.png" mode="aspectFill" /> -->
</view>
@@ -217,7 +217,7 @@ onShareAppMessage(async () => {
const shareToken = await getShareToken("index");
getShareReward({ scene: "index" });
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -227,7 +227,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const shareToken = await getShareToken("index_timeline");
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -276,20 +276,20 @@ const onNoticeTap = (tip) => {
const features = ref([
{
title: "新春祝福卡片",
title: "专属祝福卡片",
subtitle: "定制专属贺卡吧",
icon: "/static/icon/celebrate.png",
type: "card",
},
{
title: "新年运势",
subtitle: "抽取新年关键词",
title: "专属运势",
subtitle: "抽取专属关键词",
icon: "/static/icon/yunshi.png",
type: "fortune",
},
{
title: "新春头像",
subtitle: "焕上节日新饰",
title: "爆款头像",
subtitle: "焕上精美头像",
icon: "/static/icon/guashi.png",
type: "avatar_decor",
},

View File

@@ -268,7 +268,7 @@
</view>
<view class="rule-item">
<uni-icons type="person-filled" size="18" color="#ff9800" />
<text class="rule-text">每日登录+20积分</text>
<text class="rule-text">每日登录+10积分</text>
</view>
<view class="rule-item">
<uni-icons type="calendar-filled" size="18" color="#ff9800" />
@@ -302,6 +302,7 @@ import {
getCardSpecialTopic,
getShareReward,
} from "@/api/system";
import { getGreetingSceneList } from "@/api/card";
import { getUserSignInfo, userSignIn, getUserLuckInfo } from "@/api/user";
import calendar from "@/utils/lunar";
import { getShareToken, saveViewRequest } from "@/utils/common.js";
@@ -410,22 +411,7 @@ const lunarDate = computed(() => {
};
});
const sceneList = ref([
{ id: 3, name: "每日问候", icon: "/static/icon/yunshi.png", scene: "daily" },
{
id: 2,
name: "生日纪念",
icon: "/static/icon/guashi.png",
scene: "birthday",
},
{ id: 4, name: "情感表达", icon: "/static/icon/hongbao.png", scene: "love" },
{
id: 1,
name: "节日祝福",
icon: "/static/icon/celebrate.png",
scene: "holiday",
},
]);
const sceneList = ref([]);
const wallpaperList = ref([]);
const avatarList = ref([]);
@@ -437,18 +423,21 @@ onLoad((options) => {
fetchUserSingInfo(); // 获取用户签到信息
fetchHomeData();
fetchSpecialTopic();
fetchSceneList();
});
onShow(() => {
fetchHomeData();
fetchUserSingInfo();
fetchSpecialTopic();
fetchSceneList();
});
onPullDownRefresh(() => {
fetchHomeData();
fetchUserSingInfo();
fetchSpecialTopic();
fetchSceneList();
});
const specialTopic = ref(null);
@@ -466,6 +455,22 @@ const fetchSpecialTopic = async () => {
}
};
const fetchSceneList = async () => {
try {
const res = await getGreetingSceneList();
if (res && Array.isArray(res)) {
sceneList.value = res.map((item) => ({
id: item.id,
name: item.sceneName,
icon: item.imageUrl,
scene: item.scene,
}));
}
} catch (e) {
console.error("fetchSceneList error", e);
}
};
const navToSpecial = () => {
if (specialTopic.value && specialTopic.value.scene) {
uni.navigateTo({
@@ -565,7 +570,7 @@ const onOpenLucky = async () => {
const luckRes = await getUserLuckInfo();
luckyPopupRef.value?.open(luckRes, false);
uni.showToast({ title: "获取40积分", icon: "none" });
uni.showToast({ title: "获取20积分", icon: "none" });
} else {
uni.showToast({ title: "签到失败", icon: "none" });
}
@@ -595,20 +600,19 @@ const handleAdReward = async (token) => {
onShareAppMessage(async () => {
const shareToken = await getShareToken("index");
getShareReward().then((res) => {
if (isLoggedIn && res && res.success) {
userStore.fetchUserAssets();
}
});
getShareReward();
return {
title: "开启你的2026新春好运",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: "/pages/index/index?shareToken=" + shareToken,
};
});
onShareTimeline(() => {
onShareTimeline(async () => {
const shareToken = await getShareToken("index");
getShareReward();
return {
title: "开启你的2026新春好运",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
query: `shareToken=${shareToken}`,
};
});

View File

@@ -246,12 +246,8 @@ import { ref, onMounted, computed } from "vue";
import { getStatusBarHeight } from "@/utils/system";
import { onShareAppMessage, onShareTimeline, onShow } from "@dcloudio/uni-app";
import { useUserStore } from "@/stores/user";
import {
getRecommendList,
getRankList,
abilityCheck,
watchAdReward,
} from "@/api/system";
import { checkAbilityAndHandle } from "@/utils/ability.js";
import { getRecommendList, getRankList, watchAdReward } from "@/api/system";
import { saveRemoteImageToLocal, saveRecordRequest } from "@/utils/common";
import { getUserSignInfo, userSignIn } from "@/api/user";
import { avatarDownloadRecord } from "@/api/avatar";
@@ -481,40 +477,8 @@ const handleDownload = async (item) => {
const type =
item.type === "wallpaper" ? "wallpaper_download" : "avatar_download";
const abilityRes = await abilityCheck(type);
if (!abilityRes.canUse) {
if (
abilityRes?.blockType === "need_share" &&
abilityRes?.message === "分享可继续"
) {
uni.showToast({
title: "分享给好友即可下载",
icon: "none",
});
return;
}
if (
abilityRes?.blockType === "need_ad" &&
abilityRes?.message === "观看广告可继续"
) {
uni.showModal({
title: "积分不足",
content: "观看广告可获得50积分继续下载",
success: (res) => {
if (res.confirm) {
rewardAdRef.value.show();
}
},
});
return;
}
uni.showToast({
title: "您今日下载次数已用完,明日再试",
icon: "none",
});
return;
}
const canProceed = await checkAbilityAndHandle(type);
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });
try {

View File

@@ -44,7 +44,7 @@
mode="aspectFill"
/>
<view class="card-overlay">
<view class="watermark">年禧集.马年春节祝福</view>
<view class="watermark">精美头像壁纸祝福</view>
<!-- 选中的标题图片 -->
<image
v-if="currentTitle"
@@ -169,6 +169,21 @@
<view v-if="title?.id === currentTitle?.id" class="tpl-check"
></view
>
<!-- Lock Overlay -->
<view
v-if="!title.isUnlock && title.unlockType"
class="lock-overlay"
>
<!-- Badge -->
<view class="unlock-badge" :class="title.unlockType">
{{ getUnlockLabel(title.unlockType) }}
</view>
<!-- Center Lock -->
<view class="center-lock">
<uni-icons type="locked-filled" size="18" color="#fff" />
</view>
</view>
</view>
</view>
<view v-if="loadingTitles" class="loading-more">加载中...</view>
@@ -210,17 +225,7 @@
>
<!-- Badge -->
<view class="unlock-badge" :class="tpl.unlockType">
{{
tpl.unlockType === "sing3"
? "登录3天"
: tpl.unlockType === "sing1"
? "登录1天"
: tpl.unlockType === "ad"
? "广告"
: tpl.unlockType === "vip"
? "VIP"
: "解锁"
}}
{{ getUnlockLabel(tpl.unlockType) }}
</view>
<!-- Center Lock -->
@@ -535,8 +540,15 @@
@tap="selectScene(scene)"
>
<view class="scene-icon-box" :style="{ background: scene.bgColor }">
<image
v-if="scene.icon && scene.icon.includes('/')"
:src="scene.icon"
mode="aspectFit"
style="width: 52rpx; height: 52rpx"
/>
<uni-icons
:type="scene.icon"
v-else
:type="scene.icon || 'star-filled'"
size="26"
:color="scene.color"
></uni-icons>
@@ -563,12 +575,9 @@ import {
getCardTemplateTitleList,
getCardMusicList,
} from "@/api/make";
import {
abilityCheck,
getShareReward,
msgCheckApi,
watchAdReward,
} from "@/api/system";
import { getGreetingSceneList } from "@/api/card";
import { getShareReward, msgCheckApi, watchAdReward } from "@/api/system";
import { checkAbilityAndHandle, getUnlockLabel } from "@/utils/ability.js";
import {
onShareAppMessage,
onShareTimeline,
@@ -973,6 +982,7 @@ onLoad((options) => {
if (options.author) {
signatureName.value = decodeURIComponent(options.author);
}
fetchSceneList();
});
const loadData = () => {
@@ -984,51 +994,37 @@ const loadData = () => {
const currentScene = ref("");
const scenePopup = ref(null);
const scenes = [
{
name: "节日祝福",
value: "holiday",
icon: "notification-filled",
color: "#FF3B30",
bgColor: "#FFF5F5",
},
{
name: "生日纪念",
value: "birthday",
icon: "calendar-filled",
color: "#FF9500",
bgColor: "#FFF8E5",
},
{
name: "每日问候",
value: "daily",
icon: "star-filled",
color: "#FFCC00",
bgColor: "#FFFBE6",
},
{
name: "情绪表达",
value: "emotion",
icon: "heart-filled",
color: "#FF2D55",
bgColor: "#FFF0F5",
},
{
name: "人际关系",
value: "relationship",
icon: "gift-filled",
color: "#FF5E3A",
bgColor: "#FFF2F0",
},
{
name: "职场祝福",
value: "workplace",
icon: "shop-filled",
color: "#8B572A",
bgColor: "#F9F0E6",
},
const scenes = ref([]);
const SCENE_PALETTE = [
{ color: "#FF3B30", bgColor: "#FFF5F5" },
{ color: "#FF9500", bgColor: "#FFF8E5" },
{ color: "#FFCC00", bgColor: "#FFFBE6" },
{ color: "#FF2D55", bgColor: "#FFF0F5" },
{ color: "#FF5E3A", bgColor: "#FFF2F0" },
{ color: "#8B572A", bgColor: "#F9F0E6" },
];
const fetchSceneList = async () => {
try {
const res = await getGreetingSceneList("daily");
if (res && Array.isArray(res)) {
scenes.value = res.map((item, index) => {
const style = SCENE_PALETTE[index % SCENE_PALETTE.length];
return {
name: item.sceneName,
value: item.scene,
icon: item.imageUrl,
color: style.color,
bgColor: style.bgColor,
};
});
}
} catch (e) {
console.error("fetchSceneList error", e);
}
};
const selectScene = (scene) => {
currentScene.value = scene.value;
scenePopup.value.close();
@@ -1336,7 +1332,7 @@ onShareAppMessage(async (options) => {
} else {
const shareToken = await getShareToken("card_generate_index", "");
return {
title: "快来制作新春祝福卡片🎉",
title: "快来制作祝福卡片🎉",
path: `/pages/make/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -1347,7 +1343,7 @@ onShareAppMessage(async (options) => {
onShareTimeline(async () => {
const shareToken = await getShareToken("card_timeline");
return {
title: "送你一张精美的新春祝福卡片 🎊",
title: "送你一张精美的祝福卡片 🎊",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -1387,7 +1383,7 @@ const currentTemplate = ref(templates.value[0]);
const currentUnlockTpl = ref(null);
const applyTemplate = (tpl) => {
if (tpl.isUnlock === false) {
if (tpl.unlockType && !tpl.isUnlock) {
handleUnlock(tpl);
return;
}
@@ -1409,17 +1405,23 @@ const handleUnlock = (tpl) => {
break;
case "ad":
currentUnlockTpl.value = tpl;
rewardAdRef.value.showAd();
break;
case "sing1":
uni.showToast({
title: "需要连续登录1天解锁",
icon: "none",
});
rewardAdRef.value.show();
break;
case "sing3":
uni.showToast({
title: "需要连续登录3天解锁",
title: "需要连续签到1天解锁",
icon: "none",
});
break;
case "sing5":
uni.showToast({
title: "需要连续签到5天解锁",
icon: "none",
});
break;
case "sing7":
uni.showToast({
title: "需要连续签到7天解锁",
icon: "none",
});
break;
@@ -1433,7 +1435,12 @@ const handleUnlock = (tpl) => {
const handleAdReward = async (token) => {
try {
const res = await watchAdReward(token);
const res = await watchAdReward(
token,
"unlock",
activeTool.value === "template" ? "card_template" : "card_title_template",
currentUnlockTpl.value.id,
);
if (res) {
uni.showToast({
title: "解锁成功",
@@ -1442,6 +1449,8 @@ const handleAdReward = async (token) => {
// 解锁成功后,更新本地状态,允许使用
if (currentUnlockTpl.value) {
currentUnlockTpl.value.isUnlock = true;
if (activeTool.value === "template") {
// 同时更新列表中的状态
const index = templates.value.findIndex(
(t) => t.id === currentUnlockTpl.value.id,
@@ -1449,8 +1458,18 @@ const handleAdReward = async (token) => {
if (index !== -1) {
templates.value[index].isUnlock = true;
}
applyTemplate(currentUnlockTpl.value);
} else if (activeTool.value === "title") {
// 同时更新列表中的状态
const index = titles.value.findIndex(
(t) => t.id === currentUnlockTpl.value.id,
);
if (index !== -1) {
titles.value[index].isUnlock = true;
}
selectTitle(currentUnlockTpl.value);
}
currentUnlockTpl.value = null;
}
}
@@ -1461,6 +1480,10 @@ const handleAdReward = async (token) => {
};
const selectTitle = (title) => {
if (title.unlockType && !title.isUnlock) {
handleUnlock(title);
return;
}
trackRecord({
eventName: "card_title_choose",
eventType: "click",
@@ -1505,24 +1528,9 @@ const preview = async () => {
loginPopupRef.value.open();
return;
}
const abilityRes = await abilityCheck("card_generate");
if (!abilityRes.canUse) {
if (
abilityRes?.blockType === "need_share" &&
abilityRes?.message === "分享可继续"
) {
uni.showToast({
title: "分享给好友可继续使用",
icon: "none",
});
return;
}
uni.showToast({
title: "您今日祝福卡下载次数已用完,直接分享给好友或者明日再试",
icon: "none",
});
return;
}
const canProceed = await checkAbilityAndHandle("card_generate");
if (!canProceed) return;
const tempPath = await saveByCanvas(true);
const id = createCard();
shareOrSave(id);
@@ -2069,7 +2077,9 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
&.sing1,
&.sing3 {
&.sing3,
&.sing5,
&.sing7 {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
}
@@ -2320,7 +2330,9 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
&.sing1,
&.sing3 {
&.sing3,
&.sing5,
&.sing7 {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
}

View File

@@ -218,7 +218,7 @@ const formatDate = (dateStr) => {
const getDefaultName = (item) => {
// Simple deterministic name generation based on ID char code sum
if (!item.id) return "新春头像";
if (!item.id) return "精美头像";
let sum = 0;
for (let i = 0; i < item.id.length; i++) {
sum += item.id.charCodeAt(i);

View File

@@ -1,6 +1,6 @@
<template>
<view class="greeting-page">
<NavBar title="我的新春祝福" background="transparent" />
<NavBar title="我的真挚祝福" background="transparent" />
<!-- Header Stats -->
<view class="header-stats">
@@ -19,7 +19,7 @@
</view>
<view class="divider"></view>
<view class="stats-right">
<text class="label">马年运势</text>
<text class="label">今日运势</text>
<text class="value red-text">一马当先</text>
</view>
</view>
@@ -79,7 +79,7 @@
</view>
<view class="footer-note" v-if="!loading && list.length > 0">
<text>2026 丙午马年 · 祝福管理助手</text>
<text>2026 精美头像壁纸祝福</text>
</view>
</view>
@@ -87,7 +87,7 @@
<view class="fab-btn" @tap="onMake">
<view class="fab-content">
<text class="fab-emoji"></text>
<text>新春制作</text>
<text>快速制作</text>
</view>
</view>
</view>
@@ -146,7 +146,7 @@ onShareAppMessage(async (options) => {
const shareToken = await getShareToken("greeting_page", "");
getShareReward({ scene: "greeting_page" });
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -197,12 +197,12 @@ const formatDate = (dateStr) => {
const getTagText = (item) => {
// if (item.status === "draft") return "草稿";
return item?.title?.name || item.festival || "新春快乐";
return item?.title?.name || item.festival || "真挚祝福";
};
const getTitle = (item) => {
const title =
(item?.blessingTo || "祝您") + (item?.content?.content || "新春快乐");
(item?.blessingTo || "祝您") + (item?.content?.content || "万事如意");
return title.length > 10 ? title.substring(0, 10) + "..." : title;
};

View File

@@ -122,9 +122,9 @@
<view class="footer">
<view class="footer-blessing">
<uni-icons type="vip-filled" size="14" color="#ff3b30" />
<text>祝您2026新春大吉万事如意</text>
<text>祝您 万事大吉万事如意</text>
</view>
<view class="footer-copy">2026 丙午马年 · 官方出品</view>
<view class="footer-copy">官方出品</view>
</view>
</view>
</view>
@@ -193,6 +193,11 @@ const faqList = ref([
},
]);
const copyright = [
"如有疑问,请通过“我的-使用说明”联系客服处理。",
"最终解释权归 2026 助手团队所有。",
];
const toggleCategory = (index) => {
faqList.value[index].expanded = !faqList.value[index].expanded;
};

View File

@@ -65,22 +65,22 @@
<view class="menu-group">
<view class="menu-item" @tap="navTo('greetings')">
<view class="icon-box red-bg"><text>🧧</text></view>
<text class="menu-text">我的新春祝福</text>
<text class="menu-text">我的美好祝福</text>
<text class="arrow"></text>
</view>
<view class="menu-item" @tap="navTo('fortune-record')">
<view class="icon-box orange-bg"><text>📹</text></view>
<text class="menu-text">我的新年运势</text>
<text class="menu-text">我的每日运势</text>
<text class="arrow"></text>
</view>
<view class="menu-item" @tap="navTo('avatar')">
<view class="icon-box pink-bg"><text></text></view>
<text class="menu-text">我的新春头像</text>
<text class="menu-text">我的专属头像</text>
<text class="arrow"></text>
</view>
<view class="menu-item" @tap="navTo('wallpaper')">
<view class="icon-box yellow-bg"><text>🖼</text></view>
<text class="menu-text">我的新春壁纸</text>
<text class="menu-text">我的精美壁纸</text>
<view class="new-badge">NEW</view>
<text class="arrow"></text>
</view>
@@ -121,7 +121,7 @@
</view>
<!-- Footer -->
<view class="version-info">2026 丙午马年 · 新春助手 v1.0.2</view>
<!-- <view class="version-info">2026 丙午马年 · 精美助手 v1.0.2</view> -->
<!-- Bottom Spacer for TabBar -->
<view style="height: 120rpx"></view>
@@ -177,7 +177,7 @@ onShareAppMessage(async () => {
const shareToken = await getShareToken("mine");
getShareReward({ scene: "mine" });
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: "/pages/index/index?shareToken=" + shareToken,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",

View File

@@ -1,5 +1,5 @@
<template>
<view class="profile-page" >
<view class="profile-page">
<NavBar title="个人信息" />
<!-- Content -->
@@ -39,7 +39,7 @@
</view>
</view> -->
<!-- <view class="info-item" @click="handleEditManifesto">
<text class="label">新春宣言</text>
<text class="label">个性宣言</text>
<view class="value-box">
<text class="value red-text">{{ form.bio || "点击选择" }}</text>
<uni-icons type="compose" size="16" color="#ccc" />
@@ -186,7 +186,7 @@ const handleSave = async () => {
const originalForm = {
nickName: userInfo.value.nickName || "",
gender: userInfo.value.gender || 1,
bio: userInfo.value.bio || "万事如意,岁岁平安"
bio: userInfo.value.bio || "万事如意,岁岁平安",
};
try {
@@ -204,7 +204,7 @@ const handleSave = async () => {
} else {
// 恢复之前的内容
form.value = { ...originalForm };
uni.showToast({ title: res.message || '修改失败', icon: "none" });
uni.showToast({ title: res.message || "修改失败", icon: "none" });
uni.hideLoading();
}
} catch (e) {

View File

@@ -148,7 +148,7 @@ const notes = [
"会员服务为虚拟产品,支付后立即生效,不支持退款。",
"会员权益在有效期内全平台通用。",
"如有疑问,请通过“我的-使用说明”联系客服处理。",
"最终解释权归 2026 新春助手团队所有。",
"最终解释权归 本平台所有。",
];
onMounted(() => {

View File

@@ -30,7 +30,11 @@
class="grid-item"
@tap="onPreview(item)"
>
<image :src="item.imageUrl" mode="aspectFill" class="wallpaper-img" />
<image
:src="getThumbUrl(item.imageUrl)"
mode="aspectFill"
class="wallpaper-img"
/>
<view class="date-badge">
<text>{{ formatDate(item.createdAt) }}</text>
</view>
@@ -81,6 +85,10 @@ onReachBottom(() => {
loadMore();
});
const getThumbUrl = (url) => {
return `${url}?imageView2/1/w/340/h/600/q/80`;
};
const fetchList = async (reset = false) => {
if (loading.value) return;
if (reset) {

View File

@@ -142,7 +142,7 @@ const features = ref([
type: "avatar_decor",
},
{
title: "马年主题头像框",
title: "主题头像框",
subtitle: "2026限定",
icon: "https://file.lihailezzc.com/resource/9f80ab295b7e0a7a5f62c3b0f2d7a11c.png",
type: "avatar_frame",
@@ -235,7 +235,7 @@ onShareAppMessage(async () => {
const shareToken = await getShareToken("spring_index");
getShareReward({ scene: "spring_index" });
return {
title: "2026 丙午马年,送你一份新春祝福 🎊",
title: "送你一份美好祝福 🎊",
path: `/pages/spring/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -245,7 +245,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const shareToken = await getShareToken("spring_timeline");
return {
title: "2026 丙午马年,送你一份新春祝福 🎊",
title: "送你一份美好祝福 🎊",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",

View File

@@ -25,8 +25,8 @@
<view class="nickname">{{
detailData.from.nickname || "神秘好友"
}}</view>
<view class="action-text">给你分享了一张2026新春精美壁纸</view>
<view class="sub-text"> 2026 且马贺岁</view>
<view class="action-text">给你分享了一张精美壁纸</view>
<view class="sub-text"> 幸运每一天</view>
</view>
</view>
@@ -80,7 +80,7 @@
mode="aspectFill"
class="scroll-img"
/>
<text class="item-title">{{ item.title || "新春壁纸" }}</text>
<text class="item-title">{{ item.title || "精美壁纸" }}</text>
</view>
</view>
</scroll-view>
@@ -93,7 +93,7 @@
<text class="footer-text">2026 HAPPY NEW YEAR</text>
<view class="line"></view>
</view>
<view class="footer-sub">新春祝福 · 传递温情</view>
<view class="footer-sub">精美壁纸 · 传递温情</view>
</view>
</view>
<LoginPopup ref="loginPopupRef" @logind="handleLogind" />
@@ -158,7 +158,7 @@ onShareAppMessage(async () => {
const token = await getShareToken("wallpaper_download", detailData.value?.id);
getShareReward({ scene: "wallpaper_download" });
return {
title: "快来看看我刚领到的新年精美壁纸 🖼",
title: "快来看看我刚领到的精美壁纸 🖼",
path: `/pages/wallpaper/detail?shareToken=${token || ""}`,
imageUrl:
detailData.value?.imageUrl ||
@@ -169,7 +169,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const token = await getShareToken("wallpaper_download", detailData.value?.id);
return {
title: "快来看看我刚领到的新年精美壁纸 🖼",
title: "快来看看我刚领到的精美壁纸 🖼",
query: `shareToken=${token}`,
imageUrl:
detailData.value?.imageUrl ||
@@ -288,10 +288,7 @@ const downloadWallpaper = async () => {
return;
}
const canProceed = await checkAbilityAndHandle(
"wallpaper_download",
rewardAdRef,
);
const canProceed = await checkAbilityAndHandle("wallpaper_download");
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });

View File

@@ -132,7 +132,7 @@ onShareAppMessage(async (options) => {
if (!isLoggedIn.value) {
const shareToken = await getShareToken("wallpaper_download_index", "");
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "好运已送达 🎊|祝福卡·头像·壁纸",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -145,13 +145,13 @@ onShareAppMessage(async (options) => {
options?.target?.dataset?.item?.id,
);
return {
title: "快来挑选喜欢的新春壁纸吧",
title: "快来挑选喜欢的壁纸吧",
path: `/pages/wallpaper/detail?shareToken=${shareToken}`,
};
} else {
const shareToken = await getShareToken("wallpaper_download_index", "");
return {
title: "新年好运已送达 🎊|祝福卡·头像·壁纸",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
path: `/pages/index/index?shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -162,7 +162,7 @@ onShareAppMessage(async (options) => {
onShareTimeline(async () => {
const shareToken = await getShareToken("wallpaper_timeline");
return {
title: "精选新年壁纸,让手机也过年 🖼",
title: "送你一份好运祝福 🎁|头像·壁纸·祝福卡",
query: `shareToken=${shareToken}`,
imageUrl:
"https://file.lihailezzc.com/resource/8dd026d76ef7a63d123b7fd698fb989b.png",
@@ -304,10 +304,7 @@ const downloadWallpaper = async (item) => {
return;
}
const canProceed = await checkAbilityAndHandle(
"wallpaper_download",
rewardAdRef,
);
const canProceed = await checkAbilityAndHandle("wallpaper_download");
if (!canProceed) return;
uni.showLoading({ title: "下载中..." });

View File

@@ -25,8 +25,8 @@
<view class="nickname">{{
detailData.from.nickname || "神秘好友"
}}</view>
<view class="action-text">给你分享了一张2026新春精美壁纸</view>
<view class="sub-text"> 2026 且马贺岁</view>
<view class="action-text">给你分享了一张精美壁纸</view>
<view class="sub-text"> 幸运每一天</view>
</view>
</view>
@@ -52,7 +52,7 @@
<!-- More Wallpapers -->
<view class="more-section">
<view class="section-header">
<text class="section-title">我也要领新春壁纸</text>
<text class="section-title">我也要领精美壁纸</text>
<view class="more-link" @tap="goToIndex">
<text>查看更多</text>
<text class="arrow"></text>
@@ -71,7 +71,7 @@
mode="aspectFill"
class="scroll-img"
/>
<text class="item-title">{{ item.title || "新春壁纸" }}</text>
<text class="item-title">{{ item.title || "精美壁纸" }}</text>
</view>
</view>
</scroll-view>
@@ -84,8 +84,8 @@
<text>🏮</text>
</view>
<view class="banner-content">
<text class="banner-title">去抽取新年运势</text>
<text class="banner-desc">每日一签开启你的新年好运</text>
<text class="banner-title">去抽取每日运势</text>
<text class="banner-desc">每日一签开启你的满满好运</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -94,8 +94,8 @@
<text>🧧</text>
</view>
<view class="banner-content">
<text class="banner-title">制作新年贺卡</text>
<text class="banner-desc">定制专属祝福传递浓浓年味</text>
<text class="banner-title">制作一张祝福贺卡</text>
<text class="banner-desc">写下心意把祝福送给重要的人</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -104,8 +104,8 @@
<text>🖼</text>
</view>
<view class="banner-content">
<text class="banner-title">去挑选新年头像</text>
<text class="banner-desc">精选新年头像让手机也过年</text>
<text class="banner-title">换个好看头像</text>
<text class="banner-desc">精选头像合集找到你的专属风格</text>
</view>
<text class="banner-arrow"></text>
</view>
@@ -117,7 +117,7 @@
<text class="footer-text">2026 HAPPY NEW YEAR</text>
<view class="line"></view>
</view>
<view class="footer-sub">新春祝福 · 传递温情</view>
<view class="footer-sub">精美壁纸 · 传递温情</view>
</view>
</view>
</view>
@@ -152,7 +152,7 @@ onShareAppMessage(async () => {
const token = await getShareToken("wallpaper_download", detailData.value?.id);
getShareReward({ scene: "wallpaper_download" });
return {
title: "快来看看我刚领到的新年精美壁纸 🖼",
title: "快来看看我刚领到的精美壁纸 🖼",
path: `/pages/wallpaper/detail?shareToken=${token || ""}`,
imageUrl:
detailData.value?.imageUrl ||
@@ -163,7 +163,7 @@ onShareAppMessage(async () => {
onShareTimeline(async () => {
const token = await getShareToken("wallpaper_download", detailData.value?.id);
return {
title: "快来看看我刚领到的新年精美壁纸 🖼",
title: "快来看看我刚领到的精美壁纸 🖼",
query: `shareToken=${token}`,
imageUrl:
detailData.value?.imageUrl ||

View File

@@ -57,6 +57,7 @@ export const useUserStore = defineStore("user", {
},
async fetchUserAssets() {
try {
console.log("fetchUserAssets userInfo", this.userInfo);
if (!this?.userInfo?.id) return;
const res = await getUserAsset();
if (res) {

View File

@@ -1,14 +1,14 @@
import { abilityCheck } from "@/api/system";
import adManager from "@/utils/adManager";
/**
* Checks if a user has the ability to perform an action (e.g., download).
* Handles common blocking scenarios like "need_share" or "need_ad".
*
* @param {string} scene - The scene identifier for the ability check (e.g., "wallpaper_download").
* @param {Object} rewardAdRef - The ref to the RewardAd component (must have a .value.show() method or be the instance itself).
* @returns {Promise<boolean>} - Returns true if the action can proceed, false otherwise.
*/
export const checkAbilityAndHandle = async (scene, rewardAdRef) => {
export const checkAbilityAndHandle = async (scene) => {
try {
const abilityRes = await abilityCheck(scene);
if (abilityRes.canUse) {
@@ -35,19 +35,7 @@ export const checkAbilityAndHandle = async (scene, rewardAdRef) => {
content: "观看广告可获得50积分继续下载",
success: (res) => {
if (res.confirm) {
// Check if rewardAdRef is a ref (has .value) or the component instance itself
if (
rewardAdRef &&
rewardAdRef.value &&
typeof rewardAdRef.value.show === "function"
) {
rewardAdRef.value.show();
} else if (rewardAdRef && typeof rewardAdRef.show === "function") {
rewardAdRef.show();
} else {
console.error("RewardAd component reference is invalid");
uni.showToast({ title: "广告加载失败", icon: "none" });
}
adManager.showVideoAd();
}
},
});
@@ -80,3 +68,26 @@ export const checkAbilityAndHandle = async (scene, rewardAdRef) => {
return false;
}
};
/**
* Gets the display label for an unlock type.
* @param {string} unlockType - The unlock type identifier.
* @returns {string} - The display label.
*/
export const getUnlockLabel = (unlockType) => {
if (!unlockType) return "解锁";
switch (unlockType) {
case "sing3":
return "连续签到3天";
case "sing5":
return "连续签到5天";
case "sing7":
return "连续签到7天";
case "ad":
return "广告";
case "vip":
return "VIP";
default:
return "解锁";
}
};

107
utils/adManager.js Normal file
View File

@@ -0,0 +1,107 @@
import { watchAdStart, watchAdReward } from "@/api/system.js";
import { useUserStore } from "@/stores/user";
class AdManager {
constructor() {
this.videoAd = null;
this.rewardToken = "";
this.isLoaded = false;
this.adUnitId = "adunit-d7a28e0357d98947"; // Default ID from RewardAd.vue
this._init();
}
_init() {
if (uni.createRewardedVideoAd) {
this.videoAd = uni.createRewardedVideoAd({
adUnitId: this.adUnitId,
});
this.videoAd.onLoad(() => {
console.log("Ad Manager: Ad Loaded");
this.isLoaded = true;
});
this.videoAd.onError((err) => {
console.error("Ad Manager: Ad Load Error", err);
this.isLoaded = false;
});
}
}
/**
* Show the rewarded video ad.
* Handles the full flow: start session -> show ad -> verify completion -> claim reward -> refresh assets.
* @returns {Promise<boolean>} Resolves with true if reward was claimed, false otherwise.
*/
async showVideoAd() {
if (!this.videoAd) {
uni.showToast({ title: "当前环境不支持广告", icon: "none" });
return false;
}
try {
// Step 1: Start Ad Session
const startRes = await watchAdStart();
if (!startRes || !startRes.rewardToken) {
uni.showToast({ title: "广告启动失败,请稍后再试", icon: "none" });
return false;
}
this.rewardToken = startRes.rewardToken;
// Step 2: Show Ad
try {
await this.videoAd.show();
} catch (e) {
// Retry load and show
await this.videoAd.load();
await this.videoAd.show();
}
// Step 3: Wait for Close
return new Promise((resolve) => {
const onCloseHandler = async (res) => {
this.videoAd.offClose(onCloseHandler); // Clean up listener
if (res && res.isEnded) {
// Step 4: Claim Reward
await this._claimReward(this.rewardToken);
resolve(true);
} else {
uni.showToast({ title: "观看完整广告才能获取奖励哦", icon: "none" });
resolve(false);
}
};
this.videoAd.onClose(onCloseHandler);
});
} catch (e) {
console.error("Ad Manager: Show failed", e);
uni.showToast({ title: "广告加载失败,请稍后再试", icon: "none" });
return false;
}
}
async _claimReward(token) {
try {
uni.showLoading({ title: "发放奖励中..." });
const res = await watchAdReward(token);
if (res) {
uni.showToast({
title: "获得50积分",
icon: "success",
});
// Refresh user assets
const userStore = useUserStore();
await userStore.fetchUserAssets();
}
} catch (e) {
console.error("Ad Manager: Reward claim failed", e);
uni.showToast({ title: "奖励发放失败", icon: "none" });
} finally {
uni.hideLoading();
}
}
}
export default new AdManager();