detail-progress.vue 806 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <view class="ss-flex ss-col-center">
  3. <view class="progress-title ss-m-r-10"> 已抢{{ percent }}% </view>
  4. <view class="progress-box ss-flex ss-col-center">
  5. <view class="progerss-active" :style="{ width: percent < 10 ? '10%' : percent + '%' }">
  6. </view>
  7. </view>
  8. </view>
  9. </template>
  10. <script setup>
  11. const props = defineProps({
  12. percent: {
  13. type: Number,
  14. default: 0,
  15. },
  16. });
  17. </script>
  18. <style lang="scss" scoped>
  19. .progress-title {
  20. font-size: 20rpx;
  21. font-weight: 500;
  22. color: #ffffff;
  23. }
  24. .progress-box {
  25. width: 168rpx;
  26. height: 18rpx;
  27. background: #f6f6f6;
  28. border-radius: 9rpx;
  29. }
  30. .progerss-active {
  31. height: 24rpx;
  32. background: linear-gradient(86deg, #f60600, #d00500);
  33. border-radius: 12rpx;
  34. }
  35. </style>