1.简易计算机的页面布局
//.wxml
<view class="content">
<view class="layout-top">
<view class="screen">3*8</view>
</view>
<view class="layout-bottom">
<view class="btnGroup">
<view class="item orange" bindtap="clickBtn" id="{{idc}}">С</view>
<view class="item orange" bindtap="clickBtn" id="{{idb}}">←</view>
<view class="item orange" bindtap="clickBtn" id="{{idb}}">#</view>
<view class="item orange" bindtap="clickBtn" id="{{idadd}}">+</view>
</view>
<view class="btnGroup">
<view class="item blue" bindtap="clickBtn" id="{{id9}}">9</view>
<view class="item blue" bindtap="clickBtn" id="{{id8}}">8</view>
<view class="item blue" bindtap="clickBtn" id="{{id7}}">7</view>
<view class="item orange" bindtap="clickBtn" id="{{idj}}">-</view>
</view>
<view class="btnGroup">
<view class="item blue" bindtap="clickBtn" id="{{id6}}">6</view>
<view class="item blue" bindtap="clickBtn" id="{{id5}}">5</view>
<view class="item blue" bindtap="clickBtn" id="{{id4}}">4</view>
<view class="item orange" bindtap="clickBtn" id="{{idx}}">×</view>
</view>
<view class="btnGroup">
<view class="item blue" bindtap="clickBtn" id="{{id3}}">3</view>
<view class="item blue" bindtap="clickBtn" id="{{id2}}">2</view>
<view class="item blue" bindtap="clickBtn" id="{{id1}}">1</view>
<view class="item orange" bindtap="clickBtn" id="{{iddiv}}">÷</view>
</view>
<view class="btnGroup">
<view class="item blue zero" bindtap="clickBtn" id="{{id0}}">0</view>
<view class="item blue" bindtap="clickBtn" id="{{idd}}">.</view>
<view class="item orange" bindtap="clickBtn" id="{{ide}}">=</view>
</view>
</view>
</view>
//.wxss
.content {
height: 100%;
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: 260rpx;
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: 5rem;
background-color: #fff;
}
.item {
width:25%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
margin-top: 1px;
margin-right: 1px;
}
.item:active {
background-color: #ff0000;
}
.zero{
width: 50%;
}
.orange {
color: #fef4e9;
background: #f78d1d;
font-weight: bold;
}
.blue {
color:#d9eef7;
background-color: #4ac1df;
}
.iconBtn{
display: flex;
}
.icon{
display: flex;
align-items: center;
width:100%;
justify-content: center;
}
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
2. 操作题
//.wxml
<view class="cont1">
<view class="item1">行业趋势指南V</view>
<view class="item1">年度趋势指南V</view>
</view>
<view class="cont2">
<view class="item2">最新发布</view>
<view class="item2">单品</view>
<view class="item2">色彩</view>
<view class="item2">风格</view>
<view class="item2">细节</view>
<view class="item2">面料</view>
</view>
<view class="left">
<image src="/images/index.jpg"/>
<image src="/images/index1.jpg"/>
<image src="/images/index2.jpg"/>
</view>
<view class="right">
<image src="/images/index3.jpg"/>
<image src="/images/index4.jpg"/>
<image src="/images/index5.jpg"/>
</view>
//.wxss
.cont1{
display: flex;
width: 1000px;
height: 40px;
border-bottom: 1px solid #000;
}
.item1{
font-size: 16px;
margin: 10px;
padding-left: 30px;
}
.cont2{
display: flex;
width: 1000px;
height: 40px;
}
.item2{
font-size: 18px;
padding-right: 10px;
margin-left: 10px;
}
.left{
float: left;
width: 170px;
height: 500px;
}
.right{
float: right;
width: 190px;
height: 500px;
}
image{
margin-left: 10px;
margin-bottom: 5px;
width: 170px;
height:170px ;
}