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,3 @@
# 阿成校园餐模板包
此目录是模板包迁移阶段的构建输入。正式迁移后,所有阿成专属页面、组件和资源只允许存在于 `miniapp/`,公共 API 和 Runtime Contract 由 shell 提供。
Whitespace-only changes.
@@ -0,0 +1,8 @@
{
"pages": ["pages/index/index"],
"window": {
"navigationBarTitleText": "阿成校园餐",
"navigationBarBackgroundColor": "#FFF8F0",
"navigationBarTextStyle": "black"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

@@ -0,0 +1,22 @@
Component({
properties: {
brand: { type: Object, value: {} },
presentation: { type: Object, value: {} },
trustContent: { type: Object, value: {} },
offerings: { type: Array, value: [] },
},
methods: {
openOffering(e) {
this.triggerEvent("select", { id: e.currentTarget.dataset.id });
},
openInquiry() {
this.triggerEvent("inquiry");
},
openOfferings() {
this.triggerEvent("offerings");
},
openService() {
wx.navigateTo({ url: "/pages/stall-service/index" });
},
},
});
@@ -0,0 +1 @@
{ "component": true }
@@ -0,0 +1 @@
<view class="page"><view class="brand-card"><view class="identity"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><view><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="slogan">“{{brand.slogan}}”</text></view></view><view class="notice"><text class="notice-title">{{presentation.stallTitle || '今日出摊点'}}</text><text>{{brand.studioAddress || brand.address}}</text><text class="notice-time">{{presentation.stallTime || '17:00 - 22:30 · 今日营业中'}}</text><text class="notice-desc">晚高峰人多,可提前预约,下课直取不排队。</text></view><view class="actions"><button bindtap="openInquiry">预约 / 定制</button><button class="muted" bindtap="openOfferings">今日菜单</button></view></view><view class="scene-wrap"><view class="section-head"><text class="eyebrow">真实出摊现场</text><text class="more">大学城老校门夜市实拍</text></view><image class="scene" src="{{brand.heroImage}}" mode="aspectFill" bindtap="openService"/></view><view class="section-head"><view><text class="eyebrow">{{presentation.worksEyebrow || '本周学生票选招牌'}}</text><text class="heading">{{presentation.worksTitle || '现做现吃,认真管饱'}}</text><text class="subline">米饭免费续,附赠当日老汤或绿豆沙</text></view><text class="more" bindtap="openOfferings">全部餐品 ›</text></view><view class="dish-grid"><view wx:for="{{offerings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="openOffering"><image src="{{item.image}}" mode="aspectFill"/><view class="dish-copy"><text class="dish-name">{{item.name}}</text><text class="dish-sub">{{item.desc}}</text><text class="price">{{item.priceRange}}</text></view></view></view><view class="promise"><text class="eyebrow light">{{presentation.manifestoEyebrow || '阿成的四大开档底线'}}</text><text class="promise-title">{{presentation.manifestoTitle || '真材实料,当天现做'}}</text><view class="promise-grid"><text>✓ 当天采购</text><text>✓ 现炒锅气</text><text>✓ 免费续饭</text><text>✓ 不用料理包</text></view><view class="quote">“上周街舞社订了 35 份,按寝室分组打包,送来还烫嘴!”<text>—— 街舞社负责人</text></view></view></view>
@@ -0,0 +1,225 @@
.page {
min-height: 100vh;
padding: 20rpx 28rpx 48rpx;
background: #fff8f0;
color: #29231f;
}
.brand-card {
padding: 28rpx;
border: 1rpx solid #f2d9c6;
border-radius: 28rpx;
background: #fff;
box-shadow: 0 12rpx 30rpx rgba(145, 75, 33, 0.08);
}
.identity {
display: flex;
gap: 20rpx;
align-items: center;
}
.identity image {
width: 96rpx;
height: 96rpx;
border: 4rpx solid #ffd9bb;
border-radius: 50%;
background: #fff1e5;
}
.name,
.title,
.slogan,
.notice-title,
.notice text,
.eyebrow,
.heading,
.more,
.dish-name,
.dish-sub,
.price,
.promise-title,
.promise-item text {
display: block;
}
.name {
font-size: 32rpx;
font-weight: 700;
}
.title {
margin-top: 6rpx;
color: #a2613b;
font-size: 21rpx;
}
.slogan {
margin-top: 10rpx;
color: #7a6a60;
font-size: 21rpx;
}
.notice {
position: relative;
margin-top: 24rpx;
padding: 20rpx;
border: 1rpx solid #f8d7b4;
border-radius: 20rpx;
background: #fff7df;
color: #6b4a35;
font-size: 22rpx;
line-height: 1.6;
}
.notice-title {
font-weight: 700;
color: #4f3020;
}
.notice-time {
position: absolute;
right: 18rpx;
top: 18rpx;
color: #c65c28;
font-size: 19rpx;
}
.notice-desc {
display: block;
margin-top: 8rpx;
color: #8c7b70;
font-size: 19rpx;
}
.scene-wrap {
margin-top: 24rpx;
}
.scene {
display: block;
width: 100%;
height: 270rpx;
border-radius: 22rpx;
}
.subline {
display: block;
margin-top: 6rpx;
color: #8c7b70;
font-size: 19rpx;
}
.promise-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10rpx;
margin-top: 16rpx;
}
.promise-grid text {
padding: 12rpx;
border-radius: 12rpx;
background: rgba(255, 255, 255, 0.1);
color: #ffe5d2;
font-size: 19rpx;
}
.quote {
margin-top: 18rpx;
padding-top: 16rpx;
border-top: 1rpx solid rgba(255, 255, 255, 0.15);
color: #ffe5d2;
font-size: 20rpx;
line-height: 1.6;
}
.quote text {
display: block;
margin-top: 8rpx;
color: #ffc79f;
font-size: 18rpx;
}
.actions {
display: flex;
gap: 14rpx;
margin-top: 20rpx;
}
.actions button {
flex: 1;
height: 76rpx;
border-radius: 20rpx;
background: #e87532;
color: #fff;
font-size: 24rpx;
line-height: 76rpx;
}
.actions .muted {
background: #fff0e5;
color: #b85e2c;
}
.section-head {
display: flex;
justify-content: space-between;
align-items: end;
margin: 34rpx 4rpx 18rpx;
}
.eyebrow {
color: #d2652b;
font-size: 19rpx;
letter-spacing: 2rpx;
}
.heading {
margin-top: 8rpx;
font-size: 34rpx;
font-weight: 700;
}
.more {
color: #d2652b;
font-size: 21rpx;
}
.dish-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16rpx;
}
.dish {
overflow: hidden;
border: 1rpx solid #f2e2d6;
border-radius: 22rpx;
background: #fff;
}
.dish image {
display: block;
width: 100%;
height: 220rpx;
background: #f3e7de;
}
.dish-copy {
padding: 18rpx;
}
.dish-name {
font-size: 24rpx;
font-weight: 700;
line-height: 1.4;
}
.dish-sub {
margin-top: 6rpx;
color: #8c7b70;
font-size: 19rpx;
line-height: 1.4;
}
.price {
margin-top: 14rpx;
color: #dc6429;
font-size: 24rpx;
font-weight: 700;
}
.promise {
margin-top: 28rpx;
padding: 28rpx;
border-radius: 24rpx;
background: #3b2118;
color: #fff;
}
.light {
color: #ffc79f;
}
.promise-title {
margin-top: 8rpx;
font-size: 30rpx;
font-weight: 700;
}
.promise-item {
display: flex;
gap: 12rpx;
margin-top: 18rpx;
color: #ffe5d2;
font-size: 21rpx;
}
.promise-item text:first-child {
color: #ff9a5a;
font-weight: 700;
}
@@ -0,0 +1,36 @@
Component({
properties: {
brand: { type: Object, value: {} },
presentation: { type: Object, value: {} },
offerings: { type: Array, value: [] },
},
data: { query: "", visibleOfferings: [] },
observers: {
"offerings, query"(offerings, query) {
const keyword = String(query || "")
.trim()
.toLowerCase();
this.setData({
visibleOfferings: (offerings || []).filter((item) => {
if (!keyword) return true;
return [item.name, item.desc, ...(item.keywords || [])].some((value) =>
String(value || "")
.toLowerCase()
.includes(keyword),
);
}),
});
},
},
methods: {
search(e) {
this.setData({ query: e.detail.value });
},
open(e) {
this.triggerEvent("open", { id: e.currentTarget.dataset.id });
},
inquire() {
this.triggerEvent("inquire");
},
},
});
@@ -0,0 +1 @@
<view class="page"><view class="head"><text class="eyebrow">{{brand.name}}</text><text class="title">{{presentation.title || '今日菜单'}}</text><text class="subtitle">{{presentation.subtitle || '现做现吃,支持提前预留和团体定制'}}</text></view><view class="filters"><view class="filter active">全部餐品</view><view class="filter">日常学生餐</view><view class="filter">寝室 / 团体</view><view class="filter">聚会定制</view></view><view class="search"><text class="search-icon">⌕</text><input value="{{query}}" placeholder="搜索餐品、牛肉、卤肉、鸡腿" bindinput="search" /></view><view class="tip">米饭免费续,支持微辣、免葱姜蒜,团体餐可提前预留。</view><view class="list"><view wx:for="{{visibleOfferings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="open"><view class="dish-media"><image src="{{item.image}}" mode="aspectFill"/><text class="tag">{{item.category || '现做餐品'}}</text></view><view class="copy"><text class="name">{{item.name}}</text><text class="desc">{{item.desc}}</text><view class="chips"><text>现做</text><text>今日有售</text></view><view class="bottom"><text class="price">{{item.priceRange}}</text><text class="action">详情 / 预留 ›</text></view></view></view></view><button class="cta" bindtap="inquire">团体活动 / 定制餐咨询</button></view>
@@ -0,0 +1,157 @@
.page {
min-height: 100vh;
padding: 28rpx;
background: #fff8f0;
color: #29231f;
}
.eyebrow {
display: block;
color: #d2652b;
font-size: 19rpx;
letter-spacing: 2rpx;
}
.title {
display: block;
margin-top: 8rpx;
font-size: 42rpx;
font-weight: 700;
}
.subtitle {
display: block;
margin-top: 8rpx;
color: #8c7b70;
font-size: 22rpx;
}
.tip {
margin-top: 22rpx;
padding: 18rpx 20rpx;
border: 1rpx solid #f8d7b4;
border-radius: 18rpx;
background: #fff7df;
color: #8c5c39;
font-size: 21rpx;
}
.filters {
display: flex;
gap: 10rpx;
overflow: hidden;
margin-top: 20rpx;
white-space: nowrap;
}
.filter {
padding: 10rpx 18rpx;
border-radius: 999rpx;
background: #f2eee9;
color: #7a6a60;
font-size: 21rpx;
}
.filter.active {
background: #e87532;
color: #fff;
}
.search {
display: flex;
align-items: center;
gap: 8rpx;
margin-top: 16rpx;
padding: 0 20rpx;
height: 72rpx;
border: 1rpx solid #eee1d6;
border-radius: 20rpx;
background: #fff;
}
.search-icon {
color: #d2652b;
font-size: 34rpx;
}
.search input {
flex: 1;
font-size: 23rpx;
}
.dish-media {
position: relative;
flex: none;
}
.dish-media .tag {
position: absolute;
top: 10rpx;
left: 10rpx;
padding: 6rpx 10rpx;
border-radius: 10rpx;
background: rgba(59, 33, 24, 0.78);
color: #fff;
font-size: 18rpx;
}
.chips {
display: flex;
gap: 8rpx;
margin-top: 10rpx;
}
.chips text {
padding: 4rpx 8rpx;
border-radius: 8rpx;
background: #fff1e6;
color: #c65c28;
font-size: 17rpx;
}
.list {
margin-top: 18rpx;
}
.dish {
display: flex;
gap: 18rpx;
margin-bottom: 16rpx;
padding: 14rpx;
border: 1rpx solid #f2e2d6;
border-radius: 22rpx;
background: #fff;
}
.dish image,
.dish-media image {
width: 196rpx;
height: 196rpx;
flex: none;
border-radius: 16rpx;
background: #f3e7de;
}
.copy {
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
}
.name {
font-size: 26rpx;
font-weight: 700;
line-height: 1.45;
}
.desc {
margin-top: 10rpx;
color: #8c7b70;
font-size: 20rpx;
line-height: 1.5;
}
.bottom {
display: flex;
align-items: end;
justify-content: space-between;
margin-top: auto;
}
.price {
color: #dc6429;
font-size: 25rpx;
font-weight: 700;
}
.action {
color: #d2652b;
font-size: 20rpx;
}
.cta {
margin: 22rpx 0 0;
height: 76rpx;
border-radius: 20rpx;
background: #e87532;
color: #fff;
font-size: 24rpx;
line-height: 76rpx;
}
@@ -0,0 +1,18 @@
Component({
properties: {
brand: { type: Object, value: {} },
presentation: { type: Object, value: {} },
recordsCount: { type: Number, value: 0 },
},
methods: {
call() {
this.triggerEvent("call");
},
copy() {
this.triggerEvent("copy");
},
records() {
this.triggerEvent("records");
},
},
});
@@ -0,0 +1 @@
<view class="page"><view class="profile-card"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="bio">{{brand.slogan}}</text><view class="contact"><button bindtap="call">电话联系</button><button bindtap="copy">复制微信</button></view></view><view class="card"><text class="card-title">{{presentation.coverageTitle || '出摊与配送'}}</text><text>{{brand.studioAddress || brand.address}}</text><text>{{presentation.coverageContent || '支持校园摊位自取、宿舍配送和班级活动定制。'}}</text></view><view class="card" bindtap="records"><text class="card-title">我的预约记录</text><text>{{recordsCount}} 条记录 ›</text></view></view>
@@ -0,0 +1,72 @@
.page {
min-height: 100vh;
padding: 28rpx;
background: #fff8f0;
color: #29231f;
}
.profile-card {
padding: 36rpx 28rpx;
text-align: center;
border-radius: 28rpx;
background: #3b2118;
color: #fff;
}
.profile-card image {
width: 132rpx;
height: 132rpx;
border: 5rpx solid #ffbd8e;
border-radius: 50%;
}
.name,
.title,
.bio,
.card-title,
.card text {
display: block;
}
.name {
margin-top: 18rpx;
font-size: 36rpx;
font-weight: 700;
}
.title {
margin-top: 6rpx;
color: #ffc79f;
font-size: 22rpx;
}
.bio {
margin-top: 16rpx;
color: #ffe5d2;
font-size: 23rpx;
line-height: 1.6;
}
.contact {
display: flex;
gap: 14rpx;
margin-top: 24rpx;
}
.contact button {
flex: 1;
height: 70rpx;
border-radius: 18rpx;
background: #e87532;
color: #fff;
font-size: 22rpx;
line-height: 70rpx;
}
.card {
margin-top: 18rpx;
padding: 26rpx;
border: 1rpx solid #f2d9c6;
border-radius: 22rpx;
background: #fff;
color: #7a6a60;
font-size: 22rpx;
line-height: 1.7;
}
.card-title {
margin-bottom: 10rpx;
color: #4b2b1d;
font-size: 27rpx;
font-weight: 700;
}
@@ -0,0 +1,52 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const { customerRequest, customerTokenKey } = require("../../utils/request");
Page({
data: {
brand: {},
trustContent: [],
records: [],
error: "",
navigation: [],
},
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({
brand: workspace.brand || {},
trustContent: workspace.trustContent || [],
records: [],
navigation: workspace.navigation || [],
}),
)
.catch((error) => this.setData({ error: error.message }));
},
onShow() {
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.phone || this.data.brand.contactPhone || "").replace(
/[^0-9-]/g,
"",
),
});
},
copyWechat() {
wx.setClipboardData({
data: this.data.brand.wechat || this.data.brand.contactWechat || "",
success: () => wx.showToast({ title: "微信号已复制", icon: "none" }),
});
},
recordsPage() {
wx.navigateTo({ url: "/pages/records/index" });
},
inquire() {
wx.navigateTo({ url: "/pages/inquiry/index" });
},
});
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black",
"usingComponents": {
"t-icon": "/miniprogram_npm/tdesign-miniprogram/icon/icon",
"profile-module": "/components/modules/profile/profile",
"acheng-profile": "/components/templates/acheng-profile/acheng-profile"
}
}
@@ -0,0 +1 @@
<view class="page"><view wx:if="{{error}}" class="runtime-error">{{error}}</view><block wx:else><acheng-profile brand="{{brand}}" presentation="{{brand.visualPresentation.profile}}" records-count="{{records.length}}" bind:call="call" bind:copy="copyWechat" bind:records="recordsPage" /><view class="proof-grid"><view><text class="proof-icon">✓</text><text>健康证公示</text><text>每年体检合格</text></view><view><text class="proof-icon">◆</text><text>摊贩登记卡</text><text>正规合规备案</text></view><view><text class="proof-icon">✦</text><text>每日消杀</text><text>食具恒温消毒</text></view></view><view class="card"><text class="card-title">他们都在阿成这订过餐</text><text>校街舞社年度专场 · 52 人份</text><text>信息学院科创竞赛 · 连签 5 天</text><text>7 号楼庆功宴 · 8 人定制</text></view><view class="promise"><text>回复承诺:备料期 15 分钟内联系,出摊高峰 1 小时内回复。</text></view></block></view>
@@ -0,0 +1,197 @@
.page {
min-height: 100vh;
padding: 28rpx 32rpx 56rpx;
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;
color: #fff;
border-radius: 18rpx;
}
.identity {
display: flex;
align-items: center;
gap: 20rpx;
}
.avatar {
width: 88rpx;
height: 88rpx;
border: 2rpx solid #8a6846;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #d9c8b2;
font: 42rpx serif;
}
.founder {
display: block;
font: 34rpx serif;
}
.role {
display: block;
margin-top: 8rpx;
color: #d9c8b2;
font-size: 22rpx;
}
.contact-line {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 22rpx;
padding-top: 18rpx;
border-top: 1rpx solid rgba(255, 255, 255, 0.12);
color: #aaa;
font-size: 23rpx;
}
.contact-line > view {
display: flex;
align-items: center;
gap: 10rpx;
color: #fff;
}
.contact-line button {
margin: 0;
padding: 0 14rpx;
background: rgba(255, 255, 255, 0.1);
color: #d9c8b2;
font-size: 21rpx;
}
.records-entry,
.info-card {
margin-top: 20rpx;
padding: 28rpx;
background: #fff;
border: 1rpx solid #e6ded5;
border-radius: 16rpx;
}
.records-entry {
display: flex;
justify-content: space-between;
font-size: 26rpx;
}
.records-entry text:last-child {
color: #8a6846;
}
.card-title {
display: block;
font-weight: 700;
font-size: 27rpx;
}
.proof-grid {
display: flex;
gap: 12rpx;
margin-top: 20rpx;
}
.proof-grid view {
flex: 1;
padding: 18rpx 8rpx;
text-align: center;
border-radius: 18rpx;
background: #fff;
border: 1rpx solid #f2d9c6;
}
.proof-grid text {
display: block;
color: #7a6a60;
font-size: 18rpx;
}
.proof-grid .proof-icon {
color: #e87532;
font-size: 30rpx;
}
.promise {
margin-top: 18rpx;
padding: 22rpx;
border-radius: 20rpx;
background: #fff3d8;
color: #8c5c39;
font-size: 21rpx;
line-height: 1.6;
}
.note,
.bullet {
display: block;
margin-top: 16rpx;
color: #77736b;
font-size: 24rpx;
line-height: 1.75;
}
.entry-icon {
width: 64rpx;
height: 64rpx;
border-radius: 12rpx;
background: rgba(138, 104, 70, 0.1);
color: #8a6846;
display: flex;
align-items: center;
justify-content: center;
}
.records-entry {
align-items: center;
gap: 18rpx;
}
.entry-copy {
flex: 1;
}
.entry-copy text {
display: block;
}
.entry-copy text:last-child {
margin-top: 8rpx;
color: #77736b;
font-size: 21rpx;
}
.count {
color: #8a6846;
font-size: 22rpx;
}
.card-title {
display: flex;
align-items: center;
gap: 12rpx;
color: #202221;
}
.note {
padding: 20rpx;
background: #f7f5f1;
border: 1rpx solid #e6ded5;
border-radius: 12rpx;
}
.note-title {
display: block;
margin-bottom: 6rpx;
color: #202221;
font-weight: 700;
}
.bullet {
padding-left: 8rpx;
}
.contact-line button {
display: flex;
align-items: center;
justify-content: center;
gap: 6rpx;
height: 44rpx;
line-height: 44rpx;
white-space: nowrap;
}
.contact-line button t-icon {
display: inline-flex;
vertical-align: middle;
}
.page {
padding-bottom: 150rpx;
}
@@ -0,0 +1,26 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { brand: {}, presentation: {}, trustContent: [], offerings: [], error: "" },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({
brand: workspace.brand || {},
presentation: workspace.brand?.visualPresentation?.home || {},
trustContent: workspace.trustContent || [],
offerings: workspace.offerings || [],
}),
)
.catch((error) => this.setData({ error: error.message }));
},
selectOffering(event) {
wx.navigateTo({ url: "/pages/offering/detail?id=" + event.detail.id });
},
goWorks() {
wx.navigateTo({ url: "/pages/services/index" });
},
goInquiry() {
wx.navigateTo({ url: "/pages/inquiry/index" });
},
});
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "阿成校园餐",
"usingComponents": {
"acheng-home": "/components/templates/acheng-home/acheng-home"
}
}
@@ -0,0 +1,4 @@
<view class="page">
<view wx:if="{{error}}" class="runtime-error">{{error}}</view>
<acheng-home wx:else brand="{{brand}}" presentation="{{presentation}}" trust-content="{{trustContent}}" offerings="{{offerings}}" bind:select="selectOffering" bind:inquiry="goInquiry" bind:offerings="goWorks" />
</view>
@@ -0,0 +1,11 @@
.page {
background: #fff8f0;
min-height: 100vh;
}
.runtime-error {
margin: 48rpx 32rpx;
padding: 28rpx;
color: #8a4b2a;
background: #fff;
border-radius: 16rpx;
}
@@ -0,0 +1,36 @@
const { customerRequest, customerTokenKey } = require("../../utils/request");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
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(customerTokenKey())) {
customerRequest("/customer/inquiry-submissions/" + encodeURIComponent(options.id))
.then((submission) =>
this.setData({
record: {
...record,
id: submission.id,
status: submission.status === "new" ? "待处理" : submission.status,
createdAt: submission.createdAt,
offeringName: submission.offering?.name || record.offeringName || "品牌合作",
},
}),
)
.catch(() => {});
}
},
viewRecords() {
wx.redirectTo({ url: "/pages/records/index" });
},
home() {
wx.navigateTo({ url: "/pages/index/index" });
},
});
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "预订已收到",
"navigationBarBackgroundColor": "#F7F5F1",
"navigationBarTextStyle": "black",
"usingComponents": { "success-summary": "/components/modules/success-summary/success-summary" }
}
@@ -0,0 +1 @@
<view class="food-success"><success-summary record="{{record}}" presentation="{{presentation}}" bind:records="viewRecords" bind:home="home" /></view>
@@ -0,0 +1,83 @@
.page {
min-height: 100vh;
padding: 130rpx 48rpx;
background: #f7f5f1;
color: #252525;
}
.food-success {
min-height: 100vh;
padding: 32rpx;
background: #fff8f0;
}
.food-success .primary {
background: #e87532;
}
.food-success .secondary {
border-color: #e87532;
color: #c65c28;
}
.mark {
width: 120rpx;
height: 120rpx;
border: 3rpx solid #8a6846;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #8a6846;
font-size: 70rpx;
font-family: serif;
}
.eyebrow {
display: block;
margin-top: 70rpx;
color: #8a6846;
font-size: 20rpx;
letter-spacing: 4rpx;
}
.title {
display: block;
margin-top: 18rpx;
font-family: serif;
font-size: 58rpx;
}
.intro {
display: block;
margin-top: 24rpx;
color: #77736b;
font-size: 28rpx;
line-height: 1.8;
}
.summary {
margin-top: 56rpx;
padding: 10rpx 26rpx;
background: #fff;
}
.summary view {
display: flex;
justify-content: space-between;
padding: 26rpx 0;
border-bottom: 1rpx solid #e6ded5;
font-size: 27rpx;
}
.summary view:last-child {
border-bottom: 0;
}
.summary text:last-child {
color: #8a6846;
}
.primary,
.secondary {
margin-top: 28rpx;
border-radius: 0;
font-size: 28rpx;
}
.primary {
background: #252827;
color: #fff;
}
.secondary {
background: transparent;
border: 1rpx solid #8a6846;
color: #8a6846;
}
@@ -0,0 +1,148 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const { request, customerRequest, customerTokenKey } = require("../../utils/request");
const typeOptions = [
"日常留餐",
"宿舍开黑餐",
"社团 / 班级活动",
"生日聚会",
"考试周加餐",
"其他需求",
];
const peopleOptions = [
"1 人(单点)",
"2-4 人(寝室小聚)",
"5-10 人(部门小聚)",
"10-30 人(社团活动)",
"30 人以上(大型活动)",
];
const budgetOptions = [
"15 元左右 / 人(实惠)",
"18-22 元 / 人(荤素双拼)",
"25 元以上 / 人(高规格定制)",
];
const deliveryOptions = [
"摊位自取(报手机尾号即拿)",
"送至宿舍楼下(满 3 份)",
"送至指定教室 / 场地",
];
const labels = {
new: "待处理",
reviewing: "沟通中",
replied: "已回复",
qualified: "已确认",
converted: "已转化",
closed: "已关闭",
};
Page({
data: {
subView: "form",
records: [],
typeOptions,
peopleOptions,
budgetOptions,
deliveryOptions,
peopleIndex: 1,
budgetIndex: 1,
deliveryIndex: 0,
values: {
type: "日常留餐",
people: peopleOptions[1],
budget: budgetOptions[1],
delivery: deliveryOptions[0],
},
formId: "",
submitting: false,
formError: "",
},
onLoad(options) {
loadWorkspaceWithFallback()
.then((workspace) => {
const form =
(workspace.inquiryForms || []).find((item) => item.targetId === options.offeringId) ||
(workspace.inquiryForms || []).find((item) => item.target === "brand") ||
workspace.inquiryForms?.[0];
this.setData({ formId: form?.key || form?.id || "" });
})
.catch(() => {});
},
onShow() {
if (!wx.getStorageSync(customerTokenKey())) return;
customerRequest("/customer/inquiry-submissions")
.then((items) =>
this.setData({
records: (items || []).map((item) => ({
...item,
type: item.inquiryForm?.name || item.values?.type || "品牌咨询",
people: item.values?.people || "",
time: item.values?.date || "",
delivery: item.values?.delivery || "",
remark: item.values?.remark || "",
status: labels[item.status] || item.status,
replyNote: item.replyNote,
createdAt: new Date(item.createdAt).toLocaleDateString("zh-CN"),
})),
}),
)
.catch(() => {});
},
switchView(e) {
this.setData({ subView: e.currentTarget.dataset.view });
},
switchToForm() {
this.setData({ subView: "form" });
},
chooseType(e) {
this.setData({ "values.type": e.currentTarget.dataset.value });
},
choosePeople(e) {
const index = Number(e.detail.value);
this.setData({ peopleIndex: index, "values.people": peopleOptions[index] });
},
chooseBudget(e) {
const index = Number(e.detail.value);
this.setData({ budgetIndex: index, "values.budget": budgetOptions[index] });
},
chooseDelivery(e) {
const index = Number(e.detail.value);
this.setData({ deliveryIndex: index, "values.delivery": deliveryOptions[index] });
},
chooseDate(e) {
this.setData({ "values.date": e.detail.value });
},
input(e) {
this.setData({ ["values." + e.currentTarget.dataset.key]: e.detail.value });
},
submit() {
const { values, formId } = this.data;
if (!values.phone)
return this.setData({ formError: "请填写手机号或微信号,以便阿成加您发排菜菜单" });
if (!values.date) return this.setData({ formError: "请选择期望用餐日期" });
if (!formId) return this.setData({ formError: "咨询表单暂不可用,请稍后重试" });
this.setData({ submitting: true, formError: "" });
const send = () =>
customerRequest("/customer/inquiry-submissions", {
method: "POST",
data: { formId, values },
}).then((result) => {
wx.setStorageSync("latestInquirySubmission", result);
this.setData({ submitting: false, subView: "history" });
this.onShow();
wx.showToast({ title: "已提交,阿成会尽快联系你", icon: "none" });
});
const fail = (error) =>
this.setData({ submitting: false, formError: error.message || "提交失败,请重试" });
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(customerTokenKey(), result.token);
return send();
})
.catch(fail),
fail,
});
},
});
@@ -0,0 +1,12 @@
{
"navigationBarTitleText": "提交咨询",
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black",
"usingComponents": {
"brand-button": "/components/ui/brand-button/brand-button",
"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"
}
}
@@ -0,0 +1,5 @@
<view class="page booking-page">
<view class="sub-tabs"><view class="sub-tab {{subView === 'form' ? 'active' : ''}}" data-view="form" bindtap="switchView">▤ 新建咨询 / 预订</view><view class="sub-tab {{subView === 'history' ? 'active' : ''}}" data-view="history" bindtap="switchView">▣ 我的咨询记录 ({{records.length}})</view></view>
<block wx:if="{{subView === 'form'}}"><view class="form-card"><text class="form-title">定制 / 预留需求登记</text><text class="form-desc">告诉阿成时间与人数,阿成量身帮你们排菜(免收预约定金)</text><view class="field"><text class="label">1. 咨询类型 <b>*</b></text><view class="type-grid"><view wx:for="{{typeOptions}}" wx:key="*this" class="type-option {{values.type === item ? 'selected' : ''}}" data-value="{{item}}" bindtap="chooseType">{{item}}</view></view></view><view class="two-col"><view class="field"><text class="label">预计用餐人数 <b>*</b></text><picker range="{{peopleOptions}}" value="{{peopleIndex}}" bindchange="choosePeople"><view class="picker">{{values.people || '请选择人数'}}</view></picker></view><view class="field"><text class="label">期望用餐时间 <b>*</b></text><picker mode="date" value="{{values.date}}" bindchange="chooseDate"><view class="picker">{{values.date || '请选择日期'}}</view></picker></view></view><view class="two-col"><view class="field"><text class="label">人均预算期望</text><picker range="{{budgetOptions}}" value="{{budgetIndex}}" bindchange="chooseBudget"><view class="picker">{{values.budget || '请选择预算'}}</view></picker></view><view class="field"><text class="label">取餐 / 配送偏好</text><picker range="{{deliveryOptions}}" value="{{deliveryIndex}}" bindchange="chooseDelivery"><view class="picker">{{values.delivery || '请选择方式'}}</view></picker></view></view><view class="field"><text class="label">预留餐品 / 口味偏好 / 忌口备注</text><textarea value="{{values.remark}}" data-key="remark" bindinput="input" placeholder="例:现炒牛肉饭 1 份,微辣多浇卤汁,不要香菜;或活动特殊要求" /></view><view class="field"><text class="label">联系手机或微信号 <b>*</b></text><input value="{{values.phone}}" data-key="phone" bindinput="input" placeholder="阿成将第一时间加微信发排菜明细与确认" /></view><view wx:if="{{formError}}" class="error">! {{formError}}</view><view class="promise">◷ <text>承诺:阿成将在 15~30 分钟内主动加微信沟通,未成单绝不骚扰。</text></view><button class="submit" loading="{{submitting}}" bindtap="submit">➤ 立即提交咨询(免收定金)</button></view></block>
<block wx:else><view wx:if="{{!records.length}}" class="empty"><text class="empty-icon">▣</text><text class="empty-title">暂无咨询记录</text><text>快向阿成提交一份预订需求吧~</text><button bindtap="switchToForm">新建咨询</button></view><view wx:else class="history-list"><view wx:for="{{records}}" wx:key="id" class="history-card"><view class="history-head"><text class="record-id">单号 #{{item.id}}</text><text class="record-status">{{item.status}}</text></view><text class="history-title">{{item.type}}({{item.people}})</text><text>◷ 时间:{{item.time || item.createdAt}}</text><text>⌖ 配送 / 取餐:{{item.delivery || '待确认'}}</text><text>备注:{{item.remark || item.flavor || '无'}}</text><view wx:if="{{item.replyNote}}" class="reply"><b>阿成微信留言:</b>{{item.replyNote}}</view><view class="history-foot">提交时间:{{item.createdAt}}<text>如有修改可随时微信留言</text></view></view><text class="history-note">仅展示近 30 天内的微信预约咨询历史</text></view></block>
</view>
@@ -0,0 +1,234 @@
.page {
min-height: 100vh;
padding: 28rpx 32rpx 150rpx;
background: #f7f5f1;
color: #292725;
}
.sub-tabs {
display: flex;
gap: 6rpx;
margin-bottom: 24rpx;
padding: 6rpx;
border-radius: 18rpx;
background: #e9e6e1;
color: #655f58;
font-size: 20rpx;
font-weight: 600;
}
.sub-tab {
flex: 1;
padding: 18rpx 4rpx;
border-radius: 14rpx;
text-align: center;
}
.sub-tab.active {
background: #fff;
color: #2c2925;
box-shadow: 0 4rpx 10rpx rgba(60, 45, 30, 0.08);
}
.form-card {
padding: 30rpx 28rpx;
border: 1rpx solid #eee9e3;
border-radius: 28rpx;
background: #fff;
box-shadow: 0 8rpx 20rpx rgba(60, 45, 30, 0.035);
}
.form-title {
display: block;
color: #282522;
font-size: 30rpx;
font-weight: 700;
}
.form-desc {
display: block;
margin-top: 8rpx;
color: #8e877f;
font-size: 19rpx;
}
.field {
margin-top: 26rpx;
}
.label {
display: block;
margin-bottom: 12rpx;
color: #4b4640;
font-size: 21rpx;
font-weight: 700;
}
.label b {
color: #e35237;
}
.type-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10rpx;
}
.type-option {
padding: 17rpx 6rpx;
border: 1rpx solid #e5e0da;
border-radius: 14rpx;
background: #fbfaf8;
color: #686159;
font-size: 18rpx;
text-align: center;
}
.type-option.selected {
border-color: #ef812d;
background: #fff2e7;
color: #d5661e;
font-weight: 700;
}
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 18rpx;
}
.picker,
input,
textarea,
.picker {
box-sizing: border-box;
width: 100%;
min-height: 76rpx;
padding: 20rpx;
border: 1rpx solid #e6e0d9;
border-radius: 14rpx;
background: #fbfaf8;
color: #59534c;
font-size: 19rpx;
line-height: 1.5;
}
textarea {
min-height: 120rpx;
}
.picker {
white-space: normal;
}
.error {
margin-top: 22rpx;
padding: 16rpx;
border: 1rpx solid #f4c5bc;
border-radius: 14rpx;
background: #fff2f0;
color: #c34131;
font-size: 19rpx;
}
.promise {
display: flex;
gap: 10rpx;
align-items: flex-start;
margin-top: 22rpx;
padding: 18rpx;
border: 1rpx solid #eee9e3;
border-radius: 16rpx;
background: #faf9f7;
color: #7b746c;
font-size: 18rpx;
line-height: 1.5;
}
.promise:first-letter {
color: #ed7d25;
}
.submit {
width: 100%;
height: 78rpx;
margin-top: 24rpx;
border-radius: 18rpx;
background: #f18029;
color: #fff;
font-size: 22rpx;
font-weight: 700;
line-height: 78rpx;
}
.empty {
display: flex;
flex-direction: column;
align-items: center;
padding: 130rpx 28rpx;
color: #aaa39b;
font-size: 20rpx;
}
.empty-icon {
font-size: 60rpx;
color: #d8d1c8;
}
.empty-title {
margin: 18rpx 0 8rpx;
color: #655e56;
font-size: 27rpx;
font-weight: 700;
}
.empty button {
height: 70rpx;
margin-top: 28rpx;
padding: 0 34rpx;
border-radius: 16rpx;
background: #f18029;
color: #fff;
font-size: 21rpx;
line-height: 70rpx;
}
.history-card {
display: flex;
flex-direction: column;
gap: 12rpx;
margin-bottom: 18rpx;
padding: 24rpx;
border: 1rpx solid #eee9e3;
border-radius: 24rpx;
background: #fff;
color: #716a62;
font-size: 19rpx;
line-height: 1.5;
}
.history-head {
display: flex;
justify-content: space-between;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0ece7;
}
.record-id {
color: #a39c94;
font-family: monospace;
font-size: 18rpx;
}
.record-status {
padding: 5rpx 12rpx;
border-radius: 999rpx;
background: #fff1e5;
color: #d36b20;
font-size: 17rpx;
}
.history-title {
color: #292622;
font-size: 24rpx;
font-weight: 700;
}
.reply {
padding: 16rpx;
border: 1rpx solid #f5d8bc;
border-radius: 14rpx;
background: #fff8ef;
color: #6f5744;
}
.reply b {
color: #e2762c;
}
.history-foot {
display: flex;
justify-content: space-between;
padding-top: 14rpx;
border-top: 1rpx solid #f3efea;
color: #aaa39b;
font-size: 17rpx;
}
.history-foot text {
color: #e2762c;
}
.history-note {
display: block;
padding: 10rpx;
text-align: center;
color: #aaa39b;
font-size: 17rpx;
}
@@ -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;
}
@@ -0,0 +1,51 @@
const { customerRequest, customerTokenKey } = require("../../utils/request");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const statusLabels = {
new: "待处理",
reviewing: "沟通中",
replied: "已回复",
qualified: "已确认",
converted: "已转化",
closed: "已关闭",
};
Page({
data: { records: [], loading: false, presentation: {} },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({ presentation: workspace.brand?.visualPresentation?.records || {} }),
)
.catch(() => {});
},
onShow() {
if (!wx.getStorageSync(customerTokenKey())) return this.setData({ records: [] });
this.setData({ loading: true });
customerRequest("/customer/inquiry-submissions")
.then((items) =>
this.setData({
loading: false,
records: items.map((item) => ({
...item,
type: item.inquiryForm?.name || "品牌咨询",
status: statusLabels[item.status] || item.status,
timeline: (item.statusHistory || []).map((entry) => ({
status: statusLabels[entry.toStatus] || entry.toStatus,
createdAt: new Date(entry.createdAt).toLocaleString("zh-CN"),
})),
project: "咨询记录",
offeringName: item.offering?.name || "品牌合作",
createdAt: new Date(item.createdAt).toLocaleDateString("zh-CN"),
})),
}),
)
.catch((error) => {
this.setData({ loading: false });
wx.showToast({ title: error.message || "记录加载失败", icon: "none" });
});
},
inquire() {
wx.navigateTo({ url: "/pages/inquiry/index" });
},
});
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "我的预订记录",
"navigationBarBackgroundColor": "#F7F5F1",
"navigationBarTextStyle": "black",
"usingComponents": { "records-module": "/components/modules/records/records" }
}
@@ -0,0 +1 @@
<view class="page food-records"><view class="head"><view><text class="eyebrow">我的预订</text><text class="title">{{presentation.title || '我的预订记录'}}</text></view><button bindtap="inquire">{{presentation.createAction || '新增预订'}}</button></view><records-module records="{{records}}" presentation="{{presentation}}" bind:create="inquire" /></view>
@@ -0,0 +1,94 @@
.page {
min-height: 100vh;
padding: 34rpx 36rpx;
background: #f7f5f1;
color: #252525;
}
.food-records {
background: #fff8f0;
color: #29231f;
}
.food-records .eyebrow {
display: block;
color: #d2652b;
font-size: 20rpx;
letter-spacing: 2rpx;
}
.food-records .title {
display: block;
margin-top: 8rpx;
color: #3b2118;
font-family: sans-serif;
font-size: 42rpx;
}
.food-records .head button {
border: 0;
border-radius: 18rpx;
background: #e87532;
color: #fff;
}
.head {
display: flex;
align-items: center;
justify-content: space-between;
}
.title {
font-family: serif;
font-size: 48rpx;
}
.head button {
margin: 0;
padding: 0 22rpx;
border: 1rpx solid #8a6846;
background: transparent;
color: #8a6846;
font-size: 24rpx;
}
.empty {
margin-top: 180rpx;
text-align: center;
color: #99928a;
font-size: 26rpx;
line-height: 1.8;
}
.empty-title {
display: block;
margin-bottom: 16rpx;
color: #252525;
font-family: serif;
font-size: 40rpx;
}
.empty button {
margin-top: 36rpx;
background: #8a6846;
color: #fff;
border-radius: 0;
}
.record {
margin-top: 22rpx;
padding: 28rpx;
background: #fff;
}
.record-head {
display: flex;
justify-content: space-between;
font-family: serif;
font-size: 33rpx;
}
.status {
font-family: inherit;
color: #8a6846;
font-size: 23rpx;
}
.project {
display: block;
margin-top: 20rpx;
color: #77736b;
font-size: 27rpx;
}
.meta {
display: block;
margin-top: 18rpx;
color: #aaa39a;
font-size: 22rpx;
}
@@ -0,0 +1,67 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
const config = require("../../utils/config");
Page({
data: {
loading: false,
error: "",
offerings: [],
filtered: [],
modules: [],
theme: {},
brand: {},
presentation: {},
category: "all",
categories: [],
loadedBrandSlug: "",
navigation: [],
},
onLoad() {
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 || {},
loadedBrandSlug: config.brandSlug,
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 === "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" });
},
});
@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "服务列表",
"navigationBarBackgroundColor": "#FBF7F1",
"navigationBarTextStyle": "black",
"usingComponents": {
"acheng-offerings": "/components/templates/acheng-offerings/acheng-offerings",
"brand-loading": "/components/ui/brand-loading/brand-loading",
"brand-empty": "/components/ui/brand-empty/brand-empty"
}
}
@@ -0,0 +1 @@
<view class="page"><view wx:if="{{error}}" class="runtime-error">{{error}}</view><block wx:else><acheng-offerings brand="{{brand}}" presentation="{{presentation}}" offerings="{{filtered}}" bind:open="open" bind:inquire="inquire" /></block></view>
@@ -0,0 +1,202 @@
.page {
background: #f7f5f1;
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;
padding: 70rpx 40rpx 55rpx;
}
.eyebrow {
font-size: 20rpx;
letter-spacing: 3rpx;
color: #d9c8b2;
display: block;
margin-bottom: 18rpx;
}
.title {
font-size: 52rpx;
font-family: serif;
display: block;
}
.sub {
font-size: 26rpx;
color: #c6c2ba;
display: block;
margin-top: 16rpx;
}
.tabs {
white-space: nowrap;
padding: 28rpx 32rpx;
background: #f7f5f1;
}
.tab {
display: inline-block;
font-size: 25rpx;
color: #77736b;
margin: 0 14rpx;
padding-bottom: 12rpx;
}
.tab.active {
color: #8a6846;
border-bottom: 2px solid #8a6846;
}
.list {
padding: 0 32rpx 40rpx;
}
.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: 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;
}
.category {
font-size: 20rpx;
color: #8a6846;
display: block;
}
.name {
display: block;
font-size: 34rpx;
line-height: 1.45;
margin: 12rpx 0 6rpx;
}
.series {
display: block;
color: #77736b;
font-size: 24rpx;
}
.desc {
display: block;
color: #77736b;
font-size: 25rpx;
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;
border-top: 1px solid #eee7de;
margin-top: 24rpx;
padding-top: 20rpx;
color: #999;
font-size: 22rpx;
}
.arrow {
color: #8a6846;
}
.page {
padding-bottom: 150rpx;
}
@@ -0,0 +1,18 @@
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { brand: {}, presentation: {}, loading: true },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
this.setData({
brand: workspace.brand || {},
presentation: workspace.brand?.visualPresentation?.home || {},
loading: false,
}),
)
.catch(() => this.setData({ loading: false }));
},
inquire() {
wx.navigateTo({ url: "/pages/inquiry/index" });
},
});
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "出摊服务",
"usingComponents": {}
}
@@ -0,0 +1,9 @@
<view class="page service-page">
<view class="service-card">
<view class="card-head"><view class="head-title"><text class="icon">◷</text><text>每周出摊固定日程</text></view><text class="status-pill">准时出摊</text></view>
<view class="schedule schedule-primary"><view class="schedule-main"><view class="schedule-title"><text class="dot orange"></text><text>周一至周五(晚餐 + 夜宵档)</text></view><text class="schedule-line">⌖ 地点:二号校门外小吃商业街 #07 号铺位</text><text class="schedule-muted">营业:17:00 - 22:30(下雨搭防雨防风棚正常营业)</text></view><text class="schedule-tag orange-tag">常规固定点</text></view>
<view class="schedule schedule-weekend"><view class="schedule-main"><view class="schedule-title"><text class="dot blue"></text><text>周六、周日(全天接团体单 + 夜市流动)</text></view><text class="schedule-line">▣ 白天专供:球赛、班级春游、社团集训、答辩餐</text><text class="schedule-muted">晚间:18:00 - 23:00 体育馆南侧流动出摊</text></view><text class="schedule-tag blue-tag">活动专车</text></view>
</view>
<view class="service-card"><view class="card-title"><text class="icon">⌁</text><text>取餐与配送范围</text></view><view class="delivery-grid"><view class="delivery-item"><text class="delivery-title orange-text">♧ 摊位现场自取</text><text>小程序提前留餐,报手机尾号即拿,附赠特制加厚保温袋,不用排长龙。</text></view><view class="delivery-item"><text class="delivery-title blue-text">♢ 校内楼下配送</text><text>满 3 份即可送至宿舍楼栋或实验楼门前,阿成骑专用恒温保温箱电动车直送。</text></view></view></view>
<view class="service-card process-card"><view class="card-title"><text class="icon">☷</text><text>定制餐品 4 步流程</text></view><text class="card-sub">专为班长、社长、活动干事设计的极简排菜流程</text><view class="steps"><view class="step"><text class="step-no">1</text><view><text class="step-title">提交基本需求</text><text>选择活动类型(如生日会、社团换届、答辩加餐)、预估人数与预算。</text></view></view><view class="step"><text class="step-no">2</text><view><text class="step-title">15 分钟内核算菜单</text><text>阿成微信直接联系,提供荤素搭配明细与个性化需求(免辣、清真配料等)。</text></view></view><view class="step"><text class="step-no">3</text><view><text class="step-title">当日新鲜烹饪打包</text><text>提前 2 小时生鲜采买,铁锅现炒,独立封盒并标注姓名 / 楼栋。</text></view></view><view class="step"><text class="step-no">4</text><view><text class="step-title">保温直达交付</text><text>约定时间准时送抵指定场地,确认菜品温度与数量无误后结算。</text></view></view></view><view class="process-foot"><text>起订门槛:<text class="strong">6 份起</text><text class="divider">|</text>退改:<text class="strong">出餐前 2 小时全退</text></text><button bindtap="inquire">立即咨询 <text>→</text></button></view></view>
</view>
@@ -0,0 +1,217 @@
.page {
min-height: 100vh;
padding: 28rpx 32rpx 150rpx;
background: #f7f5f1;
color: #292725;
}
.service-card {
margin-bottom: 24rpx;
padding: 30rpx 28rpx;
border: 1rpx solid #eee9e3;
border-radius: 28rpx;
background: #fff;
box-shadow: 0 8rpx 20rpx rgba(60, 45, 30, 0.035);
}
.card-head,
.card-title,
.head-title,
.schedule-title,
.process-foot {
display: flex;
align-items: center;
}
.card-head {
justify-content: space-between;
padding-bottom: 22rpx;
border-bottom: 1rpx solid #eeeae5;
}
.head-title,
.card-title {
gap: 14rpx;
color: #302d29;
font-size: 28rpx;
font-weight: 700;
}
.icon {
color: #ed7d25;
font-size: 34rpx;
font-weight: 400;
}
.status-pill {
padding: 7rpx 16rpx;
border: 1rpx solid #bce4d1;
border-radius: 999rpx;
background: #effaf4;
color: #16834c;
font-size: 20rpx;
}
.schedule {
display: flex;
justify-content: space-between;
gap: 12rpx;
margin-top: 22rpx;
padding: 22rpx 18rpx;
border: 1rpx solid #f1ddd0;
border-radius: 20rpx;
}
.schedule-primary {
background: #fffaf6;
}
.schedule-weekend {
border-color: #e6e9ef;
background: #fafbfc;
}
.schedule-main {
min-width: 0;
}
.schedule-title {
gap: 12rpx;
color: #272522;
font-size: 22rpx;
font-weight: 700;
}
.dot {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
flex: none;
}
.orange {
background: #f27d27;
}
.blue {
background: #4b84d8;
}
.schedule-line,
.schedule-muted {
display: block;
margin-top: 12rpx;
margin-left: 26rpx;
color: #655e56;
font-size: 20rpx;
line-height: 1.45;
}
.schedule-muted {
margin-top: 5rpx;
color: #9a948c;
font-size: 18rpx;
}
.schedule-tag {
height: max-content;
padding: 6rpx 10rpx;
border-radius: 6rpx;
font-size: 17rpx;
white-space: nowrap;
}
.orange-tag {
background: #fff0e4;
color: #bd5d1b;
}
.blue-tag {
background: #eaf2ff;
color: #2e63a6;
}
.delivery-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 18rpx;
margin-top: 22rpx;
}
.delivery-item {
padding: 20rpx;
border: 1rpx solid #eeeae5;
border-radius: 20rpx;
background: #fbfaf8;
color: #777169;
font-size: 19rpx;
line-height: 1.6;
}
.delivery-title {
display: block;
margin-bottom: 8rpx;
font-size: 22rpx;
font-weight: 700;
}
.orange-text {
color: #eb7926;
}
.blue-text {
color: #3473c2;
}
.card-sub {
display: block;
margin-top: 12rpx;
color: #8b857e;
font-size: 19rpx;
}
.steps {
margin: 24rpx 0 0 14rpx;
padding-left: 26rpx;
border-left: 3rpx solid #f7cda9;
}
.step {
position: relative;
display: flex;
gap: 18rpx;
margin-bottom: 26rpx;
color: #79736c;
font-size: 19rpx;
line-height: 1.55;
}
.step:last-child {
margin-bottom: 0;
}
.step-no {
position: absolute;
left: -40rpx;
top: 0;
display: flex;
align-items: center;
justify-content: center;
width: 30rpx;
height: 30rpx;
border-radius: 50%;
background: #ef7c26;
color: #fff;
font-size: 18rpx;
font-weight: 700;
}
.step-title {
display: block;
margin-bottom: 5rpx;
color: #3d3934;
font-size: 22rpx;
font-weight: 700;
}
.process-foot {
justify-content: space-between;
gap: 12rpx;
margin-top: 28rpx;
padding-top: 22rpx;
border-top: 1rpx solid #eeeae5;
color: #777169;
font-size: 18rpx;
line-height: 1.5;
}
.strong {
color: #34312d;
}
.divider {
margin: 0 8rpx;
color: #d0cbc4;
}
.process-foot button {
height: 62rpx;
margin: 0;
padding: 0 22rpx;
border-radius: 16rpx;
background: #f18029;
color: #fff;
font-size: 20rpx;
line-height: 62rpx;
white-space: nowrap;
}
.process-foot button text {
margin-left: 8rpx;
font-size: 26rpx;
}
@@ -0,0 +1,12 @@
{
"name": "@personal-brand/template-acheng-campus-food",
"version": "1.0.0",
"private": true,
"type": "module",
"files": [
"template.json",
"miniapp",
"fixtures",
"README.md"
]
}
@@ -0,0 +1,75 @@
{
"packageKey": "acheng-campus-food",
"version": "1.0.0",
"displayName": "阿成校园餐",
"defaultBrandSlug": "default-brand",
"runtimeContract": "1.0",
"supportedIndustryTemplates": ["food"],
"entrypoints": {
"home": "pages/index/index",
"offerings": "pages/services/index",
"service": "pages/stall-service/index",
"detail": "pages/offering/detail",
"inquiry": "pages/inquiry/index",
"success": "pages/inquiry-success/index",
"records": "pages/records/index",
"profile": "pages/bookings/index"
},
"navigation": [
{
"key": "home",
"label": "首页/摊位",
"page": "home",
"iconPath": "assets/tab/home.png",
"selectedIconPath": "assets/tab/home-selected.png"
},
{
"key": "dishes",
"label": "套餐餐品",
"page": "offerings",
"iconPath": "assets/tab/dishes.png",
"selectedIconPath": "assets/tab/dishes-selected.png"
},
{
"key": "service",
"label": "出摊服务",
"page": "service",
"iconPath": "assets/tab/service.png",
"selectedIconPath": "assets/tab/service-selected.png"
},
{
"key": "owner",
"label": "主理人",
"page": "profile",
"iconPath": "assets/tab/owner.png",
"selectedIconPath": "assets/tab/owner-selected.png"
},
{
"key": "booking",
"label": "定制/咨询",
"page": "inquiry",
"iconPath": "assets/tab/booking.png",
"selectedIconPath": "assets/tab/booking-selected.png"
}
],
"requiredCapabilities": ["offerings", "inquiry", "booking"],
"renderers": {
"home": "acheng-home",
"offerings": "acheng-offerings",
"profile": "acheng-profile"
},
"runtimeOwnedPages": ["detail", "inquiry", "success", "records"],
"ownedPaths": [
"components/templates/acheng-home",
"components/templates/acheng-offerings",
"components/templates/acheng-profile",
"pages/index",
"pages/services",
"pages/bookings",
"pages/inquiry",
"pages/stall-service",
"pages/offering",
"pages/inquiry-success",
"pages/records"
]
}