开关选择器switch
wxml文件
<view class="content">
<view>开启心率监测
<switch class="con" type='switch' checked='true'>
</switch>
</view>
</view>
wxss文件
.content>view {
background: -webkit-linear-gradient(left, #329d9c, #205072);
display: flex;
margin-left: -20rpx;
width: 750rpx;
height: 100rpx;
line-height: 100rpx;
box-shadow: powderblue;
left: 10rpx;
margin-top: 30rpx;
padding-left: 70rpx;
border-radius: 20rpx;
opacity: 0.8;
font-size: 40rpx;
}
.con {
display: inline-block;
margin-left: 310rpx;
}
成果展示——