v0.10.28: about-us 校对(counter 组件重写/数据回填/e-global 变量/page_css 全 page 导入/catchall 图片变体解析)
This commit is contained in:
@@ -133,6 +133,14 @@
|
||||
相关产品 4 列、CF7 表单、posts 卡片(postsData/shortcodes 上下文);产品 page_css 导入
|
||||
130/138(8 篇原站 404);ACF 规格书/popup 动态按钮落地(spec_url 非 URL 回退 /contact-us/)。
|
||||
剩余差异:内嵌 CF7/推荐卡片区高 +350~364、产品文档内少数版块为原站 lazy 占位差。
|
||||
- about-us v0.10.28 ✅ 公司页校对:49/56 版块 ≤15px。修复:
|
||||
- counter 组件重写为 Elementor DOM(number-wrapper/title,低特异性默认样式让 page_css 覆盖),
|
||||
ending_number 数值渲染修复(s() 丢数字 → String());
|
||||
- 数据回填(dump 后原站改动):计数器 ending_number 100/20、69px/600 数字排版、
|
||||
844aa8d min-height 400;
|
||||
- 全局:--e-global-color-primary/4d5c430 变量定义(page_css 引用);
|
||||
- page_css 导入扩展到全部 page(14 篇)+ catchall 渲染传 pageCss + pickContent
|
||||
调用 resolveImageVariants(meta.elementor 传参修正)。
|
||||
|
||||
### 3. 商城/产品/博客(WordPress 模板页)
|
||||
- SH1 商城:`/shop/` 分类+商品网格
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dusuniot-rebuild",
|
||||
"version": "0.10.27",
|
||||
"version": "0.10.28",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -822,13 +822,15 @@ function WidgetNodeInner({ el }: { el: ElElement }) {
|
||||
return <VideoWidget settings={settings} />;
|
||||
case "counter":
|
||||
return (
|
||||
<div className="mb-[18px]" style={{ textAlign: "center" }}>
|
||||
<div style={{ fontSize: 34, fontWeight: 700, color: "var(--brand)" }}>
|
||||
{s(settings.prefix)}
|
||||
{s(settings.ending_number) || "0"}
|
||||
{s(settings.suffix)}
|
||||
<div className="el-counter" style={{ textAlign: "center" }}>
|
||||
<style>{`.elementor-counter-number-wrapper{font-size:${sizeCss(settings.typography_number_font_size) || "34px"};font-weight:${Number(settings.typography_number_font_weight) || 600};color:var(--brand)}.elementor-counter-title{color:var(--muted-foreground, #6b7280)}`}</style>
|
||||
<div className="elementor-counter-number-wrapper">
|
||||
<span className="elementor-counter-number-prefix">{s(settings.prefix)}</span>
|
||||
{/* ending_number 为数值(about-us 计数器 3000/100 等),s() 只收字符串 */}
|
||||
<span className="elementor-counter-number">{String(settings.ending_number ?? "") || "0"}</span>
|
||||
<span className="elementor-counter-number-suffix">{s(settings.suffix)}</span>
|
||||
</div>
|
||||
<div style={{ color: "var(--muted)" }}>{s(settings.title)}</div>
|
||||
<div className="elementor-counter-title">{s(settings.title)}</div>
|
||||
</div>
|
||||
);
|
||||
case "shortcode":
|
||||
|
||||
@@ -122,6 +122,11 @@ const SETTING_KEYS = new Set([
|
||||
"prefix",
|
||||
"suffix",
|
||||
"ending_number",
|
||||
// counter 排版(about-us 页面级 CSS 覆盖 69px;设置里的字号/字重键)
|
||||
"typography_number_font_size",
|
||||
"typography_number_font_weight",
|
||||
"typography_title_font_size",
|
||||
"typography_title_font_weight",
|
||||
"icon_list",
|
||||
"social_icon_list",
|
||||
"slides",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* # 模块 catch-all 页面共享逻辑($.tsx 只导出 Route)
|
||||
*/
|
||||
import { resolveImageVariants } from "~/utils/image-variant";
|
||||
import { getPublishedContent, listPosts, type PostCardItem, type PostListItem, type ProductListResult } from "~/server/data";
|
||||
import type { LayoutData } from "~/components/website/Layout";
|
||||
import type { ElElement } from "~/components/elementor/Renderer";
|
||||
@@ -65,6 +66,9 @@ export const LANG_NAMES: Record<string, string> = {
|
||||
|
||||
/** # 函数 把内容行收窄为可序列化结构(meta/terms/jsonb 处理) */
|
||||
export function pickContent(row: NonNullable<Awaited<ReturnType<typeof getPublishedContent>>>): CatchAllData["content"] {
|
||||
// image widget 的 WP 尺寸变体解析(服务端;about-us 等 elementor 页的 thumbnail 图)
|
||||
const metaRow = (row.meta ?? null) as Record<string, unknown> | null;
|
||||
if (metaRow) resolveImageVariants(metaRow.elementor);
|
||||
return {
|
||||
slug: row.slug,
|
||||
type: row.type,
|
||||
|
||||
@@ -310,6 +310,7 @@ function CatchAllPage() {
|
||||
) : null}
|
||||
<ElementorRenderer
|
||||
doc={elementor}
|
||||
pageCss={typeof (data.content?.meta as Record<string, unknown> | null)?.page_css === "string" ? ((data.content!.meta as Record<string, unknown>).page_css as string) : undefined}
|
||||
postsData={data.postsData}
|
||||
shortcodes={
|
||||
Object.keys(data.templates || {}).length
|
||||
|
||||
@@ -119,6 +119,9 @@
|
||||
/* # 成员变量 兼容变量:数据库 HTML 兼容样式与少量内联 style 仍引用旧变量名 **/
|
||||
:root {
|
||||
--brand: #ed6c00;
|
||||
/* Elementor 全局色(页面生成 CSS 引用:page_css 的 var(--e-global-color-*)) */
|
||||
--e-global-color-primary: #ed6c00;
|
||||
--e-global-color-4d5c430: #1c2b3a;
|
||||
--brand-dark: #c85600;
|
||||
--ink: #1c2b3a;
|
||||
--muted: #5f7183;
|
||||
|
||||
Reference in New Issue
Block a user