|
@@ -1,35 +1,28 @@
|
|
<template>
|
|
<template>
|
|
- <div class="pb-120">
|
|
|
|
|
|
+ <div class="pb-120 bg-[#F8F8F8]">
|
|
<TravelProjectDetailBanner
|
|
<TravelProjectDetailBanner
|
|
:banner-list="detailData?.tourismFile?.fileUrlsAfterConvert"
|
|
:banner-list="detailData?.tourismFile?.fileUrlsAfterConvert"
|
|
/>
|
|
/>
|
|
<TravelProjectDetailBaseInfo :detail-data="detailData" />
|
|
<TravelProjectDetailBaseInfo :detail-data="detailData" />
|
|
- <div class="h-10 bg-[#E6E6E6]"></div>
|
|
|
|
- <div class="px-15">
|
|
|
|
- <TravelProjectDetailBookInfo
|
|
|
|
- v-model:startDate="bookInfo.startDate"
|
|
|
|
- v-model:adultNumber="bookInfo.adultNumber"
|
|
|
|
- v-model:childrenNumber="bookInfo.childrenNumber"
|
|
|
|
- v-model:customerName="bookInfo.customerName"
|
|
|
|
- v-model:customerMobile="bookInfo.customerMobile"
|
|
|
|
- v-model:customerMobileStandby="bookInfo.customerMobileStandby"
|
|
|
|
- v-model:customerWechat="bookInfo.customerWechat"
|
|
|
|
- :calendar-data="calendarData"
|
|
|
|
- :detail-data="detailData"
|
|
|
|
- />
|
|
|
|
- <TravelProjectDetailSellingPoint
|
|
|
|
- v-if="detailData?.sellingPoint"
|
|
|
|
- :detail-data="detailData"
|
|
|
|
- class="mt-20"
|
|
|
|
- />
|
|
|
|
- <TravelProjectDetailSpecialTips class="mt-20" />
|
|
|
|
- <TravelProjectDetailDetails :detail-data="detailData" class="mt-20" />
|
|
|
|
- </div>
|
|
|
|
|
|
+ <TravelProjectDetailPinTuan
|
|
|
|
+ v-if="detailData?.hasGroup == 1 && !fromUserId"
|
|
|
|
+ :detail-data="detailData"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <TravelProjectDetailDetails :detail-data="detailData" class="mt-20" />
|
|
|
|
+
|
|
<TravelProjectDetailBottomBar
|
|
<TravelProjectDetailBottomBar
|
|
- :total-price="totalPrice"
|
|
|
|
|
|
+ v-if="!fromUserId"
|
|
:detail-data="detailData"
|
|
:detail-data="detailData"
|
|
- :loading="submitLoading"
|
|
|
|
- @onOk="handleSubmit"
|
|
|
|
|
|
+ @onOk="nomalBookModalOptions.show = true"
|
|
|
|
+ />
|
|
|
|
+ <TravelProjectDetailPinTuanSharedBottomBar
|
|
|
|
+ v-if="fromUserId"
|
|
|
|
+ :project-data="detailData"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <TravelProjectDetailNomalBookModal
|
|
|
|
+ v-model:show="nomalBookModalOptions.show"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -37,6 +30,8 @@
|
|
<script setup>
|
|
<script setup>
|
|
const id = useRouteParam("id");
|
|
const id = useRouteParam("id");
|
|
|
|
|
|
|
|
+const fromUserId = useRouteQuery("fromUserId");
|
|
|
|
+
|
|
const bookInfo = reactive({
|
|
const bookInfo = reactive({
|
|
startDate: null,
|
|
startDate: null,
|
|
adultNumber: 1,
|
|
adultNumber: 1,
|
|
@@ -51,114 +46,118 @@ const { data: detailData, status } = await useMyFetch(
|
|
`website/tourism/project/detail?id=${id.value}`
|
|
`website/tourism/project/detail?id=${id.value}`
|
|
);
|
|
);
|
|
|
|
|
|
-const dayjs = useDayjs();
|
|
|
|
-const calendarData = ref({});
|
|
|
|
-async function getCalendarData() {
|
|
|
|
- const { data } = await request("/website/tourism/project/viewDatePrice", {
|
|
|
|
- query: {
|
|
|
|
- projectId: id.value,
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- calendarData.value = data.tourismProjectDatePriceVos ?? {};
|
|
|
|
- const minDay = dayjs.min(
|
|
|
|
- Object.keys(calendarData.value).map((e) => dayjs(e))
|
|
|
|
- );
|
|
|
|
- bookInfo.startDate =
|
|
|
|
- minDay === null ? null : dayjs(minDay).format("YYYY-MM-DD");
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const totalPrice = ref("");
|
|
|
|
-
|
|
|
|
-watch(
|
|
|
|
- bookInfo,
|
|
|
|
- () => {
|
|
|
|
- // 计算总价
|
|
|
|
- const calendarInfo = calendarData.value[bookInfo.startDate] ?? {
|
|
|
|
- adultPrice: 0,
|
|
|
|
- childrenPrice: 0,
|
|
|
|
- };
|
|
|
|
- totalPrice.value = `${
|
|
|
|
- bookInfo.adultNumber * calendarInfo.adultPrice +
|
|
|
|
- bookInfo.childrenNumber * calendarInfo.childrenPrice
|
|
|
|
- }`;
|
|
|
|
- },
|
|
|
|
- { deep: true }
|
|
|
|
-);
|
|
|
|
-
|
|
|
|
-const route = useRoute();
|
|
|
|
-
|
|
|
|
-const useAuth = useAuthStore();
|
|
|
|
-
|
|
|
|
-const { token } = storeToRefs(useAuth);
|
|
|
|
-
|
|
|
|
-async function handleSubmit() {
|
|
|
|
- if (!token.value) {
|
|
|
|
- await navigateTo({
|
|
|
|
- path: "/login",
|
|
|
|
- replace: true,
|
|
|
|
- query: {
|
|
|
|
- redirect: route.fullPath,
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- handleSubmitInfo();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const submitLoading = ref(false);
|
|
|
|
-function handleSubmitInfo() {
|
|
|
|
- if (!bookInfo.customerName) {
|
|
|
|
- showToast("请输入联系人姓名");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!bookInfo.customerMobile) {
|
|
|
|
- showToast("请输入手机号");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!bookInfo.customerWechat) {
|
|
|
|
- showToast("请输入微信号");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- submitLoading.value = true;
|
|
|
|
- request("/website/tourism/myOrder/add", {
|
|
|
|
- method: "post",
|
|
|
|
- body: {
|
|
|
|
- tourBookInfoDto: {
|
|
|
|
- projectId: id.value,
|
|
|
|
- type: "1",
|
|
|
|
- ...bookInfo,
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- .then(({ data }) => {
|
|
|
|
- submitLoading.value = false;
|
|
|
|
- if (data === 1) {
|
|
|
|
- showDialog({
|
|
|
|
- title: "预定成功",
|
|
|
|
- message:
|
|
|
|
- "因为旅游预定涉及较多的环节,我们需要线下和您沟通,我们会尽快与你联系并为您提供最真诚的服务。",
|
|
|
|
- }).then(() => {});
|
|
|
|
- } else if (data === 2) {
|
|
|
|
- showDialog({
|
|
|
|
- title: "您已预定",
|
|
|
|
- message:
|
|
|
|
- "因为旅游预定涉及较多的环节,我们需要线下和您沟通,我们会尽快与你联系并为您提供最真诚的服务。",
|
|
|
|
- }).then(() => {
|
|
|
|
- // on close
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- submitLoading.value = false;
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-onMounted(() => {
|
|
|
|
- getCalendarData();
|
|
|
|
|
|
+const nomalBookModalOptions = reactive({
|
|
|
|
+ show: false,
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+// const dayjs = useDayjs();
|
|
|
|
+// const calendarData = ref({});
|
|
|
|
+// async function getCalendarData() {
|
|
|
|
+// const { data } = await request("/website/tourism/project/viewDatePrice", {
|
|
|
|
+// query: {
|
|
|
|
+// projectId: id.value,
|
|
|
|
+// },
|
|
|
|
+// });
|
|
|
|
+// calendarData.value = data.tourismProjectDatePriceVos ?? {};
|
|
|
|
+// const minDay = dayjs.min(
|
|
|
|
+// Object.keys(calendarData.value).map((e) => dayjs(e))
|
|
|
|
+// );
|
|
|
|
+// bookInfo.startDate =
|
|
|
|
+// minDay === null ? null : dayjs(minDay).format("YYYY-MM-DD");
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// const totalPrice = ref("");
|
|
|
|
+
|
|
|
|
+// watch(
|
|
|
|
+// bookInfo,
|
|
|
|
+// () => {
|
|
|
|
+// // 计算总价
|
|
|
|
+// const calendarInfo = calendarData.value[bookInfo.startDate] ?? {
|
|
|
|
+// adultPrice: 0,
|
|
|
|
+// childrenPrice: 0,
|
|
|
|
+// };
|
|
|
|
+// totalPrice.value = `${
|
|
|
|
+// bookInfo.adultNumber * calendarInfo.adultPrice +
|
|
|
|
+// bookInfo.childrenNumber * calendarInfo.childrenPrice
|
|
|
|
+// }`;
|
|
|
|
+// },
|
|
|
|
+// { deep: true }
|
|
|
|
+// );
|
|
|
|
+
|
|
|
|
+// const route = useRoute();
|
|
|
|
+
|
|
|
|
+// const useAuth = useAuthStore();
|
|
|
|
+
|
|
|
|
+// const { token } = storeToRefs(useAuth);
|
|
|
|
+
|
|
|
|
+// async function handleSubmit() {
|
|
|
|
+// if (!token.value) {
|
|
|
|
+// await navigateTo({
|
|
|
|
+// path: "/login",
|
|
|
|
+// replace: true,
|
|
|
|
+// query: {
|
|
|
|
+// redirect: route.fullPath,
|
|
|
|
+// },
|
|
|
|
+// });
|
|
|
|
+
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// handleSubmitInfo();
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// const submitLoading = ref(false);
|
|
|
|
+// function handleSubmitInfo() {
|
|
|
|
+// if (!bookInfo.customerName) {
|
|
|
|
+// showToast("请输入联系人姓名");
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// if (!bookInfo.customerMobile) {
|
|
|
|
+// showToast("请输入手机号");
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// if (!bookInfo.customerWechat) {
|
|
|
|
+// showToast("请输入微信号");
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+// submitLoading.value = true;
|
|
|
|
+// request("/website/tourism/myOrder/add", {
|
|
|
|
+// method: "post",
|
|
|
|
+// body: {
|
|
|
|
+// tourBookInfoDto: {
|
|
|
|
+// projectId: id.value,
|
|
|
|
+// type: "1",
|
|
|
|
+// ...bookInfo,
|
|
|
|
+// },
|
|
|
|
+// },
|
|
|
|
+// })
|
|
|
|
+// .then(({ data }) => {
|
|
|
|
+// submitLoading.value = false;
|
|
|
|
+// if (data === 1) {
|
|
|
|
+// showDialog({
|
|
|
|
+// title: "预定成功",
|
|
|
|
+// message:
|
|
|
|
+// "因为旅游预定涉及较多的环节,我们需要线下和您沟通,我们会尽快与你联系并为您提供最真诚的服务。",
|
|
|
|
+// }).then(() => {});
|
|
|
|
+// } else if (data === 2) {
|
|
|
|
+// showDialog({
|
|
|
|
+// title: "您已预定",
|
|
|
|
+// message:
|
|
|
|
+// "因为旅游预定涉及较多的环节,我们需要线下和您沟通,我们会尽快与你联系并为您提供最真诚的服务。",
|
|
|
|
+// }).then(() => {
|
|
|
|
+// // on close
|
|
|
|
+// });
|
|
|
|
+// }
|
|
|
|
+// })
|
|
|
|
+// .catch(() => {
|
|
|
|
+// submitLoading.value = false;
|
|
|
|
+// });
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// onMounted(() => {
|
|
|
|
+// getCalendarData();
|
|
|
|
+// });
|
|
|
|
+
|
|
// watch(
|
|
// watch(
|
|
// bookInfo,
|
|
// bookInfo,
|
|
// () => {
|
|
// () => {
|