You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.8 KiB

2 years ago
  1. <template>
  2. <div
  3. class="price-info tw-p-5 tw-mb-[20px] tw-bg-neutrals-0 tw-rounded-xl tw-hidden xl:tw-block"
  4. >
  5. <h4>
  6. {{ info.title }}
  7. </h4>
  8. <div class="element collapse tw-my-[12px]">
  9. <div
  10. :class="[
  11. 'label',
  12. 'tw-body-4',
  13. 'tw-mb-[12px]',
  14. 'tw-cursor-pointer',
  15. 'service-info',
  16. show ? 'show' : 'hide',
  17. ]"
  18. @click="show = !show"
  19. >
  20. {{ $t("Package Detail") }}
  21. </div>
  22. <Transition name="bounce">
  23. <div v-if="show" class="content tw-body-4">
  24. {{ info.detail }}
  25. </div>
  26. </Transition>
  27. </div>
  28. <div
  29. class="element tw-flex tw-justify-between tw-items-center tw-flex-nowrap tw-my-[12px]"
  30. >
  31. <div class="label tw-body-4">{{ $t("Service Date") }}</div>
  32. <div class="content tw-body-4">
  33. {{ info.date }}
  34. </div>
  35. </div>
  36. <div
  37. class="element tw-flex tw-justify-between tw-items-center tw-flex-nowrap tw-my-[12px]"
  38. >
  39. <div class="label tw-body-4">{{ $t("Quantity") }}</div>
  40. <div class="content tw-body-4">{{ info.quantity }}</div>
  41. </div>
  42. <div
  43. class="element total tw-flex tw-justify-between tw-items-center tw-flex-nowrap tw-pt-[12px] tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200"
  44. >
  45. <div class="label tw-body-4 tw-text-black tw-font-bold">
  46. {{ $t("Total")
  47. }}<span class="tw-text-neutrals-400 tw-font-medium tw-ml-[4px]">{{
  48. $t("(Tax included)")
  49. }}</span>
  50. </div>
  51. <div class="content tw-body-4 tw-font-bold">
  52. ${{ info.total.toLocaleString() + currency}}
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. export default {
  59. name: "PriceInfo",
  60. props: {
  61. info: {
  62. type: Object,
  63. },
  64. currency:{
  65. type: String,
  66. }
  67. },
  68. data() {
  69. return {
  70. show: false,
  71. };
  72. },
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .service-info {
  77. position: relative;
  78. &::after {
  79. content: "";
  80. display: inline-block;
  81. position: absolute;
  82. right: 0;
  83. top: 0;
  84. background-image: url("~/assets/svg/down-arrow.svg");
  85. background-size: 100%;
  86. background-position: right center;
  87. background-repeat: no-repeat;
  88. width: 10px;
  89. height: 6px;
  90. transition: all 0.2s linear;
  91. }
  92. &.show {
  93. &::after {
  94. transition: all 0.2s linear;
  95. transform: rotate(180deg);
  96. }
  97. }
  98. }
  99. .bounce-enter-active {
  100. animation: bounce-in 0.3s ease-out;
  101. }
  102. .bounce-leave-active {
  103. animation: bounce-in 0.3s cubic-bezier(1, 0.5, 0.8, 1) reverse;
  104. }
  105. @keyframes bounce-in {
  106. 0% {
  107. opacity: 0;
  108. transform: translateY(-10px);
  109. }
  110. 50% {
  111. opacity: 0.5;
  112. transform: translateY(-5px);
  113. }
  114. 100% {
  115. opacity: 1;
  116. transform: translateY(0);
  117. }
  118. }
  119. </style>