feat: test popup not done

This commit is contained in:
2025-09-30 14:07:42 +08:00
parent 9fef267cf6
commit 4b31141287
9 changed files with 306 additions and 24 deletions

View File

@@ -28,6 +28,16 @@ enum StageType {
RESULT = "result",
}
enum SourceType {
DETAIL = 'detail',
PUBLISH = 'publish',
}
const sourceTypeToTextMap = new Map([
[SourceType.DETAIL, '继续加入球局'],
[SourceType.PUBLISH, '继续发布球局'],
])
function adjustRadarLabels(
source: [string, number][],
topK: number = 4 // 默认挑前4个最长的标签保护
@@ -369,9 +379,8 @@ function Test(props) {
}
function Result(props) {
const { redirect } = props;
const { params } = useRouter();
const { id } = params;
const { id, type, redirect } = params;
const userInfo = useUserInfo();
const { fetchUserInfo } = useUserActions();
const radarRef = useRef();
@@ -428,6 +437,14 @@ function Result(props) {
});
}
function handleGoon () {
if (type) {
Taro.redirectTo({ url: redirect })
} else {
handleViewGames()
}
}
async function genCardImage() {
return new Promise(async (resolve, reject) => {
const url = await radarRef.current.generateImage();
@@ -558,8 +575,8 @@ function Result(props) {
</View>
)}
<View className={styles.actions}>
<View className={styles.viewGame} onClick={handleViewGames}>
<Button className={styles.viewGameBtn}></Button>
<View className={styles.viewGame} onClick={handleGoon}>
<Button className={styles.viewGameBtn}>{sourceTypeToTextMap.get(type) || '去看看球局'}</Button>
</View>
<View className={styles.otherActions}>
<View className={styles.share}>