From 83fbecba5518a5f211b5afacc498136200b43c23 Mon Sep 17 00:00:00 2001 From: Suhyeon Jeon Date: Sun, 2 Mar 2025 20:36:44 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A0=84=EC=B2=B4=20qa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/usePostOrderPay.ts | 2 +- src/app/home/_components/Home.tsx | 2 +- src/app/home/list/_components/HomeList.tsx | 4 +- src/app/layout.tsx | 8 + .../address/detail/_components/MapInfo.tsx | 3 + src/app/pay/_components/OrderInfo.tsx | 219 +++++++++--------- src/app/pay/page.tsx | 2 +- .../result/_components/SearchResult.tsx | 6 +- 8 files changed, 132 insertions(+), 114 deletions(-) diff --git a/src/api/usePostOrderPay.ts b/src/api/usePostOrderPay.ts index 7274d296..6f2e5d1e 100644 --- a/src/api/usePostOrderPay.ts +++ b/src/api/usePostOrderPay.ts @@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query' export enum OrderPayType { TOSS = 'TOSS_PAY', - PAY200 = 'PAY200', + PAY200 = 'PAY_200', } export interface OrderPay { diff --git a/src/app/home/_components/Home.tsx b/src/app/home/_components/Home.tsx index f2480c36..dc04dfad 100644 --- a/src/app/home/_components/Home.tsx +++ b/src/app/home/_components/Home.tsx @@ -24,7 +24,7 @@ const Home = () => { endpoint: 'stores/list-cursor', filter: { category: undefined }, size: 10, - ...(location && { location: { lat: location.latitude, lng: location.longitude } }), + ...(member ? {location: {lat: member.address.latitude, lng: member.address.longitude}} : location && { location: { lat: location.latitude, lng: location.longitude } }), }) const handleRefresh = async (): Promise => { diff --git a/src/app/home/list/_components/HomeList.tsx b/src/app/home/list/_components/HomeList.tsx index 73510d83..76a34fcf 100644 --- a/src/app/home/list/_components/HomeList.tsx +++ b/src/app/home/list/_components/HomeList.tsx @@ -25,7 +25,9 @@ const HomeList = () => { endpoint: 'stores/list-cursor', filter: { category, order }, size: 10, - ...(location && { location: { lat: location.latitude, lng: location.longitude } }), + ...(member + ? { location: { lat: member.address.latitude, lng: member.address.longitude } } + : location && { location: { lat: location.latitude, lng: location.longitude } }), }) const scrollRef = useRef(null) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index cc5afa57..93c262e5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -16,6 +16,14 @@ export const metadata: Metadata = { icons: { icon: '/favicon.png', }, + viewport: { + width: 'device-width', + initialScale: 1, + maximumScale: 1, + }, + other: { + 'format-detection': 'telephone=no, address=no, email=no', + }, } export const viewport = { diff --git a/src/app/mypage/address/detail/_components/MapInfo.tsx b/src/app/mypage/address/detail/_components/MapInfo.tsx index fc434922..ddf17c1c 100644 --- a/src/app/mypage/address/detail/_components/MapInfo.tsx +++ b/src/app/mypage/address/detail/_components/MapInfo.tsx @@ -1,6 +1,7 @@ 'use client' import { AddressResponseData } from '@/api/useGetAddress' +import useGetMember from '@/api/useGetMember' import usePostAddress, { Address, AddressType } from '@/api/usePostAddress' import usePutAddress from '@/api/usePutAddress' import Icon from '@/components/Icon' @@ -32,6 +33,7 @@ const MapInfo = ({ const [isAddressValid, setIsAddressValid] = useState(false) const { mutate: registerAddress, isPending } = usePostAddress() const { mutate: updateAddress, isPending: isUpdatePending } = usePutAddress() + const { refetch: refetchMember } = useGetMember() const handleAddress = () => { if (!addressData.roadAddr) { @@ -80,6 +82,7 @@ const MapInfo = ({ const _options = { onSuccess: () => { + refetchMember() queryClient.invalidateQueries({ queryKey: ['address'] }) hideModal() }, diff --git a/src/app/pay/_components/OrderInfo.tsx b/src/app/pay/_components/OrderInfo.tsx index 693da1bc..b21fee0d 100644 --- a/src/app/pay/_components/OrderInfo.tsx +++ b/src/app/pay/_components/OrderInfo.tsx @@ -180,8 +180,7 @@ const OrderInfo = () => { detailAddress: member.address.detailAddress || '', excludingSpoonAndFork: isExcludingSpoon, orderType: 'DELIVERY', - // paymentType, - paymentType: OrderPayType.TOSS, + paymentType, orderMenus: cartsState.orderMenus.map((item) => { return { id: item.menuId, @@ -335,134 +334,136 @@ const OrderInfo = () => { } return ( -
-
-
- -
가게배달
-
49~64분 후 도착
-
- {/*
- -
*/} -
- -
-
+
+
+
- -
- {`${member?.address.roadAddress} ${member?.address.detailAddress}`} -
-
(으)로 배달
+ +
가게배달
+
49~64분 후 도착
+ {/*
+
*/}
-
-
[지번] {member?.address.jibunAddress}
-
-
-
-
-
router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)} - > - {storeDetail.name} + +
+
+
+ +
+ {`${member?.address.roadAddress} ${member?.address.detailAddress}`} +
+
(으)로 배달
+
+
-
- 전체삭제 +
+
[지번] {member?.address.jibunAddress}
+
+
+
router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)} + > + {storeDetail.name} +
+
+ 전체삭제 +
+
-
- {cartsState.orderMenus.map((menu, index) => ( - - ))} -
+
+ {cartsState.orderMenus.map((menu, index) => ( + + ))} +
-
- -
router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)} - > - 메뉴 추가하기 +
+ +
router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)} + > + 메뉴 추가하기 +
-
-
-
가게 요청사항
- {/* */} -
- setIsExcludingSpoon(checked)} - /> - -
- -
-
라이더 요청사항
-
-
요청사항 없음
- +
+
가게 요청사항
+ {/* */} +
+ setIsExcludingSpoon(checked)} + /> +
-
-
-
-
-
결제수단
-
-
- {!paymentType ? ( - '결제수단을 선택해주세요' - ) : ( - - {paymentType === OrderPayType.TOSS ? '토스페이' : 'PAY200'} - - )} + +
+
라이더 요청사항
+
+
요청사항 없음
+
-
-
-
-
-
상품금액
-
{totalMenuPrice.toLocaleString()}원
+
+
+
결제수단
+
+
+ {!paymentType ? ( + '결제수단을 선택해주세요' + ) : ( + + {paymentType === OrderPayType.TOSS ? '토스페이' : 'PAY200'} + + )} +
+ +
+
-
-
배달요금
-
{deliveryPrice.toLocaleString()}원
+
+
+
상품금액
+
{totalMenuPrice.toLocaleString()}원
+
+
+
배달요금
+
{deliveryPrice.toLocaleString()}원
+
-
- -
-
총 결제금액
-
- {(totalMenuPrice + deliveryPrice).toLocaleString()}원 + +
+
총 결제금액
+
+ {(totalMenuPrice + deliveryPrice).toLocaleString()}원 +
{/* 배달비 무료 조건 추가 */} -
+

