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.

131 lines
4.2 KiB

2 years ago
  1. <template>
  2. <div
  3. class="tw-px-[15px] tw-my-[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"></section>
  5. <section class="section section-two tw-w-full xl:tw-max-w-[822px] xl:tw-mx-auto xl:tw-mt-[40px]">
  6. <PaymentStatus :status="status"></PaymentStatus>
  7. <DoneTotalPrice :subTotal="totalPrice" :orderStatus="orderStatus"></DoneTotalPrice>
  8. </section>
  9. <section class="section section-three tw-w-full tw-mt-[60px] xl:tw-max-w-[822px] xl:tw-mx-auto">
  10. <h2 class="t18 title-icon-left tw-text-black tw-mb-[15px]">
  11. {{ $t("Complete payment") }}
  12. </h2>
  13. <div class="notice tw-body-3 tw-text-black tw-mb-[20px] tw-hidden xl:tw-block">
  14. {{
  15. $t(
  16. "Please enter your info carefully. Once submitted it cannot be changed."
  17. )
  18. }}
  19. </div>
  20. <ChooseMethod></ChooseMethod>
  21. <div class="element tw-flex tw-justify-center tw-items-center xl:tw-justify-end tw-mt-[30px]">
  22. <a class="tw-transition 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"
  23. href="#">
  24. {{ $t("Repay") }}
  25. </a>
  26. </div>
  27. </section>
  28. </div>
  29. </template>
  30. <script>
  31. import StepInfo from "@/components/service/StepInfo";
  32. import BookingInfoItem from "@/components/service/BookingInfoItem";
  33. import PurchaserInfo from "@/components/service/PurchaserInfo";
  34. import ChooseMethod from "@/components/service/ChooseMethod";
  35. import PriceInfo from "@/components/service/PriceInfo";
  36. import TotalPrice from "@/components/service/TotalPrice";
  37. import DoneTotalPrice from "@/components/service/DoneTotalPrice";
  38. import PaymentStatus from "@/components/service/PaymentStatus";
  39. import WireTransferInfo from "@/components/service/WireTransferInfo";
  40. import DoneBookingDetails from "@/components/service/DoneBookingDetails";
  41. export default {
  42. name: "service",
  43. layout: "service",
  44. auth: false,
  45. components: {
  46. StepInfo,
  47. BookingInfoItem,
  48. PurchaserInfo,
  49. ChooseMethod,
  50. PriceInfo,
  51. TotalPrice,
  52. DoneTotalPrice,
  53. PaymentStatus,
  54. WireTransferInfo,
  55. DoneBookingDetails,
  56. },
  57. data() {
  58. return {
  59. step: "3",
  60. subTotal: 5510,
  61. methoodType: "Credit Card",
  62. //Credit Card,Remittance
  63. status: "failed",
  64. serviceId: "",
  65. orderStatus: {},
  66. totalPrice: 0,
  67. demo: [
  68. {
  69. title:
  70. "Taipei Popular Sightseeing Private Car Charter: Jiufen, Pingxi, and North Coast (Chinese/English/Korean)",
  71. detail:
  72. "[Pick Up Service, Taipei City, Standard Car for 4 people] x 1",
  73. date: "2022.09.20-2022.09.24 (Local time)",
  74. quantity: 1,
  75. total: 3500,
  76. },
  77. ],
  78. bankAccountInfo: {
  79. bankName: "E. SUN COMMERCIAL BANK, LTD., TAIPEI, TAIWAN",
  80. SWIFTCode: "ESUNTWTP",
  81. BankAddress:
  82. "No. 66-1,Sanchong Rd.,Nangang Dist., Taipei City 115602 , Taiwan",
  83. AccountNumber: "1182-879-079298",
  84. AccountName: "SHOWEASY CO., LTD",
  85. },
  86. };
  87. },
  88. async created() {
  89. await this.getStatus();
  90. },
  91. mounted() { },
  92. methods: {
  93. async getStatus() {
  94. await this.$axios
  95. .get(
  96. `/order/${this.$route.params.id}?jwt=${this.$auth.$storage.getUniversal("jwt").token
  97. }`
  98. )
  99. .then((result) => {
  100. console.log(result)
  101. this.serviceId = result.data[0].service_id;
  102. this.orderStatus = result.data[0];
  103. this.methoodType = result.data[0].order_payment[0].payment_type;
  104. this.orderStatus.order_item.forEach((item) => {
  105. this.totalPrice += Math.round(item.price * item.quantity * 100) / 100;
  106. })
  107. return result.data;
  108. })
  109. .catch((err) => {
  110. console.log(err);
  111. });
  112. },
  113. },
  114. };
  115. </script>
  116. <style lang="scss" scoped>
  117. .print {
  118. &::before {
  119. content: "";
  120. display: inline-block;
  121. position: relative;
  122. background-image: url("~/assets/svg/print.svg");
  123. background-position: center;
  124. background-repeat: no-repeat;
  125. background-size: cover;
  126. width: 20px;
  127. height: 20px;
  128. margin-right: 14px;
  129. }
  130. }
  131. </style>