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.

197 lines
6.7 KiB

  1. <template>
  2. <client-only>
  3. <div
  4. class="purchaser-info tw-p-5 tw-mb-[20px] tw-bg-white tw-rounded-xl"
  5. >
  6. <div class="tw-flex tw-flex-row tw-justify-between tw-items-center">
  7. <h3
  8. :class="[
  9. 'collapse',
  10. 't16',
  11. 'tw-relative',
  12. 'tw-cursor-pointer',
  13. 'xl:tw-text-[18px]',
  14. show ? 'show' : 'hide',
  15. disabled ? 'disabled' : '',
  16. disabled ? 'tw-text-neutrals-300' : 'tw-text-black',
  17. ]"
  18. @click="show = !show"
  19. >
  20. {{ $t("Purchaser Info") }}
  21. </h3>
  22. <div class="element content-status xl:tw-ml-[20px]">
  23. <span
  24. v-if="purchaserValidation == true"
  25. class="status-check-icon tw-inline-block tw-w-[30px] tw-h-[30px]"
  26. ></span>
  27. </div>
  28. </div>
  29. <Transition name="bounce">
  30. <div v-show="show">
  31. <div class="tw-mt-[32px] md:tw-ml-[60px]">
  32. <div class="element element-tabs tw-mb-[20px]">
  33. <button
  34. :class="[
  35. 'tw-transition',
  36. 'tw-btn-md',
  37. 'tw-border',
  38. 'tw-border-solid',
  39. 'tw-border-neutrals-300',
  40. 'tw-px-[30px]',
  41. ' tw-py-[9.5px]',
  42. ' tw-rounded-2xl',
  43. infoType == 'Company'
  44. ? 'tw-bg-neutrals-800 tw-text-neutrals-0'
  45. : 'tw-bg-neutrals-0 tw-text-neutrals-300',
  46. ]"
  47. @click="$emit('type', 'Company')"
  48. >
  49. {{ $t('Company')}}
  50. </button>
  51. <button
  52. :class="[
  53. 'tw-transition',
  54. 'tw-btn-md',
  55. 'tw-border',
  56. 'tw-border-solid',
  57. 'tw-border-neutrals-300',
  58. 'tw-px-[30px]',
  59. ' tw-py-[9.5px]',
  60. ' tw-rounded-2xl',
  61. infoType == 'Individual'
  62. ? 'tw-bg-neutrals-800 tw-text-neutrals-0'
  63. : 'tw-bg-neutrals-0 tw-text-neutrals-300',
  64. ]"
  65. @click="$emit('type', 'Individual')"
  66. >
  67. {{ $t('Individual')}}
  68. </button>
  69. </div>
  70. <div v-show="infoType == 'Individual'">
  71. <div
  72. class="element element-form tw-grid tw-grid-cols-1 tw-gap-[10px] md:tw-grid-cols-2 md:tw-gap-x-[60px] md:tw-gap-y-[20px] md:tw-max-w-[580px]"
  73. >
  74. <div class="element">
  75. <elementInput
  76. :input="{
  77. id: 'FirstName',
  78. label: 'First Name',
  79. required: true,
  80. type: 'text',
  81. }"
  82. :default="userData.first_name"
  83. :validation="validation.first_name"
  84. @change="userData.first_name = $event"
  85. ></elementInput>
  86. </div>
  87. <div class="element">
  88. <elementInput
  89. :input="{
  90. id: 'LastName',
  91. label: 'Last Name',
  92. required: true,
  93. type: 'text',
  94. }"
  95. :default="userData.last_name"
  96. :validation="validation.last_name"
  97. @change="userData.last_name = $event"
  98. ></elementInput>
  99. </div>
  100. <div class="element">
  101. <elementInput
  102. :input="{
  103. id: 'ContactEmail',
  104. label: 'Contact Email',
  105. required: true,
  106. type: 'email',
  107. }"
  108. :default="userData.email"
  109. :validation="validation.email"
  110. @change="userData.email = $event"
  111. >
  112. </elementInput>
  113. </div>
  114. <div class="element">
  115. <label class="tw-block tw-mb-[10px]"
  116. ><span
  117. >{{ $t("Phone") }}<span class="required">*</span></span
  118. ></label
  119. >
  120. <div class="tw-grid tw-grid-cols-[120px_auto] tw-gap-[5px]">
  121. <elementCountryCodeSelect :select="{
  122. required: true,
  123. }" :userCodeSelect="userData.phone_code" :validation="validation.phone_code" @returnCode = "getReturnCode"></elementCountryCodeSelect>
  124. <vue-phone-number-input v-model="userData.phone_number" :validation="validation.phone_number" color="#E5e5e5" error-color="#ef5a5a"
  125. valid-color="#e5e5e5"
  126. :error="error" :border-radius="5"
  127. no-flags :no-country-selector="true" no-example @update="getPhoneData" :translations="translateOption">
  128. </vue-phone-number-input></div>
  129. </div>
  130. <div class="element">
  131. <elementSelect
  132. :select="{
  133. id: 'Country',
  134. label: 'Country/Region',
  135. required: true,
  136. }"
  137. :selectList="countryOptions"
  138. :default="userData.country"
  139. :validation="validation.country"
  140. @change="userData.country = $event"
  141. ></elementSelect>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="element tw-mt-[40px] tw-text-right">
  146. <button
  147. class="tw-transition tw-btn-md tw-bg-primary-1 tw-px-[30px] tw-py-[9.5px] tw-rounded-2xl hover:tw-bg-primary-2"
  148. @click="updatePurchaserInfo(false)"
  149. >
  150. {{ $t("Next") }}
  151. </button>
  152. </div>
  153. </div>
  154. </div>
  155. </Transition>
  156. </div>
  157. </client-only>
  158. </template>>
  159. <script>
  160. import elementInput from "@/components/newComponent/form/ElementInput";
  161. import elementSelect from "@/components/newComponent/form/ElementSelect";
  162. import elementCountryCodeSelect from "@/components/newComponent/form/ElementCountryCodeSelect.vue";
  163. import { IsNumber } from "~/utils/common";
  164. import is from "is_js";
  165. export default {
  166. name: "OrderingPersonInfo",
  167. components: {
  168. elementInput,
  169. elementSelect,
  170. elementCountryCodeSelect,
  171. IsNumber,
  172. is
  173. },
  174. data() {
  175. return {
  176. validation: {
  177. first_name: true,
  178. last_name: true,
  179. email: true,
  180. phone_code: true,
  181. phone_number: true,
  182. country: true,
  183. },
  184. }
  185. },
  186. created() {},
  187. watch: {},
  188. methods: {}
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. </style>