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.

151 lines
5.0 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
  1. <template>
  2. <div id="print" ref="print"
  3. class="tw-px-[15px] tw-mb-[60px] md:tw-px-[60px] xl:tw-max-w-screen-xl xl:tw-mx-auto xl:tw-grid xl:tw-grid-cols-1">
  4. <section class="section section-one tw-my-[40px]">
  5. <StepInfo :step_active="step"></StepInfo>
  6. </section>
  7. <section class="section section-two tw-w-full xl:tw-max-w-[822px] xl:tw-mx-auto xl:tw-mt-[40px]">
  8. <PaymentStatusOther :status="status"></PaymentStatusOther>
  9. <WireTransferInfoOther ></WireTransferInfoOther>
  10. <DoneTotalPrice
  11. :subTotal="subTotal" :total="totalPrice" :orderStatus="orderStatus"></DoneTotalPrice>
  12. <div class="element tw-flex tw-justify-center tw-items-center xl:tw-justify-end tw-mt-[30px] no-print">
  13. <a class="tw-transition no-print tw-btn-md tw-no-underline tw-text-neutrals-0 tw-bg-primary-1 tw-px-[30px] tw-py-[9.5px] tw-rounded-2xl hover:tw-bg-primary-2"
  14. :href="localePath('/user/booking/' + orderStatus.bookingNo)">
  15. {{ $t("Booking Details") }}
  16. </a>
  17. </div>
  18. <div class="element tw-hidden xl:tw-flex xl:tw-justify-center xl:tw-items-center xl:tw-mt-[12px] no-print">
  19. <button v-if="status == 'success'" @click="onPrint()"
  20. class="print tw-transition tw-flex tw-justify-center tw-items-center tw-btn-md tw-text-primary-1 tw-bg-neutrals-0 tw-border tw-border-solid tw-border-primary-1 tw-px-[30px] tw-py-[13.5px] tw-rounded-xl hover:tw-bg-primary-3">
  21. {{ $t("Print this page") }}
  22. </button>
  23. </div>
  24. </section>
  25. <section class="section section-three tw-w-full tw-mt-[60px] xl:tw-max-w-[822px] xl:tw-mx-auto">
  26. <DoneBookingDetails v-if="status == 'success'" :info="content" :orderStatus="orderStatus"
  27. :totalPrice="totalPrice"></DoneBookingDetails>
  28. </section>
  29. <loading :isLoading="isLoading"></loading>
  30. </div>
  31. </template>
  32. <script>
  33. import StepInfo from "@/components/service/StepInfo";
  34. // import BookingInfoItem from "@/components/service/BookingInfoItem";
  35. // import PurchaserInfo from "@/components/service/PurchaserInfo";
  36. // import ChooseMethod from "@/components/service/ChooseMethod";
  37. // import PriceInfo from "@/components/service/PriceInfo";
  38. // import TotalPrice from "@/components/service/TotalPrice";
  39. import DoneTotalPrice from "@/components/service/DoneTotalPrice";
  40. import PaymentStatusOther from "@/components/service/PaymentStatusOther";
  41. import WireTransferInfoOther from "@/components/service/WireTransferInfoOther";
  42. import DoneBookingDetails from "@/components/service/DoneBookingDetails";
  43. import loading from "@/components/newComponent/loading/loading.vue";
  44. export default {
  45. name: "done",
  46. layout: "service",
  47. auth: false,
  48. components: {
  49. StepInfo,
  50. // BookingInfoItem,
  51. // PurchaserInfo,
  52. // ChooseMethod,
  53. // PriceInfo,
  54. // TotalPrice,
  55. DoneTotalPrice,
  56. PaymentStatusOther,
  57. WireTransferInfoOther,
  58. DoneBookingDetails,
  59. loading,
  60. },
  61. data() {
  62. return {
  63. step: "3",
  64. subTotal: 0,
  65. methoodType: "",
  66. serviceId: "",
  67. status: "success",
  68. content: {
  69. preview_image: "",
  70. name: "",
  71. bookingItems: []
  72. },
  73. orderStatus: {
  74. bookingNo: '',
  75. service_date: '',
  76. service_date: '',
  77. currency: '',
  78. created_at: ''
  79. },
  80. totalPrice: 0,
  81. subTotal: 0,
  82. isLoading: false,
  83. };
  84. },
  85. async created() {
  86. this.isLoading = true;
  87. let data = this.$route.query;
  88. if(data){
  89. let ret = JSON.parse(decodeURIComponent(data.data));
  90. this.status = data.status;
  91. if(ret && ret.TotalPrice!=undefined){
  92. this.totalPrice = (ret.TotalPrice!=null && ret.TotalPrice!="") ? Number(ret.TotalPrice): 0;
  93. this.subTotal = (ret.SubTotal!=null && ret.SubTotal!="") ? Number(ret.SubTotal): 0;
  94. this.content = {
  95. preview_image: ret.ServicePictrue,
  96. name: ret.ServiceName,
  97. exhibitionName: ret.ExhibitionName,
  98. bookingItems: JSON.parse(ret.BookingItem)
  99. };
  100. this.orderStatus = {
  101. bookingNo: ret.BookingNo,
  102. service_date: ret.ServiceDateSFormat,
  103. created_at: ret.BookingDateFormat,
  104. currency: ret.CurrencyName,
  105. };
  106. }
  107. }
  108. this.$nextTick(()=>{
  109. this.isLoading = false;
  110. });
  111. },
  112. mounted() { },
  113. computed: {
  114. currency() {
  115. return this.orderStatus.currency;
  116. },
  117. },
  118. methods: {
  119. print() {
  120. if (process.browser) {
  121. this.$nextTick(()=>{
  122. window.print();
  123. });
  124. }
  125. },
  126. onPrint() {
  127. this.$print(this.$refs.print)
  128. this.$nextTick(()=>{
  129. let arr=document.getElementsByClassName('isNeedRemove')
  130. if(arr.length) arr[0].remove();
  131. })
  132. },
  133. }
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. .print {
  138. &::before {
  139. content: "";
  140. display: inline-block;
  141. position: relative;
  142. background-image: url("~/assets/svg/print.svg");
  143. background-position: center;
  144. background-repeat: no-repeat;
  145. background-size: cover;
  146. width: 20px;
  147. height: 20px;
  148. margin-right: 14px;
  149. }
  150. }
  151. </style>