feat: 收口多品牌与模板构建基础
This commit is contained in:
1 parent
0425a1c672
commit
77224ea51f
317 files changed
+11290
-1158
No files matched your search
@@ -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 @@
|
||||
<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" />
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user