当前位置:网站首页>Harmony food menu interface
Harmony food menu interface
2022-06-25 07:24:00 【respectable-face】
Run the renderings

Code segment

data In the code cookbook-hotcat.json
[
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " Home Dishes "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " soup "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " Sichuan cuisine "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " Cantonese cuisine "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " breakfast "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " Hot pot "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " vegetable dish "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " porridge "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " Cold Dishes "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " bake "
},
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"title": " drink "
}
]data In the code cookbook-list.json
{
"ret": true,
"data": [
{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
},{
"img": "https://i.postimg.cc/pLZ0kNL8/pic-01.jpg",
"all_click": "3334.9\u4e07",
"favorites": "20.4\u4e07"
}
]
}news in hotcake Code hml
<div class="cb-hc-container">
<div class="cb=hc-title">
<text>
Hot categories
</text>
</div>
<div class="cb-hc-list">
<div class="cb-hc-item" for="{
{list}}">
<image src="{
{$item.img}}"></image>
<text>{
{$item.title}}</text>
</div>
</div>
</div>news in hotcake Code js
// @ts-nocheck
import list from '../../../common/data/cookbook-hotcat.json'
export default{
data:{
list:[]
},
onReady(){
this.list=list
}
}news in hotcake Code css
.cb-hc-container {
flex-direction: column;
}
.cb-hc-title {
border-bottom-width: 0.5px;
border-bottom-color: #eee;
height: 44px;
}
text {
font-size: 12px;
padding-left: 10px;
}
.cb-hc-list {
flex-wrap: wrap;
margin-top: 20px;
}
.cb-hc-item {
width: 33.33333%;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
image {
object-fit: cover;
width: 70px;
height: 70px;
border-radius: 8px;
}
text {
font-size: 14px;
line-height: 30px;
}
swiper In the code hml
<div class="cb-swiper-container">
<swiper>
<image for="{
{list.slice(0,5)}}" src="{
{$item.img}}">
</image>
</swiper>
</div>swiper In the code js
export default{
props:{
list:{
type:Array
}
},
onReady(){
console.log(this.list)
}
}
swiper In the code css
.cb-swiper-container {
height: 240px;
}
swiper {
width: 100%;
}
image {
width: 100%;
height: 100%;
object-fit: fill;
}top In the code hml
<div class="cb-top-container">
<div class="cb-title-title">
<text>
Fine dishes
</text>
</div>
<div class="cb-top-body">
<div class="cb-top-item" for="{
{list.slice(0,10)}}">
<image src="{
{$item.img}}"></image>
<div class="cb-top-item-info">
<text class="cb-top-item-title">
{
{$item.name}}
</text>
<text class="cb-top-item-subtitle">
{
{$item.all_click}} Browse {
{$item.favorites}} Collection
</text>
</div>
</div>
</div>
</div>
top In the code js
export default{
props:{
list:{
type:Array
}
},
onReady(){
console.log(this.list)
}
}
top In the code css
.cb-top-container {
flex-direction: column;
background-color: #f5f5f5;
}
.cb-title-title {
height: 50px;
padding-top: 5px;
padding-left: 10px;
color: #333;
}
text {
font-size: 12px;
}
.cb-top-body {
flex-wrap: wrap;
padding-left: 10px;
padding-right: 10px;
}
.cb-top-item {
width: 50%;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: white;
padding-bottom: 15px;
margin-bottom: 10px;
height: 160px;
}
image {
width: 100%;
flex: 1;
object-fit: contain;
}
.cb-top-item-info {
height: 50px;
flex-direction: column;
align-items: center;
}
.cb-top-item-title {
font-size: 16px;
}
.cb-top-item-subtitle {
font-size: 12px;
color: #666;
font-weight: 100;
}
news in index.hml Code
<element name='cb-hotcake' src='./hotcake/hotcake'></element>
<element name='cb-swiper' src='./swiper/swiper.hml'></element>
<element name='cb-top' src='./top/top.hml'></element>
<element name='comp' src='../../components/tabbar/tabbar.hml'></element>
<div class="cb-container">
<div class="cb-title">
<text>
Information Center
</text>
</div>
<div class="cb-body">
<list>
<list-item class="cb-body-item">
<!-- <cb-hotcake></cb-hotcake>-->
<cb-swiper list="{
{list}}"></cb-swiper>
<!-- <cb-hotcake></cb-hotcake>-->
</list-item>
</list>
</div>
<div class="cb-body">
<list>
<list-item class="cb-body-item">
<cb-hotcake></cb-hotcake>
<!-- <cb-hotcake></cb-hotcake>-->
</list-item>
</list>
</div>
<div class="cb-body">
<list>
<list-item class="cb-body-item">
<cb-top list="{
{list}}"></cb-top>
</list-item>
</list>
<comp index="1"></comp>
</div>
</div>
news in index.js Code
// @ts-nocheck
import list from '../../common/data/cookbook-list.json'
export default {
data: {
list:[]
// title: ""
},
onInit() {
this.list=list.data;
// this.title = this.$t('strings.world');
}
}
news in index.css Code
.cb-container {
flex-direction: column;
}
.cb-title {
width: 100%;
height: 44px;
justify-content: center;
align-items: center;
background-color: #ee742f;
}
text {
color: white;
font-size: 16px;
font-weight: normal;
}
.cb-body {
flex: 1;
}
.cb-body-item {
flex-direction: column;
}
边栏推荐
- Authentique Photoshop 2022 expérience d'achat partage
- How is the network connected?
- 稳压二极管的原理,它有什么作用?
- Efficient exploration | an application practice of ES geographical location query
- Sqlmap advanced use – cookies
- 我与CSDN的一年时光及大学经验分享
- Shandong finds clean energy that can be used by China for 3800 years? You should know the truth first
- 高数基础_函数的奇偶性
- 太上老君的炼丹炉之分布式 Quorum NWR
- 【一起上水硕系列】Day 4
猜你喜欢

用动图讲解分布式 Raft

The e-book "action guide for large organizations to further promote zero code application platform" was officially released!

Cocos学习日记3——api获取节点、组件

赚够钱回老家吗

【批处理DOS-CMD命令-汇总和小结】-外部命令-cmd下载命令、抓包命令(wget)

【UVM入門 ===> Episode_9 】~ 寄存器模型、寄存器模型的集成、寄存器模型的常規方法、寄存器模型的應用場景

Weimeisi new energy rushes to the scientific innovation board: the annual revenue is 1.7 billion, and the book value of accounts receivable is nearly 400million

Why "New Year's Eve", the original memory burst!

Expression of fatherly love

Operate cnblogs metaweblog API
随机推荐
Why is true == "true" true in R- Why TRUE == “TRUE” is TRUE in R?
深入解析 Apache BookKeeper 系列:第三篇——读取原理
Debug through yalc before releasing NPM package
The significance and proof of weak large number theorem
How to recover redis data from snapshot(rdb file) copied from another machine?
哇哦,好丰富呀。
48 pictures | teach you the performance monitoring, pressure testing and tuning of microservices by hand
How to get the difference between two dates rounded to hours
ES 终于可以搜到”悟空哥“了!
Finally, when you open source the applet ~
线程状态变化涉及哪些常用 API
高效探索|ES地理位置查询的一次应用实践
lotus v1.16.0-rc3 calibnet
Loopholes in the missed scanning system of Lvmeng and its repair scheme
全局变量&局部变量
I have used it for six years!
14 bs对象.节点名称.name attrs string 获取节点名称 属性 内容
[Shangshui Shuo series] day 5
【工具分享】一款颜值与技能并重的软件
Cocos学习日记3——api获取节点、组件