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.

338 lines
12 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
  1. <template>
  2. <div id="print" ref="print"
  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. :BookingOrder="BookingOrder"
  14. @contact-us="activeContactUs"
  15. @view-details="activeViewDetails"
  16. @cancellation-policy="activeCancellationPolicy"
  17. @cancel-booking="activeCancelBooking"
  18. ></BookingInfo>
  19. <ContactUs :ContactUs="ContactUs"></ContactUs>
  20. <CancellationPolicy :Policy="BookingOrder.CancellationPolicy"></CancellationPolicy>
  21. <ViewDetails :BookingOrder="BookingOrder"></ViewDetails>
  22. <CancelBooking :BookingOrder="BookingOrder"></CancelBooking>
  23. <BookingInfoItem :info="BookingOrder" @other-details="activeOtherDetails" @notice-details="activeNoticeDetails"></BookingInfoItem>
  24. <OtherDetails :BookingOrder="BookingOrder"></OtherDetails>
  25. <NoticeDetails :BookingOrder="BookingOrder"></NoticeDetails>
  26. <PaymentDetails
  27. class="tw-mb-[20px]"
  28. @banking-details = "activeBankingDetails"
  29. @upload-remittanceSlip = "activeUpload"
  30. :BookingOrder="BookingOrder"
  31. ></PaymentDetails>
  32. <BankingDetails :BankingDetails="BankingDetails"></BankingDetails>
  33. <UploadRemittanceSlip></UploadRemittanceSlip>
  34. <Cancellation :Policy="BookingOrder.CancellationPolicy" class="tw-mb-[20px]"></Cancellation>
  35. <div class="element tw-hidden xl:tw-flex xl:tw-justify-center xl:tw-items-center xl:tw-mt-[12px] no-print">
  36. <button @click="onPrint()"
  37. 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">
  38. {{ $t("Print this page") }}
  39. </button>
  40. </div>
  41. <!-- <ContactInfo
  42. class="tw-mb-[20px]"
  43. :ContactInfo="ContactInfo"
  44. ></ContactInfo> -->
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import ContactInfo from "@/components/booking/ContactInfo";
  50. import Cancellation from "@/components/booking/Cancellation";
  51. import PaymentDetails from "@/components/booking/PaymentDetails";
  52. import BookingInfoItem from "@/components/booking/BookingInfoItem";
  53. import BookingInfo from "@/components/booking/BookingInfo";
  54. import ViewDetails from "@/components/booking/Modal/ViewDetailsModal.vue";
  55. import OtherDetails from "@/components/booking/Modal/OtherDetailsModal.vue";
  56. import NoticeDetails from "@/components/booking/Modal/NoticeDetailsModal.vue";
  57. import ContactUs from "@/components/booking/Modal/ContactUsModal.vue";
  58. import CancelBooking from "@/components/booking/Modal/CancelBookingModal.vue";
  59. import CancellationPolicy from "@/components/booking/Modal/CancellationPolicyModal.vue";
  60. import BankingDetails from "@/components/booking/Modal/BankingDetailsModal.vue";
  61. import UploadRemittanceSlip from "@/components/booking/Modal/UploadRemittanceSlipModal.vue";
  62. export default {
  63. layout: "service",
  64. auth: true,
  65. components: {
  66. ContactInfo,
  67. Cancellation,
  68. PaymentDetails,
  69. BookingInfoItem,
  70. BookingInfo,
  71. ViewDetails,
  72. OtherDetails,
  73. NoticeDetails,
  74. ContactUs,
  75. CancelBooking,
  76. CancellationPolicy,
  77. BankingDetails,
  78. UploadRemittanceSlip,
  79. },
  80. data() {
  81. return {
  82. apiUrl: process.env.SERVICE_CONSOLE,
  83. content: {
  84. preview_image: "",
  85. country: null,
  86. city: null,
  87. name: "",
  88. highlights: "",
  89. details: "",
  90. cancellation_policy: "",
  91. saved: false,
  92. confirmation_time: 24,
  93. supplier: null,
  94. available_sections: null,
  95. timeStatus: '',
  96. dateStatus: '',
  97. times: [],
  98. start: '',
  99. end: '',
  100. faq: null,
  101. packages: [],
  102. additionalServices: [],
  103. booking_questions: [],
  104. },
  105. Supplier:{
  106. },
  107. BookingOrder: {},
  108. PaymentDetails: [],
  109. ContactInfo: {
  110. //type: Object,
  111. // UserName: "Zack Yang",
  112. // UserMail: "zackyang@gmail.com",
  113. // UserPhone: "+8869-38-234-424",
  114. },
  115. BankingDetails: {
  116. type: Object,
  117. BankName: "E.SUN COMMERCIAL BANK,LTD.,TAIPEI,TAIWAN",
  118. SwiftCode: "ESUNTWTP",
  119. BankAddress:
  120. "No.66-1,Sanching Rd.,Nangang Dist.,Taipei City 115602,Taiwan",
  121. AccountNumber: "1182-879-079298",
  122. AccountName: "SHOWEASY CO.,LTD",
  123. },
  124. NoticeDetails: {
  125. type: Object,
  126. PickUpAddress:
  127. "3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
  128. DropOffAddress:
  129. "3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
  130. DriverName: "Zack Yang",
  131. DriverMail: "zackyang@gmail.com",
  132. DriverPhone: "+8869-38-234-424",
  133. },
  134. OtherDetail: [],
  135. ViewDetails: {
  136. type: Object,
  137. Deposit: "30.000",
  138. FirstPayment: "20.000",
  139. SecondPayment: "50.000",
  140. ThirdPayment: "60.000",
  141. FinalPayment: "40.000",
  142. TotalAmount: "200.000",
  143. },
  144. ContactUs: {
  145. type: Object,
  146. Phone: "+886-2-2725-5000",
  147. Mail: "info@showeasy.com",
  148. },
  149. onsiteService: {},
  150. payment: {},
  151. };
  152. },
  153. async created() {
  154. await this.getOrder();
  155. if (this.$auth.authtoken != null) {
  156. // await this.getServiceData();
  157. // await this.getPackages();
  158. // await this.getAdditionalServices();
  159. // await this.getNotice();
  160. }
  161. },
  162. methods: {
  163. print() {
  164. if (process.browser) {
  165. this.$nextTick(()=>{
  166. window.print();
  167. });
  168. }
  169. },
  170. onPrint() {
  171. this.$print(this.$refs.print)
  172. this.$nextTick(()=>{
  173. let arr=document.getElementsByClassName('isNeedRemove')
  174. if(arr.length) arr[0].remove();
  175. })
  176. },
  177. async getOrder() {
  178. await this.$axios
  179. .get(`/trending/api/BookingOnline/Booking?BookingID&BookingNo=${this.$route.params.id}&Lang=${this.$i18n.localeProperties["langQuery"]}`)
  180. .then((response) => {
  181. // console.log(response.data.DATA.rel);
  182. const data = response.data.DATA.rel;
  183. this.BookingOrder = data;
  184. // this.onsiteService = this.BookingOrder.OnSiteService;
  185. // console.log("OnSiteService: " + this.BookingOrder.OnSiteService);
  186. // if(response && response.data && response.data.DATA && response.data.DATA.rel){
  187. // let data = response.data.DATA.rel
  188. // if(data){
  189. // this.BookingOrder = data;
  190. // this.onsiteService = this.BookingOrder.OnSiteService;
  191. // console.log("OnSiteService: " + this.this.BookingOrder.OnSiteService);
  192. // console.log("ProviderName: " + this.this.BookingOrder.OnSiteService.Provider.ProviderName);
  193. // this.payment = this.BookingOrder.Payment;
  194. // //console.log(this.BookingOrder.Provider.ProviderID);
  195. // this.ContactInfo = this.BookingOrder.BookingContact;
  196. // this.PaymentDetails = this.BookingOrder.map((item) => {
  197. // return {
  198. // method: item.Payment.PaymentMethod,
  199. // terms: item.Payment.PaymentTerms,
  200. // date: item.Payment.PaymentDate,
  201. // amount: item.TotalPrice,
  202. // };
  203. // });
  204. // this.serviceId = this.BookingOrder.OnSiteService.ServiceID;
  205. // this.currency = this.BookingOrder.CurrencyID;
  206. // }
  207. // }
  208. })
  209. .catch((error) => {
  210. console.log(error);
  211. });
  212. },
  213. async getServiceData() {
  214. await this.$axios
  215. .get(
  216. `${this.apiUrl}/user-services/content?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  217. )
  218. .then((res) => {
  219. this.content.preview_image = res.data.preview_image;
  220. this.content.name = res.data.name;
  221. this.content.country = res.data.country;
  222. this.content.city = res.data.city;
  223. this.content.highlights = res.data.highlights;
  224. this.content.details = res.data.details;
  225. this.content.cancellation_policy = res.data.cancellation_policy;
  226. this.content.supplier = res.data.supplier;
  227. this.content.available_sections = res.data.available_sections;
  228. this.content.times = res.data.available_sections.times;
  229. this.content.timeStatus = res.data.available_sections.time_status;
  230. this.content.dateStatus = res.data.available_sections.date_status;
  231. this.content.start = res.data.available_sections.start;
  232. this.content.end = res.data.available_sections.end;
  233. this.content.payment_currency = res.data.payment_currency;
  234. this.content.booking_questions = res.data.booking_questions;
  235. this.Supplier = res.data.supplier;
  236. })
  237. .catch((error) => console.log(error));
  238. },
  239. async getPackages() {
  240. let orderPackageId = this.BookingOrder.order_item[0].package_id ? this.BookingOrder.order_item[0].package_id : "";
  241. await this.$axios
  242. .get(
  243. `${this.apiUrl}/user-services/packages?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  244. )
  245. .then((res) => {
  246. this.content.packages = res.data;
  247. let packageObject = this.content.packages[this.content.packages.findIndex(item => item.package_id === orderPackageId)]
  248. for (let i in packageObject.questions) {
  249. packageObject.questions[i].required = packageObject.questions[i].required_ans;
  250. this.content.booking_questions.push(packageObject.questions[i])
  251. }
  252. })
  253. .catch((error) => console.log(error));
  254. },
  255. async getAdditionalServices() {
  256. await this.$axios
  257. .get(
  258. `${this.apiUrl}/user-services/additional?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
  259. )
  260. .then((res) => {
  261. this.content.additionalServices =
  262. res.data.services == [] ? null : res.data;
  263. if(this.BookingOrder.order_as.length > 0 ) {
  264. for (let i in this.content.additionalServices[0].questions) {
  265. this.content.additionalServices[0].questions[i].required = this.content.additionalServices[0].questions[i].required_ans;
  266. this.content.booking_questions.push(this.content.additionalServices[0].questions[i]);
  267. }
  268. }
  269. })
  270. .catch((error) => console.log(error));
  271. },
  272. async getNotice(){
  273. await this.$axios
  274. .get(
  275. `https://lambda.showeasy.com/order-message/ticket?order_no=${this.BookingOrder.order_display_id}&message_title=message`
  276. )
  277. .then((res) => {
  278. if(res.data.items.length > 0 ) {
  279. this.NoticeDetails = res.data.items[res.data.items.length-1];
  280. } else {
  281. this.NoticeDetails.message_content = "";
  282. }
  283. })
  284. .catch((error) => console.log(error));
  285. },
  286. activeContactUs() {
  287. this.$modal.show("ContactUs");
  288. },
  289. activeViewDetails() {
  290. this.$modal.show("ViewDetails");
  291. },
  292. activeCancellationPolicy() {
  293. this.$modal.show("CancellationPolicy");
  294. },
  295. activeCancelBooking() {
  296. this.$modal.show("CancelBooking");
  297. },
  298. activeBankingDetails(){
  299. this.$modal.show("BankingDetails");
  300. },
  301. activeUpload(){
  302. this.$modal.show("UploadRemittanceSlip");
  303. },
  304. activeOtherDetails() {
  305. this.$modal.show("OtherDetails");
  306. },
  307. activeNoticeDetails() {
  308. this.$modal.show("NoticeDetails");
  309. },
  310. },
  311. };
  312. </script>
  313. <style lang="scss" scoped>
  314. .print {
  315. &::before {
  316. content: "";
  317. display: inline-block;
  318. position: relative;
  319. background-image: url("~/assets/svg/print.svg");
  320. background-position: center;
  321. background-repeat: no-repeat;
  322. background-size: cover;
  323. width: 20px;
  324. height: 20px;
  325. margin-right: 14px;
  326. }
  327. }
  328. </style>