Browse Source

看房

master
mk 1 week ago
parent
commit
203e55abbc
  1. 2
      .env.development
  2. 14
      epmet-apartment-front/index.html
  3. BIN
      public/favicon.ico
  4. 2
      src/components/AppHeader.vue
  5. 83
      src/components/Crumbs.vue
  6. 6
      src/components/home/PolicyInfo.vue
  7. 6
      src/router/index.js
  8. 43
      src/views/policy/index.vue
  9. 55
      src/views/showings/apartmentDetail.vue
  10. 140
      src/views/showings/houseDetail.vue
  11. 42
      src/views/showings/roomTypeList.vue
  12. 1
      tailwind.config.js

2
.env.development

@ -1,6 +1,6 @@
#环境标识 #环境标识
VITE_ENV="开发环境" VITE_ENV="开发环境"
#基础服务 #基础服务
VITE_API_URL="http://192.168.1.144:8080/mz-api" VITE_API_URL="http://219.146.91.110:30801/mz-api"
VITE_AMAP_KEY = 8b6b7a05f40d067af88f6f211412984e VITE_AMAP_KEY = 8b6b7a05f40d067af88f6f211412984e
VITE_AMAP_SECURITY_KEY = 7439b95b4bb1850da7e5a1d65f1b8fc3 VITE_AMAP_SECURITY_KEY = 7439b95b4bb1850da7e5a1d65f1b8fc3

14
epmet-apartment-front/index.html

@ -7,10 +7,20 @@
<link rel="apple-touch-icon" href="/favicon.svg"> <link rel="apple-touch-icon" href="/favicon.svg">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>青岛市免租金住房保障平台</title> <title>青岛市免租金住房保障平台</title>
<script type="module" crossorigin src="/epmet-apartment-front/static/index-IXqfAMPy.js"></script> <script type="module" crossorigin src="/epmet-apartment-front/static/index-DBbyya2E.js"></script>
<link rel="stylesheet" crossorigin href="/epmet-apartment-front/static/index-Cb-gE271.css"> <link rel="stylesheet" crossorigin href="/epmet-apartment-front/static/index-CIEWPu3s.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>
<style type="text/css">
.amap-logo{
display: none;
opacity:0 !important;
}
.amap-copyright {
opacity:0;
}
</style>

BIN
public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

2
src/components/AppHeader.vue

@ -104,7 +104,7 @@ const navigationConfig = [
key: 'policy' key: 'policy'
}, },
{ {
name: '看房选房', name: '选房',
path: '/Showings', path: '/Showings',
key: 'Showings' key: 'Showings'
}, },

83
src/components/Crumbs.vue

@ -0,0 +1,83 @@
<!--
面包屑导航组件
使用方法
<Crumbs
:breadcrumbs="[
{ title: '首页', path: '/' },
{ title: '政策资讯', path: '/policy' },
{ title: '详情', path: '' }
]"
/>
参数说明
- breadcrumbs: 面包屑数组
- title: 显示的文字
- path: 点击跳转的路径最后一个为空字符串表示不可点击
- query: 查询参数
- width: 宽度
特性
- 自动处理分隔符
- 最后一个项目不可点击
- 支持路由跳转
- 响应式设计
-->
<template>
<div :class="`flex items-center text-base text-white w-[${width}px] mx-auto mt-10`">
<template v-for="(item, index) in breadcrumbs" :key="index">
<!-- 面包屑项 -->
<div class="flex items-center">
<!-- 分隔符 -->
<span v-if="index > 0" class="mx-3 text-white opacity-70">></span>
<!-- 面包屑链接 -->
<span
v-if="index < breadcrumbs.length - 1"
class="cursor-pointer hover:text-blue-200 transition-colors duration-200"
@click="handleClick(item.path, item.query)"
>
{{ item.title }}
</span>
<!-- 最后一个面包屑项不可点击 -->
<span v-else class="text-white font-medium">
{{ item.title }}
</span>
</div>
</template>
</div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router'
//
interface BreadcrumbItem {
title: string
path: string
}
//
interface Props {
breadcrumbs: BreadcrumbItem[]
width: number
}
//
const props = defineProps<Props>()
// 使
const router = useRouter()
//
const handleClick = (path: string, query: any) => {
if (path) {
router.push({ path: path, query: query })
}
}
</script>
<style scoped>
/* 可以添加自定义样式 */
</style>

