实现圆型百分比进度条

先上效果

 直接上代码:

<view class="scoreBox">
	<view class="score">45</view>
	<view class="scoreNmae">简历分</view>
</view>
.scoreBox {
	width: 104rpx;
	height: 104rpx;
	border-radius: 50%;
	border: 10rpx solid rgba(255, 255, 255, 0.2);
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	position: relative;
	.score {
		font-size: 32rpx;
		color: #fff;
		text-align: center;
	}
	.scoreNmae {
		font-size: 32rpx;
		transform: scale(0.5);
		color: #fff;
	}
}
.scoreBox:before {
	content: '';
	position: absolute;
	top: -10rpx;
	left: -10rpx;
	width: 42rpx;    //宽度的大小 是 原宽度大小 104rpx  * 40%
	height: 104rpx;
	display: block;
	border-radius: 100% 0 0 100%/50%;   //半圆
	border: 10rpx solid #fff;
	border-right: none;    //因此右边距
}

上面注释的是关键;计算 width 可以改为动态配置的。

最终效果:

 可能还有点瑕疵,如果有大佬有更好的解决方案,欢迎留言交流。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值