Skip to content

Commit c31ac93

Browse files
Merge pull request #53 from full-ownership/mapp
Mapp
2 parents 9ae6c57 + 1eb424a commit c31ac93

37 files changed

+74
-61
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_API_BASE_URL=https://back.newjeaps.com
1+
VITE_API_BASE_URL=http://localhost:8080

src/assets/img/apt/apt (1).jpg

23.3 KB
Loading

src/assets/img/apt/apt (10).jpg

92.5 KB
Loading

src/assets/img/apt/apt (11).jpg

7.3 KB
Loading

src/assets/img/apt/apt (12).jpg

28.7 KB
Loading

src/assets/img/apt/apt (13).jpg

18.2 KB
Loading

src/assets/img/apt/apt (14).jpg

17.7 KB
Loading

src/assets/img/apt/apt (15).jpg

20.4 KB
Loading

src/assets/img/apt/apt (16).jpg

15.8 KB
Loading

src/assets/img/apt/apt (17).jpg

13.3 KB
Loading

src/assets/img/apt/apt (18).jpg

16.6 KB
Loading

src/assets/img/apt/apt (19).jpg

12.2 KB
Loading

src/assets/img/apt/apt (2).jpg

20.6 KB
Loading

src/assets/img/apt/apt (20).jpg

12.2 KB
Loading

src/assets/img/apt/apt (21).jpg

10.9 KB
Loading

src/assets/img/apt/apt (22).jpg

14.9 KB
Loading

src/assets/img/apt/apt (23).jpg

8.18 KB
Loading

src/assets/img/apt/apt (24).jpg

15.3 KB
Loading

src/assets/img/apt/apt (25).jpg

18 KB
Loading

src/assets/img/apt/apt (26).jpg

27.4 KB
Loading

src/assets/img/apt/apt (27).jpg

14.6 KB
Loading

src/assets/img/apt/apt (28).jpg

10.9 KB
Loading

src/assets/img/apt/apt (29).jpg

14.8 KB
Loading

src/assets/img/apt/apt (3).jpg

42.9 KB
Loading

src/assets/img/apt/apt (4).jpg

12.8 KB
Loading

src/assets/img/apt/apt (5).jpg

14.7 KB
Loading

src/assets/img/apt/apt (6).jpg

62.9 KB
Loading

src/assets/img/apt/apt (7).jpg

13.8 KB
Loading

src/assets/img/apt/apt (8).jpg

33.7 KB
Loading

src/assets/img/apt/apt (9).jpg

9.33 KB
Loading

src/router/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const routes = [
2626
component: LoginView,
2727
},
2828
{
29-
path: 'map/:param', // :param은 동적 라우트 파라미터
29+
path: 'map/', // :param은 동적 라우트 파라미터
3030
name: 'map',
3131
component: MapView,
3232
},

src/stores/mapCard.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,30 @@ import axios from 'axios';
33
import apiClient from '@/api'; // 위에서 만든 axios 인스턴스를 import
44