6
src/components/home/PolicyInfo.vue

@ -34,6 +34,7 @@
:key="index" :key="index"
class="relative ml-10 w-min-[450px] h-min-[300px]" class="relative ml-10 w-min-[450px] h-min-[300px]"
style="min-width: 450px; min-height: 300px" style="min-width: 450px; min-height: 300px"
@click="handleClickPolicy(item)"
> >
<img :src="item.coverImg" class="w-full h-full rounded-md" alt="" /> <img :src="item.coverImg" class="w-full h-full rounded-md" alt="" />
<span <span
@ -43,7 +44,7 @@
</div> </div>
</div> </div>
<div class="flex flex-col mt-20 pl-14"> <div class="flex flex-col mt-20 pl-14">
<div v-for="(item, index) in policytList" :key="index"> <div v-for="(item, index) in policytList" :key="index" @click="handleClickPolicy(item)">
<span class="text-blue-600 mr-5 date relative"> <span class="text-blue-600 mr-5 date relative">
{{ item.createTime }} {{ item.createTime }}
</span> </span>
@ -98,6 +99,9 @@ defineProps({
const handleClickTab = (item) => { const handleClickTab = (item) => {
emit('tab-change', item) emit('tab-change', item)
} }
const handleClickPolicy = (item) => {
router.push(`/policy?id=${item.id}`)
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

6
src/router/index.js

@ -4,6 +4,7 @@ import Policy from "../views/policy/index.vue";
import Showings from "../views/showings/index.vue"; import Showings from "../views/showings/index.vue";
import HouseDetail from "../views/showings/houseDetail.vue"; import HouseDetail from "../views/showings/houseDetail.vue";
import apartmentDetail from "../views/showings/apartmentDetail.vue"; import apartmentDetail from "../views/showings/apartmentDetail.vue";
import roomTypeList from "../views/showings/roomTypeList.vue";
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL), history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [ routes: [
@ -32,6 +33,11 @@ const router = createRouter({
name: "apartmentDetail", name: "apartmentDetail",
component: apartmentDetail, component: apartmentDetail,
}, },
{
path: '/roomTypeList',
name: 'roomTypeList',
component: roomTypeList,
}
], ],
}); });

43
src/views/policy/index.vue

