2021-07-12

练练手

react中进度条的思考参考:https://blog.csdn.net/weixin_34297300/article/details/91381853

import React,{Component} from "react"
import './index.css'
export default class Treasure extends Component{
    constructor(props){
        super(props)
        this.state={}
    }
    render(){
        return(
            <div className="treasure">
                <div className="content">
                <span className="title">快乐手机</span>
                <div className="treasureShow"> 
                 <div className="treasureImg1">
                     <img src="" alt="" className="treasureImg"></img>
                     <span className="price">价值 ¥8999</span>
                 </div>
                 <div className="introduce">
                 <span className="proTitle">FindX2 Pro感官5G手机</span>
                 <div className="progress"><div className="bar"/></div>
                 <span className="progressValue">50%</span>
                 <span className="scale">已参与5000/10000开奖</span>
                 <div className="creaditBtn"><span>仅需999积分</span></div>
                 </div>
                </div>
                </div>
            </div>
        )
    }
}
.treasure{
    padding: 0 16px;
}
.content{
   height:150px;
   background: #f1bdbd;
}
.title{
    display: block;
    line-height: 20px;
    line-height: 20px;
    font-size:18px;
}
.treasureShow{
    display: flex;
    height: 100px;
    width: 328px;
}
.treasureImg{
    width: 100px;
    height: 100px;
    background: #e6f1bd;
    border-radius: 12px;
    margin-right: 12px;
}
.price{
    display: block;
    position: absolute;
    top:23px;
    left:20px;
    height: 16px;
    width: 70px;
    line-height: 16px;
    background: #f18408;
    color:#fff;
    font-size: 12px;
    border-radius: 12px;
}
.proTitle{
    font-size:16px;
}
.progress{
    display: inline-block;
    margin-top: 8px;
    width: 150px;
    height: 4px;
    background: #fff;
    border-radius: 2px;
}
.bar{
    width: 50%;
    height: 4px;
    background: #f37813;
    border-radius: 2px;
}
.progressValue{
    font-size: 12px;
    margin-left:12px; 
}
.scale{
    display: inline-block;
    font-size:12px
}
.creaditBtn{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 30px;
    background: #f37813;
    border-radius: 15px;
    color:#fff;
    margin-top: 8px;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值