当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

ES can finally find brother Wukong!

有了 MySQL 为什么要用 NoSQL?

Rotation vector (rotation matrix) and Euler angle

Several good weather plug-ins

Classic paper in the field of character recognition: aster

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

Qcom--lk phase I2C interface configuration scheme -i2c6

【xxl-job】池塘水绿风微暖,记得玉真初见面
![[Yu Yue education] engineering testing technology reference of Wenhua University](/img/69/50a8786ea062a541df9e07c1e16db5.jpg)
[Yu Yue education] engineering testing technology reference of Wenhua University

Large funds support ecological construction, and Plato farm builds a real meta universe with Dao as its governance
随机推荐
Expression of fatherly love
Conditional grouping with $exists inside $cond
Simple and complete steps of vivado project
Astronomers may use pulsars to detect merged supermassive black holes
我的处女作杀青啦!
哇哦,好丰富呀。
Shell命令学习
Redirect to previous page after login? PHP - Redirecting to previous page after login? PHP
有了 MySQL 为什么要用 NoSQL?
SQL query, if value is null then return 1 - SQL query, if value is null then return 1
高效探索|ES地理位置查询的一次应用实践
[Yu Yue education] engineering testing technology reference of Wenhua University
基於 KubeSphere 的分級管理實踐
What is the new business model of Taishan crowdfunding in 2022?
Operate cnblogs metaweblog API
Blue Bridge Cup SCM module code (nixie tube) (code + comments)
I have used it for six years!
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热报名中
Shandong finds clean energy that can be used by China for 3800 years? You should know the truth first
[introduction to UVM== > episode_9] ~ register model, integration of register model, general methods of register model, application scenarios of register model