小程序的时间轴(简约版)

时间轴

在这里插入图片描述

wxml

<view class="time-axis">
  <view class="ivestment-c">
    <view class="ivestment-i" wx:for="{{3}}" wx:key="index" wx:for-item="item" wx:for-index="index">
      <view class="invest-l">
        <view class="invest-b invest-line">
          <!-- <text decode="{{true}}" space="{{true}}">&nbsp;</text> -->
        </view>
        <view class="demo-flex-1 date">123123123</view>
      </view>
      <view class="invest-l">
        <view class="invest-b invest-line2">
          <!-- <text decode="{{true}}" space="{{true}}">&nbsp;</text> -->
        </view>
        <view class="demo-flex-1">
          <view wx:for="{{3}}" class="card-box">
            <view>123123</view>
            <view>456</view>
            <view>456</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>

wxss

.time-axis{
  padding: 0 30rpx;
  box-sizing: border-box;
}
.ivestment-c{
  /* position: relative; */
  background-color: #fff;
  width: 100%;
  max-height: 500px;
  overflow-y: auto;
  height: auto;
  box-sizing:border-box;
}
/* .ivestment-i{
  position: relative;  
} */
.invest-l{
  width: 100%;  
  display: flex;
  align-items: center;
  text-align: left;  
  position: relative;
}
 
.demo-flex-1{
  flex:1;
  margin-left: 40rpx;
}
.invest-b{
  position: absolute;
  top:0;
  left: 0;
  width: 20rpx;
  height: 100%;
  text-align: center;
}
.invest-line::before{
  position: absolute;
  display: inline-block;
  top:50%;
  left: 50%;
  content: " ";
  transform: translate(-9rpx,-9rpx);
  width:18rpx;
  height:18rpx;
  background:#398af4;
  border-radius:50%;
  z-index: 10;
}
.invest-line::after{
  position: absolute;
  display: inline-block;
  top: 0;
  left: 50%;
  content: " ";
  margin-left: -1rpx;
  width: 2rpx;
  height: 100%;
  background-color: #398af4;
  z-index: 5;
}
.invest-line2::after{
  position: absolute;
  display: inline-block;
  top: 0;
  left: 50%;
  content: " ";  
  width: 2rpx;
  margin-left: -1rpx;
  height: 100%;
  background-color: #398af4;
  z-index: 5;
}
.ivestment-i:nth-child(1) .invest-line::after{
  top: 36rpx;
}
.card-box{
  margin-bottom: 20rpx;
  border: 1rpx solid #ccc;
}
.date{
  height: 56rpx;
  line-height: 56rpx;
}

一个可以随意改动的时间轴 – 大宝

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值