feat: 添加背景图片
This commit is contained in:
@@ -2,8 +2,13 @@ import React, { useState, useEffect, useCallback, memo } from "react";
|
||||
import { View, Image, Text } from "@tarojs/components";
|
||||
import { requireLoginWithPhone } from "@/utils/helper";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { useUserInfo, useUserActions, useLastTestResult } from "@/store/userStore";
|
||||
import {
|
||||
useUserInfo,
|
||||
useUserActions,
|
||||
useLastTestResult,
|
||||
} from "@/store/userStore";
|
||||
// import { getCurrentFullPath } from "@/utils";
|
||||
import { OSS_BASE_URL } from "@/config/api";
|
||||
import { StageType } from "@/services/evaluateService";
|
||||
import { waitForAuthInit } from "@/utils/authInit";
|
||||
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
|
||||
@@ -26,8 +31,6 @@ function NTRPTestEntryCard(props: {
|
||||
// 使用全局状态中的测试结果,避免重复调用接口
|
||||
const lastTestResult = useLastTestResult();
|
||||
|
||||
console.log(userInfo);
|
||||
|
||||
// 从全局状态中获取测试结果,如果不存在则调用接口(使用请求锁避免重复调用)
|
||||
useEffect(() => {
|
||||
const init = async () => {
|
||||
@@ -121,7 +124,7 @@ function NTRPTestEntryCard(props: {
|
||||
if (!testFlag && !userInfo.phone) {
|
||||
Taro.navigateTo({
|
||||
url: `/login_pages/index/index?redirect=${encodeURIComponent(
|
||||
`/other_pages/ntrp-evaluate/index?stage=${StageType.INTRO}`
|
||||
`/other_pages/ntrp-evaluate/index?stage=${StageType.INTRO}`,
|
||||
)}`,
|
||||
});
|
||||
return false;
|
||||
@@ -132,7 +135,7 @@ function NTRPTestEntryCard(props: {
|
||||
}`,
|
||||
});
|
||||
},
|
||||
[setCallback, testFlag, type, evaluateCallback, userInfo.phone]
|
||||
[setCallback, testFlag, type, evaluateCallback, userInfo.phone],
|
||||
);
|
||||
|
||||
// 如果最近一个月有测试记录,则不展示
|
||||
@@ -142,6 +145,12 @@ function NTRPTestEntryCard(props: {
|
||||
|
||||
return type === EvaluateScene.list ? (
|
||||
<View className={styles.higher} onClick={handleTest}>
|
||||
<View
|
||||
className={styles.lines}
|
||||
style={{
|
||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||
}}
|
||||
/>
|
||||
<View className={styles.desc}>
|
||||
<View>
|
||||
<View className={styles.title}>
|
||||
@@ -176,6 +185,12 @@ function NTRPTestEntryCard(props: {
|
||||
</View>
|
||||
) : (
|
||||
<View className={styles.lower} onClick={handleTest}>
|
||||
<View
|
||||
className={styles.lines}
|
||||
style={{
|
||||
backgroundImage: `url(${OSS_BASE_URL}/images/215f1ce1-be52-4a92-8250-5a4a69e7f2b3.png)`,
|
||||
}}
|
||||
/>
|
||||
<View className={styles.desc}>
|
||||
<View className={styles.title}>
|
||||
<Text>不知道自己的</Text>
|
||||
|
||||
Reference in New Issue
Block a user