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