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.

259 lines
9.4 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. >
  5. <div class="section section-one">
  6. <h2
  7. class="t18 title-icon-left tw-text-black tw-mb-[21px] md:tw-mb-[31px] xl:tw-mb-[31px]"
  8. >
  9. {{ $t("Booking info") }}
  10. </h2>
  11. <BookingInfo
  12. class="tw-mb-[20px]"
  13. v-bind:BookingOrder="BookingOrder"
  14. ></BookingInfo>
  15. <BookingInfoItem v-bind:info="BookingOrder"
  16. v-bind:NoticeDetails="NoticeDetails"
  17. v-bind:Supplier="Supplier"
  18. v-bind:Img="content.preview_image"
  19. ></BookingInfoItem>
  20. <PaymentDetails
  21. class="tw-mb-[20px]"
  22. v-bind:PaymentDetails="PaymentDetails"
  23. v-bind:Currency="currency"
  24. ></PaymentDetails>
  25. <ContactInfo
  26. class="tw-mb-[20px]"
  27. v-bind:ContactInfo="ContactInfo"
  28. ></ContactInfo>
  29. <Cancellation v-bind:Policy="content.cancellation_policy"></Cancellation>
  30. <ViewDetails v-bind:ViewDetails="PaymentDetails" v-bind:Currency="currency"></ViewDetails>
  31. <OtherDetails v-bind:OtherDetail="OtherDetail"></OtherDetails>
  32. <NoticeDetails v-bind:NoticeDetails="NoticeDetails"></NoticeDetails>
  33. <ContactUs v-bind:ContactUs="ContactUs"></ContactUs>
  34. <CancelBooking ></CancelBooking>
  35. <CancellationPolicy v-bind:Policy="content.cancellation_policy"></CancellationPolicy>
  36. <BankingDetails v-bind:BankingDetails="BankingDetails"></BankingDetails>
  37. <UploadRemittanceSlip></UploadRemittanceSlip>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import ContactInfo from "@/components/booking/ContactInfo";
  43. import Cancellation from "@/components/booking/Cancellation";
  44. import PaymentDetails from "@/components/booking/PaymentDetails";
  45. import BookingInfoItem from "@/components/booking/BookingInfoItem";
  46. import BookingInfo from "@/components/booking/BookingInfo";
  47. import ViewDetails from "@/components/booking/Modal/ViewDetailsModal.vue";
  48. import OtherDetails from "@/components/booking/Modal/OtherDetailsModal.vue";
  49. import NoticeDetails from "@/components/booking/Modal/NoticeDetailsModal.vue";
  50. import ContactUs from "@/components/booking/Modal/ContactUsModal.vue";
  51. import CancelBooking from "@/components/booking/Modal/CancelBookingModal.vue";
  52. import CancellationPolicy from "@/components/booking/Modal/CancellationPolicyModal.vue";
  53. import BankingDetails from "@/components/booking/Modal/BankingDetailsModal.vue";
  54. import UploadRemittanceSlip from "@/components/booking/Modal/UploadRemittanceSlipModal.vue";
  55. export default {
  56. layout: "service",
  57. auth: true,
  58. components: {
  59. ContactInfo,
  60. Cancellation,
  61. PaymentDetails,
  62. BookingInfoItem,
  63. BookingInfo,
  64. ViewDetails,
  65. OtherDetails,
  66. NoticeDetails,
  67. ContactUs,
  68. CancelBooking,
  69. CancellationPolicy,
  70. BankingDetails,
  71. UploadRemittanceSlip,
  72. },
  73. data() {
  74. return {
  75. apiUrl: process.env.SERVICE_CONSOLE,
  76. content: {
  77. preview_image: "",
  78. country: null,
  79. city: null,
  80. name: "",
  81. highlights: "",
  82. details: "",
  83. cancellation_policy: "",
  84. saved: false,
  85. confirmation_time: 24,
  86. supplier: null,
  87. available_sections: null,
  88. timeStatus: '',
  89. dateStatus: '',
  90. times: [],
  91. start: '',
  92. end: '',
  93. faq: null,
  94. packages: [],
  95. additionalServices: [],
  96. booking_questions: [],
  97. },
  98. Supplier:{
  99. },
  100. BookingOrder: {
  101. order_question_answer:[],
  102. },
  103. PaymentDetails: [],
  104. ContactInfo: {
  105. type: Object,
  106. UserName: "Zack Yang",
  107. UserMail: "zackyang@gmail.com",
  108. UserPhone: "+8869-38-234-424",
  109. },
  110. BankingDetails: {
  111. type: Object,
  112. BankName: "E.SUN COMMERCIAL BANK,LTD.,TAIPEI,TAIWAN",
  113. SwiftCode: "ESUNTWTP",
  114. BankAddress:
  115. "No.66-1,Sanching Rd.,Nangang Dist.,Taipei City 115602,Taiwan",
  116. AccountNumber: "1182-879-079298",
  117. AccountName: "SHOWEASY CO.,LTD",
  118. },
  119. NoticeDetails: {
  120. type: Object,
  121. PickUpAddress:
  122. "3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
  123. DropOffAddress:
  124. "3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
  125. DriverName: "Zack Yang",
  126. DriverMail: "zackyang@gmail.com",
  127. DriverPhone: "+8869-38-234-424",
  128. },
  129. OtherDetail: [],
  130. ViewDetails: {
  131. type: Object,
  132. Deposit: "30.000",
  133. FirstPayment: "20.000",
  134. SecondPayment: "50.000",
  135. ThirdPayment: "60.000",
  136. FinalPayment: "40.000",
  137. TotalAmount: "200.000",
  138. },
  139. ContactUs: {
  140. type: Object,
  141. Phone: "+886-2-2725-5000",
  142. Mail: "info@showeasy.com",
  143. },
  144. };
  145. },
  146. async created() {
  147. if (this.$auth.loggedIn) {
  148. // await this.getOrder();
  149. // await this.getServiceData();
  150. // await this.getPackages();
  151. // await this.getAdditionalServices();
  152. // await this.getNotice();
  153. }
  154. },
  155. methods: {
  156. async getOrder() {
  157. await this.$axios
  158. .get(
  159. `/order/${this.$route.params.id}?jwt=${this.$auth.$storage.getUniversal("jwt").token
  160. }`
  161. )
  162. .then((res) => {
  163. this.BookingOrder = res.data[0];
  164. this.BookingOrder.subTotal = 0;
  165. for (let index in this.BookingOrder.order_payment) {
  166. this.BookingOrder.subTotal += this.BookingOrder.order_payment[index].amount;
  167. }
  168. this.ContactInfo = this.BookingOrder.order_contact[0];
  169. this.OtherDetail = this.BookingOrder.order_question_answer;
  170. this.PaymentDetails = this.BookingOrder.order_payment;
  171. this.serviceId = this.BookingOrder.service_id;
  172. this.currency = this.BookingOrder.currency;
  173. console.log(this.BookingOrder);
  174. })
  175. .catch((err) => {
  176. console.log(err);
  177. });
  178. },
  179. async getServiceData() {
  180. await this.$axios
  181. .get(
  182. `${this.apiUrl}/user-services/content?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  183. )
  184. .then((res) => {
  185. this.content.preview_image = res.data.preview_image;
  186. this.content.name = res.data.name;
  187. this.content.country = res.data.country;
  188. this.content.city = res.data.city;
  189. this.content.highlights = res.data.highlights;
  190. this.content.details = res.data.details;
  191. this.content.cancellation_policy = res.data.cancellation_policy;
  192. this.content.supplier = res.data.supplier;
  193. this.content.available_sections = res.data.available_sections;
  194. this.content.times = res.data.available_sections.times;
  195. this.content.timeStatus = res.data.available_sections.time_status;
  196. this.content.dateStatus = res.data.available_sections.date_status;
  197. this.content.start = res.data.available_sections.start;
  198. this.content.end = res.data.available_sections.end;
  199. this.content.payment_currency = res.data.payment_currency;
  200. this.content.booking_questions = res.data.booking_questions;
  201. this.Supplier = res.data.supplier;
  202. })
  203. .catch((error) => console.log(error));
  204. },
  205. async getPackages() {
  206. let orderPackageId = this.BookingOrder.order_item[0].package_id ? this.BookingOrder.order_item[0].package_id : "";
  207. await this.$axios
  208. .get(
  209. `${this.apiUrl}/user-services/packages?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  210. )
  211. .then((res) => {
  212. this.content.packages = res.data;
  213. let packageObject = this.content.packages[this.content.packages.findIndex(item => item.package_id === orderPackageId)]
  214. for (let i in packageObject.questions) {
  215. packageObject.questions[i].required = packageObject.questions[i].required_ans;
  216. this.content.booking_questions.push(packageObject.questions[i])
  217. }
  218. })
  219. .catch((error) => console.log(error));
  220. },
  221. async getAdditionalServices() {
  222. await this.$axios
  223. .get(
  224. `${this.apiUrl}/user-services/additional?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  225. )
  226. .then((res) => {
  227. this.content.additionalServices =
  228. res.data.services == [] ? null : res.data;
  229. if(this.BookingOrder.order_as.length > 0 ) {
  230. for (let i in this.content.additionalServices[0].questions) {
  231. this.content.additionalServices[0].questions[i].required = this.content.additionalServices[0].questions[i].required_ans;
  232. this.content.booking_questions.push(this.content.additionalServices[0].questions[i]);
  233. }
  234. }
  235. })
  236. .catch((error) => console.log(error));
  237. },
  238. async getNotice(){
  239. await this.$axios
  240. .get(
  241. `https://lambda.showeasy.com/order-message/ticket?order_no=${this.BookingOrder.order_display_id}&message_title=message`
  242. )
  243. .then((res) => {
  244. if(res.data.items.length > 0 ) {
  245. this.NoticeDetails = res.data.items[res.data.items.length-1];
  246. } else {
  247. this.NoticeDetails.message_content = "";
  248. }
  249. })
  250. .catch((error) => console.log(error));
  251. },
  252. },
  253. };
  254. </script>
  255. <style lang="scss" scoped></style>