fix: 收敛分类键运行时契约

This commit is contained in:
que01 committed 2026-10-12 00:03:03 +08:00
1 parent 422162e580
commit 787a50369f
4 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ export function offering(item: RuntimeOffering): Offering {
image: item.presentation.heroImage || item.coverUrl || "",
desc: item.summary || "",
priceRange: item.priceText || "沟通报价",
category: item.presentation.categoryLabel,
category: item.presentation.categoryLabel || item.presentation.categoryKey,
area: text(item.presentation.area),
series: text(item.presentation.series),
keywords: item.presentation.keywords,
@@ -39,6 +39,7 @@ const adminOffering = {
sortOrder: 0,
config: {
categoryKey: "private-chef",
categoryLabel: "私厨",
area: "东门",
series: "预约制",
spaceType: "8 人聚餐",
@@ -94,7 +94,7 @@ function renderedFields(templateRoot, entrypoint) {
}
const sharedOfferingBindings = [
"offering.config.categoryLabel",
"offering.config.categoryKey",
"offering.config.detailHero",
"offering.config.area",
"offering.config.series",
@@ -106,7 +106,7 @@ const sharedOfferingBindings = [
"offering.config.details.materialsList",
];
const offeringRuntimeBindings = {
"offering.config.categoryLabel": "item.presentation.categoryLabel",
"offering.config.categoryKey": "item.presentation.categoryLabel",
"offering.config.detailHero": "item.detailHero",
"offering.config.area": "item.area",
"offering.config.series": "item.series",
+2
View File
@@ -126,6 +126,8 @@ export function diagnoseTemplate(manifest, source, file = "taro/index.tsx") {
}
if (ts.isCallExpression(node) && ["object", "rows"].includes(node.expression.getText(ast)))
return resolve(node.arguments[0]);
if (ts.isCallExpression(node) && node.expression.getText(ast) === "text" && node.arguments[0])
return resolve(node.arguments[0]);
if (ts.isCallExpression(node) && node.expression.getText(ast) === "offering")
return "offering";
if (ts.isCallExpression(node) && node.expression.getText(ast) === "slot") return "trust";