Skip to content

Commit e52dbbc

Browse files
authored
Merge pull request #173 from FC-InnerCircle-ICD2/develop
publish
2 parents 01f6743 + b202621 commit e52dbbc

File tree

8 files changed

+132
-114
lines changed

8 files changed

+132
-114
lines changed

src/api/usePostOrderPay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
33

44
export enum OrderPayType {
55
TOSS = 'TOSS_PAY',
6-
PAY200 = 'PAY200',
6+
PAY200 = 'PAY_200',
77
}
88

99
export interface OrderPay {

src/app/home/_components/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Home = () => {
2424
endpoint: 'stores/list-cursor',
2525
filter: { category: undefined },
2626
size: 10,
27-
...(location && { location: { lat: location.latitude, lng: location.longitude } }),
27+
...(member ? {location: {lat: member.address.latitude, lng: member.address.longitude}} : location && { location: { lat: location.latitude, lng: location.longitude } }),
2828
})
2929

3030
const handleRefresh = async (): Promise<void> => {

src/app/home/list/_components/HomeList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ const HomeList = () => {
2525
endpoint: 'stores/list-cursor',
2626
filter: { category, order },
2727
size: 10,
28-
...(location && { location: { lat: location.latitude, lng: location.longitude } }),
28+
...(member
29+
? { location: { lat: member.address.latitude, lng: member.address.longitude } }
30+
: location && { location: { lat: location.latitude, lng: location.longitude } }),
2931
})
3032

3133
const scrollRef = useRef<HTMLDivElement>(null)

src/app/layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ export const metadata: Metadata = {
1616
icons: {
1717
icon: '/favicon.png',
1818
},
19+
viewport: {
20+
width: 'device-width',
21+
initialScale: 1,
22+
maximumScale: 1,
23+
},
24+
other: {
25+
'format-detection': 'telephone=no, address=no, email=no',
26+
},
1927
}
2028

