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.

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