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.

160 lines
4.4 KiB

2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="invoice tw-p-5 tw-mb-[20px] tw-bg-neutrals-0 tw-rounded-xl">
  3. <h3
  4. :class="[
  5. 'collapse',
  6. 't16',
  7. 'tw-relative',
  8. 'tw-cursor-pointer',
  9. 'xl:tw-text-[18px]',
  10. show ? 'show' : 'hide',disabled
  11. ? 'disabled' : '',
  12. disabled ? 'tw-text-neutrals-300' : 'tw-text-black',
  13. ]"
  14. @click="show = !show"
  15. >
  16. {{ "電子發票/收據" }}
  17. </h3>
  18. <Transition name="bounce">
  19. <div v-show="show" class="tw-mt-[32px] md:tw-ml-[60px]">
  20. <div class="element tw-mb-[20px]">
  21. <div class="t16">{{ "是否開立統編?" }}</div>
  22. </div>
  23. <div class="element tw-w-max tw-flex tw-items-center">
  24. <input id="true" type="radio" value="true" v-model="method" />
  25. <label for="true" class="t16 tw-font-normal"
  26. ><span>{{ "是" }}</span></label
  27. >
  28. </div>
  29. <Transition name="bounce">
  30. <div v-show="method == 'true'">
  31. <div
  32. class="card-info tw-grid tw-grid-cols-1 tw-gap-x-[20px] tw-gap-y-[20px] tw-ml-[40px] tw-mt-[20px] tw-max-w-[630px] md:tw-grid-cols-2"
  33. >
  34. <div class="element tw-flex tw-flex-col">
  35. <label class="tw-mb-[10px]"
  36. ><span
  37. >買受人公司抬頭<span class="required">*</span></span
  38. ></label
  39. >
  40. <input id="Buyer" type="text" />
  41. </div>
  42. <div class="element tw-flex tw-flex-col">
  43. <label class="tw-mb-[10px]"
  44. ><span>統一編號<span class="required">*</span></span></label
  45. >
  46. <input
  47. id="UniformNumbers"
  48. type="text"
  49. value=""
  50. class="tw-text-center"
  51. />
  52. </div>
  53. <div class="element tw-flex tw-flex-col">
  54. <label class="tw-mb-[10px]"
  55. ><span>電子郵件<span class="required">*</span></span></label
  56. >
  57. <input
  58. id="InvoiceEmail"
  59. type="text"
  60. value=""
  61. class="tw-text-center"
  62. />
  63. </div>
  64. </div>
  65. </div>
  66. </Transition>
  67. <div class="element tw-mt-[20px]">
  68. <input id="false" type="radio" value="fasle" v-model="method" />
  69. <label for="false" class="t16 tw-font-normal"
  70. ><span>{{ "否" }}</span></label
  71. >
  72. </div>
  73. </div></Transition
  74. >
  75. </div>
  76. </template>
  77. <script>
  78. export default {
  79. name: "Invoice",
  80. data() {
  81. return {
  82. show: false,
  83. disabled: false,
  84. completed: false,
  85. method: null,
  86. };
  87. },
  88. };
  89. </script>
  90. <style lang="scss" scoped>
  91. .collapse {
  92. &::before {
  93. content: "";
  94. display: inline-block;
  95. position: relative;
  96. left: 0;
  97. top: 0;
  98. background-image: url("~/assets/svg/down-arrow.svg");
  99. background-repeat: no-repeat;
  100. background-position: center;
  101. background-size: 100%;
  102. width: 16px;
  103. height: 10px;
  104. margin-right: 40px;
  105. transform: rotate(-90deg);
  106. transition: all 0.2s linear;
  107. }
  108. &.disabled {
  109. pointer-events: none;
  110. &::before {
  111. background-image: url("~/assets/svg/down-arrow-disabled.svg");
  112. }
  113. }
  114. &.show {
  115. &::before {
  116. transform: rotate(0);
  117. transition: all 0.2s linear;
  118. }
  119. }
  120. }
  121. .card-icon {
  122. background-repeat: no-repeat;
  123. background-position: center;
  124. background-size: 100%;
  125. }
  126. .icon {
  127. &--visa {
  128. background-image: url("~/assets/img/credit-card/Visa.png");
  129. }
  130. &--union-pay {
  131. background-image: url("~/assets/img/credit-card/UnionPay.png");
  132. }
  133. &--mastercard {
  134. background-image: url("~/assets/img/credit-card/Mastercard.png");
  135. }
  136. &--jcb {
  137. background-image: url("~/assets/img/credit-card/JCB.png");
  138. }
  139. }
  140. .bounce-enter-active {
  141. animation: bounce-in 0.3s ease-out;
  142. }
  143. .bounce-leave-active {
  144. animation: bounce-in 0.3s cubic-bezier(1, 0.5, 0.8, 1) reverse;
  145. }
  146. @keyframes bounce-in {
  147. 0% {
  148. opacity: 0;
  149. transform: translateY(-10px);
  150. }
  151. 50% {
  152. opacity: 0.5;
  153. transform: translateY(-5px);
  154. }
  155. 100% {
  156. opacity: 1;
  157. transform: translateY(0);
  158. }
  159. }
  160. </style>