card-title.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="card-title" :class="isSpecial=== true ? 'special' :''">
  3. <view class="card-title-icon"></view>
  4. <view class="card-title-text">{{numerator}}/{{denominator}}</view>
  5. <view class="card-title-icon"></view>
  6. </view>
  7. </template>
  8. <script setup>
  9. const props = defineProps({
  10. numerator: {
  11. type: [String, Number],
  12. default: 0
  13. },
  14. denominator: {
  15. type: [String, Number],
  16. default: 0
  17. },
  18. isSpecial: {
  19. type: Boolean,
  20. default: false
  21. }
  22. })
  23. </script>
  24. <style lang="scss" scoped>
  25. .card-title {
  26. display: flex;
  27. justify-content: space-between;
  28. width: 54%;
  29. height: 52rpx;
  30. margin: 0 auto;
  31. padding: 0 24rpx;
  32. font-size: 32rpx;
  33. color: #1869F6;
  34. background: #DBE8FF;
  35. border-radius: 0rpx 0rpx 24rpx 24rpx;
  36. .card-title-icon {
  37. width: 16rpx;
  38. height: 16rpx;
  39. margin-top: 14rpx;
  40. border-radius: 50%;
  41. background: #1869F6;
  42. box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(12, 54, 128, 0.45);
  43. }
  44. .card-title-text {
  45. margin: auto;
  46. }
  47. }
  48. .special {
  49. background: none;
  50. color: #fff;
  51. .card-title-icon {
  52. background: #fff;
  53. box-shadow: 0;
  54. }
  55. }
  56. </style>