55
export const useHouseInfoStore = defineStore('houseInfo', {
6+
67
state: () => ({
78
houseInfos: { data: [] }, // 상태 정의 (초기값)
89
}),
910
actions: {
10-
async fetchHouseInfo(type) {
11+
async fetchHouseInfo(params) {
1112
try {
12-
// URL을 BASE_URL과 합쳐서 사용
13-
console.log("맵카드")
14-
console.log(apiClient)
15-
const response = await apiClient.get(`/api/houseinfos/${type}`);
16-
// response.data.data를 houseInfos에 할당 (주요 수정 부분)
17-
this.houseInfos= response.data.data;
18-
19-
// response.data를 콘솔에 출력하여 디버깅
20-
21-
console.log(response.data.data);
22-
23-
24-
13+
console.log("fetchHousdeInfo 동작시도")
14+
const queryParams = new URLSearchParams(params).toString(); // 쿼리 문자열 생성
15+
const endpoint = `/api/house-info/range?${queryParams}`;
16+
// API 요청
17+
console.log(endpoint)
18+
const response = await apiClient.get(endpoint);
19+
this.houseInfos = response.data.data;
20+
console.log("응답 데이터:", response.data.data);
21+
//console.log(response.data.data);
2522
} catch (error) {
26-
console.log('데이터를 가져오는데 실패했습니다.', error);
23+
console.error("데이터를 가져오는데 실패했습니다.", error);
2724
}
28-
},
29-
25+
}
26+
,
27+
3028
// 필터링된 데이터를 가져오는 메서드
31-
async fetchFilteredHouseInfo({
29+
async fetchFilteredHouseInfo({
3230
buildingUse,
3331
fromPrice,
3432
toPrice,

src/views/CardView.vue

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="bg-white border-b-2 flex flex-row py-3">
44
<!-- 이미지 섹션 -->
55
<div class="bg-pink-100 w-28 h-28 mx-2">
6-
이미지
6+
<img :src="imgUrl" alt="이미지" class="w-full h-full object-cover" />
77
</div>
88
<!-- 내용 섹션 -->
99
<div class="ml-2">
@@ -16,16 +16,22 @@
1616
<span class="text-sm text-gray-600">
1717
{{ legalName }}</span>
1818
</div>
19-
<div class="pl-1">
20-
<span class="text-md">최소 </span>
21-
<span class="text-sm">{{ minPropertyPrice }}</span>
22-
<span class="text-md">만원</span>
23-
<span class="text-md"> - </span>
24-
<span class="text-md">최대</span>
25-
<span class="text-sm">{{ maxPropertyPrice }}</span>
26-
<span class="text-md">만원</span>
19+
<div class="pl-1 flex flex-row justify-center">
20+
<div>
21+
<span class="bg-blue-500 text-white text-xxs px-2 py-1 mr-1 text-center">
22+
평당가
23+
</span>
24+
</div>
25+
<div class="bg-pink-200 px-2">
26+
<span class="text-sm">{{ minPropertyPrice }}</span>
27+
<span class="text-md">만원</span>
28+
<span class="text-md"> - </span>
29+
<span class="text-sm">{{ maxPropertyPrice }}</span>
30+
<span class="text-md">만원</span>
31+
</div>
32+
2733
</div>
28-
34+
2935
<!-- 버튼 -->
3036
</div>
3137
</div>
@@ -35,6 +41,7 @@
3541
<script setup>
3642
3743
defineProps({
44+
imgUrl : String,
3845
id: Number, // int → Number
3946
buildingUse: String,
4047
buildingName: String,
@@ -43,11 +50,8 @@ defineProps({
4350
minPropertyPrice: Number, // double → Number
4451
maxPropertyPrice: Number // double → Number
4552
});
46-
4753
</script>
4854

4955
<style scoped>
5056
/* TailwindCSS 스타일을 사용하기 때문에 별도의 추가 스타일은 필요하지 않습니다. */
51-
52-
5357
</style>

src/views/HeaderView.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<img alt="logo" src="@/assets/img/logo.png" class="w-24 -mr-1" @click="goToHome" />
66
</div>
77
<nav class="md:ml-auto flex flex-wrap items-center text-base justify-center">
8-
<a @click="goToMapView('아파트')" href="" class="mr-5 hover:text-gray-900">지도</a>
8+
<a @click="goToMapView({ buildingUse: '아파트', sidoName: '서울특별시', gugunName: '종로구' });" class="mr-5 hover:text-gray-900">지도</a>
99
<a @click="goToIntroductionView" class="mr-5 hover:text-gray-900">회사소개</a>
1010
<div>
1111
<div v-if="userStore.userInfos.data.nickname">
@@ -45,10 +45,18 @@ const goToLogin = () => {
4545
};
4646
4747
const goToMapView = (param) => {
48-
//console.log('mapView 등장')
49-
console.log(param)
50-
router.push({ name: 'map', params: {param} } );
51-
}
48+
49+
console.log('동작')
50+
51+
if (!param) {
52+
console.error("param is not provided");
53+
return;
54+
}
55+
56+
console.log("Received param:", param);
57+
// Router로 이동
58+
router.push({ name: 'map', query: { ...param } });
59+
};
5260
5361
const goToIntroductionView = () =>{
5462
router.push({name: 'introduction'})

src/views/MapView.vue

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import RangeSlider from "vue-simple-range-slider";
99
import "vue-simple-range-slider/css";
1010
import { useRoute, useRouter } from 'vue-router';
1111
12-
1312
const map = ref(null); // Kakao Map 객체
1413
const polygons = ref([]); // 생성된 폴리곤 객체 배열
1514
const overlays = ref([]); // 생성된 오버레이 객체 배열
@@ -45,9 +44,14 @@ const onLoadKakaoMap = async (mapRef) => {
4544
map.value = mapRef;
4645
console.log("Kakao Map Loaded:", map.value);
4746
47+
// 초기 로딩 시 sido.json으로 도 경계선 로드
48+
await init("/sido.json");
49+
50+
4851
// 초기 로딩 시 광역시/도 데이터 로드
4952
await loadPolygonData("/sido.json");
5053
54+
5155
// 줌 레벨 변경 이벤트
5256
kakao.maps.event.addListener(map.value, "zoom_changed", async () => {
5357
level.value = map.value.getLevel();
@@ -237,17 +241,15 @@ const fetchData = async (type) => {
237241
};
238242
239243
const route = useRoute();
240-
// params로 전달된 "param" 값
241-
244+
console.log(`전달된 route`);
245+
console.log(route.params);
246+
console.log("Route query:", route.query);
242247
243-
// 문자열로 변환된 buildingUse
244-
const buildingUse = route.params.param;
245248
246-
console.log('전달된 파라미터:', buildingUse); // 디버깅용
247249
248250
onMounted(async () => {
249251
isLoading.value = false;
250-
await fetchData(buildingUse); // 데이터 로드
252+
await fetchData(route.query); // 데이터 로드
251253
isLoading.value = true;
252254
});
253255
@@ -259,10 +261,9 @@ watch(
259261
{ immediate: true } // 즉시 실행
260262
);
261263
262-
// store에서 houseInfos 가져오기
263264
const houseInfos = computed(() => houseInfoStore.houseInfos);
264265
265-
// DOMContentLoaded 이벤트는 HTML 문서의 모든 콘텐츠가 완전히 로드되었을 때 발생함
266+
266267
document.addEventListener("DOMContentLoaded", () => {
267268
268269
const filterButton = document.getElementById("filterButton");
@@ -279,7 +280,7 @@ document.addEventListener("DOMContentLoaded", () => {
279280
});
280281
281282
const state = reactive({
282-
가격: [0, 10000000], // 초기값
283+
가격: [0, 10000000],
283284
면적: [0,200],
284285
사용승인일: [1990, 2024],
285286
층수: [0, 40],
@@ -309,7 +310,9 @@ const initFilter = () => {
309310
value[0] = 0;
310311
value[1] = 10000000;
311312
console.log(`${key}: ${value[0]} ~ ${value[1]}`);
312-
//console.log(${value[0]})
313+
314+
//console.log(`${value[0]}`)
315+
313316
}
314317
}
315318
const router = useRouter();
@@ -460,14 +463,14 @@ const navigateTo = (param) => {
460463
</div>
461464
<div v-for="house in houseInfos" :key="house.id">
462465
<CardView
463-
:id="house.id"
464-
:buildingUse="house.buildingUse"
465-
:buildingName="house.buildingName"
466-
:districtName="house.districtName"
467-
:legalName="house.legalName"
468-
:minPropertyPrice="house.minPropertyPrice"
469-
:maxPropertyPrice="house.maxPropertyPrice"
470-
/>
466+
:imgUrl="house.imgUrl"
467+
:buildingUse="house.buildingUses"
468+
:id="house.aptSeq"
469+
:buildingName="house.aptNm"
470+
:districtName="house.gugunName"
471+
:legalName="house.dongName"
472+
:minPropertyPrice="house.minPrice"
473+
:maxPropertyPrice="house.maxPrice"/>
471474
</div>
472475
</div>
473476
</div>

src/views/MyPageView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const userInfoForm = reactive({
2626
email: '', // 이메일
2727
});
2828
29-
// 저장 함수 (예: API 호출)
29+
// 저장 함수 (예: API 호출) ㅇㅇ
3030
const saveUserInfo = () => {
3131
console.log('저장된 정보:', userInfoForm);
3232
// API 호출 예제

vite.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ import vue from '@vitejs/plugin-vue'
55
import vueJsx from '@vitejs/plugin-vue-jsx'
66
import vueDevTools from 'vite-plugin-vue-devtools'
77

8-
// https://vite.dev/config/
98
export default defineConfig({
9+
//const BASE_URL = import.meta.env.VITE_API_BASE_URL;
1010
server: {
1111
port: 3000,
1212
proxy: {
1313
'/api': {
14-
target: 'https://back.newjeaps.com', // 첫 번째 서버 주소
14+
target: "http://localhost:8080", // 환경 변수 사용, // 첫 번째 서버 주소
1515
changeOrigin: true,
1616
secure: true, // https 사용하지 않는 경우 false로 설정
1717
rewrite: (path) => path.replace(/^\/api/, ''), // 프록시 경로를 적절히 수정
1818
},
1919
// 추가적인 프록시 설정이 필요하면 아래와 같이 작성할 수 있습니다.
20-
2120
},
2221
},
2322
plugins: [
2423
vue(),
2524
vueJsx(),
2625
vueDevTools(),
2726
],
27+
2828
resolve: {
2929
alias: {
3030
'@': fileURLToPath(new URL('./src', import.meta.url)),

0 commit comments

Comments
 (0)