feat(ecommerce): 电商模板改为从服务端 API 加载
- 新增 ecommerceTemplateClient,通过应用 API 拉取模板清单(符合 AGENTS.md 数据走 API 规则) - EcommercePage 接入远程模板,按 categorySlug 映射到场景,补充 mediaType/sourceAssets - 移除硬编码 popularCommerceScenarioTemplates,改为远程模板为空时回退本地 - 补充 ecommerce-standalone.css 模板条样式 - .gitignore 忽略 ecommerce-template-manifest.* 运行时清单(属 API/OSS 数据,不入库)
This commit is contained in:
@@ -18702,6 +18702,144 @@ html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[d
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep template cards fully readable inside narrow command workspaces. */
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card {
|
||||
position: relative !important;
|
||||
flex: 0 0 min(100%, clamp(252px, 24vw, 328px)) !important;
|
||||
grid-template-columns: 1fr !important;
|
||||
grid-template-rows: auto minmax(0, 1fr) !important;
|
||||
gap: 8px !important;
|
||||
box-sizing: border-box !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card__media {
|
||||
width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
height: auto !important;
|
||||
aspect-ratio: 16 / 9 !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-card__media video {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
object-fit: contain !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card__media img,
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card__media video {
|
||||
object-fit: contain !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card:hover .ecom-command-template-card__media img {
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-card__body strong {
|
||||
display: -webkit-box !important;
|
||||
white-space: normal !important;
|
||||
overflow-wrap: anywhere !important;
|
||||
-webkit-line-clamp: 2 !important;
|
||||
-webkit-box-orient: vertical !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-card__prompt {
|
||||
position: absolute !important;
|
||||
right: 10px !important;
|
||||
left: 10px !important;
|
||||
top: 10px !important;
|
||||
z-index: 3 !important;
|
||||
display: -webkit-box !important;
|
||||
max-height: 86px !important;
|
||||
padding: 2px 4px !important;
|
||||
overflow: hidden !important;
|
||||
border: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
color: rgba(16, 32, 44, 0.72) !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 650 !important;
|
||||
line-height: 1.45 !important;
|
||||
text-align: center !important;
|
||||
text-shadow: 0 1px 2px rgba(255, 255, 255, 0.86) !important;
|
||||
opacity: 0 !important;
|
||||
pointer-events: none !important;
|
||||
transform: translateY(-12px) scale(0.98) !important;
|
||||
transition:
|
||||
opacity 180ms ease,
|
||||
transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
||||
box-shadow 220ms ease !important;
|
||||
-webkit-box-orient: vertical !important;
|
||||
-webkit-line-clamp: 4 !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-card:hover .ecom-command-template-card__prompt,
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-card:focus-visible .ecom-command-template-card__prompt {
|
||||
opacity: 1 !important;
|
||||
transform: translateY(0) scale(1) !important;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-template-carousel .ecom-command-template-card {
|
||||
flex-basis: min(100%, 300px) !important;
|
||||
grid-template-columns: 1fr !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Apply the same 16:9 preview treatment to the generated/history compact template rail. */
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card {
|
||||
aspect-ratio: 16 / 9 !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__media {
|
||||
position: absolute !important;
|
||||
inset: 0 !important;
|
||||
width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
height: 100% !important;
|
||||
aspect-ratio: 16 / 9 !important;
|
||||
border: 0 !important;
|
||||
border-radius: inherit !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__media img,
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__media video {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
object-fit: contain !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__body {
|
||||
position: absolute !important;
|
||||
right: 0 !important;
|
||||
bottom: 0 !important;
|
||||
left: 0 !important;
|
||||
z-index: 2 !important;
|
||||
display: grid !important;
|
||||
gap: 2px !important;
|
||||
padding: 18px 8px 8px !important;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(246, 252, 254, 0.72)) !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__badge,
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__body em {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"] .ecom-command-template-carousel .ecom-command-template-card__body strong {
|
||||
display: block !important;
|
||||
overflow: hidden !important;
|
||||
color: rgba(85, 111, 126, 0.74) !important;
|
||||
font-size: 11px !important;
|
||||
font-weight: 760 !important;
|
||||
line-height: 1.2 !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
/* Restore the colorful scenario feedback while keeping the compact responsive layout. */
|
||||
html body #root .ecommerce-standalone.ecommerce-standalone .product-clone-page[data-tool="clone"][data-tool="clone"]:not(.is-history-detail) .ecom-command-scenario-shell .ecom-command-scenario-tabs button:has(.ecom-command-mode-icon--popular) {
|
||||
--mode-accent: #c04468 !important;
|
||||
|
||||
Reference in New Issue
Block a user