fix: avatar page

This commit is contained in:
zzc
2026-01-31 22:01:02 +08:00
parent 1c42598335
commit f9453bae82
4 changed files with 13 additions and 8 deletions

View File

@@ -10,7 +10,7 @@
> >
<view class="nav-content"> <view class="nav-content">
<view class="back" @tap="goBack"></view> <view class="back" @tap="goBack"></view>
<text class="nav-title">新春头像详情</text> <text class="nav-title">专属头像</text>
</view> </view>
</view> </view>
@@ -261,6 +261,9 @@ const goToWallpaper = () => {
margin-right: 24rpx; margin-right: 24rpx;
line-height: 1; line-height: 1;
color: #333; color: #333;
/* 增大点击区域 */
padding: 20rpx;
margin-left: -20rpx;
} }
.nav-title { .nav-title {

View File

@@ -666,6 +666,7 @@ const completeCardInfo = async (id) => {
decorId: selectedDecor?.value?.id, decorId: selectedDecor?.value?.id,
frameId: selectedFrame?.value?.id, frameId: selectedFrame?.value?.id,
}); });
return imageUrl;
}; };
onShareAppMessage(async () => { onShareAppMessage(async () => {
@@ -677,17 +678,18 @@ onShareAppMessage(async () => {
path: `/pages/index/index?shareToken=${shareTokenRes.shareToken}`, path: `/pages/index/index?shareToken=${shareTokenRes.shareToken}`,
}; };
} }
uni.showLoading({ title: "分享中...", mask: true });
const id = createAvatarId(); const id = createAvatarId();
// const shareTokenRes = { // const shareTokenRes = {
// shareToken: "iFmK8WjRm6TK", // shareToken: "iFmK8WjRm6TK",
// }; // };
const shareTokenRes = await getShareToken("avatar_download", id); const shareTokenRes = await getShareToken("avatar_download", id);
completeCardInfo(id); const imageUrl = await completeCardInfo(id);
uni.hideLoading();
return { return {
title: "制作我的新春头像", title: "我做了一个新头像,真的太好看了",
path: `/pages/avatar/detail?shareToken=${shareTokenRes.shareToken}`, path: `/pages/avatar/detail?shareToken=${shareTokenRes.shareToken}`,
imageUrl: imageUrl, // 使用默认封面或 popularCards 的封面
"https://file.lihailezzc.com/resource/b48c41054c2633c478463ac1b1f1ca23.png", // 使用默认封面或 popularCards 的封面
}; };
}); });

View File

@@ -144,7 +144,7 @@ const goBack = () => {
}; };
const goHome = () => { const goHome = () => {
uni.reLaunch({ uni.switchTab({
url: "/pages/index/index", url: "/pages/index/index",
}); });
}; };

View File

@@ -1,5 +1,5 @@
// const BASE_URL = "https://api.ai-meng.com"; const BASE_URL = "https://api.ai-meng.com";
const BASE_URL = 'http://127.0.0.1:3999' // const BASE_URL = 'http://127.0.0.1:3999'
// const BASE_URL = "http://192.168.1.3:3999"; // const BASE_URL = "http://192.168.1.3:3999";
// const BASE_URL = "http://192.168.31.253:3999"; // const BASE_URL = "http://192.168.31.253:3999";
import { useUserStore } from "@/stores/user"; import { useUserStore } from "@/stores/user";