微信小程序:纵向步骤条

绿色完成图表引用的vant-weapp组件的图标组件

 wxml代码

   <view class="stepBox" wx:if="{{pitem.open}}">
     <view class="box">
       <view class="{{item.status ==='1' ? 'greenSigleStep' : 'sigleStep'}}" wx:for="{{steps}}" wx:for-item="item" wx:key="text">
         <view class="topShelter" wx:if="{{item.first}}"></view>
         <view class="gray" wx:if="{{item.status === '0'}}"></view>
         <view class="green" wx:if="{{item.status === '1'}}">
           <van-icon name="checked" size="24rpx" color="#00cf95"/>
         </view>
         <view class="stepConBox" style="color: {{item.status ==='1' ? '#00cf95' : '#969799'}}">
           <view>第{{item.text}}期供应</view>
           <view class="timebox">实供时间:{{ item.plan }}</view>
           <view class="timebox">应供时间:{{ item.desc}}</view>
         </view>
         <view class="bottomShelter" wx:if="{{item.end}}"></view>
       </view>
     </view>
   </view>

 wxss代码

.stepBox{
  padding: 8rpx 32rpx 32rpx 16rpx;
}
.box{
  box-sizing: border-box;
  width: 100%;
  padding-left: 20rpx;
}
.stepsList{
  box-sizing: border-box;
  width: 100%;
}
.sigleStep{
  box-sizing: border-box;
  width: 100%;
  padding: 0 0 0 28rpx;
  border-left: 4rpx solid #c2c3c4;
  position: relative;
}
.greenSigleStep{
  box-sizing: border-box;
  width: 100%;
  padding: 0 0 0 28rpx;
  border-left: 4rpx solid #00cf95;
  position: relative;
}
.topShelter{
  width: 20rpx;
    height: 46rpx;
    background-color: #ffffff;
    position: absolute;
    left: -10rpx;
    top: 0;
    z-index: 1;
}
.bottomShelter{
  width: 20rpx;
  height: 122rpx;
  background-color: #ffffff;
  position: absolute;
  left: -10rpx;
  bottom: 0;
  z-index: 1;
}
.gray{
  width: 10rpx;
  height: 10rpx;
  border-radius: 50%;
  background-color: #969799;
  position: absolute;
  top: 34rpx;
  left: -6rpx;
}
.green{
  position: absolute;
  top: 18rpx;
  left: -14rpx;
  z-index: 2;
  background-color: #fff;
}
.stepConBox{
  box-sizing: border-box;
  padding: 20rpx 20rpx 20rpx 0;
  color: #969799;
  font-size: 28rpx;
  line-height: 36rpx;
  border-bottom: 1rpx solid #fafafa;
}
.timebox{
  margin-top: 8rpx;
  font-size: 24rpx;
}

JS代码

 steps: [
          {
            text: '1',
            desc: "2022-07-12",
            plan: "2022-07-12",
            status: '1',
            first: true,
          },
          {
            text: '2',
            desc: "2022-07-12",
            plan: "2022-07-12",
            status: '1'
          },{
            text: '3',
            desc: "2022-07-12",
            plan: "2022-07-12",
            status: '0'
          },
          {
            text: '4',
            desc: "2022-07-12",
            plan: "2022-07-12",
            status: '0',
            end: true,
          }
        ],

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值