countdown-box.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="countdown-box">
  3. <view class="hour">{{ countDownTime.hh }}</view> <text>:</text>
  4. <view class="minute">{{ countDownTime.mm }}</view> <text>:</text>
  5. <view class="second">{{ countDownTime.ss }}</view> <text>后结束</text>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. props: {
  11. countDownTime: {
  12. type: Object,
  13. default: () => ({
  14. dd: '00',
  15. hh: '00',
  16. mm: '00',
  17. ss: '00'
  18. })
  19. }
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. .flex-center-box {
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. }
  29. .countdown-box {
  30. @extend .flex-center-box;
  31. .hour,
  32. .minute,
  33. .second {
  34. text-align: center;
  35. align-items: center;
  36. width: 48rpx;
  37. height: 48rpx;
  38. background: #ff457b;
  39. border-radius: 50%;
  40. color: #fff;
  41. font-size: 26rpx;
  42. line-height: 48rpx;
  43. }
  44. text {
  45. margin: 0 8rpx;
  46. font-size: 30rpx;
  47. color: #ff457b;
  48. font-size: 26rpx;
  49. &:last-child {
  50. margin-right: 0;
  51. margin-left: 16rpx;
  52. color: #333333;
  53. font-size: 30rpx;
  54. }
  55. }
  56. }
  57. </style>