[251124] fix: Log정리-5
🕐 커밋 시간: 2025. 11. 24. 12:43:58 📊 변경 통계: • 총 파일: 40개 • 추가: +774줄 • 삭제: -581줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/appDataActions.js ~ com.twin.app.shoptime/src/actions/billingActions.js ~ com.twin.app.shoptime/src/actions/brandActions.js ~ com.twin.app.shoptime/src/actions/cancelActions.js ~ com.twin.app.shoptime/src/actions/cardActions.js ~ com.twin.app.shoptime/src/actions/cartActions.js ~ com.twin.app.shoptime/src/actions/checkoutActions.js ~ com.twin.app.shoptime/src/actions/commonActions.js ~ com.twin.app.shoptime/src/actions/convertActions.js ~ com.twin.app.shoptime/src/actions/couponActions.js ~ com.twin.app.shoptime/src/actions/deviceActions.js ~ com.twin.app.shoptime/src/actions/empActions.js ~ com.twin.app.shoptime/src/actions/eventActions.js ~ com.twin.app.shoptime/src/actions/forYouActions.js ~ com.twin.app.shoptime/src/actions/homeActions.js ~ com.twin.app.shoptime/src/actions/logActions.js ~ com.twin.app.shoptime/src/actions/mediaActions.js ~ com.twin.app.shoptime/src/actions/mockCartActions.js ~ com.twin.app.shoptime/src/actions/myPageActions.js ~ com.twin.app.shoptime/src/actions/onSaleActions.js ~ com.twin.app.shoptime/src/actions/orderActions.js ~ com.twin.app.shoptime/src/actions/panelActions.js ~ com.twin.app.shoptime/src/actions/panelNavigationActions.js ~ com.twin.app.shoptime/src/actions/pinCodeActions.js ~ com.twin.app.shoptime/src/actions/productActions.js ~ com.twin.app.shoptime/src/actions/queuedPanelActions.js ~ com.twin.app.shoptime/src/actions/searchActions.js ~ com.twin.app.shoptime/src/actions/shippingActions.js ~ com.twin.app.shoptime/src/actions/voiceActions.js ~ com.twin.app.shoptime/src/actions/webSpeechActions.js ~ com.twin.app.shoptime/src/reducers/localSettingsReducer.js ~ com.twin.app.shoptime/src/reducers/mediaOverlayReducer.js ~ com.twin.app.shoptime/src/reducers/mockCartReducer.js ~ com.twin.app.shoptime/src/reducers/playReducer.js ~ com.twin.app.shoptime/src/reducers/productReducer.js ~ com.twin.app.shoptime/src/reducers/videoOverlayReducer.js ~ com.twin.app.shoptime/src/views/UserReview/ShowUserReviews.jsx ~ com.twin.app.shoptime/src/views/UserReview/UserReviewPanel.jsx ~ com.twin.app.shoptime/src/views/UserReview/components/UserReviewsList.jsx ~ com.twin.app.shoptime/src/views/UserReview/components/VirtualScrollBar.jsx 🔧 함수 변경 내용: 📊 Function-level changes summary across 40 files: • Functions added: 14 • Functions modified: 34 • Functions deleted: 18 📋 By language: • javascript: 40 files, 66 function changes 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 로깅 시스템 개선 • 설정 관리 시스템 개선 • UI 컴포넌트 아키텍처 개선
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const addMainIndex = (index) => ({
|
export const addMainIndex = (index) => ({
|
||||||
type: types.ADD_MAIN_INDEX,
|
type: types.ADD_MAIN_INDEX,
|
||||||
@@ -25,7 +30,7 @@ export const sendSms = (params) => (dispatch, getState) => {
|
|||||||
} = params;
|
} = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("sendSms onSuccess ", response.data);
|
dlog('sendSms onSuccess ', response.data);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SEND_SMS,
|
type: types.SEND_SMS,
|
||||||
payload: response.data.data,
|
payload: response.data.data,
|
||||||
@@ -34,13 +39,13 @@ export const sendSms = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("sendSms onFail ", error);
|
derror('sendSms onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SEND_SMS,
|
URLS.SEND_SMS,
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// IF-LGSP-328 : 회원 Billing Address 조회
|
// IF-LGSP-328 : 회원 Billing Address 조회
|
||||||
export const getMyInfoBillingSearch = (props) => (dispatch, getState) => {
|
export const getMyInfoBillingSearch = (props) => (dispatch, getState) => {
|
||||||
const { mbrNo } = props;
|
const { mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyInfoBillingSearch onSuccess: ", response.data);
|
dlog('getMyInfoBillingSearch onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_BILLING_SEARCH,
|
type: types.GET_MY_INFO_BILLING_SEARCH,
|
||||||
@@ -16,13 +21,13 @@ export const getMyInfoBillingSearch = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyInfoBillingSearch onFail: ", error);
|
derror('getMyInfoBillingSearch onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_BILLING_SEARCH,
|
URLS.GET_MY_INFO_BILLING_SEARCH,
|
||||||
{ mbrNo },
|
{ mbrNo },
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from "./commonActions";
|
import { changeAppStatus } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// Featured Brands 정보 조회 IF-LGSP-304
|
// Featured Brands 정보 조회 IF-LGSP-304
|
||||||
export const getBrandList = () => (dispatch, getState) => {
|
export const getBrandList = () => (dispatch, getState) => {
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandList onSuccess ", response.data);
|
// dlog("getBrandList onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_LIST,
|
type: types.GET_BRAND_LIST,
|
||||||
@@ -21,30 +26,21 @@ export const getBrandList = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandList onFail", error);
|
derror('getBrandList onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_LIST, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_BRAND_LIST,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Featured Brands LAYOUT (shelf) 정보 조회 IF-LGSP-305
|
// Featured Brands LAYOUT (shelf) 정보 조회 IF-LGSP-305
|
||||||
export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
|
export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
|
||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandLayoutInfo onSuccess ", response.data);
|
// dlog("getBrandLayoutInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_LAYOUT_INFO,
|
type: types.GET_BRAND_LAYOUT_INFO,
|
||||||
@@ -57,30 +53,21 @@ export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandLayoutInfo onFail ", error);
|
derror('getBrandLayoutInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_LAYOUT_INFO, { patnrId }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_BRAND_LAYOUT_INFO,
|
|
||||||
{ patnrId },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Featured Brands Live 채널 정보 조회 IF-LGSP-306
|
// Featured Brands Live 채널 정보 조회 IF-LGSP-306
|
||||||
export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
|
export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
|
||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandLiveChannelInfo onSuccess ", response.data);
|
// dlog("getBrandLiveChannelInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_LIVE_CHANNEL_INFO,
|
type: types.GET_BRAND_LIVE_CHANNEL_INFO,
|
||||||
@@ -93,14 +80,14 @@ export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandLiveChannelInfo onFail ", error);
|
derror('getBrandLiveChannelInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
|
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
|
||||||
{ patnrId },
|
{ patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -113,7 +100,7 @@ export const getBrandChanInfo = (props) => (dispatch, getState) => {
|
|||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandChanInfo onSuccess ", response.data);
|
// dlog("getBrandChanInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_CHAN_INFO,
|
type: types.GET_BRAND_CHAN_INFO,
|
||||||
@@ -124,13 +111,13 @@ export const getBrandChanInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandChanInfo onFail ", error);
|
derror('getBrandChanInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
|
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
|
||||||
{ patnrId },
|
{ patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -143,10 +130,10 @@ export const getBrandChanInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
|
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
|
||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandTSVInfo onSuccess ", response.data);
|
// dlog("getBrandTSVInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_TSV_INFO,
|
type: types.GET_BRAND_TSV_INFO,
|
||||||
@@ -159,30 +146,21 @@ export const getBrandTSVInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandTSVInfo onFail ", error);
|
derror('getBrandTSVInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_TSV_INFO, { patnrId }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_BRAND_TSV_INFO,
|
|
||||||
{ patnrId },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Featured Brand Recommended Show 정보 조회 IF-LGSP-308
|
// Featured Brand Recommended Show 정보 조회 IF-LGSP-308
|
||||||
export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
|
export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
|
||||||
const { catCd, patnrId } = props;
|
const { catCd, patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandRecommendedShowInfo onSuccess", response.data);
|
// dlog("getBrandRecommendedShowInfo onSuccess", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
|
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
|
||||||
@@ -195,14 +173,14 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandRecommendedShowInfo onFail", error);
|
derror('getBrandRecommendedShowInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_RECOMMENDED_SHOW_INFO,
|
URLS.GET_BRAND_RECOMMENDED_SHOW_INFO,
|
||||||
{ catCd, patnrId },
|
{ catCd, patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -215,10 +193,10 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
|
export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
|
||||||
const { hstNm, patnrId } = props;
|
const { hstNm, patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandCreatorsInfo onSuccess ", response.data);
|
// dlog("getBrandCreatorsInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_CREATORS_INFO,
|
type: types.GET_BRAND_CREATORS_INFO,
|
||||||
@@ -231,14 +209,14 @@ export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandCreatorsInfo onFail ", error);
|
derror('getBrandCreatorsInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_CREATORS_INFO,
|
URLS.GET_BRAND_CREATORS_INFO,
|
||||||
{ hstNm, patnrId },
|
{ hstNm, patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -251,10 +229,10 @@ export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
|
export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
|
||||||
const { patnrId, seriesId } = props;
|
const { patnrId, seriesId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandSeriesInfo onSuccess ", response.data);
|
// dlog("getBrandSeriesInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_SERIES_INFO,
|
type: types.GET_BRAND_SERIES_INFO,
|
||||||
@@ -267,14 +245,14 @@ export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandSeriesInfo onFail ", error);
|
derror('getBrandSeriesInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_SERIES_INFO,
|
URLS.GET_BRAND_SERIES_INFO,
|
||||||
{ patnrId, seriesId },
|
{ patnrId, seriesId },
|
||||||
{},
|
{},
|
||||||
@@ -287,10 +265,10 @@ export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
|
export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
|
||||||
const { catCdLv1, catCdLv2, patnrId } = props;
|
const { catCdLv1, catCdLv2, patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandCategoryInfo onSuccess ", response.data);
|
// dlog("getBrandCategoryInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_CATEGORY_INFO,
|
type: types.GET_BRAND_CATEGORY_INFO,
|
||||||
@@ -304,13 +282,13 @@ export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
|
|||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
console.error("getBrandCategoryInfo onFail ", error);
|
derror('getBrandCategoryInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_CATEGORY_INFO,
|
URLS.GET_BRAND_CATEGORY_INFO,
|
||||||
{ catCdLv1, catCdLv2, patnrId },
|
{ catCdLv1, catCdLv2, patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -322,10 +300,10 @@ export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
|
export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
|
||||||
const { catCdLv1, catCdLv2, patnrId } = props;
|
const { catCdLv1, catCdLv2, patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandCategoryProductInfo onSuccess ", response.data);
|
// dlog("getBrandCategoryProductInfo onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_CATEGORY_PRODUCT_INFO,
|
type: types.GET_BRAND_CATEGORY_PRODUCT_INFO,
|
||||||
@@ -338,14 +316,14 @@ export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandCategoryProductInfo onFail ", error);
|
derror('getBrandCategoryProductInfo onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_CATEGORY_INFO,
|
URLS.GET_BRAND_CATEGORY_INFO,
|
||||||
{ catCdLv1, catCdLv2, patnrId },
|
{ catCdLv1, catCdLv2, patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -358,10 +336,10 @@ export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getBrandBestSeller = (props) => (dispatch, getState) => {
|
export const getBrandBestSeller = (props) => (dispatch, getState) => {
|
||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandBestSeller onSuccess ", response.data);
|
// dlog("getBrandBestSeller onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_BEST_SELLER,
|
type: types.GET_BRAND_BEST_SELLER,
|
||||||
@@ -374,30 +352,21 @@ export const getBrandBestSeller = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandBestSeller onFail ", error);
|
derror('getBrandBestSeller onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_BEST_SELLER, { patnrId }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_BRAND_BEST_SELLER,
|
|
||||||
{ patnrId },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Featured Brands Showroom 조회 IF-LGSP-372
|
// Featured Brands Showroom 조회 IF-LGSP-372
|
||||||
export const getBrandShowroom = (props) => (dispatch, getState) => {
|
export const getBrandShowroom = (props) => (dispatch, getState) => {
|
||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandShowroom onSuccess ", response.data);
|
// dlog("getBrandShowroom onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_SHOWROOM,
|
type: types.GET_BRAND_SHOWROOM,
|
||||||
@@ -410,20 +379,11 @@ export const getBrandShowroom = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandShowroom onFail ", error);
|
derror('getBrandShowroom onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_BRAND_SHOWROOM, { patnrId }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_BRAND_SHOWROOM,
|
|
||||||
{ patnrId },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Featured Brands Recently Aired 조회 IF-LGSP-373
|
// Featured Brands Recently Aired 조회 IF-LGSP-373
|
||||||
@@ -431,7 +391,7 @@ export const getBrandRecentlyAired = (props) => (dispatch, getState) => {
|
|||||||
const { patnrId } = props;
|
const { patnrId } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getBrandRecentlyAired onSuccess ", response.data);
|
// dlog("getBrandRecentlyAired onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_BRAND_RECENTLY_AIRED,
|
type: types.GET_BRAND_RECENTLY_AIRED,
|
||||||
@@ -442,14 +402,14 @@ export const getBrandRecentlyAired = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getBrandRecentlyAired onFail ", error);
|
derror('getBrandRecentlyAired onFail ', error);
|
||||||
// dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
// dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_BRAND_RECENTLY_AIRED,
|
URLS.GET_BRAND_RECENTLY_AIRED,
|
||||||
{ patnrId },
|
{ patnrId },
|
||||||
{},
|
{},
|
||||||
@@ -467,7 +427,7 @@ export const setBrandLiveChannelUpcoming = (props) => (dispatch, getState) => {
|
|||||||
const brandLiveChannelUpcoming = storedBrandLiveChannelUpcoming //
|
const brandLiveChannelUpcoming = storedBrandLiveChannelUpcoming //
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
if (item.showId === showId && item.strtDt === strtDt) {
|
if (item.showId === showId && item.strtDt === strtDt) {
|
||||||
item.alamDispFlag = item.alamDispFlag === "Y" ? "N" : "Y";
|
item.alamDispFlag = item.alamDispFlag === 'Y' ? 'N' : 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
@@ -488,12 +448,11 @@ export const setBrandLiveChannelUpcoming = (props) => (dispatch, getState) => {
|
|||||||
export const setBrandChanInfo = (props) => (dispatch, getState) => {
|
export const setBrandChanInfo = (props) => (dispatch, getState) => {
|
||||||
const { showId, strtDt } = props;
|
const { showId, strtDt } = props;
|
||||||
|
|
||||||
const storedBrandLiveChanInfo =
|
const storedBrandLiveChanInfo = getState().brand.brandLiveChannelInfoData.data.brandChanInfo;
|
||||||
getState().brand.brandLiveChannelInfoData.data.brandChanInfo;
|
|
||||||
|
|
||||||
const brandChanInfo = storedBrandLiveChanInfo.map((item) => {
|
const brandChanInfo = storedBrandLiveChanInfo.map((item) => {
|
||||||
if (item.showId === showId && item.strtDt === strtDt) {
|
if (item.showId === showId && item.strtDt === strtDt) {
|
||||||
item.alamDispFlag = item.alamDispFlag === "Y" ? "N" : "Y";
|
item.alamDispFlag = item.alamDispFlag === 'Y' ? 'N' : 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus, showError } from "./commonActions";
|
import { changeAppStatus, showError } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 회원 주문 취소/반품/교환 사유 조회 (IF-LGSP-347)
|
// 회원 주문 취소/반품/교환 사유 조회 (IF-LGSP-347)
|
||||||
export const getMyinfoOrderCancelColumnsSearch =
|
export const getMyinfoOrderCancelColumnsSearch = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { reasonTpCd } = params;
|
const { reasonTpCd } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log(
|
dlog('getMyinfoOrderCancelColumnsSearch onSuccess ', response.data);
|
||||||
"getMyinfoOrderCancelColumnsSearch onSuccess ",
|
|
||||||
response.data
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -23,24 +24,19 @@ export const getMyinfoOrderCancelColumnsSearch =
|
|||||||
if (callback) callback();
|
if (callback) callback();
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, false, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyinfoOrderCancelColumnsSearch onFail ", error);
|
derror('getMyinfoOrderCancelColumnsSearch onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_ORDER_CANCEL_COLUMNS_SEARCH,
|
URLS.GET_MY_INFO_ORDER_CANCEL_COLUMNS_SEARCH,
|
||||||
{ reasonTpCd },
|
{ reasonTpCd },
|
||||||
{},
|
{},
|
||||||
@@ -54,7 +50,7 @@ export const getMyinfoOrderCancelSearch = (params) => (dispatch, getState) => {
|
|||||||
const { mbrNo, ordNo, patnrId, prdtId, prodSno, shptmChngRsnCd } = params;
|
const { mbrNo, ordNo, patnrId, prdtId, prodSno, shptmChngRsnCd } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyinfoOrderCancelSearch onSuccess ", response.data);
|
dlog('getMyinfoOrderCancelSearch onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_ORDER_CANCEL_SEARCH,
|
type: types.GET_MY_INFO_ORDER_CANCEL_SEARCH,
|
||||||
@@ -63,13 +59,13 @@ export const getMyinfoOrderCancelSearch = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyinfoOrderCancelSearch onFail ", error);
|
derror('getMyinfoOrderCancelSearch onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_ORDER_CANCEL_SEARCH,
|
URLS.GET_MY_INFO_ORDER_CANCEL_SEARCH,
|
||||||
{ mbrNo, ordNo, patnrId, prdtId, prodSno, shptmChngRsnCd },
|
{ mbrNo, ordNo, patnrId, prdtId, prodSno, shptmChngRsnCd },
|
||||||
{},
|
{},
|
||||||
@@ -80,18 +76,10 @@ export const getMyinfoOrderCancelSearch = (params) => (dispatch, getState) => {
|
|||||||
|
|
||||||
// 주문 부분 결제 취소 (IF-LGSP-351)
|
// 주문 부분 결제 취소 (IF-LGSP-351)
|
||||||
export const updateOrderPartialCancel = (params) => (dispatch, getState) => {
|
export const updateOrderPartialCancel = (params) => (dispatch, getState) => {
|
||||||
const {
|
const { mbrNo, ordNo, prodSno, reqChngRsn, reqChngRsnCd, reqMbrId, reqMbrNo } = params;
|
||||||
mbrNo,
|
|
||||||
ordNo,
|
|
||||||
prodSno,
|
|
||||||
reqChngRsn,
|
|
||||||
reqChngRsnCd,
|
|
||||||
reqMbrId,
|
|
||||||
reqMbrNo,
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("updateOrderPartialCancel onSuccess ", response.data);
|
dlog('updateOrderPartialCancel onSuccess ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -100,24 +88,19 @@ export const updateOrderPartialCancel = (params) => (dispatch, getState) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, false, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("updateOrderPartialCancel onFail ", error);
|
derror('updateOrderPartialCancel onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.UPDATE_ORDER_PARTIAL_CANCEL,
|
URLS.UPDATE_ORDER_PARTIAL_CANCEL,
|
||||||
{ mbrNo, ordNo, prodSno, reqChngRsn, reqChngRsnCd, reqMbrId, reqMbrNo },
|
{ mbrNo, ordNo, prodSno, reqChngRsn, reqChngRsnCd, reqMbrId, reqMbrNo },
|
||||||
{},
|
{},
|
||||||
@@ -127,16 +110,13 @@ export const updateOrderPartialCancel = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 결제전체취소 (IF-LGSP-367)
|
// 결제전체취소 (IF-LGSP-367)
|
||||||
export const paymentTotalCancel =
|
export const paymentTotalCancel = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { mbrNo, ordNo, reqChngRsn, reqChngRsnCd } = params;
|
const { mbrNo, ordNo, reqChngRsn, reqChngRsnCd } = params;
|
||||||
|
|
||||||
dispatch(
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } })
|
|
||||||
);
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("paymentTotalCancel onSuccess ", response.data);
|
dlog('paymentTotalCancel onSuccess ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -147,12 +127,7 @@ export const paymentTotalCancel =
|
|||||||
if (callback) callback(response.data);
|
if (callback) callback(response.data);
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, false, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,14 +135,14 @@ export const paymentTotalCancel =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("paymentTotalCancel onFail ", error);
|
derror('paymentTotalCancel onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.PAYMENT_TOTAL_CANCEL,
|
URLS.PAYMENT_TOTAL_CANCEL,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, ordNo, reqChngRsn, reqChngRsnCd },
|
{ mbrNo, ordNo, reqChngRsn, reqChngRsnCd },
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 회원의 등록 카드 정보 조회 IF-LGSP-332
|
// 회원의 등록 카드 정보 조회 IF-LGSP-332
|
||||||
export const getMyInfoCardSearch = (props) => (dispatch, getState) => {
|
export const getMyInfoCardSearch = (props) => (dispatch, getState) => {
|
||||||
const { mbrNo } = props;
|
const { mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyInfoCardSearch onSuccess: ", response.data);
|
dlog('getMyInfoCardSearch onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_CARD_SEARCH,
|
type: types.GET_MY_INFO_CARD_SEARCH,
|
||||||
@@ -16,17 +21,8 @@ export const getMyInfoCardSearch = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyInfoCardSearch OnFail: ", error);
|
derror('getMyInfoCardSearch OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_INFO_CARD_SEARCH, { mbrNo }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_INFO_CARD_SEARCH,
|
|
||||||
{ mbrNo },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import { URLS } from '../api/apiConfig';
|
|||||||
import { TAxios } from '../api/TAxios';
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { showError } from './commonActions';
|
import { showError } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 회원 장바구니 정보 조회
|
* 회원 장바구니 정보 조회
|
||||||
@@ -11,7 +16,7 @@ export const getMyInfoCartSearch = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo } = props;
|
const { mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyInfoCartSearch onSuccess: ", response.data);
|
dlog('getMyInfoCartSearch onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_CART_SEARCH,
|
type: types.GET_MY_INFO_CART_SEARCH,
|
||||||
@@ -20,7 +25,7 @@ export const getMyInfoCartSearch = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyInfoCartSearch OnFail: ", error);
|
derror('getMyInfoCartSearch OnFail: ', error);
|
||||||
|
|
||||||
// 실패 시에도 빈 데이터로 초기화
|
// 실패 시에도 빈 데이터로 초기화
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -31,7 +36,7 @@ export const getMyInfoCartSearch = (props) => (dispatch, getState) => {
|
|||||||
|
|
||||||
// API URL이 정의되어 있지 않은 경우 임시로 빈 데이터 반환
|
// API URL이 정의되어 있지 않은 경우 임시로 빈 데이터 반환
|
||||||
if (!URLS.GET_MY_INFO_CART_SEARCH) {
|
if (!URLS.GET_MY_INFO_CART_SEARCH) {
|
||||||
console.warn("GET_MY_INFO_CART_SEARCH URL이 정의되지 않았습니다.");
|
dwarn('GET_MY_INFO_CART_SEARCH URL이 정의되지 않았습니다.');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_CART_SEARCH,
|
type: types.GET_MY_INFO_CART_SEARCH,
|
||||||
payload: { cartList: [] },
|
payload: { cartList: [] },
|
||||||
@@ -39,16 +44,7 @@ export const getMyInfoCartSearch = (props) => (dispatch, getState) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_INFO_CART_SEARCH, { mbrNo }, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_INFO_CART_SEARCH,
|
|
||||||
{ mbrNo },
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,10 +54,10 @@ export const insertMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, patnrId, prdtId, prdtOpt, prodQty } = props;
|
const { mbrNo, patnrId, prdtId, prdtOpt, prodQty } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("✅ insertMyinfoCart API 성공:", response.data.retCode);
|
dlog('✅ insertMyinfoCart API 성공:', response.data.retCode);
|
||||||
// if (response.data?.retCode !== '0' && response.data.retCode !== 0) {
|
// if (response.data?.retCode !== '0' && response.data.retCode !== 0) {
|
||||||
// console.error("❌ retCode 에러:", response.data.retCode);
|
// derror("❌ retCode 에러:", response.data.retCode);
|
||||||
// console.error("에러 메시지:", response.data.retMsg);
|
// derror("에러 메시지:", response.data.retMsg);
|
||||||
|
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
@@ -73,28 +69,20 @@ export const insertMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
});
|
});
|
||||||
dispatch(getMyInfoCartSearch({ mbrNo }));
|
dispatch(getMyInfoCartSearch({ mbrNo }));
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(showError(response.data.retCode, response.data.retMsg, false, null, null));
|
||||||
showError(
|
derror('❌ retCode 에러:', response.data.retCode);
|
||||||
response.data.retCode,
|
derror('에러 메시지:', response.data.retMsg);
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
null
|
|
||||||
)
|
|
||||||
);
|
|
||||||
console.error("❌ retCode 에러:", response.data.retCode);
|
|
||||||
console.error("에러 메시지:", response.data.retMsg);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("insertMyinfoCart OnFail: ", error);
|
derror('insertMyinfoCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.INSERT_MY_INFO_CART,
|
URLS.INSERT_MY_INFO_CART,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, patnrId, prdtId, prdtOpt, prodQty },
|
{ mbrNo, patnrId, prdtId, prdtOpt, prodQty },
|
||||||
@@ -110,7 +98,7 @@ export const deleteMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, patnrId, prdtId, prodSno } = props;
|
const { mbrNo, patnrId, prdtId, prodSno } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("deleteMyinfoCart onSuccess: ", response.data);
|
dlog('deleteMyinfoCart onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.DELETE_MY_INFO_CART,
|
type: types.DELETE_MY_INFO_CART,
|
||||||
@@ -122,13 +110,13 @@ export const deleteMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("deleteMyinfoCart OnFail: ", error);
|
derror('deleteMyinfoCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.DELETE_MY_INFO_CART,
|
URLS.DELETE_MY_INFO_CART,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, patnrId, prdtId, prodSno },
|
{ mbrNo, patnrId, prdtId, prodSno },
|
||||||
@@ -144,7 +132,7 @@ export const deleteAllMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo } = props;
|
const { mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("deleteAllMyinfoCart onSuccess: ", response.data);
|
dlog('deleteAllMyinfoCart onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.DELETE_ALL_MY_INFO_CART,
|
type: types.DELETE_ALL_MY_INFO_CART,
|
||||||
@@ -156,13 +144,13 @@ export const deleteAllMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("deleteAllMyinfoCart OnFail: ", error);
|
derror('deleteAllMyinfoCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.DELETE_ALL_MY_INFO_CART,
|
URLS.DELETE_ALL_MY_INFO_CART,
|
||||||
{},
|
{},
|
||||||
{ mbrNo },
|
{ mbrNo },
|
||||||
@@ -194,7 +182,7 @@ export const updateMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, patnrId, prdtId, prodQty, prodSno } = props;
|
const { mbrNo, patnrId, prdtId, prodQty, prodSno } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("updateMyinfoCart onSuccess: ", response.data);
|
dlog('updateMyinfoCart onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.UPDATE_MY_INFO_CART,
|
type: types.UPDATE_MY_INFO_CART,
|
||||||
@@ -206,13 +194,13 @@ export const updateMyinfoCart = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("updateMyinfoCart OnFail: ", error);
|
derror('updateMyinfoCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.UPDATE_MY_INFO_CART,
|
URLS.UPDATE_MY_INFO_CART,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, patnrId, prdtId, prodQty, prodSno },
|
{ mbrNo, patnrId, prdtId, prodQty, prodSno },
|
||||||
@@ -229,7 +217,7 @@ export const addToCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt } = props;
|
const { mbrNo, patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("addToCart onSuccess: ", response.data);
|
dlog('addToCart onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.ADD_TO_CART,
|
type: types.ADD_TO_CART,
|
||||||
@@ -241,12 +229,12 @@ export const addToCart = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("addToCart OnFail: ", error);
|
derror('addToCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
// API URL이 정의되어 있지 않은 경우 로컬 상태만 업데이트
|
// API URL이 정의되어 있지 않은 경우 로컬 상태만 업데이트
|
||||||
if (!URLS.ADD_TO_CART) {
|
if (!URLS.ADD_TO_CART) {
|
||||||
console.warn("ADD_TO_CART URL이 정의되지 않았습니다.");
|
dwarn('ADD_TO_CART URL이 정의되지 않았습니다.');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.ADD_TO_CART,
|
type: types.ADD_TO_CART,
|
||||||
payload: { patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt },
|
payload: { patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt },
|
||||||
@@ -257,7 +245,7 @@ export const addToCart = (props) => (dispatch, getState) => {
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.ADD_TO_CART,
|
URLS.ADD_TO_CART,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt },
|
{ mbrNo, patnrId, prdtId, prodOptCdCval, prodQty, prdtOpt },
|
||||||
@@ -274,7 +262,7 @@ export const removeFromCart = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, cartSno } = props;
|
const { mbrNo, cartSno } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("removeFromCart onSuccess: ", response.data);
|
dlog('removeFromCart onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.REMOVE_FROM_CART,
|
type: types.REMOVE_FROM_CART,
|
||||||
@@ -286,11 +274,11 @@ export const removeFromCart = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("removeFromCart OnFail: ", error);
|
derror('removeFromCart OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!URLS.REMOVE_FROM_CART) {
|
if (!URLS.REMOVE_FROM_CART) {
|
||||||
console.warn("REMOVE_FROM_CART URL이 정의되지 않았습니다.");
|
dwarn('REMOVE_FROM_CART URL이 정의되지 않았습니다.');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.REMOVE_FROM_CART,
|
type: types.REMOVE_FROM_CART,
|
||||||
payload: { cartSno },
|
payload: { cartSno },
|
||||||
@@ -301,7 +289,7 @@ export const removeFromCart = (props) => (dispatch, getState) => {
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"delete",
|
'delete',
|
||||||
URLS.REMOVE_FROM_CART,
|
URLS.REMOVE_FROM_CART,
|
||||||
{ mbrNo, cartSno },
|
{ mbrNo, cartSno },
|
||||||
{},
|
{},
|
||||||
@@ -318,7 +306,7 @@ export const updateCartItem = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, cartSno, prodQty } = props;
|
const { mbrNo, cartSno, prodQty } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("updateCartItem onSuccess: ", response.data);
|
dlog('updateCartItem onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.UPDATE_CART_ITEM,
|
type: types.UPDATE_CART_ITEM,
|
||||||
@@ -330,11 +318,11 @@ export const updateCartItem = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("updateCartItem OnFail: ", error);
|
derror('updateCartItem OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!URLS.UPDATE_CART_ITEM) {
|
if (!URLS.UPDATE_CART_ITEM) {
|
||||||
console.warn("UPDATE_CART_ITEM URL이 정의되지 않았습니다.");
|
dwarn('UPDATE_CART_ITEM URL이 정의되지 않았습니다.');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.UPDATE_CART_ITEM,
|
type: types.UPDATE_CART_ITEM,
|
||||||
payload: { cartSno, prodQty },
|
payload: { cartSno, prodQty },
|
||||||
@@ -345,7 +333,7 @@ export const updateCartItem = (props) => (dispatch, getState) => {
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"put",
|
'put',
|
||||||
URLS.UPDATE_CART_ITEM,
|
URLS.UPDATE_CART_ITEM,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, cartSno, prodQty },
|
{ mbrNo, cartSno, prodQty },
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
import { URLS } from '../api/apiConfig';
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from '../api/TAxios';
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import {
|
import { changeAppStatus, showError } from './commonActions';
|
||||||
changeAppStatus,
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
showError,
|
|
||||||
} from './commonActions';
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 회원 체크아웃 정보 조회 IF-LGSP-345
|
// 회원 체크아웃 정보 조회 IF-LGSP-345
|
||||||
export const getMyInfoCheckoutInfo =
|
export const getMyInfoCheckoutInfo = (props, callback) => (dispatch, getState) => {
|
||||||
(props, callback) => (dispatch, getState) => {
|
|
||||||
const { mbrNo, dirPurcSelYn, cartList } = props;
|
const { mbrNo, dirPurcSelYn, cartList } = props;
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -17,14 +18,18 @@ export const getMyInfoCheckoutInfo =
|
|||||||
);
|
);
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyInfoCheckoutInfo onSuccess: ", response.data);
|
dlog('getMyInfoCheckoutInfo onSuccess: ', response.data);
|
||||||
|
|
||||||
// 🔍 API 응답 구조 분석
|
// 🔍 API 응답 구조 분석
|
||||||
const checkoutData = response.data.data || response.data;
|
const checkoutData = response.data.data || response.data;
|
||||||
const defaultAddrSno = checkoutData?.shippingAddressList?.[0]?.dlvrAddrSno || checkoutData?.shippingAddressList?.[0]?.addrSno;
|
const defaultAddrSno =
|
||||||
const defaultBilAddrSno = checkoutData?.billingAddressList?.[0]?.bilAddrSno || checkoutData?.billingAddressList?.[0]?.addrSno;
|
checkoutData?.shippingAddressList?.[0]?.dlvrAddrSno ||
|
||||||
|
checkoutData?.shippingAddressList?.[0]?.addrSno;
|
||||||
|
const defaultBilAddrSno =
|
||||||
|
checkoutData?.billingAddressList?.[0]?.bilAddrSno ||
|
||||||
|
checkoutData?.billingAddressList?.[0]?.addrSno;
|
||||||
|
|
||||||
console.log('[checkoutActions] 🔍 Checkout data structure:', {
|
dlog('[checkoutActions] 🔍 Checkout data structure:', {
|
||||||
hasResponseDataData: !!response.data.data,
|
hasResponseDataData: !!response.data.data,
|
||||||
directData: !!response.data,
|
directData: !!response.data,
|
||||||
defaultAddrSno,
|
defaultAddrSno,
|
||||||
@@ -34,7 +39,7 @@ export const getMyInfoCheckoutInfo =
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 🔴 billingAddressList 상세 분석
|
// 🔴 billingAddressList 상세 분석
|
||||||
console.log('[checkoutActions] 🔴 billingAddressList analysis:', {
|
dlog('[checkoutActions] 🔴 billingAddressList analysis:', {
|
||||||
billingAddressList: checkoutData?.billingAddressList,
|
billingAddressList: checkoutData?.billingAddressList,
|
||||||
firstBillingAddress: checkoutData?.billingAddressList?.[0],
|
firstBillingAddress: checkoutData?.billingAddressList?.[0],
|
||||||
firstBillingAddressKeys: Object.keys(checkoutData?.billingAddressList?.[0] || {}),
|
firstBillingAddressKeys: Object.keys(checkoutData?.billingAddressList?.[0] || {}),
|
||||||
@@ -46,7 +51,7 @@ export const getMyInfoCheckoutInfo =
|
|||||||
bilAddrSno: defaultBilAddrSno,
|
bilAddrSno: defaultBilAddrSno,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('[checkoutActions] 📦 Dispatching GET_CHECKOUT_INFO with:', {
|
dlog('[checkoutActions] 📦 Dispatching GET_CHECKOUT_INFO with:', {
|
||||||
infoForCheckoutData,
|
infoForCheckoutData,
|
||||||
checkoutData,
|
checkoutData,
|
||||||
});
|
});
|
||||||
@@ -63,13 +68,13 @@ export const getMyInfoCheckoutInfo =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyInfoCheckoutInfo OnFail: ", error);
|
derror('getMyInfoCheckoutInfo OnFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.GET_CHECKOUT_INFO,
|
URLS.GET_CHECKOUT_INFO,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, dirPurcSelYn, cartList },
|
{ mbrNo, dirPurcSelYn, cartList },
|
||||||
@@ -79,19 +84,12 @@ export const getMyInfoCheckoutInfo =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 회원 CheckOut 상품 주문 IF-LGSP-346
|
// 회원 CheckOut 상품 주문 IF-LGSP-346
|
||||||
export const insertMyInfoCheckoutOrder =
|
export const insertMyInfoCheckoutOrder = (props, callback) => (dispatch, getState) => {
|
||||||
(props, callback) => (dispatch, getState) => {
|
const { mbrNo, bilAddrSno, dlvrAddrSno, pinCd, orderProductCoupontUse, orderProductQtyInfo } =
|
||||||
const {
|
props;
|
||||||
mbrNo,
|
|
||||||
bilAddrSno,
|
|
||||||
dlvrAddrSno,
|
|
||||||
pinCd,
|
|
||||||
orderProductCoupontUse,
|
|
||||||
orderProductQtyInfo,
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("insertMyInfoCheckoutOrder onSuccess: ", response.data);
|
dlog('insertMyInfoCheckoutOrder onSuccess: ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -102,12 +100,7 @@ export const insertMyInfoCheckoutOrder =
|
|||||||
if (callback) callback(response);
|
if (callback) callback(response);
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, true, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
true,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +112,7 @@ export const insertMyInfoCheckoutOrder =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("insertMyInfoCheckoutOrder onFail: ", error);
|
derror('insertMyInfoCheckoutOrder onFail: ', error);
|
||||||
dispatch(
|
dispatch(
|
||||||
changeAppStatus({
|
changeAppStatus({
|
||||||
showLoadingPanel: { show: false, showMessage: false },
|
showLoadingPanel: { show: false, showMessage: false },
|
||||||
@@ -130,7 +123,7 @@ export const insertMyInfoCheckoutOrder =
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.INSERT_MY_INFO_CHECKOUT_ORDER,
|
URLS.INSERT_MY_INFO_CHECKOUT_ORDER,
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
@@ -146,25 +139,16 @@ export const insertMyInfoCheckoutOrder =
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getCheckoutTotalAmt =
|
export const getCheckoutTotalAmt = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
const { mbrNo, dirPurcSelYn, bilAddrSno, dlvrAddrSno, isPageLoading, orderProductCoupontUse } =
|
||||||
const {
|
params;
|
||||||
mbrNo,
|
|
||||||
dirPurcSelYn,
|
|
||||||
bilAddrSno,
|
|
||||||
dlvrAddrSno,
|
|
||||||
isPageLoading,
|
|
||||||
orderProductCoupontUse,
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
dispatch(changeAppStatus({ isLoading: false }));
|
dispatch(changeAppStatus({ isLoading: false }));
|
||||||
|
|
||||||
dispatch(
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } })
|
|
||||||
);
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getCheckoutTotalAmt onSuccess: ", response.data);
|
dlog('getCheckoutTotalAmt onSuccess: ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -175,12 +159,7 @@ export const getCheckoutTotalAmt =
|
|||||||
if (callback) callback(response.data);
|
if (callback) callback(response.data);
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, true, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
true,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +167,7 @@ export const getCheckoutTotalAmt =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getCheckoutTotalAmt onFail: ", error);
|
derror('getCheckoutTotalAmt onFail: ', error);
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
@@ -196,7 +175,7 @@ export const getCheckoutTotalAmt =
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.GET_CHECKOUT_TOTAL_AMT,
|
URLS.GET_CHECKOUT_TOTAL_AMT,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, dirPurcSelYn, bilAddrSno, dlvrAddrSno, isPageLoading, orderProductCoupontUse },
|
{ mbrNo, dirPurcSelYn, bilAddrSno, dlvrAddrSno, isPageLoading, orderProductCoupontUse },
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ import { initialLocalSettings } from '../reducers/localSettingsReducer';
|
|||||||
import * as Config from '../utils/Config';
|
import * as Config from '../utils/Config';
|
||||||
import * as HelperMethods from '../utils/helperMethods';
|
import * as HelperMethods from '../utils/helperMethods';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
// =======
|
// =======
|
||||||
// import appinfo from "../../webos-meta/appinfo.json";
|
// import appinfo from "../../webos-meta/appinfo.json";
|
||||||
// import appinfo35 from "../../webos-meta/appinfo35.json";
|
// import appinfo35 from "../../webos-meta/appinfo35.json";
|
||||||
@@ -92,9 +97,9 @@ export const toggleOptionalTermsConfirm = (selected) => ({
|
|||||||
export const setExitApp = () => (dispatch, getState) => {
|
export const setExitApp = () => (dispatch, getState) => {
|
||||||
dispatch({ type: types.SET_EXIT_APP });
|
dispatch({ type: types.SET_EXIT_APP });
|
||||||
|
|
||||||
console.log("Exiting App...");
|
dlog('Exiting App...');
|
||||||
|
|
||||||
if (typeof window === "object") {
|
if (typeof window === 'object') {
|
||||||
window.close();
|
window.close();
|
||||||
} else {
|
} else {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
@@ -107,12 +112,12 @@ export const getLoginUserData = (userData) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const loadingComplete = (status) => ({
|
export const loadingComplete = (status) => ({
|
||||||
type: "loadingComplete",
|
type: 'loadingComplete',
|
||||||
payload: status,
|
payload: status,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const alertToast = (payload) => (dispatch, getState) => {
|
export const alertToast = (payload) => (dispatch, getState) => {
|
||||||
if (typeof window === "object" && !window.PalmSystem) {
|
if (typeof window === 'object' && !window.PalmSystem) {
|
||||||
dispatch(changeAppStatus({ toast: true, toastText: payload }));
|
dispatch(changeAppStatus({ toast: true, toastText: payload }));
|
||||||
} else {
|
} else {
|
||||||
lunaSend.createToast(payload);
|
lunaSend.createToast(payload);
|
||||||
@@ -120,21 +125,20 @@ export const alertToast = (payload) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getSystemSettings = () => (dispatch, getState) => {
|
export const getSystemSettings = () => (dispatch, getState) => {
|
||||||
console.log("getSystemSettings ");
|
dlog('getSystemSettings ');
|
||||||
lunaSend.getSystemSettings(
|
lunaSend.getSystemSettings(
|
||||||
{ category: "caption", keys: ["captionEnable"] },
|
{ category: 'caption', keys: ['captionEnable'] },
|
||||||
{
|
{
|
||||||
onSuccess: (res) => {},
|
onSuccess: (res) => {},
|
||||||
onFailure: (err) => {},
|
onFailure: (err) => {},
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log("getSystemSettings onComplete", res);
|
dlog('getSystemSettings onComplete', res);
|
||||||
if (res && res.settings) {
|
if (res && res.settings) {
|
||||||
if (typeof res.settings.captionEnable !== "undefined") {
|
if (typeof res.settings.captionEnable !== 'undefined') {
|
||||||
dispatch(
|
dispatch(
|
||||||
changeAppStatus({
|
changeAppStatus({
|
||||||
captionEnable:
|
captionEnable:
|
||||||
res.settings.captionEnable === "on" ||
|
res.settings.captionEnable === 'on' || res.settings.captionEnable === true,
|
||||||
res.settings.captionEnable === true,
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -144,17 +148,13 @@ export const getSystemSettings = () => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getHttpHeaderForServiceRequest =
|
export const getHttpHeaderForServiceRequest = (onComplete) => (dispatch, getState) => {
|
||||||
(onComplete) => (dispatch, getState) => {
|
dlog('getHttpHeaderForServiceRequest ');
|
||||||
console.log("getHttpHeaderForServiceRequest ");
|
const { serverType, ricCodeSetting, languageSetting } = getState().localSettings;
|
||||||
const { serverType, ricCodeSetting, languageSetting } =
|
|
||||||
getState().localSettings;
|
|
||||||
lunaSend.getHttpHeaderForServiceRequest({
|
lunaSend.getHttpHeaderForServiceRequest({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const version = res["X-Device-Netcast-Platform-Version"] || "";
|
const version = res['X-Device-Netcast-Platform-Version'] || '';
|
||||||
const webOSVersion = Number(
|
const webOSVersion = Number(version.substring(0, version.lastIndexOf('.')));
|
||||||
version.substring(0, version.lastIndexOf("."))
|
|
||||||
);
|
|
||||||
|
|
||||||
// 4버전 미만인 경우 다른 처리 없이 버전 정보만 저장
|
// 4버전 미만인 경우 다른 처리 없이 버전 정보만 저장
|
||||||
if (webOSVersion < 4) {
|
if (webOSVersion < 4) {
|
||||||
@@ -168,110 +168,109 @@ export const getHttpHeaderForServiceRequest =
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4버전 이상인 경우 기존 로직 수행
|
// 4버전 이상인 경우 기존 로직 수행
|
||||||
console.log("getHttpHeaderForServiceRequest", res);
|
dlog('getHttpHeaderForServiceRequest', res);
|
||||||
const convertedRes = {
|
const convertedRes = {
|
||||||
Authorization: res["Authorization"],
|
Authorization: res['Authorization'],
|
||||||
"X-Authentication": res["X-Authentication"],
|
'X-Authentication': res['X-Authentication'],
|
||||||
"X-Device-ID": res["X-Device-ID"],
|
'X-Device-ID': res['X-Device-ID'],
|
||||||
"X-Device-Product": res["X-Device-Product"],
|
'X-Device-Product': res['X-Device-Product'],
|
||||||
"X-Device-Platform": res["X-Device-Platform"],
|
'X-Device-Platform': res['X-Device-Platform'],
|
||||||
"X-Device-Model": res["X-Device-Model"],
|
'X-Device-Model': res['X-Device-Model'],
|
||||||
"X-Device-Eco-Info": res["X-Device-Eco-Info"],
|
'X-Device-Eco-Info': res['X-Device-Eco-Info'],
|
||||||
"X-Device-Country": res["X-Device-Country"],
|
'X-Device-Country': res['X-Device-Country'],
|
||||||
"X-Device-Language": res["X-Device-Language"],
|
'X-Device-Language': res['X-Device-Language'],
|
||||||
"X-Device-Netcast-Platform-Version":
|
'X-Device-Netcast-Platform-Version': res['X-Device-Netcast-Platform-Version'],
|
||||||
res["X-Device-Netcast-Platform-Version"],
|
'X-Device-Publish-Flag': res['X-Device-Publish-Flag'],
|
||||||
"X-Device-Publish-Flag": res["X-Device-Publish-Flag"],
|
'X-Device-Fck': res['X-Device-Fck'],
|
||||||
"X-Device-Fck": res["X-Device-Fck"],
|
'X-Device-Eula': res['X-Device-Eula'],
|
||||||
"X-Device-Eula": res["X-Device-Eula"],
|
'X-Device-SDK-VERSION': res['X-Device-SDK-VERSION'],
|
||||||
"X-Device-SDK-VERSION": res["X-Device-SDK-VERSION"],
|
|
||||||
};
|
};
|
||||||
convertedRes["X-Device-Personalization"] = "Y";
|
convertedRes['X-Device-Personalization'] = 'Y';
|
||||||
|
|
||||||
if (
|
if (
|
||||||
typeof window === "object" &&
|
typeof window === 'object' &&
|
||||||
window.PalmSystem &&
|
window.PalmSystem &&
|
||||||
window.PalmSystem.identifier &&
|
window.PalmSystem.identifier &&
|
||||||
process.env.REACT_APP_MODE !== "DEBUG"
|
process.env.REACT_APP_MODE !== 'DEBUG'
|
||||||
) {
|
) {
|
||||||
convertedRes["app_id"] = window.PalmSystem.identifier ?? appinfo.id;
|
convertedRes['app_id'] = window.PalmSystem.identifier ?? appinfo.id;
|
||||||
} else {
|
} else {
|
||||||
if (ricCodeSetting === "aic") {
|
if (ricCodeSetting === 'aic') {
|
||||||
convertedRes["app_id"] = appinfo.id;
|
convertedRes['app_id'] = appinfo.id;
|
||||||
} else if (ricCodeSetting === "eic") {
|
} else if (ricCodeSetting === 'eic') {
|
||||||
convertedRes["app_id"] = appinfo35.id;
|
convertedRes['app_id'] = appinfo35.id;
|
||||||
} else if (ricCodeSetting === "ruc") {
|
} else if (ricCodeSetting === 'ruc') {
|
||||||
convertedRes["app_id"] = appinfo79.id;
|
convertedRes['app_id'] = appinfo79.id;
|
||||||
} else {
|
} else {
|
||||||
convertedRes["app_id"] = appinfo.id;
|
convertedRes['app_id'] = appinfo.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
convertedRes["app_ver"] = "1.0.0";
|
convertedRes['app_ver'] = '1.0.0';
|
||||||
convertedRes["cntry_cd"] = res["X-Device-Country"];
|
convertedRes['cntry_cd'] = res['X-Device-Country'];
|
||||||
convertedRes["prod_cd"] = res["X-Device-Product"];
|
convertedRes['prod_cd'] = res['X-Device-Product'];
|
||||||
convertedRes["plat_cd"] = res["X-Device-Platform"];
|
convertedRes['plat_cd'] = res['X-Device-Platform'];
|
||||||
convertedRes["lang_cd"] = res["X-Device-Language"];
|
convertedRes['lang_cd'] = res['X-Device-Language'];
|
||||||
convertedRes["sdk_ver"] = res["X-Device-SDK-VERSION"];
|
convertedRes['sdk_ver'] = res['X-Device-SDK-VERSION'];
|
||||||
convertedRes["publish_flag"] = res["X-Device-Publish-Flag"];
|
convertedRes['publish_flag'] = res['X-Device-Publish-Flag'];
|
||||||
convertedRes["os_ver"] = version;
|
convertedRes['os_ver'] = version;
|
||||||
convertedRes["dvc_auth"] = res["X-Authentication"];
|
convertedRes['dvc_auth'] = res['X-Authentication'];
|
||||||
|
|
||||||
if (serverType !== "system") {
|
if (serverType !== 'system') {
|
||||||
if (ricCodeSetting === "eic") {
|
if (ricCodeSetting === 'eic') {
|
||||||
if (languageSetting === "GB") {
|
if (languageSetting === 'GB') {
|
||||||
convertedRes["cntry_cd"] = "GB";
|
convertedRes['cntry_cd'] = 'GB';
|
||||||
convertedRes["X-Device-Country"] = "GB";
|
convertedRes['X-Device-Country'] = 'GB';
|
||||||
res["HOST"] = "GB.nextlgsdp.com";
|
res['HOST'] = 'GB.nextlgsdp.com';
|
||||||
}
|
}
|
||||||
if (languageSetting === "DE") {
|
if (languageSetting === 'DE') {
|
||||||
convertedRes["cntry_cd"] = "DE";
|
convertedRes['cntry_cd'] = 'DE';
|
||||||
convertedRes["X-Device-Country"] = "DE";
|
convertedRes['X-Device-Country'] = 'DE';
|
||||||
res["HOST"] = "DE.nextlgsdp.com";
|
res['HOST'] = 'DE.nextlgsdp.com';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ricCodeSetting === "aic") {
|
if (ricCodeSetting === 'aic') {
|
||||||
convertedRes["cntry_cd"] = "US";
|
convertedRes['cntry_cd'] = 'US';
|
||||||
convertedRes["X-Device-Country"] = "US";
|
convertedRes['X-Device-Country'] = 'US';
|
||||||
res["HOST"] = "US.nextlgsdp.com";
|
res['HOST'] = 'US.nextlgsdp.com';
|
||||||
}
|
}
|
||||||
if (ricCodeSetting === "ruc") {
|
if (ricCodeSetting === 'ruc') {
|
||||||
convertedRes["cntry_cd"] = "RU";
|
convertedRes['cntry_cd'] = 'RU';
|
||||||
convertedRes["X-Device-Country"] = "RU";
|
convertedRes['X-Device-Country'] = 'RU';
|
||||||
res["HOST"] = "RU.nextlgsdp.com";
|
res['HOST'] = 'RU.nextlgsdp.com';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertedRes["cntry_cd"] === "US") {
|
if (convertedRes['cntry_cd'] === 'US') {
|
||||||
convertedRes["lang_cd"] = "en-US";
|
convertedRes['lang_cd'] = 'en-US';
|
||||||
}
|
}
|
||||||
if (convertedRes["cntry_cd"] === "DE") {
|
if (convertedRes['cntry_cd'] === 'DE') {
|
||||||
convertedRes["lang_cd"] = "de-DE";
|
convertedRes['lang_cd'] = 'de-DE';
|
||||||
}
|
}
|
||||||
if (convertedRes["cntry_cd"] === "GB") {
|
if (convertedRes['cntry_cd'] === 'GB') {
|
||||||
convertedRes["lang_cd"] = "en-GB";
|
convertedRes['lang_cd'] = 'en-GB';
|
||||||
}
|
}
|
||||||
if (convertedRes["cntry_cd"] === "RU") {
|
if (convertedRes['cntry_cd'] === 'RU') {
|
||||||
convertedRes["lang_cd"] = "ru-RU";
|
convertedRes['lang_cd'] = 'ru-RU';
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({ type: types.GET_HTTP_HEADER, payload: convertedRes });
|
dispatch({ type: types.GET_HTTP_HEADER, payload: convertedRes });
|
||||||
dispatch(
|
dispatch(
|
||||||
changeAppStatus({
|
changeAppStatus({
|
||||||
webOSVersion,
|
webOSVersion,
|
||||||
serverHOST: res["HOST"],
|
serverHOST: res['HOST'],
|
||||||
mbr_no: res["X-User-Number"],
|
mbr_no: res['X-User-Number'],
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const parameters = { serviceName: "LGE" };
|
const parameters = { serviceName: 'LGE' };
|
||||||
const mbrNo = res["X-User-Number"];
|
const mbrNo = res['X-User-Number'];
|
||||||
|
|
||||||
lunaSend.getLoginUserData(parameters, {
|
lunaSend.getLoginUserData(parameters, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
const userId = res.id ?? "";
|
const userId = res.id ?? '';
|
||||||
const userNumber = res.lastSignInUserNo;
|
const userNumber = res.lastSignInUserNo;
|
||||||
const profileNick = res.profileNick || userId.split("@")[0];
|
const profileNick = res.profileNick || userId.split('@')[0];
|
||||||
dispatch(
|
dispatch(
|
||||||
getLoginUserData({
|
getLoginUserData({
|
||||||
userId,
|
userId,
|
||||||
@@ -280,31 +279,31 @@ export const getHttpHeaderForServiceRequest =
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onFailure: (err) => console.error("LoginData fetch failed ", err),
|
onFailure: (err) => derror('LoginData fetch failed ', err),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("getHttpHeaderForServiceRequest fail", err);
|
dlog('getHttpHeaderForServiceRequest fail', err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDeviceId = (onComplete) => (dispatch, getState) => {
|
export const getDeviceId = (onComplete) => (dispatch, getState) => {
|
||||||
lunaSend.getDeviceId(
|
lunaSend.getDeviceId(
|
||||||
{ idType: ["LGUDID"] },
|
{ idType: ['LGUDID'] },
|
||||||
{
|
{
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("getDeviceId ", res);
|
dlog('getDeviceId ', res);
|
||||||
if (res.returnValue) {
|
if (res.returnValue) {
|
||||||
const deviceId = res.idList[0].idValue;
|
const deviceId = res.idList[0].idValue;
|
||||||
dispatch(changeAppStatus({ deviceId: deviceId }));
|
dispatch(changeAppStatus({ deviceId: deviceId }));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log(err);
|
dlog(err);
|
||||||
},
|
},
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
console.log("getDeviceId done");
|
dlog('getDeviceId done');
|
||||||
if (onComplete) onComplete();
|
if (onComplete) onComplete();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -317,8 +316,8 @@ export const getTermsAgreeYn = () => (dispatch, getState) => {
|
|||||||
try {
|
try {
|
||||||
const { terms } = getState().home.termsData.data;
|
const { terms } = getState().home.termsData.data;
|
||||||
|
|
||||||
console.log(
|
dlog(
|
||||||
"getTermsAgreeYn",
|
'getTermsAgreeYn',
|
||||||
terms.map((term) => ({
|
terms.map((term) => ({
|
||||||
trmsId: term.trmsId,
|
trmsId: term.trmsId,
|
||||||
trmsTpCd: term.trmsTpCd,
|
trmsTpCd: term.trmsTpCd,
|
||||||
@@ -328,33 +327,33 @@ export const getTermsAgreeYn = () => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// MST00405 선택약관 정보만 따로 출력
|
// MST00405 선택약관 정보만 따로 출력
|
||||||
const optionalTerm = terms.find((term) => term.trmsTpCd === "MST00405");
|
const optionalTerm = terms.find((term) => term.trmsTpCd === 'MST00405');
|
||||||
if (optionalTerm) {
|
if (optionalTerm) {
|
||||||
console.log("getTermsAgreeYn MST00405 선택약관:", {
|
dlog('getTermsAgreeYn MST00405 선택약관:', {
|
||||||
trmsId: optionalTerm.trmsId,
|
trmsId: optionalTerm.trmsId,
|
||||||
trmsTpCd: optionalTerm.trmsTpCd,
|
trmsTpCd: optionalTerm.trmsTpCd,
|
||||||
trmsAgrFlag: optionalTerm.trmsAgrFlag,
|
trmsAgrFlag: optionalTerm.trmsAgrFlag,
|
||||||
trmsPopFlag: optionalTerm.trmsPopFlag,
|
trmsPopFlag: optionalTerm.trmsPopFlag,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("getTermsAgreeYn MST00405 선택약관을 찾을 수 없습니다.");
|
dlog('getTermsAgreeYn MST00405 선택약관을 찾을 수 없습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const termsAgreeFlag = terms.reduce((acc, term) => {
|
const termsAgreeFlag = terms.reduce((acc, term) => {
|
||||||
switch (term.trmsTpCd) {
|
switch (term.trmsTpCd) {
|
||||||
case "MST00401":
|
case 'MST00401':
|
||||||
acc.privacyTerms = term.trmsAgrFlag;
|
acc.privacyTerms = term.trmsAgrFlag;
|
||||||
break;
|
break;
|
||||||
case "MST00402":
|
case 'MST00402':
|
||||||
acc.serviceTerms = term.trmsAgrFlag;
|
acc.serviceTerms = term.trmsAgrFlag;
|
||||||
break;
|
break;
|
||||||
case "MST00403":
|
case 'MST00403':
|
||||||
acc.purchaseTerms = term.trmsAgrFlag;
|
acc.purchaseTerms = term.trmsAgrFlag;
|
||||||
break;
|
break;
|
||||||
case "MST00404":
|
case 'MST00404':
|
||||||
acc.paymentTerms = term.trmsAgrFlag;
|
acc.paymentTerms = term.trmsAgrFlag;
|
||||||
break;
|
break;
|
||||||
case "MST00405":
|
case 'MST00405':
|
||||||
acc.optionalTerms = term.trmsAgrFlag;
|
acc.optionalTerms = term.trmsAgrFlag;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -368,7 +367,7 @@ export const getTermsAgreeYn = () => (dispatch, getState) => {
|
|||||||
payload: termsAgreeFlag,
|
payload: termsAgreeFlag,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("getTermsAgreeYn error:", error);
|
derror('getTermsAgreeYn error:', error);
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -376,8 +375,8 @@ export const getTermsAgreeYn = () => (dispatch, getState) => {
|
|||||||
// export const getTermsAgreeYn = () => (dispatch, getState) => {
|
// export const getTermsAgreeYn = () => (dispatch, getState) => {
|
||||||
// const { terms } = getState().home.termsData.data;
|
// const { terms } = getState().home.termsData.data;
|
||||||
|
|
||||||
// // console.log("getTermsAgreeYn", terms);
|
// // dlog("getTermsAgreeYn", terms);
|
||||||
// console.log("getTermsAgreeYn", terms.map(term => ({
|
// dlog("getTermsAgreeYn", terms.map(term => ({
|
||||||
// trmsId: term.trmsId,
|
// trmsId: term.trmsId,
|
||||||
// trmsTpCd: term.trmsTpCd,
|
// trmsTpCd: term.trmsTpCd,
|
||||||
// trmsAgrFlag: term.trmsAgrFlag,
|
// trmsAgrFlag: term.trmsAgrFlag,
|
||||||
@@ -429,7 +428,7 @@ export const launchMembershipApp = () => (dispatch, getState) => {
|
|||||||
panelInfo: currentPanel.panelInfo || {},
|
panelInfo: currentPanel.panelInfo || {},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof window === "object" && !window.PalmSystem) {
|
if (typeof window === 'object' && !window.PalmSystem) {
|
||||||
// const testBypass = {
|
// const testBypass = {
|
||||||
// name: Config.panel_names.CATEGORY_PANEL,
|
// name: Config.panel_names.CATEGORY_PANEL,
|
||||||
// panelInfo: {
|
// panelInfo: {
|
||||||
@@ -444,7 +443,7 @@ export const launchMembershipApp = () => (dispatch, getState) => {
|
|||||||
// },
|
// },
|
||||||
// };
|
// };
|
||||||
|
|
||||||
console.log("returnPath", returnPath);
|
dlog('returnPath', returnPath);
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// dispatch(handleBypassLink(JSON.stringify(testBypass)));
|
// dispatch(handleBypassLink(JSON.stringify(testBypass)));
|
||||||
// }, 1000);
|
// }, 1000);
|
||||||
@@ -453,10 +452,10 @@ export const launchMembershipApp = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
lunaSend.launchMembershipApp(returnPath, {
|
lunaSend.launchMembershipApp(returnPath, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("membership launch success: ", res);
|
dlog('membership launch success: ', res);
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("membership launch failed:", err);
|
dlog('membership launch failed:', err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -470,7 +469,7 @@ export const setFocus = (spotlightId) => ({
|
|||||||
export const focusElement = (spotlightId) => (dispatch, getState) => {
|
export const focusElement = (spotlightId) => (dispatch, getState) => {
|
||||||
dispatch(setFocus(spotlightId));
|
dispatch(setFocus(spotlightId));
|
||||||
|
|
||||||
if (typeof window === "object") {
|
if (typeof window === 'object') {
|
||||||
rafId = window.requestAnimationFrame(() => {
|
rafId = window.requestAnimationFrame(() => {
|
||||||
Spotlight.focus(spotlightId);
|
Spotlight.focus(spotlightId);
|
||||||
});
|
});
|
||||||
@@ -479,7 +478,7 @@ export const focusElement = (spotlightId) => (dispatch, getState) => {
|
|||||||
|
|
||||||
export const cancelFocusElement = () => () => {
|
export const cancelFocusElement = () => () => {
|
||||||
if (rafId !== null) {
|
if (rafId !== null) {
|
||||||
if (typeof window === "object") {
|
if (typeof window === 'object') {
|
||||||
window.cancelAnimationFrame(rafId);
|
window.cancelAnimationFrame(rafId);
|
||||||
rafId = null;
|
rafId = null;
|
||||||
}
|
}
|
||||||
@@ -506,20 +505,20 @@ export const requestLiveSubtitle =
|
|||||||
if (Number(webOSVersion) <= 4.5) {
|
if (Number(webOSVersion) <= 4.5) {
|
||||||
lunaSend.setSubtitleEnable(mediaId, enable, {
|
lunaSend.setSubtitleEnable(mediaId, enable, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log(res);
|
dlog(res);
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log(err);
|
dlog(err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
lunaSend.setSubtitleEnableOver5(mediaId, enable, {
|
lunaSend.setSubtitleEnableOver5(mediaId, enable, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log(res);
|
dlog(res);
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log(err);
|
dlog(err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -528,20 +527,20 @@ export const requestLiveSubtitle =
|
|||||||
export const addReservation = (data) => (dispatch) => {
|
export const addReservation = (data) => (dispatch) => {
|
||||||
lunaSend.addReservation(data, {
|
lunaSend.addReservation(data, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("addReservation success:", res);
|
dlog('addReservation success:', res);
|
||||||
// Optionally show success toast
|
// Optionally show success toast
|
||||||
if (res && res.returnValue) {
|
if (res && res.returnValue) {
|
||||||
dispatch(alertToast("Reminder set successfully"));
|
dispatch(alertToast('Reminder set successfully'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error("addReservation failed:", err);
|
derror('addReservation failed:', err);
|
||||||
// Use the helper function for better error handling
|
// Use the helper function for better error handling
|
||||||
const errorMessage = HelperMethods.getReservationErrorMessage(err);
|
const errorMessage = HelperMethods.getReservationErrorMessage(err);
|
||||||
dispatch(alertToast(errorMessage));
|
dispatch(alertToast(errorMessage));
|
||||||
},
|
},
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
console.log("addReservation completed");
|
dlog('addReservation completed');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -579,7 +578,7 @@ export const deleteReservation = (showId) => (dispatch) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log(err);
|
dlog(err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -618,13 +617,7 @@ export const clearErrorMessage = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const showError =
|
export const showError =
|
||||||
(
|
(errorCode, errorMsg, shouldPopPanel = false, retDetailCode = null, returnBindStrings = null) =>
|
||||||
errorCode,
|
|
||||||
errorMsg,
|
|
||||||
shouldPopPanel = false,
|
|
||||||
retDetailCode = null,
|
|
||||||
returnBindStrings = null
|
|
||||||
) =>
|
|
||||||
(dispatch) => {
|
(dispatch) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
setShowPopup(Config.ACTIVE_POPUP.errorPopup, {
|
setShowPopup(Config.ACTIVE_POPUP.errorPopup, {
|
||||||
@@ -654,34 +647,34 @@ export const checkFirstLaunch = () => (dispatch) => {
|
|||||||
lunaSend.checkFirstLaunch({
|
lunaSend.checkFirstLaunch({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
if (!res.returnValue) {
|
if (!res.returnValue) {
|
||||||
console.error("Failed to check first launch status");
|
derror('Failed to check first launch status');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.results.length === 0) {
|
if (res.results.length === 0) {
|
||||||
console.log("First launch detected - initializing localStorage");
|
dlog('First launch detected - initializing localStorage');
|
||||||
|
|
||||||
if (typeof window === "object") {
|
if (typeof window === 'object') {
|
||||||
dispatch(changeLocalSettings({ phoneNumbers: {}, recentItems: [] }));
|
dispatch(changeLocalSettings({ phoneNumbers: {}, recentItems: [] }));
|
||||||
}
|
}
|
||||||
|
|
||||||
lunaSend.saveFirstLaunchInfo({
|
lunaSend.saveFirstLaunchInfo({
|
||||||
onSuccess: (saveRes) => {
|
onSuccess: (saveRes) => {
|
||||||
console.log("First launch info saved to DB8:", saveRes);
|
dlog('First launch info saved to DB8:', saveRes);
|
||||||
dispatch(changeAppStatus({ isFirstLaunch: true }));
|
dispatch(changeAppStatus({ isFirstLaunch: true }));
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error("Failed to save first launch info:", err);
|
derror('Failed to save first launch info:', err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("Not first launch - keeping existing settings");
|
dlog('Not first launch - keeping existing settings');
|
||||||
|
|
||||||
dispatch(changeAppStatus({ isFirstLaunch: false }));
|
dispatch(changeAppStatus({ isFirstLaunch: false }));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error("Failed to check first launch:", err);
|
derror('Failed to check first launch:', err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -693,36 +686,27 @@ let updateNetworkStateJob = new Job((dispatch, connected) => {
|
|||||||
export const getConnectionStatus = () => (dispatch, getState) => {
|
export const getConnectionStatus = () => (dispatch, getState) => {
|
||||||
lunaSend.getConnectionStatus({
|
lunaSend.getConnectionStatus({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("lunasend getConnectionStatus", res);
|
dlog('lunasend getConnectionStatus', res);
|
||||||
if (res.returnValue) {
|
if (res.returnValue) {
|
||||||
const isInternet =
|
const isInternet =
|
||||||
(res.wifi && res.wifi.onInternet === "yes") ||
|
(res.wifi && res.wifi.onInternet === 'yes') ||
|
||||||
(res.wired && res.wired.onInternet === "yes");
|
(res.wired && res.wired.onInternet === 'yes');
|
||||||
const isInternetConnected =
|
const isInternetConnected =
|
||||||
(res.wifi && res.wifi.state === "connected") ||
|
(res.wifi && res.wifi.state === 'connected') ||
|
||||||
(res.wired && res.wired.state === "connected");
|
(res.wired && res.wired.state === 'connected');
|
||||||
|
|
||||||
console.log(
|
dlog('internetconnected.............', isInternet, isInternetConnected, res);
|
||||||
"internetconnected.............",
|
|
||||||
isInternet,
|
|
||||||
isInternetConnected,
|
|
||||||
res
|
|
||||||
);
|
|
||||||
|
|
||||||
const connected = isInternet && isInternetConnected;
|
const connected = isInternet && isInternetConnected;
|
||||||
|
|
||||||
updateNetworkStateJob.startAfter(
|
updateNetworkStateJob.startAfter(connected ? 100 : 3000, dispatch, connected);
|
||||||
connected ? 100 : 3000,
|
|
||||||
dispatch,
|
|
||||||
connected
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log(err);
|
dlog(err);
|
||||||
},
|
},
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log("getConnectionStatus done", res);
|
dlog('getConnectionStatus done', res);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -731,17 +715,17 @@ export const getConnectionStatus = () => (dispatch, getState) => {
|
|||||||
export const getConnectionInfo = () => (dispatch, getState) => {
|
export const getConnectionInfo = () => (dispatch, getState) => {
|
||||||
lunaSend.getConnectionInfo({
|
lunaSend.getConnectionInfo({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("lunasend getConnectionStatus", res);
|
dlog('lunasend getConnectionStatus', res);
|
||||||
if (res && res.returnValue) {
|
if (res && res.returnValue) {
|
||||||
const macAddress = res?.wiredInfo?.macAddress;
|
const macAddress = res?.wiredInfo?.macAddress;
|
||||||
console.log("macAddress...........", macAddress, res);
|
dlog('macAddress...........', macAddress, res);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("getConnentionInfo", err);
|
dlog('getConnentionInfo', err);
|
||||||
},
|
},
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log("getConnentionInfo done", res);
|
dlog('getConnentionInfo done', res);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_DEVICE_MACADDRESS,
|
type: types.GET_DEVICE_MACADDRESS,
|
||||||
payload: res,
|
payload: res,
|
||||||
@@ -753,13 +737,13 @@ export const getConnectionInfo = () => (dispatch, getState) => {
|
|||||||
export const disableNotification = () => (dispatch, getState) => {
|
export const disableNotification = () => (dispatch, getState) => {
|
||||||
lunaSend.disableNotification({
|
lunaSend.disableNotification({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("lunasend disable notification success", res);
|
dlog('lunasend disable notification success', res);
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("lunasend disable notification failure", err);
|
dlog('lunasend disable notification failure', err);
|
||||||
},
|
},
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log("lunasend disable notification complete", res);
|
dlog('lunasend disable notification complete', res);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -767,13 +751,13 @@ export const disableNotification = () => (dispatch, getState) => {
|
|||||||
export const enableNotification = () => (dispatch, getState) => {
|
export const enableNotification = () => (dispatch, getState) => {
|
||||||
lunaSend.enableNotification({
|
lunaSend.enableNotification({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log("lunasend enable notification success", res);
|
dlog('lunasend enable notification success', res);
|
||||||
},
|
},
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.log("lunasend enable notification failure", err);
|
dlog('lunasend enable notification failure', err);
|
||||||
},
|
},
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log("lunasend enable notification complete", res);
|
dlog('lunasend enable notification complete', res);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -795,15 +779,15 @@ export const resetOptionalTermsSession = () => ({
|
|||||||
|
|
||||||
// 선택약관 동의 처리를 위한 헬퍼 함수
|
// 선택약관 동의 처리를 위한 헬퍼 함수
|
||||||
export const handleOptionalTermsAgree = () => (dispatch) => {
|
export const handleOptionalTermsAgree = () => (dispatch) => {
|
||||||
console.log("[CommonActions] 선택약관 동의 처리");
|
dlog('[CommonActions] 선택약관 동의 처리');
|
||||||
dispatch(setOptionalTermsUserDecision("agreed"));
|
dispatch(setOptionalTermsUserDecision('agreed'));
|
||||||
dispatch(setOptionalTermsPopupShown(true));
|
dispatch(setOptionalTermsPopupShown(true));
|
||||||
};
|
};
|
||||||
|
|
||||||
// 선택약관 거절 처리를 위한 헬퍼 함수
|
// 선택약관 거절 처리를 위한 헬퍼 함수
|
||||||
export const handleOptionalTermsDecline = () => (dispatch) => {
|
export const handleOptionalTermsDecline = () => (dispatch) => {
|
||||||
console.log("[CommonActions] 선택약관 거절 처리");
|
dlog('[CommonActions] 선택약관 거절 처리');
|
||||||
dispatch(setOptionalTermsUserDecision("declined"));
|
dispatch(setOptionalTermsUserDecision('declined'));
|
||||||
dispatch(setOptionalTermsPopupShown(true));
|
dispatch(setOptionalTermsPopupShown(true));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -811,10 +795,10 @@ export const handleOptionalTermsDecline = () => (dispatch) => {
|
|||||||
export const updateOptionalTermsAgreement =
|
export const updateOptionalTermsAgreement =
|
||||||
(agreed = true) =>
|
(agreed = true) =>
|
||||||
(dispatch) => {
|
(dispatch) => {
|
||||||
console.log(`[CommonActions] 선택약관 통합 상태 업데이트: ${agreed}`);
|
dlog(`[CommonActions] 선택약관 통합 상태 업데이트: ${agreed}`);
|
||||||
|
|
||||||
// 1. optionalTermsPopupFlow 업데이트 (TV 환경용)
|
// 1. optionalTermsPopupFlow 업데이트 (TV 환경용)
|
||||||
dispatch(setOptionalTermsUserDecision(agreed ? "agreed" : "declined"));
|
dispatch(setOptionalTermsUserDecision(agreed ? 'agreed' : 'declined'));
|
||||||
dispatch(setOptionalTermsPopupShown(true));
|
dispatch(setOptionalTermsPopupShown(true));
|
||||||
|
|
||||||
// 2. 기본 optionalTermsAgree 상태 직접 업데이트 (API 호출 없이)
|
// 2. 기본 optionalTermsAgree 상태 직접 업데이트 (API 호출 없이)
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import { URLS } from '../api/apiConfig';
|
|||||||
import { TAxios } from '../api/TAxios';
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { getReAuthenticationCode } from './deviceActions';
|
import { getReAuthenticationCode } from './deviceActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDF를 이미지로 변환 (재시도 로직 포함)
|
* PDF를 이미지로 변환 (재시도 로직 포함)
|
||||||
@@ -18,7 +23,7 @@ export const convertPdfToImage =
|
|||||||
|
|
||||||
const attemptConversion = () => {
|
const attemptConversion = () => {
|
||||||
attempts++;
|
attempts++;
|
||||||
// console.log(`🔄 [EnergyLabel] Converting PDF attempt ${attempts}/${maxRetries + 1}:`, pdfUrl);
|
// dlog(`🔄 [EnergyLabel] Converting PDF attempt ${attempts}/${maxRetries + 1}:`, pdfUrl);
|
||||||
|
|
||||||
// 타임아웃 설정
|
// 타임아웃 설정
|
||||||
timeoutId = setTimeout(() => {
|
timeoutId = setTimeout(() => {
|
||||||
@@ -26,15 +31,15 @@ export const convertPdfToImage =
|
|||||||
const timeoutError = new Error(
|
const timeoutError = new Error(
|
||||||
`Conversion timeout after ${timeout}ms (attempt ${attempts})`
|
`Conversion timeout after ${timeout}ms (attempt ${attempts})`
|
||||||
);
|
);
|
||||||
console.warn(`⏱️ [EnergyLabel] Timeout on attempt ${attempts}:`, timeoutError.message);
|
dwarn(`⏱️ [EnergyLabel] Timeout on attempt ${attempts}:`, timeoutError.message);
|
||||||
|
|
||||||
// 재시도 가능한 경우
|
// 재시도 가능한 경우
|
||||||
if (attempts < maxRetries + 1) {
|
if (attempts < maxRetries + 1) {
|
||||||
// console.log(`🔄 [EnergyLabel] Retrying... (${attempts}/${maxRetries + 1})`);
|
// dlog(`🔄 [EnergyLabel] Retrying... (${attempts}/${maxRetries + 1})`);
|
||||||
attemptConversion();
|
attemptConversion();
|
||||||
} else {
|
} else {
|
||||||
// 최종 실패
|
// 최종 실패
|
||||||
console.error(`❌ [EnergyLabel] Final failure after ${attempts} attempts:`, pdfUrl);
|
derror(`❌ [EnergyLabel] Final failure after ${attempts} attempts:`, pdfUrl);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.CONVERT_PDF_TO_IMAGE_FAILURE,
|
type: types.CONVERT_PDF_TO_IMAGE_FAILURE,
|
||||||
payload: { pdfUrl, error: timeoutError },
|
payload: { pdfUrl, error: timeoutError },
|
||||||
@@ -59,16 +64,14 @@ export const convertPdfToImage =
|
|||||||
|
|
||||||
if (retCode !== undefined && retCode !== 0 && retCode !== '0') {
|
if (retCode !== undefined && retCode !== 0 && retCode !== '0') {
|
||||||
const error = new Error(`API Error: retCode=${retCode}`);
|
const error = new Error(`API Error: retCode=${retCode}`);
|
||||||
console.warn(`⚠️ [EnergyLabel] API returned error on attempt ${attempts}:`, retCode);
|
dwarn(`⚠️ [EnergyLabel] API returned error on attempt ${attempts}:`, retCode);
|
||||||
|
|
||||||
// retCode 에러도 재시도
|
// retCode 에러도 재시도
|
||||||
if (attempts < maxRetries + 1) {
|
if (attempts < maxRetries + 1) {
|
||||||
console.log(
|
dlog(`🔄 [EnergyLabel] Retrying due to API error... (${attempts}/${maxRetries + 1})`);
|
||||||
`🔄 [EnergyLabel] Retrying due to API error... (${attempts}/${maxRetries + 1})`
|
|
||||||
);
|
|
||||||
attemptConversion();
|
attemptConversion();
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
derror(
|
||||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (API error):`,
|
`❌ [EnergyLabel] Final failure after ${attempts} attempts (API error):`,
|
||||||
pdfUrl
|
pdfUrl
|
||||||
);
|
);
|
||||||
@@ -81,7 +84,7 @@ export const convertPdfToImage =
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(response.data.type !== "image/png"){
|
if (response.data.type !== 'image/png') {
|
||||||
dispatch(getReAuthenticationCode());
|
dispatch(getReAuthenticationCode());
|
||||||
attemptConversion();
|
attemptConversion();
|
||||||
return;
|
return;
|
||||||
@@ -108,7 +111,7 @@ export const convertPdfToImage =
|
|||||||
imageUrl = URL.createObjectURL(blob);
|
imageUrl = URL.createObjectURL(blob);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`✅ [EnergyLabel] Conversion successful on attempt ${attempts}:`, pdfUrl);
|
dlog(`✅ [EnergyLabel] Conversion successful on attempt ${attempts}:`, pdfUrl);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.CONVERT_PDF_TO_IMAGE_SUCCESS,
|
type: types.CONVERT_PDF_TO_IMAGE_SUCCESS,
|
||||||
payload: { pdfUrl, imageUrl },
|
payload: { pdfUrl, imageUrl },
|
||||||
@@ -116,16 +119,16 @@ export const convertPdfToImage =
|
|||||||
|
|
||||||
callback && callback(null, imageUrl);
|
callback && callback(null, imageUrl);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`❌ [EnergyLabel] Image creation failed on attempt ${attempts}:`, error);
|
derror(`❌ [EnergyLabel] Image creation failed on attempt ${attempts}:`, error);
|
||||||
|
|
||||||
// 이미지 생성 실패도 재시도
|
// 이미지 생성 실패도 재시도
|
||||||
if (attempts < maxRetries + 1) {
|
if (attempts < maxRetries + 1) {
|
||||||
console.log(
|
dlog(
|
||||||
`🔄 [EnergyLabel] Retrying due to image creation error... (${attempts}/${maxRetries + 1})`
|
`🔄 [EnergyLabel] Retrying due to image creation error... (${attempts}/${maxRetries + 1})`
|
||||||
);
|
);
|
||||||
attemptConversion();
|
attemptConversion();
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
derror(
|
||||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (image error):`,
|
`❌ [EnergyLabel] Final failure after ${attempts} attempts (image error):`,
|
||||||
pdfUrl
|
pdfUrl
|
||||||
);
|
);
|
||||||
@@ -144,16 +147,14 @@ export const convertPdfToImage =
|
|||||||
timeoutId = null;
|
timeoutId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn(`⚠️ [EnergyLabel] Network error on attempt ${attempts}:`, error.message);
|
dwarn(`⚠️ [EnergyLabel] Network error on attempt ${attempts}:`, error.message);
|
||||||
|
|
||||||
// 네트워크 에러도 재시도
|
// 네트워크 에러도 재시도
|
||||||
if (attempts < maxRetries + 1) {
|
if (attempts < maxRetries + 1) {
|
||||||
console.log(
|
dlog(`🔄 [EnergyLabel] Retrying due to network error... (${attempts}/${maxRetries + 1})`);
|
||||||
`🔄 [EnergyLabel] Retrying due to network error... (${attempts}/${maxRetries + 1})`
|
|
||||||
);
|
|
||||||
attemptConversion();
|
attemptConversion();
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
derror(
|
||||||
`❌ [EnergyLabel] Final failure after ${attempts} attempts (network error):`,
|
`❌ [EnergyLabel] Final failure after ${attempts} attempts (network error):`,
|
||||||
pdfUrl
|
pdfUrl
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,13 +2,18 @@ import { URLS } from '../api/apiConfig';
|
|||||||
import { TAxios } from '../api/TAxios';
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { showError } from './commonActions';
|
import { showError } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// IF-LGSP-339 : 회원 다운로드 쿠폰 정보 조회
|
// IF-LGSP-339 : 회원 다운로드 쿠폰 정보 조회
|
||||||
export const getProductCouponInfo = (props) => (dispatch, getState) => {
|
export const getProductCouponInfo = (props) => (dispatch, getState) => {
|
||||||
const { mbrNo, patnrId, prdtId } = props;
|
const { mbrNo, patnrId, prdtId } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getProductCouponInfo onSuccess ", response.data);
|
dlog('getProductCouponInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_PRODUCT_COUPON_INFO,
|
type: types.GET_PRODUCT_COUPON_INFO,
|
||||||
@@ -17,13 +22,13 @@ export const getProductCouponInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getProductCouponInfo onFail", error);
|
derror('getProductCouponInfo onFail', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_PRODUCT_COUPON_INFO,
|
URLS.GET_PRODUCT_COUPON_INFO,
|
||||||
{ mbrNo, patnrId, prdtId },
|
{ mbrNo, patnrId, prdtId },
|
||||||
{},
|
{},
|
||||||
@@ -37,7 +42,7 @@ export const getProductCouponTotDownload = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, cpnSnoAll } = props;
|
const { mbrNo, cpnSnoAll } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getProductCouponTotDownload onSuccess ", response.data);
|
dlog('getProductCouponTotDownload onSuccess ', response.data);
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_PRODUCT_COUPON_TOTDOWNLOAD,
|
type: types.GET_PRODUCT_COUPON_TOTDOWNLOAD,
|
||||||
@@ -45,24 +50,19 @@ export const getProductCouponTotDownload = (props) => (dispatch, getState) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, false, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getProductCouponTotDownload onFail", error);
|
derror('getProductCouponTotDownload onFail', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.GET_PRODUCT_COUPON_TOTDOWNLOAD,
|
URLS.GET_PRODUCT_COUPON_TOTDOWNLOAD,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, cpnSnoAll },
|
{ mbrNo, cpnSnoAll },
|
||||||
@@ -75,7 +75,7 @@ export const getProductCouponDownload = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, cpnSno } = props;
|
const { mbrNo, cpnSno } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getProductCouponDownload onSuccess ", response.data);
|
dlog('getProductCouponDownload onSuccess ', response.data);
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_PRODUCT_COUPON_DOWNLOAD,
|
type: types.GET_PRODUCT_COUPON_DOWNLOAD,
|
||||||
@@ -84,24 +84,19 @@ export const getProductCouponDownload = (props) => (dispatch, getState) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dispatch(
|
dispatch(
|
||||||
showError(
|
showError(response.data.retCode, response.data.retMsg, false, response.data.retDetailCode)
|
||||||
response.data.retCode,
|
|
||||||
response.data.retMsg,
|
|
||||||
false,
|
|
||||||
response.data.retDetailCode
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getProductCouponDownload onFail", error);
|
derror('getProductCouponDownload onFail', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.GET_PRODUCT_COUPON_DOWNLOAD,
|
URLS.GET_PRODUCT_COUPON_DOWNLOAD,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, cpnSno },
|
{ mbrNo, cpnSno },
|
||||||
@@ -114,7 +109,7 @@ export const getProductCouponSearch = (props) => (dispatch, getState) => {
|
|||||||
const { mbrNo, patnrId, prdtId, catCd } = props;
|
const { mbrNo, patnrId, prdtId, catCd } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getProductCouponSearch onSuccess ", response.data);
|
dlog('getProductCouponSearch onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_PRODUCT_COUPON_SEARCH,
|
type: types.GET_PRODUCT_COUPON_SEARCH,
|
||||||
@@ -123,13 +118,13 @@ export const getProductCouponSearch = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getProductCouponSearch onFail", error);
|
derror('getProductCouponSearch onFail', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_PRODUCT_COUPON_SEARCH,
|
URLS.GET_PRODUCT_COUPON_SEARCH,
|
||||||
{ mbrNo, patnrId, prdtId, catCd },
|
{ mbrNo, patnrId, prdtId, catCd },
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import * as lunaSend from '../lunaSend';
|
|||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { changeLocalSettings } from './commonActions';
|
import { changeLocalSettings } from './commonActions';
|
||||||
import { fetchCurrentUserHomeTerms } from './homeActions';
|
import { fetchCurrentUserHomeTerms } from './homeActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const MAX_RETRY_COUNT = 3;
|
const MAX_RETRY_COUNT = 3;
|
||||||
const RETRY_DELAY = 2000; // 2 seconds
|
const RETRY_DELAY = 2000; // 2 seconds
|
||||||
@@ -12,7 +17,7 @@ const RETRY_DELAY = 2000; // 2 seconds
|
|||||||
export const getAuthenticationCode = () => (dispatch, getState) => {
|
export const getAuthenticationCode = () => (dispatch, getState) => {
|
||||||
setTokenRefreshing(true);
|
setTokenRefreshing(true);
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getAuthenticationCode onSuccess: ', response.data);
|
dlog('getAuthenticationCode onSuccess: ', response.data);
|
||||||
const accessToken = response.data.data.accessToken;
|
const accessToken = response.data.data.accessToken;
|
||||||
const refreshToken = response.data.data.refreshToken ?? null;
|
const refreshToken = response.data.data.refreshToken ?? null;
|
||||||
|
|
||||||
@@ -22,7 +27,7 @@ export const getAuthenticationCode = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getAuthenticationCode onFail: ', error);
|
derror('getAuthenticationCode onFail: ', error);
|
||||||
setTokenRefreshing(false);
|
setTokenRefreshing(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -35,7 +40,7 @@ export const registerDevice =
|
|||||||
const { agreeTerms } = params;
|
const { agreeTerms } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('registerDevice onSuccess: ', response.data);
|
dlog('registerDevice onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.REGISTER_DEVICE,
|
type: types.REGISTER_DEVICE,
|
||||||
@@ -50,7 +55,7 @@ export const registerDevice =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('registerDevice onFail: ', error);
|
derror('registerDevice onFail: ', error);
|
||||||
if (onFailCallback) {
|
if (onFailCallback) {
|
||||||
onFailCallback(error);
|
onFailCallback(error);
|
||||||
}
|
}
|
||||||
@@ -74,7 +79,7 @@ export const registerDeviceInfo = (params) => (dispatch, getState) => {
|
|||||||
const { evntTpCd, evntId, evntApplcnFlag, entryMenu, mbphNo } = params;
|
const { evntTpCd, evntId, evntApplcnFlag, entryMenu, mbphNo } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('registerDeviceInfo onSuccess: ', response.data);
|
dlog('registerDeviceInfo onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.REGISTER_DEVICE_INFO,
|
type: types.REGISTER_DEVICE_INFO,
|
||||||
@@ -84,7 +89,7 @@ export const registerDeviceInfo = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('registerDeviceInfo onFail: ', error);
|
derror('registerDeviceInfo onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
@@ -102,7 +107,7 @@ export const registerDeviceInfo = (params) => (dispatch, getState) => {
|
|||||||
// 디바이스 부가 정보 조회 IF-LGSP-003
|
// 디바이스 부가 정보 조회 IF-LGSP-003
|
||||||
export const getDeviceAdditionInfo = () => (dispatch, getState) => {
|
export const getDeviceAdditionInfo = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getDeviceAdditionInfo onSuccess: ', response.data);
|
dlog('getDeviceAdditionInfo onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_DEVICE_INFO,
|
type: types.GET_DEVICE_INFO,
|
||||||
@@ -111,7 +116,7 @@ export const getDeviceAdditionInfo = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getDeviceAdditionInfo onFail: ', error);
|
derror('getDeviceAdditionInfo onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(dispatch, getState, 'get', URLS.GET_DEVICE_INFO, {}, {}, onSuccess, onFail);
|
TAxios(dispatch, getState, 'get', URLS.GET_DEVICE_INFO, {}, {}, onSuccess, onFail);
|
||||||
@@ -121,7 +126,7 @@ export const getDeviceAdditionInfo = () => (dispatch, getState) => {
|
|||||||
export const getReAuthenticationCode = () => (dispatch, getState) => {
|
export const getReAuthenticationCode = () => (dispatch, getState) => {
|
||||||
setTokenRefreshing(true);
|
setTokenRefreshing(true);
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getReAuthenticationCode onSuccess: ", response.data);
|
// dlog("getReAuthenticationCode onSuccess: ", response.data);
|
||||||
const accessToken = response.data.data.accessToken;
|
const accessToken = response.data.data.accessToken;
|
||||||
dispatch(changeLocalSettings({ accessToken }));
|
dispatch(changeLocalSettings({ accessToken }));
|
||||||
setTokenRefreshing(false);
|
setTokenRefreshing(false);
|
||||||
@@ -129,7 +134,7 @@ export const getReAuthenticationCode = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getReAuthenticationCode onFail: ', error);
|
derror('getReAuthenticationCode onFail: ', error);
|
||||||
setTokenRefreshing(false);
|
setTokenRefreshing(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
import { URLS } from '../api/apiConfig';
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from '../api/TAxios';
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// IF-LGSPM-373 EMP Shoptime 선택 약관 조회
|
// IF-LGSPM-373 EMP Shoptime 선택 약관 조회
|
||||||
export const getShoptimeTerms = () => (dispatch, getState) => {
|
export const getShoptimeTerms = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getShoptimeTerms onSuccess ", response.data);
|
// dlog("getShoptimeTerms onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_SHOPTIME_TERMS,
|
type: types.GET_SHOPTIME_TERMS,
|
||||||
@@ -14,7 +19,7 @@ export const getShoptimeTerms = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getShoptimeTerms onFail ', error);
|
derror('getShoptimeTerms onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(dispatch, getState, 'get', URLS.GET_SHOPTIME_TERMS, {}, {}, onSuccess, onFail);
|
TAxios(dispatch, getState, 'get', URLS.GET_SHOPTIME_TERMS, {}, {}, onSuccess, onFail);
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 이벤트 정보 조회 IF-LGSP-070
|
// 이벤트 정보 조회 IF-LGSP-070
|
||||||
export const getWelcomeEventInfo =
|
export const getWelcomeEventInfo = (onSuccessCallback, onFailCallback) => (dispatch, getState) => {
|
||||||
(onSuccessCallback, onFailCallback) => (dispatch, getState) => {
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getWelcomeEventInfo onSuccess ", response.data);
|
dlog('getWelcomeEventInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_WELCOME_EVENT_INFO,
|
type: types.GET_WELCOME_EVENT_INFO,
|
||||||
@@ -20,29 +24,20 @@ export const getWelcomeEventInfo =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getWelcomeEventInfo onFail ", error);
|
derror('getWelcomeEventInfo onFail ', error);
|
||||||
if (onFailCallback) {
|
if (onFailCallback) {
|
||||||
onFailCallback(error);
|
onFailCallback(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_WELCOME_EVENT_INFO, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_WELCOME_EVENT_INFO,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 이벤트(쿠폰) 지급 요청 (IF-LGSP-071)
|
// 이벤트(쿠폰) 지급 요청 (IF-LGSP-071)
|
||||||
export const setEventIssueReq = (params) => (dispatch, getState) => {
|
export const setEventIssueReq = (params) => (dispatch, getState) => {
|
||||||
const { evntTpCd, evntId, mbphNo, cntryCd } = params;
|
const { evntTpCd, evntId, mbphNo, cntryCd } = params;
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setEventIssueReq onSuccess ", response.data);
|
dlog('setEventIssueReq onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_EVENT_ISSUE_REQ,
|
type: types.SET_EVENT_ISSUE_REQ,
|
||||||
@@ -52,13 +47,13 @@ export const setEventIssueReq = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setEventIssueReq onFail ", error);
|
derror('setEventIssueReq onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_EVENT_ISSUE_REQ,
|
URLS.SET_EVENT_ISSUE_REQ,
|
||||||
{},
|
{},
|
||||||
{ evntTpCd, evntId, mbphNo, cntryCd },
|
{ evntTpCd, evntId, mbphNo, cntryCd },
|
||||||
@@ -71,7 +66,7 @@ export const setEventIssueReq = (params) => (dispatch, getState) => {
|
|||||||
export const getEventIssuedStaus = (params) => (dispatch, getState) => {
|
export const getEventIssuedStaus = (params) => (dispatch, getState) => {
|
||||||
const { evntTpCd, evntId } = params;
|
const { evntTpCd, evntId } = params;
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getEventIssuedStaus onSuccess ", response.data);
|
dlog('getEventIssuedStaus onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_EVENT_ISSUED_STATUS,
|
type: types.GET_EVENT_ISSUED_STATUS,
|
||||||
@@ -81,13 +76,13 @@ export const getEventIssuedStaus = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getEventIssuedStaus onFail ", error);
|
derror('getEventIssuedStaus onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_EVENT_ISSUED_STATUS,
|
URLS.GET_EVENT_ISSUED_STATUS,
|
||||||
{ evntTpCd, evntId },
|
{ evntTpCd, evntId },
|
||||||
{},
|
{},
|
||||||
@@ -101,7 +96,7 @@ export const setEventPopClickInfo = (params) => (dispatch, getState) => {
|
|||||||
const { evntApplcnFlag, evntId } = params;
|
const { evntApplcnFlag, evntId } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setEventPopClickInfo onSuccess ", response.data);
|
dlog('setEventPopClickInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_EVENT_POP_CLICK_INFO,
|
type: types.SET_EVENT_POP_CLICK_INFO,
|
||||||
@@ -113,13 +108,13 @@ export const setEventPopClickInfo = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setEventPopClickInfo onFail ", error);
|
derror('setEventPopClickInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_EVENT_POP_CLICK_INFO,
|
URLS.SET_EVENT_POP_CLICK_INFO,
|
||||||
{},
|
{},
|
||||||
{ evntApplcnFlag, evntId },
|
{ evntApplcnFlag, evntId },
|
||||||
|
|||||||
@@ -3,34 +3,30 @@ import { TAxios } from '../api/TAxios';
|
|||||||
import { get } from '../utils/fp';
|
import { get } from '../utils/fp';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from './commonActions';
|
import { changeAppStatus } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const justForYou = (callback) => (dispatch, getState) => {
|
export const justForYou = (callback) => (dispatch, getState) => {
|
||||||
const macAddress = getState().common.macAddress;
|
const macAddress = getState().common.macAddress;
|
||||||
const macAddr = macAddress?.wired || macAddress?.wifi || "00:1A:2B:3C:4D:5E";
|
const macAddr = macAddress?.wired || macAddress?.wifi || '00:1A:2B:3C:4D:5E';
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("JustForYou onSuccess", response.data);
|
dlog('JustForYou onSuccess', response.data);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.JUSTFORYOU,
|
type: types.JUSTFORYOU,
|
||||||
payload: get("data.data", response),
|
payload: get('data.data', response),
|
||||||
});
|
});
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
callback && callback();
|
callback && callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("JustForYou onFail", error);
|
derror('JustForYou onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
callback && callback();
|
callback && callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'post', URLS.JUSTFORYOU, {}, { macAddr }, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"post",
|
|
||||||
URLS.JUSTFORYOU,
|
|
||||||
{},
|
|
||||||
{macAddr},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,13 +3,18 @@ import { TAxios, TAxiosPromise } from '../api/TAxios';
|
|||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus, getTermsAgreeYn } from './commonActions';
|
import { changeAppStatus, getTermsAgreeYn } from './commonActions';
|
||||||
import { collectBannerPositions } from '../utils/domUtils';
|
import { collectBannerPositions } from '../utils/domUtils';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 약관 정보 조회 IF-LGSP-005
|
// 약관 정보 조회 IF-LGSP-005
|
||||||
export const getHomeTerms = (props) => (dispatch, getState) => {
|
export const getHomeTerms = (props) => (dispatch, getState) => {
|
||||||
const { trmsTpCdList, mbrNo } = props;
|
const { trmsTpCdList, mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getHomeTerms onSuccess ', response.data);
|
dlog('getHomeTerms onSuccess ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -49,7 +54,7 @@ export const getHomeTerms = (props) => (dispatch, getState) => {
|
|||||||
payload: finalOptionalTermsValue,
|
payload: finalOptionalTermsValue,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(
|
dlog(
|
||||||
'[optionalTermsAvailable] 실제값:',
|
'[optionalTermsAvailable] 실제값:',
|
||||||
hasOptionalTerms,
|
hasOptionalTerms,
|
||||||
'강제설정값:',
|
'강제설정값:',
|
||||||
@@ -57,8 +62,8 @@ export const getHomeTerms = (props) => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log('약관 ID 매핑 생성:', termsIdMap);
|
dlog('약관 ID 매핑 생성:', termsIdMap);
|
||||||
console.log('선택약관 존재 여부:', hasOptionalTerms);
|
dlog('선택약관 존재 여부:', hasOptionalTerms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +74,7 @@ export const getHomeTerms = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getHomeTerms onFail ', error);
|
derror('getHomeTerms onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
@@ -89,7 +94,7 @@ export const fetchCurrentUserHomeTerms = () => (dispatch, getState) => {
|
|||||||
const loginUserData = getState().common.appStatus.loginUserData;
|
const loginUserData = getState().common.appStatus.loginUserData;
|
||||||
|
|
||||||
if (!loginUserData || !loginUserData.userNumber) {
|
if (!loginUserData || !loginUserData.userNumber) {
|
||||||
console.error(
|
derror(
|
||||||
'fetchCurrentUserHomeTerms: userNumber (mbrNo) is not available. User might not be logged in.'
|
'fetchCurrentUserHomeTerms: userNumber (mbrNo) is not available. User might not be logged in.'
|
||||||
);
|
);
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
@@ -100,7 +105,7 @@ export const fetchCurrentUserHomeTerms = () => (dispatch, getState) => {
|
|||||||
const trmsTpCdList = 'MST00401, MST00402, MST00405'; // 기본 약관 코드 리스트
|
const trmsTpCdList = 'MST00401, MST00402, MST00405'; // 기본 약관 코드 리스트
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('fetchCurrentUserHomeTerms onSuccess ', response.data);
|
dlog('fetchCurrentUserHomeTerms onSuccess ', response.data);
|
||||||
|
|
||||||
if (response.data.retCode === 0) {
|
if (response.data.retCode === 0) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -139,7 +144,7 @@ export const fetchCurrentUserHomeTerms = () => (dispatch, getState) => {
|
|||||||
type: types.SET_OPTIONAL_TERMS_AVAILABILITY,
|
type: types.SET_OPTIONAL_TERMS_AVAILABILITY,
|
||||||
payload: finalOptionalTermsValue,
|
payload: finalOptionalTermsValue,
|
||||||
});
|
});
|
||||||
console.log(
|
dlog(
|
||||||
'[optionalTermsAvailable] 실제값:',
|
'[optionalTermsAvailable] 실제값:',
|
||||||
hasOptionalTerms,
|
hasOptionalTerms,
|
||||||
'강제설정값:',
|
'강제설정값:',
|
||||||
@@ -147,8 +152,8 @@ export const fetchCurrentUserHomeTerms = () => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log('약관 ID 매핑 생성:', termsIdMap);
|
dlog('약관 ID 매핑 생성:', termsIdMap);
|
||||||
console.log('선택약관 존재 여부:', hasOptionalTerms);
|
dlog('선택약관 존재 여부:', hasOptionalTerms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +168,7 @@ export const fetchCurrentUserHomeTerms = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('fetchCurrentUserHomeTerms onFail ', error);
|
derror('fetchCurrentUserHomeTerms onFail ', error);
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -184,7 +189,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
const loginUserData = getState().common.appStatus.loginUserData;
|
const loginUserData = getState().common.appStatus.loginUserData;
|
||||||
|
|
||||||
if (!loginUserData || !loginUserData.userNumber) {
|
if (!loginUserData || !loginUserData.userNumber) {
|
||||||
console.error('fetchCurrentUserHomeTerms: userNumber is not available');
|
derror('fetchCurrentUserHomeTerms: userNumber is not available');
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
return { success: false, message: '사용자 정보가 없습니다.' };
|
return { success: false, message: '사용자 정보가 없습니다.' };
|
||||||
}
|
}
|
||||||
@@ -192,7 +197,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
const mbrNo = loginUserData.userNumber;
|
const mbrNo = loginUserData.userNumber;
|
||||||
const trmsTpCdList = 'MST00401, MST00402, MST00405';
|
const trmsTpCdList = 'MST00401, MST00402, MST00405';
|
||||||
|
|
||||||
console.log('Fetching home terms for user:', mbrNo);
|
dlog('Fetching home terms for user:', mbrNo);
|
||||||
|
|
||||||
// 안전한 API 호출 (기존 TAxios 패턴과 동일)
|
// 안전한 API 호출 (기존 TAxios 패턴과 동일)
|
||||||
const result = await TAxiosPromise(dispatch, getState, 'get', URLS.GET_HOME_TERMS, {
|
const result = await TAxiosPromise(dispatch, getState, 'get', URLS.GET_HOME_TERMS, {
|
||||||
@@ -202,7 +207,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
|
|
||||||
// 네트워크 에러인 경우
|
// 네트워크 에러인 경우
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
console.error('fetchCurrentUserHomeTerms network error:', result.error);
|
derror('fetchCurrentUserHomeTerms network error:', result.error);
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
return { success: false, message: '네트워크 오류가 발생했습니다.' };
|
return { success: false, message: '네트워크 오류가 발생했습니다.' };
|
||||||
}
|
}
|
||||||
@@ -210,7 +215,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
// 기존 TAxios처럼 특별한 retCode들은 TAxios 내부에서 이미 처리됨
|
// 기존 TAxios처럼 특별한 retCode들은 TAxios 내부에서 이미 처리됨
|
||||||
// (401, 402, 501, 602, 603, 604 등은 TAxios에서 알아서 처리하고 onSuccess가 호출되지 않음)
|
// (401, 402, 501, 602, 603, 604 등은 TAxios에서 알아서 처리하고 onSuccess가 호출되지 않음)
|
||||||
|
|
||||||
console.log('fetchCurrentUserHomeTerms response:', result.data);
|
dlog('fetchCurrentUserHomeTerms response:', result.data);
|
||||||
|
|
||||||
// 정상적으로 onSuccess가 호출된 경우에만 여기까지 옴
|
// 정상적으로 onSuccess가 호출된 경우에만 여기까지 옴
|
||||||
if (result.data && result.data.retCode === 0) {
|
if (result.data && result.data.retCode === 0) {
|
||||||
@@ -252,8 +257,8 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log('약관 ID 매핑 생성:', termsIdMap);
|
dlog('약관 ID 매핑 생성:', termsIdMap);
|
||||||
console.log(
|
dlog(
|
||||||
'선택약관 존재 여부 - 실제값:',
|
'선택약관 존재 여부 - 실제값:',
|
||||||
hasOptionalTerms,
|
hasOptionalTerms,
|
||||||
'강제설정값:',
|
'강제설정값:',
|
||||||
@@ -271,7 +276,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
} else {
|
} else {
|
||||||
// retCode가 0이 아닌 일반적인 API 에러
|
// retCode가 0이 아닌 일반적인 API 에러
|
||||||
// Chromium68 호환성을 위해 Optional Chaining 제거
|
// Chromium68 호환성을 위해 Optional Chaining 제거
|
||||||
console.error('API returned non-zero retCode:', result.data && result.data.retCode);
|
derror('API returned non-zero retCode:', result.data && result.data.retCode);
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_FAILURE });
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@@ -283,7 +288,7 @@ export const fetchCurrentUserHomeTermsSafe = () => async (dispatch, getState) =>
|
|||||||
// 메뉴 목록 조회 IF-LGSP-044
|
// 메뉴 목록 조회 IF-LGSP-044
|
||||||
export const getHomeMenu = () => (dispatch, getState) => {
|
export const getHomeMenu = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("getHomeMenu onSuccess ", response.data);
|
// dlog("getHomeMenu onSuccess ", response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_HOME_MENU,
|
type: types.GET_HOME_MENU,
|
||||||
@@ -292,7 +297,7 @@ export const getHomeMenu = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getHomeMenu onFail ', error);
|
derror('getHomeMenu onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(dispatch, getState, 'get', URLS.GET_HOME_MENU, {}, {}, onSuccess, onFail);
|
TAxios(dispatch, getState, 'get', URLS.GET_HOME_MENU, {}, {}, onSuccess, onFail);
|
||||||
@@ -305,7 +310,7 @@ export const getThemeCurationDetailInfo = (params) => (dispatch, getState) => {
|
|||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getThemeCurationDetailInfo onSuccess', response.data);
|
dlog('getThemeCurationDetailInfo onSuccess', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_THEME_CURATION_DETAIL_INFO,
|
type: types.GET_THEME_CURATION_DETAIL_INFO,
|
||||||
@@ -316,7 +321,7 @@ export const getThemeCurationDetailInfo = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getThemeCurationDetailInfo onFail', error);
|
derror('getThemeCurationDetailInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -338,7 +343,7 @@ export const getThemeHotelDetailInfo = (params) => (dispatch, getState) => {
|
|||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getThemeHotelDetailInfo onSuccess', response.data);
|
dlog('getThemeHotelDetailInfo onSuccess', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_THEME_HOTEL_DETAIL_INFO,
|
type: types.GET_THEME_HOTEL_DETAIL_INFO,
|
||||||
@@ -349,7 +354,7 @@ export const getThemeHotelDetailInfo = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getThemeHotelDetailInfo onFail', error);
|
derror('getThemeHotelDetailInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -367,7 +372,7 @@ export const getThemeHotelDetailInfo = (params) => (dispatch, getState) => {
|
|||||||
// HOME LAYOUT 정보 조회 IF-LGSP-300
|
// HOME LAYOUT 정보 조회 IF-LGSP-300
|
||||||
export const getHomeLayout = () => (dispatch, getState) => {
|
export const getHomeLayout = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getHomeLayout onSuccess', response.data);
|
dlog('getHomeLayout onSuccess', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_HOME_LAYOUT,
|
type: types.GET_HOME_LAYOUT,
|
||||||
@@ -377,7 +382,7 @@ export const getHomeLayout = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getHomeLayout onFail', error);
|
derror('getHomeLayout onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -387,7 +392,7 @@ export const getHomeLayout = () => (dispatch, getState) => {
|
|||||||
// HOME Main Contents Banner 정보 조회 IF-LGSP-301
|
// HOME Main Contents Banner 정보 조회 IF-LGSP-301
|
||||||
export const getHomeMainContents = () => (dispatch, getState) => {
|
export const getHomeMainContents = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getHomeMainContents onSuccess', response.data);
|
dlog('getHomeMainContents onSuccess', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_HOME_MAIN_CONTENTS,
|
type: types.GET_HOME_MAIN_CONTENTS,
|
||||||
@@ -399,7 +404,7 @@ export const getHomeMainContents = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getHomeMainContents onFail', error);
|
derror('getHomeMainContents onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -409,7 +414,7 @@ export const getHomeMainContents = () => (dispatch, getState) => {
|
|||||||
// Theme 전시 정보 조회 : IF-LGSP-045
|
// Theme 전시 정보 조회 : IF-LGSP-045
|
||||||
export const getThemeCurationInfo = () => (dispatch, getState) => {
|
export const getThemeCurationInfo = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getThemeCurationInfo onSuccess', response.data);
|
dlog('getThemeCurationInfo onSuccess', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_THEME_CURATION_INFO,
|
type: types.GET_THEME_CURATION_INFO,
|
||||||
@@ -420,7 +425,7 @@ export const getThemeCurationInfo = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getThemeCurationInfo onFail', error);
|
derror('getThemeCurationInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -434,7 +439,7 @@ export const getThemeMenuShelfInfo = (props) => (dispatch, getState) => {
|
|||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getThemeMenuShelfInfo onSuccess', response.data);
|
dlog('getThemeMenuShelfInfo onSuccess', response.data);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_THEME_MENU_SHELF_INFO,
|
type: types.GET_THEME_MENU_SHELF_INFO,
|
||||||
@@ -443,7 +448,7 @@ export const getThemeMenuShelfInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getThemeMenuShelfInfo onFail', error);
|
derror('getThemeMenuShelfInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -495,7 +500,7 @@ export const checkEnterThroughGNB = (boolean) => ({
|
|||||||
|
|
||||||
export const setBannerIndex = (bannerId, index) => {
|
export const setBannerIndex = (bannerId, index) => {
|
||||||
if (!bannerId) {
|
if (!bannerId) {
|
||||||
console.warn('setBannerIndex called with undefined bannerId');
|
dwarn('setBannerIndex called with undefined bannerId');
|
||||||
return { type: 'NO_OP' };
|
return { type: 'NO_OP' };
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@@ -551,9 +556,9 @@ export const collectAndSaveBannerPositions = (bannerIds) => async (dispatch) =>
|
|||||||
dispatch(setBannerPositions(positions));
|
dispatch(setBannerPositions(positions));
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log('[homeActions] 배너 위치 수집 완료:', positions);
|
dlog('[homeActions] 배너 위치 수집 완료:', positions);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[homeActions] 배너 위치 수집 실패:', error);
|
derror('[homeActions] 배너 위치 수집 실패:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { countryCode, URLS } from "../api/apiConfig";
|
import { countryCode, URLS } from '../api/apiConfig';
|
||||||
import { TLogEvent } from "../api/TLogEvent";
|
import { TLogEvent } from '../api/TLogEvent';
|
||||||
import { LOG_MENU, LOG_TP_NO } from "../utils/Config";
|
import { LOG_MENU, LOG_TP_NO } from '../utils/Config';
|
||||||
import {
|
import { formatGMTString, getTimeDifferenceByMilliseconds } from '../utils/helperMethods';
|
||||||
formatGMTString,
|
import { setGNBMenu, setSecondLayerInfo } from './commonActions';
|
||||||
getTimeDifferenceByMilliseconds,
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
} from "../utils/helperMethods";
|
|
||||||
import { setGNBMenu, setSecondLayerInfo } from "./commonActions";
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const getUrlByLogTpNo = (logTpNo) => {
|
export const getUrlByLogTpNo = (logTpNo) => {
|
||||||
switch (logTpNo) {
|
switch (logTpNo) {
|
||||||
@@ -157,17 +159,17 @@ export const getUrlByLogTpNo = (logTpNo) => {
|
|||||||
|
|
||||||
export const postTotalLog = (params, url) => (dispatch, getState) => {
|
export const postTotalLog = (params, url) => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log("#Total Log onSuccess.....", response);
|
// dlog("#Total Log onSuccess.....", response);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
// console.error("totalLog onFail...", error);
|
// derror("totalLog onFail...", error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TLogEvent(
|
TLogEvent(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.LOG_TOTAL_RECOMMEND,
|
URLS.LOG_TOTAL_RECOMMEND,
|
||||||
{},
|
{},
|
||||||
params,
|
params,
|
||||||
@@ -181,20 +183,20 @@ export const postLog = (params, url) => (dispatch, getState) => {
|
|||||||
const { logTpNo } = params;
|
const { logTpNo } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
// console.log(
|
// dlog(
|
||||||
// `postLog onSuccess logTpNo ${logTpNo}`,
|
// `postLog onSuccess logTpNo ${logTpNo}`,
|
||||||
// JSON.parse(response.config.data)
|
// JSON.parse(response.config.data)
|
||||||
// );
|
// );
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("postLog onFail", error);
|
derror('postLog onFail', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TLogEvent(
|
TLogEvent(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
url ?? getUrlByLogTpNo(logTpNo),
|
url ?? getUrlByLogTpNo(logTpNo),
|
||||||
{},
|
{},
|
||||||
params,
|
params,
|
||||||
@@ -249,7 +251,7 @@ export const sendLogLive = (params, callback) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!logTpNo || !patncNm || !patnrId || !showId || !watchStrtDt) {
|
if (!logTpNo || !patncNm || !patnrId || !showId || !watchStrtDt) {
|
||||||
console.log("[sendLogLive] invalid params", params);
|
dlog('[sendLogLive] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,7 +305,7 @@ export const sendLogVOD = (params, callback) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!logTpNo || !watchStrtDt) {
|
if (!logTpNo || !watchStrtDt) {
|
||||||
console.log("[sendLogLive] invalid params", params);
|
dlog('[sendLogLive] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,24 +370,24 @@ export const sendLogCuration = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!logTpNo) {
|
if (!logTpNo) {
|
||||||
console.log("[sendLogCuration] invalid params", params);
|
dlog('[sendLogCuration] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
cnttTpNm: params.cnttTpNm ?? "",
|
cnttTpNm: params.cnttTpNm ?? '',
|
||||||
curationId: params.curationId ?? "",
|
curationId: params.curationId ?? '',
|
||||||
curationNm: params.curationNm ?? "",
|
curationNm: params.curationNm ?? '',
|
||||||
entryMenu: entryMenu,
|
entryMenu: entryMenu,
|
||||||
expsOrd: params.expsOrd ?? "",
|
expsOrd: params.expsOrd ?? '',
|
||||||
lgCatCd: params.lgCatCd ?? "",
|
lgCatCd: params.lgCatCd ?? '',
|
||||||
lgCatNm: params.lgCatNm ?? "",
|
lgCatNm: params.lgCatNm ?? '',
|
||||||
logTpNo: params.logTpNo ?? "",
|
logTpNo: params.logTpNo ?? '',
|
||||||
linkTpCd: params.linkTpCd ?? "",
|
linkTpCd: params.linkTpCd ?? '',
|
||||||
nowMenu: nowMenu,
|
nowMenu: nowMenu,
|
||||||
patncNm: params.patncNm ?? "",
|
patncNm: params.patncNm ?? '',
|
||||||
patnrId: params.patnrId ?? "",
|
patnrId: params.patnrId ?? '',
|
||||||
sortTpNm: params.sortTpNm ?? "",
|
sortTpNm: params.sortTpNm ?? '',
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(postLog(newParams));
|
dispatch(postLog(newParams));
|
||||||
@@ -438,16 +440,12 @@ export const sendLogGNB = (menu) => (dispatch, getState) => {
|
|||||||
const secondLayerInfo = getState().common.secondLayerInfo;
|
const secondLayerInfo = getState().common.secondLayerInfo;
|
||||||
|
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
console.log("[sendLogGNB] invalid params", menu);
|
dlog('[sendLogGNB] invalid params', menu);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
![
|
![LOG_MENU.SEARCH_SEARCH, LOG_MENU.SEARCH_RESULT, LOG_MENU.SEARCH_BEST_SELLER].includes(menu)
|
||||||
LOG_MENU.SEARCH_SEARCH,
|
|
||||||
LOG_MENU.SEARCH_RESULT,
|
|
||||||
LOG_MENU.SEARCH_BEST_SELLER,
|
|
||||||
].includes(menu)
|
|
||||||
) {
|
) {
|
||||||
if (menu === nowMenu || !menuMovSno) {
|
if (menu === nowMenu || !menuMovSno) {
|
||||||
return;
|
return;
|
||||||
@@ -460,17 +458,13 @@ export const sendLogGNB = (menu) => (dispatch, getState) => {
|
|||||||
logTpNo: LOG_TP_NO.GNB,
|
logTpNo: LOG_TP_NO.GNB,
|
||||||
menuMovSno: `${menuMovSno}`,
|
menuMovSno: `${menuMovSno}`,
|
||||||
nowMenu: menu,
|
nowMenu: menu,
|
||||||
outDt: "",
|
outDt: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(setGNBMenu(menu));
|
dispatch(setGNBMenu(menu));
|
||||||
dispatch(postLog(newParams));
|
dispatch(postLog(newParams));
|
||||||
|
|
||||||
if (
|
if ([1].includes(menuMovSno) && secondLayerInfo && Object.keys(secondLayerInfo).length > 0) {
|
||||||
[1].includes(menuMovSno) &&
|
|
||||||
secondLayerInfo &&
|
|
||||||
Object.keys(secondLayerInfo).length > 0
|
|
||||||
) {
|
|
||||||
dispatch(
|
dispatch(
|
||||||
sendLogSecondLayer({
|
sendLogSecondLayer({
|
||||||
...secondLayerInfo,
|
...secondLayerInfo,
|
||||||
@@ -481,7 +475,7 @@ export const sendLogGNB = (menu) => (dispatch, getState) => {
|
|||||||
dispatch(
|
dispatch(
|
||||||
sendLogDeepLinkFlag({
|
sendLogDeepLinkFlag({
|
||||||
deeplinkId: secondLayerInfo.deeplinkId,
|
deeplinkId: secondLayerInfo.deeplinkId,
|
||||||
flag: secondLayerInfo.deeplinkId ? "Y" : "N",
|
flag: secondLayerInfo.deeplinkId ? 'Y' : 'N',
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -534,15 +528,10 @@ export const sendLogProductDetail = (params) => (dispatch, getState) => {
|
|||||||
const { logTpNo } = params;
|
const { logTpNo } = params;
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
const menu =
|
const menu = logTpNo === LOG_TP_NO.PRODUCT.PRODUCT_DETAIL_IMAGE ? entryMenu : params?.entryMenu;
|
||||||
logTpNo === LOG_TP_NO.PRODUCT.PRODUCT_DETAIL_IMAGE
|
|
||||||
? entryMenu
|
|
||||||
: params?.entryMenu;
|
|
||||||
|
|
||||||
const outDt =
|
const outDt =
|
||||||
logTpNo === LOG_TP_NO.PRODUCT.PRODUCT_DETAIL_IMAGE
|
logTpNo === LOG_TP_NO.PRODUCT.PRODUCT_DETAIL_IMAGE ? '' : formatGMTString(new Date());
|
||||||
? ""
|
|
||||||
: formatGMTString(new Date());
|
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
...params,
|
...params,
|
||||||
@@ -582,14 +571,11 @@ export const sendLogDetail = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!logTpNo || !patncNm || !patnrId) {
|
if (!logTpNo || !patncNm || !patnrId) {
|
||||||
console.log("[sendLogDetail] invalid params", params);
|
dlog('[sendLogDetail] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const outDt =
|
const outDt = logTpNo === LOG_TP_NO.DETAIL.DETAIL_BUTTON_CLICK ? '' : formatGMTString(new Date());
|
||||||
logTpNo === LOG_TP_NO.DETAIL.DETAIL_BUTTON_CLICK
|
|
||||||
? ""
|
|
||||||
: formatGMTString(new Date());
|
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
...params,
|
...params,
|
||||||
@@ -688,7 +674,7 @@ export const sendLogPartners = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!patncNm || !patnrId) {
|
if (!patncNm || !patnrId) {
|
||||||
console.log("[sendLogPartners] invalid params", params);
|
dlog('[sendLogPartners] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,7 +705,7 @@ export const sendLogMyPageAlertFlag = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!alertFlag) {
|
if (!alertFlag) {
|
||||||
console.log("[sendLogMyPageAlertFlag] invalid params", params);
|
dlog('[sendLogMyPageAlertFlag] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,7 +735,7 @@ export const sendLogMyPageMyDelete = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!cnt) {
|
if (!cnt) {
|
||||||
console.log("[sendLogMyPageMyDelete] invalid params", params);
|
dlog('[sendLogMyPageMyDelete] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,7 +767,7 @@ export const sendLogMyPageNotice = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!itemId || !title) {
|
if (!itemId || !title) {
|
||||||
console.log("[sendLogNoticeView] invalid params", params);
|
dlog('[sendLogNoticeView] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -819,7 +805,7 @@ export const sendLogSearch = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!inputFlag || !itemCnt || !keyword || !showCnt || !themeCnt) {
|
if (!inputFlag || !itemCnt || !keyword || !showCnt || !themeCnt) {
|
||||||
console.log("[sendLogSearch] invalid params", params);
|
dlog('[sendLogSearch] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -869,25 +855,25 @@ export const sendLogSearchClick = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!keyword || !patncNm || !patnrId) {
|
if (!keyword || !patncNm || !patnrId) {
|
||||||
console.log("[sendLogSearchClick] invalid params", params);
|
dlog('[sendLogSearchClick] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
curationId: params?.curationId ?? "",
|
curationId: params?.curationId ?? '',
|
||||||
curationNm: params?.curationNm ?? "",
|
curationNm: params?.curationNm ?? '',
|
||||||
dcAfPrice: params?.dcAfPrice ?? "",
|
dcAfPrice: params?.dcAfPrice ?? '',
|
||||||
entryMenu: entryMenu,
|
entryMenu: entryMenu,
|
||||||
keyword,
|
keyword,
|
||||||
lgCatNm: params?.lgCatNm ?? "",
|
lgCatNm: params?.lgCatNm ?? '',
|
||||||
logTpNo: LOG_TP_NO.SEARCH_CLICK,
|
logTpNo: LOG_TP_NO.SEARCH_CLICK,
|
||||||
nowMenu: nowMenu,
|
nowMenu: nowMenu,
|
||||||
patncNm,
|
patncNm,
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId: params?.prdtId ?? "",
|
prdtId: params?.prdtId ?? '',
|
||||||
prdtNm: params?.prdtNm ?? "",
|
prdtNm: params?.prdtNm ?? '',
|
||||||
showId: params?.showId ?? "",
|
showId: params?.showId ?? '',
|
||||||
showNm: params?.showNm ?? "",
|
showNm: params?.showNm ?? '',
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(postLog(newParams));
|
dispatch(postLog(newParams));
|
||||||
@@ -925,7 +911,7 @@ export const sendLogUpcomingFlag = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!items) {
|
if (!items) {
|
||||||
console.log("[sendLogUpcomingFlag] invalid params", params);
|
dlog('[sendLogUpcomingFlag] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -972,25 +958,17 @@ export const sendLogAlarmPop = (params) => (dispatch, getState) => {
|
|||||||
const { alarmDt, alarmType, cnt, patncNm, patnrId, showId, showNm } = params;
|
const { alarmDt, alarmType, cnt, patncNm, patnrId, showId, showNm } = params;
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (
|
if (!alarmDt || !alarmType || !cnt || !patncNm || !patnrId || !showId || !showNm) {
|
||||||
!alarmDt ||
|
dlog('[sendLogAlarmPop] invalid params', params);
|
||||||
!alarmType ||
|
|
||||||
!cnt ||
|
|
||||||
!patncNm ||
|
|
||||||
!patnrId ||
|
|
||||||
!showId ||
|
|
||||||
!showNm
|
|
||||||
) {
|
|
||||||
console.log("[sendLogAlarmPop] invalid params", params);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
...params,
|
...params,
|
||||||
entryMenu: entryMenu,
|
entryMenu: entryMenu,
|
||||||
hstNm: params?.hstNm ?? "",
|
hstNm: params?.hstNm ?? '',
|
||||||
lgCatCd: params?.lgCatCd ?? "",
|
lgCatCd: params?.lgCatCd ?? '',
|
||||||
lgCatNm: params?.lgCatNm ?? "",
|
lgCatNm: params?.lgCatNm ?? '',
|
||||||
logTpNo: LOG_TP_NO.ALARM_POP,
|
logTpNo: LOG_TP_NO.ALARM_POP,
|
||||||
nowMenu: nowMenu,
|
nowMenu: nowMenu,
|
||||||
};
|
};
|
||||||
@@ -1032,29 +1010,20 @@ export const sendLogAlarmPop = (params) => (dispatch, getState) => {
|
|||||||
* (M) showNm 방송 이름
|
* (M) showNm 방송 이름
|
||||||
*/
|
*/
|
||||||
export const sendLogAlarmClick = (params) => (dispatch, getState) => {
|
export const sendLogAlarmClick = (params) => (dispatch, getState) => {
|
||||||
const { alarmDt, alarmType, clickFlag, cnt, logTpNo, patnrId, showId } =
|
const { alarmDt, alarmType, clickFlag, cnt, logTpNo, patnrId, showId } = params;
|
||||||
params;
|
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (
|
if (!alarmDt || !alarmType || !clickFlag || !cnt || !logTpNo || !patnrId || !showId) {
|
||||||
!alarmDt ||
|
dlog('[sendLogAlarmClick] invalid params', params);
|
||||||
!alarmType ||
|
|
||||||
!clickFlag ||
|
|
||||||
!cnt ||
|
|
||||||
!logTpNo ||
|
|
||||||
!patnrId ||
|
|
||||||
!showId
|
|
||||||
) {
|
|
||||||
console.log("[sendLogAlarmClick] invalid params", params);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
...params,
|
...params,
|
||||||
entryMenu: entryMenu,
|
entryMenu: entryMenu,
|
||||||
hstNm: params?.hstNm ?? "",
|
hstNm: params?.hstNm ?? '',
|
||||||
lgCatCd: params?.lgCatCd ?? "",
|
lgCatCd: params?.lgCatCd ?? '',
|
||||||
lgCatNm: params?.lgCatNm ?? "",
|
lgCatNm: params?.lgCatNm ?? '',
|
||||||
nowMenu: nowMenu,
|
nowMenu: nowMenu,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1177,7 +1146,7 @@ export const sendLogTerms = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!logTpNo) {
|
if (!logTpNo) {
|
||||||
console.log("[sendLogTerms] invalid params", params);
|
dlog('[sendLogTerms] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1208,7 +1177,7 @@ export const sendLogLgAccountLogin = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!lginTpNm || !usrNo) {
|
if (!lginTpNm || !usrNo) {
|
||||||
console.log("[sendLogLgAccountLogin] invalid params", params);
|
dlog('[sendLogLgAccountLogin] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1239,7 +1208,7 @@ export const sendLogOrderBtnClick = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!btnNm) {
|
if (!btnNm) {
|
||||||
console.log("[sendLogOrderBtnClick] invalid params", params);
|
dlog('[sendLogOrderBtnClick] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1272,7 +1241,7 @@ export const sendLogOrderChange = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!reqRsn || !reqTpNm) {
|
if (!reqRsn || !reqTpNm) {
|
||||||
console.log("[sendLogOrderChange] invalid params", params);
|
dlog('[sendLogOrderChange] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1315,7 +1284,7 @@ export const sendLogCouponUse = (params) => (dispatch, getState) => {
|
|||||||
// const {} = params
|
// const {} = params
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
// if() {
|
// if() {
|
||||||
// console.log('[sendLogCouponUse] invalid params', params)
|
// dlog('[sendLogCouponUse] invalid params', params)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
@@ -1364,29 +1333,11 @@ export const sendLogCouponUse = (params) => (dispatch, getState) => {
|
|||||||
* (M) qty 수량
|
* (M) qty 수량
|
||||||
*/
|
*/
|
||||||
export const sendLogPaymentEntry = (params) => (dispatch, getState) => {
|
export const sendLogPaymentEntry = (params) => (dispatch, getState) => {
|
||||||
const {
|
const { cartTpSno, dcAftrPrc, dcBefPrc, patncNm, patnrId, prodId, prodNm, qty } = params;
|
||||||
cartTpSno,
|
|
||||||
dcAftrPrc,
|
|
||||||
dcBefPrc,
|
|
||||||
patncNm,
|
|
||||||
patnrId,
|
|
||||||
prodId,
|
|
||||||
prodNm,
|
|
||||||
qty,
|
|
||||||
} = params;
|
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (
|
if (!cartTpSno || !dcAftrPrc || !dcBefPrc || !patncNm || !patnrId || !prodId || !prodNm || !qty) {
|
||||||
!cartTpSno ||
|
dlog('[sendLogPaymentEntry] invalid params', params);
|
||||||
!dcAftrPrc ||
|
|
||||||
!dcBefPrc ||
|
|
||||||
!patncNm ||
|
|
||||||
!patnrId ||
|
|
||||||
!prodId ||
|
|
||||||
!prodNm ||
|
|
||||||
!qty
|
|
||||||
) {
|
|
||||||
console.log("[sendLogPaymentEntry] invalid params", params);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1438,17 +1389,7 @@ export const sendLogPaymentEntry = (params) => (dispatch, getState) => {
|
|||||||
* (M) usrNo 사용자 번호
|
* (M) usrNo 사용자 번호
|
||||||
*/
|
*/
|
||||||
export const sendLogPaymentComplete = (params) => (dispatch, getState) => {
|
export const sendLogPaymentComplete = (params) => (dispatch, getState) => {
|
||||||
const {
|
const { cartTpSno, dcAftrPrc, dcBefPrc, patncNm, patnrId, prodId, prodNm, qty, usrNo } = params;
|
||||||
cartTpSno,
|
|
||||||
dcAftrPrc,
|
|
||||||
dcBefPrc,
|
|
||||||
patncNm,
|
|
||||||
patnrId,
|
|
||||||
prodId,
|
|
||||||
prodNm,
|
|
||||||
qty,
|
|
||||||
usrNo,
|
|
||||||
} = params;
|
|
||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -1462,7 +1403,7 @@ export const sendLogPaymentComplete = (params) => (dispatch, getState) => {
|
|||||||
!qty ||
|
!qty ||
|
||||||
!usrNo
|
!usrNo
|
||||||
) {
|
) {
|
||||||
console.log("[sendLogPaymentComplete] invalid params", params);
|
dlog('[sendLogPaymentComplete] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1506,22 +1447,22 @@ export const sendLogFeaturedBrands = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!patncNm || !patnrId) {
|
if (!patncNm || !patnrId) {
|
||||||
console.log("[sendLogFeaturedBrands] invalid params", params);
|
dlog('[sendLogFeaturedBrands] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
catCd: params.catCd ?? "",
|
catCd: params.catCd ?? '',
|
||||||
catNm: params.catNm ?? "",
|
catNm: params.catNm ?? '',
|
||||||
crtrId: params.crtrId ?? "",
|
crtrId: params.crtrId ?? '',
|
||||||
crtrNm: params.crtrNm ?? "",
|
crtrNm: params.crtrNm ?? '',
|
||||||
entryMenu: entryMenu,
|
entryMenu: entryMenu,
|
||||||
logTpNo: LOG_TP_NO.BRANDS,
|
logTpNo: LOG_TP_NO.BRANDS,
|
||||||
nowMenu: nowMenu,
|
nowMenu: nowMenu,
|
||||||
patncNm,
|
patncNm,
|
||||||
patnrId,
|
patnrId,
|
||||||
srsId: params.srsId ?? "",
|
srsId: params.srsId ?? '',
|
||||||
srsNm: params.srsNm ?? "",
|
srsNm: params.srsNm ?? '',
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(postLog(newParams));
|
dispatch(postLog(newParams));
|
||||||
@@ -1543,7 +1484,7 @@ export const sendLogMyInfoEdit = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!btnNm) {
|
if (!btnNm) {
|
||||||
console.log("[sendLogMyInfoEdit] invalid params", params);
|
dlog('[sendLogMyInfoEdit] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1572,7 +1513,7 @@ export const sendLogCheckOutBtnClick = (params) => (dispatch, getState) => {
|
|||||||
const { entryMenu, nowMenu } = getState().common.menu;
|
const { entryMenu, nowMenu } = getState().common.menu;
|
||||||
|
|
||||||
if (!btnNm) {
|
if (!btnNm) {
|
||||||
console.log("[sendLogCheckOutBtnClick] invalid params", params);
|
dlog('[sendLogCheckOutBtnClick] invalid params', params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1597,19 +1538,19 @@ export const sendLogTotalRecommend = (params) => (dispatch, getState) => {
|
|||||||
|
|
||||||
const macAddr = macAddress?.wired ? macAddress?.wired : macAddress?.wifi;
|
const macAddr = macAddress?.wired ? macAddress?.wired : macAddress?.wifi;
|
||||||
|
|
||||||
if (typeof window === "object" && !window.PalmSystem) {
|
if (typeof window === 'object' && !window.PalmSystem) {
|
||||||
localMacAddress = "00:1A:2B:3C:4D:5E";
|
localMacAddress = '00:1A:2B:3C:4D:5E';
|
||||||
}
|
}
|
||||||
|
|
||||||
const logCreateTime = new Date().toISOString();
|
const logCreateTime = new Date().toISOString();
|
||||||
|
|
||||||
// console.log("#params", params);
|
// dlog("#params", params);
|
||||||
|
|
||||||
const newParams = {
|
const newParams = {
|
||||||
...params,
|
...params,
|
||||||
userNumber: userNumber,
|
userNumber: userNumber,
|
||||||
macAddr: macAddr ? macAddr : localMacAddress,
|
macAddr: macAddr ? macAddr : localMacAddress,
|
||||||
entryMenu: entryMenu ? entryMenu : "APP",
|
entryMenu: entryMenu ? entryMenu : 'APP',
|
||||||
logCreateTime,
|
logCreateTime,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ import Spotlight from '@enact/spotlight';
|
|||||||
|
|
||||||
import { panel_names } from '../utils/Config';
|
import { panel_names } from '../utils/Config';
|
||||||
import { popPanel, pushPanel, updatePanel } from './panelActions';
|
import { popPanel, pushPanel, updatePanel } from './panelActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
let startMediaFocusTimer = null;
|
let startMediaFocusTimer = null;
|
||||||
|
|
||||||
@@ -23,7 +28,7 @@ export const startMediaPlayer =
|
|||||||
const topPanel = panels[panels.length - 1];
|
const topPanel = panels[panels.length - 1];
|
||||||
let panelWorkingAction = pushPanel;
|
let panelWorkingAction = pushPanel;
|
||||||
|
|
||||||
console.log('[startMediaPlayer]-LoadingVideo 🚀 시작:', {
|
dlog('[startMediaPlayer]-LoadingVideo 🚀 시작:', {
|
||||||
showUrl: rest?.showUrl?.substring(0, 50),
|
showUrl: rest?.showUrl?.substring(0, 50),
|
||||||
showNm: rest?.showNm,
|
showNm: rest?.showNm,
|
||||||
prdtId: rest?.prdtId,
|
prdtId: rest?.prdtId,
|
||||||
@@ -53,7 +58,7 @@ export const startMediaPlayer =
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('[startMediaPlayer]-LoadingVideo ✅ MediaPanel dispatch 완료');
|
dlog('[startMediaPlayer]-LoadingVideo ✅ MediaPanel dispatch 완료');
|
||||||
|
|
||||||
if (modal && modalContainerId && !spotlightDisable) {
|
if (modal && modalContainerId && !spotlightDisable) {
|
||||||
Spotlight.setPointerMode(false);
|
Spotlight.setPointerMode(false);
|
||||||
@@ -70,21 +75,21 @@ export const finishMediaPreview = () => (dispatch, getState) => {
|
|||||||
const panels = getState().panels.panels;
|
const panels = getState().panels.panels;
|
||||||
const topPanel = panels[panels.length - 1];
|
const topPanel = panels[panels.length - 1];
|
||||||
|
|
||||||
// console.log('[finishMediaPreview] ========== Called ==========');
|
// dlog('[finishMediaPreview] ========== Called ==========');
|
||||||
// console.log('[finishMediaPreview] Current panels:', JSON.stringify(panels, null, 2));
|
// dlog('[finishMediaPreview] Current panels:', JSON.stringify(panels, null, 2));
|
||||||
// console.log('[finishMediaPreview] topPanel:', JSON.stringify(topPanel, null, 2));
|
// dlog('[finishMediaPreview] topPanel:', JSON.stringify(topPanel, null, 2));
|
||||||
|
|
||||||
if (topPanel && topPanel.name === panel_names.MEDIA_PANEL && topPanel.panelInfo.modal) {
|
if (topPanel && topPanel.name === panel_names.MEDIA_PANEL && topPanel.panelInfo.modal) {
|
||||||
// console.log('[finishMediaPreview] Closing modal MediaPanel');
|
// dlog('[finishMediaPreview] Closing modal MediaPanel');
|
||||||
|
|
||||||
if (startMediaFocusTimer) {
|
if (startMediaFocusTimer) {
|
||||||
clearTimeout(startMediaFocusTimer);
|
clearTimeout(startMediaFocusTimer);
|
||||||
startMediaFocusTimer = null;
|
startMediaFocusTimer = null;
|
||||||
}
|
}
|
||||||
dispatch(popPanel());
|
dispatch(popPanel());
|
||||||
// console.log('[finishMediaPreview] popPanel dispatched');
|
// dlog('[finishMediaPreview] popPanel dispatched');
|
||||||
} else {
|
} else {
|
||||||
// console.log('[finishMediaPreview] Not closing - no modal MediaPanel on top');
|
// dlog('[finishMediaPreview] Not closing - no modal MediaPanel on top');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -120,7 +125,7 @@ export const pauseModalMedia = () => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (modalMediaPanel) {
|
if (modalMediaPanel) {
|
||||||
// console.log('[pauseModalMedia] Pausing modal MediaPanel');
|
// dlog('[pauseModalMedia] Pausing modal MediaPanel');
|
||||||
dispatch(
|
dispatch(
|
||||||
updatePanel({
|
updatePanel({
|
||||||
name: panel_names.MEDIA_PANEL,
|
name: panel_names.MEDIA_PANEL,
|
||||||
@@ -144,7 +149,7 @@ export const resumeModalMedia = () => (dispatch, getState) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (modalMediaPanel && modalMediaPanel.panelInfo?.isPaused) {
|
if (modalMediaPanel && modalMediaPanel.panelInfo?.isPaused) {
|
||||||
// console.log('[resumeModalMedia] Resuming modal MediaPanel');
|
// dlog('[resumeModalMedia] Resuming modal MediaPanel');
|
||||||
dispatch(
|
dispatch(
|
||||||
updatePanel({
|
updatePanel({
|
||||||
name: panel_names.MEDIA_PANEL,
|
name: panel_names.MEDIA_PANEL,
|
||||||
@@ -163,21 +168,21 @@ export const resumeModalMedia = () => (dispatch, getState) => {
|
|||||||
export const switchMediaToFullscreen = () => (dispatch, getState) => {
|
export const switchMediaToFullscreen = () => (dispatch, getState) => {
|
||||||
const panels = getState().panels.panels;
|
const panels = getState().panels.panels;
|
||||||
|
|
||||||
// console.log('[switchMediaToFullscreen] ========== Called ==========');
|
// dlog('[switchMediaToFullscreen] ========== Called ==========');
|
||||||
// console.log('[switchMediaToFullscreen] Current panels:', JSON.stringify(panels, null, 2));
|
// dlog('[switchMediaToFullscreen] Current panels:', JSON.stringify(panels, null, 2));
|
||||||
|
|
||||||
const modalMediaPanel = panels.find(
|
const modalMediaPanel = panels.find(
|
||||||
(panel) => panel.name === panel_names.MEDIA_PANEL && panel.panelInfo?.modal
|
(panel) => panel.name === panel_names.MEDIA_PANEL && panel.panelInfo?.modal
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[switchMediaToFullscreen] modalMediaPanel found:',
|
// '[switchMediaToFullscreen] modalMediaPanel found:',
|
||||||
// JSON.stringify(modalMediaPanel, null, 2)
|
// JSON.stringify(modalMediaPanel, null, 2)
|
||||||
// );
|
// );
|
||||||
|
|
||||||
if (modalMediaPanel) {
|
if (modalMediaPanel) {
|
||||||
// console.log('[switchMediaToFullscreen] Switching to fullscreen - updating modal to false');
|
// dlog('[switchMediaToFullscreen] Switching to fullscreen - updating modal to false');
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[switchMediaToFullscreen] Existing panelInfo:',
|
// '[switchMediaToFullscreen] Existing panelInfo:',
|
||||||
// JSON.stringify(modalMediaPanel.panelInfo, null, 2)
|
// JSON.stringify(modalMediaPanel.panelInfo, null, 2)
|
||||||
// );
|
// );
|
||||||
@@ -187,7 +192,7 @@ export const switchMediaToFullscreen = () => (dispatch, getState) => {
|
|||||||
modal: false,
|
modal: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[switchMediaToFullscreen] New panelInfo to dispatch:',
|
// '[switchMediaToFullscreen] New panelInfo to dispatch:',
|
||||||
// JSON.stringify(newPanelInfo, null, 2)
|
// JSON.stringify(newPanelInfo, null, 2)
|
||||||
// );
|
// );
|
||||||
@@ -198,9 +203,9 @@ export const switchMediaToFullscreen = () => (dispatch, getState) => {
|
|||||||
panelInfo: newPanelInfo,
|
panelInfo: newPanelInfo,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
// console.log('[switchMediaToFullscreen] updatePanel dispatched');
|
// dlog('[switchMediaToFullscreen] updatePanel dispatched');
|
||||||
} else {
|
} else {
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[switchMediaToFullscreen] No modal MediaPanel found - cannot switch to fullscreen'
|
// '[switchMediaToFullscreen] No modal MediaPanel found - cannot switch to fullscreen'
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
@@ -215,7 +220,7 @@ export const switchMediaToModal = (modalContainerId, modalClassName) => (dispatc
|
|||||||
const mediaPanel = panels.find((panel) => panel.name === panel_names.MEDIA_PANEL);
|
const mediaPanel = panels.find((panel) => panel.name === panel_names.MEDIA_PANEL);
|
||||||
|
|
||||||
if (mediaPanel && !mediaPanel.panelInfo?.modal) {
|
if (mediaPanel && !mediaPanel.panelInfo?.modal) {
|
||||||
// console.log('[switchMediaToModal] Switching to modal');
|
// dlog('[switchMediaToModal] Switching to modal');
|
||||||
dispatch(
|
dispatch(
|
||||||
updatePanel({
|
updatePanel({
|
||||||
name: panel_names.MEDIA_PANEL,
|
name: panel_names.MEDIA_PANEL,
|
||||||
@@ -237,10 +242,11 @@ export const switchMediaToModal = (modalContainerId, modalClassName) => (dispatc
|
|||||||
export const minimizeModalMedia = () => (dispatch, getState) => {
|
export const minimizeModalMedia = () => (dispatch, getState) => {
|
||||||
const panels = getState().panels.panels;
|
const panels = getState().panels.panels;
|
||||||
|
|
||||||
console.log('[Minimize] ========== Called ==========');
|
dlog('[Minimize] ========== Called ==========');
|
||||||
console.log('[Minimize] Total panels:', panels.length);
|
dlog('[Minimize] Total panels:', panels.length);
|
||||||
console.log(
|
dlog(
|
||||||
'[Minimize] All panels:',panels
|
'[Minimize] All panels:',
|
||||||
|
panels
|
||||||
// JSON.stringify(
|
// JSON.stringify(
|
||||||
// panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal })),
|
// panels.map((p) => ({ name: p.name, modal: p.panelInfo?.modal })),
|
||||||
// null,
|
// null,
|
||||||
@@ -252,13 +258,13 @@ export const minimizeModalMedia = () => (dispatch, getState) => {
|
|||||||
(panel) => panel.name === panel_names.MEDIA_PANEL && panel.panelInfo?.modal
|
(panel) => panel.name === panel_names.MEDIA_PANEL && panel.panelInfo?.modal
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log('[Minimize] Found modalMediaPanel:', !!modalMediaPanel);
|
// dlog('[Minimize] Found modalMediaPanel:', !!modalMediaPanel);
|
||||||
if (modalMediaPanel) {
|
if (modalMediaPanel) {
|
||||||
console.log(
|
dlog(
|
||||||
'[Minimize] modalMediaPanel.panelInfo:',
|
'[Minimize] modalMediaPanel.panelInfo:',
|
||||||
JSON.stringify(modalMediaPanel.panelInfo, null, 2)
|
JSON.stringify(modalMediaPanel.panelInfo, null, 2)
|
||||||
);
|
);
|
||||||
// console.log('[Minimize] ✅ Minimizing modal MediaPanel (modal=false, isMinimized=true)');
|
// dlog('[Minimize] ✅ Minimizing modal MediaPanel (modal=false, isMinimized=true)');
|
||||||
dispatch(
|
dispatch(
|
||||||
updatePanel({
|
updatePanel({
|
||||||
name: panel_names.MEDIA_PANEL,
|
name: panel_names.MEDIA_PANEL,
|
||||||
@@ -273,7 +279,7 @@ export const minimizeModalMedia = () => (dispatch, getState) => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log('[Minimize] ❌ No modal MediaPanel found - cannot minimize');
|
dlog('[Minimize] ❌ No modal MediaPanel found - cannot minimize');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -285,16 +291,16 @@ export const restoreModalMedia = () => (dispatch, getState) => {
|
|||||||
const panels = getState().panels.panels;
|
const panels = getState().panels.panels;
|
||||||
|
|
||||||
if (typeof window !== 'undefined' && window.detailPanelScrollTop !== 0) {
|
if (typeof window !== 'undefined' && window.detailPanelScrollTop !== 0) {
|
||||||
console.log(
|
dlog(
|
||||||
'[restoreModalMedia] Blocked restore because detail panel scroll not zero:',
|
'[restoreModalMedia] Blocked restore because detail panel scroll not zero:',
|
||||||
window.detailPanelScrollTop
|
window.detailPanelScrollTop
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('[Restore]] ========== Called ==========');
|
// dlog('[Restore]] ========== Called ==========');
|
||||||
// console.log('[Restore] Total panels:', panels.length);
|
// dlog('[Restore] Total panels:', panels.length);
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[Restore] All panels:',
|
// '[Restore] All panels:',
|
||||||
// JSON.stringify(
|
// JSON.stringify(
|
||||||
// panels.map((p) => ({
|
// panels.map((p) => ({
|
||||||
@@ -315,13 +321,13 @@ export const restoreModalMedia = () => (dispatch, getState) => {
|
|||||||
panel.panelInfo?.isMinimized
|
panel.panelInfo?.isMinimized
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log('[restoreModalMedia] Found minimizedMediaPanel:', !!minimizedMediaPanel);
|
// dlog('[restoreModalMedia] Found minimizedMediaPanel:', !!minimizedMediaPanel);
|
||||||
if (minimizedMediaPanel) {
|
if (minimizedMediaPanel) {
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[restoreModalMedia] minimizedMediaPanel.panelInfo:',
|
// '[restoreModalMedia] minimizedMediaPanel.panelInfo:',
|
||||||
// JSON.stringify(minimizedMediaPanel.panelInfo, null, 2)
|
// JSON.stringify(minimizedMediaPanel.panelInfo, null, 2)
|
||||||
// );
|
// );
|
||||||
// console.log(
|
// dlog(
|
||||||
// '[restoreModalMedia] ✅ Restoring modal MediaPanel (modal=true, isMinimized=false)'
|
// '[restoreModalMedia] ✅ Restoring modal MediaPanel (modal=true, isMinimized=false)'
|
||||||
// );
|
// );
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -336,6 +342,6 @@ export const restoreModalMedia = () => (dispatch, getState) => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// console.log('[restoreModalMedia] ❌ No minimized MediaPanel found - cannot restore');
|
// dlog('[restoreModalMedia] ❌ No minimized MediaPanel found - cannot restore');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
import { BUYNOW_CONFIG } from '../utils/BuyNowConfig';
|
import { BUYNOW_CONFIG } from '../utils/BuyNowConfig';
|
||||||
import { createMockCartListData, createMockCartData, addMockCartItem, removeMockCartItem, updateMockCartItemQuantity } from '../utils/BuyNowDataManipulator';
|
import {
|
||||||
|
createMockCartListData,
|
||||||
|
createMockCartData,
|
||||||
|
addMockCartItem,
|
||||||
|
removeMockCartItem,
|
||||||
|
updateMockCartItemQuantity,
|
||||||
|
} from '../utils/BuyNowDataManipulator';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// Mock Cart Action Types
|
// Mock Cart Action Types
|
||||||
export const MOCK_CART_TYPES = {
|
export const MOCK_CART_TYPES = {
|
||||||
@@ -16,16 +27,18 @@ export const MOCK_CART_TYPES = {
|
|||||||
* Mock 장바구니 초기화
|
* Mock 장바구니 초기화
|
||||||
* BuyOption에서 ADD TO CART 시 호출 - 기존 장바구니에 상품 추가
|
* BuyOption에서 ADD TO CART 시 호출 - 기존 장바구니에 상품 추가
|
||||||
*/
|
*/
|
||||||
export const initializeMockCart = (productData, optionInfo = {}, quantity = 1) => (dispatch, getState) => {
|
export const initializeMockCart =
|
||||||
|
(productData, optionInfo = {}, quantity = 1) =>
|
||||||
|
(dispatch, getState) => {
|
||||||
if (!BUYNOW_CONFIG.isMockMode()) {
|
if (!BUYNOW_CONFIG.isMockMode()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] initializeMockCart - productData:', productData);
|
dlog('[MockCartActions] initializeMockCart - productData:', productData);
|
||||||
|
|
||||||
// 기존 장바구니 데이터 확인
|
// 기존 장바구니 데이터 확인
|
||||||
const currentCart = getState().mockCart.cartInfo || [];
|
const currentCart = getState().mockCart.cartInfo || [];
|
||||||
console.log('[MockCartActions] initializeMockCart - current cart items:', currentCart.length);
|
dlog('[MockCartActions] initializeMockCart - current cart items:', currentCart.length);
|
||||||
|
|
||||||
// 새 상품 데이터 생성
|
// 새 상품 데이터 생성
|
||||||
const newCartItem = createMockCartData(productData, optionInfo, quantity);
|
const newCartItem = createMockCartData(productData, optionInfo, quantity);
|
||||||
@@ -34,7 +47,7 @@ export const initializeMockCart = (productData, optionInfo = {}, quantity = 1) =
|
|||||||
// addToMockCart를 사용하여 기존 장바구니에 상품 추가 (덮어쓰기 방지)
|
// addToMockCart를 사용하여 기존 장바구니에 상품 추가 (덮어쓰기 방지)
|
||||||
dispatch(addToMockCart(productData, optionInfo, quantity));
|
dispatch(addToMockCart(productData, optionInfo, quantity));
|
||||||
} else {
|
} else {
|
||||||
console.log('[MockCartActions] initializeMockCart - Failed to create cart item');
|
dlog('[MockCartActions] initializeMockCart - Failed to create cart item');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -44,12 +57,14 @@ export const initializeMockCart = (productData, optionInfo = {}, quantity = 1) =
|
|||||||
* @param {Object} optionInfo - 옵션 정보
|
* @param {Object} optionInfo - 옵션 정보
|
||||||
* @param {number} quantity - 수량
|
* @param {number} quantity - 수량
|
||||||
*/
|
*/
|
||||||
export const addToMockCart = (productData, optionInfo = {}, quantity = 1) => (dispatch, getState) => {
|
export const addToMockCart =
|
||||||
|
(productData, optionInfo = {}, quantity = 1) =>
|
||||||
|
(dispatch, getState) => {
|
||||||
if (!BUYNOW_CONFIG.isMockMode()) {
|
if (!BUYNOW_CONFIG.isMockMode()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] addToMockCart - productData:', productData);
|
dlog('[MockCartActions] addToMockCart - productData:', productData);
|
||||||
|
|
||||||
// Mock 장바구니 데이터 생성
|
// Mock 장바구니 데이터 생성
|
||||||
const newCartItem = addMockCartItem(productData, optionInfo, quantity);
|
const newCartItem = addMockCartItem(productData, optionInfo, quantity);
|
||||||
@@ -76,7 +91,7 @@ export const removeFromMockCart = (prodSno) => (dispatch, getState) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] removeFromMockCart - prodSno:', prodSno);
|
dlog('[MockCartActions] removeFromMockCart - prodSno:', prodSno);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: MOCK_CART_TYPES.REMOVE_FROM_MOCK_CART,
|
type: MOCK_CART_TYPES.REMOVE_FROM_MOCK_CART,
|
||||||
@@ -101,7 +116,7 @@ export const updateMockCartItem = (prodSno, quantity) => (dispatch, getState) =>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] updateMockCartItem - prodSno:', prodSno, 'quantity:', quantity);
|
dlog('[MockCartActions] updateMockCartItem - prodSno:', prodSno, 'quantity:', quantity);
|
||||||
|
|
||||||
const updatedItem = updateMockCartItemQuantity(prodSno, quantity);
|
const updatedItem = updateMockCartItemQuantity(prodSno, quantity);
|
||||||
|
|
||||||
@@ -136,7 +151,7 @@ export const setMockCartItemQuantity = (prodSno, quantity) => (dispatch, getStat
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] setMockCartItemQuantity - prodSno:', prodSno, 'quantity:', quantity);
|
dlog('[MockCartActions] setMockCartItemQuantity - prodSno:', prodSno, 'quantity:', quantity);
|
||||||
|
|
||||||
const updatedItem = updateMockCartItemQuantity(prodSno, quantity);
|
const updatedItem = updateMockCartItemQuantity(prodSno, quantity);
|
||||||
|
|
||||||
@@ -163,7 +178,7 @@ export const clearMockCart = () => (dispatch, getState) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] clearMockCart');
|
dlog('[MockCartActions] clearMockCart');
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: MOCK_CART_TYPES.CLEAR_MOCK_CART,
|
type: MOCK_CART_TYPES.CLEAR_MOCK_CART,
|
||||||
@@ -184,7 +199,7 @@ export const resetMockCart = () => (dispatch, getState) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] resetMockCart - Clearing cart to empty');
|
dlog('[MockCartActions] resetMockCart - Clearing cart to empty');
|
||||||
|
|
||||||
// 빈 장바구니로 재설정 (기본 Mock 상품 없음)
|
// 빈 장바구니로 재설정 (기본 Mock 상품 없음)
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -208,7 +223,7 @@ export const updateSelectedItems = (selectedItems) => (dispatch, getState) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[MockCartActions] updateSelectedItems - selectedItems:', selectedItems);
|
dlog('[MockCartActions] updateSelectedItems - selectedItems:', selectedItems);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: MOCK_CART_TYPES.UPDATE_SELECTED_ITEMS,
|
type: MOCK_CART_TYPES.UPDATE_SELECTED_ITEMS,
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import {
|
import {
|
||||||
changeAppStatus,
|
changeAppStatus,
|
||||||
deleteReservation,
|
deleteReservation,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
enableNotification,
|
enableNotification,
|
||||||
} from "./commonActions";
|
} from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 추천 Keyword 목록 조회 IF-LGSP-055
|
// 추천 Keyword 목록 조회 IF-LGSP-055
|
||||||
export const getMyRecommandedKeyword = () => (dispatch, getState) => {
|
export const getMyRecommandedKeyword = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyRecommandedKeyword onSuccess ", response.data);
|
dlog('getMyRecommandedKeyword onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_RECOMMANDED_KEYWORD,
|
type: types.GET_MY_RECOMMANDED_KEYWORD,
|
||||||
@@ -20,25 +25,16 @@ export const getMyRecommandedKeyword = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyRecommandedKeyword onFail ", error);
|
derror('getMyRecommandedKeyword onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_RECOMMANDED_KEYWORD, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_RECOMMANDED_KEYWORD,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// FAQ 조회 (IF-LGSP-048)
|
// FAQ 조회 (IF-LGSP-048)
|
||||||
export const getMyFaqInfo = () => (dispatch, getState) => {
|
export const getMyFaqInfo = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyFaqInfo onSuccess ", response.data);
|
dlog('getMyFaqInfo onSuccess ', response.data);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_FAQ_INFO,
|
type: types.GET_MY_FAQ_INFO,
|
||||||
payload: response.data.data,
|
payload: response.data.data,
|
||||||
@@ -46,25 +42,16 @@ export const getMyFaqInfo = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyFaqInfo onFail ", error);
|
derror('getMyFaqInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_FAQ_INFO, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_FAQ_INFO,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Notice 조회 (IF-LGSP-049)
|
// Notice 조회 (IF-LGSP-049)
|
||||||
export const getNotice = () => (dispatch, getState) => {
|
export const getNotice = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyNotice onSuccess ", response.data);
|
dlog('getMyNotice onSuccess ', response.data);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_NOTICE,
|
type: types.GET_NOTICE,
|
||||||
payload: response.data.data,
|
payload: response.data.data,
|
||||||
@@ -72,16 +59,16 @@ export const getNotice = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyNotice onFail ", error);
|
derror('getMyNotice onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(dispatch, getState, "get", URLS.GET_NOTICE, {}, {}, onSuccess, onFail);
|
TAxios(dispatch, getState, 'get', URLS.GET_NOTICE, {}, {}, onSuccess, onFail);
|
||||||
};
|
};
|
||||||
|
|
||||||
// MyPage 파트너사 Contact 정보 조회 (IF-LGSP-033)
|
// MyPage 파트너사 Contact 정보 조회 (IF-LGSP-033)
|
||||||
export const getMyCustomers = () => (dispatch, getState) => {
|
export const getMyCustomers = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyCustomers onSuccess ", response.data);
|
dlog('getMyCustomers onSuccess ', response.data);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_CUSTOMERS,
|
type: types.GET_MY_CUSTOMERS,
|
||||||
payload: response.data.data,
|
payload: response.data.data,
|
||||||
@@ -89,27 +76,18 @@ export const getMyCustomers = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyCustomers onFail ", error);
|
derror('getMyCustomers onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_CUSTOMERS, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_CUSTOMERS,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// MyPage 찜 목록 IF-LGSP-052
|
// MyPage 찜 목록 IF-LGSP-052
|
||||||
export const getMyFavorite = () => (dispatch, getState) => {
|
export const getMyFavorite = () => (dispatch, getState) => {
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getmyFavorite onSuccess ", response.data);
|
dlog('getmyFavorite onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_FAVORITE,
|
type: types.GET_MY_FAVORITE,
|
||||||
@@ -120,20 +98,11 @@ export const getMyFavorite = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyFavorite onFail ", error);
|
derror('getMyFavorite onFail ', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_FAVORITE, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_FAVORITE,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// MyPage 찜 삭제 IF-LGSP-053
|
// MyPage 찜 삭제 IF-LGSP-053
|
||||||
@@ -141,7 +110,7 @@ export const deleteMyFavorite = (params) => (dispatch, getState) => {
|
|||||||
const { productList, showList } = params;
|
const { productList, showList } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("deleteMyFavorite onSuccess ", response.data);
|
dlog('deleteMyFavorite onSuccess ', response.data);
|
||||||
|
|
||||||
const { favoriteData } = getState().myPage;
|
const { favoriteData } = getState().myPage;
|
||||||
const currentFavorites = favoriteData.favorites;
|
const currentFavorites = favoriteData.favorites;
|
||||||
@@ -152,8 +121,7 @@ export const deleteMyFavorite = (params) => (dispatch, getState) => {
|
|||||||
|
|
||||||
const updatedFavorites = currentFavorites.filter(
|
const updatedFavorites = currentFavorites.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
!productIdsToDelete.includes(item.prdtId) &&
|
!productIdsToDelete.includes(item.prdtId) && !showIdsToDelete.includes(item.showId)
|
||||||
!showIdsToDelete.includes(item.showId)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -164,13 +132,13 @@ export const deleteMyFavorite = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("deleteMyFavorite onFail ", error);
|
derror('deleteMyFavorite onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.DELETE_MY_FAVORITE,
|
URLS.DELETE_MY_FAVORITE,
|
||||||
{},
|
{},
|
||||||
{ productList, showList },
|
{ productList, showList },
|
||||||
@@ -180,8 +148,7 @@ export const deleteMyFavorite = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// MyPage 약관 철회 (IF-LGSP-032)
|
// MyPage 약관 철회 (IF-LGSP-032)
|
||||||
export const setMyTermsWithdraw =
|
export const setMyTermsWithdraw = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
let localMacAddress;
|
let localMacAddress;
|
||||||
const { mandatoryIncludeYn, termsList } = params;
|
const { mandatoryIncludeYn, termsList } = params;
|
||||||
|
|
||||||
@@ -192,14 +159,14 @@ export const setMyTermsWithdraw =
|
|||||||
|
|
||||||
const macAddr = macAddress?.wired || macAddress?.wifi || macAddress?.p2p;
|
const macAddr = macAddress?.wired || macAddress?.wifi || macAddress?.p2p;
|
||||||
|
|
||||||
if (typeof window === "object" && !window.PalmSystem) {
|
if (typeof window === 'object' && !window.PalmSystem) {
|
||||||
localMacAddress = "00:1A:2B:3C:4D:5E";
|
localMacAddress = '00:1A:2B:3C:4D:5E';
|
||||||
}
|
}
|
||||||
const logCreateTime = new Date().toISOString();
|
const logCreateTime = new Date().toISOString();
|
||||||
const xDeviceProduct = httpHeader["X-Device-Product"] || httpHeader.prod_cd;
|
const xDeviceProduct = httpHeader['X-Device-Product'] || httpHeader.prod_cd;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setMyTermsWithdraw onSuccess ", response.data);
|
dlog('setMyTermsWithdraw onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_MY_TERMS_WITHDRAW,
|
type: types.SET_MY_TERMS_WITHDRAW,
|
||||||
@@ -210,7 +177,7 @@ export const setMyTermsWithdraw =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setMyTermsWithdraw onFail ", error);
|
derror('setMyTermsWithdraw onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
const requestData = {
|
const requestData = {
|
||||||
@@ -218,14 +185,14 @@ export const setMyTermsWithdraw =
|
|||||||
termsList,
|
termsList,
|
||||||
xDeviceProduct,
|
xDeviceProduct,
|
||||||
macAddr: macAddr ? macAddr : localMacAddress,
|
macAddr: macAddr ? macAddr : localMacAddress,
|
||||||
userNumber: userNumber || "",
|
userNumber: userNumber || '',
|
||||||
requestTime: logCreateTime,
|
requestTime: logCreateTime,
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_MY_TERMS_WITHDRAW,
|
URLS.SET_MY_TERMS_WITHDRAW,
|
||||||
{},
|
{},
|
||||||
requestData,
|
requestData,
|
||||||
@@ -235,29 +202,23 @@ export const setMyTermsWithdraw =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// MyPage 약관 동의 (IF-LGSP-031)
|
// MyPage 약관 동의 (IF-LGSP-031)
|
||||||
export const setMyPageTermsAgree =
|
export const setMyPageTermsAgree = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { termsList, notTermsList } = params;
|
const { termsList, notTermsList } = params;
|
||||||
|
|
||||||
dispatch({ type: types.GET_TERMS_AGREE_YN_START });
|
dispatch({ type: types.GET_TERMS_AGREE_YN_START });
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setMyPageTermsAgree onSuccess ", response.data);
|
dlog('setMyPageTermsAgree onSuccess ', response.data);
|
||||||
|
|
||||||
// 약관 ID를 약관 코드로 변환하기 위해 state에서 termsIdMap 조회
|
// 약관 ID를 약관 코드로 변환하기 위해 state에서 termsIdMap 조회
|
||||||
const termsIdMap = getState().home.termsIdMap || {};
|
const termsIdMap = getState().home.termsIdMap || {};
|
||||||
const idToCodeMap = Object.entries(termsIdMap).reduce(
|
const idToCodeMap = Object.entries(termsIdMap).reduce((acc, [code, id]) => {
|
||||||
(acc, [code, id]) => {
|
|
||||||
acc[id] = code;
|
acc[id] = code;
|
||||||
return acc;
|
return acc;
|
||||||
},
|
}, {});
|
||||||
{}
|
|
||||||
);
|
|
||||||
|
|
||||||
// 동의한 약관 ID 목록을 약관 코드로 변환
|
// 동의한 약관 ID 목록을 약관 코드로 변환
|
||||||
const agreedTermCodes = termsList
|
const agreedTermCodes = termsList.map((id) => idToCodeMap[id]).filter(Boolean);
|
||||||
.map((id) => idToCodeMap[id])
|
|
||||||
.filter(Boolean);
|
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_MYPAGE_TERMS_AGREE_SUCCESS,
|
type: types.SET_MYPAGE_TERMS_AGREE_SUCCESS,
|
||||||
@@ -272,7 +233,7 @@ export const setMyPageTermsAgree =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setMyPageTermsAgree onFail ", error);
|
derror('setMyPageTermsAgree onFail ', error);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_MYPAGE_TERMS_AGREE_FAIL,
|
type: types.SET_MYPAGE_TERMS_AGREE_FAIL,
|
||||||
payload: error,
|
payload: error,
|
||||||
@@ -282,7 +243,7 @@ export const setMyPageTermsAgree =
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_MYPAGE_TERMS_AGREE,
|
URLS.SET_MYPAGE_TERMS_AGREE,
|
||||||
{},
|
{},
|
||||||
{ termsList, notTermsList },
|
{ termsList, notTermsList },
|
||||||
@@ -294,7 +255,7 @@ export const setMyPageTermsAgree =
|
|||||||
// MyPage Upcoming Alert 정보 변경 조회 (IF-LGSP-050)
|
// MyPage Upcoming Alert 정보 변경 조회 (IF-LGSP-050)
|
||||||
export const getMyUpcomingChangeInfo = () => (dispatch, getState) => {
|
export const getMyUpcomingChangeInfo = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyUpcomingChangeInfo onSuccess ", response.data);
|
dlog('getMyUpcomingChangeInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_UPCOMING_CHANGE_INFO,
|
type: types.GET_MY_UPCOMING_CHANGE_INFO,
|
||||||
@@ -303,25 +264,16 @@ export const getMyUpcomingChangeInfo = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyUpcomingChangeInfo onFail ", error);
|
derror('getMyUpcomingChangeInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_UPCOMING_CHANGE_INFO, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_UPCOMING_CHANGE_INFO,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// MyPage Upcoming Alert Show 목록 (IF-LGSP-025)
|
// MyPage Upcoming Alert Show 목록 (IF-LGSP-025)
|
||||||
export const getMyUpcomingAlertShow = () => (dispatch, getState) => {
|
export const getMyUpcomingAlertShow = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyUpcomingAlertShow onSuccess ", response.data);
|
dlog('getMyUpcomingAlertShow onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_UPCOMING_ALERT_SHOW,
|
type: types.GET_MY_UPCOMING_ALERT_SHOW,
|
||||||
@@ -330,19 +282,10 @@ export const getMyUpcomingAlertShow = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyUpcomingAlertShow onFail ", error);
|
derror('getMyUpcomingAlertShow onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(dispatch, getState, 'get', URLS.GET_MY_UPCOMING_ALERT_SHOW, {}, {}, onSuccess, onFail);
|
||||||
dispatch,
|
|
||||||
getState,
|
|
||||||
"get",
|
|
||||||
URLS.GET_MY_UPCOMING_ALERT_SHOW,
|
|
||||||
{},
|
|
||||||
{},
|
|
||||||
onSuccess,
|
|
||||||
onFail
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// MyPage UpComing Alert Show 삭제 (IF-LGSP-042)
|
// MyPage UpComing Alert Show 삭제 (IF-LGSP-042)
|
||||||
@@ -350,7 +293,7 @@ export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
|
|||||||
const { showList } = params;
|
const { showList } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("deleteMyUpcomingAlertShow onSuccess ", response.data);
|
dlog('deleteMyUpcomingAlertShow onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.DELETE_MY_UPCOMING_ALERT_SHOW,
|
type: types.DELETE_MY_UPCOMING_ALERT_SHOW,
|
||||||
@@ -363,13 +306,13 @@ export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("deleteMyUpcomingAlertShow onFail ", error);
|
derror('deleteMyUpcomingAlertShow onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.DELETE_MY_UPCOMING_ALERT_SHOW,
|
URLS.DELETE_MY_UPCOMING_ALERT_SHOW,
|
||||||
{},
|
{},
|
||||||
{ showList },
|
{ showList },
|
||||||
@@ -381,7 +324,7 @@ export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
|
|||||||
// MyPage Upcoming Alert Show - Key 목록 (IF-LGSP-076)
|
// MyPage Upcoming Alert Show - Key 목록 (IF-LGSP-076)
|
||||||
export const getMyUpcomingAlertShowKeys = () => (dispatch, getState) => {
|
export const getMyUpcomingAlertShowKeys = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyUpcomingAlertShowKeys onSuccess ", response.data);
|
dlog('getMyUpcomingAlertShowKeys onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_UPCOMING_ALERT_SHOW_KEYS,
|
type: types.GET_MY_UPCOMING_ALERT_SHOW_KEYS,
|
||||||
@@ -390,13 +333,13 @@ export const getMyUpcomingAlertShowKeys = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyUpcomingAlertShowKeys onFail ", error);
|
derror('getMyUpcomingAlertShowKeys onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_UPCOMING_ALERT_SHOW_KEYS,
|
URLS.GET_MY_UPCOMING_ALERT_SHOW_KEYS,
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
@@ -410,9 +353,9 @@ export const setMyUpcomingUseAlert = (params) => (dispatch, getState) => {
|
|||||||
const { upcomingAlamUseFlag } = params;
|
const { upcomingAlamUseFlag } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setMyUpcomingUseAlert onSuccess ", response.data);
|
dlog('setMyUpcomingUseAlert onSuccess ', response.data);
|
||||||
|
|
||||||
if (upcomingAlamUseFlag === "Y") {
|
if (upcomingAlamUseFlag === 'Y') {
|
||||||
dispatch(enableNotification());
|
dispatch(enableNotification());
|
||||||
} else {
|
} else {
|
||||||
dispatch(disableNotification());
|
dispatch(disableNotification());
|
||||||
@@ -425,9 +368,9 @@ export const setMyUpcomingUseAlert = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setMyUpcomingUseAlert onFail ", error);
|
derror('setMyUpcomingUseAlert onFail ', error);
|
||||||
|
|
||||||
if (upcomingAlamUseFlag === "Y") {
|
if (upcomingAlamUseFlag === 'Y') {
|
||||||
dispatch(disableNotification());
|
dispatch(disableNotification());
|
||||||
} else {
|
} else {
|
||||||
dispatch(enableNotification());
|
dispatch(enableNotification());
|
||||||
@@ -437,7 +380,7 @@ export const setMyUpcomingUseAlert = (params) => (dispatch, getState) => {
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_MY_UPCOMING_USE_ALERT,
|
URLS.SET_MY_UPCOMING_USE_ALERT,
|
||||||
{},
|
{},
|
||||||
{ upcomingAlamUseFlag },
|
{ upcomingAlamUseFlag },
|
||||||
@@ -449,7 +392,7 @@ export const setMyUpcomingUseAlert = (params) => (dispatch, getState) => {
|
|||||||
// UpComing Alert 방송 변경 정보 조회 (IF-LGSP-068)
|
// UpComing Alert 방송 변경 정보 조회 (IF-LGSP-068)
|
||||||
export const getUpcomingAlertShowChangeInfo = () => (dispatch, getState) => {
|
export const getUpcomingAlertShowChangeInfo = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getUpcomingAlertShowChangeInfo onSuccess ", response.data);
|
dlog('getUpcomingAlertShowChangeInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_UPCOMING_ALERT_SHOW_CHANGE_INFO,
|
type: types.GET_UPCOMING_ALERT_SHOW_CHANGE_INFO,
|
||||||
@@ -458,13 +401,13 @@ export const getUpcomingAlertShowChangeInfo = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getUpcomingAlertShowChangeInfo onFail ", error);
|
derror('getUpcomingAlertShowChangeInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_UPCOMING_ALERT_SHOW_CHANGE_INFO,
|
URLS.GET_UPCOMING_ALERT_SHOW_CHANGE_INFO,
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
@@ -478,7 +421,7 @@ export const getMyRecentlyViewedInfo = (params) => (dispatch, getState) => {
|
|||||||
const { showList, productList } = params;
|
const { showList, productList } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyRecentlyViewedInfo onSuccess ", response.data);
|
dlog('getMyRecentlyViewedInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_RECENTLY_VIEWED_INFO,
|
type: types.GET_MY_RECENTLY_VIEWED_INFO,
|
||||||
@@ -488,13 +431,13 @@ export const getMyRecentlyViewedInfo = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyRecentlyViewedInfo onFail ", error);
|
derror('getMyRecentlyViewedInfo onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.GET_MY_RECENTLY_VIEWED_INFO,
|
URLS.GET_MY_RECENTLY_VIEWED_INFO,
|
||||||
{},
|
{},
|
||||||
{ showList, productList },
|
{ showList, productList },
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from "./commonActions";
|
import { changeAppStatus } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// On Sale 조회 IF-LGSP-086 (Home)
|
// On Sale 조회 IF-LGSP-086 (Home)
|
||||||
export const getHomeOnSaleInfo = (props) => (dispatch, getState) => {
|
export const getHomeOnSaleInfo = (props) => (dispatch, getState) => {
|
||||||
const { categoryIncFlag, homeSaleInfosIncFlag, lgCatCd, saleInfosIncFlag } =
|
const { categoryIncFlag, homeSaleInfosIncFlag, lgCatCd, saleInfosIncFlag } = props;
|
||||||
props;
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getHomeOnSaleInfo onSuccess ", response.data);
|
dlog('getHomeOnSaleInfo onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_HOME_ON_SALE_INFO,
|
type: types.GET_HOME_ON_SALE_INFO,
|
||||||
@@ -21,14 +25,14 @@ export const getHomeOnSaleInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getHomeOnSaleInfo onFail", error);
|
derror('getHomeOnSaleInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_ON_SALE_INFO,
|
URLS.GET_ON_SALE_INFO,
|
||||||
{ categoryIncFlag, homeSaleInfosIncFlag, lgCatCd, saleInfosIncFlag },
|
{ categoryIncFlag, homeSaleInfosIncFlag, lgCatCd, saleInfosIncFlag },
|
||||||
{},
|
{},
|
||||||
@@ -41,10 +45,10 @@ export const getHomeOnSaleInfo = (props) => (dispatch, getState) => {
|
|||||||
export const getOnSaleInfo = (props) => (dispatch, getState) => {
|
export const getOnSaleInfo = (props) => (dispatch, getState) => {
|
||||||
const { categoryIncFlag, lgCatCd, saleInfosIncFlag } = props;
|
const { categoryIncFlag, lgCatCd, saleInfosIncFlag } = props;
|
||||||
|
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getOnSaleInfo onSuccess ", response.data);
|
dlog('getOnSaleInfo onSuccess ', response.data);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_ON_SALE_INFO,
|
type: types.GET_ON_SALE_INFO,
|
||||||
@@ -55,14 +59,14 @@ export const getOnSaleInfo = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getOnSaleInfo onFail", error);
|
derror('getOnSaleInfo onFail', error);
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_ON_SALE_INFO,
|
URLS.GET_ON_SALE_INFO,
|
||||||
{ categoryIncFlag, lgCatCd, saleInfosIncFlag },
|
{ categoryIncFlag, lgCatCd, saleInfosIncFlag },
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
import axios from "axios";
|
import axios from 'axios';
|
||||||
|
|
||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { GET_MY_INFO_ORDER_SEARCH_LIMIT } from "../utils/Config";
|
import { GET_MY_INFO_ORDER_SEARCH_LIMIT } from '../utils/Config';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus, getTermsAgreeYn } from "./commonActions";
|
import { changeAppStatus, getTermsAgreeYn } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 회원 주문 정보 조회 (IF-LGSP-340)
|
// 회원 주문 정보 조회 (IF-LGSP-340)
|
||||||
let getMyinfoOrderSearchKey = null;
|
let getMyinfoOrderSearchKey = null;
|
||||||
@@ -30,14 +35,12 @@ export const getMyinfoOrderSearch =
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
dispatch(
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
||||||
changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let currentKey = key;
|
let currentKey = key;
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyinfoOrderSearch onSuccess ", response.data);
|
dlog('getMyinfoOrderSearch onSuccess ', response.data);
|
||||||
|
|
||||||
if (orderInfoDataIdx === 1) {
|
if (orderInfoDataIdx === 1) {
|
||||||
getMyinfoOrderSearchKey = new Date();
|
getMyinfoOrderSearchKey = new Date();
|
||||||
@@ -69,7 +72,7 @@ export const getMyinfoOrderSearch =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyinfoOrderSearch onFail ", error);
|
derror('getMyinfoOrderSearch onFail ', error);
|
||||||
if (loading) {
|
if (loading) {
|
||||||
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
||||||
}
|
}
|
||||||
@@ -81,7 +84,7 @@ export const getMyinfoOrderSearch =
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_ORDER_SEARCH,
|
URLS.GET_MY_INFO_ORDER_SEARCH,
|
||||||
{
|
{
|
||||||
mbrNo,
|
mbrNo,
|
||||||
@@ -101,7 +104,7 @@ export const continueGetMyinfoOrderSearch =
|
|||||||
(dispatch, getState) => {
|
(dispatch, getState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const orderSearchParams = state.order.orderSearchParams;
|
const orderSearchParams = state.order.orderSearchParams;
|
||||||
const isCancelOrder = orderSearchParams.cancelOrderYn === "Y";
|
const isCancelOrder = orderSearchParams.cancelOrderYn === 'Y';
|
||||||
const orderInfoData = isCancelOrder
|
const orderInfoData = isCancelOrder
|
||||||
? state.order.cancelOrderInfoData
|
? state.order.cancelOrderInfoData
|
||||||
: state.order.orderInfoData;
|
: state.order.orderInfoData;
|
||||||
@@ -133,12 +136,11 @@ const clearMyinfoOrderSearch = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 회원 주문 상세 정보 조회 (IF-LGSP-341)
|
// 회원 주문 상세 정보 조회 (IF-LGSP-341)
|
||||||
export const getMyinfoOrderDetailSearch =
|
export const getMyinfoOrderDetailSearch = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { mbrNo, ordNo, prdtId } = params;
|
const { mbrNo, ordNo, prdtId } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyinfoOrderDetailSearch onSuccess ", response.data);
|
dlog('getMyinfoOrderDetailSearch onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
type: types.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
||||||
@@ -149,13 +151,13 @@ export const getMyinfoOrderDetailSearch =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyinfoOrderDetailSearch onFail ", error);
|
derror('getMyinfoOrderDetailSearch onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
URLS.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
||||||
{ mbrNo, ordNo, prdtId },
|
{ mbrNo, ordNo, prdtId },
|
||||||
{},
|
{},
|
||||||
@@ -164,12 +166,11 @@ export const getMyinfoOrderDetailSearch =
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getMyinfoOrderShippingSearch =
|
export const getMyinfoOrderShippingSearch = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { mbrNo, ordNo, patnrId, prdtId, prodSno } = params;
|
const { mbrNo, ordNo, patnrId, prdtId, prodSno } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyinfoOrderShippingSearch onSuccess ", response.data);
|
dlog('getMyinfoOrderShippingSearch onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
type: types.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
||||||
@@ -180,13 +181,13 @@ export const getMyinfoOrderShippingSearch =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyinfoOrderShippingSearch onFail ", error);
|
derror('getMyinfoOrderShippingSearch onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
URLS.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
||||||
{ mbrNo, ordNo, patnrId, prdtId, prodSno },
|
{ mbrNo, ordNo, patnrId, prdtId, prodSno },
|
||||||
{},
|
{},
|
||||||
@@ -200,7 +201,7 @@ export const setPurchaseTermsAgree = (params) => (dispatch, getState) => {
|
|||||||
const { mbrNo, termsList } = params;
|
const { mbrNo, termsList } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setPurchaseTermsAgree onSuccess ", response.data);
|
dlog('setPurchaseTermsAgree onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_PURCHASE_TERMS_AGREE,
|
type: types.SET_PURCHASE_TERMS_AGREE,
|
||||||
@@ -212,13 +213,13 @@ export const setPurchaseTermsAgree = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setPurchaseTermsAgree onFail ", error);
|
derror('setPurchaseTermsAgree onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_PURCHASE_TERMS_AGREE,
|
URLS.SET_PURCHASE_TERMS_AGREE,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, termsList },
|
{ mbrNo, termsList },
|
||||||
@@ -232,7 +233,7 @@ export const setPurchasetermsWithdraw = (params) => (dispatch, getState) => {
|
|||||||
const { mbrNo, termsList } = params;
|
const { mbrNo, termsList } = params;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("setPurchasetermsWithdraw onSuccess ", response.data);
|
dlog('setPurchasetermsWithdraw onSuccess ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.SET_PURCHASE_TERMS_WITHDRAW,
|
type: types.SET_PURCHASE_TERMS_WITHDRAW,
|
||||||
@@ -244,13 +245,13 @@ export const setPurchasetermsWithdraw = (params) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("setPurchasetermsWithdraw onFail ", error);
|
derror('setPurchasetermsWithdraw onFail ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"post",
|
'post',
|
||||||
URLS.SET_PURCHASE_TERMS_WITHDRAW,
|
URLS.SET_PURCHASE_TERMS_WITHDRAW,
|
||||||
{},
|
{},
|
||||||
{ mbrNo, termsList },
|
{ mbrNo, termsList },
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import Spotlight from '@enact/spotlight';
|
|||||||
import { getContainerId } from '@enact/spotlight/src/container';
|
import { getContainerId } from '@enact/spotlight/src/container';
|
||||||
import { panel_names } from '../utils/Config';
|
import { panel_names } from '../utils/Config';
|
||||||
import { updateHomeInfo } from './homeActions';
|
import { updateHomeInfo } from './homeActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 시작 메뉴 추적을 위한 상수
|
// 시작 메뉴 추적을 위한 상수
|
||||||
export const SOURCE_MENUS = {
|
export const SOURCE_MENUS = {
|
||||||
@@ -95,7 +100,7 @@ export const navigateToDetail = ({
|
|||||||
if (sourceMenu) panelInfo.sourceMenu = sourceMenu;
|
if (sourceMenu) panelInfo.sourceMenu = sourceMenu;
|
||||||
|
|
||||||
// 로깅
|
// 로깅
|
||||||
console.log(`[navigateToDetail] ${sourceMenu || 'unknown'} → DetailPanel`, {
|
dlog(`[navigateToDetail] ${sourceMenu || 'unknown'} → DetailPanel`, {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
curationId,
|
curationId,
|
||||||
@@ -128,11 +133,9 @@ export const navigateToDetail = ({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
// console.log('[TRACE-GRADIENT] 🟢 navigateToDetail set showGradientBackground: true - source:', sourceMenu);
|
// dlog('[TRACE-GRADIENT] 🟢 navigateToDetail set showGradientBackground: true - source:', sourceMenu);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
dlog('[TRACE-GRADIENT] 🔵 navigateToDetail skipped gradient - launchedFromPlayer: true');
|
||||||
'[TRACE-GRADIENT] 🔵 navigateToDetail skipped gradient - launchedFromPlayer: true'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HomePanel Redux 상태에 포커스 스냅샷 저장 (Detail→Home 복귀 시 사용)
|
// HomePanel Redux 상태에 포커스 스냅샷 저장 (Detail→Home 복귀 시 사용)
|
||||||
@@ -542,7 +545,7 @@ export const focusPanel = (panelName, focusTarget) => {
|
|||||||
const state = getState();
|
const state = getState();
|
||||||
const panels = state.panels.panels;
|
const panels = state.panels.panels;
|
||||||
|
|
||||||
console.log('[focusPanel] 포커스 이동 시도', {
|
dlog('[focusPanel] 포커스 이동 시도', {
|
||||||
panelName,
|
panelName,
|
||||||
focusTarget,
|
focusTarget,
|
||||||
currentPanels: panels.map((p) => p.name),
|
currentPanels: panels.map((p) => p.name),
|
||||||
@@ -555,7 +558,7 @@ export const focusPanel = (panelName, focusTarget) => {
|
|||||||
const topPanel = panels[panels.length - 1];
|
const topPanel = panels[panels.length - 1];
|
||||||
|
|
||||||
if (!targetPanel) {
|
if (!targetPanel) {
|
||||||
console.warn(`[focusPanel] ❌ Panel을 찾을 수 없음: ${panelName}`);
|
dwarn(`[focusPanel] ❌ Panel을 찾을 수 없음: ${panelName}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -568,7 +571,7 @@ export const focusPanel = (panelName, focusTarget) => {
|
|||||||
|
|
||||||
if (hasBlockingModalAbove) {
|
if (hasBlockingModalAbove) {
|
||||||
const blockingModal = panelsAboveTarget.find((panel) => panel?.panelInfo?.modal === true);
|
const blockingModal = panelsAboveTarget.find((panel) => panel?.panelInfo?.modal === true);
|
||||||
console.warn(
|
dwarn(
|
||||||
`[focusPanel] ⚠️ 상위에 Modal이 있음. ` +
|
`[focusPanel] ⚠️ 상위에 Modal이 있음. ` +
|
||||||
`${panelName}(${targetPanelIndex}층)에 포커스할 수 없음. ` +
|
`${panelName}(${targetPanelIndex}층)에 포커스할 수 없음. ` +
|
||||||
`상단 Modal: ${blockingModal?.name}(${panelsAboveTarget.indexOf(blockingModal) + targetPanelIndex + 1}층)`
|
`상단 Modal: ${blockingModal?.name}(${panelsAboveTarget.indexOf(blockingModal) + targetPanelIndex + 1}층)`
|
||||||
@@ -576,7 +579,7 @@ export const focusPanel = (panelName, focusTarget) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
dlog(
|
||||||
`[focusPanel] ✅ Panel 위치 확인: ${panelName}(${targetPanelIndex}층), ` +
|
`[focusPanel] ✅ Panel 위치 확인: ${panelName}(${targetPanelIndex}층), ` +
|
||||||
`전체 Panel: ${panels.length}층`
|
`전체 Panel: ${panels.length}층`
|
||||||
);
|
);
|
||||||
@@ -586,18 +589,18 @@ export const focusPanel = (panelName, focusTarget) => {
|
|||||||
const element = document.getElementById(focusTarget);
|
const element = document.getElementById(focusTarget);
|
||||||
|
|
||||||
if (!element) {
|
if (!element) {
|
||||||
console.warn(`[focusPanel] ❌ 요소를 찾을 수 없음: ${focusTarget}`);
|
dwarn(`[focusPanel] ❌ 요소를 찾을 수 없음: ${focusTarget}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.offsetParent === null) {
|
if (element.offsetParent === null) {
|
||||||
console.warn(`[focusPanel] ⚠️ 요소가 숨겨져있음: ${focusTarget}`);
|
dwarn(`[focusPanel] ⚠️ 요소가 숨겨져있음: ${focusTarget}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 포커스 이동
|
// ✅ 포커스 이동
|
||||||
Spotlight.focus(focusTarget);
|
Spotlight.focus(focusTarget);
|
||||||
console.log(`[focusPanel] ✅ 포커스 이동 성공: ${panelName} → ${focusTarget}`);
|
dlog(`[focusPanel] ✅ 포커스 이동 성공: ${panelName} → ${focusTarget}`);
|
||||||
|
|
||||||
// Reducer에 반영
|
// Reducer에 반영
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
@@ -7,6 +7,11 @@
|
|||||||
|
|
||||||
import { pushPanel, updatePanel } from './panelActions';
|
import { pushPanel, updatePanel } from './panelActions';
|
||||||
import { panel_names } from '../utils/Config';
|
import { panel_names } from '../utils/Config';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 상품 클릭 시 순차 네비게이션 (Search → Detail)
|
* 상품 클릭 시 순차 네비게이션 (Search → Detail)
|
||||||
@@ -17,34 +22,32 @@ import { panel_names } from '../utils/Config';
|
|||||||
* @param {Object} additionalInfo - 추가 패널 정보
|
* @param {Object} additionalInfo - 추가 패널 정보
|
||||||
* @returns {Function} Redux thunk function
|
* @returns {Function} Redux thunk function
|
||||||
*/
|
*/
|
||||||
export const navigateToDetailPanel = (
|
export const navigateToDetailPanel =
|
||||||
patnrId,
|
(patnrId, prdtId, searchQuery, currentSpot, additionalInfo = {}) =>
|
||||||
prdtId,
|
(dispatch, getState) => {
|
||||||
searchQuery,
|
|
||||||
currentSpot,
|
|
||||||
additionalInfo = {}
|
|
||||||
) => (dispatch, getState) => {
|
|
||||||
// 현재 상태에서 lastPanelAction 카운트 저장
|
// 현재 상태에서 lastPanelAction 카운트 저장
|
||||||
const currentActionCount = getState().panels.lastPanelAction || 0;
|
const currentActionCount = getState().panels.lastPanelAction || 0;
|
||||||
|
|
||||||
console.log('[PanelNavigation] Starting navigation to detail:', {
|
dlog('[PanelNavigation] Starting navigation to detail:', {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
searchQuery,
|
searchQuery,
|
||||||
currentSpot,
|
currentSpot,
|
||||||
currentActionCount
|
currentActionCount,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 1. 먼저 현재 패널(예: SearchPanel) 업데이트
|
// 1. 먼저 현재 패널(예: SearchPanel) 업데이트
|
||||||
dispatch(updatePanel({
|
dispatch(
|
||||||
|
updatePanel({
|
||||||
name: panel_names.SEARCH_PANEL,
|
name: panel_names.SEARCH_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
searchVal: searchQuery,
|
searchVal: searchQuery,
|
||||||
currentSpot,
|
currentSpot,
|
||||||
tab: 0,
|
tab: 0,
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// 2. Redux store 구독하여 상태 변화 감지
|
// 2. Redux store 구독하여 상태 변화 감지
|
||||||
// 직접 store 접근 대신 타이머 기반 방식 사용 (Chrome 68 호환)
|
// 직접 store 접근 대신 타이머 기반 방식 사용 (Chrome 68 호환)
|
||||||
@@ -59,22 +62,24 @@ export const navigateToDetailPanel = (
|
|||||||
|
|
||||||
// updatePanel이 완료되면 (action count가 변경되면)
|
// updatePanel이 완료되면 (action count가 변경되면)
|
||||||
if (newActionCount !== currentActionCount) {
|
if (newActionCount !== currentActionCount) {
|
||||||
console.log('[PanelNavigation] UpdatePanel completed, pushing DetailPanel');
|
dlog('[PanelNavigation] UpdatePanel completed, pushing DetailPanel');
|
||||||
|
|
||||||
// 구독 해제
|
// 구독 해제
|
||||||
isUnsubscribed = true;
|
isUnsubscribed = true;
|
||||||
|
|
||||||
// 3. DetailPanel push
|
// 3. DetailPanel push
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.DETAIL_PANEL,
|
name: panel_names.DETAIL_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
fromSearch: true,
|
fromSearch: true,
|
||||||
searchQuery,
|
searchQuery,
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,18 +96,20 @@ export const navigateToDetailPanel = (
|
|||||||
// 타임아웃 방어 (최대 1초 대기)
|
// 타임아웃 방어 (최대 1초 대기)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
storeUnsubscribe();
|
storeUnsubscribe();
|
||||||
console.log('[PanelNavigation] Timeout fallback, pushing DetailPanel');
|
dlog('[PanelNavigation] Timeout fallback, pushing DetailPanel');
|
||||||
|
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.DETAIL_PANEL,
|
name: panel_names.DETAIL_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
fromSearch: true,
|
fromSearch: true,
|
||||||
searchQuery,
|
searchQuery,
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -113,26 +120,26 @@ export const navigateToDetailPanel = (
|
|||||||
* @param {Object} additionalInfo - 추가 패널 정보
|
* @param {Object} additionalInfo - 추가 패널 정보
|
||||||
* @returns {Function} Redux thunk function
|
* @returns {Function} Redux thunk function
|
||||||
*/
|
*/
|
||||||
export const navigateToDetailFromHome = (
|
export const navigateToDetailFromHome =
|
||||||
patnrId,
|
(patnrId, prdtId, additionalInfo = {}) =>
|
||||||
prdtId,
|
(dispatch, getState) => {
|
||||||
additionalInfo = {}
|
|
||||||
) => (dispatch, getState) => {
|
|
||||||
const currentActionCount = getState().panels.lastPanelAction || 0;
|
const currentActionCount = getState().panels.lastPanelAction || 0;
|
||||||
|
|
||||||
console.log('[PanelNavigation] Starting navigation from home:', {
|
dlog('[PanelNavigation] Starting navigation from home:', {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
currentActionCount
|
currentActionCount,
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch(updatePanel({
|
dispatch(
|
||||||
|
updatePanel({
|
||||||
name: panel_names.HOME_PANEL,
|
name: panel_names.HOME_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
lastSelectedProduct: { patnrId, prdtId },
|
lastSelectedProduct: { patnrId, prdtId },
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const storeUnsubscribe = (() => {
|
const storeUnsubscribe = (() => {
|
||||||
let isUnsubscribed = false;
|
let isUnsubscribed = false;
|
||||||
@@ -144,18 +151,20 @@ export const navigateToDetailFromHome = (
|
|||||||
const newActionCount = newState.panels.lastPanelAction || 0;
|
const newActionCount = newState.panels.lastPanelAction || 0;
|
||||||
|
|
||||||
if (newActionCount !== currentActionCount) {
|
if (newActionCount !== currentActionCount) {
|
||||||
console.log('[PanelNavigation] HomePanel update completed, pushing DetailPanel');
|
dlog('[PanelNavigation] HomePanel update completed, pushing DetailPanel');
|
||||||
isUnsubscribed = true;
|
isUnsubscribed = true;
|
||||||
|
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.DETAIL_PANEL,
|
name: panel_names.DETAIL_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
fromHome: true,
|
fromHome: true,
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -170,17 +179,19 @@ export const navigateToDetailFromHome = (
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
storeUnsubscribe();
|
storeUnsubscribe();
|
||||||
console.log('[PanelNavigation] Timeout fallback from home');
|
dlog('[PanelNavigation] Timeout fallback from home');
|
||||||
|
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.DETAIL_PANEL,
|
name: panel_names.DETAIL_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
patnrId,
|
patnrId,
|
||||||
prdtId,
|
prdtId,
|
||||||
fromHome: true,
|
fromHome: true,
|
||||||
...additionalInfo
|
...additionalInfo,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -191,18 +202,20 @@ export const navigateToDetailFromHome = (
|
|||||||
export const navigateToJustForYouTestPanel = () => (dispatch, getState) => {
|
export const navigateToJustForYouTestPanel = () => (dispatch, getState) => {
|
||||||
const currentActionCount = getState().panels.lastPanelAction || 0;
|
const currentActionCount = getState().panels.lastPanelAction || 0;
|
||||||
|
|
||||||
console.log('[PanelNavigation] Starting navigation to JustForYouTestPanel:', {
|
dlog('[PanelNavigation] Starting navigation to JustForYouTestPanel:', {
|
||||||
currentActionCount
|
currentActionCount,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 1. 먼저 HomePanel 상태 저장 (필요시)
|
// 1. 먼저 HomePanel 상태 저장 (필요시)
|
||||||
dispatch(updatePanel({
|
dispatch(
|
||||||
|
updatePanel({
|
||||||
name: panel_names.HOME_PANEL,
|
name: panel_names.HOME_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
fromJustForYouBanner: true,
|
fromJustForYouBanner: true,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const storeUnsubscribe = (() => {
|
const storeUnsubscribe = (() => {
|
||||||
let isUnsubscribed = false;
|
let isUnsubscribed = false;
|
||||||
@@ -215,20 +228,22 @@ export const navigateToJustForYouTestPanel = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
// updatePanel이 완료되면
|
// updatePanel이 완료되면
|
||||||
if (newActionCount !== currentActionCount) {
|
if (newActionCount !== currentActionCount) {
|
||||||
console.log('[PanelNavigation] HomePanel update completed, pushing JustForYouTestPanel');
|
dlog('[PanelNavigation] HomePanel update completed, pushing JustForYouTestPanel');
|
||||||
isUnsubscribed = true;
|
isUnsubscribed = true;
|
||||||
|
|
||||||
// 2. JustForYouTestPanel push
|
// 2. JustForYouTestPanel push
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.JUST_FOR_YOU_TEST_PANEL,
|
name: panel_names.JUST_FOR_YOU_TEST_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
fromJustForYouBanner: true
|
fromJustForYouBanner: true,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// 3. JustForYouTestPanel이 렌더링된 후 PlayerPanel 제거
|
// 3. JustForYouTestPanel이 렌더링된 후 PlayerPanel 제거
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('[PanelNavigation] Removing PlayerPanel after JustForYouTestPanel render');
|
dlog('[PanelNavigation] Removing PlayerPanel after JustForYouTestPanel render');
|
||||||
const { finishAllVideoForce } = require('./playActions');
|
const { finishAllVideoForce } = require('./playActions');
|
||||||
dispatch(finishAllVideoForce());
|
dispatch(finishAllVideoForce());
|
||||||
}, 200);
|
}, 200);
|
||||||
@@ -247,18 +262,20 @@ export const navigateToJustForYouTestPanel = () => (dispatch, getState) => {
|
|||||||
// 타임아웃 방어 (최대 1초 대기)
|
// 타임아웃 방어 (최대 1초 대기)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
storeUnsubscribe();
|
storeUnsubscribe();
|
||||||
console.log('[PanelNavigation] Timeout fallback, pushing JustForYouTestPanel');
|
dlog('[PanelNavigation] Timeout fallback, pushing JustForYouTestPanel');
|
||||||
|
|
||||||
dispatch(pushPanel({
|
dispatch(
|
||||||
|
pushPanel({
|
||||||
name: panel_names.JUST_FOR_YOU_TEST_PANEL,
|
name: panel_names.JUST_FOR_YOU_TEST_PANEL,
|
||||||
panelInfo: {
|
panelInfo: {
|
||||||
fromJustForYouBanner: true
|
fromJustForYouBanner: true,
|
||||||
}
|
},
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// fallback으로도 PlayerPanel 제거
|
// fallback으로도 PlayerPanel 제거
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('[PanelNavigation] Fallback: removing PlayerPanel');
|
dlog('[PanelNavigation] Fallback: removing PlayerPanel');
|
||||||
const { finishAllVideoForce } = require('./playActions');
|
const { finishAllVideoForce } = require('./playActions');
|
||||||
dispatch(finishAllVideoForce());
|
dispatch(finishAllVideoForce());
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|||||||
@@ -1,21 +1,25 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from "./commonActions";
|
import { changeAppStatus } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 회원 등록카드 PIN CODE 입력 체크 IF-LGSP-336
|
// 회원 등록카드 PIN CODE 입력 체크 IF-LGSP-336
|
||||||
export const getMyInfoCardPincodeCheck =
|
export const getMyInfoCardPincodeCheck = (params, callback) => (dispatch, getState) => {
|
||||||
(params, callback) => (dispatch, getState) => {
|
|
||||||
const { mbrNo, pinCd } = params;
|
const { mbrNo, pinCd } = params;
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
changeAppStatus({
|
changeAppStatus({
|
||||||
showLoadingPanel: { show: true, type: "wait", showMessage: true },
|
showLoadingPanel: { show: true, type: 'wait', showMessage: true },
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getMyInfoCardPincodeCheck onSuccess ", response);
|
dlog('getMyInfoCardPincodeCheck onSuccess ', response);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_CARD_PINCODE_CHECK,
|
type: types.GET_MY_INFO_CARD_PINCODE_CHECK,
|
||||||
@@ -36,7 +40,7 @@ export const getMyInfoCardPincodeCheck =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getMyInfoCardPincodeCheck onFail ", error);
|
derror('getMyInfoCardPincodeCheck onFail ', error);
|
||||||
dispatch(
|
dispatch(
|
||||||
changeAppStatus({
|
changeAppStatus({
|
||||||
showLoadingPanel: { show: false, showMessage: false },
|
showLoadingPanel: { show: false, showMessage: false },
|
||||||
@@ -47,7 +51,7 @@ export const getMyInfoCardPincodeCheck =
|
|||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_CARD_PINCODE_CHECK,
|
URLS.GET_MY_INFO_CARD_PINCODE_CHECK,
|
||||||
{ mbrNo, pinCd },
|
{ mbrNo, pinCd },
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -5,15 +5,13 @@ import { changeAppStatus } from './commonActions';
|
|||||||
import { reduce, set, get } from '../utils/fp';
|
import { reduce, set, get } from '../utils/fp';
|
||||||
import { createDebugHelpers } from '../utils/debug';
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// CustomerImages용 리뷰 이미지 import
|
// CustomerImages용 리뷰 이미지 import
|
||||||
import reviewSampleImage from '../../assets/images/image-review-sample-1.png';
|
import reviewSampleImage from '../../assets/images/image-review-sample-1.png';
|
||||||
|
|
||||||
// DEBUG_MODE - true인 경우에만 로그 출력
|
|
||||||
const DEBUG_MODE = false;
|
|
||||||
|
|
||||||
// 이 파일의 DEBUG_MODE를 사용하여 헬퍼 생성
|
|
||||||
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
|
||||||
|
|
||||||
// Best Seller 상품 목록 조회 IF-LGSP-303
|
// Best Seller 상품 목록 조회 IF-LGSP-303
|
||||||
// FP helpers
|
// FP helpers
|
||||||
const pickParams = (keys) => (src) =>
|
const pickParams = (keys) => (src) =>
|
||||||
@@ -167,7 +165,7 @@ export const getProductOption = createGetThunk({
|
|||||||
//
|
//
|
||||||
// return apiData;
|
// return apiData;
|
||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// console.error('[UserReviews] ❌ extractReviewApiData 에러:', error);
|
// derror('[UserReviews] ❌ extractReviewApiData 에러:', error);
|
||||||
// return null;
|
// return null;
|
||||||
// }
|
// }
|
||||||
// };
|
// };
|
||||||
@@ -176,11 +174,11 @@ export const getProductOption = createGetThunk({
|
|||||||
// IF-LGSP-101용 API 응답에서 reviewList + reviewDetail 추출
|
// IF-LGSP-101용 API 응답에서 reviewList + reviewDetail 추출
|
||||||
const extractReviewListApiData = (apiResponse) => {
|
const extractReviewListApiData = (apiResponse) => {
|
||||||
try {
|
try {
|
||||||
// console.log('[UserReviewList] 📥 extractReviewListApiData 호출 - 원본 응답:', apiResponse);
|
// dlog('[UserReviewList] 📥 extractReviewListApiData 호출 - 원본 응답:', apiResponse);
|
||||||
|
|
||||||
// ⭐ 핵심: retCode가 0인지 먼저 확인 (HTTP 200이어도 API 에러일 수 있음)
|
// ⭐ 핵심: retCode가 0인지 먼저 확인 (HTTP 200이어도 API 에러일 수 있음)
|
||||||
if (apiResponse && apiResponse.retCode !== 0) {
|
if (apiResponse && apiResponse.retCode !== 0) {
|
||||||
// console.error('[UserReviewList] ❌ API 에러 - retCode !== 0:', {
|
// derror('[UserReviewList] ❌ API 에러 - retCode !== 0:', {
|
||||||
// retCode: apiResponse.retCode,
|
// retCode: apiResponse.retCode,
|
||||||
// retMsg: apiResponse.retMsg,
|
// retMsg: apiResponse.retMsg,
|
||||||
// fullResponse: apiResponse
|
// fullResponse: apiResponse
|
||||||
@@ -206,7 +204,7 @@ const extractReviewListApiData = (apiResponse) => {
|
|||||||
reviewList.length === 0
|
reviewList.length === 0
|
||||||
) {
|
) {
|
||||||
reviewList = reviewDetail.reviewList;
|
reviewList = reviewDetail.reviewList;
|
||||||
// console.log('[UserReviewList] 🔄 reviewDetail.reviewList에서 데이터 추출됨');
|
// dlog('[UserReviewList] 🔄 reviewDetail.reviewList에서 데이터 추출됨');
|
||||||
}
|
}
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
@@ -214,7 +212,7 @@ const extractReviewListApiData = (apiResponse) => {
|
|||||||
reviewDetail: reviewDetail,
|
reviewDetail: reviewDetail,
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log('[UserReviewList] 📊 apiResponse.data 경로에서 추출:', {
|
// dlog('[UserReviewList] 📊 apiResponse.data 경로에서 추출:', {
|
||||||
// reviewListLength: data.reviewList.length,
|
// reviewListLength: data.reviewList.length,
|
||||||
// reviewDetailKeys: Object.keys(data.reviewDetail),
|
// reviewDetailKeys: Object.keys(data.reviewDetail),
|
||||||
// reviewDetail: data.reviewDetail,
|
// reviewDetail: data.reviewDetail,
|
||||||
@@ -232,7 +230,7 @@ const extractReviewListApiData = (apiResponse) => {
|
|||||||
reviewList.length === 0
|
reviewList.length === 0
|
||||||
) {
|
) {
|
||||||
reviewList = reviewDetail.reviewList;
|
reviewList = reviewDetail.reviewList;
|
||||||
// console.log('[UserReviewList] 🔄 reviewDetail.reviewList에서 데이터 추출됨');
|
// dlog('[UserReviewList] 🔄 reviewDetail.reviewList에서 데이터 추출됨');
|
||||||
}
|
}
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
@@ -240,7 +238,7 @@ const extractReviewListApiData = (apiResponse) => {
|
|||||||
reviewDetail: reviewDetail,
|
reviewDetail: reviewDetail,
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log('[UserReviewList] 📊 직접 경로에서 추출:', {
|
// dlog('[UserReviewList] 📊 직접 경로에서 추출:', {
|
||||||
// reviewListLength: data.reviewList.length,
|
// reviewListLength: data.reviewList.length,
|
||||||
// reviewDetailKeys: Object.keys(data.reviewDetail),
|
// reviewDetailKeys: Object.keys(data.reviewDetail),
|
||||||
// reviewDetail: data.reviewDetail,
|
// reviewDetail: data.reviewDetail,
|
||||||
@@ -249,18 +247,18 @@ const extractReviewListApiData = (apiResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!data || (!data.reviewList && !data.reviewDetail)) {
|
if (!data || (!data.reviewList && !data.reviewDetail)) {
|
||||||
// console.warn('[UserReviewList] ⚠️ reviewList와 reviewDetail 모두 없음:', apiResponse);
|
// dwarn('[UserReviewList] ⚠️ reviewList와 reviewDetail 모두 없음:', apiResponse);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('[UserReviewList] ✅ 추출 완료:', {
|
// dlog('[UserReviewList] ✅ 추출 완료:', {
|
||||||
// reviewListLength: data.reviewList.length,
|
// reviewListLength: data.reviewList.length,
|
||||||
// reviewDetail: data.reviewDetail
|
// reviewDetail: data.reviewDetail
|
||||||
// });
|
// });
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.error('[UserReviewList] ❌ extractReviewListApiData 에러:', error);
|
// derror('[UserReviewList] ❌ extractReviewListApiData 에러:', error);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -397,7 +395,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
pageSize = 100, // 최대값으로 설정하여 페이징 횟수 최소화
|
pageSize = 100, // 최대값으로 설정하여 페이징 횟수 최소화
|
||||||
} = requestParams;
|
} = requestParams;
|
||||||
|
|
||||||
// console.log('[UserReviewList] 🚀 순차 페이징 시작:', {
|
// dlog('[UserReviewList] 🚀 순차 페이징 시작:', {
|
||||||
// prdtId,
|
// prdtId,
|
||||||
// patnrId,
|
// patnrId,
|
||||||
// filterTpCd,
|
// filterTpCd,
|
||||||
@@ -427,7 +425,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
// filterTpCd가 'ALL'이 아니면 filterTpVal 추가
|
// filterTpCd가 'ALL'이 아니면 filterTpVal 추가
|
||||||
if (filterTpCd !== 'ALL') {
|
if (filterTpCd !== 'ALL') {
|
||||||
if (!filterTpVal) {
|
if (!filterTpVal) {
|
||||||
// console.warn('[UserReviewList] ⚠️ filterTpCd가 ALL이 아니면 filterTpVal은 필수입니다');
|
// dwarn('[UserReviewList] ⚠️ filterTpCd가 ALL이 아니면 filterTpVal은 필수입니다');
|
||||||
}
|
}
|
||||||
params.filterTpVal = filterTpVal;
|
params.filterTpVal = filterTpVal;
|
||||||
}
|
}
|
||||||
@@ -436,7 +434,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
// ⭐ 타임아웃 추가: TAxios의 콜백이 호출되지 않는 경우를 대비 (모든 오류 상황 처리)
|
// ⭐ 타임아웃 추가: TAxios의 콜백이 호출되지 않는 경우를 대비 (모든 오류 상황 처리)
|
||||||
const REQUEST_TIMEOUT = 5000; // 5초 타임아웃 (재인증, 팝업 등 오류 상황 처리 포함)
|
const REQUEST_TIMEOUT = 5000; // 5초 타임아웃 (재인증, 팝업 등 오류 상황 처리 포함)
|
||||||
|
|
||||||
// console.log(`[UserReviewList] 🔄 API 요청 시작 (page ${pageNo}):`, {
|
// dlog(`[UserReviewList] 🔄 API 요청 시작 (page ${pageNo}):`, {
|
||||||
// prdtId,
|
// prdtId,
|
||||||
// patnrId,
|
// patnrId,
|
||||||
// filterTpCd,
|
// filterTpCd,
|
||||||
@@ -450,12 +448,12 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
|
|
||||||
const onSuccess = (res) => {
|
const onSuccess = (res) => {
|
||||||
if (callbackCalled) {
|
if (callbackCalled) {
|
||||||
// console.warn(`[UserReviewList] ⚠️ onSuccess 중복 호출 (page ${pageNo})`);
|
// dwarn(`[UserReviewList] ⚠️ onSuccess 중복 호출 (page ${pageNo})`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
callbackCalled = true;
|
callbackCalled = true;
|
||||||
|
|
||||||
// console.log(`[UserReviewList] ✅ API 응답 수신 (page ${pageNo}):`, {
|
// dlog(`[UserReviewList] ✅ API 응답 수신 (page ${pageNo}):`, {
|
||||||
// status: res?.status,
|
// status: res?.status,
|
||||||
// statusText: res?.statusText,
|
// statusText: res?.statusText,
|
||||||
// retCode: res?.data?.retCode,
|
// retCode: res?.data?.retCode,
|
||||||
@@ -467,12 +465,12 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
|
|
||||||
const onFail = (err) => {
|
const onFail = (err) => {
|
||||||
if (callbackCalled) {
|
if (callbackCalled) {
|
||||||
// console.warn(`[UserReviewList] ⚠️ onFail 중복 호출 (page ${pageNo})`);
|
// dwarn(`[UserReviewList] ⚠️ onFail 중복 호출 (page ${pageNo})`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
callbackCalled = true;
|
callbackCalled = true;
|
||||||
|
|
||||||
// console.error(`[UserReviewList] ❌ API 콜백 에러 발생 (page ${pageNo}):`, {
|
// derror(`[UserReviewList] ❌ API 콜백 에러 발생 (page ${pageNo}):`, {
|
||||||
// errorMessage: err?.message,
|
// errorMessage: err?.message,
|
||||||
// errorStatus: err?.response?.status,
|
// errorStatus: err?.response?.status,
|
||||||
// errorStatusText: err?.response?.statusText,
|
// errorStatusText: err?.response?.statusText,
|
||||||
@@ -484,7 +482,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
// API 호출
|
// API 호출
|
||||||
// console.log(`[UserReviewList] 📡 TAxios 호출 (page ${pageNo})`);
|
// dlog(`[UserReviewList] 📡 TAxios 호출 (page ${pageNo})`);
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
@@ -500,7 +498,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
new Promise((_, reject) =>
|
new Promise((_, reject) =>
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const timeoutError = new Error(`API request timeout without callback (page ${pageNo})`);
|
const timeoutError = new Error(`API request timeout without callback (page ${pageNo})`);
|
||||||
// console.error(`[UserReviewList] ⏱️ API 응답 타임아웃 (page ${pageNo}):`, {
|
// derror(`[UserReviewList] ⏱️ API 응답 타임아웃 (page ${pageNo}):`, {
|
||||||
// timeout: REQUEST_TIMEOUT,
|
// timeout: REQUEST_TIMEOUT,
|
||||||
// prdtId,
|
// prdtId,
|
||||||
// patnrId,
|
// patnrId,
|
||||||
@@ -515,7 +513,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
// ⭐ 핵심: HTTP 200이어도 response.data.retCode를 반드시 확인해야 함
|
// ⭐ 핵심: HTTP 200이어도 response.data.retCode를 반드시 확인해야 함
|
||||||
const retCode = response?.data?.retCode;
|
const retCode = response?.data?.retCode;
|
||||||
|
|
||||||
// console.log(`[UserReviewList] 📄 페이지 ${pageNo} 응답 상태 확인:`, {
|
// dlog(`[UserReviewList] 📄 페이지 ${pageNo} 응답 상태 확인:`, {
|
||||||
// pageNo,
|
// pageNo,
|
||||||
// httpStatus: response?.status,
|
// httpStatus: response?.status,
|
||||||
// retCode: retCode,
|
// retCode: retCode,
|
||||||
@@ -526,7 +524,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
|
|
||||||
// retCode가 0이 아니면 API 에러 (HTTP 200이어도 실제 데이터 없을 수 있음)
|
// retCode가 0이 아니면 API 에러 (HTTP 200이어도 실제 데이터 없을 수 있음)
|
||||||
if (retCode !== 0) {
|
if (retCode !== 0) {
|
||||||
// console.error(`[UserReviewList] ❌ API 에러 - retCode !== 0 (page ${pageNo}):`, {
|
// derror(`[UserReviewList] ❌ API 에러 - retCode !== 0 (page ${pageNo}):`, {
|
||||||
// retCode,
|
// retCode,
|
||||||
// retMsg: response?.data?.retMsg,
|
// retMsg: response?.data?.retMsg,
|
||||||
// pageNo,
|
// pageNo,
|
||||||
@@ -540,7 +538,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
const reviewData = extractReviewListApiData(response.data);
|
const reviewData = extractReviewListApiData(response.data);
|
||||||
|
|
||||||
if (!reviewData || !reviewData.reviewList) {
|
if (!reviewData || !reviewData.reviewList) {
|
||||||
// console.warn('[UserReviewList] ⚠️ 리뷰 데이터 추출 실패, 페이징 종료');
|
// dwarn('[UserReviewList] ⚠️ 리뷰 데이터 추출 실패, 페이징 종료');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,7 +550,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
// 5. 현재 페이지의 리뷰들을 전체 리스트에 추가
|
// 5. 현재 페이지의 리뷰들을 전체 리스트에 추가
|
||||||
allReviews = allReviews.concat(reviewData.reviewList);
|
allReviews = allReviews.concat(reviewData.reviewList);
|
||||||
|
|
||||||
// console.log(`[UserReviewList] ✅ 페이지 ${pageNo} 수집 완료:`, {
|
// dlog(`[UserReviewList] ✅ 페이지 ${pageNo} 수집 완료:`, {
|
||||||
// pageNo,
|
// pageNo,
|
||||||
// currentPageCount: reviewData.reviewList.length,
|
// currentPageCount: reviewData.reviewList.length,
|
||||||
// totalCollected: allReviews.length,
|
// totalCollected: allReviews.length,
|
||||||
@@ -567,7 +565,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
|
|
||||||
if (receivedCount < pageSize || allReviews.length >= totalReviews) {
|
if (receivedCount < pageSize || allReviews.length >= totalReviews) {
|
||||||
hasMore = false;
|
hasMore = false;
|
||||||
// console.log('[UserReviewList] 📊 페이징 종료:', {
|
// dlog('[UserReviewList] 📊 페이징 종료:', {
|
||||||
// reason: receivedCount < pageSize ? '받은 개수 < pageSize' : '수집된 개수 >= 총 개수',
|
// reason: receivedCount < pageSize ? '받은 개수 < pageSize' : '수집된 개수 >= 총 개수',
|
||||||
// receivedCount,
|
// receivedCount,
|
||||||
// pageSize,
|
// pageSize,
|
||||||
@@ -580,7 +578,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 7. 모든 리뷰 수집 완료, Redux에 디스패치
|
// 7. 모든 리뷰 수집 완료, Redux에 디스패치
|
||||||
// console.log('[UserReviewList] 🎉 모든 리뷰 수집 완료:', {
|
// dlog('[UserReviewList] 🎉 모든 리뷰 수집 완료:', {
|
||||||
// totalCollected: allReviews.length,
|
// totalCollected: allReviews.length,
|
||||||
// totRvwCnt: currentReviewDetail?.totRvwCnt,
|
// totRvwCnt: currentReviewDetail?.totRvwCnt,
|
||||||
// pages: pageNo - 1
|
// pages: pageNo - 1
|
||||||
@@ -602,7 +600,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
payload: finalPayload,
|
payload: finalPayload,
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log('[UserReviewList] 📦 Redux 디스패치:', {
|
// dlog('[UserReviewList] 📦 Redux 디스패치:', {
|
||||||
// actionType,
|
// actionType,
|
||||||
// totalReviews: allReviews.length,
|
// totalReviews: allReviews.length,
|
||||||
// totRvwCnt: currentReviewDetail?.totRvwCnt,
|
// totRvwCnt: currentReviewDetail?.totRvwCnt,
|
||||||
@@ -620,7 +618,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
const apiRetCode = error?.response?.data?.retCode;
|
const apiRetCode = error?.response?.data?.retCode;
|
||||||
const apiRetMsg = error?.response?.data?.retMsg;
|
const apiRetMsg = error?.response?.data?.retMsg;
|
||||||
|
|
||||||
// console.error('[fetchAllReviewsWithSequentialPaging] ❌ 에러 발생:', {
|
// derror('[fetchAllReviewsWithSequentialPaging] ❌ 에러 발생:', {
|
||||||
// errorMessage: errorMessage,
|
// errorMessage: errorMessage,
|
||||||
// errorType: typeof error,
|
// errorType: typeof error,
|
||||||
// httpStatus: httpStatus,
|
// httpStatus: httpStatus,
|
||||||
@@ -638,7 +636,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
const isTimeoutError =
|
const isTimeoutError =
|
||||||
errorMessage.includes('timeout') || errorMessage.includes('without callback');
|
errorMessage.includes('timeout') || errorMessage.includes('without callback');
|
||||||
if (isTimeoutError && retryCount < MAX_RETRIES) {
|
if (isTimeoutError && retryCount < MAX_RETRIES) {
|
||||||
// console.log(`[fetchAllReviewsWithSequentialPaging] 🔄 타임아웃으로 인한 재시도 (${retryCount + 1}/${MAX_RETRIES}):`, {
|
// dlog(`[fetchAllReviewsWithSequentialPaging] 🔄 타임아웃으로 인한 재시도 (${retryCount + 1}/${MAX_RETRIES}):`, {
|
||||||
// prdtId,
|
// prdtId,
|
||||||
// patnrId,
|
// patnrId,
|
||||||
// pageNo,
|
// pageNo,
|
||||||
@@ -663,7 +661,7 @@ const fetchAllReviewsWithSequentialPaging = async (
|
|||||||
export const getUserReviewList = (requestParams) => async (dispatch, getState) => {
|
export const getUserReviewList = (requestParams) => async (dispatch, getState) => {
|
||||||
const { prdtId, patnrId, filterTpCd = 'ALL', filterTpVal } = requestParams;
|
const { prdtId, patnrId, filterTpCd = 'ALL', filterTpVal } = requestParams;
|
||||||
|
|
||||||
// console.log('[getUserReviewList] 🚀 getUserReviewList 호출됨 (순차 페이징 사용):', {
|
// dlog('[getUserReviewList] 🚀 getUserReviewList 호출됨 (순차 페이징 사용):', {
|
||||||
// prdtId,
|
// prdtId,
|
||||||
// patnrId,
|
// patnrId,
|
||||||
// filterTpCd,
|
// filterTpCd,
|
||||||
@@ -675,7 +673,7 @@ export const getUserReviewList = (requestParams) => async (dispatch, getState) =
|
|||||||
// fetchAllReviewsWithSequentialPaging 함수를 호출하여 모든 리뷰 수집
|
// fetchAllReviewsWithSequentialPaging 함수를 호출하여 모든 리뷰 수집
|
||||||
const result = await fetchAllReviewsWithSequentialPaging(dispatch, getState, requestParams);
|
const result = await fetchAllReviewsWithSequentialPaging(dispatch, getState, requestParams);
|
||||||
|
|
||||||
// console.log('[getUserReviewList] ✅ 모든 리뷰 수집 완료:', {
|
// dlog('[getUserReviewList] ✅ 모든 리뷰 수집 완료:', {
|
||||||
// totalReviews: result.reviewList.length,
|
// totalReviews: result.reviewList.length,
|
||||||
// totRvwCnt: result.reviewDetail?.totRvwCnt,
|
// totRvwCnt: result.reviewDetail?.totRvwCnt,
|
||||||
// prdtId,
|
// prdtId,
|
||||||
@@ -690,7 +688,7 @@ export const getUserReviewList = (requestParams) => async (dispatch, getState) =
|
|||||||
const apiRetCode = error?.response?.data?.retCode;
|
const apiRetCode = error?.response?.data?.retCode;
|
||||||
const apiRetMsg = error?.response?.data?.retMsg;
|
const apiRetMsg = error?.response?.data?.retMsg;
|
||||||
|
|
||||||
// console.error('[getUserReviewList] ❌ 순차 페이징 중 에러 발생:', {
|
// derror('[getUserReviewList] ❌ 순차 페이징 중 에러 발생:', {
|
||||||
// errorMessage: errorMessage,
|
// errorMessage: errorMessage,
|
||||||
// errorType: typeof error,
|
// errorType: typeof error,
|
||||||
// httpStatus: httpStatus,
|
// httpStatus: httpStatus,
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [251106] 큐 기반 패널 액션들
|
* [251106] 큐 기반 패널 액션들
|
||||||
@@ -26,8 +31,8 @@ export const pushPanelQueued = (panel, duplicatable = false) => ({
|
|||||||
action: 'PUSH_PANEL',
|
action: 'PUSH_PANEL',
|
||||||
panel,
|
panel,
|
||||||
duplicatable,
|
duplicatable,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,8 +46,8 @@ export const popPanelQueued = (panelName = null) => ({
|
|||||||
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
||||||
action: 'POP_PANEL',
|
action: 'POP_PANEL',
|
||||||
panelName,
|
panelName,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,8 +61,8 @@ export const updatePanelQueued = (panelInfo) => ({
|
|||||||
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
||||||
action: 'UPDATE_PANEL',
|
action: 'UPDATE_PANEL',
|
||||||
panelInfo,
|
panelInfo,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,8 +76,8 @@ export const resetPanelsQueued = (panels = null) => ({
|
|||||||
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
id: `queue_item_${++queueItemId}_${Date.now()}`,
|
||||||
action: 'RESET_PANELS',
|
action: 'RESET_PANELS',
|
||||||
panels,
|
panels,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,8 +87,8 @@ export const resetPanelsQueued = (panels = null) => ({
|
|||||||
export const clearPanelQueue = () => ({
|
export const clearPanelQueue = () => ({
|
||||||
type: types.CLEAR_PANEL_QUEUE,
|
type: types.CLEAR_PANEL_QUEUE,
|
||||||
payload: {
|
payload: {
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,8 +99,8 @@ export const clearPanelQueue = () => ({
|
|||||||
export const processPanelQueue = () => ({
|
export const processPanelQueue = () => ({
|
||||||
type: types.PROCESS_PANEL_QUEUE,
|
type: types.PROCESS_PANEL_QUEUE,
|
||||||
payload: {
|
payload: {
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,8 +113,8 @@ export const setQueueProcessing = (isProcessing) => ({
|
|||||||
type: types.SET_QUEUE_PROCESSING,
|
type: types.SET_QUEUE_PROCESSING,
|
||||||
payload: {
|
payload: {
|
||||||
isProcessing,
|
isProcessing,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,7 +124,7 @@ export const setQueueProcessing = (isProcessing) => ({
|
|||||||
*/
|
*/
|
||||||
export const enqueueMultiplePanelActions = (actions) => {
|
export const enqueueMultiplePanelActions = (actions) => {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
actions.forEach(action => {
|
actions.forEach((action) => {
|
||||||
dispatch(action);
|
dispatch(action);
|
||||||
});
|
});
|
||||||
// 마지막에 큐 처리 시작
|
// 마지막에 큐 처리 시작
|
||||||
@@ -134,7 +139,8 @@ export const enqueueMultiplePanelActions = (actions) => {
|
|||||||
*/
|
*/
|
||||||
export const createPanelSequence = (sequence) => {
|
export const createPanelSequence = (sequence) => {
|
||||||
return (dispatch) => {
|
return (dispatch) => {
|
||||||
const queuedActions = sequence.map(item => {
|
const queuedActions = sequence
|
||||||
|
.map((item) => {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'push':
|
case 'push':
|
||||||
return pushPanelQueued(item.panel, item.duplicatable);
|
return pushPanelQueued(item.panel, item.duplicatable);
|
||||||
@@ -147,7 +153,8 @@ export const createPanelSequence = (sequence) => {
|
|||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}).filter(Boolean);
|
})
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
dispatch(enqueueMultiplePanelActions(queuedActions));
|
dispatch(enqueueMultiplePanelActions(queuedActions));
|
||||||
};
|
};
|
||||||
@@ -174,9 +181,9 @@ export const enqueueAsyncPanelAction = (config) => {
|
|||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const actionId = config.id || `async_action_${++queueItemId}_${Date.now()}`;
|
const actionId = config.id || `async_action_${++queueItemId}_${Date.now()}`;
|
||||||
|
|
||||||
console.log('[queuedPanelActions] 🔄 ENQUEUE_ASYNC_PANEL_ACTION', {
|
dlog('[queuedPanelActions] 🔄 ENQUEUE_ASYNC_PANEL_ACTION', {
|
||||||
actionId,
|
actionId,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -189,8 +196,8 @@ export const enqueueAsyncPanelAction = (config) => {
|
|||||||
onFinish: config.onFinish,
|
onFinish: config.onFinish,
|
||||||
timeout: config.timeout || 10000,
|
timeout: config.timeout || 10000,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
status: 'pending'
|
status: 'pending',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 비동기 액션 실행
|
// 비동기 액션 실행
|
||||||
@@ -206,39 +213,40 @@ export const enqueueAsyncPanelAction = (config) => {
|
|||||||
*/
|
*/
|
||||||
const executeAsyncAction = (dispatch, getState, actionId) => {
|
const executeAsyncAction = (dispatch, getState, actionId) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const asyncAction = state.panels?.panelActionQueue?.find(item => item.id === actionId);
|
const asyncAction = state.panels?.panelActionQueue?.find((item) => item.id === actionId);
|
||||||
|
|
||||||
if (!asyncAction) {
|
if (!asyncAction) {
|
||||||
console.warn('[queuedPanelActions] ⚠️ ASYNC_ACTION_NOT_FOUND', actionId);
|
dwarn('[queuedPanelActions] ⚠️ ASYNC_ACTION_NOT_FOUND', actionId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[queuedPanelActions] ⚡ EXECUTING_ASYNC_ACTION', actionId);
|
dlog('[queuedPanelActions] ⚡ EXECUTING_ASYNC_ACTION', actionId);
|
||||||
|
|
||||||
// 비동기 액션을 Promise로 래핑하여 실행
|
// 비동기 액션을 Promise로 래핑하여 실행
|
||||||
import('../utils/asyncActionUtils').then(({ wrapAsyncAction, withTimeout }) => {
|
import('../utils/asyncActionUtils')
|
||||||
|
.then(({ wrapAsyncAction, withTimeout }) => {
|
||||||
const actionPromise = wrapAsyncAction(asyncAction.asyncAction, { dispatch, getState });
|
const actionPromise = wrapAsyncAction(asyncAction.asyncAction, { dispatch, getState });
|
||||||
const timeoutPromise = withTimeout(actionPromise, asyncAction.timeout);
|
const timeoutPromise = withTimeout(actionPromise, asyncAction.timeout);
|
||||||
|
|
||||||
timeoutPromise
|
timeoutPromise
|
||||||
.then(result => {
|
.then((result) => {
|
||||||
console.log('[queuedPanelActions] 📊 ASYNC_ACTION_RESULT', {
|
dlog('[queuedPanelActions] 📊 ASYNC_ACTION_RESULT', {
|
||||||
actionId,
|
actionId,
|
||||||
success: result.success,
|
success: result.success,
|
||||||
hasError: !!result.error,
|
hasError: !!result.error,
|
||||||
errorCode: result.error?.code
|
errorCode: result.error?.code,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
// 성공 처리
|
// 성공 처리
|
||||||
console.log('[queuedPanelActions] ✅ ASYNC_ACTION_SUCCESS', actionId);
|
dlog('[queuedPanelActions] ✅ ASYNC_ACTION_SUCCESS', actionId);
|
||||||
|
|
||||||
// 사용자 정의 성공 콜백 실행
|
// 사용자 정의 성공 콜백 실행
|
||||||
if (asyncAction.onSuccess) {
|
if (asyncAction.onSuccess) {
|
||||||
try {
|
try {
|
||||||
asyncAction.onSuccess(result.data);
|
asyncAction.onSuccess(result.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_SUCCESS_ERROR', error);
|
derror('[queuedPanelActions] ❌ USER_ON_SUCCESS_ERROR', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +255,7 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
try {
|
try {
|
||||||
asyncAction.onFinish(true, result.data);
|
asyncAction.onFinish(true, result.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', error);
|
derror('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,16 +265,15 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
payload: {
|
payload: {
|
||||||
actionId,
|
actionId,
|
||||||
result: result.data,
|
result: result.data,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 실패 처리
|
// 실패 처리
|
||||||
console.error('[queuedPanelActions] ❌ ASYNC_ACTION_FAILED', {
|
derror('[queuedPanelActions] ❌ ASYNC_ACTION_FAILED', {
|
||||||
actionId,
|
actionId,
|
||||||
error: result.error,
|
error: result.error,
|
||||||
errorCode: result.error?.code
|
errorCode: result.error?.code,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 사용자 정의 실패 콜백 실행
|
// 사용자 정의 실패 콜백 실행
|
||||||
@@ -274,7 +281,7 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
try {
|
try {
|
||||||
asyncAction.onFail(result.error);
|
asyncAction.onFail(result.error);
|
||||||
} catch (callbackError) {
|
} catch (callbackError) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_FAIL_ERROR', callbackError);
|
derror('[queuedPanelActions] ❌ USER_ON_FAIL_ERROR', callbackError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +290,7 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
try {
|
try {
|
||||||
asyncAction.onFinish(false, result.error);
|
asyncAction.onFinish(false, result.error);
|
||||||
} catch (callbackError) {
|
} catch (callbackError) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', callbackError);
|
derror('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', callbackError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,20 +300,20 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
payload: {
|
payload: {
|
||||||
actionId,
|
actionId,
|
||||||
error: result.error,
|
error: result.error,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now(),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.error('[queuedPanelActions] 💥 ASYNC_ACTION_EXECUTION_ERROR', { actionId, error });
|
derror('[queuedPanelActions] 💥 ASYNC_ACTION_EXECUTION_ERROR', { actionId, error });
|
||||||
|
|
||||||
// 치명적인 에러 처리
|
// 치명적인 에러 처리
|
||||||
if (asyncAction.onFail) {
|
if (asyncAction.onFail) {
|
||||||
try {
|
try {
|
||||||
asyncAction.onFail(error);
|
asyncAction.onFail(error);
|
||||||
} catch (callbackError) {
|
} catch (callbackError) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_FAIL_ERROR', callbackError);
|
derror('[queuedPanelActions] ❌ USER_ON_FAIL_ERROR', callbackError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,7 +321,7 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
try {
|
try {
|
||||||
asyncAction.onFinish(false, error);
|
asyncAction.onFinish(false, error);
|
||||||
} catch (callbackError) {
|
} catch (callbackError) {
|
||||||
console.error('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', callbackError);
|
derror('[queuedPanelActions] ❌ USER_ON_FINISH_ERROR', callbackError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,14 +331,15 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
actionId,
|
actionId,
|
||||||
error: {
|
error: {
|
||||||
code: 'EXECUTION_ERROR',
|
code: 'EXECUTION_ERROR',
|
||||||
message: error.message || '비동기 액션 실행 중 치명적인 오류 발생'
|
message: error.message || '비동기 액션 실행 중 치명적인 오류 발생',
|
||||||
|
},
|
||||||
|
timestamp: Date.now(),
|
||||||
},
|
},
|
||||||
timestamp: Date.now()
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
})
|
||||||
console.error('[queuedPanelActions] 💥 ASYNC_UTILS_IMPORT_ERROR', error);
|
.catch((error) => {
|
||||||
|
derror('[queuedPanelActions] 💥 ASYNC_UTILS_IMPORT_ERROR', error);
|
||||||
|
|
||||||
// 유틸리티 import 실패 시 기본 처리
|
// 유틸리티 import 실패 시 기본 처리
|
||||||
if (asyncAction.onFail) {
|
if (asyncAction.onFail) {
|
||||||
@@ -355,11 +363,11 @@ const executeAsyncAction = (dispatch, getState, actionId) => {
|
|||||||
export const createApiWithPanelActions = (config) => {
|
export const createApiWithPanelActions = (config) => {
|
||||||
return enqueueAsyncPanelAction({
|
return enqueueAsyncPanelAction({
|
||||||
asyncAction: (dispatch, getState, onSuccess, onFail) => {
|
asyncAction: (dispatch, getState, onSuccess, onFail) => {
|
||||||
console.log('[queuedPanelActions] 🌐 API_CALL_START');
|
dlog('[queuedPanelActions] 🌐 API_CALL_START');
|
||||||
config.apiCall(dispatch, getState, onSuccess, onFail);
|
config.apiCall(dispatch, getState, onSuccess, onFail);
|
||||||
},
|
},
|
||||||
onSuccess: (response) => {
|
onSuccess: (response) => {
|
||||||
console.log('[queuedPanelActions] 🎯 API_SUCCESS_EXECUTING_PANELS');
|
dlog('[queuedPanelActions] 🎯 API_SUCCESS_EXECUTING_PANELS');
|
||||||
|
|
||||||
// API 성공 콜백 실행
|
// API 성공 콜백 실행
|
||||||
if (config.onApiSuccess) {
|
if (config.onApiSuccess) {
|
||||||
@@ -380,7 +388,7 @@ export const createApiWithPanelActions = (config) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFail: (error) => {
|
onFail: (error) => {
|
||||||
console.log('[queuedPanelActions] 🚫 API_FAILED', error);
|
dlog('[queuedPanelActions] 🚫 API_FAILED', error);
|
||||||
|
|
||||||
// API 실패 콜백 실행
|
// API 실패 콜백 실행
|
||||||
if (config.onApiFail) {
|
if (config.onApiFail) {
|
||||||
@@ -388,8 +396,8 @@ export const createApiWithPanelActions = (config) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFinish: (isSuccess, result) => {
|
onFinish: (isSuccess, result) => {
|
||||||
console.log('[queuedPanelActions] 🏁 API_WITH_PANELS_COMPLETE', { isSuccess });
|
dlog('[queuedPanelActions] 🏁 API_WITH_PANELS_COMPLETE', { isSuccess });
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -404,14 +412,14 @@ export const createAsyncPanelSequence = (asyncConfigs) => {
|
|||||||
|
|
||||||
const executeNext = () => {
|
const executeNext = () => {
|
||||||
if (currentIndex >= asyncConfigs.length) {
|
if (currentIndex >= asyncConfigs.length) {
|
||||||
console.log('[queuedPanelActions] 🎊 ASYNC_SEQUENCE_COMPLETE');
|
dlog('[queuedPanelActions] 🎊 ASYNC_SEQUENCE_COMPLETE');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = asyncConfigs[currentIndex];
|
const config = asyncConfigs[currentIndex];
|
||||||
console.log('[queuedPanelActions] 📋 EXECUTING_ASYNC_SEQUENCE_ITEM', {
|
dlog('[queuedPanelActions] 📋 EXECUTING_ASYNC_SEQUENCE_ITEM', {
|
||||||
index: currentIndex,
|
index: currentIndex,
|
||||||
total: asyncConfigs.length
|
total: asyncConfigs.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 현재 액션에 다음 액션 실행 로직 추가
|
// 현재 액션에 다음 액션 실행 로직 추가
|
||||||
@@ -428,12 +436,12 @@ export const createAsyncPanelSequence = (asyncConfigs) => {
|
|||||||
currentIndex++;
|
currentIndex++;
|
||||||
setTimeout(executeNext, 50); // 50ms 후 다음 액션 실행
|
setTimeout(executeNext, 50); // 50ms 후 다음 액션 실행
|
||||||
} else {
|
} else {
|
||||||
console.error('[queuedPanelActions] ⛔ ASYNC_SEQUENCE_STOPPED_ON_ERROR', {
|
derror('[queuedPanelActions] ⛔ ASYNC_SEQUENCE_STOPPED_ON_ERROR', {
|
||||||
index: currentIndex,
|
index: currentIndex,
|
||||||
error: result
|
error: result,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
dispatch(enqueueAsyncPanelAction(enhancedConfig));
|
dispatch(enqueueAsyncPanelAction(enhancedConfig));
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import { TAxios } from '../api/TAxios';
|
|||||||
import { SEARCH_DATA_MAX_RESULTS_LIMIT } from '../utils/Config';
|
import { SEARCH_DATA_MAX_RESULTS_LIMIT } from '../utils/Config';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from './commonActions';
|
import { changeAppStatus } from './commonActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// Search 통합검색 (IBS) 데이터 조회 IF-LGSP-090
|
// Search 통합검색 (IBS) 데이터 조회 IF-LGSP-090
|
||||||
let getSearchKey = null;
|
let getSearchKey = null;
|
||||||
@@ -19,7 +24,7 @@ export const getSearch =
|
|||||||
|
|
||||||
let currentKey = key;
|
let currentKey = key;
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getSearch onSuccess: ', response.data);
|
dlog('getSearch onSuccess: ', response.data);
|
||||||
|
|
||||||
if (startIndex === 1) {
|
if (startIndex === 1) {
|
||||||
getSearchKey = new Date();
|
getSearchKey = new Date();
|
||||||
@@ -42,7 +47,7 @@ export const getSearch =
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getSearch onFail: ', error);
|
derror('getSearch onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
@@ -101,7 +106,7 @@ export const getShopperHouseSearch =
|
|||||||
(dispatch, getState) => {
|
(dispatch, getState) => {
|
||||||
// ✅ 빈 query 체크 - API 호출 방지
|
// ✅ 빈 query 체크 - API 호출 방지
|
||||||
if (!query || query.trim() === '') {
|
if (!query || query.trim() === '') {
|
||||||
console.log('[ShopperHouse] ⚠️ 빈 쿼리 - API 호출 건너뜀');
|
dlog('[ShopperHouse] ⚠️ 빈 쿼리 - API 호출 건너뜀');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +116,7 @@ export const getShopperHouseSearch =
|
|||||||
const currentKey = currentShopperHouseData?.results?.[0]?.searchId || 'null';
|
const currentKey = currentShopperHouseData?.results?.[0]?.searchId || 'null';
|
||||||
const preKey = preShopperHouseData?.results?.[0]?.searchId || 'null';
|
const preKey = preShopperHouseData?.results?.[0]?.searchId || 'null';
|
||||||
|
|
||||||
console.log('[ShopperHouse]-DIFF shopperHouseKey:', currentKey, '| preShopperHouseKey:', preKey);
|
dlog('[ShopperHouse]-DIFF shopperHouseKey:', currentKey, '| preShopperHouseKey:', preKey);
|
||||||
|
|
||||||
if (currentShopperHouseData) {
|
if (currentShopperHouseData) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -127,37 +132,29 @@ export const getShopperHouseSearch =
|
|||||||
const currentSearchKey = new Date().getTime();
|
const currentSearchKey = new Date().getTime();
|
||||||
getShopperHouseSearchKey = currentSearchKey;
|
getShopperHouseSearchKey = currentSearchKey;
|
||||||
|
|
||||||
console.log(
|
dlog('[ShopperHouse] 🔍 [DEBUG] API 호출 시작 - key:', currentSearchKey, 'query:', query);
|
||||||
'[ShopperHouse] 🔍 [DEBUG] API 호출 시작 - key:',
|
|
||||||
currentSearchKey,
|
|
||||||
'query:',
|
|
||||||
query
|
|
||||||
);
|
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('[ShopperHouse] 📥 [DEBUG] API 응답 도착 - key:', currentSearchKey);
|
dlog('[ShopperHouse] 📥 [DEBUG] API 응답 도착 - key:', currentSearchKey);
|
||||||
console.log('[ShopperHouse] 🔑 [DEBUG] 현재 유효한 key:', getShopperHouseSearchKey);
|
dlog('[ShopperHouse] 🔑 [DEBUG] 현재 유효한 key:', getShopperHouseSearchKey);
|
||||||
|
|
||||||
// ✨ 현재 요청이 최신 요청인지 확인
|
// ✨ 현재 요청이 최신 요청인지 확인
|
||||||
if (currentSearchKey === getShopperHouseSearchKey) {
|
if (currentSearchKey === getShopperHouseSearchKey) {
|
||||||
console.log('[ShopperHouse] ✅ [DEBUG] 유효한 응답 - Redux 업데이트');
|
dlog('[ShopperHouse] ✅ [DEBUG] 유효한 응답 - Redux 업데이트');
|
||||||
console.log(
|
dlog('[ShopperHouse] getShopperHouseSearch onSuccess: ', JSON.stringify(response.data));
|
||||||
'[ShopperHouse] getShopperHouseSearch onSuccess: ',
|
|
||||||
JSON.stringify(response.data)
|
|
||||||
);
|
|
||||||
|
|
||||||
// ✅ API 성공 여부 확인
|
// ✅ API 성공 여부 확인
|
||||||
const retCode = response.data?.retCode;
|
const retCode = response.data?.retCode;
|
||||||
if (retCode !== 0) {
|
if (retCode !== 0) {
|
||||||
console.error(
|
derror(
|
||||||
'[ShopperHouse] ❌ API 실패 - retCode:',
|
'[ShopperHouse] ❌ API 실패 - retCode:',
|
||||||
retCode,
|
retCode,
|
||||||
'retMsg:',
|
'retMsg:',
|
||||||
response.data?.retMsg
|
response.data?.retMsg
|
||||||
);
|
);
|
||||||
console.log('[VoiceInput] 📥 API 응답 실패');
|
dlog('[VoiceInput] 📥 API 응답 실패');
|
||||||
console.log('[VoiceInput] ├─ retCode:', retCode);
|
dlog('[VoiceInput] ├─ retCode:', retCode);
|
||||||
console.log('[VoiceInput] └─ retMsg:', response.data?.retMsg);
|
dlog('[VoiceInput] └─ retMsg:', response.data?.retMsg);
|
||||||
|
|
||||||
// ✨ API 실패 응답을 Redux 에러 상태에 저장
|
// ✨ API 실패 응답을 Redux 에러 상태에 저장
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -179,8 +176,8 @@ export const getShopperHouseSearch =
|
|||||||
|
|
||||||
// ✅ result 데이터 존재 확인
|
// ✅ result 데이터 존재 확인
|
||||||
if (!response.data?.data?.result) {
|
if (!response.data?.data?.result) {
|
||||||
console.error('[ShopperHouse] ❌ API 응답에 result 데이터 없음');
|
derror('[ShopperHouse] ❌ API 응답에 result 데이터 없음');
|
||||||
console.log('[VoiceInput] 📥 API 응답 실패 (result 데이터 없음)');
|
dlog('[VoiceInput] 📥 API 응답 실패 (result 데이터 없음)');
|
||||||
|
|
||||||
// ✨ result 데이터 없음 에러를 Redux 에러 상태에 저장
|
// ✨ result 데이터 없음 에러를 Redux 에러 상태에 저장
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -209,15 +206,15 @@ export const getShopperHouseSearch =
|
|||||||
|
|
||||||
const elapsedTime = ((new Date().getTime() - currentSearchKey) / 1000).toFixed(2);
|
const elapsedTime = ((new Date().getTime() - currentSearchKey) / 1000).toFixed(2);
|
||||||
|
|
||||||
console.log('*[ShopperHouseAPI] ✅ onSuccess - API 응답 성공');
|
dlog('*[ShopperHouseAPI] ✅ onSuccess - API 응답 성공');
|
||||||
console.log(
|
dlog(
|
||||||
'*[ShopperHouseAPI] ├─ searchId:',
|
'*[ShopperHouseAPI] ├─ searchId:',
|
||||||
receivedSearchId === null ? '(NULL)' : receivedSearchId
|
receivedSearchId === null ? '(NULL)' : receivedSearchId
|
||||||
);
|
);
|
||||||
console.log('*[ShopperHouseAPI] ├─ 상품 개수:', productCount);
|
dlog('*[ShopperHouseAPI] ├─ 상품 개수:', productCount);
|
||||||
console.log('*[ShopperHouseAPI] ├─ relativeQueries:', relativeQueries || '(없음)');
|
dlog('*[ShopperHouseAPI] ├─ relativeQueries:', relativeQueries || '(없음)');
|
||||||
console.log('*[ShopperHouseAPI] ├─ 소요 시간:', elapsedTime + '초');
|
dlog('*[ShopperHouseAPI] ├─ 소요 시간:', elapsedTime + '초');
|
||||||
console.log('*[ShopperHouseAPI] └─ timestamp:', new Date().toISOString());
|
dlog('*[ShopperHouseAPI] └─ timestamp:', new Date().toISOString());
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_SHOPPERHOUSE_SEARCH,
|
type: types.GET_SHOPPERHOUSE_SEARCH,
|
||||||
@@ -226,16 +223,16 @@ export const getShopperHouseSearch =
|
|||||||
|
|
||||||
dispatch(updateSearchTimestamp());
|
dispatch(updateSearchTimestamp());
|
||||||
} else {
|
} else {
|
||||||
console.log('[ShopperHouse] ❌ [DEBUG] 오래된 응답 무시 - Redux 업데이트 안함');
|
dlog('[ShopperHouse] ❌ [DEBUG] 오래된 응답 무시 - Redux 업데이트 안함');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('[ShopperHouse] getShopperHouseSearch onFail: ', JSON.stringify(error));
|
derror('[ShopperHouse] getShopperHouseSearch onFail: ', JSON.stringify(error));
|
||||||
|
|
||||||
// ✨ 현재 요청이 최신 요청인지 확인
|
// ✨ 현재 요청이 최신 요청인지 확인
|
||||||
if (currentSearchKey === getShopperHouseSearchKey) {
|
if (currentSearchKey === getShopperHouseSearchKey) {
|
||||||
console.log('[ShopperHouse] ❌ [DEBUG] 유효한 에러 응답 - Redux 에러 상태 업데이트');
|
dlog('[ShopperHouse] ❌ [DEBUG] 유효한 에러 응답 - Redux 에러 상태 업데이트');
|
||||||
|
|
||||||
const retCode = error?.data?.retCode;
|
const retCode = error?.data?.retCode;
|
||||||
const status = error?.status;
|
const status = error?.status;
|
||||||
@@ -243,15 +240,15 @@ export const getShopperHouseSearch =
|
|||||||
|
|
||||||
// ✅ TAxios 재인증 오류 필터링 (기존 방식 그대로 활용)
|
// ✅ TAxios 재인증 오류 필터링 (기존 방식 그대로 활용)
|
||||||
if (retCode === 401) {
|
if (retCode === 401) {
|
||||||
console.log('*[ShopperHouseAPI] ⚠️ onFail - Access Token 만료 (401)');
|
dlog('*[ShopperHouseAPI] ⚠️ onFail - Access Token 만료 (401)');
|
||||||
console.log('*[ShopperHouseAPI] └─ TAxios가 자동으로 재인증하고 재시도합니다');
|
dlog('*[ShopperHouseAPI] └─ TAxios가 자동으로 재인증하고 재시도합니다');
|
||||||
// 401 에러는 Redux에 저장하지 않음 (TAxios 자동 재시도 대기)
|
// 401 에러는 Redux에 저장하지 않음 (TAxios 자동 재시도 대기)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retCode === 402 || retCode === 501) {
|
if (retCode === 402 || retCode === 501) {
|
||||||
console.log('*[ShopperHouseAPI] ⚠️ onFail - RefreshToken 만료 (' + retCode + ')');
|
dlog('*[ShopperHouseAPI] ⚠️ onFail - RefreshToken 만료 (' + retCode + ')');
|
||||||
console.log('*[ShopperHouseAPI] └─ TAxios가 자동으로 토큰 재발급하고 재시도합니다');
|
dlog('*[ShopperHouseAPI] └─ TAxios가 자동으로 토큰 재발급하고 재시도합니다');
|
||||||
// 402/501 에러는 Redux에 저장하지 않음 (TAxios 자동 재시도 대기)
|
// 402/501 에러는 Redux에 저장하지 않음 (TAxios 자동 재시도 대기)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -262,22 +259,22 @@ export const getShopperHouseSearch =
|
|||||||
errorMessage?.includes('Network Error') ||
|
errorMessage?.includes('Network Error') ||
|
||||||
errorMessage?.includes('timeout')
|
errorMessage?.includes('timeout')
|
||||||
) {
|
) {
|
||||||
console.log('*[ShopperHouseAPI] ⚠️ onFail - 일시적인 네트워크 오류');
|
dlog('*[ShopperHouseAPI] ⚠️ onFail - 일시적인 네트워크 오류');
|
||||||
console.log('*[ShopperHouseAPI] ├─ status:', status);
|
dlog('*[ShopperHouseAPI] ├─ status:', status);
|
||||||
console.log('*[ShopperHouseAPI] └─ errorMessage:', errorMessage);
|
dlog('*[ShopperHouseAPI] └─ errorMessage:', errorMessage);
|
||||||
// 일시적인 네트워크 오류는 Redux에 저장하지 않음
|
// 일시적인 네트워크 오류는 Redux에 저장하지 않음
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✨ 그 외의 실제 API 오류들만 Redux에 저장
|
// ✨ 그 외의 실제 API 오류들만 Redux에 저장
|
||||||
console.log('*[ShopperHouseAPI] ❌ onFail - 실제 API 오류 발생');
|
dlog('*[ShopperHouseAPI] ❌ onFail - 실제 API 오류 발생');
|
||||||
console.log('*[ShopperHouseAPI] ├─ retCode:', retCode);
|
dlog('*[ShopperHouseAPI] ├─ retCode:', retCode);
|
||||||
console.log('*[ShopperHouseAPI] ├─ status:', status);
|
dlog('*[ShopperHouseAPI] ├─ status:', status);
|
||||||
console.log('*[ShopperHouseAPI] ├─ errorMessage:', errorMessage);
|
dlog('*[ShopperHouseAPI] ├─ errorMessage:', errorMessage);
|
||||||
console.log('*[ShopperHouseAPI] └─ retMsg:', error?.data?.retMsg || '(없음)');
|
dlog('*[ShopperHouseAPI] └─ retMsg:', error?.data?.retMsg || '(없음)');
|
||||||
|
|
||||||
// ✅ API 실패 시 모든 데이터 정리
|
// ✅ API 실패 시 모든 데이터 정리
|
||||||
console.log('*[ShopperHouseAPI] 🧹 API 실패 - shopperHouse 데이터 정리');
|
dlog('*[ShopperHouseAPI] 🧹 API 실패 - shopperHouse 데이터 정리');
|
||||||
dispatch(clearShopperHouseData());
|
dispatch(clearShopperHouseData());
|
||||||
|
|
||||||
// ✅ 사용자에게 실패 알림 표시
|
// ✅ 사용자에게 실패 알림 표시
|
||||||
@@ -310,7 +307,7 @@ export const getShopperHouseSearch =
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.log('[ShopperHouse] ❌ [DEBUG] 오래된 에러 응답 무시 - Redux 업데이트 안함');
|
dlog('[ShopperHouse] ❌ [DEBUG] 오래된 에러 응답 무시 - Redux 업데이트 안함');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -321,17 +318,17 @@ export const getShopperHouseSearch =
|
|||||||
if (sortingType) {
|
if (sortingType) {
|
||||||
params.sortingType = sortingType;
|
params.sortingType = sortingType;
|
||||||
}
|
}
|
||||||
console.log('*[ShopperHouseAPI] getShopperHouseSearch params: ', JSON.stringify(params));
|
dlog('*[ShopperHouseAPI] getShopperHouseSearch params: ', JSON.stringify(params));
|
||||||
console.log('*[ShopperHouseAPI] ├─ query:', query);
|
dlog('*[ShopperHouseAPI] ├─ query:', query);
|
||||||
console.log('*[ShopperHouseAPI] ├─ searchId:', searchId === null ? '(NULL)' : searchId);
|
dlog('*[ShopperHouseAPI] ├─ searchId:', searchId === null ? '(NULL)' : searchId);
|
||||||
console.log('*[ShopperHouseAPI] ├─ sortingType:', sortingType === null ? '(NULL)' : sortingType);
|
dlog('*[ShopperHouseAPI] ├─ sortingType:', sortingType === null ? '(NULL)' : sortingType);
|
||||||
console.log('*[ShopperHouseAPI] └─ timestamp:', new Date().toISOString());
|
dlog('*[ShopperHouseAPI] └─ timestamp:', new Date().toISOString());
|
||||||
|
|
||||||
// 🔧 [테스트용] API 실패 시뮬레이션 스위치
|
// 🔧 [테스트용] API 실패 시뮬레이션 스위치
|
||||||
const SIMULATE_API_FAILURE = false; // ⭐ 이 값을 true로 변경하면 실패 시뮬레이션
|
const SIMULATE_API_FAILURE = false; // ⭐ 이 값을 true로 변경하면 실패 시뮬레이션
|
||||||
|
|
||||||
if (SIMULATE_API_FAILURE) {
|
if (SIMULATE_API_FAILURE) {
|
||||||
console.log('🧪 [TEST] API 실패 시뮬레이션 활성화 - 2초 후 실패 응답');
|
dlog('🧪 [TEST] API 실패 시뮬레이션 활성화 - 2초 후 실패 응답');
|
||||||
|
|
||||||
// 2초 후 실패 시뮬레이션
|
// 2초 후 실패 시뮬레이션
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -346,7 +343,7 @@ export const getShopperHouseSearch =
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('🧪 [TEST] 시뮬레이션된 실패 응답 전송');
|
dlog('🧪 [TEST] 시뮬레이션된 실패 응답 전송');
|
||||||
onFail(simulatedError);
|
onFail(simulatedError);
|
||||||
}, 2000); // 2초 딜레이
|
}, 2000); // 2초 딜레이
|
||||||
|
|
||||||
@@ -358,8 +355,8 @@ export const getShopperHouseSearch =
|
|||||||
|
|
||||||
// ShopperHouse API 에러 처리 액션
|
// ShopperHouse API 에러 처리 액션
|
||||||
export const setShopperHouseError = (error) => {
|
export const setShopperHouseError = (error) => {
|
||||||
console.log('[ShopperHouse] ❌ [DEBUG] setShopperHouseError - 에러 정보 저장');
|
dlog('[ShopperHouse] ❌ [DEBUG] setShopperHouseError - 에러 정보 저장');
|
||||||
console.log('[ShopperHouse] └─ error:', error);
|
dlog('[ShopperHouse] └─ error:', error);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: types.SET_SHOPPERHOUSE_ERROR,
|
type: types.SET_SHOPPERHOUSE_ERROR,
|
||||||
@@ -369,8 +366,8 @@ export const setShopperHouseError = (error) => {
|
|||||||
|
|
||||||
// ShopperHouse 에러 표시 액션 (사용자에게 팝업으로 알림)
|
// ShopperHouse 에러 표시 액션 (사용자에게 팝업으로 알림)
|
||||||
export const showShopperHouseError = (error) => {
|
export const showShopperHouseError = (error) => {
|
||||||
console.log('[ShopperHouse] 🔴 [DEBUG] showShopperHouseError - 에러 팝업 표시');
|
dlog('[ShopperHouse] 🔴 [DEBUG] showShopperHouseError - 에러 팝업 표시');
|
||||||
console.log('[ShopperHouse] └─ error:', error);
|
dlog('[ShopperHouse] └─ error:', error);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: types.SHOW_SHOPPERHOUSE_ERROR,
|
type: types.SHOW_SHOPPERHOUSE_ERROR,
|
||||||
@@ -386,7 +383,7 @@ export const showShopperHouseError = (error) => {
|
|||||||
|
|
||||||
// ShopperHouse 에러 숨김 액션 (팝업 닫기)
|
// ShopperHouse 에러 숨김 액션 (팝업 닫기)
|
||||||
export const hideShopperHouseError = () => {
|
export const hideShopperHouseError = () => {
|
||||||
console.log('[ShopperHouse] ✅ [DEBUG] hideShopperHouseError - 에러 팝업 숨김');
|
dlog('[ShopperHouse] ✅ [DEBUG] hideShopperHouseError - 에러 팝업 숨김');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: types.HIDE_SHOPPERHOUSE_ERROR,
|
type: types.HIDE_SHOPPERHOUSE_ERROR,
|
||||||
@@ -401,7 +398,12 @@ export const clearShopperHouseData = () => (dispatch, getState) => {
|
|||||||
const currentKey = currentShopperHouseData?.results?.[0]?.searchId || 'null';
|
const currentKey = currentShopperHouseData?.results?.[0]?.searchId || 'null';
|
||||||
const preKey = preShopperHouseData?.results?.[0]?.searchId || 'null';
|
const preKey = preShopperHouseData?.results?.[0]?.searchId || 'null';
|
||||||
|
|
||||||
console.log('[ShopperHouse]-DIFF (before clear) shopperHouseKey:', currentKey, '| preShopperHouseKey:', preKey);
|
dlog(
|
||||||
|
'[ShopperHouse]-DIFF (before clear) shopperHouseKey:',
|
||||||
|
currentKey,
|
||||||
|
'| preShopperHouseKey:',
|
||||||
|
preKey
|
||||||
|
);
|
||||||
|
|
||||||
if (currentShopperHouseData) {
|
if (currentShopperHouseData) {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -422,7 +424,7 @@ export const clearShopperHouseData = () => (dispatch, getState) => {
|
|||||||
// Search Main 조회 IF-LGSP-097
|
// Search Main 조회 IF-LGSP-097
|
||||||
export const getSearchMain = () => (dispatch, getState) => {
|
export const getSearchMain = () => (dispatch, getState) => {
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log('getSearchMain onSuccess: ', response.data);
|
dlog('getSearchMain onSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_SEARCH_MAIN,
|
type: types.GET_SEARCH_MAIN,
|
||||||
@@ -431,7 +433,7 @@ export const getSearchMain = () => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error('getSearchMain onFail: ', error);
|
derror('getSearchMain onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(dispatch, getState, 'post', URLS.GET_SEARCH_MAIN, {}, {}, onSuccess, onFail);
|
TAxios(dispatch, getState, 'post', URLS.GET_SEARCH_MAIN, {}, {}, onSuccess, onFail);
|
||||||
@@ -462,7 +464,7 @@ export const clearSearchMainData = () => ({
|
|||||||
* @returns {object} Redux action
|
* @returns {object} Redux action
|
||||||
*/
|
*/
|
||||||
export const switchToSearchInputOverlay = (source = 'VoiceInputOverlay') => {
|
export const switchToSearchInputOverlay = (source = 'VoiceInputOverlay') => {
|
||||||
console.log('[searchActions] 🔄 switchToSearchInputOverlay 명령 발송', {
|
dlog('[searchActions] 🔄 switchToSearchInputOverlay 명령 발송', {
|
||||||
source,
|
source,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
});
|
});
|
||||||
@@ -483,7 +485,7 @@ export const switchToSearchInputOverlay = (source = 'VoiceInputOverlay') => {
|
|||||||
* @returns {object} Redux action
|
* @returns {object} Redux action
|
||||||
*/
|
*/
|
||||||
export const clearPanelCommand = () => {
|
export const clearPanelCommand = () => {
|
||||||
console.log('[searchActions] 🧹 clearPanelCommand 호출 - 명령 초기화');
|
dlog('[searchActions] 🧹 clearPanelCommand 호출 - 명령 초기화');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: types.CLEAR_PANEL_COMMAND,
|
type: types.CLEAR_PANEL_COMMAND,
|
||||||
@@ -505,31 +507,31 @@ export const clearPanelCommand = () => {
|
|||||||
export const transitionToSearchInputOverlay = (options) => async (dispatch) => {
|
export const transitionToSearchInputOverlay = (options) => async (dispatch) => {
|
||||||
const { setIsVoiceOverlayVisible, setIsSearchOverlayVisible, Spotlight } = options;
|
const { setIsVoiceOverlayVisible, setIsSearchOverlayVisible, Spotlight } = options;
|
||||||
|
|
||||||
console.log('[searchActions] 🔄 transitionToSearchInputOverlay 시작');
|
dlog('[searchActions] 🔄 transitionToSearchInputOverlay 시작');
|
||||||
console.log('[searchActions] ├─ Step 1: VoiceInputOverlay 닫기');
|
dlog('[searchActions] ├─ Step 1: VoiceInputOverlay 닫기');
|
||||||
|
|
||||||
// Step 1: VoiceInputOverlay 닫기
|
// Step 1: VoiceInputOverlay 닫기
|
||||||
setIsVoiceOverlayVisible(false);
|
setIsVoiceOverlayVisible(false);
|
||||||
|
|
||||||
// Step 2: 애니메이션 대기 (300ms - VoiceInputOverlay 닫기 애니메이션)
|
// Step 2: 애니메이션 대기 (300ms - VoiceInputOverlay 닫기 애니메이션)
|
||||||
console.log('[searchActions] ├─ Step 2: 300ms 대기 (VoiceOverlay 애니메이션)');
|
dlog('[searchActions] ├─ Step 2: 300ms 대기 (VoiceOverlay 애니메이션)');
|
||||||
await new Promise((resolve) => setTimeout(resolve, 300));
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
||||||
|
|
||||||
// Step 3: SearchInputOverlay 열기
|
// Step 3: SearchInputOverlay 열기
|
||||||
console.log('[searchActions] ├─ Step 3: SearchInputOverlay 열기');
|
dlog('[searchActions] ├─ Step 3: SearchInputOverlay 열기');
|
||||||
setIsSearchOverlayVisible(true);
|
setIsSearchOverlayVisible(true);
|
||||||
|
|
||||||
// Step 4: 렌더링 대기 (100ms - SearchInputOverlay 렌더링 및 마운트)
|
// Step 4: 렌더링 대기 (100ms - SearchInputOverlay 렌더링 및 마운트)
|
||||||
console.log('[searchActions] ├─ Step 4: 100ms 대기 (SearchInputOverlay 렌더링)');
|
dlog('[searchActions] ├─ Step 4: 100ms 대기 (SearchInputOverlay 렌더링)');
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
|
|
||||||
// Step 5: Spotlight 포커스 설정
|
// Step 5: Spotlight 포커스 설정
|
||||||
console.log('[searchActions] ├─ Step 5: Spotlight 포커스 설정 (search_overlay_input_box)');
|
dlog('[searchActions] ├─ Step 5: Spotlight 포커스 설정 (search_overlay_input_box)');
|
||||||
Spotlight.focus('search_overlay_input_box');
|
Spotlight.focus('search_overlay_input_box');
|
||||||
|
|
||||||
// Step 6: 명령 초기화
|
// Step 6: 명령 초기화
|
||||||
console.log('[searchActions] └─ Step 6: panelCommand 초기화');
|
dlog('[searchActions] └─ Step 6: panelCommand 초기화');
|
||||||
dispatch(clearPanelCommand());
|
dispatch(clearPanelCommand());
|
||||||
|
|
||||||
console.log('[searchActions] ✅ transitionToSearchInputOverlay 완료');
|
dlog('[searchActions] ✅ transitionToSearchInputOverlay 완료');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import { URLS } from "../api/apiConfig";
|
import { URLS } from '../api/apiConfig';
|
||||||
import { TAxios } from "../api/TAxios";
|
import { TAxios } from '../api/TAxios';
|
||||||
import { types } from "./actionTypes";
|
import { types } from './actionTypes';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// IF-LGSP-324 회원 Shipping Address 조회
|
// IF-LGSP-324 회원 Shipping Address 조회
|
||||||
export const getMyInfoShippingSearch = (props) => (dispatch, getState) => {
|
export const getMyInfoShippingSearch = (props) => (dispatch, getState) => {
|
||||||
const { mbrNo } = props;
|
const { mbrNo } = props;
|
||||||
|
|
||||||
const onSuccess = (response) => {
|
const onSuccess = (response) => {
|
||||||
console.log("getmyInfoShippingSearch OnSuccess: ", response.data);
|
dlog('getmyInfoShippingSearch OnSuccess: ', response.data);
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.GET_MY_INFO_SHIPPING_SEARCH,
|
type: types.GET_MY_INFO_SHIPPING_SEARCH,
|
||||||
@@ -16,13 +21,13 @@ export const getMyInfoShippingSearch = (props) => (dispatch, getState) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onFail = (error) => {
|
const onFail = (error) => {
|
||||||
console.error("getmyInfoShippingSearch onFail: ", error);
|
derror('getmyInfoShippingSearch onFail: ', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
TAxios(
|
TAxios(
|
||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
"get",
|
'get',
|
||||||
URLS.GET_MY_INFO_SHIPPING_SEARCH,
|
URLS.GET_MY_INFO_SHIPPING_SEARCH,
|
||||||
{ mbrNo },
|
{ mbrNo },
|
||||||
{},
|
{},
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import * as lunaSend from '../lunaSend/voice';
|
import * as lunaSend from '../lunaSend/voice';
|
||||||
import { FEATURE_FLAGS } from '../constants/featureFlags';
|
import { FEATURE_FLAGS } from '../constants/featureFlags';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to add log entries
|
* Helper function to add log entries
|
||||||
@@ -27,7 +32,7 @@ const addLog = (type, title, data, success = true) => {
|
|||||||
export const registerVoiceFramework = () => (dispatch, getState) => {
|
export const registerVoiceFramework = () => (dispatch, getState) => {
|
||||||
// VUI Feature Flag Check
|
// VUI Feature Flag Check
|
||||||
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
||||||
console.log('[Voice] VUI is disabled by feature flag');
|
dlog('[Voice] VUI is disabled by feature flag');
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
'ACTION',
|
'ACTION',
|
||||||
@@ -46,7 +51,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
const isTV = typeof window === 'object' && window.PalmSystem;
|
const isTV = typeof window === 'object' && window.PalmSystem;
|
||||||
|
|
||||||
if (!isTV) {
|
if (!isTV) {
|
||||||
console.warn('[Voice] Voice framework is only available on webOS TV platform');
|
dwarn('[Voice] Voice framework is only available on webOS TV platform');
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
'ERROR',
|
'ERROR',
|
||||||
@@ -65,7 +70,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[Voice] Registering with voice framework...');
|
dlog('[Voice] Registering with voice framework...');
|
||||||
|
|
||||||
// Log the request
|
// Log the request
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -83,8 +88,8 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
voiceHandler = lunaSend.registerVoiceConductor({
|
voiceHandler = lunaSend.registerVoiceConductor({
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log('[Voice] ⭐ Response from voice framework:', res);
|
dlog('[Voice] ⭐ Response from voice framework:', res);
|
||||||
console.log('[Voice] Response details:', {
|
dlog('[Voice] Response details:', {
|
||||||
subscribed: res.subscribed,
|
subscribed: res.subscribed,
|
||||||
returnValue: res.returnValue,
|
returnValue: res.returnValue,
|
||||||
command: res.command,
|
command: res.command,
|
||||||
@@ -114,7 +119,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
// Initial registration response
|
// Initial registration response
|
||||||
if (res.subscribed && res.returnValue && !res.command) {
|
if (res.subscribed && res.returnValue && !res.command) {
|
||||||
console.log('[Voice] Registration successful');
|
dlog('[Voice] Registration successful');
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog('ACTION', '[Voice] ✅ Registration Successful', {
|
addLog('ACTION', '[Voice] ✅ Registration Successful', {
|
||||||
message: 'Successfully registered with voice framework',
|
message: 'Successfully registered with voice framework',
|
||||||
@@ -130,7 +135,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
// setContext command received
|
// setContext command received
|
||||||
if (res.command === 'setContext' && res.voiceTicket) {
|
if (res.command === 'setContext' && res.voiceTicket) {
|
||||||
console.log('[Voice] setContext command received, ticket:', res.voiceTicket);
|
dlog('[Voice] setContext command received, ticket:', res.voiceTicket);
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog('COMMAND', '[VoiceConductor] setContext Command Received', {
|
addLog('COMMAND', '[VoiceConductor] setContext Command Received', {
|
||||||
command: res.command,
|
command: res.command,
|
||||||
@@ -150,7 +155,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
// performAction command received
|
// performAction command received
|
||||||
if (res.command === 'performAction' && res.action) {
|
if (res.command === 'performAction' && res.action) {
|
||||||
console.log('[Voice] ⭐⭐⭐ performAction command received:', res.action);
|
dlog('[Voice] ⭐⭐⭐ performAction command received:', res.action);
|
||||||
|
|
||||||
// ⭐ 중요: performAction 수신 성공 로그 (명확하게)
|
// ⭐ 중요: performAction 수신 성공 로그 (명확하게)
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -171,7 +176,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
|
|
||||||
// Get voiceTicket from Redux state (performAction response doesn't include voiceTicket)
|
// Get voiceTicket from Redux state (performAction response doesn't include voiceTicket)
|
||||||
const { voiceTicket } = getState().voice;
|
const { voiceTicket } = getState().voice;
|
||||||
console.log('[Voice] Using voiceTicket from state:', voiceTicket);
|
dlog('[Voice] Using voiceTicket from state:', voiceTicket);
|
||||||
|
|
||||||
// Process the action and report result
|
// Process the action and report result
|
||||||
dispatch(handleVoiceAction(voiceTicket, res.action));
|
dispatch(handleVoiceAction(voiceTicket, res.action));
|
||||||
@@ -179,7 +184,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error('[Voice] Registration failed:', err);
|
derror('[Voice] Registration failed:', err);
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
'ERROR',
|
'ERROR',
|
||||||
@@ -203,7 +208,7 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log('[Voice] Registration completed:', res);
|
dlog('[Voice] Registration completed:', res);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -217,21 +222,21 @@ export const registerVoiceFramework = () => (dispatch, getState) => {
|
|||||||
export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
||||||
// VUI Feature Flag Check
|
// VUI Feature Flag Check
|
||||||
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
||||||
console.log('[Voice] VUI is disabled - sendVoiceIntents skipped');
|
dlog('[Voice] VUI is disabled - sendVoiceIntents skipped');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[Voice] Sending voice intents...');
|
dlog('[Voice] Sending voice intents...');
|
||||||
|
|
||||||
// Define the intents that this app supports
|
// Define the intents that this app supports
|
||||||
// This is a sample configuration - customize based on your app's features
|
// This is a sample configuration - customize based on your app's features
|
||||||
|
|
||||||
// ⭐ 디버깅 팁: UseIME이 안되면 먼저 Select/Scroll 테스트
|
// ⭐ 디버깅 팁: UseIME이 안되면 먼저 Select/Scroll 테스트
|
||||||
console.log('[Voice] ⚠️ DEBUGGING TIP:');
|
dlog('[Voice] ⚠️ DEBUGGING TIP:');
|
||||||
console.log(' 1. UseIME might not be supported on all webOS versions');
|
dlog(' 1. UseIME might not be supported on all webOS versions');
|
||||||
console.log(' 2. Try saying "Search" or "Home" to test Select intent first');
|
dlog(' 2. Try saying "Search" or "Home" to test Select intent first');
|
||||||
console.log(' 3. If Select works but UseIME does not, UseIME is not supported');
|
dlog(' 3. If Select works but UseIME does not, UseIME is not supported');
|
||||||
console.log(' 4. Check webOS system logs: journalctl -u voiceconductor');
|
dlog(' 4. Check webOS system logs: journalctl -u voiceconductor');
|
||||||
|
|
||||||
// VoicePanel UI에도 표시
|
// VoicePanel UI에도 표시
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -312,7 +317,7 @@ export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
|||||||
|
|
||||||
lunaSend.setVoiceContext(voiceTicket, inAppIntents, {
|
lunaSend.setVoiceContext(voiceTicket, inAppIntents, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log('[Voice] Voice context set successfully:', res);
|
dlog('[Voice] Voice context set successfully:', res);
|
||||||
// Log successful context setting
|
// Log successful context setting
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
@@ -384,7 +389,7 @@ export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
|||||||
healthCheckCount++;
|
healthCheckCount++;
|
||||||
const currentState = getState().voice;
|
const currentState = getState().voice;
|
||||||
|
|
||||||
console.log(`[Voice] 🏥 Subscription Health Check #${healthCheckCount}:`, {
|
dlog(`[Voice] 🏥 Subscription Health Check #${healthCheckCount}:`, {
|
||||||
isRegistered: currentState.isRegistered,
|
isRegistered: currentState.isRegistered,
|
||||||
hasVoiceTicket: !!currentState.voiceTicket,
|
hasVoiceTicket: !!currentState.voiceTicket,
|
||||||
voiceTicket: currentState.voiceTicket,
|
voiceTicket: currentState.voiceTicket,
|
||||||
@@ -408,13 +413,13 @@ export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
|||||||
// 10번 체크하면 중단 (30초)
|
// 10번 체크하면 중단 (30초)
|
||||||
if (healthCheckCount >= 10 || currentState.lastSTTText) {
|
if (healthCheckCount >= 10 || currentState.lastSTTText) {
|
||||||
clearInterval(healthCheckInterval);
|
clearInterval(healthCheckInterval);
|
||||||
console.log('[Voice] Health check completed or STT received');
|
dlog('[Voice] Health check completed or STT received');
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
},
|
},
|
||||||
|
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error('[Voice] Failed to set voice context:', err);
|
derror('[Voice] Failed to set voice context:', err);
|
||||||
// Log failed context setting
|
// Log failed context setting
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
@@ -440,7 +445,7 @@ export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log('[Voice] setContext completed');
|
dlog('[Voice] setContext completed');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -450,7 +455,7 @@ export const sendVoiceIntents = (voiceTicket) => (dispatch, getState) => {
|
|||||||
* Process the action and report the result
|
* Process the action and report the result
|
||||||
*/
|
*/
|
||||||
export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) => {
|
export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) => {
|
||||||
console.log('[Voice] Handling voice action:', action);
|
dlog('[Voice] Handling voice action:', action);
|
||||||
|
|
||||||
// Log that we're processing the action
|
// Log that we're processing the action
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -468,7 +473,7 @@ export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) =
|
|||||||
try {
|
try {
|
||||||
// UseIME Intent 처리 - STT 텍스트 수신
|
// UseIME Intent 처리 - STT 텍스트 수신
|
||||||
if (action.intent === 'UseIME' && action.value) {
|
if (action.intent === 'UseIME' && action.value) {
|
||||||
console.log('[Voice] ⭐ STT Text received:', action.value);
|
dlog('[Voice] ⭐ STT Text received:', action.value);
|
||||||
|
|
||||||
// 📝 로그: STT 텍스트 추출 과정
|
// 📝 로그: STT 텍스트 추출 과정
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -511,7 +516,7 @@ export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) =
|
|||||||
} else if (action.intent === 'Scroll' && action.itemId) {
|
} else if (action.intent === 'Scroll' && action.itemId) {
|
||||||
result = dispatch(handleScrollIntent(action.itemId));
|
result = dispatch(handleScrollIntent(action.itemId));
|
||||||
} else {
|
} else {
|
||||||
console.warn('[Voice] Unknown intent or missing itemId:', action);
|
dwarn('[Voice] Unknown intent or missing itemId:', action);
|
||||||
result = false;
|
result = false;
|
||||||
feedback = {
|
feedback = {
|
||||||
voiceUi: {
|
voiceUi: {
|
||||||
@@ -520,7 +525,7 @@ export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) =
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[Voice] Error processing action:', error);
|
derror('[Voice] Error processing action:', error);
|
||||||
result = false;
|
result = false;
|
||||||
feedback = {
|
feedback = {
|
||||||
voiceUi: {
|
voiceUi: {
|
||||||
@@ -548,32 +553,32 @@ export const handleVoiceAction = (voiceTicket, action) => (dispatch, getState) =
|
|||||||
* Handle Select intent actions
|
* Handle Select intent actions
|
||||||
*/
|
*/
|
||||||
const handleSelectIntent = (itemId) => (dispatch, getState) => {
|
const handleSelectIntent = (itemId) => (dispatch, getState) => {
|
||||||
console.log('[Voice] Processing Select intent for:', itemId);
|
dlog('[Voice] Processing Select intent for:', itemId);
|
||||||
|
|
||||||
// TODO: Implement actual navigation/action logic
|
// TODO: Implement actual navigation/action logic
|
||||||
switch (itemId) {
|
switch (itemId) {
|
||||||
case 'voice-search-button':
|
case 'voice-search-button':
|
||||||
console.log('[Voice] Navigate to Search');
|
dlog('[Voice] Navigate to Search');
|
||||||
// dispatch(navigateToSearch());
|
// dispatch(navigateToSearch());
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 'voice-cart-button':
|
case 'voice-cart-button':
|
||||||
console.log('[Voice] Navigate to Cart');
|
dlog('[Voice] Navigate to Cart');
|
||||||
// dispatch(navigateToCart());
|
// dispatch(navigateToCart());
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 'voice-home-button':
|
case 'voice-home-button':
|
||||||
console.log('[Voice] Navigate to Home');
|
dlog('[Voice] Navigate to Home');
|
||||||
// dispatch(navigateToHome());
|
// dispatch(navigateToHome());
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 'voice-mypage-button':
|
case 'voice-mypage-button':
|
||||||
console.log('[Voice] Navigate to My Page');
|
dlog('[Voice] Navigate to My Page');
|
||||||
// dispatch(navigateToMyPage());
|
// dispatch(navigateToMyPage());
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn('[Voice] Unknown Select itemId:', itemId);
|
dwarn('[Voice] Unknown Select itemId:', itemId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -582,22 +587,22 @@ const handleSelectIntent = (itemId) => (dispatch, getState) => {
|
|||||||
* Handle Scroll intent actions
|
* Handle Scroll intent actions
|
||||||
*/
|
*/
|
||||||
const handleScrollIntent = (itemId) => (dispatch, getState) => {
|
const handleScrollIntent = (itemId) => (dispatch, getState) => {
|
||||||
console.log('[Voice] Processing Scroll intent for:', itemId);
|
dlog('[Voice] Processing Scroll intent for:', itemId);
|
||||||
|
|
||||||
// TODO: Implement actual scroll logic
|
// TODO: Implement actual scroll logic
|
||||||
switch (itemId) {
|
switch (itemId) {
|
||||||
case 'voice-scroll-up':
|
case 'voice-scroll-up':
|
||||||
console.log('[Voice] Scroll Up');
|
dlog('[Voice] Scroll Up');
|
||||||
// Implement scroll up logic
|
// Implement scroll up logic
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 'voice-scroll-down':
|
case 'voice-scroll-down':
|
||||||
console.log('[Voice] Scroll Down');
|
dlog('[Voice] Scroll Down');
|
||||||
// Implement scroll down logic
|
// Implement scroll down logic
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.warn('[Voice] Unknown Scroll itemId:', itemId);
|
dwarn('[Voice] Unknown Scroll itemId:', itemId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -608,7 +613,7 @@ const handleScrollIntent = (itemId) => (dispatch, getState) => {
|
|||||||
export const reportActionResult =
|
export const reportActionResult =
|
||||||
(voiceTicket, result, feedback = null) =>
|
(voiceTicket, result, feedback = null) =>
|
||||||
(dispatch, getState) => {
|
(dispatch, getState) => {
|
||||||
console.log('[Voice] Reporting action result:', { result, feedback });
|
dlog('[Voice] Reporting action result:', { result, feedback });
|
||||||
|
|
||||||
// Log the report request
|
// Log the report request
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -622,7 +627,7 @@ export const reportActionResult =
|
|||||||
|
|
||||||
lunaSend.reportVoiceActionResult(voiceTicket, result, feedback, {
|
lunaSend.reportVoiceActionResult(voiceTicket, result, feedback, {
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
console.log('[Voice] Action result reported successfully:', res);
|
dlog('[Voice] Action result reported successfully:', res);
|
||||||
// Log successful report
|
// Log successful report
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
@@ -643,7 +648,7 @@ export const reportActionResult =
|
|||||||
},
|
},
|
||||||
|
|
||||||
onFailure: (err) => {
|
onFailure: (err) => {
|
||||||
console.error('[Voice] Failed to report action result:', err);
|
derror('[Voice] Failed to report action result:', err);
|
||||||
// Log failed report
|
// Log failed report
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog(
|
addLog(
|
||||||
@@ -664,7 +669,7 @@ export const reportActionResult =
|
|||||||
},
|
},
|
||||||
|
|
||||||
onComplete: (res) => {
|
onComplete: (res) => {
|
||||||
console.log('[Voice] reportActionResult completed');
|
dlog('[Voice] reportActionResult completed');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -676,14 +681,14 @@ export const reportActionResult =
|
|||||||
export const unregisterVoiceFramework = () => (dispatch, getState) => {
|
export const unregisterVoiceFramework = () => (dispatch, getState) => {
|
||||||
// VUI Feature Flag Check
|
// VUI Feature Flag Check
|
||||||
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
if (!FEATURE_FLAGS.ENABLE_VUI) {
|
||||||
console.log('[Voice] VUI is disabled - unregisterVoiceFramework skipped');
|
dlog('[Voice] VUI is disabled - unregisterVoiceFramework skipped');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { voiceHandler } = getState().voice;
|
const { voiceHandler } = getState().voice;
|
||||||
const isTV = typeof window === 'object' && window.PalmSystem;
|
const isTV = typeof window === 'object' && window.PalmSystem;
|
||||||
|
|
||||||
console.log('[Voice] Unregistering from voice framework');
|
dlog('[Voice] Unregistering from voice framework');
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addLog('ACTION', '[Voice] 🔌 Unregistering Voice Framework', {
|
addLog('ACTION', '[Voice] 🔌 Unregistering Voice Framework', {
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import webSpeechService from '../services/webSpeech/WebSpeechService';
|
import webSpeechService from '../services/webSpeech/WebSpeechService';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Web Speech 초기화 및 시작
|
* Web Speech 초기화 및 시작
|
||||||
@@ -10,12 +15,12 @@ import webSpeechService from '../services/webSpeech/WebSpeechService';
|
|||||||
export const initializeWebSpeech =
|
export const initializeWebSpeech =
|
||||||
(config = {}) =>
|
(config = {}) =>
|
||||||
(dispatch) => {
|
(dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-INIT: 초기화 시작');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-INIT: 초기화 시작');
|
||||||
|
|
||||||
// 지원 여부 확인
|
// 지원 여부 확인
|
||||||
if (!webSpeechService.isSupported) {
|
if (!webSpeechService.isSupported) {
|
||||||
const error = 'Web Speech API is not supported in this browser';
|
const error = 'Web Speech API is not supported in this browser';
|
||||||
console.error('[VoiceInput]-[WebSpeech] ACTION-INIT: ❌ Web Speech API 미지원');
|
derror('[VoiceInput]-[WebSpeech] ACTION-INIT: ❌ Web Speech API 미지원');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_ERROR,
|
type: types.WEB_SPEECH_ERROR,
|
||||||
payload: { error, message: error },
|
payload: { error, message: error },
|
||||||
@@ -32,7 +37,7 @@ export const initializeWebSpeech =
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
console.error('[VoiceInput]-[WebSpeech] ACTION-INIT: ❌ 초기화 실패');
|
derror('[VoiceInput]-[WebSpeech] ACTION-INIT: ❌ 초기화 실패');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_ERROR,
|
type: types.WEB_SPEECH_ERROR,
|
||||||
payload: { error: 'Failed to initialize', message: 'Failed to initialize Web Speech' },
|
payload: { error: 'Failed to initialize', message: 'Failed to initialize Web Speech' },
|
||||||
@@ -42,14 +47,14 @@ export const initializeWebSpeech =
|
|||||||
|
|
||||||
// 이벤트 핸들러 등록
|
// 이벤트 핸들러 등록
|
||||||
webSpeechService.on('start', () => {
|
webSpeechService.on('start', () => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_START 디스패치');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_START 디스패치');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_START,
|
type: types.WEB_SPEECH_START,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
webSpeechService.on('result', (result) => {
|
webSpeechService.on('result', (result) => {
|
||||||
console.log(
|
dlog(
|
||||||
`[VoiceInput]-[WebSpeech] ACTION-EVENT: result 수신 - isFinal=${result.isFinal}, text="${result.transcript}"`
|
`[VoiceInput]-[WebSpeech] ACTION-EVENT: result 수신 - isFinal=${result.isFinal}, text="${result.transcript}"`
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -62,7 +67,7 @@ export const initializeWebSpeech =
|
|||||||
// ✅ Final 결과 처리 추가 (TV 환경 대응)
|
// ✅ Final 결과 처리 추가 (TV 환경 대응)
|
||||||
// TV에서는 final result가 와야 API 호출이 가능할 수 있음
|
// TV에서는 final result가 와야 API 호출이 가능할 수 있음
|
||||||
if (result.isFinal) {
|
if (result.isFinal) {
|
||||||
console.log(
|
dlog(
|
||||||
`[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_FINAL_RESULT 디스패치 - finalText="${result.transcript}"`
|
`[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_FINAL_RESULT 디스패치 - finalText="${result.transcript}"`
|
||||||
);
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -76,7 +81,7 @@ export const initializeWebSpeech =
|
|||||||
});
|
});
|
||||||
|
|
||||||
webSpeechService.on('error', (errorInfo) => {
|
webSpeechService.on('error', (errorInfo) => {
|
||||||
console.error(
|
derror(
|
||||||
`[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_ERROR 디스패치 - error="${errorInfo.error}"`
|
`[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_ERROR 디스패치 - error="${errorInfo.error}"`
|
||||||
);
|
);
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -86,13 +91,13 @@ export const initializeWebSpeech =
|
|||||||
});
|
});
|
||||||
|
|
||||||
webSpeechService.on('end', () => {
|
webSpeechService.on('end', () => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_END 디스패치');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-EVENT: WEB_SPEECH_END 디스패치');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_END,
|
type: types.WEB_SPEECH_END,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-INIT: ✅ WEB_SPEECH_INITIALIZED 디스패치');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-INIT: ✅ WEB_SPEECH_INITIALIZED 디스패치');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_INITIALIZED,
|
type: types.WEB_SPEECH_INITIALIZED,
|
||||||
});
|
});
|
||||||
@@ -104,11 +109,11 @@ export const initializeWebSpeech =
|
|||||||
* 음성 인식 시작
|
* 음성 인식 시작
|
||||||
*/
|
*/
|
||||||
export const startWebSpeech = () => (dispatch) => {
|
export const startWebSpeech = () => (dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-START: 음성 인식 시작 요청');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-START: 음성 인식 시작 요청');
|
||||||
const started = webSpeechService.start();
|
const started = webSpeechService.start();
|
||||||
|
|
||||||
if (!started) {
|
if (!started) {
|
||||||
console.error('[VoiceInput]-[WebSpeech] ACTION-START: ❌ 음성 인식 시작 실패');
|
derror('[VoiceInput]-[WebSpeech] ACTION-START: ❌ 음성 인식 시작 실패');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_ERROR,
|
type: types.WEB_SPEECH_ERROR,
|
||||||
payload: { error: 'Failed to start', message: 'Failed to start recognition' },
|
payload: { error: 'Failed to start', message: 'Failed to start recognition' },
|
||||||
@@ -120,7 +125,7 @@ export const startWebSpeech = () => (dispatch) => {
|
|||||||
* 음성 인식 중지
|
* 음성 인식 중지
|
||||||
*/
|
*/
|
||||||
export const stopWebSpeech = () => (dispatch) => {
|
export const stopWebSpeech = () => (dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-STOP: 음성 인식 중지 요청');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-STOP: 음성 인식 중지 요청');
|
||||||
webSpeechService.stop();
|
webSpeechService.stop();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,7 +133,7 @@ export const stopWebSpeech = () => (dispatch) => {
|
|||||||
* 음성 인식 중단
|
* 음성 인식 중단
|
||||||
*/
|
*/
|
||||||
export const abortWebSpeech = () => (dispatch) => {
|
export const abortWebSpeech = () => (dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-ABORT: 음성 인식 중단 (즉시) 요청');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-ABORT: 음성 인식 중단 (즉시) 요청');
|
||||||
webSpeechService.abort();
|
webSpeechService.abort();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -136,21 +141,21 @@ export const abortWebSpeech = () => (dispatch) => {
|
|||||||
* 리소스 정리
|
* 리소스 정리
|
||||||
*/
|
*/
|
||||||
export const cleanupWebSpeech = () => (dispatch) => {
|
export const cleanupWebSpeech = () => (dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-CLEANUP: 리소스 정리 요청');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-CLEANUP: 리소스 정리 요청');
|
||||||
webSpeechService.cleanup();
|
webSpeechService.cleanup();
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.WEB_SPEECH_CLEANUP,
|
type: types.WEB_SPEECH_CLEANUP,
|
||||||
});
|
});
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-CLEANUP: ✅ WEB_SPEECH_CLEANUP 디스패치');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-CLEANUP: ✅ WEB_SPEECH_CLEANUP 디스패치');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* STT 텍스트 초기화 (이전 음성 인식 결과 제거)
|
* STT 텍스트 초기화 (이전 음성 인식 결과 제거)
|
||||||
*/
|
*/
|
||||||
export const clearSTTText = () => (dispatch) => {
|
export const clearSTTText = () => (dispatch) => {
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-CLEAR: STT 텍스트 초기화 요청');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-CLEAR: STT 텍스트 초기화 요청');
|
||||||
dispatch({
|
dispatch({
|
||||||
type: types.VOICE_CLEAR_STATE,
|
type: types.VOICE_CLEAR_STATE,
|
||||||
});
|
});
|
||||||
console.log('[VoiceInput]-[WebSpeech] ACTION-CLEAR: ✅ VOICE_CLEAR_STATE 디스패치');
|
dlog('[VoiceInput]-[WebSpeech] ACTION-CLEAR: ✅ VOICE_CLEAR_STATE 디스패치');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import { types } from "../actions/actionTypes";
|
import { types } from '../actions/actionTypes';
|
||||||
import { SHOPTIME_BASE_URL } from "../api/apiConfig";
|
import { SHOPTIME_BASE_URL } from '../api/apiConfig';
|
||||||
import * as Config from "../utils/Config";
|
import * as Config from '../utils/Config';
|
||||||
import { readLocalStorage, writeLocalStorage } from "../utils/helperMethods";
|
import { readLocalStorage, writeLocalStorage } from '../utils/helperMethods';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const initialLocalSettings = {
|
export const initialLocalSettings = {
|
||||||
version: 1, // if version changed data will be deleted
|
version: 1, // if version changed data will be deleted
|
||||||
@@ -10,9 +15,9 @@ export const initialLocalSettings = {
|
|||||||
accessToken: null,
|
accessToken: null,
|
||||||
refreshToken: null,
|
refreshToken: null,
|
||||||
phoneNumbers: {},
|
phoneNumbers: {},
|
||||||
logEnable: typeof window === "object" && !window.PalmSystem,
|
logEnable: typeof window === 'object' && !window.PalmSystem,
|
||||||
recentItems: [],
|
recentItems: [],
|
||||||
languageSetting: "system", //US, GB, DE, RU
|
languageSetting: 'system', //US, GB, DE, RU
|
||||||
watchRecord: {},
|
watchRecord: {},
|
||||||
oldDb8Deleted: false,
|
oldDb8Deleted: false,
|
||||||
skipEndOfServicePopup: false,
|
skipEndOfServicePopup: false,
|
||||||
@@ -23,10 +28,7 @@ const updateAWithBKeys = (A, B) => {
|
|||||||
for (const key in B) {
|
for (const key in B) {
|
||||||
if (Object.prototype.hasOwnProperty.call(B, key)) {
|
if (Object.prototype.hasOwnProperty.call(B, key)) {
|
||||||
// B에만 존재하는 키를 A에 업데이트
|
// B에만 존재하는 키를 A에 업데이트
|
||||||
if (
|
if (!Object.prototype.hasOwnProperty.call(A, key) || A[key] === undefined) {
|
||||||
!Object.prototype.hasOwnProperty.call(A, key) ||
|
|
||||||
A[key] === undefined
|
|
||||||
) {
|
|
||||||
A[key] = B[key];
|
A[key] = B[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,23 +36,31 @@ const updateAWithBKeys = (A, B) => {
|
|||||||
return A;
|
return A;
|
||||||
};
|
};
|
||||||
const updateInitialLocalSettings = () => {
|
const updateInitialLocalSettings = () => {
|
||||||
let data = readLocalStorage("localSettings", initialLocalSettings);
|
let data = readLocalStorage('localSettings', initialLocalSettings);
|
||||||
|
|
||||||
// pc 에서 web hotsting 서버에 접속시 서버 변경을 제한한다.
|
// pc 에서 web hotsting 서버에 접속시 서버 변경을 제한한다.
|
||||||
if( typeof window === "object" && !window.PalmSystem && window.location.href.indexOf(SHOPTIME_BASE_URL) > 0){
|
if (
|
||||||
|
typeof window === 'object' &&
|
||||||
|
!window.PalmSystem &&
|
||||||
|
window.location.href.indexOf(SHOPTIME_BASE_URL) > 0
|
||||||
|
) {
|
||||||
data.preventServerChange = true;
|
data.preventServerChange = true;
|
||||||
let hrefUrl = window.location.href.split(".")[0];
|
let hrefUrl = window.location.href.split('.')[0];
|
||||||
if (hrefUrl.indexOf("qt2") >= 0) {
|
if (hrefUrl.indexOf('qt2') >= 0) {
|
||||||
data.serverType = 'qt2';
|
data.serverType = 'qt2';
|
||||||
} else if (hrefUrl.indexOf("qt") >= 0) {
|
} else if (hrefUrl.indexOf('qt') >= 0) {
|
||||||
data.serverType = 'qt';
|
data.serverType = 'qt';
|
||||||
} else {
|
} else {
|
||||||
data.serverType = 'prd';
|
data.serverType = 'prd';
|
||||||
}
|
}
|
||||||
data.ricCodeSetting = hrefUrl.split("-")[1] ?? hrefUrl.split("//")[1];
|
data.ricCodeSetting = hrefUrl.split('-')[1] ?? hrefUrl.split('//')[1];
|
||||||
if (data.ricCodeSetting === 'aic') {
|
if (data.ricCodeSetting === 'aic') {
|
||||||
data.languageSetting = 'US';
|
data.languageSetting = 'US';
|
||||||
}else if(data.ricCodeSetting === 'eic' && (data.languageSetting !== 'GB' && data.languageSetting !== 'DE')){
|
} else if (
|
||||||
|
data.ricCodeSetting === 'eic' &&
|
||||||
|
data.languageSetting !== 'GB' &&
|
||||||
|
data.languageSetting !== 'DE'
|
||||||
|
) {
|
||||||
data.languageSetting = 'GB';
|
data.languageSetting = 'GB';
|
||||||
} else if (data.ricCodeSetting === 'ruc') {
|
} else if (data.ricCodeSetting === 'ruc') {
|
||||||
data.languageSetting = 'RU';
|
data.languageSetting = 'RU';
|
||||||
@@ -58,25 +68,20 @@ const updateInitialLocalSettings = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data.version !== initialLocalSettings.version) {
|
if (data.version !== initialLocalSettings.version) {
|
||||||
console.log(
|
dlog('localSettingsReducer version updated. All datas are initialized.');
|
||||||
"localSettingsReducer version updated. All datas are initialized."
|
|
||||||
);
|
|
||||||
data = initialLocalSettings;
|
data = initialLocalSettings;
|
||||||
writeLocalStorage("localSettings", initialLocalSettings);
|
writeLocalStorage('localSettings', initialLocalSettings);
|
||||||
} else {
|
} else {
|
||||||
updateAWithBKeys(data, initialLocalSettings);
|
updateAWithBKeys(data, initialLocalSettings);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const localSettingsReducer = (
|
export const localSettingsReducer = (state = updateInitialLocalSettings(), action) => {
|
||||||
state = updateInitialLocalSettings(),
|
|
||||||
action
|
|
||||||
) => {
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case types.CHANGE_LOCAL_SETTINGS: {
|
case types.CHANGE_LOCAL_SETTINGS: {
|
||||||
const newState = Object.assign({}, state, action.payload);
|
const newState = Object.assign({}, state, action.payload);
|
||||||
writeLocalStorage("localSettings", newState);
|
writeLocalStorage('localSettings', newState);
|
||||||
return newState;
|
return newState;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
// Media Overlay Reducer - 3 Layer 구조(MediaPanel + MediaPlayer)용 overlay 상태 관리
|
// Media Overlay Reducer - 3 Layer 구조(MediaPanel + MediaPlayer)용 overlay 상태 관리
|
||||||
import { MEDIA_OVERLAY_ACTIONS } from '../actions/mediaOverlayActions';
|
import { MEDIA_OVERLAY_ACTIONS } from '../actions/mediaOverlayActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const initialState = {
|
export const initialState = {
|
||||||
// Media Overlay Controls 상태
|
// Media Overlay Controls 상태
|
||||||
@@ -86,10 +91,13 @@ const handlers = {
|
|||||||
lastAction: MEDIA_OVERLAY_ACTIONS.SET_MEDIA_CONTROLS_TOGGLE,
|
lastAction: MEDIA_OVERLAY_ACTIONS.SET_MEDIA_CONTROLS_TOGGLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 상태 변화');
|
dlog('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 상태 변화');
|
||||||
console.log('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 이전 visible:', isCurrentlyVisible);
|
dlog('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 이전 visible:', isCurrentlyVisible);
|
||||||
console.log('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 이후 visible:', newState.controls.visible);
|
dlog(
|
||||||
console.log('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 전체 상태:', newState);
|
'🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 이후 visible:',
|
||||||
|
newState.controls.visible
|
||||||
|
);
|
||||||
|
dlog('🔄 [mediaOverlayReducer.SET_MEDIA_CONTROLS_TOGGLE] 전체 상태:', newState);
|
||||||
|
|
||||||
return newState;
|
return newState;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { MOCK_CART_TYPES } from '../actions/mockCartActions';
|
import { MOCK_CART_TYPES } from '../actions/mockCartActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 브라우저 환경 확인
|
// 브라우저 환경 확인
|
||||||
const isBrowser = typeof window !== 'undefined' && typeof window.localStorage !== 'undefined';
|
const isBrowser = typeof window !== 'undefined' && typeof window.localStorage !== 'undefined';
|
||||||
@@ -43,7 +48,7 @@ const saveToLocalStorage = (state) => {
|
|||||||
};
|
};
|
||||||
window.localStorage.setItem(MOCK_CART_STORAGE_KEY, JSON.stringify(dataToSave));
|
window.localStorage.setItem(MOCK_CART_STORAGE_KEY, JSON.stringify(dataToSave));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[MockCartReducer] localStorage 저장 실패:', error);
|
derror('[MockCartReducer] localStorage 저장 실패:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,7 +72,7 @@ const loadFromLocalStorage = () => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('[MockCartReducer] localStorage 로드 실패:', error);
|
derror('[MockCartReducer] localStorage 로드 실패:', error);
|
||||||
}
|
}
|
||||||
return initialState;
|
return initialState;
|
||||||
};
|
};
|
||||||
@@ -79,13 +84,12 @@ const loadFromLocalStorage = () => {
|
|||||||
* @returns {Object} 중복 여부와 기존 아이템 인덱스
|
* @returns {Object} 중복 여부와 기존 아이템 인덱스
|
||||||
*/
|
*/
|
||||||
const findDuplicateItem = (cartItems, newItem) => {
|
const findDuplicateItem = (cartItems, newItem) => {
|
||||||
const index = cartItems.findIndex(item =>
|
const index = cartItems.findIndex(
|
||||||
item.prdtId === newItem.prdtId &&
|
(item) => item.prdtId === newItem.prdtId && item.optNm === newItem.optNm
|
||||||
item.optNm === newItem.optNm
|
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
isDuplicate: index !== -1,
|
isDuplicate: index !== -1,
|
||||||
index
|
index,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,7 +109,7 @@ const calculateTotals = (cartItems) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
totalQuantity,
|
totalQuantity,
|
||||||
totalPrice: parseFloat(totalPrice.toFixed(2))
|
totalPrice: parseFloat(totalPrice.toFixed(2)),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -145,12 +149,12 @@ export const mockCartReducer = (state = loadFromLocalStorage(), action) => {
|
|||||||
const currentQty = updatedItems[index].prodQty || updatedItems[index].qty || 1;
|
const currentQty = updatedItems[index].prodQty || updatedItems[index].qty || 1;
|
||||||
const newQty = item.prodQty || item.qty || 1;
|
const newQty = item.prodQty || item.qty || 1;
|
||||||
|
|
||||||
console.log('[MockCartReducer] Quantity update - Current:', currentQty, 'Adding:', newQty);
|
dlog('[MockCartReducer] Quantity update - Current:', currentQty, 'Adding:', newQty);
|
||||||
|
|
||||||
updatedItems[index] = {
|
updatedItems[index] = {
|
||||||
...updatedItems[index],
|
...updatedItems[index],
|
||||||
prodQty: currentQty + newQty,
|
prodQty: currentQty + newQty,
|
||||||
qty: currentQty + newQty // qty 필드도 동기화
|
qty: currentQty + newQty, // qty 필드도 동기화
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// 새 상품 추가
|
// 새 상품 추가
|
||||||
@@ -173,7 +177,7 @@ export const mockCartReducer = (state = loadFromLocalStorage(), action) => {
|
|||||||
|
|
||||||
case MOCK_CART_TYPES.REMOVE_FROM_MOCK_CART: {
|
case MOCK_CART_TYPES.REMOVE_FROM_MOCK_CART: {
|
||||||
const { prodSno } = action.payload;
|
const { prodSno } = action.payload;
|
||||||
const updatedItems = state.cartInfo.filter(item => item.prodSno !== prodSno);
|
const updatedItems = state.cartInfo.filter((item) => item.prodSno !== prodSno);
|
||||||
|
|
||||||
const newState = {
|
const newState = {
|
||||||
...state,
|
...state,
|
||||||
@@ -191,11 +195,11 @@ export const mockCartReducer = (state = loadFromLocalStorage(), action) => {
|
|||||||
|
|
||||||
case MOCK_CART_TYPES.UPDATE_MOCK_CART_ITEM: {
|
case MOCK_CART_TYPES.UPDATE_MOCK_CART_ITEM: {
|
||||||
const { prodSno, quantity } = action.payload;
|
const { prodSno, quantity } = action.payload;
|
||||||
const updatedItems = state.cartInfo.map(item => {
|
const updatedItems = state.cartInfo.map((item) => {
|
||||||
if (item.prodSno === prodSno) {
|
if (item.prodSno === prodSno) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
prodQty: Math.max(1, quantity) // 최소 1개 보장
|
prodQty: Math.max(1, quantity), // 최소 1개 보장
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
@@ -220,7 +224,7 @@ export const mockCartReducer = (state = loadFromLocalStorage(), action) => {
|
|||||||
|
|
||||||
if (quantity <= 0) {
|
if (quantity <= 0) {
|
||||||
// 수량이 0이면 상품 제거
|
// 수량이 0이면 상품 제거
|
||||||
const updatedItems = state.cartInfo.filter(item => item.prodSno !== prodSno);
|
const updatedItems = state.cartInfo.filter((item) => item.prodSno !== prodSno);
|
||||||
|
|
||||||
const newState = {
|
const newState = {
|
||||||
...state,
|
...state,
|
||||||
@@ -236,11 +240,11 @@ export const mockCartReducer = (state = loadFromLocalStorage(), action) => {
|
|||||||
return newState;
|
return newState;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatedItems = state.cartInfo.map(item => {
|
const updatedItems = state.cartInfo.map((item) => {
|
||||||
if (item.prodSno === prodSno) {
|
if (item.prodSno === prodSno) {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
prodQty: quantity
|
prodQty: quantity,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { types } from '../actions/actionTypes';
|
import { types } from '../actions/actionTypes';
|
||||||
import { PLAYBACK_STATUS, DISPLAY_STATUS } from '../actions/playActions';
|
import { PLAYBACK_STATUS, DISPLAY_STATUS } from '../actions/playActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
subTitleBlobs: {},
|
subTitleBlobs: {},
|
||||||
@@ -103,7 +108,7 @@ export const playReducer = (state = initialState, action) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (hasImportantChange) {
|
if (hasImportantChange) {
|
||||||
console.log('🔄 [Redux Reducer] VIDEO PLAY STATE CRITICAL CHANGE', {
|
dlog('🔄 [Redux Reducer] VIDEO PLAY STATE CRITICAL CHANGE', {
|
||||||
previousPaused: state.videoPlayState?.isPaused,
|
previousPaused: state.videoPlayState?.isPaused,
|
||||||
newPaused: newState.isPaused,
|
newPaused: newState.isPaused,
|
||||||
previousPlaying: state.videoPlayState?.isPlaying,
|
previousPlaying: state.videoPlayState?.isPlaying,
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { types } from '../actions/actionTypes';
|
import { types } from '../actions/actionTypes';
|
||||||
import { curry, get, set } from '../utils/fp';
|
import { curry, get, set } from '../utils/fp';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
bestSellerData: {},
|
bestSellerData: {},
|
||||||
@@ -61,11 +66,11 @@ const handleUserReviewList = curry((state, action) => {
|
|||||||
const reviewListData = get('payload', action);
|
const reviewListData = get('payload', action);
|
||||||
const prdtId = get(['payload', 'prdtId'], action);
|
const prdtId = get(['payload', 'prdtId'], action);
|
||||||
|
|
||||||
console.log('[productReducer_useReviewList] 🟡 handleUserReviewList:', {
|
dlog('[productReducer_useReviewList] 🟡 handleUserReviewList:', {
|
||||||
prdtId,
|
prdtId,
|
||||||
reviewListDataKeys: reviewListData ? Object.keys(reviewListData) : 'null',
|
reviewListDataKeys: reviewListData ? Object.keys(reviewListData) : 'null',
|
||||||
reviewListLength: reviewListData?.reviewList?.length || 0,
|
reviewListLength: reviewListData?.reviewList?.length || 0,
|
||||||
reviewDetail: reviewListData?.reviewDetail
|
reviewDetail: reviewListData?.reviewDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
return set('reviewListData', reviewListData, set('loadedListPrdtId', prdtId, state));
|
return set('reviewListData', reviewListData, set('loadedListPrdtId', prdtId, state));
|
||||||
@@ -89,11 +94,11 @@ const handleReviewFilters = curry((state, action) => {
|
|||||||
const reviewFiltersData = get('payload', action);
|
const reviewFiltersData = get('payload', action);
|
||||||
const prdtId = get(['payload', 'prdtId'], action);
|
const prdtId = get(['payload', 'prdtId'], action);
|
||||||
|
|
||||||
console.log('[productReducer_reviewFilters] 🟡 handleReviewFilters:', {
|
dlog('[productReducer_reviewFilters] 🟡 handleReviewFilters:', {
|
||||||
prdtId,
|
prdtId,
|
||||||
reviewFiltersDataKeys: reviewFiltersData ? Object.keys(reviewFiltersData) : 'null',
|
reviewFiltersDataKeys: reviewFiltersData ? Object.keys(reviewFiltersData) : 'null',
|
||||||
filtersLength: reviewFiltersData?.filters?.length || 0,
|
filtersLength: reviewFiltersData?.filters?.length || 0,
|
||||||
filters: reviewFiltersData?.filters
|
filters: reviewFiltersData?.filters,
|
||||||
});
|
});
|
||||||
|
|
||||||
return set('reviewFiltersData', reviewFiltersData, set('loadedFiltersPrdtId', prdtId, state));
|
return set('reviewFiltersData', reviewFiltersData, set('loadedFiltersPrdtId', prdtId, state));
|
||||||
@@ -105,11 +110,13 @@ const handleFilteredReviewList = curry((state, action) => {
|
|||||||
const filterTpCd = get(['payload', 'filterTpCd'], action);
|
const filterTpCd = get(['payload', 'filterTpCd'], action);
|
||||||
const filterTpVal = get(['payload', 'filterTpVal'], action);
|
const filterTpVal = get(['payload', 'filterTpVal'], action);
|
||||||
|
|
||||||
console.log('[productReducer_filteredReviewList] 🟡 handleFilteredReviewList:', {
|
dlog('[productReducer_filteredReviewList] 🟡 handleFilteredReviewList:', {
|
||||||
filterTpCd,
|
filterTpCd,
|
||||||
filterTpVal,
|
filterTpVal,
|
||||||
filteredReviewListDataKeys: filteredReviewListData ? Object.keys(filteredReviewListData) : 'null',
|
filteredReviewListDataKeys: filteredReviewListData
|
||||||
reviewListLength: filteredReviewListData?.reviewList?.length || 0
|
? Object.keys(filteredReviewListData)
|
||||||
|
: 'null',
|
||||||
|
reviewListLength: filteredReviewListData?.reviewList?.length || 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
// filteredReviewListData와 currentReviewFilter 모두 업데이트
|
// filteredReviewListData와 currentReviewFilter 모두 업데이트
|
||||||
@@ -125,7 +132,9 @@ const handleFilteredReviewList = curry((state, action) => {
|
|||||||
// All Star 필터 해제 핸들러 - 필터 상태와 필터링된 데이터를 초기화
|
// All Star 필터 해제 핸들러 - 필터 상태와 필터링된 데이터를 초기화
|
||||||
// ✅ CRITICAL FIX: reviewListData도 함께 초기화하여 Back 시 재로드되도록 함
|
// ✅ CRITICAL FIX: reviewListData도 함께 초기화하여 Back 시 재로드되도록 함
|
||||||
const handleClearReviewFilter = (state, action) => {
|
const handleClearReviewFilter = (state, action) => {
|
||||||
console.log('[productReducer_clearReviewFilter] 🟡 handleClearReviewFilter: 필터 해제됨 + 리뷰 데이터 초기화');
|
dlog(
|
||||||
|
'[productReducer_clearReviewFilter] 🟡 handleClearReviewFilter: 필터 해제됨 + 리뷰 데이터 초기화'
|
||||||
|
);
|
||||||
|
|
||||||
let newState = state;
|
let newState = state;
|
||||||
// 캐시 ID 초기화 (다시 로드되도록)
|
// 캐시 ID 초기화 (다시 로드되도록)
|
||||||
@@ -163,12 +172,12 @@ export const productReducer = (state = initialState, action = {}) => {
|
|||||||
|
|
||||||
// v2 디버깅: GET_USER_REVIEW_LIST 액션 확인
|
// v2 디버깅: GET_USER_REVIEW_LIST 액션 확인
|
||||||
if (type === 'GET_USER_REVIEW_LIST') {
|
if (type === 'GET_USER_REVIEW_LIST') {
|
||||||
console.log('[productReducer_useReviewList] 🟢 GET_USER_REVIEW_LIST 액션 수신:', {
|
dlog('[productReducer_useReviewList] 🟢 GET_USER_REVIEW_LIST 액션 수신:', {
|
||||||
actionType: type,
|
actionType: type,
|
||||||
payloadKeys: action.payload ? Object.keys(action.payload) : 'null',
|
payloadKeys: action.payload ? Object.keys(action.payload) : 'null',
|
||||||
reviewListLength: action.payload?.reviewList?.length || 0,
|
reviewListLength: action.payload?.reviewList?.length || 0,
|
||||||
prdtId: action.payload?.prdtId,
|
prdtId: action.payload?.prdtId,
|
||||||
handler: !!handler
|
handler: !!handler,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,11 +185,11 @@ export const productReducer = (state = initialState, action = {}) => {
|
|||||||
|
|
||||||
// v2 디버깅: 상태 업데이트 확인
|
// v2 디버깅: 상태 업데이트 확인
|
||||||
if (type === 'GET_USER_REVIEW_LIST') {
|
if (type === 'GET_USER_REVIEW_LIST') {
|
||||||
console.log('[productReducer_useReviewList] 🔵 상태 업데이트 완료:', {
|
dlog('[productReducer_useReviewList] 🔵 상태 업데이트 완료:', {
|
||||||
reviewListDataExists: !!newState.reviewListData,
|
reviewListDataExists: !!newState.reviewListData,
|
||||||
reviewListDataKeys: newState.reviewListData ? Object.keys(newState.reviewListData) : 'null',
|
reviewListDataKeys: newState.reviewListData ? Object.keys(newState.reviewListData) : 'null',
|
||||||
loadedListPrdtId: newState.loadedListPrdtId,
|
loadedListPrdtId: newState.loadedListPrdtId,
|
||||||
reviewListLength: newState.reviewListData?.reviewList?.length || 0
|
reviewListLength: newState.reviewListData?.reviewList?.length || 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
// Video Overlay Reducer - modal=true 상태에서 비디오 오버레이 제어
|
// Video Overlay Reducer - modal=true 상태에서 비디오 오버레이 제어
|
||||||
import { VIDEO_OVERLAY_ACTIONS } from '../actions/videoOverlayActions';
|
import { VIDEO_OVERLAY_ACTIONS } from '../actions/videoOverlayActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
export const initialState = {
|
export const initialState = {
|
||||||
// Modal 상태
|
// Modal 상태
|
||||||
@@ -111,10 +116,10 @@ const handlers = {
|
|||||||
lastAction: VIDEO_OVERLAY_ACTIONS.TOGGLE_CONTROLS,
|
lastAction: VIDEO_OVERLAY_ACTIONS.TOGGLE_CONTROLS,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 상태 변화');
|
dlog('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 상태 변화');
|
||||||
console.log('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 이전 visible:', isCurrentlyVisible);
|
dlog('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 이전 visible:', isCurrentlyVisible);
|
||||||
console.log('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 이후 visible:', newState.controls.visible);
|
dlog('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 이후 visible:', newState.controls.visible);
|
||||||
console.log('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 전체 상태:', newState);
|
dlog('🔄 [videoOverlayReducer.TOGGLE_CONTROLS] 전체 상태:', newState);
|
||||||
|
|
||||||
return newState;
|
return newState;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
import React, {
|
import React, { useCallback, useEffect } from 'react';
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
} from 'react';
|
|
||||||
|
|
||||||
import {
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
useDispatch,
|
|
||||||
useSelector,
|
|
||||||
} from 'react-redux';
|
|
||||||
|
|
||||||
import Spotlight from '@enact/spotlight';
|
import Spotlight from '@enact/spotlight';
|
||||||
import Spottable from '@enact/spotlight/Spottable';
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
import { finishMediaPreview } from '../../actions/mediaActions';
|
import { finishMediaPreview } from '../../actions/mediaActions';
|
||||||
import {
|
import { popPanel, pushPanel } from '../../actions/panelActions';
|
||||||
popPanel,
|
|
||||||
pushPanel,
|
|
||||||
} from '../../actions/panelActions';
|
|
||||||
import { clearAllVideoTimers } from '../../actions/playActions';
|
import { clearAllVideoTimers } from '../../actions/playActions';
|
||||||
import useReviews, { REVIEW_VERSION } from '../../hooks/useReviews/useReviews';
|
import useReviews, { REVIEW_VERSION } from '../../hooks/useReviews/useReviews';
|
||||||
import { panel_names } from '../../utils/Config';
|
import { panel_names } from '../../utils/Config';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
import css from './ShowUserReviews.module.less';
|
import css from './ShowUserReviews.module.less';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const SpottableComponent = Spottable('div');
|
const SpottableComponent = Spottable('div');
|
||||||
|
|
||||||
const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
||||||
@@ -37,11 +33,11 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
const { stats } = useReviews(productData && productData.prdtId);
|
const { stats } = useReviews(productData && productData.prdtId);
|
||||||
|
|
||||||
const handleShowUserReviewsClick = useCallback(() => {
|
const handleShowUserReviewsClick = useCallback(() => {
|
||||||
console.log('[ShowUserReviews] 🎯 Show User Reviews 버튼 클릭:', {
|
dlog('[ShowUserReviews] 🎯 Show User Reviews 버튼 클릭:', {
|
||||||
reviewVersion: REVIEW_VERSION,
|
reviewVersion: REVIEW_VERSION,
|
||||||
reviewListDataLength: reviewListData?.length || 0,
|
reviewListDataLength: reviewListData?.length || 0,
|
||||||
statsAvgRating: stats?.averageRating,
|
statsAvgRating: stats?.averageRating,
|
||||||
statsTotalReviews: stats?.totalReviews
|
statsTotalReviews: stats?.totalReviews,
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch(popPanel(panel_names.PLAYER_PANEL)); // PlayerPanel 제거
|
dispatch(popPanel(panel_names.PLAYER_PANEL)); // PlayerPanel 제거
|
||||||
@@ -72,7 +68,7 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
|
|
||||||
const handleKeyDown = useCallback((event) => {
|
const handleKeyDown = useCallback((event) => {
|
||||||
if (event.key === 'ArrowUp') {
|
if (event.key === 'ArrowUp') {
|
||||||
console.log('[ShowUserReviews] ArrowUp key pressed - attempting to focus last review');
|
dlog('[ShowUserReviews] ArrowUp key pressed - attempting to focus last review');
|
||||||
|
|
||||||
const container = document.querySelector('[data-spotlight-id="user-reviews-container"]');
|
const container = document.querySelector('[data-spotlight-id="user-reviews-container"]');
|
||||||
const savedScrollTop = container?.scrollTop || 0;
|
const savedScrollTop = container?.scrollTop || 0;
|
||||||
@@ -82,17 +78,17 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
'[data-spotlight-id="user-review-at-last"]'
|
'[data-spotlight-id="user-review-at-last"]'
|
||||||
);
|
);
|
||||||
if (lastReviewElement) {
|
if (lastReviewElement) {
|
||||||
console.log('[ShowUserReviews] Found last review element, focusing...');
|
dlog('[ShowUserReviews] Found last review element, focusing...');
|
||||||
Spotlight.focus(lastReviewElement);
|
Spotlight.focus(lastReviewElement);
|
||||||
|
|
||||||
if (container) container.scrollTop = savedScrollTop;
|
if (container) container.scrollTop = savedScrollTop;
|
||||||
} else {
|
} else {
|
||||||
console.log('[ShowUserReviews] Last review element not found, trying alternative...');
|
dlog('[ShowUserReviews] Last review element not found, trying alternative...');
|
||||||
|
|
||||||
const reviewElements = document.querySelectorAll('[data-spotlight-id^="user-review-"]');
|
const reviewElements = document.querySelectorAll('[data-spotlight-id^="user-review-"]');
|
||||||
if (reviewElements.length > 0) {
|
if (reviewElements.length > 0) {
|
||||||
const lastElement = reviewElements[reviewElements.length - 1];
|
const lastElement = reviewElements[reviewElements.length - 1];
|
||||||
console.log('[ShowUserReviews] Focusing last review element (alternative method)');
|
dlog('[ShowUserReviews] Focusing last review element (alternative method)');
|
||||||
Spotlight.focus(lastElement);
|
Spotlight.focus(lastElement);
|
||||||
|
|
||||||
if (container) container.scrollTop = savedScrollTop;
|
if (container) container.scrollTop = savedScrollTop;
|
||||||
@@ -103,7 +99,7 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// console.log('[ShowUserReviews_v2] 컴포넌트 마운트/업데이트', {
|
// dlog('[ShowUserReviews_v2] 컴포넌트 마운트/업데이트', {
|
||||||
// hasReviewData: !!reviewListData,
|
// hasReviewData: !!reviewListData,
|
||||||
// reviewCount: reviewListData?.length || 0,
|
// reviewCount: reviewListData?.length || 0,
|
||||||
// statsTotalReviews: stats?.totalReviews,
|
// statsTotalReviews: stats?.totalReviews,
|
||||||
@@ -115,7 +111,7 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
|
|
||||||
// v2 API 데이터로 렌더링 조건 수정: 5개 이상일 때만 보이기
|
// v2 API 데이터로 렌더링 조건 수정: 5개 이상일 때만 보이기
|
||||||
if (!reviewListData || reviewListData.length <= 5) {
|
if (!reviewListData || reviewListData.length <= 5) {
|
||||||
// console.log('[ShowUserReviews_v2] ❌ 버튼 숨김:', {
|
// dlog('[ShowUserReviews_v2] ❌ 버튼 숨김:', {
|
||||||
// reason: !reviewListData ? 'reviewListData가 없음' : 'reviewListData.length <= 5',
|
// reason: !reviewListData ? 'reviewListData가 없음' : 'reviewListData.length <= 5',
|
||||||
// reviewListLength: reviewListData?.length || 0
|
// reviewListLength: reviewListData?.length || 0
|
||||||
// });
|
// });
|
||||||
@@ -124,7 +120,7 @@ const ShowUserReviews = ({ hasVideo, launchedFromPlayer, onFocus, onBlur }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={css.showUserReviews__wrapper}>
|
<div className={css.showUserReviews__wrapper}>
|
||||||
{/* {console.log('[ShowUserReviews_v2] ✅ 버튼 렌더링 시작:', {
|
{/* {dlog('[ShowUserReviews_v2] ✅ 버튼 렌더링 시작:', {
|
||||||
reviewListLength: reviewListData?.length,
|
reviewListLength: reviewListData?.length,
|
||||||
version: REVIEW_VERSION
|
version: REVIEW_VERSION
|
||||||
})} */}
|
})} */}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import TPanel from '../../components/TPanel/TPanel';
|
|||||||
import useReviews, { REVIEW_VERSION } from '../../hooks/useReviews/useReviews';
|
import useReviews, { REVIEW_VERSION } from '../../hooks/useReviews/useReviews';
|
||||||
import fp from '../../utils/fp';
|
import fp from '../../utils/fp';
|
||||||
import { panel_names } from '../../utils/Config';
|
import { panel_names } from '../../utils/Config';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
import StarRating from '../DetailPanel/components/StarRating';
|
import StarRating from '../DetailPanel/components/StarRating';
|
||||||
import UserReviewsPopup from '../DetailPanel/ProductContentSection/UserReviews/UserReviewsPopup/UserReviewsPopup';
|
import UserReviewsPopup from '../DetailPanel/ProductContentSection/UserReviews/UserReviewsPopup/UserReviewsPopup';
|
||||||
import FilterItemButton from './components/FilterItemButton';
|
import FilterItemButton from './components/FilterItemButton';
|
||||||
@@ -17,9 +18,13 @@ import UserReviewsList from './components/UserReviewsList';
|
|||||||
import UserReviewHeader from './UserReviewHeader';
|
import UserReviewHeader from './UserReviewHeader';
|
||||||
import css from './UserReviewPanel.module.less';
|
import css from './UserReviewPanel.module.less';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// 버전에 따른 UI 설정
|
// 버전에 따른 UI 설정
|
||||||
const VERSION_LABEL = REVIEW_VERSION === 1 ? '[v1 - 기존 API]' : '[v2 - 신 API]';
|
const VERSION_LABEL = REVIEW_VERSION === 1 ? '[v1 - 기존 API]' : '[v2 - 신 API]';
|
||||||
console.log('[UserReviewPanel] 🔧 REVIEW_VERSION:', REVIEW_VERSION, VERSION_LABEL);
|
dlog('[UserReviewPanel] 🔧 REVIEW_VERSION:', REVIEW_VERSION, VERSION_LABEL);
|
||||||
|
|
||||||
const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -119,32 +124,32 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
const filteredCount = stats.filteredCount || 0;
|
const filteredCount = stats.filteredCount || 0;
|
||||||
const avgRating = stats.averageRating || 5;
|
const avgRating = stats.averageRating || 5;
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 📊 ReviewCount:', {
|
dlog('[UserReviewPanel] 📊 ReviewCount:', {
|
||||||
reviewCount,
|
reviewCount,
|
||||||
filteredCount,
|
filteredCount,
|
||||||
avgRating,
|
avgRating,
|
||||||
isFilterActive: !!currentReviewFilter,
|
isFilterActive: !!currentReviewFilter,
|
||||||
_isFilterActive: stats._isFilterActive,
|
_isFilterActive: stats._isFilterActive,
|
||||||
_activeSource: stats._activeSource
|
_activeSource: stats._activeSource,
|
||||||
});
|
});
|
||||||
|
|
||||||
// API 기반 RATING 필터 데이터 추출 (IF-LGSP-100)
|
// API 기반 RATING 필터 데이터 추출 (IF-LGSP-100)
|
||||||
// ✅ 필터 버튼의 개수는 초기 IF-LGSP-100 기반으로 절대 변경되지 않음
|
// ✅ 필터 버튼의 개수는 초기 IF-LGSP-100 기반으로 절대 변경되지 않음
|
||||||
const ratingFilterData = React.useMemo(() => {
|
const ratingFilterData = React.useMemo(() => {
|
||||||
if (!filters || !Array.isArray(filters)) {
|
if (!filters || !Array.isArray(filters)) {
|
||||||
console.log('[UserReviewPanel] ⚠️ filters 데이터 없음');
|
dlog('[UserReviewPanel] ⚠️ filters 데이터 없음');
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const ratingFilter = filters.find((f) => f.filterTpCd === 'RATING');
|
const ratingFilter = filters.find((f) => f.filterTpCd === 'RATING');
|
||||||
if (!ratingFilter) {
|
if (!ratingFilter) {
|
||||||
console.log('[UserReviewPanel] ⚠️ RATING 필터 데이터 없음');
|
dlog('[UserReviewPanel] ⚠️ RATING 필터 데이터 없음');
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🎯 RATING 필터 데이터 추출 (IF-LGSP-100 기반):', {
|
dlog('[UserReviewPanel] 🎯 RATING 필터 데이터 추출 (IF-LGSP-100 기반):', {
|
||||||
ratingFilter,
|
ratingFilter,
|
||||||
filterItems: ratingFilter.filter
|
filterItems: ratingFilter.filter,
|
||||||
});
|
});
|
||||||
|
|
||||||
// filter 배열을 { filterTpVal: filterNmCnt } 형태로 변환
|
// filter 배열을 { filterTpVal: filterNmCnt } 형태로 변환
|
||||||
@@ -167,7 +172,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 📊 RATING 필터 데이터 변환 완료:', ratingMap);
|
dlog('[UserReviewPanel] 📊 RATING 필터 데이터 변환 완료:', ratingMap);
|
||||||
|
|
||||||
return ratingMap;
|
return ratingMap;
|
||||||
}, [filters]);
|
}, [filters]);
|
||||||
@@ -180,13 +185,13 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
|
|
||||||
const keywordsFilter = filters.find((f) => f.filterTpCd === 'KEYWORDS');
|
const keywordsFilter = filters.find((f) => f.filterTpCd === 'KEYWORDS');
|
||||||
if (!keywordsFilter) {
|
if (!keywordsFilter) {
|
||||||
console.log('[UserReviewPanel] ⚠️ KEYWORDS 필터 데이터 없음');
|
dlog('[UserReviewPanel] ⚠️ KEYWORDS 필터 데이터 없음');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🎯 KEYWORDS 필터 데이터 추출:', {
|
dlog('[UserReviewPanel] 🎯 KEYWORDS 필터 데이터 추출:', {
|
||||||
keywordsFilter,
|
keywordsFilter,
|
||||||
filterItems: keywordsFilter.filter
|
filterItems: keywordsFilter.filter,
|
||||||
});
|
});
|
||||||
|
|
||||||
// filter 배열을 그대로 반환 (filterNm, filterNmCnt, filterTpVal 포함)
|
// filter 배열을 그대로 반환 (filterNm, filterNmCnt, filterTpVal 포함)
|
||||||
@@ -201,13 +206,13 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
|
|
||||||
const sentimentFilter = filters.find((f) => f.filterTpCd === 'SENTIMENT');
|
const sentimentFilter = filters.find((f) => f.filterTpCd === 'SENTIMENT');
|
||||||
if (!sentimentFilter) {
|
if (!sentimentFilter) {
|
||||||
console.log('[UserReviewPanel] ⚠️ SENTIMENT 필터 데이터 없음');
|
dlog('[UserReviewPanel] ⚠️ SENTIMENT 필터 데이터 없음');
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🎯 SENTIMENT 필터 데이터 추출:', {
|
dlog('[UserReviewPanel] 🎯 SENTIMENT 필터 데이터 추출:', {
|
||||||
sentimentFilter,
|
sentimentFilter,
|
||||||
filterItems: sentimentFilter.filter
|
filterItems: sentimentFilter.filter,
|
||||||
});
|
});
|
||||||
|
|
||||||
// filter 배열을 { filterTpVal: filterNmCnt } 형태로 변환
|
// filter 배열을 { filterTpVal: filterNmCnt } 형태로 변환
|
||||||
@@ -225,39 +230,43 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
const handleApiRatingFilter = useCallback(
|
const handleApiRatingFilter = useCallback(
|
||||||
(rating) => {
|
(rating) => {
|
||||||
if (!prdtId || !patnrId) {
|
if (!prdtId || !patnrId) {
|
||||||
console.warn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
dwarn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🔄 별점 필터 API 호출:', { rating, prdtId, patnrId });
|
dlog('[UserReviewPanel] 🔄 별점 필터 API 호출:', { rating, prdtId, patnrId });
|
||||||
setForceScrollToTop(true);
|
setForceScrollToTop(true);
|
||||||
|
|
||||||
if (rating === 'all') {
|
if (rating === 'all') {
|
||||||
// ALL 필터로 리뷰 재로드
|
// ALL 필터로 리뷰 재로드
|
||||||
dispatch(getUserReviewList({
|
dispatch(
|
||||||
|
getUserReviewList({
|
||||||
prdtId,
|
prdtId,
|
||||||
patnrId,
|
patnrId,
|
||||||
filterTpCd: 'ALL',
|
filterTpCd: 'ALL',
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1
|
pageNo: 1,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// RATING 필터로 리뷰 조회
|
// RATING 필터로 리뷰 조회
|
||||||
dispatch(getUserReviewList({
|
dispatch(
|
||||||
|
getUserReviewList({
|
||||||
prdtId,
|
prdtId,
|
||||||
patnrId,
|
patnrId,
|
||||||
filterTpCd: 'RATING',
|
filterTpCd: 'RATING',
|
||||||
filterTpVal: String(rating),
|
filterTpVal: String(rating),
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1
|
pageNo: 1,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[prdtId, patnrId, dispatch]
|
[prdtId, patnrId, dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleAllStarsFilter = useCallback(() => {
|
const handleAllStarsFilter = useCallback(() => {
|
||||||
console.log('[UserReviewPanel] 🔄 All Star 필터 해제');
|
dlog('[UserReviewPanel] 🔄 All Star 필터 해제');
|
||||||
setForceScrollToTop(true);
|
setForceScrollToTop(true);
|
||||||
dispatch(clearReviewFilter());
|
dispatch(clearReviewFilter());
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
@@ -271,21 +280,23 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
const handleApiKeywordsFilter = useCallback(
|
const handleApiKeywordsFilter = useCallback(
|
||||||
(keyword) => {
|
(keyword) => {
|
||||||
if (!prdtId || !patnrId) {
|
if (!prdtId || !patnrId) {
|
||||||
console.warn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
dwarn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🔄 키워드 필터 API 호출:', { keyword, prdtId, patnrId });
|
dlog('[UserReviewPanel] 🔄 키워드 필터 API 호출:', { keyword, prdtId, patnrId });
|
||||||
setForceScrollToTop(true);
|
setForceScrollToTop(true);
|
||||||
|
|
||||||
dispatch(getUserReviewList({
|
dispatch(
|
||||||
|
getUserReviewList({
|
||||||
prdtId,
|
prdtId,
|
||||||
patnrId,
|
patnrId,
|
||||||
filterTpCd: 'KEYWORDS',
|
filterTpCd: 'KEYWORDS',
|
||||||
filterTpVal: keyword,
|
filterTpVal: keyword,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1
|
pageNo: 1,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
},
|
},
|
||||||
[prdtId, patnrId, dispatch]
|
[prdtId, patnrId, dispatch]
|
||||||
);
|
);
|
||||||
@@ -294,41 +305,57 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
const handleApiSentimentFilter = useCallback(
|
const handleApiSentimentFilter = useCallback(
|
||||||
(sentiment) => {
|
(sentiment) => {
|
||||||
if (!prdtId || !patnrId) {
|
if (!prdtId || !patnrId) {
|
||||||
console.warn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
dwarn('[UserReviewPanel] ⚠️ API 호출 실패: prdtId 또는 patnrId 없음');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[UserReviewPanel] 🔄 감정 필터 API 호출:', { sentiment, prdtId, patnrId });
|
dlog('[UserReviewPanel] 🔄 감정 필터 API 호출:', { sentiment, prdtId, patnrId });
|
||||||
setForceScrollToTop(true);
|
setForceScrollToTop(true);
|
||||||
|
|
||||||
if (sentiment === 'all') {
|
if (sentiment === 'all') {
|
||||||
// ALL 필터로 리뷰 재로드
|
// ALL 필터로 리뷰 재로드
|
||||||
dispatch(getUserReviewList({
|
dispatch(
|
||||||
|
getUserReviewList({
|
||||||
prdtId,
|
prdtId,
|
||||||
patnrId,
|
patnrId,
|
||||||
filterTpCd: 'ALL',
|
filterTpCd: 'ALL',
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1
|
pageNo: 1,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// SENTIMENT 필터로 리뷰 조회
|
// SENTIMENT 필터로 리뷰 조회
|
||||||
dispatch(getUserReviewList({
|
dispatch(
|
||||||
|
getUserReviewList({
|
||||||
prdtId,
|
prdtId,
|
||||||
patnrId,
|
patnrId,
|
||||||
filterTpCd: 'SENTIMENT',
|
filterTpCd: 'SENTIMENT',
|
||||||
filterTpVal: sentiment,
|
filterTpVal: sentiment,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1
|
pageNo: 1,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[prdtId, patnrId, dispatch]
|
[prdtId, patnrId, dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleAromaClick = useCallback(() => handleApiKeywordsFilter('Aroma'), [handleApiKeywordsFilter]);
|
const handleAromaClick = useCallback(
|
||||||
const handleVanillaClick = useCallback(() => handleApiKeywordsFilter('Vanilla'), [handleApiKeywordsFilter]);
|
() => handleApiKeywordsFilter('Aroma'),
|
||||||
const handleCinnamonClick = useCallback(() => handleApiKeywordsFilter('Cinnamon'), [handleApiKeywordsFilter]);
|
[handleApiKeywordsFilter]
|
||||||
const handleQualityClick = useCallback(() => handleApiKeywordsFilter('Quality'), [handleApiKeywordsFilter]);
|
);
|
||||||
|
const handleVanillaClick = useCallback(
|
||||||
|
() => handleApiKeywordsFilter('Vanilla'),
|
||||||
|
[handleApiKeywordsFilter]
|
||||||
|
);
|
||||||
|
const handleCinnamonClick = useCallback(
|
||||||
|
() => handleApiKeywordsFilter('Cinnamon'),
|
||||||
|
[handleApiKeywordsFilter]
|
||||||
|
);
|
||||||
|
const handleQualityClick = useCallback(
|
||||||
|
() => handleApiKeywordsFilter('Quality'),
|
||||||
|
[handleApiKeywordsFilter]
|
||||||
|
);
|
||||||
|
|
||||||
const handlePositiveClick = useCallback(
|
const handlePositiveClick = useCallback(
|
||||||
() => handleApiSentimentFilter('positive'),
|
() => handleApiSentimentFilter('positive'),
|
||||||
@@ -343,7 +370,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (forceScrollToTop) {
|
if (forceScrollToTop) {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
console.log('[UserReviewPanel] ↩️ 스크롤을 상단으로 리셋 완료');
|
dlog('[UserReviewPanel] ↩️ 스크롤을 상단으로 리셋 완료');
|
||||||
setForceScrollToTop(false);
|
setForceScrollToTop(false);
|
||||||
}, 50);
|
}, 50);
|
||||||
return () => clearTimeout(timer);
|
return () => clearTimeout(timer);
|
||||||
@@ -353,7 +380,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
// UserReviewPanel 데이터 상태 로깅
|
// UserReviewPanel 데이터 상태 로깅
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (_debug) {
|
if (_debug) {
|
||||||
console.log(`[UserReviewPanel] 📊 데이터 상태 ${VERSION_LABEL}:`, {
|
dlog(`[UserReviewPanel] 📊 데이터 상태 ${VERSION_LABEL}:`, {
|
||||||
reviewVersion: _debug.reviewVersion,
|
reviewVersion: _debug.reviewVersion,
|
||||||
versionLabel: VERSION_LABEL,
|
versionLabel: VERSION_LABEL,
|
||||||
totalReviews: stats.totalReviews,
|
totalReviews: stats.totalReviews,
|
||||||
@@ -366,7 +393,16 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
totalPages: userReviewPanelTotalPages,
|
totalPages: userReviewPanelTotalPages,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [_debug, stats, currentFilter, userReviewPanelPage, userReviewPanelReviews, userReviewPanelHasNext, userReviewPanelHasPrev, userReviewPanelTotalPages]);
|
}, [
|
||||||
|
_debug,
|
||||||
|
stats,
|
||||||
|
currentFilter,
|
||||||
|
userReviewPanelPage,
|
||||||
|
userReviewPanelReviews,
|
||||||
|
userReviewPanelHasNext,
|
||||||
|
userReviewPanelHasPrev,
|
||||||
|
userReviewPanelTotalPages,
|
||||||
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
@@ -377,7 +413,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
const handleBackButton = useCallback(() => {
|
const handleBackButton = useCallback(() => {
|
||||||
// ✅ CRITICAL FIX: Back 버튼 클릭 시 Redux 필터 상태 초기화
|
// ✅ CRITICAL FIX: Back 버튼 클릭 시 Redux 필터 상태 초기화
|
||||||
// 필터가 유지되어 ProductAllSection으로 돌아갔을 때 잘못된 리뷰 표시 방지
|
// 필터가 유지되어 ProductAllSection으로 돌아갔을 때 잘못된 리뷰 표시 방지
|
||||||
console.log('[UserReviewPanel] 🔙 Back 버튼 클릭 - Redux 필터 초기화');
|
dlog('[UserReviewPanel] 🔙 Back 버튼 클릭 - Redux 필터 초기화');
|
||||||
dispatch(clearReviewFilter());
|
dispatch(clearReviewFilter());
|
||||||
|
|
||||||
if (bgVideoInfo && bgVideoInfo.hasVideo) {
|
if (bgVideoInfo && bgVideoInfo.hasVideo) {
|
||||||
@@ -408,7 +444,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
// ✅ filteredReviews 사용: 현재 필터에 적용된 리뷰 목록 내에서 찾기
|
// ✅ filteredReviews 사용: 현재 필터에 적용된 리뷰 목록 내에서 찾기
|
||||||
const handleReviewClick = useCallback(
|
const handleReviewClick = useCallback(
|
||||||
(review, index) => {
|
(review, index) => {
|
||||||
console.log('[UserReviewPanel] Review clicked, opening popup:', {
|
dlog('[UserReviewPanel] Review clicked, opening popup:', {
|
||||||
rvwId: review.rvwId,
|
rvwId: review.rvwId,
|
||||||
index,
|
index,
|
||||||
currentFilter,
|
currentFilter,
|
||||||
@@ -419,7 +455,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
// filteredReviews는 현재 필터에 적용된 전체 리뷰 목록
|
// filteredReviews는 현재 필터에 적용된 전체 리뷰 목록
|
||||||
const realIndex = filteredReviews.findIndex((r) => r.rvwId === review.rvwId);
|
const realIndex = filteredReviews.findIndex((r) => r.rvwId === review.rvwId);
|
||||||
|
|
||||||
console.log('[UserReviewPanel] Review index mapping:', {
|
dlog('[UserReviewPanel] Review index mapping:', {
|
||||||
localIndex: index,
|
localIndex: index,
|
||||||
realIndexInFiltered: realIndex,
|
realIndexInFiltered: realIndex,
|
||||||
selectedIndex: realIndex >= 0 ? realIndex : index,
|
selectedIndex: realIndex >= 0 ? realIndex : index,
|
||||||
@@ -434,7 +470,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
|
|
||||||
// 팝업 닫기 핸들러
|
// 팝업 닫기 핸들러
|
||||||
const handleClosePopup = useCallback(() => {
|
const handleClosePopup = useCallback(() => {
|
||||||
console.log('[UserReviewPanel] Closing popup');
|
dlog('[UserReviewPanel] Closing popup');
|
||||||
setIsPopupOpen(false);
|
setIsPopupOpen(false);
|
||||||
setPopupMode('user-reviews');
|
setPopupMode('user-reviews');
|
||||||
setSelectedImageIndex(0);
|
setSelectedImageIndex(0);
|
||||||
@@ -442,7 +478,7 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
|
|
||||||
// 팝업 모드 변경 핸들러
|
// 팝업 모드 변경 핸들러
|
||||||
const handleModeChange = useCallback((newMode, imageIndex = 0) => {
|
const handleModeChange = useCallback((newMode, imageIndex = 0) => {
|
||||||
console.log('[UserReviewPanel] Mode change requested:', { newMode, imageIndex });
|
dlog('[UserReviewPanel] Mode change requested:', { newMode, imageIndex });
|
||||||
setPopupMode(newMode);
|
setPopupMode(newMode);
|
||||||
if (newMode === 'all-images' || newMode === 'user-reviews') {
|
if (newMode === 'all-images' || newMode === 'user-reviews') {
|
||||||
setSelectedImageIndex(imageIndex);
|
setSelectedImageIndex(imageIndex);
|
||||||
@@ -518,7 +554,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
ariaLabel="Filter by 5 star ratings"
|
ariaLabel="Filter by 5 star ratings"
|
||||||
dataSpotlightUp="filter-all-stars"
|
dataSpotlightUp="filter-all-stars"
|
||||||
dataSpotlightDown="filter-4-stars"
|
dataSpotlightDown="filter-4-stars"
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'RATING' && currentReviewFilter?.filterTpVal === '5'}
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'RATING' &&
|
||||||
|
currentReviewFilter?.filterTpVal === '5'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<FilterItemButton
|
<FilterItemButton
|
||||||
text={`4 star (${ratingFilterData['4'] || 0})`}
|
text={`4 star (${ratingFilterData['4'] || 0})`}
|
||||||
@@ -527,7 +566,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
ariaLabel="Filter by 4 star ratings"
|
ariaLabel="Filter by 4 star ratings"
|
||||||
dataSpotlightUp="filter-5-stars"
|
dataSpotlightUp="filter-5-stars"
|
||||||
dataSpotlightDown="filter-3-stars"
|
dataSpotlightDown="filter-3-stars"
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'RATING' && currentReviewFilter?.filterTpVal === '4'}
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'RATING' &&
|
||||||
|
currentReviewFilter?.filterTpVal === '4'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<FilterItemButton
|
<FilterItemButton
|
||||||
text={`3 star (${ratingFilterData['3'] || 0})`}
|
text={`3 star (${ratingFilterData['3'] || 0})`}
|
||||||
@@ -536,7 +578,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
ariaLabel="Filter by 3 star ratings"
|
ariaLabel="Filter by 3 star ratings"
|
||||||
dataSpotlightUp="filter-4-stars"
|
dataSpotlightUp="filter-4-stars"
|
||||||
dataSpotlightDown="filter-2-stars"
|
dataSpotlightDown="filter-2-stars"
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'RATING' && currentReviewFilter?.filterTpVal === '3'}
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'RATING' &&
|
||||||
|
currentReviewFilter?.filterTpVal === '3'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<FilterItemButton
|
<FilterItemButton
|
||||||
text={`2 star (${ratingFilterData['2'] || 0})`}
|
text={`2 star (${ratingFilterData['2'] || 0})`}
|
||||||
@@ -545,7 +590,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
ariaLabel="Filter by 2 star ratings"
|
ariaLabel="Filter by 2 star ratings"
|
||||||
dataSpotlightUp="filter-3-stars"
|
dataSpotlightUp="filter-3-stars"
|
||||||
dataSpotlightDown="filter-1-stars"
|
dataSpotlightDown="filter-1-stars"
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'RATING' && currentReviewFilter?.filterTpVal === '2'}
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'RATING' &&
|
||||||
|
currentReviewFilter?.filterTpVal === '2'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<FilterItemButton
|
<FilterItemButton
|
||||||
text={`1 star (${ratingFilterData['1'] || 0})`}
|
text={`1 star (${ratingFilterData['1'] || 0})`}
|
||||||
@@ -553,7 +601,10 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
spotlightId="filter-1-stars"
|
spotlightId="filter-1-stars"
|
||||||
ariaLabel="Filter by 1 star ratings"
|
ariaLabel="Filter by 1 star ratings"
|
||||||
dataSpotlightUp="filter-2-stars"
|
dataSpotlightUp="filter-2-stars"
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'RATING' && currentReviewFilter?.filterTpVal === '1'}
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'RATING' &&
|
||||||
|
currentReviewFilter?.filterTpVal === '1'
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -573,9 +624,21 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
onClick={() => handleApiKeywordsFilter(keyword.filterTpVal)}
|
onClick={() => handleApiKeywordsFilter(keyword.filterTpVal)}
|
||||||
spotlightId={`filter-keyword-${index}`}
|
spotlightId={`filter-keyword-${index}`}
|
||||||
ariaLabel={`Filter by ${keyword.filterNm} keyword`}
|
ariaLabel={`Filter by ${keyword.filterNm} keyword`}
|
||||||
dataSpotlightUp={index === 0 ? 'filter-1-stars' : `filter-keyword-${index - 1}`}
|
dataSpotlightUp={
|
||||||
dataSpotlightDown={index === keywordsFilterData.filter((k) => parseInt(k.filterNmCnt, 10) > 0).length - 1 ? 'filter-positive' : `filter-keyword-${index + 1}`}
|
index === 0 ? 'filter-1-stars' : `filter-keyword-${index - 1}`
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'KEYWORDS' && currentReviewFilter?.filterTpVal === keyword.filterTpVal}
|
}
|
||||||
|
dataSpotlightDown={
|
||||||
|
index ===
|
||||||
|
keywordsFilterData.filter((k) => parseInt(k.filterNmCnt, 10) > 0)
|
||||||
|
.length -
|
||||||
|
1
|
||||||
|
? 'filter-positive'
|
||||||
|
: `filter-keyword-${index + 1}`
|
||||||
|
}
|
||||||
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'KEYWORDS' &&
|
||||||
|
currentReviewFilter?.filterTpVal === keyword.filterTpVal
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
@@ -633,9 +696,21 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
onClick={() => handleApiSentimentFilter(sentiment)}
|
onClick={() => handleApiSentimentFilter(sentiment)}
|
||||||
spotlightId={`filter-sentiment-${sentiment}`}
|
spotlightId={`filter-sentiment-${sentiment}`}
|
||||||
ariaLabel={`Filter by ${sentiment} sentiment`}
|
ariaLabel={`Filter by ${sentiment} sentiment`}
|
||||||
dataSpotlightUp={index === 0 ? 'filter-quality' : `filter-sentiment-${Object.entries(sentimentFilterData).filter(([, c]) => c > 0)[index - 1][0]}`}
|
dataSpotlightUp={
|
||||||
dataSpotlightDown={index === Object.entries(sentimentFilterData).filter(([, c]) => c > 0).length - 1 ? undefined : `filter-sentiment-${Object.entries(sentimentFilterData).filter(([, c]) => c > 0)[index + 1][0]}`}
|
index === 0
|
||||||
isActive={currentReviewFilter?.filterTpCd === 'SENTIMENT' && currentReviewFilter?.filterTpVal === sentiment}
|
? 'filter-quality'
|
||||||
|
: `filter-sentiment-${Object.entries(sentimentFilterData).filter(([, c]) => c > 0)[index - 1][0]}`
|
||||||
|
}
|
||||||
|
dataSpotlightDown={
|
||||||
|
index ===
|
||||||
|
Object.entries(sentimentFilterData).filter(([, c]) => c > 0).length - 1
|
||||||
|
? undefined
|
||||||
|
: `filter-sentiment-${Object.entries(sentimentFilterData).filter(([, c]) => c > 0)[index + 1][0]}`
|
||||||
|
}
|
||||||
|
isActive={
|
||||||
|
currentReviewFilter?.filterTpCd === 'SENTIMENT' &&
|
||||||
|
currentReviewFilter?.filterTpVal === sentiment
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
@@ -660,7 +735,11 @@ const UserReviewPanel = ({ className, panelInfo, spotlightId }) => {
|
|||||||
onClick={handleNegativeClick}
|
onClick={handleNegativeClick}
|
||||||
spotlightId="filter-negative"
|
spotlightId="filter-negative"
|
||||||
ariaLabel="Filter by negative sentiment"
|
ariaLabel="Filter by negative sentiment"
|
||||||
dataSpotlightUp={filterCounts?.sentiment?.positive > 0 ? "filter-positive" : "filter-quality"}
|
dataSpotlightUp={
|
||||||
|
filterCounts?.sentiment?.positive > 0
|
||||||
|
? 'filter-positive'
|
||||||
|
: 'filter-quality'
|
||||||
|
}
|
||||||
isActive={
|
isActive={
|
||||||
currentFilter.type === 'sentiment' && currentFilter.value === 'negative'
|
currentFilter.type === 'sentiment' && currentFilter.value === 'negative'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,13 @@ import UserReviewItem from './UserReviewItem';
|
|||||||
import UserReviewsScroller from './UserReviewsScroller';
|
import UserReviewsScroller from './UserReviewsScroller';
|
||||||
import VirtualScrollBar from './VirtualScrollBar';
|
import VirtualScrollBar from './VirtualScrollBar';
|
||||||
import { $L } from '../../../utils/helperMethods';
|
import { $L } from '../../../utils/helperMethods';
|
||||||
|
import { createDebugHelpers } from '../../../utils/debug';
|
||||||
import css from './UserReviewsList.module.less';
|
import css from './UserReviewsList.module.less';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const Container = SpotlightContainerDecorator(
|
const Container = SpotlightContainerDecorator(
|
||||||
{
|
{
|
||||||
enterTo: 'default-element',
|
enterTo: 'default-element',
|
||||||
@@ -34,8 +39,9 @@ const UserReviewsList = ({
|
|||||||
onReviewClick, // 상위에서 전달받은 리뷰 클릭 핸들러
|
onReviewClick, // 상위에서 전달받은 리뷰 클릭 핸들러
|
||||||
forceScrollToTop = false, // 필터 변경 시 스크롤을 상단으로 리셋
|
forceScrollToTop = false, // 필터 변경 시 스크롤을 상단으로 리셋
|
||||||
}) => {
|
}) => {
|
||||||
const handleReviewClick = useCallback((review, index) => {
|
const handleReviewClick = useCallback(
|
||||||
console.log('[UserReviewsList] Review item clicked:', {
|
(review, index) => {
|
||||||
|
dlog('[UserReviewsList] Review item clicked:', {
|
||||||
rvwId: review.rvwId,
|
rvwId: review.rvwId,
|
||||||
index: index,
|
index: index,
|
||||||
review: review,
|
review: review,
|
||||||
@@ -45,7 +51,9 @@ const UserReviewsList = ({
|
|||||||
if (onReviewClick) {
|
if (onReviewClick) {
|
||||||
onReviewClick(review, index);
|
onReviewClick(review, index);
|
||||||
}
|
}
|
||||||
}, [onReviewClick]);
|
},
|
||||||
|
[onReviewClick]
|
||||||
|
);
|
||||||
|
|
||||||
// ✅ API 필터 활성화 여부 확인
|
// ✅ API 필터 활성화 여부 확인
|
||||||
// 필터가 활성화되면 filteredReviewCount (필터링된 리뷰 개수) 사용
|
// 필터가 활성화되면 filteredReviewCount (필터링된 리뷰 개수) 사용
|
||||||
@@ -53,23 +61,20 @@ const UserReviewsList = ({
|
|||||||
const isApiFilterActive = !!currentReviewFilter;
|
const isApiFilterActive = !!currentReviewFilter;
|
||||||
const displayCount = isApiFilterActive ? filteredReviewCount : totalReviewCount;
|
const displayCount = isApiFilterActive ? filteredReviewCount : totalReviewCount;
|
||||||
|
|
||||||
console.log('[UserReviewsList] 📊 리뷰 개수 계산:', {
|
dlog('[UserReviewsList] 📊 리뷰 개수 계산:', {
|
||||||
isApiFilterActive,
|
isApiFilterActive,
|
||||||
totalReviewCount,
|
totalReviewCount,
|
||||||
filteredReviewCount,
|
filteredReviewCount,
|
||||||
displayCount,
|
displayCount,
|
||||||
currentReviewFilter,
|
currentReviewFilter,
|
||||||
reviewsDataLength: reviewsData?.length || 0
|
reviewsDataLength: reviewsData?.length || 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.reviewsListContainer}>
|
<Container className={css.reviewsListContainer}>
|
||||||
<div className={css.reviewsListHeader}>
|
<div className={css.reviewsListHeader}>
|
||||||
<div className={css.reviewsListHeaderText}>
|
<div className={css.reviewsListHeaderText}>
|
||||||
<span className={css.reviewsListHeaderCount}>
|
<span className={css.reviewsListHeaderCount}>{displayCount}</span> Customer Reviews
|
||||||
{displayCount}
|
|
||||||
</span>{' '}
|
|
||||||
Customer Reviews
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import React, { useCallback, useMemo, useEffect, useRef } from 'react';
|
import React, { useCallback, useMemo, useEffect, useRef } from 'react';
|
||||||
import Spottable from '@enact/spotlight/Spottable';
|
import Spottable from '@enact/spotlight/Spottable';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { createDebugHelpers } from '../../../utils/debug';
|
||||||
import css from './VirtualScrollBar.module.less';
|
import css from './VirtualScrollBar.module.less';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
const SpottableDiv = Spottable('div');
|
const SpottableDiv = Spottable('div');
|
||||||
|
|
||||||
const VirtualScrollBar = ({
|
const VirtualScrollBar = ({
|
||||||
@@ -36,14 +41,14 @@ const VirtualScrollBar = ({
|
|||||||
(event) => {
|
(event) => {
|
||||||
if (event.key === 'ArrowDown') {
|
if (event.key === 'ArrowDown') {
|
||||||
if (hasNext && onNextPage) {
|
if (hasNext && onNextPage) {
|
||||||
console.log('[VirtualScrollBar] Arrow Down - Next page');
|
dlog('[VirtualScrollBar] Arrow Down - Next page');
|
||||||
onNextPage();
|
onNextPage();
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
} else if (event.key === 'ArrowUp') {
|
} else if (event.key === 'ArrowUp') {
|
||||||
if (hasPrev && onPrevPage) {
|
if (hasPrev && onPrevPage) {
|
||||||
console.log('[VirtualScrollBar] Arrow Up - Previous page');
|
dlog('[VirtualScrollBar] Arrow Up - Previous page');
|
||||||
onPrevPage();
|
onPrevPage();
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -57,7 +62,7 @@ const VirtualScrollBar = ({
|
|||||||
if (thumbRef.current) {
|
if (thumbRef.current) {
|
||||||
thumbRef.current.style.height = `${thumbHeightPercent}%`;
|
thumbRef.current.style.height = `${thumbHeightPercent}%`;
|
||||||
thumbRef.current.style.top = `${thumbTopPercent}%`;
|
thumbRef.current.style.top = `${thumbTopPercent}%`;
|
||||||
console.log('[VirtualScrollBar] Updated:', {
|
dlog('[VirtualScrollBar] Updated:', {
|
||||||
totalPages,
|
totalPages,
|
||||||
thumbHeightPercent,
|
thumbHeightPercent,
|
||||||
thumbTopPercent,
|
thumbTopPercent,
|
||||||
|
|||||||
Reference in New Issue
Block a user