feat: 详情页分享海报重新绘制

This commit is contained in:
2025-11-25 11:29:25 +08:00
parent dcbcbb49f6
commit 2c739255b7
2 changed files with 150 additions and 39 deletions

View File

@@ -4,6 +4,7 @@ import { View, Image, Text, Button } from "@tarojs/components";
import Taro, { useRouter } from "@tarojs/taro";
import classnames from "classnames";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import { generatePosterImage, base64ToTempFilePath, delay } from "@/utils";
import { withAuth } from "@/components";
import GeneralNavbar from "@/components/GeneralNavbar";
@@ -17,6 +18,8 @@ import { genNTRPRequirementText } from "@/utils/helper";
import { waitForAuthInit } from "@/utils/authInit";
import styles from "./index.module.scss";
dayjs.locale("zh-cn");
function SharePoster(props) {
const [url, setUrl] = useState("");
const { fetchUserInfo } = useUserActions();
@@ -63,8 +66,9 @@ function SharePoster(props) {
playType: play_type,
ntrp: `NTRP ${genNTRPRequirementText(skill_level_min, skill_level_max)}`,
mainCoursal:
image_list[0] ||
"https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png",
image_list[0] && image_list[0].startsWith("http")
? image_list[0]
: "https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/0621b8cf-f7d6-43ad-b852-7dc39f29a782.png",
nickname,
avatarUrl: avatar_url,
title,
@@ -84,10 +88,7 @@ function SharePoster(props) {
return (
<>
<GeneralNavbar
title="生成分享图"
className={styles.navbar}
/>
<GeneralNavbar title="生成分享图" className={styles.navbar} />
{url && (
<View className={styles.posterContainer}>
<View className={styles.posterWrap}>