Merge branch 'dev' of https://git.hanasys.jp/qcast3/onsitesurvey into feature/inquiry
This commit is contained in:
commit
8ad1ed4bcf
@ -4,4 +4,7 @@
|
|||||||
NEXT_PUBLIC_API_URL=http://localhost:3000
|
NEXT_PUBLIC_API_URL=http://localhost:3000
|
||||||
|
|
||||||
#qsp 로그인 api
|
#qsp 로그인 api
|
||||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
|
|
||||||
|
#1:1문의 api
|
||||||
|
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||||
@ -2,4 +2,7 @@
|
|||||||
NEXT_PUBLIC_API_URL=http://172.30.1.35:3000
|
NEXT_PUBLIC_API_URL=http://172.30.1.35:3000
|
||||||
|
|
||||||
#qsp 로그인 api
|
#qsp 로그인 api
|
||||||
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
|
||||||
|
|
||||||
|
#1:1문의 api
|
||||||
|
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
|
||||||
@ -28,7 +28,7 @@ export default async function RootLayout({ children, header, footer, floatBtn }:
|
|||||||
const cookieStore = await cookies()
|
const cookieStore = await cookies()
|
||||||
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)
|
||||||
|
|
||||||
const sessionData = JSON.stringify(session)
|
const sessionData = session.isLoggedIn ? JSON.stringify(session) : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactQueryProviders>
|
<ReactQueryProviders>
|
||||||
|
|||||||
@ -1,10 +1,19 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { usePopupController } from '@/store/popupController'
|
import { usePopupController } from '@/store/popupController'
|
||||||
import React from 'react'
|
|
||||||
|
|
||||||
export default function DoubleBtnAlert() {
|
export default function DoubleBtnAlert() {
|
||||||
const { alertMsg, alert2BtnYes, alert2BtnNo } = usePopupController()
|
const { alertMsg, alert2BtnYes, alert2BtnNo, setAlert2 } = usePopupController()
|
||||||
|
|
||||||
|
const handleAlert2BtnYes = () => {
|
||||||
|
alert2BtnYes()
|
||||||
|
setAlert2(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAlert2BtnNo = () => {
|
||||||
|
alert2BtnNo()
|
||||||
|
setAlert2(false)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="modal-popup alert">
|
<div className="modal-popup alert">
|
||||||
@ -13,12 +22,12 @@ export default function DoubleBtnAlert() {
|
|||||||
<div className="alert-tit">{alertMsg}</div>
|
<div className="alert-tit">{alertMsg}</div>
|
||||||
<div className="alert-btn-wrap">
|
<div className="alert-btn-wrap">
|
||||||
<div className="alert-btn-bx">
|
<div className="alert-btn-bx">
|
||||||
<button className="btn-frame red min" onClick={() => alert2BtnYes()}>
|
<button className="btn-frame red min" onClick={() => handleAlert2BtnYes()}>
|
||||||
確認
|
確認
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="alert-btn-bx">
|
<div className="alert-btn-bx">
|
||||||
<button className="btn-frame n-blue min" onClick={() => alert2BtnNo()}>
|
<button className="btn-frame n-blue min" onClick={() => handleAlert2BtnNo()}>
|
||||||
キャンセル
|
キャンセル
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import { useTitle } from '@/hooks/useTitle'
|
|||||||
import { axiosInstance } from '@/libs/axios'
|
import { axiosInstance } from '@/libs/axios'
|
||||||
|
|
||||||
import 'swiper/css'
|
import 'swiper/css'
|
||||||
|
import { confirmParamsSerialize } from '@/utils/window'
|
||||||
|
|
||||||
export default function Header() {
|
export default function Header() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -38,6 +39,22 @@ export default function Header() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleYes = () => {
|
||||||
|
console.log('yes')
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleNo = () => {
|
||||||
|
console.log('no')
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleCofirm = () => {
|
||||||
|
window.neoConfirm(
|
||||||
|
'よろしいですか?',
|
||||||
|
() => console.log('yes'),
|
||||||
|
() => console.log('no'),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="header-warp">
|
<div className="header-warp">
|
||||||
@ -45,7 +62,7 @@ export default function Header() {
|
|||||||
<div className="header-inner">
|
<div className="header-inner">
|
||||||
{backBtn && (
|
{backBtn && (
|
||||||
<div className="back-button-wrap">
|
<div className="back-button-wrap">
|
||||||
<button className="back-button" onClick={() => router.back()}></button>
|
<button className="back-button" onClick={handleCofirm}></button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<h2 className="logo">
|
<h2 className="logo">
|
||||||
|
|||||||
@ -7,6 +7,12 @@ import { usePathname } from 'next/navigation'
|
|||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
neoConfirm: (msg?: string, alertBtn2Yes?: Function, alertBtn2No?: Function) => boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
interface EdgeProviderProps {
|
interface EdgeProviderProps {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
sessionData: string
|
sessionData: string
|
||||||
@ -44,29 +50,24 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
|
|||||||
setAlert2(true)
|
setAlert2(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//alert 함수 변경해서 바인딩
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
//alert 함수 변경해서 바인딩
|
||||||
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
window.alert = function (msg, alertBtn = () => setAlert(false)) {
|
||||||
alertFunc(msg, alertBtn)
|
alertFunc(msg, alertBtn)
|
||||||
}
|
}
|
||||||
window.confirm = function (msg = '', alert2BtnYes = () => setAlert2(false), alert2BtnNo = () => setAlert2(false)) {
|
// confirm 함수 변경해서 바인딩
|
||||||
alertFunc2(
|
window.neoConfirm = function (msg: string | undefined, alertBtn2Yes?: Function, alertBtn2No?: Function) {
|
||||||
msg,
|
if (!msg) return false
|
||||||
() => {
|
alertFunc2(msg, alertBtn2Yes || (() => {}), alertBtn2No || (() => {}))
|
||||||
alert2BtnYes()
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
alert2BtnNo()
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
setSession({
|
// 서버 세션이 있으면 zuatand 세션 데이터 갱신
|
||||||
...session,
|
if (sessionData && sessionData !== '') {
|
||||||
...JSON.parse(sessionData),
|
setSession({
|
||||||
})
|
...session,
|
||||||
|
...JSON.parse(sessionData),
|
||||||
|
})
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
7
src/utils/window.ts
Normal file
7
src/utils/window.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export const confirmParamsSerialize = ({ msg, yes, no }: { msg: string; yes: () => void; no: () => void }) => {
|
||||||
|
return JSON.stringify({ msg, yes, no })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const confirmParamsDeserialize = (params: string) => {
|
||||||
|
return JSON.parse(params)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user