feat:商品详情的样式调整

This commit is contained in:
2025-09-11 21:23:27 +08:00
parent 9adba3efa3
commit 24206e8d79
8 changed files with 171 additions and 51 deletions

View File

@@ -13,7 +13,21 @@
<view class="goods-content">
<!-- 商品信息组件 -->
<GoodInfo :goodsData="goodsData" @showCalendar="showCalendar" />
<GoodInfo :goodsData="goodsData" />
<!-- 地址区域 -->
<LocationCard :orderData="goodsData" />
<!-- 日期选择区域 -->
<DateSelector
v-if="goodsData.commodityTypeCode === '0'"
@showCalendar="showCalendar"
:checkInDate="selectedDate.startDate"
:checkOutDate="selectedDate.endDate"
:checkInDay="''"
:checkOutDay="''"
:nights="selectedDate.totalDays"
/>
<view v-if="goodsData.commodityPurchaseInstruction" class="use-notice">
<ModuleTitle
@@ -97,11 +111,31 @@ import ModuleTitle from "@/components/ModuleTitle/index.vue";
import GoodConfirm from "./components/GoodConfirm/index.vue";
import Calender from "@/components/Calender/index.vue";
import { zniconsMap } from "@/static/fonts/znicons.js";
import LocationCard from "@/components/LocationCard/index.vue";
import DateSelector from "./components/DateSelector/index.vue";
const calendarVisible = ref(false);
const goodsData = ref({});
const goodConfirmRef = ref(null);
const selectedDate = ref();
// 格式化日期为 yyyy-mm-dd 格式
const formatDate = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
return `${year}-${month}-${day}`;
};
// 获取今天和明天的日期
const today = new Date();
const tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
const selectedDate = ref({
startDate: formatDate(today),
endDate: formatDate(tomorrow),
totalDays: 1,
});
const priceData = ref([]);
// 获取商品详情数据