Files
mini-programs/src/components/NTRPPopupGuide/index.tsx
2025-10-01 09:37:28 +08:00

92 lines
3.0 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from "react";
import { View, Text, Button, Image } from "@tarojs/components";
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { useUserInfo } from "@/store/userStore";
import { useEvaluate, EvaluateCallback } from "@/store/evaluateStore";
import { delay } from "@/utils";
import ArrwoRight from "@/static/ntrp/ntrp_arrow_right.svg";
import CloseIcon from "@/static/ntrp/ntrp_popup_close.svg";
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
import styles from "./index.module.scss";
function NtrpPopupGuide(props: {
close: () => void;
skipGuide: () => void;
evaluateCallback: EvaluateCallback;
}) {
const { close, skipGuide, evaluateCallback } = props;
const userInfo = useUserInfo();
const { setCallback } = useEvaluate();
async function handleTest() {
setCallback(evaluateCallback);
Taro.navigateTo({
url: `/other_pages/ntrp-evaluate/index?stage=test`,
});
await delay(1000);
close();
}
return (
<View className={styles.container} onClick={(e) => e.stopPropagation()}>
<View className={styles.header}>
<View className={styles.closeBtn} onClick={close}>
<Image className={styles.closeIcon} src={CloseIcon} />
</View>
</View>
<View className={styles.top}>
<View className={styles.avatarWrap}>
<View className={styles.avatar}>
<Image
className={styles.avatarUrl}
src={userInfo.avatar_url}
mode="aspectFit"
/>
</View>
{/* avatar side */}
<View className={styles.addonImage}>
<Image
className={styles.docImage}
src={DocCopy}
mode="aspectFill"
/>
</View>
</View>
<View className={styles.guideMsg}>
<View className={styles.title}>
<Text></Text>
</View>
<View className={styles.title}>
<Text></Text>
<Text className={styles.colorTip}> (</Text>
<Text className={styles.strongTip}>NTRP</Text>
<Text className={styles.colorTip}>) </Text>
<Text>?</Text>
</View>
</View>
<View className={styles.desc}>
<Text> NTRP </Text>
</View>
</View>
<View className={styles.bottom}>
<View className={styles.jump}>
<Button
className={classnames(styles.button, styles.primary)}
onClick={handleTest}
>
<Text></Text>
<Image className={styles.jumpIcon} src={ArrwoRight} />
</Button>
</View>
<View className={styles.direct}>
<Button className={classnames(styles.button)} onClick={skipGuide}>
<Text></Text>
</Button>
</View>
</View>
</View>
);
}
export default NtrpPopupGuide;