returnjinx 2 bulan lalu
induk
melakukan
50ee2992db
53 mengubah file dengan 558 tambahan dan 173 penghapusan
  1. 1 1
      index.html
  2. 1 1
      package.json
  3. TEMPAT SAMPAH
      public/static/image/house/001.jpg
  4. TEMPAT SAMPAH
      public/static/image/house/002.jpg
  5. TEMPAT SAMPAH
      public/static/image/house/003.jpg
  6. TEMPAT SAMPAH
      public/static/image/house/004.png
  7. TEMPAT SAMPAH
      public/static/image/house/005.jpeg
  8. TEMPAT SAMPAH
      public/static/image/house/006.jpg
  9. TEMPAT SAMPAH
      public/static/image/house/007.jpg
  10. TEMPAT SAMPAH
      public/static/image/house/008.jpg
  11. TEMPAT SAMPAH
      public/static/image/house/009.jpg
  12. TEMPAT SAMPAH
      public/static/image/house/010.jpg
  13. TEMPAT SAMPAH
      public/static/image/house/101.jpeg
  14. TEMPAT SAMPAH
      public/static/image/house/101.jpg
  15. TEMPAT SAMPAH
      public/static/image/house/102.jpg
  16. TEMPAT SAMPAH
      public/static/image/house/102.png
  17. TEMPAT SAMPAH
      public/static/image/house/103.jpg
  18. TEMPAT SAMPAH
      public/static/image/house/104.jpeg
  19. TEMPAT SAMPAH
      public/static/image/house/105.jpg
  20. TEMPAT SAMPAH
      public/static/image/house/106.jpg
  21. TEMPAT SAMPAH
      public/static/image/house/106三.jpg
  22. TEMPAT SAMPAH
      public/static/image/house/107.jpg
  23. TEMPAT SAMPAH
      public/static/image/house/108.jpg
  24. TEMPAT SAMPAH
      public/static/image/house/109.jpg
  25. TEMPAT SAMPAH
      public/static/image/house/110.jpg
  26. TEMPAT SAMPAH
      public/static/image/house/201.jpg
  27. TEMPAT SAMPAH
      public/static/image/house/202.jpg
  28. TEMPAT SAMPAH
      public/static/image/house/301.jpg
  29. TEMPAT SAMPAH
      public/static/image/house/401.jpg
  30. TEMPAT SAMPAH
      public/static/image/house/402.jpg
  31. TEMPAT SAMPAH
      public/static/image/house/501.jpg
  32. TEMPAT SAMPAH
      public/static/image/house/502.jpeg
  33. TEMPAT SAMPAH
      public/static/image/house/71二.jpg
  34. TEMPAT SAMPAH
      public/static/image/house/76二.jpg
  35. TEMPAT SAMPAH
      public/static/image/house/96三.jpg
  36. TEMPAT SAMPAH
      public/static/image/house/pt1.jpeg
  37. TEMPAT SAMPAH
      public/static/image/house/pt2.jpg
  38. TEMPAT SAMPAH
      public/static/image/house/pt3.jpg
  39. TEMPAT SAMPAH
      public/static/image/house/qw1.jpg
  40. TEMPAT SAMPAH
      public/static/image/house/yb1.jpg
  41. TEMPAT SAMPAH
      public/static/image/house/yb2.jpg
  42. TEMPAT SAMPAH
      public/static/image/house/yb3.jpg
  43. TEMPAT SAMPAH
      public/static/image/house/yb4.jpeg
  44. TEMPAT SAMPAH
      src/assets/images/logo-en.png
  45. TEMPAT SAMPAH
      src/assets/images/model720.png
  46. 43 26
      src/components/header/index.vue
  47. 24 0
      src/lang/zh.js
  48. 6 2
      src/router/index.js
  49. 97 0
      src/views/data/data.js
  50. 73 63
      src/views/data/index.vue
  51. 253 47
      src/views/details/index.vue
  52. 54 25
      src/views/home/index.vue
  53. 6 8
      vite.config.js

+ 1 - 1
index.html

@@ -8,7 +8,7 @@
   </head>
   <body>
     <div id="app"></div>
-    <!-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD-nVI43AYI9qp4rsQMJgN6abyPdn3QRY0&libraries=maps,marker&v=beta" defer></script> -->
+    <!-- <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD-nVI43AYI9qp4rsQMJgN6abyPdn3QRY0&libraries=maps,marker&v=beta&language=en-us" defer></script> -->
     <script type="module" src="/src/main.js"></script>
 
     <script>

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "yueyang-map-h5",
+  "name": "vr-house-demo",
   "version": "0.0.0",
   "private": true,
   "type": "module",

TEMPAT SAMPAH
public/static/image/house/001.jpg


TEMPAT SAMPAH
public/static/image/house/002.jpg


TEMPAT SAMPAH
public/static/image/house/003.jpg


TEMPAT SAMPAH
public/static/image/house/004.png


TEMPAT SAMPAH
public/static/image/house/005.jpeg


TEMPAT SAMPAH
public/static/image/house/006.jpg


TEMPAT SAMPAH
public/static/image/house/007.jpg


TEMPAT SAMPAH
public/static/image/house/008.jpg


TEMPAT SAMPAH
public/static/image/house/009.jpg


TEMPAT SAMPAH
public/static/image/house/010.jpg


TEMPAT SAMPAH
public/static/image/house/101.jpeg


TEMPAT SAMPAH
public/static/image/house/101.jpg


