要实现的效果如图:

代码如下:

<template>
<div class="page">
<div class="title">我要开店</div>
<p style="padding-top:25px;">一个身份只能开一家店;开店后店铺无法注销;申请到正式开通预计需1-3个工作日。了解更多请看
<el-button type="text">开店规则必看</el-button>
</p>
<div class="steps">
<div
v-for="(item,index) in process"
class="step step_r"
:class="{active:($route.query.step || 1) == (index+1)}"
>
<div style="position:absolute;right:-42px;height:80px;width:80px;overflow:hidden;">
<div class="rotateBox"></div>
</div>
<div class="step_b">
<div class="num">{{index+1}}</div>
<div class="info">
<p class="up">{{item.step}}</p>
<p class="down">{{item.desc}}</p>
</div>
</div>
</div>
</div>
<div>
</div>
</div>
</template>
CSS代码如下:
<style lang='scss' scoped>
.page {
height: 260px;
width: 100%;
.title {
width: 105px;
height: 37px;
font-size: 26px;
font-family: PingFangSC-Medium;
font-weight: 500;
color: #333333;
line-height: 37px;
padding: 34px 0;
}
.steps {
width: 100%;
display: flex;
margin-top: 17px;
zoom: 1;
}
.steps::after {
content: ".";
display: block;
clear: both;
visibility: hidden;
font-size: 0;
height: 0;
line-height: 0;
}
.step {
flex: 1;
width: 320px;
height: 80px;
background: #E4F0FD;
position: relative;
.step_b {
width: 230px;
margin: 7px auto 7px 40px;
display: flex;
.num {
width: 20px;
height: 67px;
font-size: 48px;
font-family: PingFangSC-Regular;
font-weight: 400;
color: #666666;
line-height: 67px;
margin-right: 20px;
}
.info {
height: 37px;
margin-top: 15px;
.up {
width: 84px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular;
font-weight: 400;
color: #666666;
line-height: 20px;
}
.down {
height: 17px;
font-size: 12px;
font-family: PingFangSC-Regular;
font-weight: 400;
color: #888888;
line-height: 17px;
}
}
}
}
//旋转的小方形盒子
.rotateBox {
content: "";
border:10px solid #fff;
border-bottom: none;
border-left: none;
background-color: #E4F0FD;
height: 68px;
width: 68px;
position: absolute;
display: block;
top: 6px;
right: 15px;
z-index: 10;
transform:rotate(45deg);
}
.step_l {
margin-right: 0;
}
.active {
background: #75B0DF !important;
.num {
color: #FFFFFF !important;
}
.up {
color: #FFFFFF !important;
}
.down {
color: #0E58AF !important;
}
}
//被激活的步骤条的样式
.active .rotateBox {
background-color: #75B0DF;
content: "";
border: 10px solid #fff;
border-bottom: none;
border-left: none;
height: 68px;
width: 68px;
position: absolute;
display: block;
top: 6px;
right: 15px;
z-index: 10;
transform:rotate(45deg);
// -ms-transform:rotate(45deg); /* IE 9 */
// -moz-transform:rotate(45deg); /* Firefox */
// -webkit-transform:rotate(45deg); /* Safari 和 Chrome */
// -o-transform:rotate(45deg); /* Opera */
}
//最后一步取消向右箭头
.step:last-child .rotateBox{
content: "";
border: none;
height: 0;
width: 0;
z-index: 11;
}
}
</style>
版权声明:本文为weixin_42414668原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。