@tbox.cn/app-module-alipay-activity 1.0.0-alpha.1 → 1.0.0-alpha.7
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/AGENTS.md +3 -3
- package/README.md +1 -1
- package/dist/client/index.js +31 -34
- package/package.json +5 -8
- package/src/client/cards/bumpin-activity/index.tsx +35 -35
- package/src/client/index.ts +0 -2
- package/tbox.module.json +0 -1
- package/tsup.config.ts +0 -3
- package/dist/bumpin-UR4NBS7F.css +0 -531
- package/src/client/styles/bumpin.css +0 -531
package/AGENTS.md
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
## 自定义 API 对接(AI 集成)
|
|
7
7
|
|
|
8
8
|
见本包 `INTEGRATION.md`(接入语义真源);实施落点与流程见
|
|
9
|
-
`
|
|
10
|
-
`
|
|
9
|
+
`pnpm exec tbox-app skills get integration`(任务路由/材料清单)与
|
|
10
|
+
`pnpm exec tbox-app skills get provider-custom`(adapter 实施)。
|
|
11
11
|
|
|
12
12
|
## 真实厂商接入
|
|
13
13
|
|
|
14
|
-
见本包 `INTEGRATION.md`;官方 provider 包形态:应用态 `
|
|
14
|
+
见本包 `INTEGRATION.md`;官方 provider 包形态:应用态 `pnpm exec tbox-app new provider <name>`(`packages/provider-<id>`
|
|
15
15
|
local 形态)/ 仓内发布源 `tbox-app-dev new provider <name>`(`modules/provider-<id>` 发布形态)。
|
package/README.md
CHANGED
package/dist/client/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// src/client/index.ts
|
|
2
|
-
import "../bumpin-UR4NBS7F.css";
|
|
3
|
-
|
|
4
1
|
// src/client/cards/bumpin-activity/index.tsx
|
|
5
2
|
import { useState as useState2 } from "react";
|
|
6
3
|
import { CaretDown, CaretUp, Lock, Trophy } from "@phosphor-icons/react";
|
|
@@ -91,25 +88,25 @@ function StepsProgress({
|
|
|
91
88
|
unit
|
|
92
89
|
}) {
|
|
93
90
|
const steps = Array.from({ length: total }, (_, index) => index + 1);
|
|
94
|
-
return /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__steps", children: steps.map((stepNumber, index) => {
|
|
91
|
+
return /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__steps flex items-start justify-between px-3 pb-1 pt-2.5", children: steps.map((stepNumber, index) => {
|
|
95
92
|
const isDone = stepNumber <= current;
|
|
96
93
|
const isLast = index === steps.length - 1;
|
|
97
94
|
const isLocked = isLast && !isDone;
|
|
98
|
-
return /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__step-item", children: [
|
|
95
|
+
return /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__step-item relative flex flex-1 flex-col items-center gap-1", children: [
|
|
99
96
|
index > 0 && /* @__PURE__ */ jsx2(
|
|
100
97
|
"div",
|
|
101
98
|
{
|
|
102
|
-
className: `promotion-bumpin__step-line${isDone && steps[index - 1] <= current ? " promotion-bumpin__step-line--done" : ""}`
|
|
99
|
+
className: `promotion-bumpin__step-line absolute left-[-50%] right-1/2 top-2.5 h-0.75 -translate-y-1/2 ${isDone && steps[index - 1] <= current ? "bg-warning shadow-sm promotion-bumpin__step-line--done" : "bg-[rgba(255,255,255,0.18)]"}`
|
|
103
100
|
}
|
|
104
101
|
),
|
|
105
102
|
/* @__PURE__ */ jsx2(
|
|
106
103
|
"div",
|
|
107
104
|
{
|
|
108
|
-
className: `promotion-bumpin__step-node${
|
|
105
|
+
className: `promotion-bumpin__step-node relative z-10 flex size-5.5 items-center justify-center rounded-full border-2 text-xs font-bold leading-none ${isLocked ? "border-warning bg-warn-surface text-warn-ink promotion-bumpin__step-node--locked" : isDone ? "border-warning bg-white text-primary promotion-bumpin__step-node--done" : "border-[rgba(255,255,255,0.3)] bg-[rgba(255,255,255,0.12)] text-[rgba(255,255,255,0.7)]"}`,
|
|
109
106
|
children: isLocked ? /* @__PURE__ */ jsx2(Lock, { weight: "fill", size: 20 }) : /* @__PURE__ */ jsx2("span", { children: stepNumber })
|
|
110
107
|
}
|
|
111
108
|
),
|
|
112
|
-
/* @__PURE__ */ jsxs("span", { className: "promotion-bumpin__step-label", children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("span", { className: "promotion-bumpin__step-label whitespace-nowrap text-xs leading-tight text-white-dim", children: [
|
|
113
110
|
stepNumber,
|
|
114
111
|
" ",
|
|
115
112
|
unit
|
|
@@ -130,31 +127,31 @@ function AlipayActivityBumpInCard(props) {
|
|
|
130
127
|
const visibleVouchers = prizesExpanded ? data.vouchers : data.vouchers.slice(0, PRIZES_PREVIEW_COUNT);
|
|
131
128
|
const hiddenCount = data.vouchers.length - PRIZES_PREVIEW_COUNT;
|
|
132
129
|
const statusBadge = data.actStatus === "NOT_START" ? "\u672A\u5F00\u59CB" : data.actStatus === "FINISH" ? "\u5DF2\u7ED3\u675F" : data.actStatus === "RECEIVED" ? "\u5DF2\u9886\u5956" : void 0;
|
|
133
|
-
const statusClass = data.actStatus === "NOT_START" ? "promotion-bumpin__status--pending" : data.actStatus === "RECEIVED" ? "promotion-bumpin__status--received" : "promotion-bumpin__status--terminal";
|
|
130
|
+
const statusClass = data.actStatus === "NOT_START" ? "promotion-bumpin__status--pending border border-white-line bg-white-soft text-white" : data.actStatus === "RECEIVED" ? "promotion-bumpin__status--received border border-warn-border bg-warn-surface text-warn-ink" : "promotion-bumpin__status--terminal border border-border bg-neutral-soft text-muted-foreground";
|
|
134
131
|
const notStarted = data.actStatus === "NOT_START";
|
|
135
132
|
const periodDateText = notStarted ? data.startAtText ?? data.endAtText : data.endAtText;
|
|
136
133
|
const periodText = periodDateText ? periodDateText.replace(/^\d{4}-/, "").replace("-", " \u6708 ").concat(notStarted && data.startAtText ? " \u65E5\u5F00\u59CB" : " \u65E5\u524D\u6709\u6548") : void 0;
|
|
137
|
-
return /* @__PURE__ */ jsxs("section", { className: "promotion-card promotion-bumpin", children: [
|
|
134
|
+
return /* @__PURE__ */ jsxs("section", { className: "promotion-card promotion-bumpin relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
|
|
138
135
|
/* @__PURE__ */ jsxs(
|
|
139
136
|
"div",
|
|
140
137
|
{
|
|
141
|
-
className: `promotion-bumpin__header${hasBackground ? "
|
|
138
|
+
className: `promotion-bumpin__header ${hasBackground ? "promotion-bumpin__header--bg bumpin-hero bumpin-scrim block min-h-25 p-3 pb-3.5" : "flex items-center gap-2.5 bg-linear-to-br from-primary-foreground to-card p-3.5"}`,
|
|
142
139
|
style: serverBgUrl ? { backgroundImage: `url(${serverBgUrl})` } : void 0,
|
|
143
140
|
children: [
|
|
144
|
-
!hasBackground && data.coverUrl && /* @__PURE__ */ jsx2(ImageWithFallback, { src: data.coverUrl, alt: data.title, className: "promotion-bumpin__cover" }),
|
|
145
|
-
!hasBackground && !data.coverUrl && /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__cover-placeholder" }),
|
|
146
|
-
/* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__header-copy", children: [
|
|
147
|
-
(data.tagLabel || statusBadge) && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__tag-row", children: [
|
|
148
|
-
data.tagLabel && /* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__tag", children: data.tagLabel }),
|
|
149
|
-
statusBadge && /* @__PURE__ */ jsx2("span", { className: `promotion-bumpin__status ${statusClass}`, children: statusBadge })
|
|
141
|
+
!hasBackground && data.coverUrl && /* @__PURE__ */ jsx2(ImageWithFallback, { src: data.coverUrl, alt: data.title, className: "promotion-bumpin__cover size-14.5 shrink-0 rounded-md object-cover shadow-lg" }),
|
|
142
|
+
!hasBackground && !data.coverUrl && /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__cover-placeholder grid size-14.5 shrink-0 place-items-center rounded-md bg-white-soft text-white" }),
|
|
143
|
+
/* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__header-copy grid min-w-0 gap-1", children: [
|
|
144
|
+
(data.tagLabel || statusBadge) && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__tag-row flex flex-wrap items-center gap-1", children: [
|
|
145
|
+
data.tagLabel && /* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__tag inline-block rounded-full border border-warn-border bg-warn-surface px-1.5 py-0.5 text-xs font-semibold leading-3.5 text-warn-ink", children: data.tagLabel }),
|
|
146
|
+
statusBadge && /* @__PURE__ */ jsx2("span", { className: `promotion-bumpin__status inline-block rounded-full px-1.5 py-0.5 text-xs font-semibold leading-3.5 ${statusClass}`, children: statusBadge })
|
|
150
147
|
] }),
|
|
151
|
-
/* @__PURE__ */ jsx2("h3", { className: "promotion-bumpin__title", children: data.mainTitle || data.title }),
|
|
152
|
-
periodText && /* @__PURE__ */ jsx2("small", { className: "promotion-bumpin__period", children: periodText })
|
|
148
|
+
/* @__PURE__ */ jsx2("h3", { className: "promotion-bumpin__title flex items-center gap-1 break-words text-base font-bold leading-5 text-white [&_svg]:shrink-0", children: data.mainTitle || data.title }),
|
|
149
|
+
periodText && /* @__PURE__ */ jsx2("small", { className: "promotion-bumpin__period justify-self-start rounded-full bg-white-soft px-1.5 py-0.5 text-xs leading-3.5 text-white", children: periodText })
|
|
153
150
|
] })
|
|
154
151
|
]
|
|
155
152
|
}
|
|
156
153
|
),
|
|
157
|
-
data.totalProgress && /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress", children: isStepsMode ? /* @__PURE__ */ jsx2(
|
|
154
|
+
data.totalProgress && /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress grid gap-1.25 px-3.5 pt-3", children: isStepsMode ? /* @__PURE__ */ jsx2(
|
|
158
155
|
StepsProgress,
|
|
159
156
|
{
|
|
160
157
|
total: totalNum,
|
|
@@ -162,33 +159,33 @@ function AlipayActivityBumpInCard(props) {
|
|
|
162
159
|
unit: data.progressUnit ?? "\u6B21"
|
|
163
160
|
}
|
|
164
161
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
165
|
-
/* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress-bar", children: /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress-fill", style: { width: `${progressPercent}%` } }) }),
|
|
166
|
-
/* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__progress-text", children: notStarted ? "\u5C1A\u672A\u5F00\u59CB" : `\u5DF2\u5B8C\u6210 ${data.currentProgress ?? "0"} / ${data.totalProgress} ${data.progressUnit ?? "\u6B21"}` })
|
|
162
|
+
/* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress-bar h-1.75 overflow-hidden rounded-full bg-border", children: /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__progress-fill h-full rounded-full bg-warning transition-all duration-300", style: { width: `${progressPercent}%` } }) }),
|
|
163
|
+
/* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__progress-text text-xs leading-4 text-muted-foreground", children: notStarted ? "\u5C1A\u672A\u5F00\u59CB" : `\u5DF2\u5B8C\u6210 ${data.currentProgress ?? "0"} / ${data.totalProgress} ${data.progressUnit ?? "\u6B21"}` })
|
|
167
164
|
] }) }),
|
|
168
|
-
!isBanner && data.vouchers.length > 0 && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__prizes", children: [
|
|
169
|
-
/* @__PURE__ */ jsxs("header", { className: "promotion-bumpin__prizes-header", children: [
|
|
165
|
+
!isBanner && data.vouchers.length > 0 && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__prizes mx-3.5 mt-3 overflow-hidden rounded-lg border-2 border-border bg-muted", children: [
|
|
166
|
+
/* @__PURE__ */ jsxs("header", { className: "promotion-bumpin__prizes-header flex items-center gap-1 border-b-2 border-border px-2.5 py-2 text-xs font-bold leading-4 text-warn-ink", children: [
|
|
170
167
|
/* @__PURE__ */ jsx2(Trophy, { weight: "fill" }),
|
|
171
168
|
data.actStatus === "RECEIVED" ? "\u5DF2\u9886\u53D6 \xB7 \u5956\u52B1\u6C60" : "\u5956\u52B1\u6C60"
|
|
172
169
|
] }),
|
|
173
|
-
/* @__PURE__ */ jsx2("ul", { className: "promotion-bumpin__prizes-list", children: visibleVouchers.map((voucher) => /* @__PURE__ */ jsxs("li", { className: "promotion-bumpin__prize-item", children: [
|
|
170
|
+
/* @__PURE__ */ jsx2("ul", { className: "promotion-bumpin__prizes-list m-0 grid list-none p-0", children: visibleVouchers.map((voucher) => /* @__PURE__ */ jsxs("li", { className: "promotion-bumpin__prize-item flex items-center gap-2 border-b-2 border-border bg-card px-2.5 py-2 last:border-b-0", children: [
|
|
174
171
|
voucher.itemLogo ? /* @__PURE__ */ jsx2(
|
|
175
172
|
ImageWithFallback,
|
|
176
173
|
{
|
|
177
174
|
src: voucher.itemLogo,
|
|
178
175
|
alt: voucher.voucherName,
|
|
179
|
-
className: "promotion-bumpin__prize-logo"
|
|
176
|
+
className: "promotion-bumpin__prize-logo size-9 shrink-0 rounded-md object-cover"
|
|
180
177
|
}
|
|
181
|
-
) : /* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__prize-logo-placeholder" }),
|
|
182
|
-
/* @__PURE__ */ jsxs("span", { className: "promotion-bumpin__prize-copy", children: [
|
|
183
|
-
/* @__PURE__ */ jsx2("strong", { children: voucher.voucherName }),
|
|
184
|
-
/* @__PURE__ */ jsx2("small", { children: voucher.thresholdAmountText || voucher.merchantName })
|
|
178
|
+
) : /* @__PURE__ */ jsx2("span", { className: "promotion-bumpin__prize-logo-placeholder size-9 shrink-0 rounded-md bg-success-soft" }),
|
|
179
|
+
/* @__PURE__ */ jsxs("span", { className: "promotion-bumpin__prize-copy grid min-w-0 gap-0.5", children: [
|
|
180
|
+
/* @__PURE__ */ jsx2("strong", { className: "truncate text-xs font-semibold leading-4 text-foreground", children: voucher.voucherName }),
|
|
181
|
+
/* @__PURE__ */ jsx2("small", { className: "truncate text-xs leading-3.5 text-muted-foreground", children: voucher.thresholdAmountText || voucher.merchantName })
|
|
185
182
|
] })
|
|
186
183
|
] }, voucher.prizeId)) }),
|
|
187
184
|
data.vouchers.length > PRIZES_PREVIEW_COUNT && /* @__PURE__ */ jsx2(
|
|
188
185
|
"button",
|
|
189
186
|
{
|
|
190
187
|
type: "button",
|
|
191
|
-
className: "promotion-bumpin__prizes-toggle",
|
|
188
|
+
className: "promotion-bumpin__prizes-toggle flex w-full cursor-pointer items-center justify-center gap-1.5 border-0 border-t-2 border-border bg-transparent px-2.5 py-2 text-xs font-semibold text-muted-foreground [font-family:inherit] active:opacity-70",
|
|
192
189
|
onClick: () => setPrizesExpanded((prev) => !prev),
|
|
193
190
|
children: prizesExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
194
191
|
/* @__PURE__ */ jsx2(CaretUp, { weight: "bold", size: 12 }),
|
|
@@ -202,12 +199,12 @@ function AlipayActivityBumpInCard(props) {
|
|
|
202
199
|
}
|
|
203
200
|
)
|
|
204
201
|
] }),
|
|
205
|
-
data.description && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__rules", children: [
|
|
206
|
-
/* @__PURE__ */ jsx2("header", { className: "promotion-bumpin__rules-header", children: "\u6D3B\u52A8\u89C4\u5219" }),
|
|
202
|
+
data.description && /* @__PURE__ */ jsxs("div", { className: "promotion-bumpin__rules mx-3.5 mb-3.5 mt-3 overflow-hidden rounded-lg bg-muted", children: [
|
|
203
|
+
/* @__PURE__ */ jsx2("header", { className: "promotion-bumpin__rules-header px-2.5 pt-1.75 text-xs font-bold leading-3.5 text-muted-foreground", children: "\u6D3B\u52A8\u89C4\u5219" }),
|
|
207
204
|
/* @__PURE__ */ jsx2(
|
|
208
205
|
"div",
|
|
209
206
|
{
|
|
210
|
-
className: "promotion-bumpin__rules-content",
|
|
207
|
+
className: "promotion-bumpin__rules-content break-words px-2.5 pb-2 pt-1.25 text-xs leading-4 text-muted-foreground [&_img]:max-w-full",
|
|
211
208
|
dangerouslySetInnerHTML: { __html: sanitizeActivityHtml(data.description) }
|
|
212
209
|
}
|
|
213
210
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-module-alipay-activity",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "支付宝互动营销活动模块:碰出惊喜(碰一下)活动查询与展示(codegen 源)。",
|
|
6
6
|
"exports": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tbox.cn/app-contracts": "1.0.0-alpha.1",
|
|
22
|
-
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.1",
|
|
23
21
|
"alipay-sdk": "4.14.0",
|
|
24
|
-
"@tbox.cn/app-
|
|
25
|
-
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.
|
|
22
|
+
"@tbox.cn/app-contracts": "1.0.0-alpha.7",
|
|
23
|
+
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.7",
|
|
24
|
+
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.7",
|
|
25
|
+
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.7"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"zod": "3.25.76",
|
|
@@ -60,9 +60,6 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"license": "MIT",
|
|
63
|
-
"sideEffects": [
|
|
64
|
-
"**/*.css"
|
|
65
|
-
],
|
|
66
63
|
"scripts": {
|
|
67
64
|
"typecheck": "tsc --noEmit",
|
|
68
65
|
"test": "vitest run",
|
|
@@ -18,20 +18,20 @@ function StepsProgress({
|
|
|
18
18
|
}) {
|
|
19
19
|
const steps = Array.from({ length: total }, (_, index) => index + 1);
|
|
20
20
|
return (
|
|
21
|
-
<div className="promotion-bumpin__steps">
|
|
21
|
+
<div className="promotion-bumpin__steps flex items-start justify-between px-3 pb-1 pt-2.5">
|
|
22
22
|
{steps.map((stepNumber, index) => {
|
|
23
23
|
const isDone = stepNumber <= current;
|
|
24
24
|
const isLast = index === steps.length - 1;
|
|
25
25
|
const isLocked = isLast && !isDone;
|
|
26
26
|
return (
|
|
27
|
-
<div key={stepNumber} className="promotion-bumpin__step-item">
|
|
27
|
+
<div key={stepNumber} className="promotion-bumpin__step-item relative flex flex-1 flex-col items-center gap-1">
|
|
28
28
|
{index > 0 && (
|
|
29
29
|
<div
|
|
30
|
-
className={`promotion-bumpin__step-line${isDone && steps[index - 1] <= current ? ' promotion-bumpin__step-line--done' : ''}`}
|
|
30
|
+
className={`promotion-bumpin__step-line absolute left-[-50%] right-1/2 top-2.5 h-0.75 -translate-y-1/2 ${isDone && steps[index - 1] <= current ? 'bg-warning shadow-sm promotion-bumpin__step-line--done' : 'bg-[rgba(255,255,255,0.18)]'}`}
|
|
31
31
|
/>
|
|
32
32
|
)}
|
|
33
33
|
<div
|
|
34
|
-
className={`promotion-bumpin__step-node${
|
|
34
|
+
className={`promotion-bumpin__step-node relative z-10 flex size-5.5 items-center justify-center rounded-full border-2 text-xs font-bold leading-none ${isLocked ? 'border-warning bg-warn-surface text-warn-ink promotion-bumpin__step-node--locked' : isDone ? 'border-warning bg-white text-primary promotion-bumpin__step-node--done' : 'border-[rgba(255,255,255,0.3)] bg-[rgba(255,255,255,0.12)] text-[rgba(255,255,255,0.7)]'}`}
|
|
35
35
|
>
|
|
36
36
|
{isLocked ? (
|
|
37
37
|
<Lock weight="fill" size={20} />
|
|
@@ -39,7 +39,7 @@ function StepsProgress({
|
|
|
39
39
|
<span>{stepNumber}</span>
|
|
40
40
|
)}
|
|
41
41
|
</div>
|
|
42
|
-
<span className="promotion-bumpin__step-label">{stepNumber} {unit}</span>
|
|
42
|
+
<span className="promotion-bumpin__step-label whitespace-nowrap text-xs leading-tight text-white-dim">{stepNumber} {unit}</span>
|
|
43
43
|
</div>
|
|
44
44
|
);
|
|
45
45
|
})}
|
|
@@ -83,10 +83,10 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
83
83
|
: undefined;
|
|
84
84
|
const statusClass =
|
|
85
85
|
data.actStatus === 'NOT_START'
|
|
86
|
-
? 'promotion-bumpin__status--pending'
|
|
86
|
+
? 'promotion-bumpin__status--pending border border-white-line bg-white-soft text-white'
|
|
87
87
|
: data.actStatus === 'RECEIVED'
|
|
88
|
-
? 'promotion-bumpin__status--received'
|
|
89
|
-
: 'promotion-bumpin__status--terminal';
|
|
88
|
+
? 'promotion-bumpin__status--received border border-warn-border bg-warn-surface text-warn-ink'
|
|
89
|
+
: 'promotion-bumpin__status--terminal border border-border bg-neutral-soft text-muted-foreground';
|
|
90
90
|
// 未开始:有效期行改「{startAtText} 开始」(活动尚未开始,"日前有效"是误导)
|
|
91
91
|
const notStarted = data.actStatus === 'NOT_START';
|
|
92
92
|
const periodDateText = notStarted ? (data.startAtText ?? data.endAtText) : data.endAtText;
|
|
@@ -98,36 +98,36 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
98
98
|
: undefined;
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
|
-
<section className="promotion-card promotion-bumpin">
|
|
101
|
+
<section className="promotion-card promotion-bumpin relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
|
|
102
102
|
{/* ── 头部:全幅背景图(联单)或 cover 小图(普通)── */}
|
|
103
103
|
<div
|
|
104
|
-
className={`promotion-bumpin__header${hasBackground ? '
|
|
104
|
+
className={`promotion-bumpin__header ${hasBackground ? 'promotion-bumpin__header--bg bumpin-hero bumpin-scrim block min-h-25 p-3 pb-3.5' : 'flex items-center gap-2.5 bg-linear-to-br from-primary-foreground to-card p-3.5'}`}
|
|
105
105
|
style={serverBgUrl ? { backgroundImage: `url(${serverBgUrl})` } : undefined}
|
|
106
106
|
>
|
|
107
107
|
{!hasBackground && data.coverUrl && (
|
|
108
|
-
<ImageWithFallback src={data.coverUrl} alt={data.title} className="promotion-bumpin__cover" />
|
|
108
|
+
<ImageWithFallback src={data.coverUrl} alt={data.title} className="promotion-bumpin__cover size-14.5 shrink-0 rounded-md object-cover shadow-lg" />
|
|
109
109
|
)}
|
|
110
110
|
{!hasBackground && !data.coverUrl && (
|
|
111
|
-
<div className="promotion-bumpin__cover-placeholder" />
|
|
111
|
+
<div className="promotion-bumpin__cover-placeholder grid size-14.5 shrink-0 place-items-center rounded-md bg-white-soft text-white" />
|
|
112
112
|
)}
|
|
113
113
|
|
|
114
|
-
<div className="promotion-bumpin__header-copy">
|
|
114
|
+
<div className="promotion-bumpin__header-copy grid min-w-0 gap-1">
|
|
115
115
|
{(data.tagLabel || statusBadge) && (
|
|
116
|
-
<div className="promotion-bumpin__tag-row">
|
|
116
|
+
<div className="promotion-bumpin__tag-row flex flex-wrap items-center gap-1">
|
|
117
117
|
{data.tagLabel && (
|
|
118
|
-
<span className="promotion-bumpin__tag">{data.tagLabel}</span>
|
|
118
|
+
<span className="promotion-bumpin__tag inline-block rounded-full border border-warn-border bg-warn-surface px-1.5 py-0.5 text-xs font-semibold leading-3.5 text-warn-ink">{data.tagLabel}</span>
|
|
119
119
|
)}
|
|
120
|
-
{statusBadge && <span className={`promotion-bumpin__status ${statusClass}`}>{statusBadge}</span>}
|
|
120
|
+
{statusBadge && <span className={`promotion-bumpin__status inline-block rounded-full px-1.5 py-0.5 text-xs font-semibold leading-3.5 ${statusClass}`}>{statusBadge}</span>}
|
|
121
121
|
</div>
|
|
122
122
|
)}
|
|
123
|
-
<h3 className="promotion-bumpin__title">{data.mainTitle || data.title}</h3>
|
|
124
|
-
{periodText && <small className="promotion-bumpin__period">{periodText}</small>}
|
|
123
|
+
<h3 className="promotion-bumpin__title flex items-center gap-1 break-words text-base font-bold leading-5 text-white [&_svg]:shrink-0">{data.mainTitle || data.title}</h3>
|
|
124
|
+
{periodText && <small className="promotion-bumpin__period justify-self-start rounded-full bg-white-soft px-1.5 py-0.5 text-xs leading-3.5 text-white">{periodText}</small>}
|
|
125
125
|
</div>
|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
128
|
{/* ── 进度:steps 步骤节点 或 bar 线性条 ── */}
|
|
129
129
|
{data.totalProgress && (
|
|
130
|
-
<div className="promotion-bumpin__progress">
|
|
130
|
+
<div className="promotion-bumpin__progress grid gap-1.25 px-3.5 pt-3">
|
|
131
131
|
{isStepsMode ? (
|
|
132
132
|
<StepsProgress
|
|
133
133
|
total={totalNum}
|
|
@@ -136,10 +136,10 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
136
136
|
/>
|
|
137
137
|
) : (
|
|
138
138
|
<>
|
|
139
|
-
<div className="promotion-bumpin__progress-bar">
|
|
140
|
-
<div className="promotion-bumpin__progress-fill" style={{ width: `${progressPercent}%` }} />
|
|
139
|
+
<div className="promotion-bumpin__progress-bar h-1.75 overflow-hidden rounded-full bg-border">
|
|
140
|
+
<div className="promotion-bumpin__progress-fill h-full rounded-full bg-warning transition-all duration-300" style={{ width: `${progressPercent}%` }} />
|
|
141
141
|
</div>
|
|
142
|
-
<span className="promotion-bumpin__progress-text">
|
|
142
|
+
<span className="promotion-bumpin__progress-text text-xs leading-4 text-muted-foreground">
|
|
143
143
|
{notStarted
|
|
144
144
|
? '尚未开始'
|
|
145
145
|
: `已完成 ${data.currentProgress ?? '0'} / ${data.totalProgress} ${data.progressUnit ?? '次'}`}
|
|
@@ -151,26 +151,26 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
151
151
|
|
|
152
152
|
{/* ── 奖励池 ── */}
|
|
153
153
|
{!isBanner && data.vouchers.length > 0 && (
|
|
154
|
-
<div className="promotion-bumpin__prizes">
|
|
155
|
-
<header className="promotion-bumpin__prizes-header">
|
|
154
|
+
<div className="promotion-bumpin__prizes mx-3.5 mt-3 overflow-hidden rounded-lg border-2 border-border bg-muted">
|
|
155
|
+
<header className="promotion-bumpin__prizes-header flex items-center gap-1 border-b-2 border-border px-2.5 py-2 text-xs font-bold leading-4 text-warn-ink">
|
|
156
156
|
<Trophy weight="fill" />
|
|
157
157
|
{data.actStatus === 'RECEIVED' ? '已领取 · 奖励池' : '奖励池'}
|
|
158
158
|
</header>
|
|
159
|
-
<ul className="promotion-bumpin__prizes-list">
|
|
159
|
+
<ul className="promotion-bumpin__prizes-list m-0 grid list-none p-0">
|
|
160
160
|
{visibleVouchers.map((voucher) => (
|
|
161
|
-
<li key={voucher.prizeId} className="promotion-bumpin__prize-item">
|
|
161
|
+
<li key={voucher.prizeId} className="promotion-bumpin__prize-item flex items-center gap-2 border-b-2 border-border bg-card px-2.5 py-2 last:border-b-0">
|
|
162
162
|
{voucher.itemLogo ? (
|
|
163
163
|
<ImageWithFallback
|
|
164
164
|
src={voucher.itemLogo}
|
|
165
165
|
alt={voucher.voucherName}
|
|
166
|
-
className="promotion-bumpin__prize-logo"
|
|
166
|
+
className="promotion-bumpin__prize-logo size-9 shrink-0 rounded-md object-cover"
|
|
167
167
|
/>
|
|
168
168
|
) : (
|
|
169
|
-
<span className="promotion-bumpin__prize-logo-placeholder" />
|
|
169
|
+
<span className="promotion-bumpin__prize-logo-placeholder size-9 shrink-0 rounded-md bg-success-soft" />
|
|
170
170
|
)}
|
|
171
|
-
<span className="promotion-bumpin__prize-copy">
|
|
172
|
-
<strong>{voucher.voucherName}</strong>
|
|
173
|
-
<small>{voucher.thresholdAmountText || voucher.merchantName}</small>
|
|
171
|
+
<span className="promotion-bumpin__prize-copy grid min-w-0 gap-0.5">
|
|
172
|
+
<strong className="truncate text-xs font-semibold leading-4 text-foreground">{voucher.voucherName}</strong>
|
|
173
|
+
<small className="truncate text-xs leading-3.5 text-muted-foreground">{voucher.thresholdAmountText || voucher.merchantName}</small>
|
|
174
174
|
</span>
|
|
175
175
|
</li>
|
|
176
176
|
))}
|
|
@@ -178,7 +178,7 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
178
178
|
{data.vouchers.length > PRIZES_PREVIEW_COUNT && (
|
|
179
179
|
<button
|
|
180
180
|
type="button"
|
|
181
|
-
className="promotion-bumpin__prizes-toggle"
|
|
181
|
+
className="promotion-bumpin__prizes-toggle flex w-full cursor-pointer items-center justify-center gap-1.5 border-0 border-t-2 border-border bg-transparent px-2.5 py-2 text-xs font-semibold text-muted-foreground [font-family:inherit] active:opacity-70"
|
|
182
182
|
onClick={() => setPrizesExpanded((prev) => !prev)}
|
|
183
183
|
>
|
|
184
184
|
{prizesExpanded ? (
|
|
@@ -199,10 +199,10 @@ export function AlipayActivityBumpInCard(props: {
|
|
|
199
199
|
|
|
200
200
|
{/* ── 活动规则 ── */}
|
|
201
201
|
{data.description && (
|
|
202
|
-
<div className="promotion-bumpin__rules">
|
|
203
|
-
<header className="promotion-bumpin__rules-header">活动规则</header>
|
|
202
|
+
<div className="promotion-bumpin__rules mx-3.5 mb-3.5 mt-3 overflow-hidden rounded-lg bg-muted">
|
|
203
|
+
<header className="promotion-bumpin__rules-header px-2.5 pt-1.75 text-xs font-bold leading-3.5 text-muted-foreground">活动规则</header>
|
|
204
204
|
<div
|
|
205
|
-
className="promotion-bumpin__rules-content"
|
|
205
|
+
className="promotion-bumpin__rules-content break-words px-2.5 pb-2 pt-1.25 text-xs leading-4 text-muted-foreground [&_img]:max-w-full"
|
|
206
206
|
dangerouslySetInnerHTML={{ __html: sanitizeActivityHtml(data.description) }}
|
|
207
207
|
/>
|
|
208
208
|
</div>
|
package/src/client/index.ts
CHANGED
package/tbox.module.json
CHANGED