TEMPAT SAMPAH
public/static/image/house/102.jpg


TEMPAT SAMPAH
public/static/image/house/102.png


TEMPAT SAMPAH
public/static/image/house/103.jpg


TEMPAT SAMPAH
public/static/image/house/104.jpeg


TEMPAT SAMPAH
public/static/image/house/105.jpg


TEMPAT SAMPAH
public/static/image/house/106.jpg


TEMPAT SAMPAH
public/static/image/house/106三.jpg


TEMPAT SAMPAH
public/static/image/house/107.jpg


TEMPAT SAMPAH
public/static/image/house/108.jpg


TEMPAT SAMPAH
public/static/image/house/109.jpg


TEMPAT SAMPAH
public/static/image/house/110.jpg


TEMPAT SAMPAH
public/static/image/house/201.jpg


TEMPAT SAMPAH
public/static/image/house/202.jpg


TEMPAT SAMPAH
public/static/image/house/301.jpg


TEMPAT SAMPAH
public/static/image/house/401.jpg


TEMPAT SAMPAH
public/static/image/house/402.jpg


TEMPAT SAMPAH
public/static/image/house/501.jpg


TEMPAT SAMPAH
public/static/image/house/502.jpeg


TEMPAT SAMPAH
public/static/image/house/71二.jpg


TEMPAT SAMPAH
public/static/image/house/76二.jpg


TEMPAT SAMPAH
public/static/image/house/96三.jpg


TEMPAT SAMPAH
public/static/image/house/pt1.jpeg


TEMPAT SAMPAH
public/static/image/house/pt2.jpg


TEMPAT SAMPAH
public/static/image/house/pt3.jpg


TEMPAT SAMPAH
public/static/image/house/qw1.jpg


TEMPAT SAMPAH
public/static/image/house/yb1.jpg


TEMPAT SAMPAH
public/static/image/house/yb2.jpg


TEMPAT SAMPAH
public/static/image/house/yb3.jpg


TEMPAT SAMPAH
public/static/image/house/yb4.jpeg


TEMPAT SAMPAH
src/assets/images/logo-en.png


TEMPAT SAMPAH
src/assets/images/model720.png


+ 43 - 26
src/components/header/index.vue

@@ -5,12 +5,17 @@
       <div class="main-nav">
         <div class="nav-left">
           <div class="nav-logo">
-            <img src="@/assets/images/logo.png" alt="logo" />
+            <img src="@/assets/images/logo-en.png" alt="logo" />
           </div>
           <template v-if="route.path == '/'">
             <span class="nav-border"></span>
             <div class="nav-city">
-              <n-dropdown trigger="click" :options="options" :show-arrow="true" @select="handleSelect">
+              <n-dropdown
+                trigger="click"
+                :options="options"
+                :show-arrow="true"
+                @select="handleSelect"
+              >
                 <div class="s-city">珠海</div>
               </n-dropdown>
             </div></template
@@ -18,39 +23,41 @@
         </div>
         <div class="nav-right" v-if="route.path == '/'">
           <div class="search-wrapper">
-            <n-input round placeholder="请输入楼盘名"> </n-input>
+            <n-input round placeholder="请输入楼盘名" v-model:value="iptVal">
+            </n-input>
           </div>
-          <n-button tertiary round>搜索</n-button>
+          <n-button tertiary round @click="handleSearch">搜索</n-button>
         </div>
       </div>
       <div v-if="route.path == '/'" class="main-tab">
-        <div class="tab-item active">全部楼盘</div>
-        <div class="tab-item">近期楼盘</div>
-        <div class="tab-item">优惠楼盘</div>
+        <div @click="handleAll" class="tab-item" :class="{ active: !isSearch }">
+          全部楼盘
+        </div>
+        <!-- <div class="tab-item">近期楼盘</div>
+        <div class="tab-item">优惠楼盘</div> -->
       </div>
       <!-- <div class="main-tab"><span>珠海</span>><span>详情</span></div> -->
-
     </div>
   </div>
 </template>
 
 <script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, watch, defineEmits, defineProps } from "vue";
+import {
+  reactive,
+  ref,
+  toRefs,
+  onBeforeMount,
+  onMounted,
+  nextTick,
+  watch,
+  defineEmits,
+  defineProps,
+} from "vue";
 import { useRoute } from "vue-router";
-const emits = defineEmits(["close"]);
+const emits = defineEmits(["close", "search"]);
 const route = useRoute();
