@tbox.cn/app-module-member 1.0.0-alpha.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/AGENTS.md +3 -3
- package/dist/chunk-O7IULIMR.js +838 -0
- package/dist/client/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/server/index.d.ts +152 -152
- package/dist/server/index.js +1 -1
- package/package.json +12 -9
- package/src/client/cards/member-card-summary/index.tsx +207 -115
- package/src/client/cards/member-enrollment-cta/index.tsx +10 -10
- package/src/client/cards/member-enrollment-form/index.tsx +34 -26
- package/src/client/cards/member-enrollment-status/index.tsx +24 -9
- package/src/client/cards/member-info/index.tsx +20 -20
- package/src/client/cards/member-login-cta/index.tsx +14 -14
- package/src/client/cards/member-point-usage-list/index.tsx +27 -21
- package/src/client/components/ImageWithFallback.tsx +1 -1
- package/src/client/index.ts +0 -2
- package/tbox.module.json +0 -1
- package/tests/cards-render.test.tsx +6 -4
- package/tsup.config.ts +0 -5
- package/dist/chunk-GMHJMLRV.js +0 -767
- package/dist/member-372B74DY.css +0 -1740
- package/src/client/styles/member.css +0 -1740
- package/src/client/types/css.d.ts +0 -2
- /package/dist/{chunk-DSFXLULX.js → chunk-6JWXQAHX.js} +0 -0
package/dist/server/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-module-member",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "商圈会员模块:会员账户、会员卡、积分流水与入会流程(codegen 源)。",
|
|
6
6
|
"exports": {
|
|
@@ -18,16 +18,17 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tbox.cn/app-
|
|
22
|
-
"@tbox.cn/app-
|
|
23
|
-
"@tbox.cn/app-
|
|
24
|
-
"@tbox.cn/app-
|
|
21
|
+
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.10",
|
|
22
|
+
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.10",
|
|
23
|
+
"@tbox.cn/app-contracts": "1.0.0-alpha.10",
|
|
24
|
+
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.10"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"zod": "3.25.76",
|
|
28
28
|
"react": "18.3.1",
|
|
29
29
|
"react-dom": "18.3.1",
|
|
30
|
-
"@phosphor-icons/react": "2.1.10"
|
|
30
|
+
"@phosphor-icons/react": "2.1.10",
|
|
31
|
+
"@tbox.cn/app-agent-ui-kit": "^1.0.0-alpha.10"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/react": "18.3.31",
|
|
@@ -60,9 +61,11 @@
|
|
|
60
61
|
"access": "public"
|
|
61
62
|
},
|
|
62
63
|
"license": "MIT",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
64
|
+
"peerDependenciesMeta": {
|
|
65
|
+
"@tbox.cn/app-agent-ui-kit": {
|
|
66
|
+
"optional": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
66
69
|
"scripts": {
|
|
67
70
|
"typecheck": "tsc --noEmit",
|
|
68
71
|
"test": "vitest run",
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* member-card-summary 富卡:原型同款真实卡面 + 积分摘要。
|
|
3
3
|
* 会员卡名是 C 端卡名,不把 levelName 渲染成会员等级或权益。
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { useId, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import type { ReactNode, SyntheticEvent, UIEvent } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { Overlay } from '@tbox.cn/app-agent-ui-kit/overlay';
|
|
8
8
|
import { X } from '@phosphor-icons/react';
|
|
9
9
|
import { markSelfRendering, sendCardAction } from '@tbox.cn/app-agent-sdk-client';
|
|
10
10
|
import { Car, Confetti, Coins, Gift, Sparkle } from '@phosphor-icons/react';
|
|
@@ -12,6 +12,91 @@ import { ImageWithFallback } from '../../components/ImageWithFallback';
|
|
|
12
12
|
import { MEMBER_PREFERENCE_PROMPTS } from '@tbox.cn/app-contracts-mall';
|
|
13
13
|
import type { MemberCardSummaryCardData } from '@tbox.cn/app-contracts-mall';
|
|
14
14
|
|
|
15
|
+
type SummaryVariant = 'blue' | 'silver' | 'gold' | 'black';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 四档卡面/页面配色(原 CSS 的 --member-level-* 变量组)。
|
|
19
|
+
* 每个值都是完整类名字面量,按 variant 键取;工具类按"后出现者胜"的顺序写成一组,不拼接。
|
|
20
|
+
*/
|
|
21
|
+
const VARIANT_CLASS: Record<SummaryVariant, {
|
|
22
|
+
root: string;
|
|
23
|
+
faceHook: string;
|
|
24
|
+
faceColor: string;
|
|
25
|
+
levelText: string;
|
|
26
|
+
svgColor: string;
|
|
27
|
+
iconBg: string;
|
|
28
|
+
trackBg: string;
|
|
29
|
+
fillBg: string;
|
|
30
|
+
divider: string;
|
|
31
|
+
prefButton: string;
|
|
32
|
+
dot: string;
|
|
33
|
+
tagBg: string;
|
|
34
|
+
faceFallbackBg: string;
|
|
35
|
+
}> = {
|
|
36
|
+
blue: {
|
|
37
|
+
root: 'member-card-summary--dynamic member-card-summary--blue bg-[image:linear-gradient(180deg,#f4f8fd_0%,#e6f0fc_100%)] px-5 pb-9 pt-5 text-[#294d87]',
|
|
38
|
+
faceHook: 'member-card-summary__face--blue',
|
|
39
|
+
faceColor: 'text-[#254077]',
|
|
40
|
+
levelText: 'text-[#294d87]',
|
|
41
|
+
svgColor: '[&_svg]:text-[#82a6e8]',
|
|
42
|
+
iconBg: 'bg-[#82a6e8]',
|
|
43
|
+
trackBg: 'bg-[#8bade8]',
|
|
44
|
+
fillBg: 'bg-[#254077]',
|
|
45
|
+
divider: 'border-t-[rgba(74,112,174,0.16)]',
|
|
46
|
+
prefButton: 'border-[#c4d6f2] bg-[rgba(255,255,255,0.68)] text-[#45679f] hover:enabled:border-[#82a6e8] hover:enabled:bg-white',
|
|
47
|
+
dot: 'bg-[rgba(11,15,23,0.16)] data-[active=true]:bg-[#82a6e8]',
|
|
48
|
+
tagBg: 'bg-[#e1e1e1]',
|
|
49
|
+
faceFallbackBg: 'bg-[#dde7f6]',
|
|
50
|
+
},
|
|
51
|
+
silver: {
|
|
52
|
+
root: 'member-card-summary--dynamic member-card-summary--silver bg-[image:linear-gradient(180deg,#f7f8fa_0%,#e8edf3_100%)] px-5 pb-9 pt-5 text-[#303443]',
|
|
53
|
+
faceHook: 'member-card-summary__face--silver',
|
|
54
|
+
faceColor: 'text-[#303443]',
|
|
55
|
+
levelText: 'text-[#303443]',
|
|
56
|
+
svgColor: '[&_svg]:text-[#a8b1c2]',
|
|
57
|
+
iconBg: 'bg-[#a8b1c2]',
|
|
58
|
+
trackBg: 'bg-[#9aa7ce]',
|
|
59
|
+
fillBg: 'bg-[#254077]',
|
|
60
|
+
divider: 'border-t-[rgba(74,112,174,0.16)]',
|
|
61
|
+
prefButton: 'border-[#303443] bg-[rgba(255,255,255,0.68)] text-[#254077] hover:enabled:border-[#a8b1c2] hover:enabled:bg-white',
|
|
62
|
+
dot: 'bg-[rgba(11,15,23,0.16)] data-[active=true]:bg-[#a8b1c2]',
|
|
63
|
+
tagBg: 'bg-[#e1e1e1]',
|
|
64
|
+
faceFallbackBg: 'bg-[#e5e8ef]',
|
|
65
|
+
},
|
|
66
|
+
gold: {
|
|
67
|
+
root: 'member-card-summary--dynamic member-card-summary--gold bg-[image:linear-gradient(180deg,#584024_0%,#141414_58%,#2e2519_100%)] px-5 pb-9 pt-5 text-[#f7f1e6]',
|
|
68
|
+
faceHook: 'member-card-summary__face--gold',
|
|
69
|
+
faceColor: 'text-[#683d08]',
|
|
70
|
+
levelText: 'text-[#f7f1e6]',
|
|
71
|
+
svgColor: '[&_svg]:text-[#efe6d4]',
|
|
72
|
+
iconBg: 'bg-[#efe6d4]',
|
|
73
|
+
trackBg: 'bg-[rgba(104,61,8,0.18)]',
|
|
74
|
+
fillBg: 'bg-[#683d08]',
|
|
75
|
+
divider: 'border-t-[rgba(240,228,201,0.18)]',
|
|
76
|
+
prefButton: 'border-[rgba(240,228,201,0.36)] bg-[rgba(255,255,255,0.10)] text-[#f0e4c9] hover:enabled:border-[#efe6d4] hover:enabled:bg-[rgba(255,255,255,0.18)]',
|
|
77
|
+
dot: 'bg-[rgba(255,255,255,0.24)] data-[active=true]:bg-[#efe6d4]',
|
|
78
|
+
tagBg: 'bg-[#efe6d4]',
|
|
79
|
+
faceFallbackBg: 'bg-[#f0e3c6]',
|
|
80
|
+
},
|
|
81
|
+
black: {
|
|
82
|
+
root: 'member-card-summary--dynamic member-card-summary--black bg-[image:linear-gradient(180deg,#222222_0%,#000000_100%)] px-5 pb-9 pt-5 text-[#e9d7ac]',
|
|
83
|
+
faceHook: 'member-card-summary__face--black',
|
|
84
|
+
faceColor: 'text-[#e9d7ac]',
|
|
85
|
+
levelText: 'text-[#e9d7ac]',
|
|
86
|
+
svgColor: '[&_svg]:text-[#e6dcc6]',
|
|
87
|
+
iconBg: 'bg-[#e6dcc6]',
|
|
88
|
+
trackBg: 'bg-[rgba(230,238,255,0.09)]',
|
|
89
|
+
fillBg: 'bg-[#e9d7ac]',
|
|
90
|
+
divider: 'border-t-[rgba(233,215,172,0.16)]',
|
|
91
|
+
prefButton: 'border-[rgba(233,215,172,0.34)] bg-[rgba(255,255,255,0.08)] text-[#e9d7ac] hover:enabled:border-[#e6dcc6] hover:enabled:bg-[rgba(255,255,255,0.16)]',
|
|
92
|
+
dot: 'bg-[rgba(255,255,255,0.22)] data-[active=true]:bg-[#e6dcc6]',
|
|
93
|
+
tagBg: 'bg-[#e6dcc6]',
|
|
94
|
+
faceFallbackBg: 'bg-[#2b2926]',
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const CONTROL_FOCUS_CLASS = 'focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-[rgba(180,95,6,0.28)]';
|
|
99
|
+
|
|
15
100
|
// 仅校验支付宝 scheme 前缀 + 非空 authority,**不依赖 webview `new URL`**——
|
|
16
101
|
// 安卓/UC 内核对 `alipays://` 非特殊 scheme 可能抛 TypeError 或解出非标字段,会让权益按钮(如积分换礼)
|
|
17
102
|
// 在安卓上落成不可点的静态态。深链合法性由 resolveAlipayNavigation 进一步校验。
|
|
@@ -29,7 +114,7 @@ function renderBenefitText(text: string): ReactNode {
|
|
|
29
114
|
function BenefitFallbackIcon({ name }: { name: string }) {
|
|
30
115
|
const props = {
|
|
31
116
|
'aria-hidden': true,
|
|
32
|
-
className: 'member-card-summary__benefit-icon-fallback',
|
|
117
|
+
className: 'member-card-summary__benefit-icon-fallback shrink-0',
|
|
33
118
|
size: 28,
|
|
34
119
|
weight: 'duotone' as const,
|
|
35
120
|
};
|
|
@@ -50,6 +135,7 @@ export function MemberCardSummaryCard(props: {
|
|
|
50
135
|
const { data, cardId = '', isHistory = false } = props;
|
|
51
136
|
const dynamicFace = data.presentation !== undefined;
|
|
52
137
|
const labelsEmbedded = data.presentation?.labelsEmbedded === true;
|
|
138
|
+
const vc = VARIANT_CLASS[data.presentation?.variant ?? 'blue'];
|
|
53
139
|
// 不截断:权益数量本身随等级变化(完整卡面 provider 的采集快照里,低两档 14 项、
|
|
54
140
|
// 高两档 15 项——高档多出的正是免费停车),截到固定条数会把「等级差异」这个卡面最该
|
|
55
141
|
// 体现的东西抹平。条数上限由契约的 benefits.max(20) 兜住。
|
|
@@ -76,51 +162,23 @@ export function MemberCardSummaryCard(props: {
|
|
|
76
162
|
const preferencePrompts = data.preferencePrompts ?? MEMBER_PREFERENCE_PROMPTS;
|
|
77
163
|
const [pointsRuleOpen, setPointsRuleOpen] = useState(false);
|
|
78
164
|
const [pointsRuleClosing, setPointsRuleClosing] = useState(false);
|
|
79
|
-
const [benefitAction, setBenefitAction] = useState<{ name: string;
|
|
80
|
-
const benefitActionCloseTimerRef = useRef<number>();
|
|
165
|
+
const [benefitAction, setBenefitAction] = useState<{ name: string; title?: string; text?: string; closing?: boolean }>();
|
|
81
166
|
const pointsRuleTriggerRef = useRef<HTMLButtonElement>(null);
|
|
82
167
|
const pointsRuleCloseRef = useRef<HTMLButtonElement>(null);
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (!pointsRuleOpen) return;
|
|
87
|
-
const previousOverflow = document.body.style.overflow;
|
|
88
|
-
document.body.style.overflow = 'hidden';
|
|
89
|
-
pointsRuleCloseRef.current?.focus();
|
|
90
|
-
const onKeyDown = (event: KeyboardEvent) => {
|
|
91
|
-
if (event.key !== 'Escape') return;
|
|
92
|
-
closePointsRule();
|
|
93
|
-
};
|
|
94
|
-
window.addEventListener('keydown', onKeyDown);
|
|
95
|
-
return () => {
|
|
96
|
-
document.body.style.overflow = previousOverflow;
|
|
97
|
-
window.removeEventListener('keydown', onKeyDown);
|
|
98
|
-
};
|
|
99
|
-
}, [pointsRuleOpen]);
|
|
100
|
-
|
|
101
|
-
useEffect(() => () => {
|
|
102
|
-
window.clearTimeout(pointsRuleCloseTimerRef.current);
|
|
103
|
-
window.clearTimeout(benefitActionCloseTimerRef.current);
|
|
104
|
-
}, []);
|
|
168
|
+
const pointsRuleTitleId = useId();
|
|
105
169
|
|
|
170
|
+
// 弹层行为(传送 / 滚动锁 / Escape / 焦点循环与恢复)统一由 kit overlay 承担;
|
|
171
|
+
// 这里只留「先播退出动画再卸载」的两段式关闭(两个弹层都是条件挂载)。
|
|
106
172
|
const closeBenefitAction = () => {
|
|
107
|
-
|
|
108
|
-
setBenefitAction({ ...benefitAction, closing: true });
|
|
109
|
-
benefitActionCloseTimerRef.current = window.setTimeout(() => setBenefitAction(undefined), 180);
|
|
173
|
+
setBenefitAction((current) => (current && !current.closing ? { ...current, closing: true } : current));
|
|
110
174
|
};
|
|
111
175
|
|
|
112
176
|
const finishClosePointsRule = () => {
|
|
113
|
-
window.clearTimeout(pointsRuleCloseTimerRef.current);
|
|
114
177
|
setPointsRuleOpen(false);
|
|
115
178
|
setPointsRuleClosing(false);
|
|
116
|
-
pointsRuleTriggerRef.current?.focus();
|
|
117
179
|
};
|
|
118
180
|
|
|
119
|
-
const closePointsRule = () =>
|
|
120
|
-
if (pointsRuleClosing) return;
|
|
121
|
-
setPointsRuleClosing(true);
|
|
122
|
-
pointsRuleCloseTimerRef.current = window.setTimeout(finishClosePointsRule, 220);
|
|
123
|
-
};
|
|
181
|
+
const closePointsRule = () => setPointsRuleClosing(true);
|
|
124
182
|
|
|
125
183
|
const openPointsRule = (event: SyntheticEvent<HTMLButtonElement>) => {
|
|
126
184
|
event.preventDefault();
|
|
@@ -134,8 +192,10 @@ export function MemberCardSummaryCard(props: {
|
|
|
134
192
|
ref={pointsRuleTriggerRef}
|
|
135
193
|
type="button"
|
|
136
194
|
className={labelsEmbedded
|
|
137
|
-
?
|
|
138
|
-
:
|
|
195
|
+
? `member-card-summary__rule-hotspot absolute left-[68.5%] top-[53%] z-2 h-[27%] w-[25%] cursor-pointer rounded-full border-0 bg-transparent p-0 text-transparent pointer-events-auto ${CONTROL_FOCUS_CLASS}`
|
|
196
|
+
: dynamicFace
|
|
197
|
+
? `member-card-summary__rule-trigger absolute right-[7%] top-[8%] z-2 inline-flex min-h-[19px] cursor-pointer items-center gap-[2px] rounded-[9.5px] border border-[rgba(255,255,255,0.5)] bg-[rgba(255,255,255,0.84)] px-1.5 py-[2px] text-xs font-semibold leading-[13px] text-[#303443] [font-family:inherit] tracking-normal transition-colors duration-[180ms] pointer-events-auto hover:border-[rgba(255,255,255,0.78)] hover:bg-[rgba(255,255,255,0.96)] motion-reduce:transition-none ${CONTROL_FOCUS_CLASS}`
|
|
198
|
+
: `member-card-summary__rule-trigger static z-auto ml-auto inline-flex min-h-[19px] cursor-pointer items-center gap-[2px] rounded-[9.5px] border border-[#ecdec2] bg-[color:var(--tbox-domain-member-surface,#fffdf8)] px-1.5 py-[2px] text-xs font-semibold leading-[13px] text-[#8c6a2f] [font-family:inherit] tracking-normal transition-colors duration-[180ms] hover:border-[rgba(255,255,255,0.78)] hover:bg-[rgba(255,255,255,0.96)] motion-reduce:transition-none ${CONTROL_FOCUS_CLASS}`}
|
|
139
199
|
aria-label="积分规则"
|
|
140
200
|
aria-haspopup="dialog"
|
|
141
201
|
onClick={openPointsRule}
|
|
@@ -144,53 +204,72 @@ export function MemberCardSummaryCard(props: {
|
|
|
144
204
|
</button>
|
|
145
205
|
) : null;
|
|
146
206
|
|
|
207
|
+
const benefitButtonClass = `member-card-summary__benefit-button inline-flex w-full cursor-pointer flex-col items-center gap-[9px] border-0 bg-transparent p-0 text-inherit [font-family:inherit] tracking-normal disabled:cursor-not-allowed disabled:opacity-[0.55] ${CONTROL_FOCUS_CLASS}`;
|
|
208
|
+
const benefitIconClass = dynamicFace
|
|
209
|
+
? `member-card-summary__benefit-icon inline-flex size-7 items-center justify-center rounded-full border-0 text-white shadow-[0_2px_5px_rgba(71,117,190,0.16)] ${vc.iconBg}`
|
|
210
|
+
: 'member-card-summary__benefit-icon inline-flex size-6 items-center justify-center rounded-full border-0 bg-[#f3f3f3] text-[#8c6a2f] max-[480px]:size-[22px]';
|
|
211
|
+
const benefitImageClass = dynamicFace
|
|
212
|
+
? 'size-full bg-transparent object-contain text-white [&.img-fallback]:size-[15px] [&_.member-card-summary__benefit-icon-fallback]:size-[15px] [&_.member-card-summary__benefit-icon-fallback]:text-white'
|
|
213
|
+
: 'size-[14px] bg-transparent object-contain text-[rgba(11,15,23,0.65)] max-[480px]:size-[13px]';
|
|
214
|
+
const benefitCopyClass = dynamicFace
|
|
215
|
+
? 'member-card-summary__benefit-copy inline-flex flex-col items-center gap-[1.5px] text-xs leading-[1.4]'
|
|
216
|
+
: 'member-card-summary__benefit-copy';
|
|
217
|
+
const dotClass = dynamicFace
|
|
218
|
+
? vc.dot
|
|
219
|
+
: 'bg-[rgba(11,15,23,0.16)] data-[active=true]:bg-[#b45f06]';
|
|
220
|
+
const benefitDescClass = dynamicFace
|
|
221
|
+
? `member-card-summary__benefit-description rounded-[4px] px-[3.5px] py-[0.5px] text-xs font-medium leading-[1.4] whitespace-nowrap text-[#000] ${vc.tagBg}`
|
|
222
|
+
: 'member-card-summary__benefit-description';
|
|
223
|
+
|
|
147
224
|
return (
|
|
148
|
-
<section className={`member-card member-card-summary${dynamicFace ?
|
|
225
|
+
<section className={`member-card member-card-summary p-4 max-[480px]:p-[14px] ${dynamicFace ? vc.root : 'bg-white px-3 pb-[14px] pt-3 text-foreground'}`}>
|
|
149
226
|
{dynamicFace ? (
|
|
150
227
|
<div
|
|
151
|
-
className={`member-card-summary__face member-card-summary__face--dynamic
|
|
228
|
+
className={`member-card-summary__face member-card-summary__face--dynamic ${vc.faceHook}${labelsEmbedded ? ' member-card-summary__face--embedded' : ''} relative -mt-[3.72%] aspect-[672/347] w-full overflow-hidden rounded-[9px] ${vc.faceColor} ${labelsEmbedded ? 'bg-transparent' : 'bg-[#f6ead4]'}`}
|
|
152
229
|
aria-label={`${data.cardDisplay},可用积分 ${String(data.availablePoints)}`}
|
|
153
230
|
>
|
|
154
231
|
{data.cardImageUrl ? (
|
|
155
232
|
<ImageWithFallback
|
|
156
233
|
src={data.cardImageUrl}
|
|
157
234
|
alt=""
|
|
158
|
-
className=
|
|
235
|
+
className={`member-card-summary__background pointer-events-none absolute inset-0 size-full [&.img-fallback]:grid [&.img-fallback]:place-items-center ${labelsEmbedded ? 'object-contain' : 'object-cover'}`}
|
|
159
236
|
size={96}
|
|
160
237
|
loading="eager"
|
|
161
238
|
/>
|
|
162
239
|
) : (
|
|
163
|
-
<span className=
|
|
240
|
+
<span className={`member-card-summary__background member-card-summary__background--fallback pointer-events-none absolute inset-0 size-full ${vc.faceFallbackBg}`} />
|
|
164
241
|
)}
|
|
165
|
-
<div className="member-card-summary__overlay">
|
|
242
|
+
<div className="member-card-summary__overlay absolute inset-0 z-1 pb-[7.5%] pl-[9%] pr-[9%] pt-[8.5%]">
|
|
166
243
|
{!labelsEmbedded && (
|
|
167
244
|
<>
|
|
168
|
-
<strong className="member-card-summary__level">{data.cardDisplay}</strong>
|
|
169
|
-
{data.pointsUrl ? <button type="button" className=
|
|
245
|
+
<strong className="member-card-summary__level block max-w-[62%] text-lg font-bold leading-[21px] [overflow-wrap:anywhere] max-[480px]:text-sm max-[480px]:leading-[17px]">{data.cardDisplay}</strong>
|
|
246
|
+
{data.pointsUrl ? <button type="button" className={`member-card-summary__points-label mt-[5.5%] block cursor-pointer text-xs font-medium leading-[15px] max-[480px]:leading-[13px] [font-family:inherit] tracking-normal ${CONTROL_FOCUS_CLASS}`} onClick={() => sendCardAction(cardId, { type: 'openLink', url: data.pointsUrl! })}>我的积分 <span aria-hidden="true">></span></button> : <span className="member-card-summary__points-label mt-[5.5%] block text-xs font-medium leading-[15px] max-[480px]:leading-[13px]">我的积分 <span aria-hidden="true">></span></span>}
|
|
170
247
|
</>
|
|
171
248
|
)}
|
|
172
|
-
<b className={
|
|
249
|
+
<b className={labelsEmbedded
|
|
250
|
+
? 'member-card-summary__balance member-card-summary__balance--embedded absolute left-[9%] top-[61%] m-0 tabular-nums text-base font-bold leading-[17px] max-[480px]:leading-[19px]'
|
|
251
|
+
: 'member-card-summary__balance mt-px block tabular-nums text-2xl font-bold leading-[27px] max-[480px]:text-xl max-[480px]:leading-[23px]'}>{String(data.availablePoints)}</b>
|
|
173
252
|
{data.progress && (
|
|
174
|
-
<div className=
|
|
175
|
-
<div className={`member-card-summary__progress-text${data.progress.message.length > 24 ? ' member-card-summary__progress-text--scroll' : ''}`}>
|
|
176
|
-
<span>{data.progress.message}</span>
|
|
253
|
+
<div className={`member-card-summary__progress absolute bottom-[8%] ${labelsEmbedded ? 'inset-x-[9.2%]' : 'inset-x-[9%]'}`}>
|
|
254
|
+
<div className={`member-card-summary__progress-text w-full overflow-hidden whitespace-nowrap text-xs ${labelsEmbedded ? 'leading-[13px]' : 'leading-[14px] max-[480px]:leading-3'}${data.progress.message.length > 24 ? ' member-card-summary__progress-text--scroll' : ''}`}>
|
|
255
|
+
<span className={data.progress.message.length > 24 ? 'block overflow-hidden text-ellipsis' : 'inline-block'}>{data.progress.message}</span>
|
|
177
256
|
</div>
|
|
178
257
|
<div
|
|
179
|
-
className=
|
|
258
|
+
className={`member-card-summary__progress-track overflow-hidden rounded-[1.5px] ${labelsEmbedded ? 'mt-1 h-px' : 'mt-[5px] h-[1.5px]'} ${vc.trackBg}`}
|
|
180
259
|
role="progressbar"
|
|
181
260
|
aria-label="会员等级消费进度"
|
|
182
261
|
aria-valuemin={0}
|
|
183
262
|
aria-valuemax={100}
|
|
184
263
|
aria-valuenow={Math.round(data.progress.percent)}
|
|
185
264
|
>
|
|
186
|
-
<span style={{ width: `${data.progress.percent}%` }} />
|
|
265
|
+
<span className={`block h-full rounded-[inherit] transition-[width] duration-[300ms] ${vc.fillBg}`} style={{ width: `${data.progress.percent}%` }} />
|
|
187
266
|
</div>
|
|
188
267
|
</div>
|
|
189
268
|
)}
|
|
190
269
|
{labelsEmbedded && data.pointsUrl && (
|
|
191
270
|
<button
|
|
192
271
|
type="button"
|
|
193
|
-
className=
|
|
272
|
+
className={`member-card-summary__points-hotspot absolute left-[8%] top-1/2 h-[14%] w-[42%] cursor-pointer border-0 bg-transparent p-0 ${CONTROL_FOCUS_CLASS}`}
|
|
194
273
|
aria-label="打开我的积分"
|
|
195
274
|
onClick={() => sendCardAction(cardId, { type: 'openLink', url: data.pointsUrl! })}
|
|
196
275
|
/>
|
|
@@ -202,21 +281,21 @@ export function MemberCardSummaryCard(props: {
|
|
|
202
281
|
<ImageWithFallback
|
|
203
282
|
src={data.cardImageUrl}
|
|
204
283
|
alt={data.cardDisplay}
|
|
205
|
-
className="member-card-summary__face"
|
|
284
|
+
className="member-card-summary__face block h-auto aspect-[71/42] w-full rounded-[8px] bg-[#f6ead4] object-cover [&.img-fallback]:grid [&.img-fallback]:min-h-[110px] [&.img-fallback]:place-items-center"
|
|
206
285
|
size={96}
|
|
207
286
|
loading="eager"
|
|
208
287
|
/>
|
|
209
288
|
) : (
|
|
210
|
-
<div className="member-card-summary__face member-card-summary__face--gradient">
|
|
211
|
-
<strong>{data.cardDisplay}</strong>
|
|
289
|
+
<div className="member-card-summary__face member-card-summary__face--gradient flex aspect-[71/42] w-full flex-col items-center justify-center gap-1 rounded-[8px] bg-[image:linear-gradient(135deg,#ffcf5c_0%,#ff9f2e_100%)] text-white">
|
|
290
|
+
<strong className="text-lg font-bold">{data.cardDisplay}</strong>
|
|
212
291
|
</div>
|
|
213
292
|
)}
|
|
214
293
|
{!dynamicFace && (
|
|
215
|
-
<div className="member-card-summary__metric">
|
|
216
|
-
<b className="member-card-summary__points-value">{String(data.availablePoints)}</b>
|
|
217
|
-
<span className="member-card-summary__metric-label">积分</span>
|
|
294
|
+
<div className="member-card-summary__metric mt-[7px] flex items-baseline gap-1 px-px">
|
|
295
|
+
<b className="member-card-summary__points-value text-2xl font-extrabold leading-[27px] tabular-nums text-[#b45f06] max-[480px]:text-xl">{String(data.availablePoints)}</b>
|
|
296
|
+
<span className="member-card-summary__metric-label text-sm font-semibold leading-[18px] text-[#a3925f]">积分</span>
|
|
218
297
|
{data.status !== 'active' && (
|
|
219
|
-
<em className="member-card-summary__status">{data.status}</em>
|
|
298
|
+
<em className="member-card-summary__status ml-auto text-xs not-italic text-muted-foreground">{data.status}</em>
|
|
220
299
|
)}
|
|
221
300
|
{pointsRuleTrigger}
|
|
222
301
|
</div>
|
|
@@ -226,26 +305,27 @@ export function MemberCardSummaryCard(props: {
|
|
|
226
305
|
{/* 无区块标题:这张卡本身就是会员卡,图标加名称已经自解释,多一行「可享权益」
|
|
227
306
|
只是把卡片拉长。语义靠 pager 的 aria-label 交代,读屏不受影响。 */}
|
|
228
307
|
<div
|
|
229
|
-
className=
|
|
308
|
+
className={`member-card-summary__benefit-pager grid snap-x snap-mandatory grid-flow-col auto-cols-[100%] overflow-x-auto [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden ${dynamicFace ? 'mt-[17px]' : 'mt-2.5'}`}
|
|
230
309
|
role="group"
|
|
231
310
|
aria-label="当前会员权益"
|
|
232
311
|
onScroll={benefitPages.length > 1 ? onBenefitsScroll : undefined}
|
|
233
312
|
>
|
|
234
313
|
{benefitPages.map((page) => (
|
|
235
|
-
<ul className=
|
|
314
|
+
<ul className={`member-card-summary__benefits grid list-none grid-cols-4 p-0 [grid-auto-rows:1fr] snap-start max-[480px]:gap-x-[5px] ${dynamicFace ? 'gap-x-[6px] gap-y-[11px]' : 'gap-1'}`} key={page[0].benefitRef}>
|
|
236
315
|
{page.map((benefit) => (
|
|
237
|
-
<li key={benefit.benefitRef}>
|
|
316
|
+
<li key={benefit.benefitRef} className={`grid min-w-0 content-start justify-items-center text-center [overflow-wrap:anywhere] ${dynamicFace ? `gap-[4.5px] text-xs font-medium leading-3 ${vc.levelText}` : 'gap-1 text-xs leading-[10px] text-[#6f6552] max-[480px]:leading-[9px]'}`}>
|
|
238
317
|
{benefit.action?.kind === 'miniapp' && benefit.action.url && isProviderMiniappUrl(benefit.action.url) ? (
|
|
239
318
|
<button
|
|
240
319
|
type="button"
|
|
241
|
-
className=
|
|
320
|
+
className={benefitButtonClass}
|
|
242
321
|
aria-label={`打开${benefit.name}`}
|
|
243
322
|
onClick={() => sendCardAction(cardId, { type: 'openLink', url: benefit.action!.url! })}
|
|
244
323
|
>
|
|
245
|
-
<span className=
|
|
324
|
+
<span className={benefitIconClass}>
|
|
246
325
|
<ImageWithFallback
|
|
247
326
|
src={benefit.iconUrl}
|
|
248
327
|
alt={`${benefit.name}权益图标`}
|
|
328
|
+
className={benefitImageClass}
|
|
249
329
|
size={48}
|
|
250
330
|
// 与卡面底图同批加载:ImageWithFallback 默认 lazy,而权益图标挂在卡片
|
|
251
331
|
// 下半部,实测滚进视口后仍长时间不触发请求,整排图标空着。它们是卡片主体
|
|
@@ -254,29 +334,29 @@ export function MemberCardSummaryCard(props: {
|
|
|
254
334
|
fallback={<BenefitFallbackIcon name={benefit.name} />}
|
|
255
335
|
/>
|
|
256
336
|
</span>
|
|
257
|
-
<span className=
|
|
337
|
+
<span className={benefitCopyClass}>
|
|
258
338
|
<span>{benefit.name}</span>
|
|
259
339
|
{benefit.description && (
|
|
260
|
-
<small className=
|
|
340
|
+
<small className={benefitDescClass}>{benefit.description}</small>
|
|
261
341
|
)}
|
|
262
342
|
</span>
|
|
263
343
|
</button>
|
|
264
344
|
) : benefit.action?.kind === 'toast' ? (
|
|
265
|
-
<button type="button" className=
|
|
266
|
-
<span className=
|
|
267
|
-
<span className=
|
|
345
|
+
<button type="button" className={benefitButtonClass} onClick={() => sendCardAction(cardId, { type: 'toast', content: benefit.action?.text ?? '敬请期待~' })}>
|
|
346
|
+
<span className={benefitIconClass}><ImageWithFallback src={benefit.iconUrl} alt={`${benefit.name}权益图标`} className={benefitImageClass} size={48} loading="eager" fallback={<BenefitFallbackIcon name={benefit.name} />} /></span>
|
|
347
|
+
<span className={benefitCopyClass}><span>{benefit.name}</span></span>
|
|
268
348
|
</button>
|
|
269
349
|
) : benefit.action?.kind === 'dialog' ? (
|
|
270
|
-
<button type="button" className=
|
|
271
|
-
<span className=
|
|
272
|
-
<span className=
|
|
350
|
+
<button type="button" className={benefitButtonClass} onClick={() => setBenefitAction({ name: benefit.action?.title ?? benefit.name, title: benefit.action?.title, text: benefit.action?.text })}>
|
|
351
|
+
<span className={benefitIconClass}><ImageWithFallback src={benefit.iconUrl} alt={`${benefit.name}权益图标`} className={benefitImageClass} size={48} loading="eager" fallback={<BenefitFallbackIcon name={benefit.name} />} /></span>
|
|
352
|
+
<span className={benefitCopyClass}><span>{benefit.name}</span></span>
|
|
273
353
|
</button>
|
|
274
354
|
) : (
|
|
275
355
|
<>
|
|
276
|
-
<span className=
|
|
277
|
-
<ImageWithFallback src={benefit.iconUrl} alt={`${benefit.name}权益图标`} size={48} loading="eager" fallback={<BenefitFallbackIcon name={benefit.name} />} />
|
|
356
|
+
<span className={benefitIconClass}>
|
|
357
|
+
<ImageWithFallback src={benefit.iconUrl} alt={`${benefit.name}权益图标`} className={benefitImageClass} size={48} loading="eager" fallback={<BenefitFallbackIcon name={benefit.name} />} />
|
|
278
358
|
</span>
|
|
279
|
-
<span className=
|
|
359
|
+
<span className={benefitCopyClass}><span>{benefit.name}</span>{benefit.description && <small className={benefitDescClass}>{benefit.description}</small>}</span>
|
|
280
360
|
</>
|
|
281
361
|
)}
|
|
282
362
|
</li>
|
|
@@ -285,9 +365,9 @@ export function MemberCardSummaryCard(props: {
|
|
|
285
365
|
))}
|
|
286
366
|
</div>
|
|
287
367
|
{benefitPages.length > 1 && (
|
|
288
|
-
<div className="member-card-summary__benefit-dots" aria-hidden="true">
|
|
368
|
+
<div className="member-card-summary__benefit-dots mt-2 flex justify-center gap-[3px]" aria-hidden="true">
|
|
289
369
|
{benefitPages.map((page, index) => (
|
|
290
|
-
<span key={page[0].benefitRef} data-active={index === benefitPage} />
|
|
370
|
+
<span key={page[0].benefitRef} className={`size-[3px] rounded-full transition-[width,background-color] duration-[160ms] data-[active=true]:w-[9px] ${dotClass}`} data-active={index === benefitPage} />
|
|
291
371
|
))}
|
|
292
372
|
</div>
|
|
293
373
|
)}
|
|
@@ -299,18 +379,27 @@ export function MemberCardSummaryCard(props: {
|
|
|
299
379
|
* 会员卡偏好三问与确定性记忆)。原标题「继续探索更多精彩吧」把这层意思整个盖住了,
|
|
300
380
|
* 当前说明同时提示选择偏好与直接表达两种输入方式,偏好采集行为保持不变。
|
|
301
381
|
*/}
|
|
302
|
-
<div className=
|
|
303
|
-
|
|
382
|
+
<div className={dynamicFace
|
|
383
|
+
? `member-card-summary__preferences mt-[15px] rounded-none border-0 border-t border-solid bg-transparent px-2 pb-0 pt-[15px] shadow-none ${vc.divider}`
|
|
384
|
+
: 'member-card-summary__preferences mt-3 rounded-[8px] border-[0.5px] border-[rgba(11,15,23,0.12)] bg-white p-2 shadow-[0_1px_8px_rgba(106,119,137,0.08)] max-[480px]:p-[7px]'}>
|
|
385
|
+
<strong className={dynamicFace
|
|
386
|
+
? `flex items-center gap-2 font-semibold text-base leading-5 ${vc.levelText} ${vc.svgColor} [&_svg]:shrink-0`
|
|
387
|
+
: 'flex items-center gap-[3px] text-xs font-bold leading-[8.5px] text-[rgba(11,15,23,0.88)] [&_svg]:shrink-0 [&_svg]:text-[#d7b76b]'}>
|
|
304
388
|
{/* 跟随标题字号:size 走 SVG 属性、不经 rem 换算,不跟就会比标题还大。 */}
|
|
305
389
|
<Sparkle size={15} weight="fill" aria-hidden="true" />
|
|
306
390
|
<span>说说你的偏好</span>
|
|
307
391
|
</strong>
|
|
308
|
-
<p className=
|
|
309
|
-
<div className=
|
|
392
|
+
<p className={`member-card-summary__preference-hint opacity-[0.82] ${dynamicFace ? `mt-[5px] text-xs leading-[17px] ${vc.levelText}` : 'mt-[3px] text-xs leading-[15px] text-secondary-foreground'}`}>请选择你的偏好,或直接告诉我</p>
|
|
393
|
+
<div className={dynamicFace
|
|
394
|
+
? 'member-card-summary__preference-list mt-2.5 grid grid-cols-3 gap-[7px] overflow-visible pb-px'
|
|
395
|
+
: 'member-card-summary__preference-list mt-1.5 flex flex-nowrap gap-1 overflow-x-auto [scrollbar-width:none] [-webkit-overflow-scrolling:touch] [&::-webkit-scrollbar]:hidden'}>
|
|
310
396
|
{preferencePrompts.map((prompt) => (
|
|
311
397
|
<button
|
|
312
398
|
key={prompt.value}
|
|
313
399
|
type="button"
|
|
400
|
+
className={`inline-flex shrink-0 cursor-pointer items-center justify-center gap-px whitespace-nowrap [font-family:inherit] tracking-normal disabled:cursor-not-allowed disabled:opacity-50 ${CONTROL_FOCUS_CLASS} ${dynamicFace
|
|
401
|
+
? `min-h-[34px] w-full min-w-0 rounded-[17px] border border-solid px-[5.5px] py-[4.5px] text-sm font-semibold leading-[17px] transition-[background-color,border-color,transform] duration-[160ms] active:enabled:scale-[0.98] ${vc.prefButton}`
|
|
402
|
+
: 'min-h-4 rounded-[8px] border-0 bg-[#f3f3f3] px-[3px] py-[2.5px] text-xs leading-[9px] text-[rgba(11,15,23,0.72)]'}`}
|
|
314
403
|
disabled={isHistory || !cardId}
|
|
315
404
|
onClick={() => sendCardAction(cardId, {
|
|
316
405
|
type: 'sendMessage',
|
|
@@ -324,49 +413,52 @@ export function MemberCardSummaryCard(props: {
|
|
|
324
413
|
))}
|
|
325
414
|
</div>
|
|
326
415
|
</div>
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
<header className="member-points-rule__header">
|
|
342
|
-
<strong id="
|
|
416
|
+
<Overlay
|
|
417
|
+
open={pointsRuleOpen && !pointsRuleClosing}
|
|
418
|
+
onDismiss={closePointsRule}
|
|
419
|
+
onExited={finishClosePointsRule}
|
|
420
|
+
placement="center"
|
|
421
|
+
labelledBy={pointsRuleTitleId}
|
|
422
|
+
initialFocus={pointsRuleCloseRef}
|
|
423
|
+
restoreFocus={pointsRuleTriggerRef}
|
|
424
|
+
maskDismiss="self-pointerdown"
|
|
425
|
+
exitMs={220}
|
|
426
|
+
rootClassName="member-points-rule group animate-[member-points-rule-backdrop-in_180ms_ease-out_both] group-data-[state=closed]:animate-[member-points-rule-backdrop-out_160ms_ease-in_both] motion-reduce:animate-none"
|
|
427
|
+
maskClassName="bg-[rgba(11,15,23,0.56)]"
|
|
428
|
+
panelClassName="member-points-rule__panel flex h-[90vh] w-[min(92vw,720px)] flex-col overflow-hidden rounded-[8px] bg-card shadow-[0_8px_24px_rgba(11,15,23,0.2)] supports-[height:100dvh]:h-[90dvh] animate-[member-points-rule-panel-in_220ms_cubic-bezier(0.2,0.8,0.2,1)_both] group-data-[state=closed]:animate-[member-points-rule-panel-out_160ms_ease-in_both] motion-reduce:animate-none"
|
|
429
|
+
>
|
|
430
|
+
<header className="member-points-rule__header flex min-h-12 items-center border-b border-[#ecdec2] bg-card px-3 py-[9px]">
|
|
431
|
+
<strong id={pointsRuleTitleId} className="flex-1 text-base font-bold leading-5 text-foreground">积分规则</strong>
|
|
343
432
|
<button
|
|
344
433
|
ref={pointsRuleCloseRef}
|
|
345
434
|
type="button"
|
|
346
|
-
className="member-points-rule__close"
|
|
435
|
+
className="member-points-rule__close grid size-8 shrink-0 place-items-center rounded-full border-0 bg-[#fff8eb] p-0 text-foreground"
|
|
347
436
|
aria-label="关闭积分规则"
|
|
348
437
|
onClick={closePointsRule}
|
|
349
438
|
>
|
|
350
439
|
<X size={20} weight="bold" aria-hidden="true" />
|
|
351
440
|
</button>
|
|
352
441
|
</header>
|
|
353
|
-
<div className="member-points-rule__body">
|
|
354
|
-
{data.pointsRuleImageUrl ? <ImageWithFallback src={data.pointsRuleImageUrl} alt="积分规则详情" className="member-points-rule__image" size={96} loading="eager" /> : <div className="member-points-rule__content">{renderBenefitText(data.pointsRuleContent ?? '')}</div>}
|
|
442
|
+
<div className="member-points-rule__body min-h-0 flex-1 overflow-y-auto overscroll-contain bg-[#f5f6f8] [-webkit-overflow-scrolling:touch]">
|
|
443
|
+
{data.pointsRuleImageUrl ? <ImageWithFallback src={data.pointsRuleImageUrl} alt="积分规则详情" className="member-points-rule__image block h-auto min-h-full w-full bg-white object-contain object-top [&.img-fallback]:place-items-center" size={96} loading="eager" /> : <div className="member-points-rule__content whitespace-pre-line bg-white px-[10px] pb-4 pt-3 text-xs leading-[1.75] text-[#333] [&_a]:text-[#1677ff] [&_a]:no-underline">{renderBenefitText(data.pointsRuleContent ?? '')}</div>}
|
|
355
444
|
</div>
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
445
|
+
</Overlay>
|
|
446
|
+
<Overlay
|
|
447
|
+
open={Boolean(benefitAction && !benefitAction.closing)}
|
|
448
|
+
onDismiss={closeBenefitAction}
|
|
449
|
+
onExited={() => setBenefitAction(undefined)}
|
|
450
|
+
placement="bottom"
|
|
451
|
+
label={benefitAction ? benefitAction.title ?? benefitAction.name : undefined}
|
|
452
|
+
maskDismiss="self-pointerdown"
|
|
453
|
+
exitMs={200}
|
|
454
|
+
rootClassName="member-miniapp-dialog group animate-[member-miniapp-dialog-backdrop-in_180ms_ease-out_both] group-data-[state=closed]:animate-[member-miniapp-dialog-backdrop-out_180ms_ease-in_both] motion-reduce:animate-none"
|
|
455
|
+
maskClassName="bg-[rgba(11,17,29,0.52)]"
|
|
456
|
+
panelClassName="member-miniapp-dialog__panel flex h-auto max-h-[90vh] w-[min(100%,720px)] flex-col overflow-hidden rounded-t-[18px] bg-white [font-family:-apple-system,BlinkMacSystemFont,'PingFang_SC','Helvetica_Neue',sans-serif] animate-[member-miniapp-dialog-panel-in_220ms_cubic-bezier(0.2,0.8,0.2,1)_both] group-data-[state=closed]:animate-[member-miniapp-dialog-panel-out_180ms_ease-in_both] motion-reduce:animate-none"
|
|
457
|
+
>
|
|
458
|
+
<header className="member-miniapp-dialog__header flex min-h-[52px] items-center justify-between border-b border-[#edf0f4] px-4 text-[#1e2733]"><strong className="text-xl font-semibold leading-[28px]">{benefitAction?.title ?? benefitAction?.name}</strong><button type="button" className="border-0 bg-transparent p-2 text-[#697586]" aria-label="关闭" onClick={closeBenefitAction}><X size={20} weight="bold" aria-hidden="true" /></button></header>
|
|
459
|
+
<div className="member-miniapp-dialog__text flex-1 overflow-auto whitespace-pre-line px-5 py-6 text-base leading-[1.7] text-[#333] [&_a]:text-[#1677ff] [&_a]:no-underline">{renderBenefitText(benefitAction?.text ?? '')}</div>
|
|
460
|
+
<button type="button" className="member-miniapp-dialog__confirm mx-5 mb-5 flex-none rounded-[24px] border-0 bg-[#bd9f63] p-3 text-base text-white [font-family:inherit]" onClick={closeBenefitAction}>我知道了</button>
|
|
461
|
+
</Overlay>
|
|
370
462
|
</section>
|
|
371
463
|
);
|
|
372
464
|
}
|
|
@@ -22,24 +22,24 @@ export function MemberEnrollmentCtaCard(props: {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<section className="member-card member-enroll-cta">
|
|
26
|
-
<div className="member-enroll-cta__hero">
|
|
27
|
-
<span className="member-enroll-cta__icon" aria-hidden="true">
|
|
25
|
+
<section className="member-card member-enroll-cta overflow-hidden bg-white p-0 text-foreground">
|
|
26
|
+
<div className="member-enroll-cta__hero relative flex min-h-[180px] flex-col items-start overflow-hidden bg-[image:linear-gradient(145deg,#3c2a18_0%,#765225_54%,#b7802e_100%)] px-6 pb-[26px] pt-7 text-[#fff7e8] after:absolute after:-bottom-[74px] after:-right-[52px] after:size-[190px] after:rounded-full after:box-border after:border after:border-[rgba(255,236,190,0.26)] after:content-['']">
|
|
27
|
+
<span className="member-enroll-cta__icon grid size-12 shrink-0 place-items-center rounded-[15px] border border-[rgba(255,247,232,0.34)] bg-[rgba(255,247,232,0.14)]" aria-hidden="true">
|
|
28
28
|
<IdentificationCard size={28} weight="duotone" />
|
|
29
29
|
</span>
|
|
30
|
-
<span className="member-enroll-cta__eyebrow">会员服务</span>
|
|
31
|
-
<h4>{data.title ?? '开卡入会'}</h4>
|
|
32
|
-
<p>前往支付宝会员页面完成开卡,结果以页面为准</p>
|
|
30
|
+
<span className="member-enroll-cta__eyebrow mt-[18px] text-xs leading-[18px] tracking-[1.5px]">会员服务</span>
|
|
31
|
+
<h4 className="mt-[3px] text-2xl leading-[34px] [font-weight:760]">{data.title ?? '开卡入会'}</h4>
|
|
32
|
+
<p className="mt-[7px] max-w-[270px] text-sm leading-5 text-[rgba(255,247,232,0.82)]">前往支付宝会员页面完成开卡,结果以页面为准</p>
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
|
-
<div className="member-enroll-cta__footer">
|
|
36
|
-
<p className="member-enroll-cta__hint">
|
|
35
|
+
<div className="member-enroll-cta__footer flex flex-col gap-3 px-5 pb-5 pt-[18px]">
|
|
36
|
+
<p className="member-enroll-cta__hint flex items-center justify-center gap-[7px] text-xs leading-[18px] text-secondary-foreground">
|
|
37
37
|
<ShieldCheck size={16} weight="fill" aria-hidden="true" />
|
|
38
38
|
登录状态不受入会结果影响,开卡结果以支付宝会员页面为准
|
|
39
39
|
</p>
|
|
40
40
|
<button
|
|
41
41
|
type="button"
|
|
42
|
-
className="member-enroll-cta__btn"
|
|
42
|
+
className="member-enroll-cta__btn flex min-h-12 w-full cursor-pointer items-center justify-center gap-2 rounded-[24px] border-0 bg-[image:linear-gradient(108deg,#ffb029_0%,#ff8c1a_100%)] px-[18px] py-3 text-base font-bold text-white shadow-[0_8px_18px_rgba(255,140,26,0.32)] [font-family:inherit] tracking-normal [transition:opacity_150ms_ease,transform_100ms_ease] active:enabled:scale-[0.98] active:enabled:opacity-[0.88] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-[rgba(180,95,6,0.28)] disabled:cursor-not-allowed disabled:bg-[#d0cdc8] disabled:text-[rgba(255,255,255,0.76)] disabled:opacity-50 disabled:shadow-none"
|
|
43
43
|
disabled={isHistory || opening || !data.enrollUrl}
|
|
44
44
|
onClick={handleEnroll}
|
|
45
45
|
aria-label={data.enrollUrl ? '立即开卡入会' : '入会暂不可用(请联系商场客服)'}
|
|
@@ -52,7 +52,7 @@ export function MemberEnrollmentCtaCard(props: {
|
|
|
52
52
|
<WarningCircle size={18} weight="fill" aria-hidden="true" />
|
|
53
53
|
)}
|
|
54
54
|
</button>
|
|
55
|
-
{isHistory && <p className="member-enroll-cta__history">历史卡片不可重复操作</p>}
|
|
55
|
+
{isHistory && <p className="member-enroll-cta__history text-center text-xs leading-[17px] text-muted-foreground">历史卡片不可重复操作</p>}
|
|
56
56
|
</div>
|
|
57
57
|
</section>
|
|
58
58
|
);
|