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.

165 lines
5.6 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
  1. <template>
  2. <div
  3. class="booking-info-item tw-p-[20px] tw-mb-[20px] tw-bg-white tw-rounded-[20px] xl:tw-p-[20px]"
  4. >
  5. <div
  6. class="tw-grid tw-grid-cols-[16%_82%] lg:tw-grid-cols-[13%_84%] tw-gap-x-2 lg:tw-gap-x-5"
  7. >
  8. <div>
  9. <nuxt-link :to="localePath('/user/booking/' + info.BookingNo)"
  10. ><img class="tw-w-[100px] tw-h-[75px] tw-rounded-[10px ]" :src="info.OnSiteService.Logo"
  11. /></nuxt-link>
  12. </div>
  13. <div class="element content-text">
  14. <div class="tw-text-[18px] tw-font-medium tw-mb-[17px]">
  15. <span :class="bookingColor(mybookingStatusMap(info.BookingStatus))"
  16. >{{ $t(mybookingStatusMap(info.BookingStatus)) }},&nbsp;</span
  17. >
  18. <span
  19. :class="
  20. bookingColor(
  21. mypaymentStatusMap(info.PaymentStatus)
  22. )
  23. "
  24. >{{ $t(mypaymentStatusMap(info.PaymentStatus)) }}</span
  25. >
  26. </div>
  27. <h3
  28. class="t12 tw-font-bold tw-text-black tw-mb-[8px] md:tw-text-[16px]"
  29. >
  30. {{ info.OnSiteService.ServiceName }}
  31. </h3>
  32. <div class="order-id tw-body-5 tw-mb-[4px] tw-text-neutrals-800">
  33. #{{ info.BookingNo }}
  34. </div>
  35. <div
  36. class="detail tw-body-5 tw-mb-[4px] xl:tw-text-neutrals-800"
  37. v-for="(item, key) in info.BookingDetail" :key="key"
  38. >
  39. {{ item }}
  40. </div>
  41. <div class="service-date tw-body-5 tw-mb-[4px] xl:tw-text-neutrals-800"
  42. >
  43. {{ $t("Service Date:")
  44. }}&nbsp;{{ new Date(info.OnSiteService.ServiceStartDate).toLocaleString() }} - {{ new Date(info.OnSiteService.ServiceEndDate).toLocaleString() }}
  45. </div>
  46. <div v-if="info.BookingDate" class="booking-date tw-body-5 tw-mb-[8px] tw-text-neutrals-800">
  47. {{ $t("Booking Date:")
  48. }}&nbsp;{{ new Date(info.BookingDate).toLocaleString() }}
  49. </div>
  50. <div
  51. class="total tw-mb-[10px] md:tw-flex md:tw-justify-between md:tw-items-center md:tw-mb-0"
  52. >
  53. <span class="tw-text-[16px] tw-text-primary-1">
  54. ${{ formatTotal(info.TotalPrice) }}&nbsp;{{ info.Currency.CurrencyName }}
  55. </span>
  56. <div class="tw-mt-[10px] tw-flex md:tw-mt-0">
  57. <button
  58. @click="$emit('contact-us')"
  59. class="tw-transition 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-rounded-xl hover:tw-bg-primary-3 tw-hidden md:tw-flex tw-w-fit tw-h-fit tw-mr-[10px]"
  60. >
  61. {{ $t("Contact Us") }}
  62. </button>
  63. <button
  64. v-if="
  65. mybookingStatusMap(info.BookingStatus) === 'Processing' &&
  66. mypaymentStatusMap(info.PaymentStatus) ===
  67. 'Unpaid'
  68. "
  69. @click="$emit('upload-remittance-slip', info.BookingID)"
  70. class="tw-transition tw-justify-center tw-items-center tw-btn-md tw-text-white tw-bg-primary-1 tw-px-[30px] tw-py-[8.5px] tw-rounded-xl tw-w-fit tw-h-fit"
  71. >
  72. {{ $t("Upload Remittance Slip") }}
  73. </button>
  74. <!-- <button
  75. v-if="mypaymentStatusMap(info.PaymentStatus) === 'Unpaid'"
  76. class="tw-transition tw-justify-center tw-items-center tw-btn-md tw-text-white tw-bg-primary-1 tw-px-[30px] tw-py-[8.5px] tw-rounded-xl tw-w-fit tw-h-fit"
  77. @click="goToPay()"
  78. >
  79. {{ $t("Go To Pay") }}
  80. </button> -->
  81. <!-- <button
  82. v-if="mybookingStatusMap(info.BookingStatus) === 'Completed'"
  83. class="tw-transition tw-justify-center tw-items-center tw-btn-md tw-text-white tw-bg-primary-1 tw-px-[30px] tw-py-[8.5px] tw-rounded-xl tw-w-fit tw-h-fit"
  84. >
  85. {{ $t("Write a Review") }}
  86. </button> -->
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import elementTextarea from "@/components/newComponent/form/ElementTextarea";
  95. import elementPromoCode from "@/components/newComponent/form/ElementPromoCode";
  96. import elementTimePicker from "@/components/newComponent/form/ElementTimePicker";
  97. import {
  98. bookingStatusMap,
  99. mybookingStatusMap,
  100. paymentStatusMap,
  101. mypaymentStatusMap,
  102. bookingColor,
  103. } from "@/plugins/util.js";
  104. export default {
  105. components: {
  106. elementTextarea,
  107. elementPromoCode,
  108. elementTimePicker,
  109. },
  110. props: {
  111. info: {
  112. type: Object,
  113. },
  114. active: {
  115. type: Number,
  116. },
  117. },
  118. data() {
  119. return {
  120. apiUrl: process.env.SERVICE_CONSOLE,
  121. img:"",
  122. };
  123. },
  124. computed: {
  125. activeLabel() {
  126. return this.active;
  127. },
  128. formatTotal() {
  129. return function (total) {
  130. return total.toLocaleString("en-US");
  131. };
  132. },
  133. },
  134. mounted() {
  135. //this.getServiceData(this.info);
  136. },
  137. methods: {
  138. onLabelClick(label) {
  139. this.$emit("changeActiveLabel", label);
  140. },
  141. bookingStatusMap,
  142. mybookingStatusMap,
  143. paymentStatusMap,
  144. mypaymentStatusMap,
  145. bookingColor,
  146. goToPay() {
  147. this.$router.push(
  148. this.localePath("/user/booking/" + this.info.BookingNo)
  149. );
  150. },
  151. // async getServiceData(object) {
  152. // this.$axios
  153. // .get(
  154. // `${this.apiUrl}/user-services/content?service_id=${object.service_id}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${object.currency}`
  155. // )
  156. // .then((res) => {
  157. // this.img = res.data.preview_image;
  158. // console.log(this.img);
  159. // })
  160. // .catch((error) => console.log(error));
  161. // },
  162. },
  163. };
  164. </script>
  165. <style lang="scss" scoped></style>