@ -58,7 +58,7 @@
<div class="text-white flex items-center mb-2 absolute -top-16"> <div class="text-white flex items-center mb-2 absolute -top-16">
<span <span
class="cursor-pointer text-xl" class="cursor-pointer text-xl"
@click="showDetail = false" @click="handleBack"
>政策资讯</span >政策资讯</span
><span class="text-2xl">>详情</span> ><span class="text-2xl">>详情</span>
</div> </div>
@ -85,6 +85,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from "vue"; import { ref, reactive, onMounted, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { gePolicytList, getPolicyInfo } from "@/api/policy"; import { gePolicytList, getPolicyInfo } from "@/api/policy";
// tabList // tabList
const tabList = reactive([ const tabList = reactive([
@ -114,12 +115,14 @@ interface PolicyItem {
detail: string; detail: string;
dictLabel: string; dictLabel: string;
createTime: string; createTime: string;
id: string; id: string | number;
} }
interface PolicyResponse { // utils/http.ts data
data: PolicyItem[]; interface ApiResponse<T> {
data?: T;
} }
const showDetail = ref(false); const showDetail = ref(false);
const router = useRouter();
const handleClickTab = (item: any) => { const handleClickTab = (item: any) => {
active.value = item.dictValue; active.value = item.dictValue;
joinIn.pageNum = 1; joinIn.pageNum = 1;
@ -148,9 +151,10 @@ const getList = async () => {
return false; return false;
}; };
// //
const res:PolicyResponse = await gePolicytList(joinIn); const res = (await gePolicytList(joinIn)) as unknown as ApiResponse<PolicyItem[]>;
list.value = [...list.value, ...res.data]; const data = res.data || [];
if (res.data.length < joinIn.pageSize) { list.value = [...list.value, ...data];
if (data.length < joinIn.pageSize) {
isLoading.value = false; isLoading.value = false;
return false; return false;
} }
@ -172,18 +176,29 @@ const handleScroll = (event: Event) => {
lastScrollTime = now; lastScrollTime = now;
} }
}; };
// PolicyItem // item id
const toPolicyDetail = async (item: PolicyItem) => { const toPolicyDetail = async (itemOrId: PolicyItem | string | number) => {
// PolicyResponse const id = typeof itemOrId === "object" ? itemOrId.id : itemOrId;
const res: PolicyResponse = await getPolicyInfo(item.id); const res = (await getPolicyInfo(Number(id))) as unknown as ApiResponse<PolicyItem>;
policyInfo.value = res.data; policyInfo.value = res.data || {};
showDetail.value = true; showDetail.value = true;
}; };
const handleBack = () => {
showDetail.value = false;
router.push('/policy');
getList();
}
// //
onMounted(() => { onMounted(() => {
// //
getList(); // getList();
const route = useRoute();
const id = route.query.id as string | undefined;
if (id) {
toPolicyDetail(id);
} else {
getList();
}
}); });
onUnmounted(() => { onUnmounted(() => {

55
src/views/showings/apartmentDetail.vue

@ -1,6 +1,12 @@
<template> <template>
<div class="w-full min-h-screen pt-16 pb-7 bg-gradient-to-b from-[#1974ff] to-[#f8faff] to-50%"> <div class="w-full min-h-screen pt-16 pb-7 bg-gradient-to-b from-[#1974ff] to-[#f8faff] to-50%">
<div class="w-[1310px] mx-auto mt-60px bg-white pb-9 px-6 pt-6 rounded relative"> <Crumbs :breadcrumbs="[
{ title: '看房', path: '/Showings' },
{ title: '公寓详情', path: '' },
]"
:width="1510"
/>
<div class="w-[1310px] mx-auto mt-10 bg-white pb-9 px-6 pt-6 rounded relative">
<div class="title "> <div class="title ">
<h3 class="font-bold text-2xl">公寓详情</h3> <h3 class="font-bold text-2xl">公寓详情</h3>
</div> </div>
@ -27,7 +33,7 @@
<div class=" pr-10 "> <div class=" pr-10 ">
<div class="mb-5"> <!-- <div class="mb-5">
<div class="text-xl font-bold ">选择房型</div> <div class="text-xl font-bold ">选择房型</div>
</div> </div>
<div style="height: 300px; overflow-y: auto;"> <div style="height: 300px; overflow-y: auto;">
@ -60,35 +66,30 @@
</div> </div>
<el-divider direction="horizontal" border-style="dashed" /> <el-divider direction="horizontal" border-style="dashed" />
</div> </div>
</div> </div> -->
<div class=" pr-10">
<div>
<div class="text-xl font-bold ">基本介绍</div>
</div>
<div class="pt-3">
<div class="indent-8">{{ residentialDetail.introduce }}</div>
<div class="indent-8 flex">联系电话:<span class="text-blue-800"> {{ residentialDetail.phone }}</span>
</div>
</div>
<!-- <div class="map-container" ref="mapContainer"></div> -->
<!-- <div class=" w-1/2 pl-32">房型详情 </div> -->
</div>
</div> </div>
</div> </div>
<div class="w-px bg-gray-200 border-dashed h-auto mx-4"></div> <div class="w-px bg-gray-200 border-dashed h-auto mx-4"></div>
<div class="flex-col w-full justify-between pl-10"> <div class="flex-col w-full justify-between pl-10">
<div class=" pr-10">
<div>
<div class="text-xl font-bold ">基本介绍</div>
</div>
<div class="pt-3">
<div class="indent-8">{{ residentialDetail.introduce }}</div>
</div>
<!-- <div class="map-container" ref="mapContainer"></div> --> <div class="map-container pt-3" ref="mapContainer"></div>
<!-- <div class=" w-1/2 pl-32">房型详情 </div> --> <div class=" bg-blue-500 text-white w-[215px] text-center p-2 rounded-3xl cursor-pointer mt-8 mx-auto"
</div> @click="handleHouseDet">查看房型</div>
<div class="pt-5">
<div class="text-xl font-bold">其他配套</div>
<div class="pt-3 pb-3">
<div class="indent-8 flex">联系电话:<span class="text-blue-800"> {{ residentialDetail.phone }}</span>
</div>
</div>
<div class="map-container pt-3" ref="mapContainer"></div>
</div>
<!-- 返回 --> <!-- 返回 -->
<!-- <div class="text-white flex items-center mb-2 absolute -top-14 absolute"> <!-- <div class="text-white flex items-center mb-2 absolute -top-14 absolute">
<span class="cursor-pointer text-xl">看房选房</span><span class="text-2xl">>房型详情</span> <span class="cursor-pointer text-xl">看房选房</span><span class="text-2xl">>房型详情</span>
@ -107,6 +108,7 @@ import { getHouseDetail, getDict, getDeptInfo, getHouseTypeList, getlayoutOfAHou
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import Crumbs from "@/components/Crumbs.vue";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const activeTab = ref('vr') const activeTab = ref('vr')
@ -145,9 +147,8 @@ const getHouseType = async () => {
} }
}; };
const handleHouseDet = async (e) => { const handleHouseDet = async (e) => {
console.log(e, "ds,kjkl"); router.push({ path: '/roomTypeList', query: { apartmentId: deptId } })
// router.push({ path: '/houseDetail', query: { deptId: e.apartmentId, id: e.id } })
router.push({ path: '/houseDetail', query: { deptId: e.apartmentId, id: e.id } })
} }
const getHouseList = async () => { const getHouseList = async () => {
try { try {

140
src/views/showings/houseDetail.vue

@ -1,31 +1,37 @@
<template> <template>
<div class="w-full min-h-screen pt-16 pb-7 bg-gradient-to-b from-[#1974ff] to-[#f8faff] to-50%"> <div class="w-full min-h-screen pt-16 pb-7 bg-gradient-to-b from-[#1974ff] to-[#f8faff] to-50%">
<div class="w-[1310px] mx-auto mt-60px bg-white pb-9 px-6 pt-6 rounded relative"> <Crumbs :breadcrumbs="[
{ title: '看房', path: '/Showings' },
{ title: '公寓详情', path: '/apartmentDetail', query: { deptId: deptId } },
{ title: '公寓房型', path: '/roomTypeList', query: { apartmentId: deptId } },
{ title: '房型详情', path: '' },
]" :width="1678" />
<div class="w-[1310px] mx-auto mt-10 bg-white pb-9 px-14 pt-6 rounded relative">
<div class="title "> <div class="title ">
<h3 class="font-bold text-2xl">房型详情</h3> <h3 class="font-bold text-2xl">房型详情</h3>
</div> </div>
<div class="flex"> <div class="flex">
<div class="flex-col w-full pt-2 "> <div class="flex-col w-full pt-2 ">
<div class=" pr-10"> <div class=" pr-10 w-[592px]">
<div class=" w-full relative "> <div class=" w-full relative">
<div v-if="activeTab === 'video'" class="w-full h-72"> <!-- <div v-if="activeTab === 'video'" class="w-full h-72">
<video :src="houseDetail.videos[0] ? houseDetail.videos[0].url : ''" controls <video :src="houseDetail.videos[0] ? houseDetail.videos[0].url : ''" controls
class="w-full h-full object-cover rounded-md" /> class="w-full h-full object-cover rounded-md" />
</div> </div> -->
<el-carousel v-if="activeTab === 'img'" height="300px"> <el-carousel v-if="activeTab === 'img'" height="290px">
<el-carousel-item v-for="(img, idx) in houseDetail.images" :key="idx"> <el-carousel-item v-for="(img, idx) in houseDetail.images" :key="idx">
<img :src="img.url" class="w-full h-72 object-cover rounded-md" /> <img :src="img.url" class="w-full h-72 object-cover rounded-md" />
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div v-if="activeTab === 'vr'" class="relative"> <div v-if="activeTab === 'vr'" class="relative h-[290px]">
<img class="w-full h-72 object-cover rounded-md" :src="houseDetail.vrUrl" alt="VR封面图" /> <img class="w-full h-[290px] object-cover rounded-md" :src="houseDetail.coverImg" alt="VR封面图" />
<a :href="vrLink" target="_blank"> <a :href="houseDetail.vrUrl" target="_blank">
<div class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-30 cursor-pointer"> <div class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-30 cursor-pointer">
</div> </div>
</a> </a>
</div> </div>
<div <div
class="mt-4 flex justify-center border rounded-full overflow-hidden w-fit absolute bottom-10 left-52"> class="mt-4 flex justify-center border rounded-full overflow-hidden w-fit absolute bottom-10 left-1/2 -translate-x-1/2">
<button class="px-4 py-1 text-sm font-medium" <button class="px-4 py-1 text-sm font-medium"
:class="activeTab === 'vr' ? 'bg-blue-500 text-white' : 'bg-white text-gray-800'" :class="activeTab === 'vr' ? 'bg-blue-500 text-white' : 'bg-white text-gray-800'"
@click="activeTab = 'vr'"> @click="activeTab = 'vr'">
@ -36,15 +42,15 @@
@click="activeTab = 'img'"> @click="activeTab = 'img'">
图片 图片
</button> </button>
<button class="px-4 py-1 text-sm font-medium" <!-- <button class="px-4 py-1 text-sm font-medium"
:class="activeTab === 'video' ? 'bg-blue-500 text-white' : 'bg-white text-gray-800'" :class="activeTab === 'video' ? 'bg-blue-500 text-white' : 'bg-white text-gray-800'"
@click="activeTab = 'video'"> @click="activeTab = 'video'">
视频 视频
</button> </button> -->
</div> </div>
<div v-if="activeTab === 'vr'" class=" mt-4 flex justify-center border rounded-full overflow-hidden w-fit <div v-if="activeTab === 'vr'" class=" mt-4 flex justify-center border rounded-full overflow-hidden w-fit
absolute bottom-24 left-56"> absolute bottom-24 left-1/2 -translate-x-1/2" @click="handleVr">
<img class="opacity-10" src="@/assets/images/ar.png"> <img class="opacity-10" src="@/assets/images/ar.png">
</div> </div>
@ -54,57 +60,29 @@
</div> </div>
<div class="pt-3 text-base flex"> <div class="pt-3 text-base flex">
<div class=" ">房型</div> <div class=" ">房型</div>
<div class=" font-bold text-red-700 "> <div class=" font-bold text-red-400 ">
{{ houseDetail.roomCount }}{{ houseDetail.livingRoomCount }}{{ houseDetail.bathroomCount }}</div> <span class="">{{ houseDetail.roomCount }}</span><span>{{ houseDetail.livingRoomCount
}}</span><span>{{ houseDetail.bathroomCount }}</span>
</div>
<div class=" pl-7">面积:</div> <div class=" pl-7">面积:</div>
<div class="font-bold text-red-700 ">125m²</div> <div class="font-bold text-red-400 ">{{ houseDetail.area }}m²</div>
</div> </div>
<el-divider direction="horizontal" />
<div class="pt-3"> <div class="pt-3">
<div class="text-xl font-bold ">房屋设施</div> <div class="text-xl font-bold ">房屋设施</div>
</div> </div>
<div class="flex pt-3"> <div class="flex pt-3 flex-wrap gap-2">
<div class="" v-for="(item, index) in houseDetail.facilityIcon" :key="index"> <div v-for="(item, index) in houseDetail.facilityOptions" :key="index">
<div class="w-20"> <img class="w-33 h-5 pl-7" style="width: 50px; height: 20px;" :src="item.url" />
<img class="w-33 h-5 pl-6" style="width: 50px; height: 20px;" :src="item" /> <div class="text-center w-20 h-7">{{ item.name }}</div>
</div>
</div>
</div>
<div class="flex pt-3">
<div v-for="(item, index) in houseDetail.facilityNames" :key="index">
<div class=" pl-5 w-20 h-7">{{ item }}</div>
</div> </div>
</div> </div>
<el-divider direction="horizontal" border-style="dashed" />
</div> </div>
<div class=" pr-10 ">
<div class="text-xl font-bold">房间详情</div>
<div class="flex items-start gap-4 py-4 border-gray-200 border-dashed"
:class="{ 'border-b': index !== houseDetail.roomTypes.length - 1 }"
v-for="(item, index) in houseDetail.roomTypes" :key="index">
<!-- 封面图 -->
<img class="w-45 h-36 object-cover rounded-md" :src="item.images[0].url" alt="封面" />
<!-- 文字信息 -->
<div class="flex flex-col justify-between">
<div class="text-lg font-bold">{{ item.roomTypeName }}</div>
<div class="flex flex-wrap items-center text-sm text-gray-600 mt-2 space-x-3">
<div>{{ item.area }}</div>
<div>{{ item.roomTypeName }}</div>
<div>{{ item.hasWindow ? '有窗' : '无窗' }}</div>
</div>
<div class="text-xs text-gray-900 mt-2 leading-snug">{{ item.description }}</div>
</div>
</div>
</div>
</div> </div>
<div class="w-px bg-gray-200 border-dashed h-auto mx-4"></div> <div class="w-px bg-gray-200 border-dashed h-auto mx-4"></div>
<div class="flex-col w-full justify-between pl-10"> <div class="flex-col w-full justify-between pl-10">
<div class=" pr-10"> <!-- <div class=" pr-10">
<div> <div>
<div class="text-xl font-bold ">入住评价</div> <div class="text-xl font-bold ">入住评价</div>
</div> </div>
@ -133,6 +111,39 @@
</div> </div>
</div> </div>
</div> -->
<div class=" pr-10 ">
<div class="text-xl font-bold">房间详情</div>
<div class="overflow-y-auto max-h-[600px]">
<div class="flex items-start gap-4 py-4 border-gray-200 border-dashed"
:class="{ 'border-b': index !== houseDetail.roomTypes.length - 1 }"
v-for="(item, index) in houseDetail.roomTypes" :key="index">
<!-- 封面图 -->
<img class=" w-44 h-28 object-cover rounded-md" :src="item.images[0].url" alt="封面" />
<!-- 文字信息 -->
<div class="flex flex-col justify-between">
<div class="text-lg font-bold">{{ item.roomTypeName }}</div>
<div class="flex flex-wrap items-center text-sm text-gray-600 mt-2 space-x-3">
<div>{{ item.area }}</div>
<div>{{ item.roomTypeName }}</div>
<div>{{ item.hasWindow ? '有窗' : '无窗' }}</div>
</div>
<div class="text-xs text-gray-900 mt-2 leading-snug">
<div :class="item.isExpanded ? '' : 'line-clamp-2'" class="transition-all duration-300">
{{ item.description }}
</div>
<div v-if="item.description && item.description.length > 50"
class="text-blue-600 cursor-pointer mt-1 hover:text-blue-800 transition-colors"
@click="toggleDescription(item)">
查看
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
@ -147,17 +158,17 @@ import { getHouseDetail, getDict, getDeptInfo, getHouseTypeList } from "@/api/in
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import Crumbs from '@/components/Crumbs.vue';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const activeTab = ref('vr') const activeTab = ref('vr')
const deptId = route.query.deptId; const deptId = route.query.deptId;
const houseId = route.query.id;
const imgList = ref([ const imgList = ref([
'https://example.com/img1.jpg', 'https://example.com/img1.jpg',
'https://example.com/img2.jpg', 'https://example.com/img2.jpg',
'https://example.com/img3.jpg', 'https://example.com/img3.jpg',
]) ])
const houseId = route.query.id;
const houseDetail = ref({}); // const houseDetail = ref({}); //
const residentialDetail = ref({}); // const residentialDetail = ref({}); //
const dictList = ref([]); // const dictList = ref([]); //
@ -170,6 +181,14 @@ const mapContainer = ref(null);
const handerReturn = async () => { const handerReturn = async () => {
router.go(-1) // router.go(-1) //
} }
const handleVr = () => {
window.open(houseDetail.value.vrUrl, '_blank')
}
// /
const toggleDescription = (item) => {
item.isExpanded = !item.isExpanded;
}
const getHouseType = async () => { const getHouseType = async () => {
try { try {
console.log(houseId, "sfdjksdlk;"); console.log(houseId, "sfdjksdlk;");
@ -179,7 +198,18 @@ const getHouseType = async () => {
const res = await getHouseDetail(parms); const res = await getHouseDetail(parms);
console.log(res, "sfdjksdlk;"); console.log(res, "sfdjksdlk;");
houseDetail.value = res.data houseDetail.value = res.data;
// facilityIcon facilityNames
if (res.data.facilityIcon && res.data.facilityNames) {
houseDetail.value.facilityOptions = res.data.facilityIcon.map((icon, index) => ({
url: icon,
name: res.data.facilityNames[index] || ''
}));
} else {
houseDetail.value.facilityOptions = [];
}
// res // res
} catch (error) { } catch (error) {
} }

42
src/views/showings/roomTypeList.vue

@ -0,0 +1,42 @@
<template>
<div class="w-full min-h-screen pt-16 pb-7 bg-gradient-to-b from-[#1974ff] to-[#f8faff] to-50%">
<Crumbs :breadcrumbs="[
{ title: '看房', path: '/Showings' },
{ title: '公寓详情', path: '/apartmentDetail', query: { deptId: apartmentId } },
{ title: '公寓房型', path: '' },
]" :width="1678" />
<div class="w-[1678px] mx-auto mt-10 bg-white pb-9 px-6 pt-6 rounded relative ">
<div class=" text-2xl font-bold mb-5">请选择房型</div>
<div class="flex flex-wrap gap-4">
<div class="w-[499px] h-[131px] bg-white rounded-md flex" @click="handleHouseDetail(item.id)" v-for="(item, index) in houseList" :key="index">
<img :src="item.coverImg" class="w-[176px] h-[120px] rounded-md mr-5" alt="">
<div class="flex flex-col justify-between py-2">
<div class="text-xl font-bold">{{ item.typeName }}</div>
<div class="flex justify-between"><span>{{ item.fullName }}</span><span>{{ item.total }}</span></div>
<div class="text-sm text-gray-500">{{ item.labelStr }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { getlayoutOfAHouseOrAnApartment } from '@/api';
import { useRoute, useRouter } from 'vue-router';
import { ref, onMounted } from 'vue';
import Crumbs from '@/components/Crumbs.vue';
const route = useRoute();
const router = useRouter();
const apartmentId = ref(route.query.apartmentId);
const houseList = ref([]);
const getHouseList = async () => {
const res = await getlayoutOfAHouseOrAnApartment({ apartmentId: apartmentId.value });
houseList.value = res.data;
}
onMounted(() => {
getHouseList();
})
const handleHouseDetail = (id) => {
router.push({ path: '/houseDetail', query: { deptId: apartmentId.value, id: id } })
}
</script>

1
tailwind.config.js

@ -46,6 +46,7 @@ export default {
"42px": "42px", "42px": "42px",
"28px": "28px", "28px": "28px",
"22px": "22px", "22px": "22px",
"26px": "26px",
}, },
slideUp: { slideUp: {
'0%': { transform: 'translateY(20px)', opacity: '0' }, '0%': { transform: 'translateY(20px)', opacity: '0' },

Loading…
Cancel
Save