漂亮的前端物流显示

物流样式

  <div className="logistics-flow lgs-p-re">
                            <ul className="logistics">
                                {
                                    flowList.map((item, index) => {
                                        return <li key={index}>
                                            {
                                                index === 0 ? <span className="top-white"/> : ''
                                            }
                                            {
                                                index === flowList.length - 1 ?
                                                    <span className="bottom-white"/> : ''
                                            }
                                            <span className={`icon ${index === 0 ? 'on' : ''}`}/>
                                            <span className={index === 0 ? 'first' : ''}>
                                            {item.status}
                                        </span>
                                            <span
                                                className={index === 0 ? 'first' : ''}>
                                            {item.time}
                                        </span>
                                        </li>
                                    })
                                }
                            </ul>
                        </div>

logistics = [ ]为一个物流查询结果,属性为一个数组

css样式

li{
    list-style-type:none;
}
.flow-list {
    margin-top: 20px;
    padding: 0 10px 0 20px;
    background-color: #fff;
}

.logistics-flow {
    /*margin-top: 20px;*/
    padding: 5px 10px 0;
    border-left: 2px solid #f1f3f7;
}

.lgs-p-re {
    position: relative;
}


.logistics li {
    position: relative;
    padding: 15px 10px;
    border-bottom: 1px dotted #e8e5e5;
}

.logistics li .icon {
    position: absolute;
    /* top: 26 %;*/
    left: -29px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dbe0eb;
}

.logistics li .top-white {
    position: absolute;
    top: -5%;
    left: -17.5px;
    width: 12px;
    height: 20%;
    background-color: #fff;
}

.logistics li .bottom-white {
    position: absolute;
    top: 27px;
    left: -17.5px;
    width: 12px;
    height: calc(100% - 26px);
    background-color: #fff;
}

.logistics li .icon.on {
    background-color: #09B687;
    top: 14%;
    width: 18px;
    height: 18px;
    left: -32px;
    border: solid #d5f2e5 2px;
}

.logistics li span {
    display: block;
    font-size: 14px;
    color: #a1a5b1;
}

.logistics li span:last-child {
    color: #d0d2d7;
}

.logistics li span.first {
    color: #09B687;
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值