물건 상세
This commit is contained in:
parent
32108583e9
commit
4114a3ca1e
@ -27,37 +27,12 @@ export default function MainPage() {
|
|||||||
|
|
||||||
const [searchRadioType, setSearchRadioType] = useState('object')
|
const [searchRadioType, setSearchRadioType] = useState('object')
|
||||||
|
|
||||||
// const [saleStoreId, setSaleStoreId] = useState('')
|
|
||||||
// const [saleStoreName, setSaleStoreName] = useState('')
|
|
||||||
|
|
||||||
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
||||||
|
|
||||||
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
const [searchForm, setSearchForm] = useRecoilState(searchState)
|
||||||
|
|
||||||
const { qcastState } = useContext(QcastContext)
|
const { qcastState } = useContext(QcastContext)
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (session.pwdInitYn === 'Y') {
|
|
||||||
// fetchObjectList()
|
|
||||||
// }
|
|
||||||
// }, [session])
|
|
||||||
|
|
||||||
const fetchObjectList = async () => {
|
|
||||||
try {
|
|
||||||
const apiUrl = `/api/main-page/object/${session?.storeId}/list`
|
|
||||||
await promiseGet({
|
|
||||||
url: apiUrl,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
setSaleStoreId(res.data.saleStoreId)
|
|
||||||
setSaleStoreName(res.data.saleStoreName)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
console.error('MAIN API fetching error:', error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 엔터 이벤트
|
// 엔터 이벤트
|
||||||
const handleByOnKeyUp = (e) => {
|
const handleByOnKeyUp = (e) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
@ -68,7 +43,7 @@ export default function MainPage() {
|
|||||||
schObjectNo: searchTxt,
|
schObjectNo: searchTxt,
|
||||||
code: 'M',
|
code: 'M',
|
||||||
})
|
})
|
||||||
router.push('/management/stuff')
|
router.push('/management/stuff', { scroll: false })
|
||||||
} else {
|
} else {
|
||||||
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
||||||
router.push('/community/faq')
|
router.push('/community/faq')
|
||||||
@ -90,7 +65,7 @@ export default function MainPage() {
|
|||||||
code: 'M',
|
code: 'M',
|
||||||
})
|
})
|
||||||
|
|
||||||
router.push('/management/stuff')
|
router.push('/management/stuff', { scroll: false })
|
||||||
} else {
|
} else {
|
||||||
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' })
|
||||||
router.push('/community/faq')
|
router.push('/community/faq')
|
||||||
|
|||||||
@ -22,19 +22,12 @@ export default function MainContents() {
|
|||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet } = useAxios(globalLocaleState)
|
const { promiseGet } = useAxios(globalLocaleState)
|
||||||
|
|
||||||
//최근 물건
|
|
||||||
// const [objectList, setObjectList] = useState([])
|
|
||||||
|
|
||||||
//공지사항
|
//공지사항
|
||||||
const [recentNoticeList, setRecentNoticeList] = useState([])
|
const [recentNoticeList, setRecentNoticeList] = useState([])
|
||||||
|
|
||||||
//FAQ
|
//FAQ
|
||||||
const [recentFaqList, setRecentFaqList] = useState([])
|
const [recentFaqList, setRecentFaqList] = useState([])
|
||||||
|
|
||||||
//Sales Contact info
|
|
||||||
// const [businessCharger, setBusinessCharger] = useState(null)
|
|
||||||
// const [businessChargerMail, setBusinessChargerMail] = useState(null)
|
|
||||||
|
|
||||||
const { qcastState } = useContext(QcastContext)
|
const { qcastState } = useContext(QcastContext)
|
||||||
const { fetchObjectList, initObjectList } = useMainContentsController()
|
const { fetchObjectList, initObjectList } = useMainContentsController()
|
||||||
|
|
||||||
@ -47,28 +40,6 @@ export default function MainContents() {
|
|||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
//최근 갱신 물건목록 / Sales Contact info 정보
|
|
||||||
// const fetchObjectList = async () => {
|
|
||||||
// try {
|
|
||||||
// const apiUrl = `/api/main-page/object/${session?.storeId}/list`
|
|
||||||
// await promiseGet({
|
|
||||||
// url: apiUrl,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (res.status === 200) {
|
|
||||||
// setObjectList(res.data.objectList)
|
|
||||||
// setBusinessCharger(res.data.businessCharger)
|
|
||||||
// setBusinessChargerMail(res.data.businessChargerMail)
|
|
||||||
// } else {
|
|
||||||
// setObjectList([])
|
|
||||||
// setBusinessCharger(null)
|
|
||||||
// setBusinessChargerMail(null)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error('MAIN API fetching error:', error)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//공지사항 호출
|
//공지사항 호출
|
||||||
const fetchNoticeList = async () => {
|
const fetchNoticeList = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -211,7 +211,6 @@ export default function Stuff() {
|
|||||||
fetchData()
|
fetchData()
|
||||||
} else if (stuffSearchParams?.code === 'M') {
|
} else if (stuffSearchParams?.code === 'M') {
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: session?.storeId,
|
|
||||||
schObjectNo: stuffSearchParams.schObjectNo,
|
schObjectNo: stuffSearchParams.schObjectNo,
|
||||||
schAddress: '',
|
schAddress: '',
|
||||||
schObjectName: '',
|
schObjectName: '',
|
||||||
@ -225,7 +224,7 @@ export default function Stuff() {
|
|||||||
endRow: pageNo * pageSize,
|
endRow: pageNo * pageSize,
|
||||||
schSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : stuffSearchParams.schSelSaleStoreId,
|
schSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : stuffSearchParams.schSelSaleStoreId,
|
||||||
schSortType: 'R',
|
schSortType: 'R',
|
||||||
code: 'S',
|
code: 'E',
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
}
|
}
|
||||||
@ -338,7 +337,6 @@ export default function Stuff() {
|
|||||||
|
|
||||||
//최근 등록일 수정일 정렬 이벤트
|
//최근 등록일 수정일 정렬 이벤트
|
||||||
const onChangeSortType = (e) => {
|
const onChangeSortType = (e) => {
|
||||||
// let startRow = (stuffSearchParams.pageNo - 1) * pageSize + 1
|
|
||||||
let startRow = (1 - 1) * stuffSearchParams.pageSize + 1
|
let startRow = (1 - 1) * stuffSearchParams.pageSize + 1
|
||||||
stuffSearchParams.startRow = startRow
|
stuffSearchParams.startRow = startRow
|
||||||
stuffSearchParams.endRow = startRow * stuffSearchParams.pageSize
|
stuffSearchParams.endRow = startRow * stuffSearchParams.pageSize
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user