一,计算机页面的实现
.wxml代码
<view class="content">
<view class="layout-top">
<view class="screen">168</view>
</view>
<view class="layout-bottom">
<view class="btnGroup">
<view class="item orange">C</view>
<view class="item orange">←</view>
<view class="item orange">#</view>
<view class="item orange">+</view>
</view>
<view class="btnGroup">
<view class="item blue">9</view>
<view class="item blue">8</view>
<view class="item blue">7</view>
<view class="item orange">-</view>
</view>
<view class="btnGroup">
<view class="item blue">6</view>
<view class="item blue">5</view>
<view class="item blue">4</view>
<view class="item orange">×</view>
</view>
<view class="btnGroup">
<view class="item blue">3</view>
<view class="item blue">2</view>
<view class="item blue">1</view>
<view class="item orange">÷</view>
</view>
<view class="btnGroup">
<view class="item blue zero">0</view>
<view class="item blue">.</view>
<view class="item orange">=</view>
</view>
</view>
</view>
.wxss代码
.content{
height: 100%;
top:20%;
display: flex;
flex-direction: column;
align-items: center;
background-color: #ccc;
font-family: "Microsoft YaHei";
overflow-x: hidden;
}
.layout-top{
width: 100%;
margin-bottom: 30rpx;
}
.layout-bottom{
width: 100%;
}
.screen{
text-align: right;
width: 100%;
line-height: 130rpx;
padding: 0 10rpx;
font-weight: bold;
font-size: 60px;
box-sizing: border-box;
border-top: 1px solid #fff;
}
.btnGroup{
display: flex;
flex-direction: row;
flex: 1;
width: 100%;
height: 4rem;
background-color: #fff;
}
.item{
width: 25%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
margin-top: 1px;
margin-right: 1px;
}
.zero{
width: 50%;
}
.orange{
color: #fef4e9;
background: #f78d1d;
font-weight: bold;
}
.blue{
color: #d9eef7;
background-color: #0095cd;
}
效果图
![](https://i-blog.csdnimg.cn/blog_migrate/f208e4a545b822bf9d7b74183e1b1b4e.png)
二,网页的实现
.wxml代码
<view class="top">
<view class="ea">行业趋势指南</view>
<view class="ea">年度趋势指南</view>
</view>
<view class="xhx"></view>
<view class="bt">
<view class="bt1">最新发布</view>
<view class="bt2">单品</view>
<view class="bt2">色彩</view>
<view class="bt2">风格</view>
<view class="bt2">细节</view>
<view class="bt2">面料</view>
</view>
<view>
<view class="w">
<view class="tp1"></view>
<view class="tp1"></view>
</view>
<text>\n</text>
<view class="w">
<view class="tp1"></view>
<view class="tp1"></view>
</view>
<text>\n</text>
<view class="w">
<view class="tp1"></view>
<view class="tp1"></view>
</view>
</view>
.wxss代码
.top{
display:flex;
height: 40px;
width: 300px;
}
.ea{
margin: 10px;
height: 40px;
width: 200px;
text-align: center;
}
.xhx{
height: 2px;
width: 500px;
background: #4F2F4F;
}
.bt{
display:flex;
height: 25px;
width: 320px;
}
.bt1{
height: 17px;
width: 120px;
font-size: 14px;
text-align: center;
}
.bt1:hover{
border-bottom: 3px solid black;
}
.bt2:hover{
border-bottom: 3px solid black;
}
.bt2{
height: 17px;
width: 80px;
font-size: 14px;
text-align: center;
}
.w{
width: 350px;
height: 200px;
display: flex;
}
.tp1{
height: 200px;
width: 145px;
margin: 5px;
border: 2px solid blue;
}
.app.json代码
"window": {
"navigationBarBackgroundColor": "#CFB53B",
"navigationBarTextStyle":"white",
"navigationBarTitleText": "趋势"
}
效果图
![](https://i-blog.csdnimg.cn/blog_migrate/79093fac95136afcac96cf09910031df.png)