-console.error(route)
-const back = () => {
-  if (props.isClose) {
-    emits("close");
-    return;
-  }
-  if (props.path) {
-    router.replace(`/${props.path}`);
-    return;
-  }
-  router.replace("/");
-};
+const iptVal = ref("");
+const isSearch = ref(false);
 const props = defineProps({
   title: {
     type: String,
@@ -69,6 +76,16 @@ const props = defineProps({
   //   default: false,
   // },
 });
+
+const handleSearch = () => {
+  emits("search", iptVal.value);
+  isSearch.value = true;
+};
+const handleAll = () => {
+  emits("search", "all");
+  isSearch.value = false;
+};
+
 const handleSelect = (key) => {
   console.log(key);
 };
@@ -78,10 +95,10 @@ const options = ref([
     key: "marina bay sands",
     disabled: true,
   },
-  {
-    label: "中山",
-    key: "brown's hotel, london",
-  },
+  // {
+  //   label: "中山",
+  //   key: "brown's hotel, london",
+  // },
 ]);
 onMounted(() => {});
 </script>

+ 24 - 0
src/lang/zh.js

@@ -0,0 +1,24 @@
+export default {
+  header: {
+    all: "全部楼盘",
+    search: "搜索",
+    searchPlaceholder: "请输入楼盘名",
+    city: "珠海",
+  },
+  body: {
+    hot: "热门楼盘",
+  },
+
+  footer: {
+    copyright: "版权所有 © 2023 房产管理系统",
+  },
+  details: {
+    tel: "咨询电话",
+    projectAddress: "项目地址",
+    openTime: "最新开盘",
+    cadInfo: "户型介绍",
+    moneyUnit: "元/平(单价) ",
+    totalUnit: "万/套(总价) ",
+    
+  },
+};

+ 6 - 2
src/router/index.js

@@ -1,4 +1,8 @@
-import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";
+import {
+  createRouter,
+  createWebHistory,
+  createWebHashHistory,
+} from "vue-router";
 
 const router = createRouter({
   // history: createWebHistory(import.meta.env.BASE_URL),
@@ -10,7 +14,7 @@ const router = createRouter({
       component: () => import("../views/home/index.vue"),
     },
     {
-      path: "/details",
+      path: "/details/:id",
       name: "details",
       component: () => import("../views/details/index.vue"),
     },

+ 97 - 0
src/views/data/data.js

@@ -0,0 +1,97 @@
+export const houseData = [
+  {
+    id: 1,
+    images_1: ["101.jpg", "102.jpg", "103.jpg"],
+    images_2: ["yb1.jpg", "yb2.jpg"],
+    images_3: ["yb1.jpg", "yb2.jpg", "yb3.jpg", "yb4.jpeg"],
+    images_4: ["qw1.jpg"],
+    images_5: ["pt1.jpeg", "pt2.jpg", "pt3.jpg"],
+    title: "格力海岸六期",
+    vrLink: "https://www.4dkankan.com/spc.html?m=t-VJjZMUl&lang=zh",
+    tags: ["在售", "住宅", "低密住宅"],
+    address: "广东省珠海市香洲区情侣北路",
+    location: "22.3530,113.5920",
+    time: "2021-07-06",
+    cad: "二居室,三居室",
+    agent: "张伟",
+    label: ["公交直达", "公园", "小三房", "小户型"],
+    price: "25000元/㎡",
+    total: "130-275(万/套)",
+  },
+  {
+    id: 2,
+    images_1: ["201.jpg", "202.jpg"],
+    images_2: ["yb1.jpg", "yb2.jpg"],
+    images_3: ["yb1.jpg", "yb2.jpg", "yb3.jpg", "yb4.jpeg"],
+    images_4: ["qw1.jpg"],
+    images_5: ["pt1.jpeg", "pt2.jpg", "pt3.jpg"],
+    title: "正方深悦湾",
+    vrLink: "https://www.4dkankan.com/spc.html?m=t-pnj0IJX&lang=zh",
+    tags: ["在售", "住宅", "低密住宅"],
+    address: "金业南路555号",
+    location: "22.2356,113.5412",
+    time: "2023-02-23",
+    cad: "二居室,三居室",
+    agent: "李娜",
+    label: ["公交直达", "综合商场", "两房", "小型社区"],
+    price: "24000元/平",
+    total: "170-315(万/套)",
+  },
+  {
+    id: 3,
+    images_1: ["301.jpg"],
+    images_2: ["yb1.jpg", "yb2.jpg"],
+    images_3: ["yb1.jpg", "yb2.jpg", "yb3.jpg", "yb4.jpeg"],
+    images_4: ["qw1.jpg"],
+    images_5: ["pt1.jpeg", "pt2.jpg", "pt3.jpg"],
+    title: "港湾天际",
+    vrLink: "https://www.4dkankan.com/spc.html?m=t-kZUcUeX&lang=zh",
+    tags: ["在售", "住宅", "低密住宅"],
+    address: "前湾二路港湾天际",
+    location: "22.5218,113.8843",
+    time: "2023-03-21",
+    cad: "二居室,三居室",
+    agent: "王磊",
+    label: ["期房", "公园", "两房", "小户型"],
+    price: "25000元/平",
+    total: "115-255(万/套)",
+  },
+  {
+    id: 4,
+    images_1: ["401.jpg", "402.jpg"],
+    images_2: ["yb1.jpg", "yb2.jpg"],
+    images_3: ["yb1.jpg", "yb2.jpg", "yb3.jpg", "yb4.jpeg"],
+    images_4: ["qw1.jpg"],
+    images_5: ["pt1.jpeg", "pt2.jpg", "pt3.jpg"],
+    title: "仁恒滨海湾一期",
+    vrLink: "https://www.4dkankan.com/spc.html?m=t-N4Pdc1B&lang=zh",
+    tags: ["在售", "住宅", "低密住宅"],
+    address: "广东省珠海市香洲区田馆路",
+    location: "22.2914,113.5726",
+    time: "2022-04-30",
+    cad: "二居室,三居室",
+    agent: "陈芳",
+    label: ["公交直达", "现房", "两房", "大三居"],
+    price: "25000元/平",
+    total: "150-538(万/套)",
+  },
+  {
+    id: 5,
+    images_1: ["502.jpeg", "501.jpg"],
+    images_2: ["yb1.jpg", "yb2.jpg"],
+    images_3: ["yb1.jpg", "yb2.jpg", "yb3.jpg", "yb4.jpeg"],
+    images_4: ["qw1.jpg"],
+    images_5: ["pt1.jpeg", "pt2.jpg", "pt3.jpg"],
+    title: "港湾新城",
+    vrLink: "https://www.4dkankan.com/spc.html?m=t-N4Pdc1B&lang=zh",
+    tags: ["在售", "住宅", "低密住宅"],
+    address: "圣皇头街港湾新城",
+    location: "22.2703,113.5768",
+    time: "2024-12-30",
+    cad: "二居室,三居室",
+    agent: "赵明",
+    label: ["公交直达", "公园", "两房", "小户型"],
+    price: "16000元/平",
+    total: "130-200(万/套)",
+  },
+];

+ 73 - 63
src/views/data/index.vue

@@ -3,11 +3,18 @@ vue3
 <template>
   <p>点位</p>
   <input type="file" @change="readFile" accept=".xlsx" />
- 
 </template>
 
 <script setup>
-import { reactive, ref, toRefs, onBeforeMount, onMounted, nextTick, watch } from "vue";
+import {
+  reactive,
+  ref,
+  toRefs,
+  onBeforeMount,
+  onMounted,
+  nextTick,
+  watch,
+} from "vue";
 import * as XLSX from "xlsx";
 const readFile = (e) => {
   const files = e.target.files;
@@ -37,13 +44,15 @@ const readFile = (e) => {
         let obj = {};
         obj.name = item;
         // obj.list = XLSX.utils.sheet_to_json(table[item]);
-        obj.list = procressData(
-          XLSX.utils.sheet_to_json(table[item], {
-            /** Default value for null/undefined values */
-            defval: "", //给defval赋值为空的字符串
-          })
-        );
-        array.push(obj);
+        if (item == "楼盘信息") {
+          obj.list = procressData(
+            XLSX.utils.sheet_to_json(table[item], {
+              /** Default value for null/undefined values */
+              defval: "", //给defval赋值为空的字符串
+            })
+          );
+          array.push(obj);
+        }
       });
     } catch (e) {
       return false;
@@ -68,85 +77,76 @@ const filterName = (name) => {
 };
 const procressData = (list) => {
   let array = [];
-  list = list.filter((item) => item["提供日期"]);
-
   console.error(list);
+  // list = list.filter((item) => item["提供日期"]);
+
   list.forEach((item, index) => {
     let obj = {};
-    obj.id = index + 1;
+    // obj.id = index + 1;
     for (let key in item) {
       switch (key) {
-        case "地图上分类":
+        case "楼盘名称":
           obj["title"] = item[key];
-          if (item[key] === "历史文化") {
-            obj["type"] = 1;
-          }
-          if (item[key] === "自然探索") {
-            obj["type"] = 2;
-          }
-          if (item[key] === "亲子休闲") {
-            obj["type"] = 3;
-          }
-          if (item[key] === "城市烟火") {
-            obj["type"] = 4;
-          }
-          if (item[key] === "交通住宿") {
-            obj["type"] = 5;
-          }
-          if (item[key] === "政府驻地") {
-            obj["type"] = 6;
-          }
 
           break;
-        case "景点名称":
-          obj["name"] = item[key];
+        case "楼盘ID":
+          obj["id"] = item[key];
 
           break;
-        case "坐标(以游客中心坐标为准)":
-          obj["location"] = item[key];
-
+        case "VR":
+          obj["images_1"] = item[key].replaceAll(",", ",").split(",");
+          break;
+        case "效果图":
+          obj["images_2"] = item[key].replaceAll(",", ",").split(",");
+          break;
+        case "样板间":
+          obj["images_3"] = item[key].replaceAll(",", ",").split(",");
           break;
-        case "大场景链接":
+        case "区位":
+          obj["images_4"] = item[key].replaceAll(",", ",").split(",");
+          break;
+        case "小区配套":
+          obj["images_5"] = item[key].replaceAll(",", ",").split(",");
+          break;
+        case "VR链接":
           if (item[key]) {
             obj["vrLink"] = item[key];
           }
 
           break;
-        case "三维模型":
-          if (item[key]) {
-            obj["modelLink"] = item[key];
-          }
 
+        case "标签":
+          obj["tags"] = item[key].replaceAll(",", ",").split(",");
           break;
-        case "普通图片":
-          obj["images"] = item[key].replaceAll(",", ",").split(",");
-
+        case "特点":
+          obj["label"] = item[key].replaceAll(",", ",").split(",");
           break;
-        case "景区等级":
-          if (item[key]) {
-            obj["rate"] = item[key];
-          }
 
-          break;
-        case "简介":
-          obj["desc"] = item[key];
+        case "楼盘户型":
+          obj["cad"] = item[key];
 
           break;
-        case "音频名称":
-          if (item[key]) {
-            obj["audio"] = item[key] + ".MP3";
-          }
+        case "最新开盘":
+          let time =
+            new Date(item[key]) * 24 * 60 * 60 * 1000 + Date.UTC(1899, 11, 30);
+          const formattedDate = formatDate(time);
+          obj["time"] = formattedDate;
 
           break;
-        case "县市区":
+        case "项目地址":
           obj["address"] = item[key];
-          // case "图标大小":
-          //   if (item[key] && item[key] != "需补充") {
-          //     obj["iconSize"] = item[key].split("*");
-          //   } else {
-          //     obj["iconSize"] = null;
-          //   }
-
+          break;
+        case "新房顾问":
+          obj["agent"] = item[key];
+          break;
+        case "均价":
+          obj["price"] = item[key];
+          break;
+        case "总价":
+          obj["total"] = item[key];
+          break;
+        case "谷歌经纬度":
+          obj["location"] = item[key];
           break;
       }
     }
@@ -157,6 +157,16 @@ const procressData = (list) => {
   console.error(array);
   return array;
 };
+// 格式化日期
+const formatDate = (timestamp) => {
+  const date = new Date(timestamp);
+  const year = date.getFullYear();
+  const month = (date.getMonth() + 1).toString().padStart(2, "0");
+  const day = date.getDate().toString().padStart(2, "0");
+  return `${year}-${month}-${day}`;
+};
+
+// 使用函数格式化日期
 
 onMounted(() => {});
 </script>

+ 253 - 47
src/views/details/index.vue

@@ -7,13 +7,13 @@
         <div class="details-title">
           <div class="name-box">
             <div class="name">
-              <span>招商云璟揽阅</span>
+              <span>{{ houseInfo.title }}</span>
               <div class="label-wrap">
-                <div class="label zs">在售</div>
-                <div class="label zz">住宅</div>
+                <div class="label zs">{{ houseInfo.tags[0] }}</div>
+                <div class="label zz">{{ houseInfo.tags[1] }}</div>
               </div>
             </div>
-            <div class="other-name">别名:璟云雅苑</div>
+            <!-- <div class="other-name">别名:璟云雅苑</div> -->
           </div>
           <div class="tel-num">咨询电话: 4008315585转04817</div>
         </div>
@@ -21,9 +21,17 @@
           <div class="banner-box">
             <div class="swiper-wraper">
               <div class="swiper-wrapper">
-                <div class="swiper-slide" v-for="i in 4"><img src="" alt="" /></div>
-
-                <!-- 更多幻灯片 -->
+                <div class="swiper-slide" v-for="i in bannerList">
+                  <n-image
+                    width="100%"
+                    height="100%"
+                    object-fit="cover"
+                    :src="`./static/image/house/${i}`"
+                  />
+                  <div class="vr-layer" v-if="bannerActiveIndex == 1">
+                    <div class="vr-btn" @click="goVr()"></div>
+                  </div>
+                </div>
               </div>
               <!-- 如果需要分页器 -->
               <!-- <div class="swiper-pagination"></div> -->
@@ -31,41 +39,53 @@
               <div class="swiper-button-next"></div>
             </div>
             <div class="image-box">
-              <div class="item-image"><img src="" alt="" /><span class="name">VR(4)</span></div>
-              <div class="item-image"><img src="" alt="" /><span class="name">效果图(4)</span></div>
-              <div class="item-image"><img src="" alt="" /><span class="name">样板间(4)</span></div>
-              <div class="item-image"><img src="" alt="" /><span class="name">区位(4)</span></div>
-              <div class="item-image"><img src="" alt="" /><span class="name">小区配套(4)</span></div>
+              <div
+                class="item-image"
+                :class="{ active: i.type === bannerActiveIndex }"
+                @click="changeBanner(i.type)"
+                v-for="(i, index) in bannerListType"
+              >
+                <img
+                  :src="`./static/image/house/${houseInfo.images_1[0]}`"
+                  alt=""
+                /><span class="name"
+                  >{{ i.name }}({{ i.images.length }})</span
+                >
+              </div>
             </div>
           </div>
           <div class="info-box">
             <div class="top-info">
               <span class="title">参考均价</span>
-              <span class="price-number">60000</span>
-              <span class="price-unit">元/平(单价) </span>
-              <span class="price-number">480-765</span>
-              <span class="price-unit">(万/套)(总价)</span>
+              <!-- <span class="price-number">60000</span> -->
+              <!-- <span class="price-unit">元/平(单价) </span> -->
+              <span class="price-unit">{{ houseInfo.price }} </span>
+              <!-- <span class="price-number">480-765</span> -->
+              <!-- <span class="price-unit">(万/套)(总价)</span> -->
+              <span class="total-title">总价</span>
+              <span class="price-unit">{{ houseInfo.total }} </span>
             </div>
             <div class="info-tag">
-              <div class="tag-item">2025北京房展</div>
-              <div class="tag-item">近地铁</div>
-              <div class="tag-item">公交直达</div>
-              <div class="tag-item">综合商场</div>
+              <div class="tag-item" v-for="(i, index) in houseInfo.label">
+                {{ i }}
+              </div>
             </div>
             <div class="info-desc">
               <div class="desc-item">
                 <div class="title">项目地址</div>
-                <div class="text">北京市通州区云景南大街辅路</div>
+                <div class="text">{{ houseInfo.address }}</div>
               </div>
               <div class="desc-item">
                 <div class="title">最新开盘</div>
-                <div class="text">2025-03-02</div>
+                <div class="text">{{ houseInfo.time }}</div>
               </div>
               <div class="desc-item">
                 <div class="title">楼盘户型</div>
                 <div class="text">
-                  <span>三居室({{ 1 }})</span>
-                  <span>四居室({{ 2 }})</span>
+                  <span v-for="(i, key, index) in cadData"
+                    >{{ key }}({{ i.length }})</span
+                  >
+                  <!-- <span>四居室({{ 2 }})</span> -->
                 </div>
               </div>
             </div>
@@ -75,24 +95,37 @@
           <div class="cad-box">
             <h2 class="title">户型介绍</h2>
             <div class="cad-tab">
-              <div class="tab-item active"><span>三居室(3)</span></div>
-              <div class="tab-item"><span>四居室(1)</span></div>
+              <div
+                class="tab-item"
+                :class="{ active: activeCad == key }"
+                v-for="(i, key, index) in cadData"
+                @click="activeCad = key"
+              >
+                <span>{{ key }}({{ i.length }})</span>
+              </div>
+              <!-- <div class="tab-item"><span>三居室(1)</span></div> -->
             </div>
             <div class="cad-list">
-              <div class="cad-item" v-for="i in 3">
-                <div class="cad-img"><img src="" alt="" /></div>
+              <div class="cad-item" v-for="i in cadData[activeCad]">
+                <div class="cad-img">
+                  <n-image
+                    width="100%"
+                    height="100%"
+                    object-fit="cover"
+                    :src="`./static/image/house/${i.thumb}`"
+                  />
+                </div>
                 <div class="cad-info">
                   <div class="cad-title">
-                    <span> 3室2厅2卫 </span>
+                    <span> {{ i.desc }} </span>
                     <div class="label-wrap">
                       <div class="label zs">在售</div>
                       <div class="label zz">住宅</div>
                     </div>
                   </div>
-                  <div class="area">建面 108m² (南,北朝向)</div>
+                  <div class="area">{{ i.area }} (南,北朝向)</div>
                   <div class="price">
-                    约<span>645</span>
-                    万/套
+                    {{ i.price }}
                   </div>
                 </div>
               </div>
@@ -100,39 +133,47 @@
           </div>
           <div class="bottom-info-box">
             <div class="name-info">
-              <h3>招商云璟揽阅</h3>
+              <h3>{{ houseInfo.title }}</h3>
               <div class="label-wrap">
-                <div class="label zs">在售</div>
-                <div class="label zz">住宅</div>
+                <div class="label zs">{{ houseInfo.tags[0] }}</div>
+                <div class="label zz">{{ houseInfo.tags[1] }}</div>
               </div>
             </div>
             <div class="top-info">
               <span class="title">参考均价</span>
-              <span class="price-number">60000</span>
-              <span class="price-unit">元/平(单价) </span>
+              <span class="price-number">{{ houseInfo.price }}</span>
+              <!-- <span class="price-unit">元/平(单价) </span> -->
             </div>
 
             <div class="info-desc">
               <div class="desc-item">
                 <div class="title">项目地址</div>
-                <div class="text">北京市通州区云景南大街辅路</div>
+                <div class="text">{{ houseInfo.address }}</div>
               </div>
               <div class="desc-item">
                 <div class="title">最新开盘</div>
-                <div class="text">2025-03-02</div>
+                <div class="text">{{ houseInfo.time }}</div>
               </div>
               <div class="desc-item">
                 <div class="title">楼盘户型</div>
                 <div class="text">
-                  <span>三居室({{ 1 }})</span>
-                  <span>四居室({{ 2 }})</span>
+                  <span v-for="(i, key, index) in cadData"
+                    >{{ key }}({{ i.length }})</span
+                  >
+                  <!-- <span>四居室({{ 2 }})</span> -->
                 </div>
               </div>
             </div>
           </div>
         </div>
         <div class="google-map" id="map">
-          <GoogleMap api-key="AIzaSyBGUvCR1bppO9pfuS0MUWzuftiZ127y4Os" style="width: 100%; height: 100%" :center="center" :zoom="15">
+          <GoogleMap
+            api-key="AIzaSyD-nVI43AYI9qp4rsQMJgN6abyPdn3QRY0"
+            style="width: 100%; height: 100%"
+            :center="center"
+            :zoom="15"
+            language="en-us"
+          >
             <Marker :options="{ position: center }" />
           </GoogleMap>
         </div>
@@ -151,7 +192,15 @@ import { GoogleMap, Marker } from "vue3-google-map";
 import Swiper from "swiper";
 import "swiper/css/swiper.css";
 import { NConfigProvider } from "naive-ui";
+import { houseData } from "../data/data.js";
+import { useRoute } from "vue-router";
+
+const route = useRoute();
 
+const houseId = ref(route.params.id || 1);
+const houseInfo = computed(() => {
+  return houseData.find((item) => item.id == houseId.value);
+});
 const themeOverrides = {
   common: {
     primaryColor: "#3072f6",
@@ -160,8 +209,106 @@ const themeOverrides = {
 
   // ...
 };
+const goVr = () => {
+  window.open(houseInfo.value.vrLink);
+};
+const bannerActiveIndex = ref(1);
+const bannerListType = ref([
+  {
+    type: 1,
+    name: "VR",
+    images: houseInfo.value.images_1,
+  },
+  {
+    type: 2,
+    name: "效果图",
+    images: houseInfo.value.images_2,
+  },
+  {
+    type: 3,
+    name: "样板间",
+    images: houseInfo.value.images_3,
+  },
+  {
+    type: 4,
+    name: "区位",
+    images: houseInfo.value.images_4,
+  },
+  {
+    type: 5,
+    name: "小区配套",
+    images: houseInfo.value.images_5,
+  },
+]);
+const banner = ref(
+  "https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
+);
+const bannerList = ref(houseInfo.value.images_1);
+// https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg
+
+const activeCad = ref("二居室");
+const cadData = ref({
+  二居室: [
+    {
+      title: "二居室",
+      area: "建面 76m²",
+      desc: "2室2厅1卫",
+      price: "190 万/套(参考价格)",
+      thumb: "76二.jpg",
+    },
+    {
+      title: "二居室",
+      area: "建面 71m²",
+      desc: "2室2厅1卫",
+      price: "190 万/套(参考价格)",
+      thumb: "71二.jpg",
+    },
+  ],
+  三居室: [
+    {
+      title: "三居室",
+      area: "建面 96m²",
+      desc: "3室2厅2卫",
+      price: "270 万/套(参考价格)",
+      thumb: "96三.jpg",
+    },
+    {
+      title: "三居室",
+      area: "建面 97m²",
+      desc: "3室2厅2卫",
+      price: "270 万/套(参考价格)",
+      thumb: "97三.jpg",
+    },
+    {
+      title: "三居室",
+      area: "建面 106m²",
+      desc: "3室2厅2卫",
+      price: "275 万/套(参考价格)",
+      thumb: "106三.jpg",
+    },
+  ],
+});
+const changeBanner = (type) => {
+  bannerActiveIndex.value = type;
+  bannerList.value = bannerListType.value.find(
+    (item) => item.type === type
+  ).images;
+  if (swiper) {
+    swiper.destroy(true, true);
+    swiper = null;
+  }
+  banner.value =
+    "https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg";
+  setTimeout(() => {
+    initBanner();
+  }, 0);
+
+  // swiper.update();
+  // console.log(bannerCount.value);
+};
+
 let swiper = null;
-const initTab = () => {
+const initBanner = () => {
   swiper = new Swiper(".swiper-wraper", {
     navigation: {
       nextEl: ".swiper-button-next",
@@ -189,7 +336,11 @@ const initMap = async () => {
 };
 
 // let center = { lat: -34.397, lng: 150.644 };
-const center = { lat: 40.689247, lng: -74.044502 };
+let lonlat = houseInfo.value.location.split(",");
+
+// const center = { lat: 40.689247, lng: -74.044502 };
+const center = { lat: lonlat[0] - 0, lng: lonlat[1] - 0 };
+
 const addMarker = async () => {
   let center = { lat: -34.397, lng: 150.644 };
   const marker = new google.maps.marker.AdvancedMarkerElement({
@@ -199,7 +350,7 @@ const addMarker = async () => {
 };
 
 onMounted(() => {
-  initTab();
+  initBanner();
   // initMap();
 });
 </script>
@@ -287,13 +438,35 @@ onMounted(() => {
         width: 526px;
         height: 295px;
         overflow: hidden;
+        position: relative;
         .swiper-wrapper {
           .swiper-slide {
-            img {
+            .vr-layer {
+              position: absolute;
               width: 100%;
               height: 100%;
-              object-fit: cover;
+              top: 0;
+              left: 0;
+              background: rgba(0, 0, 0, 0.5);
+              .vr-btn {
+                position: absolute;
+                top: 50%;
+                left: 50%;
+                transform: translate(-50%, -50%);
+                width: 60px;
+                height: 60px;
+                background: url("@/assets/images/model720.png") no-repeat center
+                  center;
+                background-size: cover;
+
+                cursor: pointer;
+              }
             }
+            // img {
+            //   width: 100%;
+            //   height: 100%;
+            //   object-fit: cover;
+            // }
           }
         }
       }
@@ -314,6 +487,12 @@ onMounted(() => {
           cursor: pointer;
           background: red;
           position: relative;
+
+          img {
+            width: 100%;
+            height: 100%;
+            object-fit: cover;
+          }
           .name {
             position: absolute;
             bottom: 0;
@@ -327,6 +506,11 @@ onMounted(() => {
             letter-spacing: 0;
             background: rgba(0, 0, 0, 0.5);
           }
+          &.active {
+            .name {
+              background: #3072f6;
+            }
+          }
         }
       }
     }
@@ -353,6 +537,10 @@ onMounted(() => {
           font-family: Tahoma-Bold;
           font-size: 30px;
         }
+        .total-title {
+          font-size: 14px;
+          color: #9399a5;
+        }
         .price-unit {
           font-family: HiraginoSansGB-W6;
           font-size: 16px;
@@ -572,4 +760,22 @@ onMounted(() => {
   height: 300px;
   margin-top: 30px;
 }
+.swiper-button-next,
+.swiper-button-prev {
+  // transform: translateY(-50%);
+  // margin-top: 0;
+}
+.swiper-button-disabled {
+  pointer-events: auto;
+}
+.n-image {
+  width: 100%;
+  height: 100%;
+}
+</style>
+<style>
+/* .gmnoprint,
+.gm-style-cc {
+  display: none !important;
+} */
 </style>

+ 54 - 25
src/views/home/index.vue

@@ -1,57 +1,72 @@
 <!--  -->
 <template>
   <NConfigProvider :theme-overrides="themeOverrides">
-    <navheader></navheader>
+    <navheader @search="search"></navheader>
     <div class="home">
       <div class="list">
         <div class="list-left">
-          <div class="left-item" v-for="i in 10">
+          <div
+            class="left-item"
+            v-for="i in homeList"
+            @click="router.push(`/details/${i.id}`)"
+          >
             <div class="item-info">
               <div class="item-cover">
-                <img src="https://ke-image.ljcdn.com/newhouse-user-image/a2734ab4bfa1481cf8027a8f54b39d40.jpg.592x432.jpg" alt="" />
+                <img :src="`./static/image/house/${i.images_1[0]}`" alt="" />
               </div>
               <div class="item-text">
                 <div class="title">
-                  <span class="name">招商云璟揽阅</span>
+                  <span class="name">{{ i.title }}</span>
                   <div class="label-box">
-                    <div class="label-item zs">在售</div>
-                    <div class="label-item zz">住宅</div>
-                    <div class="label-item dmzz">低密住宅</div>
+                    <div class="label-item zs">{{ i.tags[0] }}</div>
+                    <div class="label-item zz">{{ i.tags[1] }}</div>
+                    <div class="label-item dmzz">{{ i.tags[2] }}</div>
                   </div>
                 </div>
-                <div class="location"><span>地址:</span><span>北京市昌平区回龙观镇史各庄街道生命科学园三期</span></div>
-                <div class="house"><span>户型:</span><span>3室/4室</span> <span>建面: </span><span>120-196㎡</span></div>
-                <div class="role">新房顾问:高治科</div>
+                <div class="location">
+                  <span>地址:</span><span>{{ i.address }}</span>
+                </div>
+                <div class="house">
+                  <span>户型:</span><span>{{ i.cad }}</span> <span>建面: </span
+                  ><span>120-196㎡</span>
+                </div>
+                <div class="role">新房顾问:{{ i.agent }}</div>
                 <div class="tag">
-                  <div class="tag-item">2025北京房展</div>
-                  <div class="tag-item">近地铁</div>
-                  <div class="tag-item">公交直达</div>
-                  <div class="tag-item">综合商场</div>
+                  <div class="tag-item" v-for="j in i.label">{{ j }}</div>
                 </div>
               </div>
             </div>
             <div class="item-price">
-              <div class="unit-price"><span>60000</span> 元/㎡(均价)</div>
-              <div class="total-price">总价480-765(万/套)</div>
+              <div class="unit-price">
+                <!-- <span>{{ i.price }}</span> 元/㎡(均价) -->
+                <span>{{ i.price }}</span> (均价)
+              </div>
+              <div class="total-price">总价{{ i.total }}</div>
             </div>
           </div>
         </div>
         <div class="list-right">
           <p class="title">热门楼盘</p>
           <div class="hot-list">
-            <div class="hot-item" v-for="i in 5">
-              <div class="hot-cover"><img src="" alt="" /></div>
+            <div
+              class="hot-item"
+              @click="router.push(`/details/${i.id}`)"
+              v-for="i in hotList"
+            >
+              <div class="hot-cover">
+                <img :src="`./static/image/house/${i.images_1[0]}`" alt="" />
+              </div>
               <div class="hot-text">
                 <div class="hot-name">
-                  <span>顺鑫颐和天璟</span>
+                  <span>{{ i.title }}</span>
                   <div class="hot-label">
-                    <div class="item zs">在售</div>
-                    <div class="item zz">低密住宅</div>
+                    <div class="item zs">{{ i.tags[0] }}</div>
+                    <div class="item zz">{{ i.tags[2] }}</div>
                   </div>
                 </div>
 
                 <div class="price-wrapper">
-                  <div class="hot-price">900-950</div>
+                  <div class="hot-price">{{ i.total }}</div>
                   <div class="hot-unit">(万/套)</div>
                 </div>
               </div>
@@ -69,9 +84,11 @@ import router from "@/router";
 import navheader from "@/components/header/index.vue";
 import copyRight from "@/components/copyRight/index.vue";
 import { reactive, ref, toRefs, onBeforeMount, onMounted, computed } from "vue";
-
+import { houseData } from "../data/data.js";
 import { NConfigProvider } from "naive-ui";
-
+const hotList = computed(() => {
+  return houseData.slice(0, 5);
+});
 const themeOverrides = {
   common: {
     primaryColor: "#3072f6",
@@ -80,7 +97,17 @@ const themeOverrides = {
 
   // ...
 };
-
+const homeList = ref(houseData);
+const search = (val) => {
+  if (val == "all") {
+    homeList.value = houseData;
+    return;
+  }
+  let list = houseData.filter((item) => {
+    return item.title.includes(val);
+  });
+  homeList.value = list;
+};
 onMounted(() => {});
 </script>
 <style lang="scss" scoped>
@@ -124,6 +151,7 @@ onMounted(() => {});
               width: 236px;
               height: 178px;
               background: transparent;
+              object-fit: cover;
             }
           }
           .item-text {
@@ -233,6 +261,7 @@ onMounted(() => {});
             img {
               width: 100%;
               height: 128px;
+              object-fit: cover;
             }
           }
           .hot-text {

+ 6 - 8
vite.config.js

@@ -12,7 +12,7 @@ export default defineConfig({
     // assetsDir: "assets",
     // outDir: 'dist', // 输出目录
     // emptyOutDir: true,
-    copyPublicDir: false,
+    // copyPublicDir: false,
   },
   plugins: [
     vue(),
@@ -21,13 +21,11 @@ export default defineConfig({
   server: {
     host: "0.0.0.0",
     proxy: {
-      "/api": {
-        // target: 'https://sit-yueyangbwg.4dage.com', // 后端服务地址
-        // target: "https://txiaobo.qiweiwangguo.com", // 后端服务地址
-        target: "https://hn3dreal.org.cn", // 后端服务地址
-        changeOrigin: true, // 是否改变源地址
-        // rewrite: (path) => path.replace(/^\/api/, ""),
-      },
+      // "/api": {
+      //   target: "https://hn3dreal.org.cn", // 后端服务地址
+      //   changeOrigin: true, // 是否改变源地址
+      //   // rewrite: (path) => path.replace(/^\/api/, ""),
+      // },
     },
   },
   resolve: {