环形进度条-uniapp-vue

本文详细描述了一个使用Vue编写的交互式UI组件,展示了如何通过CSS动画和条件渲染实现签字率的百分比展示,以及圆圈进度条的设计与实现。
摘要由CSDN通过智能技术生成
<view class="circle-out-box">
        <view class="circle-inner-box">
          <view
            class="circle"
            :class="{ 'clip-auto': baseForm.detailShowVO.rate > 50 }"
          >
            <view
              class="percent left"
              :style="renderLeftRate(baseForm.detailShowVO.rate)"
            ></view>
            <view
              class="percent right"
              :class="{ wth0: baseForm.detailShowVO.rate < 50 }"
            ></view>
          </view>
          <view class="circle-num-box">
            <view>
              <view class="circle-sign-box">签字率</view>
              <view class="circle-percent-box"
                >{{ baseForm.detailShowVO.rate || 0 }}%</view
              >
            </view>
          </view>
        </view>
      </view>
       renderLeftRate(percent) {
  return `transform: rotate(${3.6 * percent}deg);`;
},
        .circle-out-box {
      width: 148rpx;
      height: 148rpx;
      position: relative;

      .circle-inner-box,
      .circle,
      .percent {
        position: absolute;
        width: 148rpx;
        height: 148rpx;
        border-radius: 50%;
      }

      .circle-inner-box {
        // top: 74rpx;
        // left: 74rpx;
        background-color: #f5f6f8;
      }

      .circle {
        box-sizing: border-box;
        border: 14rpx solid #f5f6f8;
        clip: rect(0, 148rpx, 148rpx, 74rpx);
      }

      .clip-auto {
        clip: rect(auto, auto, auto, auto);
      }

      .percent {
        box-sizing: border-box;
        top: -14rpx;
        left: -14rpx;
      }

      .left {
        transition: transform ease;
        border: 14rpx solid #ff851a;
        clip: rect(0, 74rpx, 148rpx, 0);
      }

      .right {
        border: 14rpx solid #ff851a;
        clip: rect(0, 148rpx, 148rpx, 74rpx);
      }

      .wth0 {
        width: 0;
      }

      .circle-num-box {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 120rpx;
        height: 120rpx;
        box-sizing: border-box;
        text-align: center;
        font-size: 28rpx;
        border-radius: 50%;
        background-color: #fff;
        z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;

        .circle-sign-box {
          width: 100%;
          text-align: center;
          font-weight: 700;
          font-size: 28rpx;
          color: #ff851a;
        }

        .circle-percent-box {
          margin-top: 6rpx;
          font-weight: 500;
          font-size: 24rpx;
          color: #ff851a;
          line-height: 34rpx;
        }
      }
    }

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值