2129
export const viewport = {

src/app/mypage/address/detail/_components/MapInfo.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { AddressResponseData } from '@/api/useGetAddress'
4+
import useGetMember from '@/api/useGetMember'
45
import usePostAddress, { Address, AddressType } from '@/api/usePostAddress'
56
import usePutAddress from '@/api/usePutAddress'
67
import Icon from '@/components/Icon'
@@ -32,6 +33,7 @@ const MapInfo = ({
3233
const [isAddressValid, setIsAddressValid] = useState<boolean>(false)
3334
const { mutate: registerAddress, isPending } = usePostAddress()
3435
const { mutate: updateAddress, isPending: isUpdatePending } = usePutAddress()
36+
const { refetch: refetchMember } = useGetMember()
3537

3638
const handleAddress = () => {
3739
if (!addressData.roadAddr) {
@@ -80,6 +82,7 @@ const MapInfo = ({
8082

8183
const _options = {
8284
onSuccess: () => {
85+
refetchMember()
8386
queryClient.invalidateQueries({ queryKey: ['address'] })
8487
hideModal()
8588
},

src/app/pay/_components/OrderInfo.tsx

Lines changed: 110 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ const OrderInfo = () => {
180180
detailAddress: member.address.detailAddress || '',
181181
excludingSpoonAndFork: isExcludingSpoon,
182182
orderType: 'DELIVERY',
183-
// paymentType,
184-
paymentType: OrderPayType.TOSS,
183+
paymentType,
185184
orderMenus: cartsState.orderMenus.map((item) => {
186185
return {
187186
id: item.menuId,
@@ -335,134 +334,136 @@ const OrderInfo = () => {
335334
}
336335

337336
return (
338-
<div id="payment-method" className="my-5 flex flex-col gap-5 pb-32">
339-
<div className="flex flex-row justify-between">
340-
<div className="flex flex-row gap-2">
341-
<Icon name="Bike" size={24} />
342-
<div className="place-content-center text-sm font-bold">가게배달</div>
343-
<div className="place-content-center text-xs">49~64분 후 도착</div>
344-
</div>
345-
{/* <div>
346-
<Icon name="ChevronRight" size={24} />
347-
</div> */}
348-
</div>
349-
<Separator />
350-
<div className="flex flex-col gap-2">
351-
<div className="flex flex-row justify-between" onClick={handleSelectRiderRequest}>
337+
<div id="payment-method" className="relative mt-5">
338+
<div className="flex flex-col gap-5 px-mobile_safe pb-7">
339+
<div className="flex flex-row justify-between">
352340
<div className="flex flex-row gap-2">
353-
<Icon name="MapPin" size={24} />
354-
<div className="max-w-[calc(100dvw-24px-24px-54px-1rem-40px)] place-content-center truncate text-sm font-bold">
355-
{`${member?.address.roadAddress} ${member?.address.detailAddress}`}
356-
</div>
357-
<div className="place-content-center text-xs">(으)로 배달</div>
341+
<Icon name="Bike" size={24} />
342+
<div className="place-content-center text-sm font-bold">가게배달</div>
343+
<div className="place-content-center text-xs">49~64분 후 도착</div>
358344
</div>
345+
{/* <div>
359346
<Icon name="ChevronRight" size={24} />
347+
</div> */}
360348
</div>
361-
<div>
362-
<div className="ml-7 text-xs text-gray-700">[지번] {member?.address.jibunAddress}</div>
363-
</div>
364-
</div>
365-
<div className="rounded-xl border border-solid border-gray-400">
366-
<div className="flex flex-row justify-between border-b border-solid border-gray-300 px-5 py-4">
367-
<div
368-
className="cursor-pointer text-base font-extrabold"
369-
onClick={() => router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)}
370-
>
371-
{storeDetail.name}
349+
<Separator />
350+
<div className="flex flex-col gap-2">
351+
<div className="flex flex-row justify-between" onClick={handleSelectRiderRequest}>
352+
<div className="flex flex-row gap-2">
353+
<Icon name="MapPin" size={24} />
354+
<div className="max-w-[calc(100dvw-24px-24px-54px-1rem-40px)] place-content-center truncate text-sm font-bold">
355+
{`${member?.address.roadAddress} ${member?.address.detailAddress}`}
356+
</div>
357+
<div className="place-content-center text-xs">(으)로 배달</div>
358+
</div>
359+
<Icon name="ChevronRight" size={24} />
372360
</div>
373-
<div
374-
className="cursor-pointer place-content-center text-xs text-gray-700"
375-
onClick={handleEmptyCart}
376-
>
377-
전체삭제
361+
<div>
362+
<div className="ml-7 text-xs text-gray-700">[지번] {member?.address.jibunAddress}</div>
378363
</div>
379364
</div>
365+
<div className="rounded-xl border border-solid border-gray-400">
366+
<div className="flex flex-row justify-between border-b border-solid border-gray-300 px-5 py-4">
367+
<div
368+
className="cursor-pointer text-base font-extrabold"
369+
onClick={() => router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)}
370+
>
371+
{storeDetail.name}
372+
</div>
373+
<div
374+
className="cursor-pointer place-content-center text-xs text-gray-700"
375+
onClick={handleEmptyCart}
376+
>
377+
전체삭제
378+
</div>
379+
</div>
380380

381-
<div className="flex flex-col gap-1 px-5 py-4">
382-
{cartsState.orderMenus.map((menu, index) => (
383-
<MenuItem
384-
key={`${menu.menuId}-${index}`}
385-
menu={menu}
386-
onIncrease={handleIncreaseQuantity}
387-
onDecrease={handleDecreaseQuantity}
388-
onRemove={handleRemoveItem}
389-
/>
390-
))}
391-
</div>
381+
<div className="flex flex-col gap-1 px-5 py-4">
382+
{cartsState.orderMenus.map((menu, index) => (
383+
<MenuItem
384+
key={`${menu.menuId}-${index}`}
385+
menu={menu}
386+
onIncrease={handleIncreaseQuantity}
387+
onDecrease={handleDecreaseQuantity}
388+
onRemove={handleRemoveItem}
389+
/>
390+
))}
391+
</div>
392392

393-
<div className="flex flex-row items-center justify-center gap-1 border-t border-solid border-gray-300 px-5 py-4">
394-
<Icon name="Plus" size={20} />
395-
<div
396-
className="cursor-pointer font-bold"
397-
onClick={() => router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)}
398-
>
399-
메뉴 추가하기
393+
<div className="flex flex-row items-center justify-center gap-1 border-t border-solid border-gray-300 px-5 py-4">
394+
<Icon name="Plus" size={20} />
395+
<div
396+
className="cursor-pointer font-bold"
397+
onClick={() => router.push(`${ROUTE_PATHS.STORE_DETAIL}/${storeDetail.id}`)}
398+
>
399+
메뉴 추가하기
400+
</div>
400401
</div>
401402
</div>
402-
</div>
403-
<div className="flex flex-col gap-4 rounded-xl border border-solid border-gray-400 px-5 py-4">
404-
<div className="text-base font-extrabold">가게 요청사항</div>
405-
{/* <Input placeholder="예) 견과류 빼주세요" /> */}
406-
<div className="items-top flex items-center space-x-2">
407-
<Checkbox
408-
id="terms1"
409-
className="size-5 border-solid border-gray-300 outline-none data-[state=checked]:border-primary data-[state=checked]:bg-white"
410-
checked={isExcludingSpoon}
411-
onCheckedChange={(checked: boolean) => setIsExcludingSpoon(checked)}
412-
/>
413-
<Label
414-
htmlFor="terms1"
415-
className="text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
416-
>
417-
일회용 수저, 포크는 빼주세요
418-
</Label>
419-
</div>
420-
<Separator />
421-
<div className="flex flex-row justify-between">
422-
<div className="place-content-center text-base font-extrabold">라이더 요청사항</div>
423-
<div className="flex flex-row gap-1" onClick={handleSelectRiderRequest}>
424-
<div className="place-content-center text-sm">요청사항 없음</div>
425-
<Icon name="ChevronRight" size={24} />
403+
<div className="flex flex-col gap-4 rounded-xl border border-solid border-gray-400 px-5 py-4">
404+
<div className="text-base font-extrabold">가게 요청사항</div>
405+
{/* <Input placeholder="예) 견과류 빼주세요" /> */}
406+
<div className="items-top flex items-center space-x-2">
407+
<Checkbox
408+
id="terms1"
409+
className="size-5 border-solid border-gray-300 outline-none data-[state=checked]:border-primary data-[state=checked]:bg-white"
410+
checked={isExcludingSpoon}
411+
onCheckedChange={(checked: boolean) => setIsExcludingSpoon(checked)}
412+
/>
413+
<Label
414+
htmlFor="terms1"
415+
className="text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
416+
>
417+
일회용 수저, 포크는 빼주세요
418+
</Label>
426419
</div>
427-
</div>
428-
</div>
429-
<div className="flex flex-col gap-4 rounded-xl border border-solid border-gray-400 px-5 py-4">
430-
<div className="flex flex-row justify-between" onClick={handleSelectOrderPay}>
431-
<div className="place-content-center text-base font-extrabold">결제수단</div>
432-
<div className="flex flex-row items-center gap-1">
433-
<div className="place-content-center text-sm font-semibold text-primary">
434-
{!paymentType ? (
435-
'결제수단을 선택해주세요'
436-
) : (
437-
<span className="text-base font-semibold">
438-
{paymentType === OrderPayType.TOSS ? '토스페이' : 'PAY200'}
439-
</span>
440-
)}
420+
<Separator />
421+
<div className="flex flex-row justify-between">
422+
<div className="place-content-center text-base font-extrabold">라이더 요청사항</div>
423+
<div className="flex flex-row gap-1" onClick={handleSelectRiderRequest}>
424+
<div className="place-content-center text-sm">요청사항 없음</div>
425+
<Icon name="ChevronRight" size={24} />
441426
</div>
442-
<Icon name="ChevronRight" size={24} />
443427
</div>
444428
</div>
445-
</div>
446-
<div className="flex flex-col gap-2 px-1">
447-
<div className="flex flex-row justify-between">
448-
<div>상품금액</div>
449-
<div>{totalMenuPrice.toLocaleString()}</div>
429+
<div className="flex flex-col gap-4 rounded-xl border border-solid border-gray-400 px-5 py-4">
430+
<div className="flex flex-row justify-between" onClick={handleSelectOrderPay}>
431+
<div className="place-content-center text-base font-extrabold">결제수단</div>
432+
<div className="flex flex-row items-center gap-1">
433+
<div className="place-content-center text-sm font-semibold text-primary">
434+
{!paymentType ? (
435+
'결제수단을 선택해주세요'
436+
) : (
437+
<span className="text-base font-semibold">
438+
{paymentType === OrderPayType.TOSS ? '토스페이' : 'PAY200'}
439+
</span>
440+
)}
441+
</div>
442+
<Icon name="ChevronRight" size={24} />
443+
</div>
444+
</div>
450445
</div>
451-
<div className="flex flex-row justify-between">
452-
<div>배달요금</div>
453-
<div>{deliveryPrice.toLocaleString()}</div>
446+
<div className="flex flex-col gap-2 px-1">
447+
<div className="flex flex-row justify-between">
448+
<div>상품금액</div>
449+
<div>{totalMenuPrice.toLocaleString()}</div>
450+
</div>
451+
<div className="flex flex-row justify-between">
452+
<div>배달요금</div>
453+
<div>{deliveryPrice.toLocaleString()}</div>
454+
</div>
454455
</div>
455-
</div>
456-
<Separator />
457-
<div className="flex flex-row justify-between px-1">
458-
<div className="text-lg font-bold">총 결제금액</div>
459-
<div className="text-lg font-bold">
460-
{(totalMenuPrice + deliveryPrice).toLocaleString()}
456+
<Separator />
457+
<div className="flex flex-row justify-between px-1">
458+
<div className="text-lg font-bold">총 결제금액</div>
459+
<div className="text-lg font-bold">
460+
{(totalMenuPrice + deliveryPrice).toLocaleString()}
461+
</div>
461462
</div>
462463
</div>
463464

464465
{/* 배달비 무료 조건 추가 */}
465-
<div className="fixed bottom-0 left-0 h-28 w-full rounded-t-2xl bg-white px-mobile_safe shadow-[0_-4px_6px_-2px_rgba(0,0,0,0.1)]">
466+
<div className="sticky bottom-0 left-0 h-28 w-full max-w-[480px] rounded-t-2xl bg-white px-mobile_safe shadow-[0_-4px_6px_-2px_rgba(0,0,0,0.1)]">
466467
<p
467468
className={cn(
468469
'py-3 text-center text-sm font-semibold text-blue-600',

src/app/pay/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const PayPage = () => {
99
return (
1010
<>
1111
{member ? (
12-
<div className="px-mobile_safe">
12+
<div className="">
1313
<OrderInfo />
1414
</div>
1515
) : (

src/app/search/result/_components/SearchResult.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Store } from '@/models/store'
99
import { useGeoLocationStore } from '@/store/geoLocation'
1010
import { useFoodSearchFilterStore } from '@/store/homeSearchFilter'
1111
import suggestionStore from '@/store/suggestion'
12+
import memberStore from '@/store/user'
1213
import { useRef } from 'react'
1314
import SearchFoodList from './SearchFoodList'
1415

@@ -17,6 +18,7 @@ const SearchResult = () => {
1718
const { coordinates: location } = useGeoLocationStore()
1819
const { keyword, order } = useFoodSearchFilterStore()
1920
const { suggestion, suggestionWord, isFocus } = suggestionStore()
21+
const { member } = memberStore()
2022
const { data, isFetching, targetRef, refetch } = useInfiniteScroll<
2123
Store,
2224
{ keyword: string | undefined; order: OrderType }
@@ -25,7 +27,9 @@ const SearchResult = () => {
2527
endpoint: 'stores/list-cursor',
2628
filter: { keyword, order },
2729
size: 10,
28-
...(location && { location: { lat: location.latitude, lng: location.longitude } }),
30+
...(member
31+
? { location: { lat: member.address.latitude, lng: member.address.longitude } }
32+
: location && { location: { lat: location.latitude, lng: location.longitude } }),
2933
})
3034
const { mutate: postSearch } = usePostSearch()
3135

0 commit comments

Comments
 (0)