修复bug
This commit is contained in:
@@ -39,7 +39,6 @@ const FilterPopup = (props: FilterPopupProps) => {
|
|||||||
// const [selectedDates, setSelectedDates] = useState<String[]>([])
|
// const [selectedDates, setSelectedDates] = useState<String[]>([])
|
||||||
|
|
||||||
const handleDateChange = (dates: Date[]) => {
|
const handleDateChange = (dates: Date[]) => {
|
||||||
console.log(dates,'datesdatesdatesdatesdates');
|
|
||||||
let times: String[] = [];
|
let times: String[] = [];
|
||||||
if (Array.isArray(dates)) {
|
if (Array.isArray(dates)) {
|
||||||
const currentDay = dayjs(dates[0]).format('YYYY-MM-DD');
|
const currentDay = dayjs(dates[0]).format('YYYY-MM-DD');
|
||||||
@@ -129,6 +128,11 @@ const FilterPopup = (props: FilterPopupProps) => {
|
|||||||
showRangeStart={false}
|
showRangeStart={false}
|
||||||
value={filterOptions?.dateRange}
|
value={filterOptions?.dateRange}
|
||||||
onChange={handleDateChange}
|
onChange={handleDateChange}
|
||||||
|
style={{
|
||||||
|
bottom: '25%',
|
||||||
|
width: 'calc(100vw - 32px)',
|
||||||
|
left: '16px',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{/* 时间气泡选项 */}
|
{/* 时间气泡选项 */}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 400px;
|
height: calc(100vh - 94px - 72px - 110px);
|
||||||
|
|
||||||
.listLoadErrorImg {
|
.listLoadErrorImg {
|
||||||
width: 154px;
|
width: 154px;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Image, View, Text, Button } from "@tarojs/components";
|
import { Image, View, Text } from "@tarojs/components";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
import img from "@/config/images";
|
import img from "@/config/images";
|
||||||
|
|
||||||
@@ -24,10 +24,10 @@ const ListLoadError = (props: IProps) => {
|
|||||||
/>
|
/>
|
||||||
{text && <Text className={styles.listLoadErrorText}>{text}</Text>}
|
{text && <Text className={styles.listLoadErrorText}>{text}</Text>}
|
||||||
{reload && (
|
{reload && (
|
||||||
<Button className={styles.listLoadErrorBtn} onClick={handleReload}>
|
<View className={styles.listLoadErrorBtn} onClick={handleReload}>
|
||||||
<Image src={btnImg ? img[btnImg] : img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
|
<Image src={btnImg ? img[btnImg] : img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
|
||||||
{btnText ? " " + btnText : "重试"}
|
{btnText ? " " + btnText : "重试"}
|
||||||
</Button>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ interface NutUICalendarProps {
|
|||||||
showQuickActions?: boolean;
|
showQuickActions?: boolean;
|
||||||
onHeaderClick?: (date: Date) => void;
|
onHeaderClick?: (date: Date) => void;
|
||||||
showRangeStart?: boolean;
|
showRangeStart?: boolean;
|
||||||
|
style?: React.CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CalendarUIRef {
|
export interface CalendarUIRef {
|
||||||
@@ -36,6 +37,7 @@ const NutUICalendar = React.forwardRef<CalendarUIRef, NutUICalendarProps>(
|
|||||||
showRangeStart = true,
|
showRangeStart = true,
|
||||||
showQuickActions = true,
|
showQuickActions = true,
|
||||||
onHeaderClick,
|
onHeaderClick,
|
||||||
|
style,
|
||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) => {
|
) => {
|
||||||
@@ -281,6 +283,7 @@ const NutUICalendar = React.forwardRef<CalendarUIRef, NutUICalendarProps>(
|
|||||||
value={[current.getFullYear(), current.getMonth() + 1]}
|
value={[current.getFullYear(), current.getMonth() + 1]}
|
||||||
type="month"
|
type="month"
|
||||||
onChange={(value) => handleMonthChange(value)}
|
onChange={(value) => handleMonthChange(value)}
|
||||||
|
style={style}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ interface PickerProps {
|
|||||||
img?: string;
|
img?: string;
|
||||||
onConfirm?: (options: PickerOption[], values: (string | number)[]) => void;
|
onConfirm?: (options: PickerOption[], values: (string | number)[]) => void;
|
||||||
onChange?: (value: (string | number)[]) => void;
|
onChange?: (value: (string | number)[]) => void;
|
||||||
|
style?: React.CSSProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
const PopupPicker = ({
|
const PopupPicker = ({
|
||||||
@@ -36,6 +37,7 @@ const PopupPicker = ({
|
|||||||
onChange,
|
onChange,
|
||||||
options = [],
|
options = [],
|
||||||
type = null,
|
type = null,
|
||||||
|
style,
|
||||||
}: PickerProps) => {
|
}: PickerProps) => {
|
||||||
const [defaultValue, setDefaultValue] = useState<(string | number)[]>([]);
|
const [defaultValue, setDefaultValue] = useState<(string | number)[]>([]);
|
||||||
const [defaultOptions, setDefaultOptions] = useState<PickerOption[][]>([]);
|
const [defaultOptions, setDefaultOptions] = useState<PickerOption[][]>([]);
|
||||||
@@ -106,6 +108,7 @@ const PopupPicker = ({
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
round
|
round
|
||||||
zIndex={1000}
|
zIndex={1000}
|
||||||
|
style={style}
|
||||||
>
|
>
|
||||||
{type === "ntrp" && (
|
{type === "ntrp" && (
|
||||||
<View className={styles.evaluateCardWrap}>
|
<View className={styles.evaluateCardWrap}>
|
||||||
|
|||||||
@@ -487,8 +487,8 @@ const ShareCardCanvas: React.FC<ShareCardCanvasProps> = ({
|
|||||||
|
|
||||||
// 绘制用户昵称 已完成
|
// 绘制用户昵称 已完成
|
||||||
const nicknameX = avatarX + avatarSize + 8 * dpr // 距离头像8px
|
const nicknameX = avatarX + avatarSize + 8 * dpr // 距离头像8px
|
||||||
const nicknameY = avatarY + (avatarSize - 24 * dpr) / 2 // 与头像水平居中对齐
|
const nicknameY = avatarY + (avatarSize - 18 * dpr) / 2 // 与头像水平居中对齐
|
||||||
const nicknameFontSize = scale * 24 * dpr
|
const nicknameFontSize = scale * 18 * dpr
|
||||||
drawText(ctx, data.userNickname, nicknameX, nicknameY, 200 * dpr, nicknameFontSize, '#000000', true, '"Noto Sans SC"')
|
drawText(ctx, data.userNickname, nicknameX, nicknameY, 200 * dpr, nicknameFontSize, '#000000', true, '"Noto Sans SC"')
|
||||||
|
|
||||||
// 绘制"邀你加入球局"文案
|
// 绘制"邀你加入球局"文案
|
||||||
@@ -669,8 +669,8 @@ const ShareCardCanvas: React.FC<ShareCardCanvasProps> = ({
|
|||||||
width: `${canvasWidth}px`,
|
width: `${canvasWidth}px`,
|
||||||
height: `${canvasHeight}px`,
|
height: `${canvasHeight}px`,
|
||||||
position: 'absolute', // 绝对定位避免影响布局
|
position: 'absolute', // 绝对定位避免影响布局
|
||||||
top: '-9999px', // 移出可视区域
|
// top: '-9999px', // 移出可视区域
|
||||||
left: '-9999px'
|
// left: '-9999px'
|
||||||
}}
|
}}
|
||||||
width={`${canvasWidth * dpr}`}
|
width={`${canvasWidth * dpr}`}
|
||||||
height={`${canvasHeight * dpr}`}
|
height={`${canvasHeight * dpr}`}
|
||||||
|
|||||||
@@ -29,9 +29,12 @@ const ListContainer = (props) => {
|
|||||||
|
|
||||||
useReachBottom(() => {
|
useReachBottom(() => {
|
||||||
// 加载更多方法
|
// 加载更多方法
|
||||||
timerRef.current = setTimeout(() => {
|
if (loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// timerRef.current = setTimeout(() => {
|
||||||
loadMoreMatches();
|
loadMoreMatches();
|
||||||
}, 500);
|
// }, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -102,15 +105,6 @@ const ListContainer = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="listContentWrapper">
|
<View className="listContentWrapper">
|
||||||
{/* <ScrollView
|
|
||||||
scrollY
|
|
||||||
scrollWithAnimation
|
|
||||||
enableBackToTop
|
|
||||||
enablePassive
|
|
||||||
style={{ height: '100vh' }}
|
|
||||||
onScrollToLower={handleScrollToLower}
|
|
||||||
upperThreshold={60}
|
|
||||||
> */}
|
|
||||||
{renderList(data)}
|
{renderList(data)}
|
||||||
{/* 显示骨架屏 */}
|
{/* 显示骨架屏 */}
|
||||||
{loading && renderSkeleton()}
|
{loading && renderSkeleton()}
|
||||||
@@ -120,7 +114,6 @@ const ListContainer = (props) => {
|
|||||||
{renderList(recommendList)} */}
|
{renderList(recommendList)} */}
|
||||||
{/* 到底了 */}
|
{/* 到底了 */}
|
||||||
{data?.length > 0 && <View className="bottomTextWrapper">到底了</View>}
|
{data?.length > 0 && <View className="bottomTextWrapper">到底了</View>}
|
||||||
{/* </ScrollView> */}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import CustomNavbar from "@/components/CustomNavbar";
|
|||||||
import { Input } from "@nutui/nutui-react-taro";
|
import { Input } from "@nutui/nutui-react-taro";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
import { getCurrentFullPath } from "@/utils";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
config?: {
|
config?: {
|
||||||
@@ -40,10 +41,8 @@ const ListHeader = (props: IProps) => {
|
|||||||
const currentAddress = city + district
|
const currentAddress = city + district
|
||||||
|
|
||||||
const handleInputClick = () => {
|
const handleInputClick = () => {
|
||||||
const pages = Taro.getCurrentPages();
|
const currentPagePath = getCurrentFullPath()
|
||||||
const currentPage = pages[pages.length - 1];
|
if (currentPagePath === "/game_pages/searchResult/index") {
|
||||||
const currentPagePath = currentPage.route;
|
|
||||||
if (currentPagePath === "game_pages/searchResult/index") {
|
|
||||||
Taro.navigateBack();
|
Taro.navigateBack();
|
||||||
} else {
|
} else {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
@@ -54,6 +53,13 @@ const ListHeader = (props: IProps) => {
|
|||||||
|
|
||||||
// 点击logo
|
// 点击logo
|
||||||
const handleLogoClick = () => {
|
const handleLogoClick = () => {
|
||||||
|
// 如果当前在列表页,点击后页面回到顶部
|
||||||
|
if (getCurrentFullPath() === "/game_pages/list/index") {
|
||||||
|
Taro.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
duration: 300,
|
||||||
|
});
|
||||||
|
}
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "game_pages/list/index", // 列表页
|
url: "game_pages/list/index", // 列表页
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ export default definePageConfig({
|
|||||||
enablePullDownRefresh: true,
|
enablePullDownRefresh: true,
|
||||||
backgroundTextStyle: 'dark',
|
backgroundTextStyle: 'dark',
|
||||||
navigationStyle: 'custom',
|
navigationStyle: 'custom',
|
||||||
|
onReachBottomDistance: 300,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import styles from "./index.module.scss";
|
|||||||
import { useEffect, useRef, useCallback, useState } from "react";
|
import { useEffect, useRef, useCallback, useState } from "react";
|
||||||
import Taro, {
|
import Taro, {
|
||||||
usePageScroll,
|
usePageScroll,
|
||||||
useShareAppMessage,
|
// useShareAppMessage,
|
||||||
useShareTimeline,
|
// useShareTimeline,
|
||||||
} from "@tarojs/taro";
|
} from "@tarojs/taro";
|
||||||
import { useListStore } from "@/store/listStore";
|
import { useListStore } from "@/store/listStore";
|
||||||
import { useGlobalState } from "@/store/global";
|
import { useGlobalState } from "@/store/global";
|
||||||
@@ -395,7 +395,6 @@ const ListPage = () => {
|
|||||||
venueImages: ["https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/63f62c80-ac44-4f3b-bb6c-d7f6e8ebf76d.jpg",
|
venueImages: ["https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/63f62c80-ac44-4f3b-bb6c-d7f6e8ebf76d.jpg",
|
||||||
"https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/63f62c80-ac44-4f3b-bb6c-d7f6e8ebf76d.jpg"
|
"https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/63f62c80-ac44-4f3b-bb6c-d7f6e8ebf76d.jpg"
|
||||||
],
|
],
|
||||||
playerImage: "https://bimwe.oss-cn-shanghai.aliyuncs.com/front/ball/images/63f62c80-ac44-4f3b-bb6c-d7f6e8ebf76d.jpg"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onGenerated={handleShare}
|
onGenerated={handleShare}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const commonStateDefaultValue = {
|
|||||||
// 是否是搜索结果页
|
// 是否是搜索结果页
|
||||||
isSearchResult: false,
|
isSearchResult: false,
|
||||||
// 是否加载中
|
// 是否加载中
|
||||||
loading: true,
|
loading: false,
|
||||||
// 错误信息
|
// 错误信息
|
||||||
error: null,
|
error: null,
|
||||||
// 位置
|
// 位置
|
||||||
@@ -225,6 +225,9 @@ export const useListStore = create<TennisStore>()((set, get) => ({
|
|||||||
|
|
||||||
// 获取列表数据(常规搜索)
|
// 获取列表数据(常规搜索)
|
||||||
fetchMatches: async (params, isFirstLoad = false, isAppend = false) => {
|
fetchMatches: async (params, isFirstLoad = false, isAppend = false) => {
|
||||||
|
if (get().loading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
set({ loading: true, error: null });
|
set({ loading: true, error: null });
|
||||||
const { getSearchParams, setListData } = get();
|
const { getSearchParams, setListData } = get();
|
||||||
|
|
||||||
@@ -463,14 +466,14 @@ export const useListStore = create<TennisStore>()((set, get) => ({
|
|||||||
searchPageState: {
|
searchPageState: {
|
||||||
...searchPageStateDefaultValue
|
...searchPageStateDefaultValue
|
||||||
},
|
},
|
||||||
loading: true,
|
// loading: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
set({
|
set({
|
||||||
listPageState: {
|
listPageState: {
|
||||||
...listPageStateDefaultValue
|
...listPageStateDefaultValue
|
||||||
},
|
},
|
||||||
loading: true,
|
// loading: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!isSearchData) {
|
if (!isSearchData) {
|
||||||
|
|||||||
@@ -529,8 +529,8 @@ const drawShareCard = async (ctx: any, data: ShareCardData, offscreen: any): Pro
|
|||||||
|
|
||||||
// 绘制用户昵称 已完成
|
// 绘制用户昵称 已完成
|
||||||
const nicknameX = avatarX + avatarSize + 8 * dpr // 距离头像8px
|
const nicknameX = avatarX + avatarSize + 8 * dpr // 距离头像8px
|
||||||
const nicknameY = avatarY + (avatarSize - 24 * dpr) / 2 // 与头像水平居中对齐
|
const nicknameY = avatarY + (avatarSize - 18 * dpr) / 2 // 与头像水平居中对齐
|
||||||
const nicknameFontSize = scale * 24 * dpr
|
const nicknameFontSize = scale * 18 * dpr
|
||||||
drawText(ctx, data.userNickname, nicknameX, nicknameY, 200 * dpr, nicknameFontSize, '#000000', true, '"Noto Sans SC"')
|
drawText(ctx, data.userNickname, nicknameX, nicknameY, 200 * dpr, nicknameFontSize, '#000000', true, '"Noto Sans SC"')
|
||||||
|
|
||||||
// 绘制"邀你加入球局"文案
|
// 绘制"邀你加入球局"文案
|
||||||
|
|||||||
Reference in New Issue
Block a user