From 313e587e17f2cf77b6b3a78ed89f8aeff9413ab3 Mon Sep 17 00:00:00 2001 From: sjsjmine129 Date: Sat, 25 May 2024 23:38:08 +0900 Subject: [PATCH] Add/Filter of naver data --- src/screens/list/ListMainScreen.js | 135 +++++++++++++++++++++++++++++ src/screens/map/MapScreen.js | 134 ++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) diff --git a/src/screens/list/ListMainScreen.js b/src/screens/list/ListMainScreen.js index 2df8ee8..7226f75 100644 --- a/src/screens/list/ListMainScreen.js +++ b/src/screens/list/ListMainScreen.js @@ -42,13 +42,20 @@ export default function ListMainScreen() { const [categoryModalVisible, setCategoryModalVisible] = useState(false); const [storeScoreModalVisible, setStoreScoreModalVisible] = useState(false); const [replyNumModalVisible, setReplyNumModalVisible] = useState(false); + const [storeScoreNaverModalVisible, setStoreScoreNaverModalVisible] = + useState(false); + const [replyNumNaverModalVisible, setReplyNaverNumModalVisible] = + useState(false); + const [priceRangeModalVisible, setPriceRangeModalVisible] = useState(false); const [sortModalVisible, setSortModalVisible] = useState(false); const [selectedCategory, setSelectedCategory] = useState('전체'); const [storeScore, setStoreScore] = useState('전체'); + const [storeScoreNaver, setStoreScoreNaver] = useState('전체'); const [replyNum, setReplyNum] = useState('전체'); const [priceRange, setPriceRange] = useState('전체'); + const [replyNumNaver, setReplyNumNaver] = useState('전체'); const [sort, setSort] = useState('기본 순'); const [selectSale, setSelectSale] = useState(false); const [likedStore, setLikedStore] = useState(false); @@ -119,6 +126,21 @@ export default function ListMainScreen() { break; } + switch (storeScoreNaver) { + case '5.0점': + params.naverRatingAvg = 5.0; + break; + case '4.5점 이상': + params.naverRatingAvg = 4.5; + break; + case '4.0점 이상': + params.naverRatingAvg = 4.0; + break; + case '3.5점 이상': + params.naverRatingAvg = 3.5; + break; + } + switch (replyNum) { case '10개 이상': params.reviewCount = 10; @@ -134,6 +156,21 @@ export default function ListMainScreen() { break; } + switch (replyNumNaver) { + case '10개 이상': + params.naverReviewCount = 10; + break; + case '30개 이상': + params.naverReviewCount = 30; + break; + case '50개 이상': + params.naverReviewCount = 50; + break; + case '100개 이상': + params.naverReviewCount = 100; + break; + } + switch (priceRange) { case '1만원 미만': params.priceMax = 10000; @@ -195,6 +232,8 @@ export default function ListMainScreen() { selectSale, likedStore, sort, + storeScoreNaver, + replyNumNaver, ]); const listHeader = () => { @@ -411,6 +450,43 @@ export default function ListMainScreen() { + { + console.log('press 평점'); + setStoreScoreNaverModalVisible(true); + }}> + {storeScoreNaver === '전체' ? ( + <> + + {'네이버 평점'} + + ) : ( + <> + + {storeScoreNaver} + + )} + + + + + { + console.log('press 네이버 댓글수'); + setReplyNaverNumModalVisible(true); + }}> + {replyNumNaver === '전체' ? ( + <> + + {'네이버 리뷰수'} + + ) : ( + <> + + {replyNumNaver} + + )} + + + + + {/* 네이버 평점 모달 */} + + {/* 정렬 모달 */} + {/* 댓글수 모달 */} + + {/* 가격 모달 */} + { + console.log('press 평점'); + setStoreScoreNaverModalVisible(true); + }}> + {storeScoreNaver === '전체' ? ( + <> + + {'네이버 평점'} + + ) : ( + <> + + {storeScoreNaver} + + )} + + + + + { + console.log('press 네이버 댓글수'); + setReplyNaverNumModalVisible(true); + }}> + {replyNumNaver === '전체' ? ( + <> + + {'네이버 리뷰수'} + + ) : ( + <> + + {replyNumNaver} + + )} + + + + + {/* 네이버 평점 모달 */} + + {/* 댓글수 모달 */} + {/* 댓글수 모달 */} + + {/* 가격 모달 */}