detail-progress.vue 843 B

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