@tbox.cn/app-module-alipay-activity 0.2.3 → 0.2.4

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.
@@ -11,10 +11,14 @@
11
11
  }
12
12
 
13
13
  /* ── 联单全幅背景图模式 ── */
14
+ /* 素材变量链(主题品牌资产轨 A1 级联修复):元素只消费不声明(声明截断主题覆写继承);
15
+ 服务端 backgroundUrl 走 inline style 自动覆盖本规则(优先语义保持);兜底 = 中立渐变(零品牌资产——B2),
16
+ 主题包覆写 --tbox-asset-bumpin-bg。 */
14
17
  .promotion-bumpin__header--bg {
15
18
  display: block;
16
19
  position: relative;
17
20
  padding: 24px 24px 28px;
21
+ background-image: var(--tbox-asset-bumpin-bg, linear-gradient(135deg, #eaf3ff, #d7e7fd));
18
22
  background-size: cover;
19
23
  background-position: center;
20
24
  background-repeat: no-repeat;
@@ -1,5 +1,5 @@
1
1
  // src/client/index.ts
2
- import "../bumpin-VKHLYCKG.css";
2
+ import "../bumpin-UR4NBS7F.css";
3
3
 
4
4
  // src/client/cards/bumpin-activity/index.tsx
5
5
  import { useState as useState2 } from "react";
@@ -82,9 +82,6 @@ function sanitizeActivityHtml(html) {
82
82
  return doc.body.innerHTML;
83
83
  }
84
84
 
85
- // src/client/assets/linked-card-background.jpg
86
- var linked_card_background_default = "../linked-card-background-MVGUOJ7J.jpg";
87
-
88
85
  // src/client/cards/bumpin-activity/index.tsx
89
86
  import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
90
87
  var PRIZES_PREVIEW_COUNT = 3;
@@ -124,8 +121,8 @@ function AlipayActivityBumpInCard(props) {
124
121
  const { data } = props;
125
122
  const isBanner = data.mode === "banner";
126
123
  const isStepsMode = data.progressStyle === "steps";
127
- const resolvedBgUrl = data.backgroundUrl ?? (isStepsMode ? linked_card_background_default : void 0);
128
- const hasBackground = Boolean(resolvedBgUrl);
124
+ const serverBgUrl = data.backgroundUrl || void 0;
125
+ const hasBackground = Boolean(serverBgUrl) || isStepsMode;
129
126
  const [prizesExpanded, setPrizesExpanded] = useState2(false);
130
127
  const totalNum = Number(data.totalProgress ?? "0");
131
128
  const currentNum = Number(data.currentProgress ?? "0");
@@ -142,7 +139,7 @@ function AlipayActivityBumpInCard(props) {
142
139
  "div",
143
140
  {
144
141
  className: `promotion-bumpin__header${hasBackground ? " promotion-bumpin__header--bg" : ""}`,
145
- style: resolvedBgUrl ? { backgroundImage: `url(${resolvedBgUrl})` } : void 0,
142
+ style: serverBgUrl ? { backgroundImage: `url(${serverBgUrl})` } : void 0,
146
143
  children: [
147
144
  !hasBackground && data.coverUrl && /* @__PURE__ */ jsx2(ImageWithFallback, { src: data.coverUrl, alt: data.title, className: "promotion-bumpin__cover" }),
148
145
  !hasBackground && !data.coverUrl && /* @__PURE__ */ jsx2("div", { className: "promotion-bumpin__cover-placeholder" }),
@@ -114,23 +114,23 @@ declare const serverModule: {
114
114
  merchantLogo: zod.ZodOptional<zod.ZodString>;
115
115
  itemLogo: zod.ZodOptional<zod.ZodString>;
116
116
  }, "strip", zod.ZodTypeAny, {
117
- merchantName: string;
118
117
  prizeId: string;
119
118
  voucherName: string;
120
119
  voucherType: string;
121
120
  reductionAmount: string;
122
121
  thresholdAmountText: string;
123
122
  unit: string;
123
+ merchantName: string;
124
124
  merchantLogo?: string | undefined;
125
125
  itemLogo?: string | undefined;
126
126
  }, {
127
- merchantName: string;
128
127
  prizeId: string;
129
128
  voucherName: string;
130
129
  voucherType: string;
131
130
  reductionAmount: string;
132
131
  thresholdAmountText: string;
133
132
  unit: string;
133
+ merchantName: string;
134
134
  merchantLogo?: string | undefined;
135
135
  itemLogo?: string | undefined;
136
136
  }>, "many">;
@@ -147,29 +147,25 @@ declare const serverModule: {
147
147
  description?: string | undefined;
148
148
  }>, "many">>;
149
149
  }, "strip", zod.ZodTypeAny, {
150
- title: string;
151
- mode: "detail" | "banner";
152
150
  activityRef: string;
151
+ title: string;
153
152
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
154
153
  vouchers: {
155
- merchantName: string;
156
154
  prizeId: string;
157
155
  voucherName: string;
158
156
  voucherType: string;
159
157
  reductionAmount: string;
160
158
  thresholdAmountText: string;
161
159
  unit: string;
160
+ merchantName: string;
162
161
  merchantLogo?: string | undefined;
163
162
  itemLogo?: string | undefined;
164
163
  }[];
165
- progressStyle: "steps" | "bar";
164
+ mode: "detail" | "banner";
165
+ progressStyle: "bar" | "steps";
166
166
  description?: string | undefined;
167
- steps?: {
168
- title: string;
169
- description?: string | undefined;
170
- }[] | undefined;
171
- coverUrl?: string | undefined;
172
167
  mainTitle?: string | undefined;
168
+ coverUrl?: string | undefined;
173
169
  backgroundUrl?: string | undefined;
174
170
  tagLabel?: string | undefined;
175
171
  cardLogoUrl?: string | undefined;
@@ -178,29 +174,28 @@ declare const serverModule: {
178
174
  progressUnit?: string | undefined;
179
175
  startAtText?: string | undefined;
180
176
  endAtText?: string | undefined;
177
+ steps?: {
178
+ title: string;
179
+ description?: string | undefined;
180
+ }[] | undefined;
181
181
  }, {
182
- title: string;
183
182
  activityRef: string;
183
+ title: string;
184
184
  actStatus: "NOT_START" | "INIT" | "PROCESSING" | "FINISH" | "RECEIVED";
185
185
  vouchers: {
186
- merchantName: string;
187
186
  prizeId: string;
188
187
  voucherName: string;
189
188
  voucherType: string;
190
189
  reductionAmount: string;
191
190
  thresholdAmountText: string;
192
191
  unit: string;
192
+ merchantName: string;
193
193
  merchantLogo?: string | undefined;
194
194
  itemLogo?: string | undefined;
195
195
  }[];
196
196
  description?: string | undefined;
197
- mode?: "detail" | "banner" | undefined;
198
- steps?: {
199
- title: string;
200
- description?: string | undefined;
201
- }[] | undefined;
202
- coverUrl?: string | undefined;
203
197
  mainTitle?: string | undefined;
198
+ coverUrl?: string | undefined;
204
199
  backgroundUrl?: string | undefined;
205
200
  tagLabel?: string | undefined;
206
201
  cardLogoUrl?: string | undefined;
@@ -209,7 +204,12 @@ declare const serverModule: {
209
204
  progressUnit?: string | undefined;
210
205
  startAtText?: string | undefined;
211
206
  endAtText?: string | undefined;
212
- progressStyle?: "steps" | "bar" | undefined;
207
+ mode?: "detail" | "banner" | undefined;
208
+ steps?: {
209
+ title: string;
210
+ description?: string | undefined;
211
+ }[] | undefined;
212
+ progressStyle?: "bar" | "steps" | undefined;
213
213
  }>>;
214
214
  };
215
215
  skills: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-alipay-activity",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "description": "支付宝互动营销活动模块:碰出惊喜(碰一下)活动查询与展示(codegen 源)。",
6
6
  "exports": {
@@ -18,9 +18,9 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-sdk": "0.17.0",
22
- "@tbox.cn/app-contracts": "0.9.0",
23
- "@tbox.cn/app-contracts-mall": "0.9.0",
21
+ "@tbox.cn/app-sdk": "0.19.0",
22
+ "@tbox.cn/app-contracts": "0.10.0",
23
+ "@tbox.cn/app-contracts-mall": "0.10.0",
24
24
  "alipay-sdk": "4.14.0"
25
25
  },
26
26
  "peerDependencies": {
@@ -3,8 +3,6 @@ import { CaretDown, CaretUp, Lock, Trophy } from '@phosphor-icons/react';
3
3
  import type { AlipayActivityBumpInCardData } from '../../../server/cards/bumpin-activity/meta';
4
4
  import { ImageWithFallback } from '../../components/ImageWithFallback';
5
5
  import { sanitizeActivityHtml } from '../../utils/sanitize-activity-html';
6
- // 联单活动本地背景图(steps 模式下作为 fallback,优先使用服务端下发的 backgroundUrl)
7
- import linkedCardBgUrl from '../../assets/linked-card-background.jpg';
8
6
 
9
7
  const PRIZES_PREVIEW_COUNT = 3;
10
8
 
@@ -57,9 +55,12 @@ export function AlipayActivityBumpInCard(props: {
57
55
  const { data } = props;
58
56
  const isBanner = data.mode === 'banner';
59
57
  const isStepsMode = data.progressStyle === 'steps';
60
- // steps 模式下:优先使用服务端下发的 backgroundUrl,没有则 fallback 到本地联单背景图
61
- const resolvedBgUrl = data.backgroundUrl ?? (isStepsMode ? linkedCardBgUrl : undefined);
62
- const hasBackground = Boolean(resolvedBgUrl);
58
+ // steps 模式下:服务端下发的 backgroundUrl 优先(inline style,业务内容不可被主题覆写);
59
+ // 无服务端 URL 时由 CSS 变量链 --tbox-asset-bumpin-bg 提供出厂默认(主题轨 T-2.3,
60
+ // 本地资产不再经 JS import;inline style 存在时自动覆盖 CSS background-image)。
61
+ // 空串归一 undefined:契约 z.string().optional() 允许 '',后端显式空值 ≡ 未提供(走出厂默认)。
62
+ const serverBgUrl = data.backgroundUrl || undefined;
63
+ const hasBackground = Boolean(serverBgUrl) || isStepsMode;
63
64
 
64
65
  const [prizesExpanded, setPrizesExpanded] = useState(false);
65
66
 
@@ -101,7 +102,7 @@ export function AlipayActivityBumpInCard(props: {
101
102
  {/* ── 头部:全幅背景图(联单)或 cover 小图(普通)── */}
102
103
  <div
103
104
  className={`promotion-bumpin__header${hasBackground ? ' promotion-bumpin__header--bg' : ''}`}
104
- style={resolvedBgUrl ? { backgroundImage: `url(${resolvedBgUrl})` } : undefined}
105
+ style={serverBgUrl ? { backgroundImage: `url(${serverBgUrl})` } : undefined}
105
106
  >
106
107
  {!hasBackground && data.coverUrl && (
107
108
  <ImageWithFallback src={data.coverUrl} alt={data.title} className="promotion-bumpin__cover" />
@@ -11,10 +11,14 @@
11
11
  }
12
12
 
13
13
  /* ── 联单全幅背景图模式 ── */
14
+ /* 素材变量链(主题品牌资产轨 A1 级联修复):元素只消费不声明(声明截断主题覆写继承);
15
+ 服务端 backgroundUrl 走 inline style 自动覆盖本规则(优先语义保持);兜底 = 中立渐变(零品牌资产——B2),
16
+ 主题包覆写 --tbox-asset-bumpin-bg。 */
14
17
  .promotion-bumpin__header--bg {
15
18
  display: block;
16
19
  position: relative;
17
20
  padding: 24px 24px 28px;
21
+ background-image: var(--tbox-asset-bumpin-bg, linear-gradient(135deg, #eaf3ff, #d7e7fd));
18
22
  background-size: cover;
19
23
  background-position: center;
20
24
  background-repeat: no-repeat;
@@ -1,10 +0,0 @@
1
- /** 静态图片资产类型声明(Vite asset import) */
2
- declare module '*.png' {
3
- const url: string;
4
- export default url;
5
- }
6
-
7
- declare module '*.jpg' {
8
- const url: string;
9
- export default url;
10
- }