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.

172 lines
5.8 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 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 :confirmDays="confirmDays"></WireTransferInfoOther>
  10. <div v-if="payType == '2'" class="tw-mb-[30px] tw-grid tw-grid-cols-1 tw-gap-[6px] tw-p-[20px] tw-text-[16px] tw-bg-[#fefefe] tw-border tw-border-solid tw-border-primary-1 tw-rounded-[20px] xl:tw-mx-[90px]">
  11. <div class="tw-text-primary-1">
  12. 銀行帳戶資訊
  13. </div>
  14. <div class="tw-text-black">
  15. 銀行名稱玉山銀行 (808) 南港分行
  16. </div>
  17. <div>
  18. 帳戶號碼1182-940-020288
  19. </div>
  20. <div>
  21. 戶名簡單平台股份有限公司
  22. </div>
  23. </div>
  24. <DoneTotalPrice
  25. :subTotal="subTotal" :total="totalPrice" :orderStatus="orderStatus"></DoneTotalPrice>
  26. <div class="element tw-flex tw-justify-center tw-items-center xl:tw-justify-end tw-mt-[30px] no-print">
  27. <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"
  28. :href="localePath('/user/booking/' + orderStatus.bookingNo)">
  29. {{ $t("Booking Details") }}
  30. </a>
  31. </div>
  32. <div class="element tw-hidden xl:tw-flex xl:tw-justify-center xl:tw-items-center xl:tw-mt-[12px] no-print">
  33. <button v-if="status == 'success'" @click="onPrint()"
  34. 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">
  35. {{ $t("Print this page") }}
  36. </button>
  37. </div>
  38. </section>
  39. <section class="section section-three tw-w-full tw-mt-[60px] xl:tw-max-w-[822px] xl:tw-mx-auto">
  40. <DoneBookingDetails v-if="status == 'success'" :info="content" :orderStatus="orderStatus"
  41. :totalPrice="totalPrice"></DoneBookingDetails>
  42. </section>
  43. <loading :isLoading="isLoading"></loading>
  44. </div>
  45. </template>
  46. <script>
  47. import StepInfo from "@/components/service/StepInfo";
  48. // import BookingInfoItem from "@/components/service/BookingInfoItem";
  49. // import PurchaserInfo from "@/components/service/PurchaserInfo";
  50. // import ChooseMethod from "@/components/service/ChooseMethod";
  51. // import PriceInfo from "@/components/service/PriceInfo";
  52. // import TotalPrice from "@/components/service/TotalPrice";
  53. import DoneTotalPrice from "@/components/service/DoneTotalPrice";
  54. import PaymentStatusOther from "@/components/service/PaymentStatusOther";
  55. import WireTransferInfoOther from "@/components/service/WireTransferInfoOther";
  56. import DoneBookingDetails from "@/components/service/DoneBookingDetails";
  57. import loading from "@/components/newComponent/loading/loading.vue";
  58. export default {
  59. name: "done",
  60. layout: "service",
  61. auth: false,
  62. components: {
  63. StepInfo,
  64. // BookingInfoItem,
  65. // PurchaserInfo,
  66. // ChooseMethod,
  67. // PriceInfo,
  68. // TotalPrice,
  69. DoneTotalPrice,
  70. PaymentStatusOther,
  71. WireTransferInfoOther,
  72. DoneBookingDetails,
  73. loading,
  74. },
  75. data() {
  76. return {
  77. step: "3",
  78. subTotal: 0,
  79. methoodType: "",
  80. serviceId: "",
  81. status: "success",
  82. content: {
  83. preview_image: "",
  84. name: "",
  85. bookingItems: []
  86. },
  87. orderStatus: {
  88. bookingNo: '',
  89. service_date: '',
  90. service_date: '',
  91. currency: '',
  92. created_at: ''
  93. },
  94. totalPrice: 0,
  95. subTotal: 0,
  96. isLoading: false,
  97. confirmDays: "",
  98. payType: "",
  99. };
  100. },
  101. async created() {
  102. this.isLoading = true;
  103. let data = this.$route.query;
  104. if(data){
  105. console.log(data);
  106. let ret = JSON.parse(decodeURIComponent(data.data));
  107. console.log("ret:" + JSON.stringify(ret));
  108. this.status = data.status;
  109. if(ret && ret.TotalPrice!=undefined){
  110. this.totalPrice = (ret.TotalPrice!=null && ret.TotalPrice!="") ? Number(ret.TotalPrice): 0;
  111. this.subTotal = (ret.SubTotal!=null && ret.SubTotal!="") ? Number(ret.SubTotal): 0;
  112. this.content = {
  113. preview_image: ret.ServicePictrue,
  114. name: ret.ServiceName,
  115. exhibitionName: ret.ExhibitionName,
  116. bookingItems: JSON.parse(ret.BookingItem),
  117. bookingStatus: ret.BookingStatus,
  118. };
  119. this.orderStatus = {
  120. bookingNo: ret.BookingNo,
  121. service_date: ret.ServiceDateSFormat,
  122. created_at: ret.BookingDateFormat,
  123. currency: ret.CurrencyName,
  124. };
  125. this.confirmDays = ret.ConfirmDays;
  126. this.payType = ret.PayType;
  127. }
  128. }
  129. this.$nextTick(()=>{
  130. this.isLoading = false;
  131. });
  132. },
  133. mounted() { },
  134. computed: {
  135. currency() {
  136. return this.orderStatus.currency;
  137. },
  138. },
  139. methods: {
  140. print() {
  141. if (process.browser) {
  142. this.$nextTick(()=>{
  143. window.print();
  144. });
  145. }
  146. },
  147. onPrint() {
  148. this.$print(this.$refs.print)
  149. this.$nextTick(()=>{
  150. let arr=document.getElementsByClassName('isNeedRemove')
  151. if(arr.length) arr[0].remove();
  152. })
  153. },
  154. }
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .print {
  159. &::before {
  160. content: "";
  161. display: inline-block;
  162. position: relative;
  163. background-image: url("~/assets/svg/print.svg");
  164. background-position: center;
  165. background-repeat: no-repeat;
  166. background-size: cover;
  167. width: 20px;
  168. height: 20px;
  169. margin-right: 14px;
  170. }
  171. }
  172. </style>