From 13a2d3c67610b3864144fb9332334432df6021f2 Mon Sep 17 00:00:00 2001 From: que01 Date: Wed, 23 Sep 2026 00:03:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8C=89=E8=BF=90=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=B8=B2=E6=9F=93=E9=A6=96=E9=A1=B5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/miniapp/pages/index/index.js | 3 ++- apps/miniapp/pages/index/index.wxml | 10 +++++----- docs/template-runtime-progress.md | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/miniapp/pages/index/index.js b/apps/miniapp/pages/index/index.js index 56fce8f..1854c1f 100644 --- a/apps/miniapp/pages/index/index.js +++ b/apps/miniapp/pages/index/index.js @@ -2,7 +2,8 @@ const { brand, trustContent, offerings } = require("../../utils/linjing-data"); const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace"); Page({ data: { brand, trustContent, offerings, modules: [], layout: [], theme: {}, hero: { image: "https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=900&q=80", eyebrow: "年度落成实景 · 莫干山庄园", title: "万籁系列 · 铸铜冷锻双轴入户门", slogan: "门高 3.4m · 德国静音地轴", cta: "探索全系作品 →" }, loading: false }, - onLoad() { this.setData({ loading: true }); loadWorkspaceWithFallback().then((workspace) => { this.setData({ brand: workspace.brand, trustContent: workspace.trustContent || trustContent, offerings: workspace.offerings || offerings, modules: workspace.modules || [], layout: workspace.layout?.home || [], theme: workspace.theme || {}, loading: false }); wx.setNavigationBarTitle({ title: workspace.brand.name || brand.name }); }); }, + onLoad() { this.setData({ loading: true }); loadWorkspaceWithFallback().then((workspace) => { const layout = workspace.layout?.home || ["founder-card", "brand-hero", "trust-proof", "trust-manifesto", "offering-list"]; this.setData({ brand: workspace.brand, trustContent: workspace.trustContent || trustContent, offerings: workspace.offerings || offerings, modules: workspace.modules || [], layout, theme: workspace.theme || {}, loading: false }); wx.setNavigationBarTitle({ title: workspace.brand.name || brand.name }); }); }, + showModule(e) { return this.data.layout.includes(e); }, selectOffering(e) { const id = e.detail ? e.detail.id : e.currentTarget.dataset.id; wx.navigateTo({ url: "/pages/offering/detail?id=" + id }); }, goWorks() { wx.switchTab({ url: "/pages/services/index" }); }, goInquiry() { wx.navigateTo({ url: "/pages/inquiry/index" }); }, diff --git a/apps/miniapp/pages/index/index.wxml b/apps/miniapp/pages/index/index.wxml index 1a663f6..c54d422 100644 --- a/apps/miniapp/pages/index/index.wxml +++ b/apps/miniapp/pages/index/index.wxml @@ -1,7 +1,7 @@ - - - - - + + + + + diff --git a/docs/template-runtime-progress.md b/docs/template-runtime-progress.md index a2b2f6d..5774255 100644 --- a/docs/template-runtime-progress.md +++ b/docs/template-runtime-progress.md @@ -54,6 +54,7 @@ - [x] Admin 展示视觉模板主题色、适用场景和模块变体预览卡片。 - [x] 增加行业模板与视觉模板的安装前组合预览接口,不写入品牌配置。 - [x] Admin 接入模板组合预览,可在安装前查看模块变体和能力依赖。 +- [x] 首页标准模块按 `layout.home` 受控显示,未知模块安全隐藏。 - [ ] Phase 4:Capability Plugin。 - [ ] Phase 5:林境门作与第二行业双模板验证。 - [ ] Phase 6:Stitch 到 Manifest 的转换流水线。