当前位置:网站首页>Hongmeng OS development III
Hongmeng OS development III
2022-06-24 07:46:00 【Calm!】
Effect display
Bottom navigation bar

Home page rotation chart

Hot categories

Boutique display

Project structure

Code implementation
Bottom navigation bar
<element name="category" src="./category/category"></element>
<element name="cookbook" src="./cookbook/cookbook"></element>
<element name="map" src="./map/map"></element>
<element name="more" src="./more/more"></element>
<div>
<tabs class="tabs" index="0" vertical="false" on:change="change">
<tab-content class="tab-content" scrollable="true">
<cookbook></cookbook>
<category></category>
<map></map>
<more></more>
</tab-content>
<tab-bar class="tab-bar" mode="fixed">
<div class="tab-item" for="{
{(index,tab) in tabs}}">
<image src="{
{currentSelected === index ? tab.tintIcon : tab.icon}}"></image>
<text>
{
{tab.title}}
</text>
</div>
</tab-bar>
</tabs>
</div>
.container {
flex-direction:column;
justify-content:flex-start;
align-items:center;
}
.tabs {
width:100%;
}
.tab-content {
width:100%;
}
.tab-bar {
height: 50px;
border-top-width: 0.5px;
border-top-color: #ccc;
.tab-item {
flex: 1;
flex-direction: column;
align-items: center;
justify-content: center;
image {
width:22px;
height:22px;
}
text {
font-size:12px;
font_weight:100;
color:#000;
}
}
}
export default {
data: {
tabs:[
{
id:'tab1',
title:' Food collection ',
icon:"/common/images/ Personal center 1.png",
tintIcon:"/common/images/ Personal center .png",
component:"cookbook"
},
{
id:'tab2',
title:' classification ',
icon:"/common/images/ About us 1.png",
tintIcon:"/common/images/ About us .png",
component:"category"
},
{
id:'tab3',
title:' Map ',
icon:"/common/images/ Information Center 1.png",
tintIcon:"/common/images/ Information Center .png",
component:"map"
},
{
id:'tab4',
title:' more ',
icon:"/common/images/ home page 1.png",
tintIcon:"/common/images/ home page .png",
component:"more"
},
],
currentSelected:0
},
change:function(e) {
console.log("Tab Index:"+e.index);
this.currentSelected = e.index
},
}
Home page blog round
<div class="cb-swiper-container">
<swiper>
<image for="{
{list.slice(0,5)}}" src="{
{$item.img}}"></image>
</swiper>
</div>
.cb-swiper-container {
height:240px;
swiper {
width:100%;
image {
width:100%;
height:100%;
object-fit:fill;
}
}
}
export default {
props:{
list:{
type:Array
}
},
onReady(){
console.log(this.list)
}
}
Hot categories
<div class="cb-hc-container">
<div class="cb-hc-title">
<text>
People classify
</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>
.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;
}
// @ts-ignore
import list from '../../../../common/data/cookbook-hotcat.json';
export default {
data:{
list:[]
},
onReady() {
this.list = list
}
}
Boutique display
<div class="cb-top-container">
<div class="cb-top-title">
<text class="title-text">
Excellent talent
</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>
.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;
}
.title-text {
font-size: 22px;
}
.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;
}
export default {
props: {
list: {
type:Array
}
}
}
边栏推荐
- Global and Chinese market of anion sanitary napkins 2022-2028: Research Report on technology, participants, trends, market size and share
- 常见的数组封装
- Shell script for MySQL real-time synchronization of binlog
- Only two lines are displayed, and the excess part is displayed with Ellipsis
- Teach you how to use the reflect package to parse the structure of go - step 2: structure member traversal
- How to realize multi protocol video capture and output in video surveillance system?
- any类备注
- MaxCompute远程连接,上传、下载数据文件操作
- IndexError: Target 7 is out of bounds.
- The seminar on "global IPv6 development and outlook 2020-2021" was held in Beijing
猜你喜欢

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

Alibaba cloud full link data governance

How to turn on win11 notebook power saving mode? How to open win11 computer power saving mode

Cloud development who is the source code of undercover applet

Étalonnage de la caméra (objectif et principe d'étalonnage)

Shader 常用函数

exness:鲍威尔坚持抗通胀承诺,指出衰退是可能的

免费ICP域名备案查接口

语料库数据处理个案实例(读取多个文本文件、读取一个文件夹下面指定的多个文件、解码错误、读取多个子文件夹文本、多个文件批量改名)

2022年PMP项目管理考试敏捷知识点(1)
随机推荐
What challenges does the video streaming media platform face in transmitting HD video?
IndexError: Target 7 is out of bounds.
运行npm run eject报错解决方法
atguigu----15-内置指令
A case of bouncing around the system firewall
js实现查看一个数组对象中是否包含另一个数组对象中的值
Win11 points how to divide disks? How to divide disks in win11 system?
图形技术之坐标转换
面试中的最常被问到的两种锁
火线,零线,地线,你知道这三根线的作用是什么吗?
洛谷 P1051 谁拿了最多奖学金
Teach you how to use the reflect package to parse the structure of go - step 2: structure member traversal
[learn FPGA programming from scratch -41]: vision chapter - Moore's era and Moore's law and the arrival of the post Moore Era
Quickly set up PgSQL for serverless
保留一位小数和保留两位小数
力扣(LeetCode)174. 地下城游戏(2022.06.23)
MySQL case: analysis of full-text indexing
Q & A on cloud development cloudbase hot issues of "Huage youyue phase I"
Unity Culling 相关技术
Experience of Shenzhou computer