This commit is contained in:
2025-11-22 15:46:23 +08:00
parent b2b665dfb6
commit cba231ab3d
11 changed files with 197 additions and 127 deletions

View File

@@ -8,16 +8,17 @@ interface IProps {
errorImg?: string;
btnText?: string;
btnImg?: string;
height?: string
}
const ListLoadError = (props: IProps) => {
const { reload, text, errorImg, btnText, btnImg } = props;
const { reload, text, errorImg, btnText, btnImg, height = "unset" } = props;
const handleReload = () => {
reload && typeof reload === "function" && reload();
};
return (
<View className={styles.listLoadError}>
<View className={styles.listLoadError} style={{ height }}>
<Image
className={styles.listLoadErrorImg}
src={errorImg ? img[errorImg] : img.ICON_LIST_LOAD_ERROR}

View File

@@ -18,10 +18,11 @@ import styles from "./index.module.scss";
function NTRPTestEntryCard(props: {
type: EvaluateScene;
evaluateCallback?: EvaluateCallback;
callback?: (flag) => void;
}) {
const [testFlag, setTestFlag] = useState(false);
const [hasTestInLastMonth, setHasTestInLastMonth] = useState(false);
const { type, evaluateCallback } = props;
const { type, evaluateCallback, callback } = props;
const userInfo = useUserInfo();
const { setCallback } = useEvaluate();
const { fetchUserInfo } = useUserActions();
@@ -41,6 +42,7 @@ function NTRPTestEntryCard(props: {
if (res.code === 0) {
setTestFlag(res.data.has_test_record);
setHasTestInLastMonth(res.data.has_test_in_last_month);
callback?.(res.data.has_test_in_last_month);
}
};
init();

View File

@@ -52,6 +52,7 @@ const PopupPicker = ({
const [defaultValue, setDefaultValue] = useState<(string | number)[]>([]);
const [defaultOptions, setDefaultOptions] = useState<PickerOption[][]>([]);
const [pickerCurrentValue, setPickerCurrentValue] = useState<(string | number)[]>(value);
const [tested, setTested] = useState(false)
const changePicker = (options: any[], values: any, columnIndex: number) => {
// 更新 Picker 的当前值
@@ -126,6 +127,9 @@ const PopupPicker = ({
}
}
}, [visible, value]);
const callback = (tested: boolean) => {
setTested(tested)
}
return (
<>
<CommonPopup
@@ -142,9 +146,9 @@ const PopupPicker = ({
zIndex={1000}
style={style}
>
{type === "ntrp" && (
{type === "ntrp" && !tested && (
<View className={styles.evaluateCardWrap}>
<NTRPTestEntryCard type={EvaluateScene.userEdit} />
<NTRPTestEntryCard callback={(flag) => callback(flag)} type={EvaluateScene.userEdit} />
</View>
// <View className={`${styles["examination-btn"]}}`}>
// <View className={`${styles["text-container"]}}`}>

View File

@@ -486,7 +486,7 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
<Text></Text>
</View>
) : null}
{user_info.ntrp_level !== "0" ? (
{user_info.ntrp_level !== "" ? (
<View
className="tag_item"
onClick={() => {