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

+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;
}