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.

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