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.

132 lines
3.1 KiB

  1. <template>
  2. <div class="group">
  3. <div class="tw-text-[16px] tw-text-[#9c9c9c] tw-mb-[20px]">
  4. 大大會提供每實收攤位(贈攤不計列)單件 7 噸內至多 3 件免費服務請詳實填寫逾期申請或現場追加恕不受理
  5. </div>
  6. <div class="tw-grid tw-grid-cols-[199px_auto] tw-gap-[15px]">
  7. <div class="tw-text-[16px] tw-text-black">
  8. 實收攤位數 <span class="tw-text-[12px]">(9平方米/攤位)</span><span class="tw-text-[#ef5a5a]">*</span>
  9. </div>
  10. <div class="tw-flex tw-justify-between tw-items-center tw-max-w-[165px]">
  11. <!-- <div class="t12 tw-mr-[35px] tw-text-neutrals-900 tw-hidden md:tw-block md:t16 md:tw-font-normal">
  12. ${{ price.toLocaleString() }} {{ currency }}
  13. </div> -->
  14. <button :class="[
  15. 'custom-button button-reduce tw-text-transparent tw-p-[6px] tw-rounded-[8px] tw-max-w-[24px] tw-max-h-[24px] tw-mr-[16px] md:tw-max-w-[30px] md:tw-max-h-[30px] md:tw-mr-[42px]',
  16. value == 0 ? 'tw-bg-neutrals-200' : 'tw-bg-primary-default',
  17. ]" @click="reduce()">
  18. reduce
  19. </button>
  20. <div class="tw-min-w-[24px] tw-text-center md:t18 md:tw-font-normal">
  21. {{ value }}
  22. </div>
  23. <button :class="[
  24. 'custom-button button-add tw-text-transparent tw-p-[6px] tw-rounded-[8px] tw-max-w-[24px] tw-max-h-[24px] tw-ml-[16px] md:tw-max-w-[30px] md:tw-max-h-[30px] md:tw-text-medium md:tw-ml-[42px]',
  25. ]" @click="add()">
  26. add
  27. </button>
  28. </div>
  29. </div>
  30. <div v-if="validation.length == false" style="font-size: 16px; color: #ef5a5a; margin-top: 10px; margin-left: 90px;">{{ $t("Required.") }}</div>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'selectExhibitionBooth',
  36. components: {
  37. },
  38. props: {
  39. },
  40. data() {
  41. return {
  42. value: 0,
  43. validation:{
  44. length: true
  45. },
  46. errors: null,
  47. };
  48. },
  49. watch: {
  50. value: {
  51. handler: function () {
  52. this.$emit('booth-select', this.value);
  53. },
  54. },
  55. },
  56. methods: {
  57. add() {
  58. this.value += 1;
  59. },
  60. reduce() {
  61. if (this.value !== 0) {
  62. this.value -= 1;
  63. }
  64. },
  65. validators() {
  66. if(this.value == 0) {
  67. this.validation.length = false;
  68. } else{
  69. this.validation.length = true;
  70. }
  71. this.errors = Object.entries(this.validation).filter(
  72. (e) => e[1] == false
  73. );
  74. if (this.errors.length > 0) {
  75. return false;
  76. } else {
  77. return true;
  78. }
  79. }
  80. },
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .custom-button {
  85. background-position: center;
  86. background-repeat: no-repeat;
  87. background-size: 12px;
  88. }
  89. .button {
  90. &-reduce {
  91. background-image: url("~/assets/svg/reduce.svg");
  92. background-color: #e5e5e5;
  93. }
  94. &-add {
  95. background-image: url("~/assets/svg/add.svg");
  96. background-color: #f48800;
  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 reverse;
  104. }
  105. @keyframes bounce-in {
  106. 0% {
  107. opacity: 0;
  108. }
  109. 50% {
  110. opacity: 0.5;
  111. }
  112. 100% {
  113. opacity: 1;
  114. }
  115. }
  116. </style>