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