@tbox.cn/app-module-activity-play 0.4.1 → 1.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INTEGRATION.md +12 -7
- package/README.md +8 -6
- package/dist/chunk-OFPXH7OI.js +469 -0
- package/dist/{chunk-HXO47NYM.js → chunk-YH6HTRSS.js} +7 -76
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/dist/server/index.d.ts +261 -156
- package/dist/server/index.js +1 -3
- package/package.json +15 -10
- package/skills/activity-play/SKILL.md +10 -0
- package/src/client/cards/ListPresentation.tsx +83 -0
- package/src/client/cards/activity-play/ActivityDetailSheet.tsx +143 -0
- package/src/client/cards/activity-play/ActivityPlayCard.tsx +60 -40
- package/src/client/cards/activity-play-prize/ActivityPlayPrizeListCard.tsx +55 -44
- package/src/client/cards/activity-play-prize/PrizeDetailContent.tsx +33 -0
- package/src/client/cards/activity-play-prize/PrizeDetailSheet.tsx +52 -0
- package/src/client/cards/activity-play-prize/index.ts +0 -7
- package/src/client/cards/view.ts +16 -0
- package/src/client/index.ts +2 -13
- package/src/server/cards/index.ts +1 -3
- package/src/server/index.ts +2 -19
- package/src/server/prizes/cards.ts +6 -6
- package/src/server/prizes/tools.ts +4 -6
- package/src/server/tools.ts +1 -1
- package/tbox.module.json +1 -6
- package/tests/activity-card.test.tsx +169 -0
- package/tests/prizes-tools.test.ts +7 -4
- package/tests/prizes.test.ts +6 -12
- package/tests/routes.test.ts +13 -0
- package/tests/smoke.test.ts +7 -5
- package/tsup.config.ts +1 -0
- package/dist/chunk-GDHTMID6.js +0 -185
- package/dist/client/index.css +0 -107
- package/dist/index.css +0 -107
- package/src/client/cards/activity-play-prize/ActivityPlayPrizeDetailCard.tsx +0 -44
- package/src/client/styles/activity-play.css +0 -136
- package/src/server/cards/activity-play-prize-detail/meta.ts +0 -29
- package/src/server/cards/activity-play-prize-detail/samples.ts +0 -54
package/dist/server/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
ACTIVITY_PLAY_LIMIT_DEFAULT,
|
|
4
4
|
ACTIVITY_PLAY_LIMIT_MAX,
|
|
5
5
|
ACTIVITY_PLAY_LIMIT_MIN,
|
|
6
|
-
ACTIVITY_PLAY_PRIZE_DETAIL_CARD_TYPE,
|
|
7
6
|
ACTIVITY_PLAY_PRIZE_LIST_CARD_TYPE,
|
|
8
7
|
ActivityPlayHttpError,
|
|
9
8
|
ActivityPlayPrizeHttpError,
|
|
@@ -32,13 +31,12 @@ import {
|
|
|
32
31
|
toActivityPlayPrizeError,
|
|
33
32
|
toPrizeDetailCardData,
|
|
34
33
|
toPrizeListCardData
|
|
35
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-YH6HTRSS.js";
|
|
36
35
|
export {
|
|
37
36
|
ACTIVITY_PLAY_CARD_TYPE,
|
|
38
37
|
ACTIVITY_PLAY_LIMIT_DEFAULT,
|
|
39
38
|
ACTIVITY_PLAY_LIMIT_MAX,
|
|
40
39
|
ACTIVITY_PLAY_LIMIT_MIN,
|
|
41
|
-
ACTIVITY_PLAY_PRIZE_DETAIL_CARD_TYPE,
|
|
42
40
|
ACTIVITY_PLAY_PRIZE_LIST_CARD_TYPE,
|
|
43
41
|
ActivityPlayHttpError,
|
|
44
42
|
ActivityPlayPrizeHttpError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-module-activity-play",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "活动玩法业务模块:供应商活动查询(HTTP/工具/出卡)",
|
|
6
6
|
"exports": {
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tbox.cn/app-contracts": "0.
|
|
23
|
-
"@tbox.cn/app-
|
|
24
|
-
"@tbox.cn/app-
|
|
25
|
-
"@tbox.cn/app-agent-sdk-server": "0.
|
|
22
|
+
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.10",
|
|
23
|
+
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.10",
|
|
24
|
+
"@tbox.cn/app-contracts": "1.0.0-alpha.10",
|
|
25
|
+
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.10"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"zod": "3.25.76",
|
|
29
|
-
"react": "18.3.1"
|
|
29
|
+
"react": "18.3.1",
|
|
30
|
+
"@tbox.cn/app-agent-ui-kit": "^1.0.0-alpha.10"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/express": "4.17.25",
|
|
@@ -38,7 +39,9 @@
|
|
|
38
39
|
"zod": "3.25.76",
|
|
39
40
|
"tsup": "8.5.1",
|
|
40
41
|
"express": "4.22.2",
|
|
41
|
-
"supertest": "7.2.2"
|
|
42
|
+
"supertest": "7.2.2",
|
|
43
|
+
"react-dom": "18.3.1",
|
|
44
|
+
"@types/react-dom": "18.3.7"
|
|
42
45
|
},
|
|
43
46
|
"files": [
|
|
44
47
|
"dist",
|
|
@@ -59,9 +62,11 @@
|
|
|
59
62
|
"access": "public"
|
|
60
63
|
},
|
|
61
64
|
"license": "MIT",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"@tbox.cn/app-agent-ui-kit": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
65
70
|
"scripts": {
|
|
66
71
|
"typecheck": "tsc --noEmit",
|
|
67
72
|
"test": "vitest run",
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
name: activity-play
|
|
3
3
|
description: 商圈活动玩法与本人奖品 SOP——大转盘、抽奖、签到等供应商活动的查询口径,以及「我中了什么奖」的本人中奖记录查询与边界(数据均来自外部供应商实时查询)。
|
|
4
4
|
routingTerms:
|
|
5
|
+
- 活动
|
|
6
|
+
- 活动中心
|
|
7
|
+
- 活动列表
|
|
8
|
+
- 有什么活动
|
|
5
9
|
- 活动玩法
|
|
6
10
|
- 大转盘
|
|
7
11
|
- 转盘
|
|
@@ -44,6 +48,10 @@ routingTerms:
|
|
|
44
48
|
|
|
45
49
|
## 查询口径
|
|
46
50
|
|
|
51
|
+
用户泛指「活动」「有什么活动」「本周活动」「活动中心」时,本域是活动查询入口,先调
|
|
52
|
+
`listActivityPlays`;详情调 `getActivityPlayDetail`。优惠券和明确的满减促销仍由营销域处理。
|
|
53
|
+
时间范围依据接口返回的起止时间判断,不把当前活动直接等同本周活动。
|
|
54
|
+
|
|
47
55
|
1. 列表:调用 `listActivityPlays`(keyword 可选、limit 缺省 20);按名称/说明过滤是服务
|
|
48
56
|
端匹配,不要自己拿着完整列表再筛一遍。
|
|
49
57
|
2. 详情:`getActivityPlayDetail` 需要 `activityId`——用户只说名称(如「那个转盘」)时,
|
|
@@ -82,3 +90,5 @@ routingTerms:
|
|
|
82
90
|
- 碰一碰、碰出惊喜 → 支付宝活动组件。
|
|
83
91
|
- 泛问「有什么活动」时先弄清用户要玩法还是优惠,必要时澄清一句再查;不要把所有
|
|
84
92
|
「活动」问句都引到本技能。
|
|
93
|
+
|
|
94
|
+
奖品展示统一使用列表卡:`getMyPrizeDetail` 返回仅含指定记录的列表卡;完整详情由用户点击列表中的“查看详情”在半屏弹层查看,不生成独立奖品详情卡。
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
export const LIST_PREVIEW_COUNT = 3;
|
|
5
|
+
|
|
6
|
+
/** 两类列表共用的卡头、时间与展开入口。 */
|
|
7
|
+
export function ListHeader({ title, subtitle, kind }: {
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
kind: 'activity' | 'prize';
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<header className="ap-list__header relative -mx-3.5 flex min-h-18 items-center gap-2.5 overflow-hidden bg-[#fcefe2] px-4 py-3.5 after:pointer-events-none after:absolute after:-right-[15px] after:-bottom-[15px] after:h-10 after:w-[150px] after:-rotate-18 after:rounded-full after:border-8 after:border-[rgba(246,179,82,0.13)] after:content-['']">
|
|
14
|
+
<span className="ap-list__header-icon flex size-7 shrink-0 items-center justify-center rounded-md bg-[#bb8124] text-white [&>svg]:size-4.5" aria-hidden="true">
|
|
15
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8">
|
|
16
|
+
{kind === 'activity' ? (
|
|
17
|
+
<>
|
|
18
|
+
<rect x="4" y="5" width="16" height="16" rx="2" />
|
|
19
|
+
<path d="M4 10h16M8 3v4m8-4v4m-4 5 1 2 2.2.3-1.6 1.6.4 2.2-2-1-2 1 .4-2.2-1.6-1.6L11 14Z" />
|
|
20
|
+
</>
|
|
21
|
+
) : (
|
|
22
|
+
<>
|
|
23
|
+
<path d="M3 9h18v5H3zM5 14v7h14v-7M12 9v12" />
|
|
24
|
+
<path d="M12 9C4 9 5 2 8 3c3 0 4 6 4 6Zm0 0c8 0 7-7 4-6-3 0-4 6-4 6Z" />
|
|
25
|
+
</>
|
|
26
|
+
)}
|
|
27
|
+
</svg>
|
|
28
|
+
</span>
|
|
29
|
+
<div className="ap-list__header-copy relative z-1 min-w-0">
|
|
30
|
+
<h3 className="ap-list__title m-0 text-base font-semibold leading-5.5 text-foreground">{title}</h3>
|
|
31
|
+
<p className="ap-list__subtitle mt-[3px] mb-0 text-xs leading-[17px] text-secondary-foreground">{subtitle}</p>
|
|
32
|
+
</div>
|
|
33
|
+
</header>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function ListTime({ children }: { children: ReactNode }) {
|
|
38
|
+
return (
|
|
39
|
+
<p className="ap-list__meta mt-1.5 mb-0 flex items-start gap-[3px] text-[11px] leading-[15px] text-secondary-foreground [overflow-wrap:anywhere] [&>svg]:mt-[2.5px] [&>svg]:size-2.5 [&>svg]:shrink-0">
|
|
40
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
41
|
+
<circle cx="8" cy="8" r="7" fill="currentColor" />
|
|
42
|
+
<path d="M8 4v4l3 2" fill="none" stroke="white" strokeWidth="1.5" />
|
|
43
|
+
</svg>
|
|
44
|
+
<span>{children}</span>
|
|
45
|
+
</p>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ViewAll({ label, onExpand }: { label: string; onExpand: () => void }) {
|
|
50
|
+
return (
|
|
51
|
+
<button type="button" className="ap-list__view-all flex min-h-[38px] w-full cursor-pointer items-center justify-center gap-[7px] border-0 border-t border-border bg-transparent py-2 text-xs leading-[17px] text-secondary-foreground focus-visible:outline-2 focus-visible:outline-primary focus-visible:-outline-offset-2 [&>svg]:size-3" aria-expanded={false} onClick={onExpand}>
|
|
52
|
+
{label}
|
|
53
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="2">
|
|
54
|
+
<path d="m6 4 4 4-4 4" />
|
|
55
|
+
</svg>
|
|
56
|
+
</button>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ListImage({ src, kind }: { src?: string; kind: 'activity' | 'prize' }) {
|
|
61
|
+
const [failedSrc, setFailedSrc] = useState<string>();
|
|
62
|
+
return (
|
|
63
|
+
<div className="ap-list__image flex size-[86px] shrink-0 items-center justify-center overflow-hidden rounded-[7px] bg-[linear-gradient(135deg,#faf7f0,#f0f2eb)] text-[#8a927c] [&>img]:block [&>img]:size-full [&>img]:object-cover [&>svg]:size-8" aria-hidden="true">
|
|
64
|
+
{src && src !== failedSrc ? (
|
|
65
|
+
<img src={src} alt="" loading="lazy" onError={() => setFailedSrc(src)} />
|
|
66
|
+
) : (
|
|
67
|
+
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" strokeWidth="2">
|
|
68
|
+
{kind === 'prize' ? (
|
|
69
|
+
<>
|
|
70
|
+
<path d="M8 21h32v-9H8zM11 21v20h26V21M24 12v29" />
|
|
71
|
+
<path d="M24 12c-12 0-13-10-7-10 5 0 7 10 7 10Zm0 0c12 0 13-10 7-10-5 0-7 10-7 10Z" />
|
|
72
|
+
</>
|
|
73
|
+
) : (
|
|
74
|
+
<>
|
|
75
|
+
<path d="M8 10h32v10a4 4 0 0 0 0 8v10H8V28a4 4 0 0 0 0-8Z" />
|
|
76
|
+
<path d="m24 16 2.5 5 5.5.8-4 3.9.9 5.5-4.9-2.6-4.9 2.6.9-5.5-4-3.9 5.5-.8Z" />
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
</svg>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { activityPlayBadgeClass } from '../view';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { toast } from '@tbox.cn/app-agent-ui-kit/toast';
|
|
4
|
+
import { BottomSheet } from '@tbox.cn/app-agent-ui-kit/bottom-sheet';
|
|
5
|
+
import { callJsapi, httpGet } from '@tbox.cn/app-agent-sdk-client';
|
|
6
|
+
import { activityPlayActivitySchema } from '@tbox.cn/app-contracts-mall';
|
|
7
|
+
import type { ActivityPlayActivity } from '@tbox.cn/app-contracts-mall';
|
|
8
|
+
import { activityPlayStatusText, activityPlayStatusTone, formatActivityPlayTime } from '../view';
|
|
9
|
+
|
|
10
|
+
/** 琥珀活动插件公开页(动态插件协议:provider AppID + 公开页名)。 */
|
|
11
|
+
const ACTIVITY_PLAY_PLUGIN_URL = 'dynamic-plugin://2021007119624628/activity';
|
|
12
|
+
|
|
13
|
+
/** 活动标识按原字符串编码;插件目标固定,不接受业务入参以外的导航目标。 */
|
|
14
|
+
function buildActivityPlayPluginUrl(activityId: string): string {
|
|
15
|
+
return `${ACTIVITY_PLAY_PLUGIN_URL}?activityId=${encodeURIComponent(activityId)}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 先查询活动详情;宿主导航只由弹层中的参与按钮触发(经宿主 my.navigateTo 打开固定插件页)。 */
|
|
19
|
+
export function ActivityDetailSheet({ mallId, activityId, onClose }: {
|
|
20
|
+
mallId: string; activityId: string; onClose: () => void;
|
|
21
|
+
}) {
|
|
22
|
+
const [detail, setDetail] = useState<ActivityPlayActivity>();
|
|
23
|
+
const [error, setError] = useState('');
|
|
24
|
+
const [opening, setOpening] = useState(false);
|
|
25
|
+
const navigating = useRef(false);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const controller = new AbortController();
|
|
28
|
+
const load = async () => {
|
|
29
|
+
try {
|
|
30
|
+
const result = await httpGet<{ data?: unknown }>(
|
|
31
|
+
`/api/m/activity-play/activities/${encodeURIComponent(activityId)}?mallId=${encodeURIComponent(mallId)}`,
|
|
32
|
+
{ signal: controller.signal, cache: 'no-store' },
|
|
33
|
+
);
|
|
34
|
+
if (controller.signal.aborted) return;
|
|
35
|
+
if (result.status !== 200) {
|
|
36
|
+
setError('活动详情查询失败,请关闭后重试');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const parsed = activityPlayActivitySchema.safeParse(result.data.data);
|
|
40
|
+
if (!parsed.success || parsed.data.activityId !== activityId) {
|
|
41
|
+
setError('活动详情数据异常,请关闭后重试');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setDetail(parsed.data);
|
|
45
|
+
} catch {
|
|
46
|
+
if (!controller.signal.aborted) setError('活动详情查询失败,请关闭后重试');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
void load();
|
|
50
|
+
return () => controller.abort();
|
|
51
|
+
}, [activityId, mallId]);
|
|
52
|
+
|
|
53
|
+
const participate = async () => {
|
|
54
|
+
if (!detail || detail.status !== 'active' || navigating.current) return;
|
|
55
|
+
navigating.current = true;
|
|
56
|
+
setOpening(true);
|
|
57
|
+
try {
|
|
58
|
+
await callJsapi('navigateTo', { url: buildActivityPlayPluginUrl(detail.activityId) });
|
|
59
|
+
} catch {
|
|
60
|
+
void toast('活动暂时无法打开,请在宿主小程序中重试');
|
|
61
|
+
} finally {
|
|
62
|
+
navigating.current = false;
|
|
63
|
+
setOpening(false);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<BottomSheet open title="活动详情" onClose={onClose} className="ap-activity-sheet">
|
|
69
|
+
{error ? <p role="alert">{error}</p> : detail ? (
|
|
70
|
+
<>
|
|
71
|
+
<section className="ap-card ap-card--detail flex flex-col gap-2 bg-transparent p-0">
|
|
72
|
+
{(detail.detailCoverUrl || detail.imageUrl) && (
|
|
73
|
+
<img className="ap-activity-sheet__image block aspect-[2.2] w-full rounded-lg object-cover" src={detail.detailCoverUrl || detail.imageUrl} alt=""
|
|
74
|
+
onError={(event) => {
|
|
75
|
+
if (detail.imageUrl && event.currentTarget.getAttribute('src') !== detail.imageUrl) {
|
|
76
|
+
event.currentTarget.src = detail.imageUrl;
|
|
77
|
+
} else event.currentTarget.style.display = 'none';
|
|
78
|
+
}} />
|
|
79
|
+
)}
|
|
80
|
+
<h3 className="ap-activity-sheet__title m-0 text-base leading-5.5 text-foreground">{detail.title}</h3>
|
|
81
|
+
{detail.description && <p className="ap-card__detail-desc m-0 whitespace-pre-wrap text-[13px] leading-[19px] text-secondary-foreground [overflow-wrap:anywhere]">{detail.description}</p>}
|
|
82
|
+
<span className={`w-fit max-w-full shrink-0 self-start rounded-[3.5px] px-1.5 py-px text-[11px] leading-4 [overflow-wrap:anywhere] ap-badge ap-badge--${activityPlayStatusTone(detail.status)} ${activityPlayBadgeClass(detail.status)}`}>
|
|
83
|
+
{activityPlayStatusText(detail.status)}
|
|
84
|
+
</span>
|
|
85
|
+
{(detail.startsAt || detail.endsAt) && (
|
|
86
|
+
<section className="ap-activity-sheet__time w-full rounded-xl border border-border bg-muted p-3">
|
|
87
|
+
<h4 className="m-0 flex items-center gap-1.5 text-xs font-medium leading-5 text-foreground">
|
|
88
|
+
<svg className="size-4 shrink-0 text-muted-foreground" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
|
|
89
|
+
<rect x="3" y="5" width="18" height="16" rx="3" />
|
|
90
|
+
<path d="M7 3v4M17 3v4M3 11h18M8 15h2M14 15h2" />
|
|
91
|
+
</svg>
|
|
92
|
+
活动时间
|
|
93
|
+
</h4>
|
|
94
|
+
<dl className="mt-2 mb-0 grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1.5 text-xs leading-5">
|
|
95
|
+
{detail.startsAt && <>
|
|
96
|
+
<dt className="text-muted-foreground">开始时间</dt>
|
|
97
|
+
<dd className="m-0 font-medium text-foreground tabular-nums [overflow-wrap:anywhere]">{formatActivityPlayTime(detail.startsAt)}</dd>
|
|
98
|
+
</>}
|
|
99
|
+
{detail.endsAt && <>
|
|
100
|
+
<dt className="text-muted-foreground">结束时间</dt>
|
|
101
|
+
<dd className="m-0 font-medium text-foreground tabular-nums [overflow-wrap:anywhere]">{formatActivityPlayTime(detail.endsAt)}</dd>
|
|
102
|
+
</>}
|
|
103
|
+
</dl>
|
|
104
|
+
</section>
|
|
105
|
+
)}
|
|
106
|
+
{!!detail.participationRules?.ruleTexts.length && (
|
|
107
|
+
<section className="ap-activity-sheet__section mt-1 w-full [&>h4]:mt-0 [&>h4]:mb-2 [&>h4]:text-sm [&>h4]:leading-5">
|
|
108
|
+
<h4>玩法规则</h4>
|
|
109
|
+
<ul className="ap-activity-sheet__rules m-0 pl-4 text-xs leading-[21px] text-secondary-foreground [&>li]:whitespace-pre-wrap [&>li]:[overflow-wrap:anywhere]">
|
|
110
|
+
{detail.participationRules.ruleTexts.map((text, index) => <li key={index}>{text}</li>)}
|
|
111
|
+
</ul>
|
|
112
|
+
</section>
|
|
113
|
+
)}
|
|
114
|
+
{!!detail.rewardSummary?.items.length && (
|
|
115
|
+
<section className="ap-activity-sheet__section mt-1 w-full [&>h4]:mt-0 [&>h4]:mb-2 [&>h4]:text-sm [&>h4]:leading-5">
|
|
116
|
+
<h4>奖品设置</h4>
|
|
117
|
+
<ul className="ap-activity-sheet__rewards m-0 grid list-none grid-cols-2 gap-[7px] p-0 [&>li]:flex [&>li]:min-w-0 [&>li]:items-center [&>li]:gap-[7px] [&>li]:rounded-[9px] [&>li]:bg-muted [&>li]:p-2 [&>li>div]:min-w-0 [&>li>div>span]:block [&>li>div>span]:text-[11px] [&>li>div>span]:leading-[15px] [&>li>div>span]:text-secondary-foreground [&_strong]:block [&_strong]:text-xs [&_strong]:font-medium [&_strong]:leading-[17px] [&_strong]:[overflow-wrap:anywhere]">
|
|
118
|
+
{detail.rewardSummary.items.map((reward, index) => (
|
|
119
|
+
<li key={index}>
|
|
120
|
+
<span className="ap-activity-sheet__reward-icon relative flex h-[34px] w-[30px] shrink-0 items-center justify-center overflow-hidden rounded-lg bg-[#fff8e8] text-[#cb9737] [&>svg]:size-5.5 [&>img]:absolute [&>img]:inset-0 [&>img]:size-full [&>img]:bg-[#fff8e8] [&>img]:object-contain">
|
|
121
|
+
{reward.imageUrl ? <img src={reward.imageUrl} alt="" onError={(event) => { event.currentTarget.hidden = true; }} /> : null}
|
|
122
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true">
|
|
123
|
+
<path d="M3 8h18v4H3zM5 12v9h14v-9M12 8v13M12 8C5 8 5 1 9 3c2 1 3 5 3 5Zm0 0c7 0 7-7 3-5-2 1-3 5-3 5Z" />
|
|
124
|
+
</svg>
|
|
125
|
+
</span>
|
|
126
|
+
<div><span>{reward.tierName}</span><strong>{reward.title}</strong></div>
|
|
127
|
+
</li>
|
|
128
|
+
))}
|
|
129
|
+
</ul>
|
|
130
|
+
</section>
|
|
131
|
+
)}
|
|
132
|
+
</section>
|
|
133
|
+
<footer className="ap-activity-sheet__footer sticky bottom-0 mt-3.5 bg-card pt-2.5 [&>button]:min-h-10 [&>button]:w-full">
|
|
134
|
+
<button type="button" className="ap-list__action shrink-0 cursor-pointer rounded-full border-0 bg-primary px-3 py-1 text-xs font-semibold leading-4.5 text-white disabled:cursor-default disabled:opacity-45" disabled={opening || detail.status !== 'active'}
|
|
135
|
+
onClick={() => { void participate(); }}>
|
|
136
|
+
{opening ? '打开中' : detail.status === 'active' ? '立即参与' : activityPlayStatusText(detail.status)}
|
|
137
|
+
</button>
|
|
138
|
+
</footer>
|
|
139
|
+
</>
|
|
140
|
+
) : <p role="status">正在查询活动详情…</p>}
|
|
141
|
+
</BottomSheet>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -1,36 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* 活动事实的查询时快照渲染;正式参与按钮与宿主桥交互归前端任务线)——正式渲染器
|
|
6
|
-
* 由前端负责人按任务线交付后整体替换本文件(替换单文件即可,装配面不变);
|
|
7
|
-
* - 视觉纪律:中立形态(无厂商关联、无 --tbox-asset-* 元素级声明、域变量兜底)。
|
|
8
|
-
*/
|
|
1
|
+
import { activityPlayBadgeClass } from '../view';
|
|
2
|
+
/** 活动卡:列表采用导览式图文布局;详情展示查询快照,参与导航由宿主接入。 */
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { markSelfRendering } from '@tbox.cn/app-agent-sdk-client';
|
|
9
5
|
import type { ActivityPlayCardData } from '@tbox.cn/app-contracts-mall';
|
|
6
|
+
import { ActivityDetailSheet } from './ActivityDetailSheet';
|
|
7
|
+
import { LIST_PREVIEW_COUNT, ListHeader, ListImage, ListTime, ViewAll } from '../ListPresentation';
|
|
10
8
|
import {
|
|
11
9
|
activityPlayStatusText,
|
|
12
10
|
activityPlayStatusTone,
|
|
13
11
|
formatActivityPlayTime,
|
|
14
12
|
} from '../view';
|
|
15
13
|
|
|
16
|
-
/**
|
|
17
|
-
function ActivityRow({ item
|
|
14
|
+
/** 列表按供应商事实展示封面、状态和时间。 */
|
|
15
|
+
function ActivityRow({ item, mallId, isHistory }: {
|
|
16
|
+
item: ActivityPlayCardData['items'][number]; mallId: string; isHistory: boolean;
|
|
17
|
+
}) {
|
|
18
|
+
const [showDetail, setShowDetail] = useState(false);
|
|
18
19
|
const tone = activityPlayStatusTone(item.status);
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
21
|
+
<li className="ap-card__row flex items-start gap-3 border-t border-border py-3.5 first:border-t-0">
|
|
22
|
+
<ListImage src={item.imageUrl} kind="activity" />
|
|
23
|
+
<div className="ap-card__row-main min-w-0 flex-1">
|
|
24
|
+
<div className="ap-card__row-title flex items-center gap-1.5 [&>strong]:truncate [&>strong]:text-sm [&>strong]:leading-5 [&>strong]:text-foreground">
|
|
23
25
|
<strong>{item.title}</strong>
|
|
24
|
-
<span className={`ap-badge ap-badge--${tone}`}>{activityPlayStatusText(item.status)}</span>
|
|
25
26
|
</div>
|
|
26
|
-
{item.description && <p className="ap-card__row-desc">{item.description}</p>}
|
|
27
|
+
{item.description && <p className="ap-card__row-desc mt-1 mb-0 line-clamp-1 text-xs leading-[17px] text-secondary-foreground [overflow-wrap:anywhere]">{item.description}</p>}
|
|
28
|
+
{(item.startsAt || item.endsAt) && (
|
|
29
|
+
<ListTime>
|
|
30
|
+
{item.startsAt && `开始 ${formatActivityPlayTime(item.startsAt)}`}
|
|
31
|
+
{item.startsAt && item.endsAt && ' · '}
|
|
32
|
+
{item.endsAt && `结束 ${formatActivityPlayTime(item.endsAt)}`}
|
|
33
|
+
</ListTime>
|
|
34
|
+
)}
|
|
35
|
+
<div className="ap-list__row-bottom mt-1.5 flex items-center justify-between gap-1.5">
|
|
36
|
+
<span className={`max-w-full shrink-0 rounded-[3.5px] px-1.5 py-px text-[11px] leading-4 [overflow-wrap:anywhere] ap-badge ap-badge--${tone} ${activityPlayBadgeClass(item.status)}`}>{activityPlayStatusText(item.status)}</span>
|
|
37
|
+
{item.status === 'active' && (
|
|
38
|
+
<button type="button" className="ap-list__action shrink-0 cursor-pointer rounded-full border-0 bg-primary px-3 py-1 text-xs font-semibold leading-4.5 text-white disabled:cursor-default disabled:opacity-45" disabled={isHistory}
|
|
39
|
+
onClick={() => setShowDetail(true)}>去参与</button>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
27
42
|
</div>
|
|
28
|
-
|
|
43
|
+
{showDetail && !isHistory && (
|
|
44
|
+
<ActivityDetailSheet mallId={mallId} activityId={item.activityId} onClose={() => setShowDetail(false)} />
|
|
45
|
+
)}
|
|
46
|
+
</li>
|
|
29
47
|
);
|
|
30
48
|
}
|
|
31
49
|
|
|
32
|
-
export function ActivityPlayCard(props: { data: ActivityPlayCardData }) {
|
|
33
|
-
const { data } = props;
|
|
50
|
+
export function ActivityPlayCard(props: { data: ActivityPlayCardData; isHistory?: boolean }) {
|
|
51
|
+
const { data, isHistory = false } = props;
|
|
52
|
+
const [expanded, setExpanded] = useState(false);
|
|
53
|
+
const visibleItems = expanded ? data.items : data.items.slice(0, LIST_PREVIEW_COUNT);
|
|
34
54
|
if (data.mode === 'detail') {
|
|
35
55
|
const item = data.items[0];
|
|
36
56
|
if (!item) return null; // 契约保证 detail 恰 1 项;防御性渲染
|
|
@@ -38,40 +58,40 @@ export function ActivityPlayCard(props: { data: ActivityPlayCardData }) {
|
|
|
38
58
|
.filter(Boolean)
|
|
39
59
|
.join(' — ');
|
|
40
60
|
return (
|
|
41
|
-
<section className="ap-card ap-card--detail">
|
|
42
|
-
<span className="ap-card__eyebrow">活动玩法</span>
|
|
43
|
-
<div className="ap-card__detail-head">
|
|
61
|
+
<section className="ap-card ap-card--detail flex flex-col gap-2 bg-transparent p-0">
|
|
62
|
+
<span className="ap-card__eyebrow text-xs leading-4.5 text-muted-foreground">活动玩法</span>
|
|
63
|
+
<div className="ap-card__detail-head flex flex-wrap items-center gap-2 [&>strong]:text-base [&>strong]:leading-5.5">
|
|
44
64
|
<strong>{item.title}</strong>
|
|
45
|
-
<span className={`ap-badge ap-badge--${activityPlayStatusTone(item.status)}`}>
|
|
65
|
+
<span className={`max-w-full shrink-0 rounded-[3.5px] px-1.5 py-px text-[11px] leading-4 [overflow-wrap:anywhere] ap-badge ap-badge--${activityPlayStatusTone(item.status)} ${activityPlayBadgeClass(item.status)}`}>
|
|
46
66
|
{activityPlayStatusText(item.status)}
|
|
47
67
|
</span>
|
|
48
68
|
</div>
|
|
49
|
-
{item.description && <p className="ap-card__detail-desc">{item.description}</p>}
|
|
69
|
+
{item.description && <p className="ap-card__detail-desc m-0 whitespace-pre-wrap text-[13px] leading-[19px] text-secondary-foreground [overflow-wrap:anywhere]">{item.description}</p>}
|
|
50
70
|
{item.imageUrl && (
|
|
51
|
-
<img className="ap-card__cover" src={item.imageUrl} alt={`${item.title}封面`} loading="lazy" />
|
|
71
|
+
<img className="ap-card__cover max-h-45 w-full rounded-md object-cover" src={item.imageUrl} alt={`${item.title}封面`} loading="lazy" />
|
|
52
72
|
)}
|
|
53
|
-
{range && <p className="ap-card__meta">活动时间:{range}</p>}
|
|
54
|
-
</section>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
if (data.items.length === 0) {
|
|
58
|
-
return (
|
|
59
|
-
<section className="ap-card ap-card--list">
|
|
60
|
-
<span className="ap-card__eyebrow">活动玩法</span>
|
|
61
|
-
<p className="ap-card__empty">当前商场暂无进行中的活动玩法</p>
|
|
73
|
+
{range && <p className="ap-card__meta m-0 text-xs leading-4.5 text-muted-foreground [overflow-wrap:anywhere]">活动时间:{range}</p>}
|
|
62
74
|
</section>
|
|
63
75
|
);
|
|
64
76
|
}
|
|
65
77
|
return (
|
|
66
|
-
<section className="ap-card ap-card--list">
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
<section className="ap-card ap-card--list flex flex-col gap-0 bg-card px-3.5">
|
|
79
|
+
<ListHeader title="商圈活动一览" subtitle="近期活动 一键参与" kind="activity" />
|
|
80
|
+
{data.items.length === 0 ? (
|
|
81
|
+
<p className="ap-card__empty m-0 px-1.5 py-5 text-center text-xs leading-4.5 text-secondary-foreground">暂无匹配的活动玩法</p>
|
|
82
|
+
) : (
|
|
83
|
+
<ul className="ap-card__list m-0 flex list-none flex-col p-0">
|
|
84
|
+
{visibleItems.map((item) => (
|
|
85
|
+
<ActivityRow key={item.activityId} item={item} mallId={data.mallId} isHistory={isHistory} />
|
|
86
|
+
))}
|
|
87
|
+
</ul>
|
|
88
|
+
)}
|
|
89
|
+
{!expanded && data.items.length > LIST_PREVIEW_COUNT && (
|
|
90
|
+
<ViewAll label="查看全部活动" onExpand={() => setExpanded(true)} />
|
|
91
|
+
)}
|
|
73
92
|
</section>
|
|
74
93
|
);
|
|
75
94
|
}
|
|
76
95
|
|
|
96
|
+
markSelfRendering(ActivityPlayCard);
|
|
77
97
|
export default ActivityPlayCard;
|
|
@@ -1,62 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* noResultsReason?/truncated?——PrizeCardItem 条目含标准 send itemActions 出卡件,
|
|
5
|
-
* 占位期不渲染交互按钮);
|
|
6
|
-
* - 占位边界:中立保形展示(奖品名/类型/领取与使用状态/中奖时间),空态出
|
|
7
|
-
* noResultsReason,truncated 只作「展示范围 ≠ 记录范围」提示行——**不冒称无更多
|
|
8
|
-
* 记录**(total 是供应商真实总数);正式渲染器(含 itemActions sendMessage 点击、
|
|
9
|
-
* isHistory 历史禁用与品牌视觉)由前端负责人按任务线交付后整体替换本文件;
|
|
10
|
-
* - 视觉纪律:中立形态(无厂商关联、无 --tbox-asset-* 元素级声明、域变量兜底)。
|
|
11
|
-
*/
|
|
1
|
+
/** 本人奖品列表:导览式图文展示,保留总数与截断提示;消息动作由正式交互接入。 */
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { markSelfRendering } from '@tbox.cn/app-agent-sdk-client';
|
|
12
4
|
import type { ActivityPlayPrizeListCardData } from '@tbox.cn/app-contracts-mall';
|
|
13
5
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
6
|
+
import { LIST_PREVIEW_COUNT, ListHeader, ListImage, ListTime, ViewAll } from '../ListPresentation';
|
|
7
|
+
import { formatActivityPlayTime, prizeStatusLabel } from '../view';
|
|
8
|
+
import { PrizeDetailSheet } from './PrizeDetailSheet';
|
|
18
9
|
|
|
19
|
-
/**
|
|
20
|
-
function PrizeRow({ item
|
|
10
|
+
/** 图文列表行,仅展示奖品事实。 */
|
|
11
|
+
function PrizeRow({ item, isHistory, onDetail }: {
|
|
12
|
+
item: ActivityPlayPrizeListCardData['items'][number]; isHistory: boolean; onDetail: () => void;
|
|
13
|
+
}) {
|
|
21
14
|
return (
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
15
|
+
<li className="ap-card__row flex items-start gap-3 border-t border-border py-3.5 first:border-t-0">
|
|
16
|
+
<ListImage src={item.imageUrl} kind="prize" />
|
|
17
|
+
<div className="ap-card__row-main min-w-0 flex-1">
|
|
18
|
+
<div className="ap-card__row-title flex items-center gap-1.5 [&>strong]:truncate [&>strong]:text-sm [&>strong]:leading-5 [&>strong]:text-foreground">
|
|
25
19
|
<strong>{item.title}</strong>
|
|
26
|
-
<span className="ap-badge ap-badge--muted">{statusLabel(item.claimStatus)}</span>
|
|
27
20
|
</div>
|
|
28
|
-
<p className="ap-card__row-desc">
|
|
29
|
-
{
|
|
30
|
-
{
|
|
21
|
+
<p className="ap-card__row-desc mt-1 mb-0 line-clamp-1 text-xs leading-[17px] text-secondary-foreground [overflow-wrap:anywhere]">
|
|
22
|
+
{item.activityTitle ? `${item.activityTitle} · ` : ''}{prizeStatusLabel(item.prizeType)}
|
|
23
|
+
{' · '}使用状态 {prizeStatusLabel(item.useStatus)}
|
|
31
24
|
</p>
|
|
25
|
+
{item.wonAt && <ListTime>{formatActivityPlayTime(item.wonAt)}</ListTime>}
|
|
26
|
+
<div className="ap-list__row-bottom mt-1.5 flex items-center justify-between gap-1.5">
|
|
27
|
+
<span className={`max-w-full shrink-0 rounded-[3.5px] px-1.5 py-px text-[11px] leading-4 [overflow-wrap:anywhere] ap-badge ap-badge--${item.claimStatus === 'PENDING' ? 'warning' : 'muted'} ${item.claimStatus === 'PENDING' ? 'bg-warning-soft text-warning' : 'bg-neutral-soft text-secondary-foreground'}`}>
|
|
28
|
+
{prizeStatusLabel(item.claimStatus)}
|
|
29
|
+
</span>
|
|
30
|
+
<button type="button" className="ap-list__action shrink-0 cursor-pointer rounded-full border-0 bg-primary px-3 py-1 text-xs font-semibold leading-4.5 text-white disabled:cursor-default disabled:opacity-45" disabled={isHistory}
|
|
31
|
+
onClick={() => { if (!isHistory) onDetail(); }}>查看详情</button>
|
|
32
|
+
</div>
|
|
32
33
|
</div>
|
|
33
|
-
</
|
|
34
|
+
</li>
|
|
34
35
|
);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
export function ActivityPlayPrizeListCard(props: { data: ActivityPlayPrizeListCardData }) {
|
|
38
|
-
const { data } = props;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<span className="ap-card__eyebrow">本人奖品</span>
|
|
43
|
-
<p className="ap-card__empty">{data.noResultsReason ?? '暂无中奖记录'}</p>
|
|
44
|
-
</section>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
38
|
+
export function ActivityPlayPrizeListCard(props: { data: ActivityPlayPrizeListCardData; isHistory?: boolean }) {
|
|
39
|
+
const { data, isHistory = false } = props;
|
|
40
|
+
const [selectedRef, setSelectedRef] = useState<string | null>(null);
|
|
41
|
+
const [expanded, setExpanded] = useState(false);
|
|
42
|
+
const visibleItems = expanded ? data.items : data.items.slice(0, LIST_PREVIEW_COUNT);
|
|
47
43
|
return (
|
|
48
|
-
<section className="ap-card ap-card--list">
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
<section className="ap-card ap-card--list flex flex-col gap-0 bg-card px-3.5">
|
|
45
|
+
<ListHeader title="我的奖品一览" subtitle={`中奖好礼 共 ${data.total} 条记录`} kind="prize" />
|
|
46
|
+
{data.items.length === 0 ? (
|
|
47
|
+
<p className="ap-card__empty m-0 px-1.5 py-5 text-center text-xs leading-4.5 text-secondary-foreground">
|
|
48
|
+
{data.total === 0 ? (data.noResultsReason ?? '暂无中奖记录') : '本次未返回奖品条目'}
|
|
49
|
+
</p>
|
|
50
|
+
) : (
|
|
51
|
+
<ul className="ap-card__list m-0 flex list-none flex-col p-0">
|
|
52
|
+
{visibleItems.map((item) => (
|
|
53
|
+
<PrizeRow key={item.prizeRecordRef} item={item} isHistory={isHistory}
|
|
54
|
+
onDetail={() => setSelectedRef(item.prizeRecordRef)} />
|
|
55
|
+
))}
|
|
56
|
+
</ul>
|
|
57
|
+
)}
|
|
58
|
+
{!expanded && data.items.length > LIST_PREVIEW_COUNT && (
|
|
59
|
+
<ViewAll label="查看全部奖品" onExpand={() => setExpanded(true)} />
|
|
60
|
+
)}
|
|
61
|
+
{data.truncated && (expanded || data.items.length <= LIST_PREVIEW_COUNT) && (
|
|
62
|
+
<p className="ap-card__meta ap-list__footer m-0 text-xs leading-4.5 text-muted-foreground [overflow-wrap:anywhere] m-0 border-t border-border py-2 text-[11px] leading-4">共 {data.total} 条记录,当前展示前 {data.items.length} 条</p>
|
|
63
|
+
)}
|
|
64
|
+
{selectedRef !== null && !isHistory && (
|
|
65
|
+
<PrizeDetailSheet key={`${data.mallId}:${selectedRef}`} mallId={data.mallId}
|
|
66
|
+
prizeRecordRef={selectedRef} onClose={() => setSelectedRef(null)} />
|
|
57
67
|
)}
|
|
58
68
|
</section>
|
|
59
69
|
);
|
|
60
70
|
}
|
|
61
71
|
|
|
72
|
+
markSelfRendering(ActivityPlayPrizeListCard);
|
|
62
73
|
export default ActivityPlayPrizeListCard;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** 本人奖品详情半屏内容,不注册独立卡型。 */
|
|
2
|
+
import type { ActivityPlayPrizeDetail } from '@tbox.cn/app-contracts-mall';
|
|
3
|
+
import { formatActivityPlayTime, prizeStatusLabel } from '../view';
|
|
4
|
+
|
|
5
|
+
export function PrizeDetailContent(props: { data: ActivityPlayPrizeDetail }) {
|
|
6
|
+
const { data } = props;
|
|
7
|
+
return (
|
|
8
|
+
<section className="ap-card ap-card--detail flex flex-col gap-2 bg-transparent p-0">
|
|
9
|
+
<span className="ap-card__eyebrow text-xs leading-4.5 text-muted-foreground">本人奖品</span>
|
|
10
|
+
<div className="ap-card__detail-head flex flex-wrap items-center gap-2 [&>strong]:text-base [&>strong]:leading-5.5">
|
|
11
|
+
<strong>{data.title}</strong>
|
|
12
|
+
<span className="ap-badge ap-badge--muted max-w-full shrink-0 rounded-[3.5px] px-1.5 py-px text-[11px] leading-4 [overflow-wrap:anywhere] bg-neutral-soft text-secondary-foreground">{prizeStatusLabel(data.claimStatus)}</span>
|
|
13
|
+
</div>
|
|
14
|
+
<p className="ap-card__row-desc mt-1 mb-0 line-clamp-1 text-xs leading-[17px] text-secondary-foreground [overflow-wrap:anywhere]">
|
|
15
|
+
{prizeStatusLabel(data.prizeType)} · 使用状态 {prizeStatusLabel(data.useStatus)}
|
|
16
|
+
{data.wonAt ? ` · ${formatActivityPlayTime(data.wonAt)}` : ''}
|
|
17
|
+
</p>
|
|
18
|
+
{data.activityTitle && <p className="ap-card__meta m-0 text-xs leading-4.5 text-muted-foreground [overflow-wrap:anywhere]">来源活动:{data.activityTitle}</p>}
|
|
19
|
+
{data.usageRuleText && (
|
|
20
|
+
<p className="ap-card__detail-desc m-0 whitespace-pre-wrap text-[13px] leading-[19px] text-secondary-foreground [overflow-wrap:anywhere]">使用规则:{data.usageRuleText}</p>
|
|
21
|
+
)}
|
|
22
|
+
{data.redemptionMethod && <p className="ap-card__detail-desc m-0 whitespace-pre-wrap text-[13px] leading-[19px] text-secondary-foreground [overflow-wrap:anywhere]">领取方式:{prizeStatusLabel(data.redemptionMethod)}</p>}
|
|
23
|
+
{data.redemptionInstruction && (
|
|
24
|
+
<p className="ap-card__detail-desc m-0 whitespace-pre-wrap text-[13px] leading-[19px] text-secondary-foreground [overflow-wrap:anywhere]">领取说明:{data.redemptionInstruction}</p>
|
|
25
|
+
)}
|
|
26
|
+
{data.prizeUrl && (
|
|
27
|
+
<p className="ap-card__meta m-0 text-xs leading-4.5 text-muted-foreground [overflow-wrap:anywhere]">领取指引:{data.prizeUrl}(以活动页面为准)</p>
|
|
28
|
+
)}
|
|
29
|
+
</section>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default PrizeDetailContent;
|