diff --git a/src/api/orders/types.ts b/src/api/orders/types.ts index 6c45c60..349e553 100644 --- a/src/api/orders/types.ts +++ b/src/api/orders/types.ts @@ -140,9 +140,9 @@ export interface TournamentAdminOrderInfoVO { /** 订单详情查询参数 */ export interface OrderDetailQueryParams { /** 订单编号 */ - orderNo: string; + orderNo?: string; /** 选手ID */ - uniqueId: string; + uniqueId?: string; } // ============================================================ @@ -178,9 +178,9 @@ export interface TournamentAdminOrderInfoPageVO { /** 选手列表查询参数 */ export interface OrderPlayerListQueryParams { /** 订单编号 */ - orderNo: string; + orderNo?: string; /** 选手ID */ - uniqueId: string; + uniqueId?: string; page: string; limit: string; } diff --git a/src/assets/img/default.png b/src/assets/img/default.png new file mode 100644 index 0000000..d8b4f5b Binary files /dev/null and b/src/assets/img/default.png differ diff --git a/src/pages/events/list/components/EventDetailModal.module.less b/src/pages/events/list/components/EventDetailModal.module.less index 61044c5..caef3e2 100644 --- a/src/pages/events/list/components/EventDetailModal.module.less +++ b/src/pages/events/list/components/EventDetailModal.module.less @@ -59,11 +59,6 @@ font-weight: 500; } - .tableWrap { - max-height: 200px; - overflow-y: auto; - } - .paginationRow { display: flex; justify-content: flex-end; @@ -80,30 +75,4 @@ font-size: 13px; color: rgba(0, 0, 0, 0.65); } - - .idImageGrid { - display: flex; - gap: 8px; - flex-wrap: wrap; - } - - .idImageCell { - width: 128px; - height: 82px; - border-radius: 4px; - overflow: hidden; - border: 1px solid #f0f0f0; - flex-shrink: 0; - - :global(.ant-image) { - width: 100%; - height: 100%; - - img { - width: 100%; - height: 100%; - object-fit: cover; - } - } - } } diff --git a/src/pages/events/list/components/EventDetailModal.tsx b/src/pages/events/list/components/EventDetailModal.tsx index 7584bc6..57fedca 100644 --- a/src/pages/events/list/components/EventDetailModal.tsx +++ b/src/pages/events/list/components/EventDetailModal.tsx @@ -1,5 +1,5 @@ -import { defineComponent, reactive, ref } from 'vue'; -import { Modal, Descriptions, Image, Table, Pagination, Spin } from 'ant-design-vue'; +import { defineComponent, computed, reactive, ref } from 'vue'; +import { Modal, Descriptions, Image, Table, Pagination, Spin, Space } from 'ant-design-vue'; import { message } from 'ant-design-vue'; import { getEventDetail, @@ -9,6 +9,7 @@ import { type TournamentAdminInfoSignupVO, } from '../model/services'; import { useState, useEffect } from '@/hooks'; +import defaultCover from '@/assets/img/default.png'; import styles from './EventDetailModal.module.less'; interface EventDetailModalProps { @@ -27,27 +28,29 @@ const formatYN = (v: string) => YES_NO_MAP[v] ?? v; const formatPublic = (v: string) => PUBLIC_MAP[v] ?? v; const formatGender = (v: string) => GENDER_MAP[v] ?? v; -const PAGE_SIZE = 10; +const PAGE_SIZE = 5; -/** 渲染身份证图片(cover 填充,与封面显示方式一致) */ +/** 渲染身份证图片(缩略图,点击可预览) */ const renderIdImages = (imgList: string[], singleImg: string) => { const urls = imgList.length > 0 ? imgList : singleImg ? [singleImg] : []; if (urls.length === 0) return --; return ( - -
- {urls.map((url) => ( -
- -
- ))} -
-
+ + {urls.map((url) => ( + + ))} + ); }; -/** 选手表格列 */ -const PLAYER_COLUMNS = [ +/** 选手表格基础列(不含证件号/证件图片,由 setup 内 computed 按需拼接) */ +const BASE_PLAYER_COLUMNS: any[] = [ { title: '选手', dataIndex: 'realName', key: 'realName', width: 100 }, { title: '性别', @@ -57,23 +60,25 @@ const PLAYER_COLUMNS = [ customRender: ({ text }: { text: string }) => formatGender(text), }, { title: '手机号', dataIndex: 'phone', key: 'phone', width: 130 }, - { - title: '证件号', - dataIndex: 'idCard', - key: 'idCard', - width: 180, - customRender: ({ record }: { record?: TournamentAdminInfoSignupVO }) => - record?.idCard ? record.idCard : --, - }, - { - title: '证件图片', - key: 'idCardImgs', - width: 280, - customRender: ({ record }: { record?: TournamentAdminInfoSignupVO }) => - record ? renderIdImages(record.idCardImgList || [], record.idCardImg || '') : --, - }, ]; +const ID_CARD_COLUMN: any = { + title: '证件号', + dataIndex: 'idCard', + key: 'idCard', + width: 180, + customRender: ({ record }: { record?: TournamentAdminInfoSignupVO }) => + record?.idCard ? record.idCard : --, +}; + +const ID_CARD_IMG_COLUMN: any = { + title: '证件图片', + key: 'idCardImgs', + width: 120, + customRender: ({ record }: { record?: TournamentAdminInfoSignupVO }) => + record ? renderIdImages(record.idCardImgList || [], record.idCardImg || '') : --, +}; + export default defineComponent({ name: 'EventDetailModal', props: { @@ -86,6 +91,14 @@ export default defineComponent({ const [detail, setDetail] = useState(null); const [detailLoading, setDetailLoading] = useState(false); + /** 动态列:根据赛事是否要求证件号/证件图片决定显示 */ + const playerColumns = computed(() => { + const cols = [...BASE_PLAYER_COLUMNS]; + if (detail.value?.isRequireIdCardNo === '1') cols.push(ID_CARD_COLUMN); + if (detail.value?.isRequireIdCardImg === '1') cols.push(ID_CARD_IMG_COLUMN); + return cols; + }); + // ===== 每个组别的选手数据(key = categoryId) ===== const categoryPlayers = ref>({}); const categoryPlayerTotal = ref>({}); @@ -230,12 +243,14 @@ export default defineComponent({ {/* ===== 封面 ===== */} - {detail.value.img && ( -
-
封面
- -
- )} +
+
封面
+ +
{/* ===== 赛事公告 ===== */} {detail.value.notice && ( @@ -249,21 +264,20 @@ export default defineComponent({ {detail.value.categoryList && detail.value.categoryList.length > 0 && (
组别信息
- {detail.value.categoryList.map((cat: InnerCategoryVO) => ( + {detail.value.categoryList.map((cat: InnerCategoryVO, idx: number) => (
- {cat.name}({CATEGORY_TYPE_MAP[cat.type] ?? cat.type}) -
-
- + 组别{idx + 1}:{cat.name}({CATEGORY_TYPE_MAP[cat.type] ?? cat.type}) +
{categoryPlayerTotal.value[cat.id] > 0 && (
refundSuccessList.value.length); const fetchData = async () => { - const params = { orderNo: props.orderNo, uniqueId: props.uniqueId }; + const params: OrderDetailQueryParams = {}; + if (props.orderNo) params['orderNo'] = props.orderNo; + else params['uniqueId'] = props.uniqueId; + const [detailRes] = await Promise.all([getOrderDetail(params), fetchPlayers(1)]); if (detailRes.code == 200) { setDetail(detailRes.data);