feat: 按林境门作原型完善静态小程序

This commit is contained in:
que01 committed 2026-09-22 16:43:29 +08:00
1 parent 4afb6bbbe8
commit 8489c8ca79
26 files changed
+92 -964

No files matched your search

+7 -44
View File
@@ -1,46 +1,9 @@
const { request } = require("../../utils/request");
const config = require("../../utils/config");
const { getTemplate } = require("../../utils/templates");
const { brand, trustContent, offerings } = require("../../utils/linjing-data");
Page({
data: { loading: true, error: "", brand: {}, services: [], copy: {} },
onLoad() {
this.load();
},
load() {
this.setData({ loading: true, error: "" });
Promise.all([request("/public/brand"), request("/public/offerings")])
.then(([brand, services]) => {
getApp().globalData.brand = brand;
wx.setNavigationBarTitle({ title: brand.name || "个人品牌" });
const copy = getTemplate(brand.templateKey);
this.setData({
brand: { ...brand, coverUrl: brand.coverUrl || "/assets/brand/home-hero.jpg" },
services,
copy,
loading: false,
});
})
.catch(() => this.setData({ loading: false, error: "暂时无法加载内容" }));
},
selectService(event) {
wx.navigateTo({
url: "/pages/booking/index?offeringId=" + encodeURIComponent(event.currentTarget.dataset.id),
});
},
goServices() {
wx.switchTab({ url: "/pages/services/index" });
},
goPrivateChef() {
wx.navigateTo({ url: "/pages/booking/index?type=private_chef" });
},
goBooking() {
wx.navigateTo({ url: "/pages/booking/index" });
},
goBookings() {
wx.switchTab({ url: "/pages/bookings/index" });
},
goHome() {
wx.switchTab({ url: "/pages/index/index" });
},
data: { brand, trustContent, offerings, loading: false },
onLoad() { wx.setNavigationBarTitle({ title: brand.name }); },
selectOffering(e) { wx.navigateTo({ url: "/pages/offering/detail?id=" + e.currentTarget.dataset.id }); },
goWorks() { wx.switchTab({ url: "/pages/services/index" }); },
goInquiry() { wx.navigateTo({ url: "/pages/inquiry/index" }); },
goProfile() { wx.switchTab({ url: "/pages/bookings/index" }); },
});