{ return ( <> {member ? ( -

+
) : ( diff --git a/src/app/search/result/_components/SearchResult.tsx b/src/app/search/result/_components/SearchResult.tsx index 80b53a31..ec3c6d06 100644 --- a/src/app/search/result/_components/SearchResult.tsx +++ b/src/app/search/result/_components/SearchResult.tsx @@ -9,6 +9,7 @@ import { Store } from '@/models/store' import { useGeoLocationStore } from '@/store/geoLocation' import { useFoodSearchFilterStore } from '@/store/homeSearchFilter' import suggestionStore from '@/store/suggestion' +import memberStore from '@/store/user' import { useRef } from 'react' import SearchFoodList from './SearchFoodList' @@ -17,6 +18,7 @@ const SearchResult = () => { const { coordinates: location } = useGeoLocationStore() const { keyword, order } = useFoodSearchFilterStore() const { suggestion, suggestionWord, isFocus } = suggestionStore() + const { member } = memberStore() const { data, isFetching, targetRef, refetch } = useInfiniteScroll< Store, { keyword: string | undefined; order: OrderType } @@ -25,7 +27,9 @@ const SearchResult = () => { endpoint: 'stores/list-cursor', filter: { keyword, order }, size: 10, - ...(location && { location: { lat: location.latitude, lng: location.longitude } }), + ...(member + ? { location: { lat: member.address.latitude, lng: member.address.longitude } } + : location && { location: { lat: location.latitude, lng: location.longitude } }), }) const { mutate: postSearch } = usePostSearch()