Skip to content

Commit

Permalink
Merge pull request #45 from full-ownership/master
Browse files Browse the repository at this point in the history
feat : 가격필터링
  • Loading branch information
femmefatalehaein authored Nov 24, 2024
2 parents 59cb09e + f6da4ce commit d01e0e7
Show file tree
Hide file tree
Showing 26 changed files with 962 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BASE_URL=http://localhost:8080/api
VITE_API_BASE_URL=https://back.newjeaps.com
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:

# 종속성 재설치
npm install
npm install vue-simple-range-slider


- name: Build the Vue app
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>Newjeaps</title>
</head>
<body>
<div id="app"></div>
Expand Down
92 changes: 74 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"lint": "eslint . --fix"
},
"dependencies": {
"@vueform/slider": "^2.1.10",
"aos": "^2.3.4",
"axios": "^1.7.7",
"dotenv": "^16.4.5",
Expand All @@ -21,7 +22,9 @@
"typed.js": "^2.1.0",
"vue": "^3.5.12",
"vue-fullpage.js": "^0.2.20",
"vue-range-slider": "^0.6.0",
"vue-router": "^4.4.5",
"vue-simple-range-slider": "^1.1.0",
"vue-typer": "^1.2.0",
"vue3-kakao-maps": "^2.3.10"
},
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ChatbotButton from './Component/Chatbot/ChatbotButton.vue'
<!-- <HeaderView /> -->
<HeaderView />
<MainView />
<FooterView />

</div>
</template>
<style scoped>
Expand Down
114 changes: 27 additions & 87 deletions src/Component/Notice/FAQList.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
<script setup>
import {useFaqStore} from '@/stores/faq';
import { useRouter } from 'vue-router';
const router = useRouter();
const faqStore = useFaqStore();
faqStore.fetchFaqs();
const goToDetail = (faqId) => {
router.push(`/notice/faqDetail/${faqId}`);
}
</script>

<template>
<div class="p-6 bg-gray-100 min-h-screen">
<!-- 공지사항 제목 및 더보기 -->
<!-- 제목 및 검색 -->
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-bold text-gray-800">최신뉴스</h2>
<a href="#" class="text-sm text-blue-500 hover:underline">더보기</a>
<h2 class="text-xl font-bold text-gray-800">자주 묻는 질문</h2>
</div>

<!-- 공지사항 리스트 -->
<ul class="space-y-6">
<li
v-for="notice in paginatedNotices"
:key="notice.id"
v-for="faq in faqStore.faqs"
:key="faq.faqId"
class="neumorphic-card p-4 rounded-lg transition-all duration-300 hover:shadow-lg"
@click="goToDetail(faq.faqId)"
>
<div>
<!-- 공지사항 제목 -->
<p class="text-lg font-bold text-gray-900">{{ notice.title }}</p>
<!-- 카테고리 및 날짜 -->
<div class="flex justify-between text-sm text-gray-500 mt-2">
<span>{{ notice.category }}</span>
<span>{{ notice.date }}</span>
</div>
<!-- 공지사항 내용 -->
<p class="text-sm text-gray-700 mt-3">{{ notice.description }}</p>
<p class="text-lg font-bold text-gray-900">{{ faq.question }}</p>
<!-- 작성일 및 조회수 -->
</div>
</li>
</ul>

<!-- 페이지네이션 -->
<div class="flex justify-center mt-8 space-x-4">
<button
v-for="page in totalPages"
v-for="page in faqStore.pagination.totalPages"
:key="page"
@click="currentPage = page"
@click="faqStore.setPage(page)"
:class="{
'neumorphic-button-active': currentPage === page,
'neumorphic-button': currentPage !== page,
'neumorphic-button-active': faqStore.pagination.currentPage === page,
'neumorphic-button': faqStore.pagination.currentPage !== page,
}"
class="px-4 py-2 rounded-lg text-sm font-bold transition-all duration-300 hover:shadow-lg active:shadow-inner"
>
Expand All @@ -45,76 +55,6 @@
</div>
</template>

<script setup>
import { ref, computed } from "vue";
// 공지사항 더미 데이터
const notices = ref([
{
id: 1,
title: "서비스 점검 안내",
category: "시스템 점검",
date: "2024-11-21",
description: "11월 23일 오전 2시부터 6시까지 시스템 점검이 예정되어 있습니다.",
},
{
id: 2,
title: "신규 기능 업데이트",
category: "공지",
date: "2024-11-20",
description: "새로운 대시보드 기능이 추가되었습니다. 많은 이용 부탁드립니다.",
},
{
id: 3,
title: "이용약관 변경 안내",
category: "법적 안내",
date: "2024-11-15",
description: "12월 1일부터 적용되는 새로운 이용약관을 확인해주세요.",
},
{
id: 4,
title: "회원 가입 이벤트",
category: "이벤트",
date: "2024-11-10",
description: "회원 가입 이벤트가 진행 중입니다. 지금 가입하고 특별한 혜택을 받아보세요!",
},
{
id: 5,
title: "긴급 공지: 서비스 장애 복구",
category: "긴급 공지",
date: "2024-11-05",
description: "서버 장애로 인해 불편을 끼쳐드려 죄송합니다. 현재 복구 작업이 완료되었습니다.",
},
{
id: 6,
title: "신규 서버 배포",
category: "시스템 점검",
date: "2024-11-03",
description: "신규 서버가 성공적으로 배포되었습니다. 성능이 향상되었습니다.",
},
{
id: 7,
title: "보안 업데이트",
category: "보안",
date: "2024-10-28",
description: "중요 보안 패치가 적용되었습니다. 최신 버전을 확인해주세요.",
},
]);
// 페이지네이션 상태
const currentPage = ref(1); // 현재 페이지
const itemsPerPage = ref(3); // 페이지당 항목 수
// 페이지네이션 계산
const totalPages = computed(() => Math.ceil(notices.value.length / itemsPerPage.value));
// 현재 페이지에 해당하는 공지사항만 필터링
const paginatedNotices = computed(() => {
const start = (currentPage.value - 1) * itemsPerPage.value;
const end = start + itemsPerPage.value;
return notices.value.slice(start, end);
});
</script>

<style scoped>
/* 뉴모피즘 카드 스타일 */
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Notice/MainInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const searchNotices = () => {
//디테일 가즈아
const goToDetail = (noticeId) => {
router.push(`/notice/${noticeId}`);
router.push(`/notice/noticeDetail/${noticeId}`);
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Notice/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@click="$emit('changeTab', tab.id)"
:class="[
'px-6 py-2 font-medium',
activeTab === tab.id ? 'border-b-2 border-black text-black' : 'text-gray-500',
activeTab === tab.id ? 'border-b-4 border-[#5995ED] text-black' : 'text-gray-500',
]"
class="transition"
>
Expand Down
Loading

0 comments on commit d01e0e7

Please sign in to comment.