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

<template>
<div
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"
>
<div class="section section-one">
<h2
class="t18 title-icon-left tw-text-black tw-mb-[21px] md:tw-mb-[31px] xl:tw-mb-[31px]"
>
{{ $t("Booking info") }}
</h2>
<BookingInfo
class="tw-mb-[20px]"
v-bind:BookingOrder="BookingOrder"
></BookingInfo>
<BookingInfoItem v-bind:info="BookingOrder"
v-bind:NoticeDetails="NoticeDetails"
v-bind:Supplier="Supplier"
v-bind:Img="content.preview_image"
></BookingInfoItem>
<PaymentDetails
class="tw-mb-[20px]"
v-bind:PaymentDetails="PaymentDetails"
v-bind:Currency="currency"
></PaymentDetails>
<ContactInfo
class="tw-mb-[20px]"
v-bind:ContactInfo="ContactInfo"
></ContactInfo>
<Cancellation v-bind:Policy="content.cancellation_policy"></Cancellation>
<ViewDetails v-bind:ViewDetails="PaymentDetails" v-bind:Currency="currency"></ViewDetails>
<OtherDetails v-bind:OtherDetail="OtherDetail"></OtherDetails>
<NoticeDetails v-bind:NoticeDetails="NoticeDetails"></NoticeDetails>
<ContactUs v-bind:ContactUs="ContactUs"></ContactUs>
<CancelBooking ></CancelBooking>
<CancellationPolicy v-bind:Policy="content.cancellation_policy"></CancellationPolicy>
<BankingDetails v-bind:BankingDetails="BankingDetails"></BankingDetails>
<UploadRemittanceSlip></UploadRemittanceSlip>
</div>
</div>
</template>
<script>
import ContactInfo from "@/components/booking/ContactInfo";
import Cancellation from "@/components/booking/Cancellation";
import PaymentDetails from "@/components/booking/PaymentDetails";
import BookingInfoItem from "@/components/booking/BookingInfoItem";
import BookingInfo from "@/components/booking/BookingInfo";
import ViewDetails from "@/components/booking/Modal/ViewDetailsModal.vue";
import OtherDetails from "@/components/booking/Modal/OtherDetailsModal.vue";
import NoticeDetails from "@/components/booking/Modal/NoticeDetailsModal.vue";
import ContactUs from "@/components/booking/Modal/ContactUsModal.vue";
import CancelBooking from "@/components/booking/Modal/CancelBookingModal.vue";
import CancellationPolicy from "@/components/booking/Modal/CancellationPolicyModal.vue";
import BankingDetails from "@/components/booking/Modal/BankingDetailsModal.vue";
import UploadRemittanceSlip from "@/components/booking/Modal/UploadRemittanceSlipModal.vue";
export default {
layout: "service",
auth: true,
components: {
ContactInfo,
Cancellation,
PaymentDetails,
BookingInfoItem,
BookingInfo,
ViewDetails,
OtherDetails,
NoticeDetails,
ContactUs,
CancelBooking,
CancellationPolicy,
BankingDetails,
UploadRemittanceSlip,
},
data() {
return {
apiUrl: process.env.SERVICE_CONSOLE,
content: {
preview_image: "",
country: null,
city: null,
name: "",
highlights: "",
details: "",
cancellation_policy: "",
saved: false,
confirmation_time: 24,
supplier: null,
available_sections: null,
timeStatus: '',
dateStatus: '',
times: [],
start: '',
end: '',
faq: null,
packages: [],
additionalServices: [],
booking_questions: [],
},
Supplier:{
},
BookingOrder: {
order_question_answer:[],
},
PaymentDetails: [],
ContactInfo: {
type: Object,
UserName: "Zack Yang",
UserMail: "zackyang@gmail.com",
UserPhone: "+8869-38-234-424",
},
BankingDetails: {
type: Object,
BankName: "E.SUN COMMERCIAL BANK,LTD.,TAIPEI,TAIWAN",
SwiftCode: "ESUNTWTP",
BankAddress:
"No.66-1,Sanching Rd.,Nangang Dist.,Taipei City 115602,Taiwan",
AccountNumber: "1182-879-079298",
AccountName: "SHOWEASY CO.,LTD",
},
NoticeDetails: {
type: Object,
PickUpAddress:
"3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
DropOffAddress:
"3rd Floor,No 457,Chongyang Road,Nangang District,Taipei City,Taiwan,11560",
DriverName: "Zack Yang",
DriverMail: "zackyang@gmail.com",
DriverPhone: "+8869-38-234-424",
},
OtherDetail: [],
ViewDetails: {
type: Object,
Deposit: "30.000",
FirstPayment: "20.000",
SecondPayment: "50.000",
ThirdPayment: "60.000",
FinalPayment: "40.000",
TotalAmount: "200.000",
},
ContactUs: {
type: Object,
Phone: "+886-2-2725-5000",
Mail: "info@showeasy.com",
},
};
},
async created() {
if (this.$auth.loggedIn) {
// await this.getOrder();
// await this.getServiceData();
// await this.getPackages();
// await this.getAdditionalServices();
// await this.getNotice();
}
},
methods: {
async getOrder() {
await this.$axios
.get(
`/order/${this.$route.params.id}?jwt=${this.$auth.$storage.getUniversal("jwt").token
}`
)
.then((res) => {
this.BookingOrder = res.data[0];
this.BookingOrder.subTotal = 0;
for (let index in this.BookingOrder.order_payment) {
this.BookingOrder.subTotal += this.BookingOrder.order_payment[index].amount;
}
this.ContactInfo = this.BookingOrder.order_contact[0];
this.OtherDetail = this.BookingOrder.order_question_answer;
this.PaymentDetails = this.BookingOrder.order_payment;
this.serviceId = this.BookingOrder.service_id;
this.currency = this.BookingOrder.currency;
console.log(this.BookingOrder);
})
.catch((err) => {
console.log(err);
});
},
async getServiceData() {
await this.$axios
.get(
`${this.apiUrl}/user-services/content?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
)
.then((res) => {
this.content.preview_image = res.data.preview_image;
this.content.name = res.data.name;
this.content.country = res.data.country;
this.content.city = res.data.city;
this.content.highlights = res.data.highlights;
this.content.details = res.data.details;
this.content.cancellation_policy = res.data.cancellation_policy;
this.content.supplier = res.data.supplier;
this.content.available_sections = res.data.available_sections;
this.content.times = res.data.available_sections.times;
this.content.timeStatus = res.data.available_sections.time_status;
this.content.dateStatus = res.data.available_sections.date_status;
this.content.start = res.data.available_sections.start;
this.content.end = res.data.available_sections.end;
this.content.payment_currency = res.data.payment_currency;
this.content.booking_questions = res.data.booking_questions;
this.Supplier = res.data.supplier;
})
.catch((error) => console.log(error));
},
async getPackages() {
let orderPackageId = this.BookingOrder.order_item[0].package_id ? this.BookingOrder.order_item[0].package_id : "";
await this.$axios
.get(
`${this.apiUrl}/user-services/packages?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
)
.then((res) => {
this.content.packages = res.data;
let packageObject = this.content.packages[this.content.packages.findIndex(item => item.package_id === orderPackageId)]
for (let i in packageObject.questions) {
packageObject.questions[i].required = packageObject.questions[i].required_ans;
this.content.booking_questions.push(packageObject.questions[i])
}
})
.catch((error) => console.log(error));
},
async getAdditionalServices() {
await this.$axios
.get(
`${this.apiUrl}/user-services/additional?service_id=${this.serviceId}&lang_code=${this.$i18n.localeProperties["langQuery"]}&currency=${this.currency}`
)
.then((res) => {
this.content.additionalServices =
res.data.services == [] ? null : res.data;
if(this.BookingOrder.order_as.length > 0 ) {
for (let i in this.content.additionalServices[0].questions) {
this.content.additionalServices[0].questions[i].required = this.content.additionalServices[0].questions[i].required_ans;
this.content.booking_questions.push(this.content.additionalServices[0].questions[i]);
}
}
})
.catch((error) => console.log(error));
},
async getNotice(){
await this.$axios
.get(
`https://lambda.showeasy.com/order-message/ticket?order_no=${this.BookingOrder.order_display_id}&message_title=message`
)
.then((res) => {
if(res.data.items.length > 0 ) {
this.NoticeDetails = res.data.items[res.data.items.length-1];
} else {
this.NoticeDetails.message_content = "";
}
})
.catch((error) => console.log(error));
},
},
};
</script>
<style lang="scss" scoped></style>