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.

766 lines
26 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div
  3. class="booking-info-item tw-p-[15px] lg:tw-p-[20px] tw-mb-[30px] tw-bg-white tw-rounded-xl md:tw-mb-[40px]"
  4. >
  5. <div
  6. :class="[
  7. 'info-content',
  8. 'collapse',
  9. 'tw-cursor-pointer',
  10. 'tw-grid tw-items-start tw-grid-cols-[52px_auto] tw-gap-[15px] md:tw-grid-cols-[160px_auto] md:tw-gap-[20px] xl:tw-grid-cols-[56px_105px_520px_30px] xl:tw-gap-[16px] xl:tw-items-center',
  11. show ? 'show' : 'hide',
  12. ]"
  13. @click="show = !show"
  14. >
  15. <img
  16. class="element content-img tw-rounded-[4px] tw-h-1/5 md:tw-rounded-[12px] md:tw-h-3/5 xl:tw-h-3/5"
  17. :src="info.preview_image"
  18. />
  19. <div class="element content-text">
  20. <h3
  21. class="t12 tw-font-bold tw-mb-[10px] tw-text-base-primary md:tw-text-[16px] md:tw-leading-[21px] xl:tw-mb-[12px]"
  22. >
  23. {{ info.service_name }}
  24. </h3>
  25. <div v-for="(item, key) in info.order_item" :key="key"
  26. class="detail tw-body-5 tw-mb-[10px] xl:tw-text-neutrals-600 xl:tw-mb-[4px]"
  27. >
  28. {{ item }}
  29. </div>
  30. <div class="tw-mb-[10px] tw-my-[12px] xl:tw-mb-0 tw-flex t-12 tw-text-[#232323]"
  31. >
  32. <div>{{ $t("Select Exhibition") }}</div>
  33. <div class="tw-ml-[10px]">{{ info.selectExhibition }}</div>
  34. </div>
  35. <!-- <div
  36. v-for="(item, key) in info.order_as" :key="key"
  37. class="detail tw-body-5 tw-mb-[10px] xl:tw-mb-0 xl:tw-text-neutrals-600"
  38. >
  39. {{ item.as_name + "&nbsp;x&nbsp;" + item.quantity }}
  40. </div> -->
  41. <!-- <div
  42. class="date tw-body-5 tw-mb-[10px] xl:tw-mt-[12px]"
  43. v-if="info.service_date != null || info.service_time != null"
  44. >
  45. Service Date: {{ info.service_date +"&nbsp;"+ info.service_time }}
  46. </div> -->
  47. <!-- <div
  48. class="total t14 tw-font-bold tw-text-primary-1 tw-mb-[10px] xl:tw-hidden"
  49. >
  50. $3,500 {{ info.currency
  51. }}<span class="tw-font-normal tw-text-neutrals-400 tw-ml-[10px]"
  52. >(Tax included)</span
  53. >
  54. </div>
  55. <div class="element xl:tw-hidden">
  56. <button
  57. class="tw-transition tw-flex tw-justify-center tw-items-center tw-btn-md tw-text-primary-1 tw-border tw-border-solid tw-border-primary-1 tw-px-[30px] tw-py-[8.5px] tw-w-full tw-rounded-xl hover:tw-bg-primary-3"
  58. >
  59. {{ $t("Enter Required info") }}
  60. <span
  61. v-if="questionValidation == true"
  62. class="status-check-icon tw-inline-block tw-items-center tw-w-[16px] tw-h-[16px] tw-ml-[10px]"
  63. ></span>
  64. </button>
  65. </div> -->
  66. </div>
  67. <div class="element content-status tw-hidden xl:tw-block xl:tw-ml-[20px]">
  68. <span
  69. class="status-check-icon tw-inline-block tw-w-[30px] tw-h-[30px]"
  70. ></span>
  71. </div>
  72. </div>
  73. <Transition name="bounce">
  74. <div v-show="show" :class="['info-form']">
  75. <div
  76. :class="[
  77. 'bookingdetails',
  78. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  79. 'tw-pt-[20px] tw-mt-[20px]',
  80. ]"
  81. >
  82. <h3 class="tw-mb-[40px] t18 tw-font-bold tw-text-black">{{ $t("Ordering details") }}</h3>
  83. <table class="table-auto">
  84. <template v-for="(item,index) in questions">
  85. <template v-if="windewWidth>414">
  86. <tr v-if="item.type != 'MultilineText'" class="element tw-my-[10px]" :key="index">
  87. <td class="tw-pr-[20px]">
  88. <div class="tw-items-center">
  89. <label class="tw-font-normal "><span>{{ item.name }}
  90. <span v-if="item.requiredFlag=='1'" class="required t12 md:t14">*</span></span></label>
  91. </div>
  92. </td>
  93. <td>
  94. <div class="element tw-my-[10px]">
  95. <div class="md:tw-flex tw-items-center" v-if="item.type == 'DateText'">
  96. <selectDate @selected="item.value = $event"></selectDate>
  97. <span v-if="item.validation==false" class="required md:tw-ml-[20px] t12 md:t14">{{ $t("Required.") }}</span>
  98. </div>
  99. <div class="md:tw-flex tw-items-center" v-else-if="item.type == 'TimeText'">
  100. <elementTimePicker @change="item.value = $event"></elementTimePicker>
  101. <span v-if="item.validation==false" class="required md:tw-ml-[20px] t12 md:t14">{{ $t("Required.") }}</span>
  102. </div>
  103. <elementInputNew v-else-if="item.type == 'SingleText'"
  104. :input="{
  105. id: item.id,
  106. required: item.requiredFlag=='1' ? true : false,
  107. type: 'text',
  108. placeholder: '',
  109. }"
  110. :validation="item.validation"
  111. @change="item.value = $event"
  112. >
  113. </elementInputNew>
  114. </div>
  115. </td>
  116. </tr>
  117. </template>
  118. <template v-else>
  119. <template v-if="item.type != 'MultilineText'">
  120. <tr class="element" :key="index">
  121. <div class="tw-items-center">
  122. <label class="tw-font-normal "><span>{{ item.name }}
  123. <span v-if="item.requiredFlag=='1'" class="required t12 md:t14">*</span></span></label>
  124. </div>
  125. </tr>
  126. <tr class="element" :key="item.id+index">
  127. <div class="element tw-my-[10px]">
  128. <div class="md:tw-flex tw-items-center" v-if="item.type == 'DateText'">
  129. <selectDate @selected="item.value = $event"></selectDate>
  130. <span v-if="item.validation==false" class="required md:tw-ml-[20px] t12 md:t14">{{ $t("Required.") }}</span>
  131. </div>
  132. <div class="md:tw-flex tw-items-center" v-else-if="item.type == 'TimeText'">
  133. <elementTimePicker @change="item.value = $event"></elementTimePicker>
  134. <span v-if="item.validation==false" class="required md:tw-ml-[20px] t12 md:t14">{{ $t("Required.") }}</span>
  135. </div>
  136. <elementInputNew v-else-if="item.type == 'SingleText'"
  137. :input="{
  138. id: item.id,
  139. required: item.requiredFlag=='1' ? true : false,
  140. type: 'text',
  141. placeholder: '',
  142. }"
  143. :validation="item.validation"
  144. @change="item.value = $event"
  145. >
  146. </elementInputNew>
  147. </div>
  148. </tr>
  149. </template>
  150. </template>
  151. </template>
  152. </table>
  153. <template v-for="item in questions">
  154. <div v-if="item.type == 'MultilineText'" class="element tw-my-[10px]" :key="item.id">
  155. <elementTextarea
  156. :input="{
  157. id: item.id,
  158. label: item.name,
  159. required: false,
  160. placeholder: '',
  161. }"
  162. :default="''"
  163. :validation="true"
  164. @change="item.value = $event"
  165. ></elementTextarea>
  166. </div>
  167. </template>
  168. <!-- <template v-for="(item,index) in questions">
  169. <div v-if="item.type == 'CustomDate'" class="element tw-mt-[16px]">
  170. <div class="element tw-flex">
  171. <div class="tw-flex element tw-grid tw-grid-cols-1 md:tw-grid-cols-[190px_215px_auto] xl:tw-grid-cols-[190px_215px_auto] tw-gap-[10px]">
  172. <div class="tw-items-center"></div>
  173. <label class="tw-font-normal "><span>{{ item.name }}
  174. <span class="required">*</span></span></label>
  175. </div>
  176. <selectDate @selected="item.value = $event"></selectDate>
  177. </div>
  178. </div>
  179. <div v-else-if="item.type == 'TimeText'" class="element tw-mt-[16px]">
  180. <div class="element tw-flex">
  181. <label class="tw-font-normal "><span>{{ item.name }}
  182. <span class="required">*</span></span></label>
  183. <elementTimePicker></elementTimePicker>
  184. </div>
  185. </div>
  186. <div v-else-if="item.type == 'Email'" class="element tw-mt-[16px]">
  187. <div class="element tw-flex">
  188. <div class="tw-flex tw-items-center">
  189. <label class="tw-font-normal ">
  190. <span>{{ item.name }}</span><span class="required">*</span>
  191. </label>
  192. </div>
  193. <elementInputNew
  194. :input="{
  195. id: item.id,
  196. required: true,
  197. type: 'text',
  198. placeholder: '',
  199. }"
  200. :validation="item.validation"
  201. @change="item.value = $event"
  202. >
  203. </elementInputNew>
  204. </div>
  205. </div>
  206. <div v-else-if="item.type == 'MultilineText'" class="element tw-mt-[16px]" >
  207. <elementTextarea
  208. :input="{
  209. id: item.id,
  210. label: item.name,
  211. required: false,
  212. placeholder: '',
  213. }"
  214. :default="''"
  215. :validation="true"
  216. @change="item.value = $event"
  217. ></elementTextarea>
  218. </div>
  219. </template> -->
  220. <!-- <div
  221. v-for="(item, key) in content.booking_questions" :key="key"
  222. class="element tw-mb-[20px]"
  223. >
  224. <elementTextarea
  225. :input="{
  226. id: item.question_id,
  227. label: item.question,
  228. required:
  229. item.required === 1 || item.required === 'required'
  230. ? true
  231. : false,
  232. placeholder: '',
  233. }"
  234. :default="''"
  235. :validation="question[key].validation"
  236. @change="setQuestion($event, key, item)"
  237. ></elementTextarea>
  238. </div> -->
  239. <!-- <OrderingDetails ref="child_Ordering"></OrderingDetails> -->
  240. </div>
  241. <!-- <div
  242. :class="[
  243. 'contact-info',
  244. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  245. 'tw-pt-[20px] tw-mt-[20px]',
  246. ]"
  247. > -->
  248. <!-- <h3 class="tw-mb-[20px]">{{ $t("Contact information") }}</h3>
  249. <Contact></Contact> -->
  250. <!-- <div
  251. class="element element-button-group tw-flex tw-justify-start tw-flex-wrap -tw-mx-[8px]"
  252. >
  253. <button
  254. v-for="(item, index) in contact"
  255. :key="index"
  256. :class="[
  257. 'tw-transition',
  258. 'tw-btn-md',
  259. 'tw-text-[14px]',
  260. 'tw-leading-[18px]',
  261. 'tw-text-complementary-1',
  262. 'tw-bg-neutrals-0',
  263. 'tw-px-[12px]',
  264. 'tw-py-[11px]',
  265. 'tw-mx-[8px]',
  266. 'tw-mb-[16px]',
  267. 'tw-rounded-2xl',
  268. 'tw-border tw-border-solid',
  269. 'tw-bg-complementary-3',
  270. activeLabel == index + 1
  271. ? 'tw-border-complementary-1 tw-bg-complementary-1/20'
  272. : 'tw-border-transparent',
  273. ]"
  274. @click="onLabelClick(index + 1, item)"
  275. >
  276. {{ item.first_name }} {{ item.last_name }}
  277. </button>
  278. <button
  279. class="btn-add-icon tw-transition tw-btn-md tw-text-[14px] tw-leading-[18px] tw-text-complementary-1 tw-bg-complementary-3 tw-pr-[12px] tw-pl-[36px] tw-py-[11px] tw-mx-[8px] tw-mb-[16px] tw-rounded-[10px]"
  280. @click="$modal.show('add-contact-modal')"
  281. >
  282. {{ $t("Add") }}
  283. </button>
  284. </div> -->
  285. <!-- <div class="company-info-list">
  286. <template v-for="(item, index) in contact">
  287. <div
  288. :key="index"
  289. v-if="index + 1 === activeLabel"
  290. class="tw-grid tw-grid-cols-1 tw-gap-y-[16px]"
  291. >
  292. <div
  293. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  294. >
  295. <div class="label t14 tw-font-bold">
  296. {{ $t("First Name") }}
  297. </div>
  298. <div class="content tw-body-4">
  299. {{ item.first_name }}
  300. </div>
  301. </div>
  302. <div
  303. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  304. >
  305. <div class="label t14 tw-font-bold">
  306. {{ $t("Last Name") }}
  307. </div>
  308. <div class="content tw-body-4">
  309. {{ item.last_name }}
  310. </div>
  311. </div>
  312. <div
  313. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  314. >
  315. <div class="label t14 tw-font-bold">{{ $t("Email") }}</div>
  316. <div class="content tw-body-4">
  317. {{ item.email }}
  318. </div>
  319. </div>
  320. <div
  321. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  322. >
  323. <div class="label t14 tw-font-bold">{{ $t("Phone") }}</div>
  324. <div class="content tw-body-4">
  325. {{ item.phone_number }}
  326. </div>
  327. </div>
  328. <button
  329. class="btn-edit-icon tw-w-[28px] tw-h-[28px]"
  330. @click="$modal.show('edit-contact-modal')"
  331. ></button>
  332. </div>
  333. </template>
  334. </div> -->
  335. <!-- </div> -->
  336. <!-- <div
  337. :class="[
  338. 'promo-code',
  339. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  340. 'tw-pt-[20px] tw-mt-[20px]',
  341. ]"
  342. >
  343. <h3 class="tw-mb-[10px]">{{ $t("Promo code") }}</h3>
  344. <elementPromoCode></elementPromoCode>
  345. </div> -->
  346. <div class="element tw-text-right tw-mt-[40px]">
  347. <button
  348. class="tw-transition tw-btn-md tw-bg-primary-1 tw-px-[30px] tw-py-[8.5px] tw-rounded-2xl hover:tw-bg-primary-2"
  349. @click="updateInfo()"
  350. >
  351. {{ $t("Next") }}
  352. </button>
  353. </div>
  354. </div>
  355. </Transition>
  356. <!-- <Transition name="bounce">
  357. <div v-show="show" :class="['info-form']">
  358. <div
  359. :class="[
  360. 'bookingdetails',
  361. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  362. 'tw-pt-[20px] tw-mt-[20px]',
  363. ]"
  364. >
  365. {{ content.booking_questions }}
  366. <h3 class="tw-mb-[40px]">{{ $t("Booking Details") }}</h3>
  367. <div
  368. v-for="(item, key) in content.booking_questions"
  369. class="element tw-mb-[20px]"
  370. >
  371. <elementTextarea
  372. :input="{
  373. id: item.question_id,
  374. label: item.question,
  375. required:
  376. item.required === 1 || item.required === 'required'
  377. ? true
  378. : false,
  379. placeholder: '',
  380. }"
  381. :default="''"
  382. :validation="true"
  383. @change="
  384. setQuestion($event, key, item.question_id, item.question)
  385. "
  386. ></elementTextarea>
  387. </div>
  388. </div>
  389. <div
  390. :class="[
  391. 'contact-info',
  392. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  393. 'tw-pt-[20px] tw-mt-[20px]',
  394. ]"
  395. >
  396. <h3 class="tw-mb-[20px]">{{ $t("Contact Info") }}</h3>
  397. <div
  398. class="element element-button-group tw-flex tw-justify-start tw-flex-wrap -tw-mx-[8px]"
  399. >
  400. <button
  401. v-for="(item, index) in contact"
  402. :key="index"
  403. :class="[
  404. 'tw-transition',
  405. 'tw-btn-md',
  406. 'tw-text-[14px]',
  407. 'tw-leading-[18px]',
  408. 'tw-text-complementary-1',
  409. 'tw-bg-neutrals-0',
  410. 'tw-px-[12px]',
  411. 'tw-py-[11px]',
  412. 'tw-mx-[8px]',
  413. 'tw-mb-[16px]',
  414. 'tw-rounded-2xl',
  415. 'tw-border tw-border-solid',
  416. 'tw-bg-complementary-3',
  417. activeLabel == index + 1
  418. ? 'tw-border-complementary-1 tw-bg-complementary-1/20'
  419. : 'tw-border-transparent',
  420. ]"
  421. @click="onLabelClick(index + 1, item)"
  422. >
  423. {{ item.first_name }} {{ item.last_name }}
  424. </button>
  425. <button
  426. class="btn-add-icon tw-transition tw-btn-md tw-text-[14px] tw-leading-[18px] tw-text-complementary-1 tw-bg-complementary-3 tw-pr-[12px] tw-pl-[36px] tw-py-[11px] tw-mx-[8px] tw-mb-[16px] tw-rounded-[10px]"
  427. @click="$modal.show('add-contact-modal')"
  428. >
  429. {{ $t("Add") }}
  430. </button>
  431. </div>
  432. <div class="company-info-list">
  433. <template v-for="(item, index) in contact">
  434. <div
  435. :key="index"
  436. v-if="index + 1 === activeLabel"
  437. class="tw-grid tw-grid-cols-1 tw-gap-y-[16px]"
  438. >
  439. <div
  440. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  441. >
  442. <div class="label t14 tw-font-bold">
  443. {{ $t("First Name") }}
  444. </div>
  445. <div class="content tw-body-4">
  446. {{ item.first_name }}
  447. </div>
  448. </div>
  449. <div
  450. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  451. >
  452. <div class="label t14 tw-font-bold">
  453. {{ $t("Last Name") }}
  454. </div>
  455. <div class="content tw-body-4">
  456. {{ item.last_name }}
  457. </div>
  458. </div>
  459. <div
  460. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  461. >
  462. <div class="label t14 tw-font-bold">{{ $t("Email") }}</div>
  463. <div class="content tw-body-4">
  464. {{ item.email }}
  465. </div>
  466. </div>
  467. <div
  468. class="element tw-grid tw-grid-cols-[140px_auto] tw-gap-x-[12px]"
  469. >
  470. <div class="label t14 tw-font-bold">{{ $t("Phone") }}</div>
  471. <div class="content tw-body-4">
  472. {{ item.phone_number }}
  473. </div>
  474. </div>
  475. <button
  476. class="btn-edit-icon tw-w-[28px] tw-h-[28px]"
  477. @click="$modal.show('edit-contact-modal')"
  478. ></button>
  479. </div>
  480. </template>
  481. </div>
  482. </div>
  483. <div
  484. :class="[
  485. 'promo-code',
  486. 'tw-border-0 tw-border-t tw-border-solid tw-border-neutrals-200',
  487. 'tw-pt-[20px] tw-mt-[20px]',
  488. ]"
  489. >
  490. <h3 class="tw-mb-[10px]">{{ $t("Promo code") }}</h3>
  491. <elementPromoCode></elementPromoCode>
  492. </div>
  493. <div class="element tw-text-right tw-mt-[40px]">
  494. <button
  495. class="tw-transition tw-btn-md tw-bg-primary-1 tw-px-[30px] tw-py-[8.5px] tw-rounded-2xl hover:tw-bg-primary-2"
  496. @click="updateInfo()"
  497. >
  498. {{ $t("Next") }}
  499. </button>
  500. </div>
  501. </div>
  502. </Transition> -->
  503. </div>
  504. </template>
  505. <script>
  506. import elementTextarea from "@/components/newComponent/form/ElementTextarea";
  507. import elementInputNew from "@/components/newComponent/form/ElementInputNew";
  508. import selectDate from "@/components/service/content/selectDate.vue";
  509. import elementTimePicker from "@/components/newComponent/form/ElementTimePicker";
  510. // import elementPromoCode from "@/components/newComponent/form/ElementPromoCode";
  511. import Contact from "@/components/service/Contact";
  512. // import OrderingDetails from "@/components/service/OrderingDetails";
  513. import is from "is_js";
  514. export default {
  515. components: {
  516. elementTextarea,
  517. elementInputNew,
  518. selectDate,
  519. // elementPromoCode,
  520. elementTimePicker,
  521. is,
  522. Contact,
  523. // OrderingDetails,
  524. },
  525. props: {
  526. info: {
  527. type: Object,
  528. },
  529. content: {
  530. type: Object,
  531. },
  532. questions: {
  533. type: Array,
  534. default: [],
  535. },
  536. active: {
  537. type: Number,
  538. },
  539. },
  540. data() {
  541. return {
  542. show: true,
  543. // question: [],
  544. contactData: {
  545. first_name: "",
  546. last_name: "",
  547. email: "",
  548. phone_number: "",
  549. },
  550. questionValidation: false,
  551. errors: null,
  552. windewWidth: null,
  553. };
  554. },
  555. computed: {
  556. activeLabel() {
  557. return this.active;
  558. },
  559. },
  560. mounted() {
  561. let vm = this;
  562. vm.$nextTick(function () {
  563. // if (vm.contact.length > 0) {
  564. // vm.contactData.first_name = vm.contact[0].first_name;
  565. // vm.contactData.last_name = vm.contact[0].last_name;
  566. // vm.contactData.email = vm.contact[0].email;
  567. // vm.contactData.phone_number = vm.contact[0].phone_number;
  568. // }
  569. });
  570. },
  571. created(){
  572. if (process.browser) {
  573. window.addEventListener("resize", this.handleResize);
  574. }
  575. this.handleResize();
  576. },
  577. destroyed() {
  578. if (process.browser) {
  579. window.removeEventListener("resize", this.handleResize);
  580. }
  581. },
  582. watch: {
  583. // contact: {
  584. // handler: function () {
  585. // let vm = this;
  586. // if (vm.contact.length > 0) {
  587. // vm.contactData.first_name = vm.contact[0].first_name;
  588. // vm.contactData.last_name = vm.contact[0].last_name;
  589. // vm.contactData.email = vm.contact[0].email;
  590. // vm.contactData.phone_number = vm.contact[0].phone_number;
  591. // }
  592. // },
  593. // },
  594. // questions: {
  595. // handler: function () {
  596. // this.getContent();
  597. // },
  598. // },
  599. questionValidation: {
  600. handler: function () {
  601. if (this.questionValidation == true) {
  602. this.show = false;
  603. }else{
  604. this.show = true;
  605. }
  606. },
  607. },
  608. },
  609. methods: {
  610. handleResize() {
  611. if (process.browser) {
  612. this.windewWidth = window.innerWidth;
  613. }
  614. },
  615. // onLabelClick(label) {
  616. // let index = label - 1;
  617. // if (index <= 0) {
  618. // index = 0;
  619. // }
  620. // this.contactData.first_name = this.contact[index].first_name;
  621. // this.contactData.last_name = this.contact[index].last_name;
  622. // this.contactData.email = this.contact[index].email;
  623. // this.contactData.phone_number = this.contact[index].phone_number;
  624. // this.$emit("changeActiveLabel", label);
  625. // },
  626. updateInfo() {
  627. // 需要先校驗
  628. this.questions.forEach((item) => {
  629. if (item.requiredFlag !== "0") {
  630. if (item.value == "") {
  631. item.validation = false;
  632. } else {
  633. item.validation = true;
  634. this.$emit("answer", this.questions);
  635. // this.$emit("contact", this.contactData);
  636. }
  637. } else {
  638. this.$emit("answer", this.questions);
  639. }
  640. });
  641. this.questionValidation = this.questions.every(function (item) {
  642. if(item.type=="MultilineText"){
  643. item.validation = true;
  644. }
  645. return item.validation == true;
  646. });
  647. this.$emit("bookingDetail_validation", this.questionValidation);
  648. },
  649. getValidation(){
  650. this.updateInfo();
  651. // let isPass = this.$refs.child_Ordering.save();
  652. this.questionValidation = this.questions.every(function (item) {
  653. return item.validation == true;
  654. });
  655. if(this.questionValidation==false){
  656. this.show = true;
  657. }
  658. return this.questionValidation;
  659. },
  660. // getContent() {
  661. // this.questions.forEach((item) => {
  662. // item.validation = true;
  663. // });
  664. // // this.question = JSON.parse(JSON.stringify(this.questions));
  665. // this.questions.forEach((item) => {
  666. // item.answer = "";
  667. // });
  668. // },
  669. // setQuestion(val, index, item) {
  670. // this.question[index].answer = val;
  671. // },
  672. },
  673. };
  674. </script>
  675. <style lang="scss" scoped>
  676. .collapse {
  677. @media (min-width: 1366px) {
  678. &::before {
  679. content: "";
  680. display: inline-block;
  681. position: relative;
  682. padding-left: auto;
  683. padding-right: auto;
  684. left: 25px;
  685. top: 0;
  686. background-image: url("~/assets/svg/down-arrow.svg");
  687. background-repeat: no-repeat;
  688. background-position: center;
  689. background-size: 100%;
  690. width: 16px;
  691. height: 10px;
  692. margin-right: 45px;
  693. transform: rotate(-90deg);
  694. transition: all 0.2s linear;
  695. }
  696. &.disabled {
  697. pointer-events: none;
  698. &::before {
  699. background-image: url("~/assets/svg/down-arrow-disabled.svg");
  700. }
  701. }
  702. &.show {
  703. &::before {
  704. transform: rotate(0);
  705. transition: all 0.2s linear;
  706. }
  707. }
  708. }
  709. }
  710. .status-check-icon {
  711. background-image: url("~/assets/svg/status-check.svg");
  712. background-size: 100%;
  713. background-repeat: no-repeat;
  714. background-position: center;
  715. }
  716. .btn-add-icon {
  717. background-image: url("~/assets/svg/plus-blue.svg");
  718. background-repeat: no-repeat;
  719. background-position: left 12px center;
  720. background-size: 16px 16px;
  721. }
  722. .btn-edit-icon {
  723. background-image: url("~/assets/svg/edit-info.svg");
  724. background-repeat: no-repeat;
  725. background-position: center;
  726. background-size: 100%;
  727. }
  728. .bounce-enter-active {
  729. animation: bounce-in 0.3s ease-out;
  730. }
  731. .bounce-leave-active {
  732. animation: bounce-in 0.3s cubic-bezier(1, 0.5, 0.8, 1) reverse;
  733. }
  734. @keyframes bounce-in {
  735. 0% {
  736. opacity: 0;
  737. transform: translateY(-10px);
  738. }
  739. 50% {
  740. opacity: 0.5;
  741. transform: translateY(-5px);
  742. }
  743. 100% {
  744. opacity: 1;
  745. transform: translateY(0);
  746. }
  747. }
  748. </style>