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.

166 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. >{{ mybookingStatusMap(info.BookingStatus) }},&nbsp;</span
  17. >
  18. <span
  19. :class="
  20. bookingColor(
  21. mypaymentStatusMap(info.PaymentStatus)
  22. )
  23. "
  24. >{{ 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. <!-- BookingItem還要調整 -->
  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.ServiceDateS).toLocaleString() }} - {{ new Date(info.ServiceDateE).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.CurrencyID }}
  56. </span>
  57. <div class="tw-mt-[10px] tw-flex md:tw-mt-0">
  58. <button
  59. @click="$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) === 'Confirmed' &&
  67. mypaymentStatusMap(info.PaymentStatus) ===
  68. 'Unpaid'
  69. "
  70. @click="$emit('upload-remittance-slip')"
  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. </div>
  93. </template>
  94. <script>
  95. import elementTextarea from "@/components/newComponent/form/ElementTextarea";
  96. import elementPromoCode from "@/components/newComponent/form/ElementPromoCode";
  97. import elementTimePicker from "@/components/newComponent/form/ElementTimePicker";
  98. import {
  99. bookingStatusMap,
  100. mybookingStatusMap,
  101. paymentStatusMap,
  102. mypaymentStatusMap,
  103. bookingColor,
  104. } from "@/plugins/util.js";
  105. export default {
  106. components: {
  107. elementTextarea,
  108. elementPromoCode,
  109. elementTimePicker,
  110. },
  111. props: {
  112. info: {
  113. type: Object,
  114. },
  115. active: {
  116. type: Number,
  117. },
  118. },
  119. data() {
  120. return {
  121. apiUrl: process.env.SERVICE_CONSOLE,
  122. img:"",
  123. };
  124. },
  125. computed: {
  126. activeLabel() {
  127. return this.active;
  128. },
  129. formatTotal() {
  130. return function (total) {
  131. return total.toLocaleString("en-US");
  132. };
  133. },
  134. },
  135. mounted() {
  136. //this.getServiceData(this.info);
  137. },
  138. methods: {
  139. onLabelClick(label) {
  140. this.$emit("changeActiveLabel", label);
  141. },
  142. bookingStatusMap,
  143. mybookingStatusMap,
  144. paymentStatusMap,
  145. mypaymentStatusMap,
  146. bookingColor,
  147. goToPay() {
  148. this.$router.push(
  149. this.localePath("/user/booking/" + this.info.BookingNo)
  150. );
  151. },
  152. // async getServiceData(object) {
  153. // this.$axios
  154. // .get(
  155. // `${this.apiUrl}/user-services/content?service_id=${object.service_id}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${object.currency}`
  156. // )
  157. // .then((res) => {
  158. // this.img = res.data.preview_image;
  159. // console.log(this.img);
  160. // })
  161. // .catch((error) => console.log(error));
  162. // },
  163. },
  164. };
  165. </script>
  166. <style lang="scss" scoped></style>