feat: 修改两处海报logo-text图片、修改创建球局后跳转详情页打开分享弹窗位置、修改分享二维码接口取值、修改ntrp修改弹窗的初始值、增加复制链接功能
This commit is contained in:
@@ -18,7 +18,6 @@ import { formatNtrpDisplay } from "@/utils/helper";
|
||||
import { waitForAuthInit } from "@/utils/authInit";
|
||||
import httpService from "@/services/httpService";
|
||||
import DetailService from "@/services/detailService";
|
||||
import { base64ToTempFilePath } from "@/utils/genPoster";
|
||||
import { OSS_BASE_URL } from "@/config/api";
|
||||
import CloseIcon from "@/static/ntrp/ntrp_close_icon.svg";
|
||||
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
||||
@@ -38,7 +37,7 @@ const sourceTypeToTextMap = new Map([
|
||||
|
||||
function adjustRadarLabels(
|
||||
source: [string, number][],
|
||||
topK: number = 4 // 默认挑前4个最长的标签保护
|
||||
topK: number = 4, // 默认挑前4个最长的标签保护
|
||||
): [string, number][] {
|
||||
if (source.length === 0) return source;
|
||||
|
||||
@@ -216,8 +215,9 @@ function Intro() {
|
||||
});
|
||||
}
|
||||
Taro.redirectTo({
|
||||
url: `/other_pages/ntrp-evaluate/index?stage=${type}${type === StageType.RESULT ? `&id=${id}` : ""
|
||||
}`,
|
||||
url: `/other_pages/ntrp-evaluate/index?stage=${type}${
|
||||
type === StageType.RESULT ? `&id=${id}` : ""
|
||||
}`,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ function Test() {
|
||||
prev.map((item, pIndex) => ({
|
||||
...item,
|
||||
...(pIndex === index ? { choosen: i } : {}),
|
||||
}))
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -522,13 +522,14 @@ function Result() {
|
||||
page: "other_pages/ntrp-evaluate/index",
|
||||
scene: `stage=${StageType.INTRO}`,
|
||||
});
|
||||
if (qrCodeUrlRes.code === 0 && qrCodeUrlRes.data?.qr_code_base64) {
|
||||
// 将 base64 转换为临时文件路径
|
||||
const tempFilePath = await base64ToTempFilePath(
|
||||
qrCodeUrlRes.data.qr_code_base64
|
||||
);
|
||||
setQrCodeUrl(tempFilePath);
|
||||
}
|
||||
setQrCodeUrl(qrCodeUrlRes.data.ossPath);
|
||||
// if (qrCodeUrlRes.code === 0 && qrCodeUrlRes.data?.qr_code_base64) {
|
||||
// // 将 base64 转换为临时文件路径
|
||||
// const tempFilePath = await base64ToTempFilePath(
|
||||
// qrCodeUrlRes.data.qr_code_base64
|
||||
// );
|
||||
// setQrCodeUrl(tempFilePath);
|
||||
// }
|
||||
} catch (error) {
|
||||
console.error("获取二维码失败:", error);
|
||||
}
|
||||
@@ -542,13 +543,17 @@ function Result() {
|
||||
const sortOrder = res.data.sort || [];
|
||||
const abilities = res.data.radar_data.abilities;
|
||||
const sortedKeys = sortOrder.filter((k) => k in abilities);
|
||||
const remainingKeys = Object.keys(abilities).filter((k) => !sortOrder.includes(k));
|
||||
const remainingKeys = Object.keys(abilities).filter(
|
||||
(k) => !sortOrder.includes(k),
|
||||
);
|
||||
const allKeys = [...sortedKeys, ...remainingKeys];
|
||||
let radarData: [string, number][] = allKeys.map((key) => [
|
||||
key,
|
||||
Math.min(
|
||||
100,
|
||||
Math.floor((abilities[key].current_score / abilities[key].max_score) * 100)
|
||||
Math.floor(
|
||||
(abilities[key].current_score / abilities[key].max_score) * 100,
|
||||
),
|
||||
),
|
||||
]);
|
||||
// 直接使用接口 sort 顺序,不经过 adjustRadarLabels 重新排序
|
||||
@@ -590,7 +595,7 @@ function Result() {
|
||||
if (!userInfo?.phone) {
|
||||
Taro.redirectTo({
|
||||
url: `/login_pages/index/index?redirect=${encodeURIComponent(
|
||||
`/main_pages/index`
|
||||
`/main_pages/index`,
|
||||
)}`,
|
||||
});
|
||||
clear();
|
||||
@@ -615,11 +620,12 @@ function Result() {
|
||||
page: "other_pages/ntrp-evaluate/index",
|
||||
scene: `stage=${StageType.INTRO}`,
|
||||
});
|
||||
if (qrCodeUrlRes.code === 0 && qrCodeUrlRes.data?.qr_code_base64) {
|
||||
finalQrCodeUrl = await base64ToTempFilePath(
|
||||
qrCodeUrlRes.data.qr_code_base64
|
||||
);
|
||||
}
|
||||
finalQrCodeUrl = qrCodeUrlRes.data.ossPath;
|
||||
// if (qrCodeUrlRes.code === 0 && qrCodeUrlRes.data?.qr_code_base64) {
|
||||
// finalQrCodeUrl = await base64ToTempFilePath(
|
||||
// qrCodeUrlRes.data.qr_code_base64
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
// 使用 RadarV2 的 generateFullImage 方法生成完整图片
|
||||
@@ -700,12 +706,13 @@ function Result() {
|
||||
}
|
||||
const currentPage = getCurrentFullPath();
|
||||
Taro.redirectTo({
|
||||
url: `/login_pages/index/index${currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
|
||||
}`,
|
||||
url: `/login_pages/index/index${
|
||||
currentPage ? `?redirect=${encodeURIComponent(currentPage)}` : ""
|
||||
}`,
|
||||
});
|
||||
}
|
||||
|
||||
function handleGo() { }
|
||||
function handleGo() {}
|
||||
|
||||
return (
|
||||
<View className={styles.resultContainer}>
|
||||
@@ -763,7 +770,8 @@ function Result() {
|
||||
{userInfo?.phone ? (
|
||||
<View className={styles.updateTip}>
|
||||
<Text>
|
||||
你的 NTRP 水平已更新为 {formatNtrpDisplay(result?.ntrp_level || "")}{" "}
|
||||
你的 NTRP 水平已更新为{" "}
|
||||
{formatNtrpDisplay(result?.ntrp_level || "")}{" "}
|
||||
</Text>
|
||||
<Text className={styles.grayTip}>(可在个人信息中修改)</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user