4 Commits

Author SHA1 Message Date
ebb7116c25 Merge branch 'feat/liujie' 2026-02-02 11:24:17 +08:00
73bb56b1b2 feat: 添加背景图片 2026-02-02 11:02:58 +08:00
9cde3a606c Merge branch 'master' into feat/liujie 2026-02-02 09:54:22 +08:00
筱野
ee579df162 修改详情弹出 2026-02-01 23:56:47 +08:00
4 changed files with 97 additions and 39 deletions

View File

@@ -4,10 +4,39 @@
box-sizing: border-box; box-sizing: border-box;
border-radius: 20px; border-radius: 20px;
border: 0.5px solid rgba(0, 0, 0, 0.08); border: 0.5px solid rgba(0, 0, 0, 0.08);
background: linear-gradient(180deg, #BFFFEF 0%, #F2FFFC 100%), var(--Backgrounds-Primary, #FFF);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: relative;
background:
linear-gradient(180deg, #bfffef 0%, #f2fffc 100%),
var(--Backgrounds-Primary, #fff);
.lines {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 20px;
z-index: 1;
background-position-y: 85%;
pointer-events: none;
}
// .gradient {
// inset: 0;
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// z-index: -2;
// border-radius: 20px;
// background:
// linear-gradient(180deg, #bfffef 0%, #f2fffc 100%),
// var(--Backgrounds-Primary, #fff);
// pointer-events: none;
// }
} }
.higher { .higher {
@@ -18,8 +47,6 @@
.lower { .lower {
height: 80px; height: 80px;
@include commonCardStyle(); @include commonCardStyle();
} }
.desc { .desc {
@@ -30,7 +57,7 @@
gap: 7px; gap: 7px;
.title { .title {
color: #2A4D44; color: #2a4d44;
font-family: "Noto Sans SC"; font-family: "Noto Sans SC";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
@@ -38,7 +65,7 @@
line-height: 24px; line-height: 24px;
.colorTip { .colorTip {
color: #00E5AD; color: #00e5ad;
font-family: "Noto Sans SC"; font-family: "Noto Sans SC";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
@@ -47,7 +74,7 @@
} }
.strongTip { .strongTip {
color: #00E5AD; color: #00e5ad;
font-family: "Noto Sans SC"; font-family: "Noto Sans SC";
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
@@ -68,8 +95,10 @@
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
gap: 4px; gap: 4px;
color: #5CA693; color: #5ca693;
font-feature-settings: 'liga' off, 'clig' off; font-feature-settings:
"liga" off,
"clig" off;
font-family: "PingFang SC"; font-family: "PingFang SC";
font-size: 12px; font-size: 12px;
font-style: normal; font-style: normal;
@@ -94,7 +123,9 @@
border-radius: 50%; border-radius: 50%;
border: 1px solid #efefef; border: 1px solid #efefef;
overflow: hidden; overflow: hidden;
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.20), 0 8px 20px 0 rgba(0, 0, 0, 0.12); box-shadow:
0 0 1px 0 rgba(0, 0, 0, 0.2),
0 8px 20px 0 rgba(0, 0, 0, 0.12);
.avatarUrl { .avatarUrl {
width: calc(90px * $multiple); width: calc(90px * $multiple);
@@ -112,8 +143,14 @@
flex-shrink: 0; flex-shrink: 0;
aspect-ratio: 1/1; aspect-ratio: 1/1;
border-radius: calc(20px * $multiple); border-radius: calc(20px * $multiple);
border: 4px solid #FFF; border: 4px solid #fff;
background: linear-gradient(0deg, rgba(89, 255, 214, 0.20) 0%, rgba(89, 255, 214, 0.20) 100%), #FFF; background:
linear-gradient(
0deg,
rgba(89, 255, 214, 0.2) 0%,
rgba(89, 255, 214, 0.2) 100%
),
#fff;
box-shadow: 0 4px 36px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 4px 36px 0 rgba(0, 0, 0, 0.12);
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -2,8 +2,13 @@ import React, { useState, useEffect, useCallback, memo } from "react";
import { View, Image, Text } from "@tarojs/components"; import { View, Image, Text } from "@tarojs/components";
import { requireLoginWithPhone } from "@/utils/helper"; import { requireLoginWithPhone } from "@/utils/helper";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import { useUserInfo, useUserActions, useLastTestResult } from "@/store/userStore"; import {
useUserInfo,
useUserActions,
useLastTestResult,
} from "@/store/userStore";
// import { getCurrentFullPath } from "@/utils"; // import { getCurrentFullPath } from "@/utils";
import { OSS_BASE_URL } from "@/config/api";
import { StageType } from "@/services/evaluateService"; import { StageType } from "@/services/evaluateService";
import { waitForAuthInit } from "@/utils/authInit"; import { waitForAuthInit } from "@/utils/authInit";
import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg"; import DocCopy from "@/static/ntrp/ntrp_doc_copy.svg";
@@ -26,8 +31,6 @@ function NTRPTestEntryCard(props: {
// 使用全局状态中的测试结果,避免重复调用接口 // 使用全局状态中的测试结果,避免重复调用接口
const lastTestResult = useLastTestResult(); const lastTestResult = useLastTestResult();
console.log(userInfo);
// 从全局状态中获取测试结果,如果不存在则调用接口(使用请求锁避免重复调用) // 从全局状态中获取测试结果,如果不存在则调用接口(使用请求锁避免重复调用)
useEffect(() => { useEffect(() => {
const init = async () => { const init = async () => {
@@ -121,7 +124,7 @@ function NTRPTestEntryCard(props: {
if (!testFlag && !userInfo.phone) { if (!testFlag && !userInfo.phone) {
Taro.navigateTo({ Taro.navigateTo({
url: `/login_pages/index/index?redirect=${encodeURIComponent( 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; 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 ? ( return type === EvaluateScene.list ? (
<View className={styles.higher} onClick={handleTest}> <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 className={styles.desc}>
<View> <View>
<View className={styles.title}> <View className={styles.title}>
@@ -176,6 +185,12 @@ function NTRPTestEntryCard(props: {
</View> </View>
) : ( ) : (
<View className={styles.lower} onClick={handleTest}> <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.desc}>
<View className={styles.title}> <View className={styles.title}>
<Text></Text> <Text></Text>

View File

@@ -63,7 +63,6 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
area, area,
cityQrCode, cityQrCode,
districts, districts,
fetchMatches,
gamesNum, // 新增:获取球局数量 gamesNum, // 新增:获取球局数量
} = store; } = store;
@@ -78,7 +77,6 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
pageOption, pageOption,
isShowNoData, isShowNoData,
} = listPageState || {}; } = listPageState || {};
console.log('===matches', matches)
const scrollContextRef = useRef(null); const scrollContextRef = useRef(null);
const scrollViewRef = useRef(null); const scrollViewRef = useRef(null);
@@ -94,8 +92,6 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
// 记录上一次加载数据时的城市,用于检测城市变化 // 记录上一次加载数据时的城市,用于检测城市变化
const lastLoadedAreaRef = useRef<[string, string] | null>(null); const lastLoadedAreaRef = useRef<[string, string] | null>(null);
const prevIsActiveRef = useRef(isActive); const prevIsActiveRef = useRef(isActive);
// 首次加载标记:避免切回 tab 时使用 isRefresh 导致智能排序顺序抖动
const hasLoadedOnceRef = useRef(false);
// 处理距离筛选显示/隐藏 // 处理距离筛选显示/隐藏
const handleDistanceFilterVisibleChange = useCallback( const handleDistanceFilterVisibleChange = useCallback(
@@ -234,14 +230,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
// 只有当页面激活时才加载位置和列表数据 // 只有当页面激活时才加载位置和列表数据
if (isActive) { if (isActive) {
const firstLoad = !hasLoadedOnceRef.current; getLocation().catch((error) => {
getLocation(firstLoad)
.then(() => {
if (firstLoad) {
hasLoadedOnceRef.current = true;
}
})
.catch((error) => {
console.error('获取位置信息失败:', error); console.error('获取位置信息失败:', error);
}); });
} }
@@ -370,7 +359,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
}; };
}, []); }, []);
const getLocation = async (useRefresh = true) => { const getLocation = async () => {
const location = await getCurrentLocationInfo(); const location = await getCurrentLocationInfo();
updateState({ location }); updateState({ location });
if (location && location.latitude && location.longitude) { if (location && location.latitude && location.longitude) {
@@ -381,7 +370,7 @@ const ListPageContent: React.FC<ListPageContentProps> = ({
} }
} }
// 先调用列表接口 // 先调用列表接口
await fetchMatches({}, useRefresh); await getMatchesData();
// 列表接口完成后,再调用数量接口 // 列表接口完成后,再调用数量接口
await fetchGetGamesCount(); await fetchGetGamesCount();
// 初始数据加载完成后,记录当前城市 // 初始数据加载完成后,记录当前城市

View File

@@ -1,4 +1,4 @@
import React, { useState, useCallback, forwardRef, useImperativeHandle, useEffect } from 'react' import React, { useState, useCallback, forwardRef, useImperativeHandle } from 'react'
import Taro from '@tarojs/taro' import Taro from '@tarojs/taro'
import { View, Text, Image, ScrollView } from '@tarojs/components' import { View, Text, Image, ScrollView } from '@tarojs/components'
import images from '@/config/images' import images from '@/config/images'
@@ -70,6 +70,7 @@ const StadiumDetail = forwardRef<StadiumDetailRef, StadiumDetailProps>(({
onAnyInput onAnyInput
}, ref) => { }, ref) => {
const [openPicker, setOpenPicker] = useState(false); const [openPicker, setOpenPicker] = useState(false);
const [scrollTop, setScrollTop] = useState(0);
const { getDictionaryValue } = useDictionaryActions() const { getDictionaryValue } = useDictionaryActions()
const court_type = getDictionaryValue('court_type') || [] const court_type = getDictionaryValue('court_type') || []
const court_surface = getDictionaryValue('court_surface') || [] const court_surface = getDictionaryValue('court_surface') || []
@@ -170,14 +171,27 @@ const StadiumDetail = forwardRef<StadiumDetailRef, StadiumDetailProps>(({
const changeTextarea = (value) => {
if (value) {
// 先滚动到底部
setScrollTop(scrollTop ? scrollTop + 1 : 9999);
// 使用 setTimeout 确保滚动后再更新 openPicker
}
}
const changePicker = (value) => { const changePicker = (value) => {
setOpenPicker(value) setOpenPicker(value);
} }
console.log(stadium,'stadiumstadium'); console.log(stadium,'stadiumstadium');
return ( return (
<View className='stadium-detail'> <View className='stadium-detail'>
<ScrollView className='stadium-detail-scroll' refresherBackground="#FAFAFA" scrollY={!openPicker}> <ScrollView
className='stadium-detail-scroll'
refresherBackground="#FAFAFA"
scrollY={!openPicker}
scrollTop={scrollTop}
>
{/* 已选球场 */} {/* 已选球场 */}
<View <View
className={`stadium-item`} className={`stadium-item`}
@@ -220,9 +234,12 @@ const StadiumDetail = forwardRef<StadiumDetailRef, StadiumDetailProps>(({
<View className='textarea-tag-container'> <View className='textarea-tag-container'>
<TextareaTag <TextareaTag
value={formData[item.prop]} value={formData[item.prop]}
onChange={(value) => updateFormData(item.prop, value)} onChange={(value) => {
onBlur={() => changePicker(false)} changeTextarea(true)
onFocus={() => changePicker(true)} updateFormData(item.prop, value)
}}
// onBlur={() => changeTextarea(false)}
onFocus={() => changeTextarea(true)}
placeholder='有其他场地信息可备注' placeholder='有其他场地信息可备注'
options={(item.options || []).map((o) => ({ label: o, value: o }))} options={(item.options || []).map((o) => ({ label: o, value: o }))}
/> />