feat: test popup not done
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user