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.

174 lines
5.9 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="mypaymentStatusMap(info.PaymentStatus) === 'Unpaid'"
  77. 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"
  78. @click="goToPay()"
  79. >
  80. {{ $t("Go To Pay") }}
  81. </button> -->
  82. <!-- <button
  83. v-if="mybookingStatusMap(info.BookingStatus) === 'Completed'"
  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. >
  86. {{ $t("Write a Review") }}
  87. </button> -->
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </nuxt-link>
  93. </div>
  94. </template>
  95. <script>
  96. import elementTextarea from "@/components/newComponent/form/ElementTextarea";
  97. import elementPromoCode from "@/components/newComponent/form/ElementPromoCode";
  98. import elementTimePicker from "@/components/newComponent/form/ElementTimePicker";
  99. import {
  100. bookingStatusMap,
  101. mybookingStatusMap,
  102. paymentStatusMap,
  103. mypaymentStatusMap,
  104. bookingColor,
  105. } from "@/plugins/util.js";
  106. export default {
  107. components: {
  108. elementTextarea,
  109. elementPromoCode,
  110. elementTimePicker,
  111. },
  112. props: {
  113. info: {
  114. type: Object,
  115. },
  116. active: {
  117. type: Number,
  118. },
  119. },
  120. data() {
  121. return {
  122. apiUrl: process.env.SERVICE_CONSOLE,
  123. img:"",
  124. };
  125. },
  126. computed: {
  127. activeLabel() {
  128. return this.active;
  129. },
  130. formatTotal() {
  131. return function (total) {
  132. return total.toLocaleString("en-US");
  133. };
  134. },
  135. },
  136. mounted() {
  137. //this.getServiceData(this.info);
  138. },
  139. methods: {
  140. onLabelClick(label) {
  141. this.$emit("changeActiveLabel", label);
  142. },
  143. bookingStatusMap,
  144. mybookingStatusMap,
  145. paymentStatusMap,
  146. mypaymentStatusMap,
  147. bookingColor,
  148. goToPay() {
  149. this.$router.push(
  150. this.localePath("/user/booking/" + this.info.BookingNo)
  151. );
  152. },
  153. // async getServiceData(object) {
  154. // this.$axios
  155. // .get(
  156. // `${this.apiUrl}/user-services/content?service_id=${object.service_id}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${object.currency}`
  157. // )
  158. // .then((res) => {
  159. // this.img = res.data.preview_image;
  160. // console.log(this.img);
  161. // })
  162. // .catch((error) => console.log(error));
  163. // },
  164. },
  165. };
  166. </script>
  167. <style lang="scss" scoped>
  168. .booking-info-item {
  169. &:hover {
  170. box-shadow: 10px 10px 10px rgba(155, 155, 155, 0.25);
  171. }
  172. }
  173. </style>