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

@@ -0,0 +1,22 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
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, 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 });
},
});
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "餐品详情",
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black",
"usingComponents": { "offering-detail": "/components/modules/offering-detail/offering-detail" }
}
@@ -0,0 +1 @@
<view wx:if="{{error}}" class="runtime-error">{{error}}</view><offering-detail wx:elif="{{item}}" item="{{item}}" presentation="{{presentation}}" bind:inquire="inquire" />
@@ -0,0 +1,104 @@
.page {
background: #f7f5f1;
min-height: 100vh;
color: #252525;
padding-bottom: 150rpx;
}
.page {
background: #fff8f0;
color: #29231f;
}
.bar button {
border-radius: 20rpx;
background: #e87532;
}
.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;
display: block;
}
.content {
padding: 42rpx 40rpx;
}
.category,
.label {
font-size: 21rpx;
color: #8a6846;
display: block;
letter-spacing: 1rpx;
}
.title {
display: block;
font-size: 46rpx;
font-family: serif;
line-height: 1.35;
margin: 18rpx 0 8rpx;
}
.series {
display: block;
color: #77736b;
font-size: 26rpx;
}
.price {
display: block;
color: #8a6846;
font-size: 30rpx;
margin-top: 26rpx;
}
.rule {
height: 1px;
background: #ddd5cb;
margin: 38rpx 0;
}
.desc,
.body {
display: block;
color: #77736b;
font-size: 27rpx;
line-height: 1.9;
margin-top: 16rpx;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: 14rpx;
margin: 30rpx 0;
}
.chips text {
border: 1px solid #c9b7a0;
color: #8a6846;
padding: 10rpx 18rpx;
font-size: 22rpx;
}
.section {
border-top: 1px solid #ddd5cb;
padding-top: 30rpx;
margin-top: 28rpx;
}
.bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #f7f5f1;
padding: 22rpx 32rpx calc(22rpx + env(safe-area-inset-bottom));
box-shadow: 0 -4rpx 18rpx rgba(37, 40, 39, 0.08);
}
.bar button {
background: #252827;
color: #fff;
border-radius: 0;
height: 86rpx;
line-height: 86rpx;
font-size: 28rpx;
}