v0.10.27: /product/$slug 产品单模板一比一(模板2741/29972 补录、Woo 图廊/meta/tabs/相关产品组件、page_css 130 篇、动态按钮落地)+ css-translate 共享模块

This commit is contained in:
bigcode
2026-11-03 05:18:10 +08:00
parent d016be03ae
commit 35d154870a
9 changed files with 472 additions and 277 deletions
+16
View File
@@ -260,6 +260,22 @@ async function runProductQuery(conds: unknown[], page: number, pageSize: number,
}
/** # 函数 产品详情(含图廊、属性、分类) */
/** # 函数 产品单页模板(elementor_library 2741,dump 缺失已从 legacy SQL 补录)
* 返回值 { doc, pageCss };未入库返回 null
*/
export async function getProductTemplate() {
const [row] = await db
.select({ meta: contents.meta })
.from(contents)
.where(and(eq(contents.slug, "product-template"), eq(contents.type, "template")));
if (!row) return null;
const meta = (row.meta ?? {}) as Record<string, unknown>;
return {
doc: meta.elementor as never,
pageCss: typeof meta.page_css === "string" ? meta.page_css : undefined,
};
}
export async function getProductDetail(slug: string) {
const [row] = await db
.select({