feat: 收口多品牌与模板构建基础

This commit is contained in:
que01 committed 2026-09-25 02:55:46 +08:00
1 parent 0425a1c672
commit 77224ea51f
317 files changed
+11290 -1158

No files matched your search

+3 -3
View File
@@ -1,4 +1,4 @@
const { request, customerRequest } = require("../../utils/request");
const { request, customerRequest, customerTokenKey } = require("../../utils/request");
const { getTemplate } = require("../../utils/templates");
Page({
data: {
@@ -70,13 +70,13 @@ Page({
this.setData({ submitting: false });
wx.showToast({ title: error.message || "提交失败", icon: "none" });
});
const token = wx.getStorageSync("customerToken");
const token = wx.getStorageSync(customerTokenKey());
if (token) return send();
wx.login({
success: (login) =>
request("/customer/session/wechat", { method: "POST", data: { code: login.code } })
.then((result) => {
wx.setStorageSync("customerToken", result.token);
wx.setStorageSync(customerTokenKey(), result.token);
send();
})
.catch((error) => {
+31 -10
View File
@@ -1,28 +1,49 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const { customerRequest, customerTokenKey } = require("../../utils/request");
Page({
data: {
brand: {},
trustContent: [],
records: [],
pageRenderer: "",
error: "",
templateKey: "",
navigation: [],
},
onLoad() {
loadWorkspaceWithFallback().then((workspace) =>
this.setData({
brand: workspace.brand || {},
trustContent: workspace.trustContent || [],
records: wx.getStorageSync("linjingInquiryRecords") || [],
}),
);
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({
brand: workspace.brand || {},
trustContent: workspace.trustContent || [],
pageRenderer: workspace.pageRenderers?.profile || "",
records: [],
templateKey: workspace.visualTemplate?.key || "",
navigation: workspace.navigation || [],
}),
)
.catch((error) => this.setData({ error: error.message }));
},
onShow() {
this.setData({ records: wx.getStorageSync("linjingInquiryRecords") || [] });
this.loadRecords();
},
loadRecords() {
if (!wx.getStorageSync(customerTokenKey())) return this.setData({ records: [] });
customerRequest("/customer/inquiry-submissions")
.then((records) => this.setData({ records: Array.isArray(records) ? records : [] }))
.catch(() => this.setData({ records: [] }));
},
call() {
wx.makePhoneCall({ phoneNumber: (this.data.brand.contactPhone || "").replace(/[^0-9-]/g, "") });
wx.makePhoneCall({
phoneNumber: (this.data.brand.phone || this.data.brand.contactPhone || "").replace(
/[^0-9-]/g,
"",
),
});
},
copyWechat() {
wx.setClipboardData({
data: this.data.brand.contactWechat || "",
data: this.data.brand.wechat || this.data.brand.contactWechat || "",
success: () => wx.showToast({ title: "微信号已复制", icon: "none" }),
});
},
+4 -1
View File
@@ -4,6 +4,9 @@
"navigationBarTextStyle": "black",
"usingComponents": {
"t-icon": "/miniprogram_npm/tdesign-miniprogram/icon/icon",
"profile-module": "/components/modules/profile/profile"
"profile-module": "/components/modules/profile/profile",
"linjing-profile": "/components/templates/linjing-profile/linjing-profile",
"acheng-profile": "/components/templates/acheng-profile/acheng-profile",
"runtime-tab-bar": "/components/runtime-tab-bar/runtime-tab-bar"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="page"><profile-module brand="{{brand}}" records-count="{{records.length}}" bind:call="call" bind:copy="copyWechat" bind:records="recordsPage" /><view class="info-card"><view class="card-title"><t-icon name="map" size="34rpx"/> <text>直派服务区域与履约说明</text></view><view class="note"><text class="note-title">直派核心圈:</text><text>上海、杭州、宁波、苏州、无锡、南京及深圳、广州。主理人及资深装配总工亲赴现场。</text></view><view class="note"><text class="note-title">全国其他城市私邸:</text><text>接受建筑设计师联合委托,安排远程 3D 激光测绘支持与专用物流直运安装。</text></view></view><view class="info-card"><view class="card-title"><t-icon name="secured" size="34rpx"/> <text>一门一档 · 终生质保规约</text></view><text class="bullet">门体内部防变形航空合金骨架承诺 10 年结构质保;</text><text class="bullet">重型天地轴、进口地弹簧及磁吸五金 5 年免费维护;</text><text class="bullet">每樘门出厂前进行 5000 次启闭校正;</text><text class="bullet">原木天然肌理享有首年 2 次木蜡油保养服务。</text></view></view>
<view class="page"><view wx:if="{{error}}" class="runtime-error">{{error}}</view><block wx:else><acheng-profile wx:if="{{pageRenderer === 'acheng-profile'}}" brand="{{brand}}" presentation="{{brand.visualPresentation.profile}}" records-count="{{records.length}}" bind:call="call" bind:copy="copyWechat" bind:records="recordsPage" /><linjing-profile wx:elif="{{pageRenderer === 'linjing-profile'}}" brand="{{brand}}" presentation="{{brand.visualPresentation.profile}}" records-count="{{records.length}}" bind:call="call" bind:copy="copyWechat" bind:records="recordsPage" /><block wx:else><profile-module brand="{{brand}}" presentation="{{brand.visualPresentation.profile}}" records-count="{{records.length}}" bind:call="call" bind:copy="copyWechat" bind:records="recordsPage" /></block><runtime-tab-bar template-key="{{templateKey}}" active="owner" /></block></view>
+14 -1
View File
@@ -1,9 +1,19 @@
.page {
min-height: 100vh;
padding: 28rpx 32rpx 56rpx;
padding: 0;
background: #f7f5f1;
color: #252525;
}
.runtime-error {
margin: 48rpx 0;
padding: 28rpx;
border: 1rpx solid #e6ded5;
border-radius: 14rpx;
background: #fff;
color: #8a6846;
font-size: 25rpx;
line-height: 1.6;
}
.contact-card {
padding: 34rpx 30rpx;
background: #202221;
@@ -151,3 +161,6 @@
display: inline-flex;
vertical-align: middle;
}
.page {
padding-bottom: 150rpx;
}
+56 -39
View File
@@ -1,4 +1,5 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const config = require("../../utils/config");
Page({
data: {
brand: {},
@@ -6,50 +7,66 @@ Page({
offerings: [],
modules: [],
moduleVariants: {},
pageRenderer: "",
layout: [],
theme: {},
hero: {
image:
"https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=900&q=80",
eyebrow: "",
title: "",
slogan: "",
cta: "了解业务与服务 →",
},
hero: { image: "", eyebrow: "", title: "", slogan: "", cta: "" },
loading: false,
loadedBrandSlug: "",
templateKey: "",
navigation: [],
},
onLoad() {
this.loadWorkspace();
},
onShow() {
if (this.data.loadedBrandSlug && this.data.loadedBrandSlug !== config.brandSlug) {
this.loadWorkspace();
}
},
loadWorkspace() {
this.setData({ loading: true });
loadWorkspaceWithFallback().then((workspace) => {
const activeBrand = workspace.brand || {};
const activeOfferings = workspace.offerings || [];
const layout = workspace.layout?.home || [
"founder-card",
"brand-hero",
"trust-proof",
"trust-manifesto",
"offering-list",
];
const firstOffering = activeOfferings[0] || {};
this.setData({
brand: activeBrand,
trustContent: workspace.trustContent || [],
offerings: activeOfferings,
modules: workspace.modules || [],
moduleVariants: workspace.moduleVariants || {},
layout,
theme: workspace.theme || {},
hero: {
...this.data.hero,
image: activeBrand.heroImage || this.data.hero.image,
eyebrow: activeBrand.tagline || activeBrand.name,
title: firstOffering.name || activeBrand.name,
slogan: activeBrand.description || "以专业经验建立长期信任",
},
loading: false,
});
wx.setNavigationBarTitle({ title: activeBrand.name || "个人品牌" });
});
loadWorkspaceWithFallback()
.then((workspace) => {
const activeBrand = workspace.brand || {};
const activeOfferings = workspace.offerings || [];
const layout = workspace.layout?.home || [
"founder-card",
"brand-hero",
"trust-proof",
"trust-manifesto",
"offering-list",
];
const firstOffering = activeOfferings[0] || {};
const configuredHero =
activeBrand.homeHero && typeof activeBrand.homeHero === "object"
? activeBrand.homeHero
: {};
this.setData({
brand: activeBrand,
trustContent: workspace.trustContent || [],
offerings: activeOfferings,
modules: workspace.modules || [],
moduleVariants: workspace.moduleVariants || {},
pageRenderer: workspace.pageRenderers?.home || "",
layout,
theme: workspace.theme || {},
hero: {
...this.data.hero,
image: activeBrand.heroImage || this.data.hero.image,
eyebrow: activeBrand.tagline || activeBrand.name,
title: firstOffering.name || activeBrand.name,
slogan: activeBrand.description || "",
...configuredHero,
},
loading: false,
loadedBrandSlug: config.brandSlug,
templateKey: workspace.visualTemplate?.key || "",
navigation: workspace.navigation || [],
});
wx.setNavigationBarTitle({ title: activeBrand.name || "个人品牌" });
})
.catch((error) => this.setData({ error: error.message, loading: false }));
},
showModule(e) {
return this.data.layout.includes(e);
@@ -65,6 +82,6 @@ Page({
wx.navigateTo({ url: "/pages/inquiry/index" });
},
goProfile() {
wx.switchTab({ url: "/pages/bookings/index" });
wx.navigateTo({ url: "/pages/bookings/index" });
},
});
+4 -1
View File
@@ -1,10 +1,13 @@
{
"navigationBarTitleText": "品牌首页",
"usingComponents": {
"linjing-home": "/components/templates/linjing-home/linjing-home",
"acheng-home": "/components/templates/acheng-home/acheng-home",
"founder-card": "/components/modules/founder-card/founder-card",
"brand-hero": "/components/modules/brand-hero/brand-hero",
"trust-proof": "/components/modules/trust-proof/trust-proof",
"trust-manifesto": "/components/modules/trust-manifesto/trust-manifesto",
"offering-list": "/components/modules/offering-list/offering-list"
"offering-list": "/components/modules/offering-list/offering-list",
"runtime-tab-bar": "/components/runtime-tab-bar/runtime-tab-bar"
}
}
+12 -4
View File
@@ -1,9 +1,17 @@
<view class="page">
<view wx:if="{{error}}" class="runtime-error">{{error}}</view>
<block wx:else>
<linjing-home wx:if="{{pageRenderer === 'linjing-home'}}" brand="{{brand}}" presentation="{{brand.visualPresentation.home}}" hero="{{hero}}" trust-content="{{trustContent}}" offerings="{{offerings}}" bind:select="selectOffering" bind:works="goWorks" />
<acheng-home wx:elif="{{pageRenderer === 'acheng-home'}}" brand="{{brand}}" presentation="{{brand.visualPresentation.home}}" trust-content="{{trustContent}}" offerings="{{offerings}}" bind:select="selectOffering" bind:inquiry="goInquiry" bind:offerings="goWorks" />
<block wx:else>
<block wx:for="{{layout}}" wx:key="*this" wx:for-item="moduleKey">
<founder-card wx:if="{{moduleKey === 'founder-card'}}" brand="{{brand}}" variant="{{moduleVariants[moduleKey]}}" />
<founder-card wx:if="{{moduleKey === 'founder-card'}}" brand="{{brand}}" presentation="{{brand.visualPresentation.home}}" variant="{{moduleVariants[moduleKey]}}" />
<brand-hero wx:if="{{moduleKey === 'brand-hero'}}" hero="{{hero}}" variant="{{moduleVariants[moduleKey]}}" bind:explore="goWorks" />
<trust-proof wx:if="{{moduleKey === 'trust-proof'}}" content="{{trustContent}}" variant="{{moduleVariants[moduleKey]}}" />
<trust-manifesto wx:if="{{moduleKey === 'trust-manifesto'}}" content="{{trustContent}}" variant="{{moduleVariants[moduleKey]}}" />
<offering-list wx:if="{{moduleKey === 'offering-list'}}" offerings="{{offerings}}" variant="{{moduleVariants[moduleKey]}}" bind:open="selectOffering" bind:more="goWorks" />
<trust-proof wx:if="{{moduleKey === 'trust-proof'}}" content="{{trustContent}}" presentation="{{brand.visualPresentation.home}}" variant="{{moduleVariants[moduleKey]}}" />
<trust-manifesto wx:if="{{moduleKey === 'trust-manifesto'}}" content="{{trustContent}}" presentation="{{brand.visualPresentation.home}}" variant="{{moduleVariants[moduleKey]}}" />
<offering-list wx:if="{{moduleKey === 'offering-list'}}" offerings="{{offerings}}" presentation="{{brand.visualPresentation.home}}" variant="{{moduleVariants[moduleKey]}}" bind:open="selectOffering" bind:more="goWorks" />
</block>
</block>
</block>
</view>
<runtime-tab-bar template-key="{{templateKey}}" active="home" />
+13
View File
@@ -4,6 +4,16 @@
min-height: 100vh;
padding-bottom: 30rpx;
}
.runtime-error {
margin: 48rpx 32rpx;
padding: 28rpx;
border: 1rpx solid #e6ded5;
border-radius: 14rpx;
background: #fff;
color: #8a6846;
font-size: 25rpx;
line-height: 1.6;
}
.founder {
margin: 32rpx 40rpx 20rpx;
padding: 28rpx;
@@ -206,3 +216,6 @@
height: 72rpx;
line-height: 72rpx;
}
.page {
padding-bottom: 150rpx;
}
+10 -4
View File
@@ -1,11 +1,17 @@
const { customerRequest } = require("../../utils/request");
const { customerRequest, customerTokenKey } = require("../../utils/request");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { record: {} },
data: { record: {}, presentation: {} },
onLoad(options) {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({ presentation: workspace.brand?.visualPresentation?.success || {} }),
)
.catch(() => {});
const record = wx.getStorageSync("latestInquirySubmission") || {};
if (record.id === options.id) this.setData({ record });
if (options.id && wx.getStorageSync("customerToken")) {
if (options.id && wx.getStorageSync(customerTokenKey())) {
customerRequest("/customer/inquiry-submissions/" + encodeURIComponent(options.id))
.then((submission) =>
this.setData({
@@ -25,6 +31,6 @@ Page({
wx.redirectTo({ url: "/pages/records/index" });
},
home() {
wx.switchTab({ url: "/pages/index/index" });
wx.navigateTo({ url: "/pages/index/index" });
},
});
@@ -1 +1 @@
<success-summary record="{{record}}" bind:records="viewRecords" bind:home="home" />
<success-summary record="{{record}}" presentation="{{presentation}}" bind:records="viewRecords" bind:home="home" />
+34 -23
View File
@@ -1,5 +1,5 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const { request, customerRequest } = require("../../utils/request");
const { request, customerRequest, customerTokenKey } = require("../../utils/request");
Page({
data: {
offering: null,
@@ -8,31 +8,42 @@ Page({
title: "需求咨询",
subtitle: "提交信息后由主理人与你联系",
submitLabel: "提交需求",
presentation: {},
values: {},
fields: [],
formId: "",
error: "",
templateKey: "",
navigation: [],
},
onLoad(options) {
loadWorkspaceWithFallback().then((workspace) => {
const offering =
(workspace.offerings || []).find((item) => item.id === options.offeringId) || null;
const forms = workspace.inquiryForms || [];
const form =
forms.find((item) => item.targetId && item.targetId === options.offeringId) ||
forms.find((item) => item.target === "brand") ||
forms[0];
const isQuote =
form?.purpose === "quote-request" ||
(workspace.plugins || []).some((plugin) => plugin.key === "quote-request");
this.setData({
offering,
fields: form?.fields || workspace.fields || [],
formId: form?.key || form?.id || "",
title: isQuote ? "获取报价方案" : "需求咨询",
eyebrow: isQuote ? "QUOTE REQUEST" : "CONSULTATION",
submitLabel: isQuote ? "提交报价需求" : "提交需求",
});
});
loadWorkspaceWithFallback()
.then((workspace) => {
const offering =
(workspace.offerings || []).find((item) => item.id === options.offeringId) || null;
const forms = workspace.inquiryForms || [];
const form =
forms.find((item) => item.targetId && item.targetId === options.offeringId) ||
forms.find((item) => item.target === "brand") ||
forms[0];
const isQuote =
form?.purpose === "quote-request" ||
(workspace.plugins || []).some((plugin) => plugin.key === "quote-request");
const presentation = workspace.brand?.visualPresentation?.inquiry || {};
this.setData({
offering,
fields: form?.fields || workspace.fields || [],
formId: form?.key || form?.id || "",
title: isQuote ? "获取报价方案" : presentation.title || "需求咨询",
eyebrow: isQuote ? "QUOTE REQUEST" : presentation.eyebrow || "CONSULTATION",
subtitle: presentation.subtitle || "提交信息后由主理人与你联系",
submitLabel: isQuote ? "提交报价需求" : presentation.submitLabel || "提交需求",
presentation,
templateKey: workspace.visualTemplate?.key || "",
navigation: workspace.navigation || [],
});
})
.catch((error) => this.setData({ error: error.message }));
},
onInput(e) {
this.setData({ ["values." + e.currentTarget.dataset.key]: e.detail.value });
@@ -69,12 +80,12 @@ Page({
this.setData({ submitting: false });
wx.showToast({ title: error.message || "提交失败,请重试", icon: "none" });
};
if (wx.getStorageSync("customerToken")) return send().catch(fail);
if (wx.getStorageSync(customerTokenKey())) return send().catch(fail);
wx.login({
success: (login) =>
request("/customer/session/wechat", { method: "POST", data: { code: login.code } })
.then((result) => {
wx.setStorageSync("customerToken", result.token);
wx.setStorageSync(customerTokenKey(), result.token);
return send();
})
.catch(fail),
+2 -1
View File
@@ -7,6 +7,7 @@
"brand-field": "/components/ui/brand-field/brand-field",
"brand-loading": "/components/ui/brand-loading/brand-loading",
"brand-empty": "/components/ui/brand-empty/brand-empty",
"inquiry-form": "/components/modules/inquiry-form/inquiry-form"
"inquiry-form": "/components/modules/inquiry-form/inquiry-form",
"runtime-tab-bar": "/components/runtime-tab-bar/runtime-tab-bar"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="page"><view class="head"><text class="eyebrow">{{eyebrow}}</text><text class="title">{{title}}</text><text class="sub">{{offering ? offering.name : subtitle}}</text></view><inquiry-form fields="{{fields}}" values="{{values}}" submitting="{{submitting}}" submit-label="{{submitLabel}}" bind:input="onComponentInput" bind:submit="submit" /></view>
<view class="page"><view wx:if="{{error}}" class="runtime-error">{{error}}</view><block wx:else><view class="head"><text class="eyebrow">{{eyebrow}}</text><text class="title">{{title}}</text><text class="sub">{{offering ? offering.name : subtitle}}</text></view><view wx:if="{{presentation.note}}" class="booking-note"><text>{{presentation.note}}</text></view><view class="form-panel"><inquiry-form fields="{{fields}}" values="{{values}}" submitting="{{submitting}}" submit-label="{{submitLabel}}" bind:input="onComponentInput" bind:submit="submit" /></view></block></view>
+88
View File
@@ -3,6 +3,91 @@
background: #f7f5f1;
color: #252525;
}
.page {
padding-bottom: 150rpx;
}
.page {
min-height: 100vh;
background: #fff8f0;
color: #29231f;
}
.booking-hero {
padding: 52rpx 32rpx 30rpx;
background: linear-gradient(180deg, #fff1df, #fff8f0);
}
.booking-hero .eyebrow {
display: block;
color: #c65c28;
font-size: 22rpx;
font-weight: 700;
}
.booking-hero .title {
display: block;
margin-top: 14rpx;
font-size: 44rpx;
font-weight: 800;
line-height: 1.2;
}
.booking-hero .sub {
display: block;
margin-top: 14rpx;
color: #7a6a60;
font-size: 24rpx;
line-height: 1.7;
}
.booking-note {
display: flex;
justify-content: space-between;
margin: 0 32rpx 20rpx;
padding: 20rpx 22rpx;
border: 1rpx solid #f3d1b2;
border-radius: 20rpx;
background: #fff;
color: #a4562d;
font-size: 21rpx;
}
.form-panel {
margin: 0 24rpx;
padding: 10rpx 8rpx 24rpx;
border: 1rpx solid #f1e1d5;
border-radius: 28rpx;
background: #fff;
box-shadow: 0 12rpx 28rpx rgba(145, 75, 33, 0.06);
}
.form-panel .form {
padding: 20rpx;
}
.form-panel .field {
margin-bottom: 20rpx;
}
.form-panel .label {
color: #4f3020;
font-weight: 700;
}
.form-panel input,
.form-panel textarea,
.form-panel .picker-value {
border: 1rpx solid #eaded5;
border-radius: 16rpx;
background: #fffaf6;
}
.form-panel .submit {
height: 82rpx;
border-radius: 20rpx;
background: #e87532;
color: #fff;
line-height: 82rpx;
}
.runtime-error {
margin: 48rpx 32rpx;
padding: 28rpx;
border: 1rpx solid #e6ded5;
border-radius: 14rpx;
background: #fff;
color: #8a6846;
font-size: 25rpx;
line-height: 1.6;
}
.head {
background: #252827;
color: #fff;
@@ -65,3 +150,6 @@
font-size: 20rpx;
margin-top: 26rpx;
}
.page {
padding-bottom: 150rpx;
}
+14 -8
View File
@@ -1,14 +1,20 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { item: null, loading: true },
data: { item: null, loading: true, error: "", presentation: {} },
onLoad(options) {
loadWorkspaceWithFallback().then((workspace) => {
const offerings = workspace.offerings || [];
const item = offerings.find((entry) => entry.id === options.id) || offerings[0];
if (!item) return this.setData({ loading: false });
this.setData({ item, loading: false });
wx.setNavigationBarTitle({ title: item.category || item.name });
});
loadWorkspaceWithFallback()
.then((workspace) => {
const offerings = workspace.offerings || [];
const item = offerings.find((entry) => entry.id === options.id) || offerings[0];
if (!item) return this.setData({ loading: false, error: "未找到可展示的业务提供项" });
this.setData({
item,
loading: false,
presentation: workspace.brand?.visualPresentation?.detail || {},
});
wx.setNavigationBarTitle({ title: item.category || item.name });
})
.catch((error) => this.setData({ loading: false, error: error.message }));
},
inquire() {
wx.navigateTo({ url: "/pages/inquiry/index?offeringId=" + this.data.item.id });
+1 -1
View File
@@ -1 +1 @@
<offering-detail wx:if="{{item}}" item="{{item}}" bind:inquire="inquire" />
<view wx:if="{{error}}" class="runtime-error">{{error}}</view><offering-detail wx:elif="{{item}}" item="{{item}}" presentation="{{presentation}}" bind:inquire="inquire" />
+10
View File
@@ -4,6 +4,16 @@
color: #252525;
padding-bottom: 150rpx;
}
.runtime-error {
margin: 48rpx 32rpx;
padding: 28rpx;
border: 1rpx solid #e6ded5;
border-radius: 14rpx;
background: #fff;
color: #8a6846;
font-size: 25rpx;
line-height: 1.6;
}
.hero {
width: 100%;
height: 600rpx;
+11 -3
View File
@@ -1,4 +1,5 @@
const { customerRequest } = require("../../utils/request");
const { customerRequest, customerTokenKey } = require("../../utils/request");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const statusLabels = {
new: "待处理",
@@ -10,9 +11,16 @@ const statusLabels = {
};
Page({
data: { records: [], loading: false },
data: { records: [], loading: false, presentation: {} },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({ presentation: workspace.brand?.visualPresentation?.records || {} }),
)
.catch(() => {});
},
onShow() {
if (!wx.getStorageSync("customerToken")) return this.setData({ records: [] });
if (!wx.getStorageSync(customerTokenKey())) return this.setData({ records: [] });
this.setData({ loading: true });
customerRequest("/customer/inquiry-submissions")
.then((items) =>
+1 -1
View File
@@ -1 +1 @@
<view class="page"><view class="head"><text class="title">我的咨询记录</text><button bindtap="inquire">+ 新增预约</button></view><records-module records="{{records}}" bind:create="inquire" /></view>
<view class="page"><view class="head"><text class="title">{{presentation.title}}</text><button bindtap="inquire">{{presentation.createAction}}</button></view><records-module records="{{records}}" presentation="{{presentation}}" bind:create="inquire" /></view>
+48 -11
View File
@@ -1,4 +1,5 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const config = require("../../utils/config");
Page({
data: {
loading: false,
@@ -7,28 +8,64 @@ Page({
filtered: [],
modules: [],
theme: {},
category: "全部",
brand: {},
presentation: {},
category: "all",
categories: [],
pageRenderer: "",
loadedBrandSlug: "",
templateKey: "",
navigation: [],
},
onLoad() {
loadWorkspaceWithFallback().then((workspace) => {
const items = workspace.offerings || [];
this.setData({
offerings: items,
filtered: items,
modules: workspace.modules || [],
theme: workspace.theme || {},
});
});
this.loadWorkspace();
},
onShow() {
if (this.data.loadedBrandSlug && this.data.loadedBrandSlug !== config.brandSlug) {
this.loadWorkspace();
}
},
loadWorkspace() {
loadWorkspaceWithFallback()
.then((workspace) => {
const items = workspace.offerings || [];
this.setData({
offerings: items,
filtered: items,
categories: [
{ key: "all", label: "全部" },
...Array.from(new Set(items.map((item) => item.category).filter(Boolean))).map(
(key) => ({
key,
label: key,
}),
),
],
modules: workspace.modules || [],
theme: workspace.theme || {},
brand: workspace.brand || {},
presentation: workspace.brand?.visualPresentation?.offerings || {},
brand: workspace.brand || {},
pageRenderer: workspace.pageRenderers?.offerings || "",
loadedBrandSlug: config.brandSlug,
templateKey: workspace.visualTemplate?.key || "",
navigation: workspace.navigation || [],
});
})
.catch((error) => this.setData({ error: error.message }));
},
switchCategory(e) {
const category = e.currentTarget.dataset.category;
const items = this.data.offerings || [];
this.setData({
category,
filtered: category === "全部" ? items : items.filter((item) => item.category === category),
filtered: category === "all" ? items : items.filter((item) => item.category === category),
});
},
open(e) {
wx.navigateTo({ url: "/pages/offering/detail?id=" + e.currentTarget.dataset.id });
},
inquire() {
wx.navigateTo({ url: "/pages/inquiry/index" });
},
});
+4 -1
View File
@@ -3,7 +3,10 @@
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black",
"usingComponents": {
"acheng-offerings": "/components/templates/acheng-offerings/acheng-offerings",
"linjing-offerings": "/components/templates/linjing-offerings/linjing-offerings",
"brand-loading": "/components/ui/brand-loading/brand-loading",
"brand-empty": "/components/ui/brand-empty/brand-empty"
"brand-empty": "/components/ui/brand-empty/brand-empty",
"runtime-tab-bar": "/components/runtime-tab-bar/runtime-tab-bar"
}
}
+1 -1
View File
@@ -1 +1 @@
<view class="page"><view class="head"><text class="eyebrow">LINJING ATELIER</text><text class="title">作品与系统</text><text class="sub">每一扇门,都是建筑秩序的一部分。</text></view><scroll-view scroll-x class="tabs"><text wx:for="{{['全部','入户大门','庭院围墙门','室内户内门','装饰隐形门']}}" wx:key="*this" class="tab {{category===item?'active':''}}" data-category="{{item}}" bindtap="switchCategory">{{item}}</text></scroll-view><view class="list"><view wx:for="{{filtered}}" wx:key="id" class="card" data-id="{{item.id}}" bindtap="open"><image src="{{item.image}}" mode="aspectFill"/><view class="card-body"><text class="category">{{item.category}} · {{item.tag}}</text><text class="name">{{item.name}}</text><text class="series">{{item.series}}</text><text class="desc">{{item.desc}}</text><view class="foot"><text>{{item.area}}</text><text class="arrow">查看详情 →</text></view></view></view></view></view>
<view class="page"><view wx:if="{{error}}" class="runtime-error">{{error}}</view><block wx:else><acheng-offerings wx:if="{{pageRenderer === 'acheng-offerings'}}" brand="{{brand}}" presentation="{{presentation}}" offerings="{{filtered}}" bind:open="open" bind:inquire="inquire" /><block wx:else><view class="head"><text class="eyebrow">{{brand.name}}</text><text class="title">{{presentation.title}}</text><text class="sub">{{presentation.subtitle}}</text></view><scroll-view scroll-x class="tabs"><text wx:for="{{categories}}" wx:key="key" class="tab {{category===item.key?'active':''}}" data-category="{{item.key}}" bindtap="switchCategory">{{item.label}}</text></scroll-view><view class="list"><view wx:for="{{filtered}}" wx:key="id" class="card"><view class="media" data-id="{{item.id}}" bindtap="open"><image src="{{item.image}}" mode="aspectFill"/><text class="media-category">{{item.category}}</text><text wx:if="{{item.tag}}" class="media-tag">{{item.tag}}</text><view wx:if="{{item.area || item.spaceType}}" class="media-meta"><text>{{item.area}}</text><text>{{item.spaceType}}</text></view></view><view class="card-body"><text class="name" data-id="{{item.id}}" bindtap="open">{{item.name}}</text><text class="series">{{item.series}}</text><view wx:if="{{item.woodMaterial || item.hardware}}" class="specs"><view wx:if="{{item.woodMaterial}}"><text>{{presentation.materialLabel}}</text><text>{{item.woodMaterial}}</text></view><view wx:if="{{item.hardware}}"><text>{{presentation.hardwareLabel}}</text><text>{{item.hardware}}</text></view></view><view class="actions"><button class="detail" data-id="{{item.id}}" bindtap="open">{{presentation.detailAction}}</button><button class="inquire" data-id="{{item.id}}" bindtap="open">{{presentation.inquiryAction}}</button></view></view></view></view></block></block><runtime-tab-bar template-key="{{templateKey}}" active="dishes" /></view>
+109 -1
View File
@@ -3,6 +3,16 @@
min-height: 100vh;
color: #252525;
}
.runtime-error {
margin: 48rpx 32rpx;
padding: 28rpx;
border: 1rpx solid #e6ded5;
border-radius: 14rpx;
background: #fff;
color: #8a6846;
font-size: 25rpx;
line-height: 1.6;
}
.head {
background: #252827;
color: #fff;
@@ -48,12 +58,64 @@
.card {
background: #fff;
margin-bottom: 30rpx;
overflow: hidden;
border: 1rpx solid #e6ded5;
border-radius: 18rpx;
box-shadow: 0 10rpx 30rpx -12rpx rgba(32, 34, 33, 0.08);
}
.media {
position: relative;
height: 380rpx;
background: #202221;
}
.card image {
width: 100%;
height: 380rpx;
height: 100%;
display: block;
}
.media-category,
.media-tag,
.media-meta {
position: absolute;
color: #fff;
font-size: 20rpx;
}
.media-category {
top: 20rpx;
left: 20rpx;
padding: 8rpx 14rpx;
border: 1rpx solid rgba(255, 255, 255, 0.15);
border-radius: 8rpx;
background: rgba(32, 34, 33, 0.76);
color: #d9c8b2;
}
.media-tag {
top: 20rpx;
right: 20rpx;
padding: 8rpx 14rpx;
border-radius: 6rpx;
background: #8a6846;
}
.media-meta {
right: 20rpx;
bottom: 20rpx;
left: 20rpx;
display: flex;
justify-content: space-between;
gap: 20rpx;
padding: 10rpx 14rpx;
border: 1rpx solid rgba(255, 255, 255, 0.12);
border-radius: 10rpx;
background: rgba(0, 0, 0, 0.4);
color: rgba(255, 255, 255, 0.9);
font-size: 19rpx;
}
.media-meta text:last-child {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #d9c8b2;
}
.card-body {
padding: 28rpx;
}
@@ -80,6 +142,49 @@
line-height: 1.7;
margin-top: 18rpx;
}
.specs {
margin-top: 20rpx;
padding: 18rpx;
border: 1rpx solid #e6ded5;
border-radius: 12rpx;
background: #f7f5f1;
color: #252525;
font-size: 20rpx;
line-height: 1.55;
}
.specs view {
display: flex;
gap: 8rpx;
}
.specs view + view {
margin-top: 10rpx;
}
.specs text:first-child {
flex: 0 0 auto;
color: #77736b;
}
.actions {
display: flex;
gap: 14rpx;
margin-top: 22rpx;
}
.actions button {
flex: 1;
height: 70rpx;
margin: 0;
border-radius: 12rpx;
font-size: 21rpx;
line-height: 70rpx;
}
.detail {
border: 1rpx solid #202221;
background: #fff;
color: #202221;
}
.inquire {
background: #8a6846;
color: #fff;
}
.foot {
display: flex;
justify-content: space-between;
@@ -92,3 +197,6 @@
.arrow {
color: #8a6846;
}
.page {
padding-bottom: 150rpx;
}
+17
View File
@@ -0,0 +1,17 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { brand: {}, templateKey: "", presentation: {}, navigation: [], loading: true },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({
brand: workspace.brand || {},
templateKey: workspace.visualTemplate?.key || "",
presentation: workspace.brand?.visualPresentation?.home || {},
navigation: workspace.navigation || [],
loading: false,
}),
)
.catch(() => this.setData({ loading: false }));
},
});
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "出摊服务",
"usingComponents": { "runtime-tab-bar": "/components/runtime-tab-bar/runtime-tab-bar" }
}
@@ -0,0 +1 @@
<view class="page"><view class="head"><text class="eyebrow">出摊与服务</text><text class="title">今天在哪里,怎么取餐</text><text class="sub">{{brand.hours || '营业时间以当天通知为准'}}</text></view><view class="card"><text class="card-title">固定出摊与取餐</text><text>{{brand.studioAddress || brand.address || '校园生活区附近'}}</text><text>支持摊位自取、校内配送,以及班级和社团活动定制。</text></view><view class="card"><text class="card-title">定制餐品流程</text><text>1. 提交人数、时间和口味需求</text><text>2. 主理人确认菜单与取餐方式</text><text>3. 当天现做并按约定时间交付</text></view><runtime-tab-bar template-key="{{templateKey}}" active="service" /></view>
@@ -0,0 +1,42 @@
.page {
min-height: 100vh;
padding: 28rpx 32rpx 150rpx;
background: #fff8f0;
color: #29231f;
}
.head {
padding: 38rpx 4rpx 28rpx;
}
.eyebrow {
display: block;
color: #c65c28;
font-size: 22rpx;
}
.title {
display: block;
margin-top: 12rpx;
font-size: 42rpx;
font-weight: 800;
}
.sub {
display: block;
margin-top: 12rpx;
color: #7a6a60;
font-size: 24rpx;
}
.card {
display: flex;
flex-direction: column;
gap: 14rpx;
margin-bottom: 22rpx;
padding: 28rpx;
border: 1rpx solid #f2d9c6;
border-radius: 24rpx;
background: #fff;
line-height: 1.7;
}
.card-title {
color: #4f3020;
font-size: 29rpx;
font-weight: 700;
}