🕐 커밋 시간: 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 컴포넌트 아키텍처 개선
262 lines
6.4 KiB
JavaScript
262 lines
6.4 KiB
JavaScript
import axios from 'axios';
|
|
|
|
import { URLS } from '../api/apiConfig';
|
|
import { TAxios } from '../api/TAxios';
|
|
import { GET_MY_INFO_ORDER_SEARCH_LIMIT } from '../utils/Config';
|
|
import { types } from './actionTypes';
|
|
import { changeAppStatus, getTermsAgreeYn } from './commonActions';
|
|
import { createDebugHelpers } from '../utils/debug';
|
|
|
|
// 디버그 헬퍼 설정
|
|
const DEBUG_MODE = false;
|
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
|
|
|
// 회원 주문 정보 조회 (IF-LGSP-340)
|
|
let getMyinfoOrderSearchKey = null;
|
|
let lastMyinfoOrderSearchParams = {};
|
|
export const getMyinfoOrderSearch =
|
|
(params, forceUpdate = false, orderInfoDataIdx = 1, key, loading = true) =>
|
|
(dispatch, getState) => {
|
|
const { mbrNo, srchMonth, cancelOrderYn } = params;
|
|
let limitNum = params.limitNum || GET_MY_INFO_ORDER_SEARCH_LIMIT;
|
|
|
|
if (orderInfoDataIdx === 1) {
|
|
// if (
|
|
// JSON.stringify(lastMyinfoOrderSearchParams) ===
|
|
// JSON.stringify(params) &&
|
|
// !forceUpdate
|
|
// ) {
|
|
// console.log("getMyinfoOrderSearch ignore patch");
|
|
// return;
|
|
// }
|
|
|
|
lastMyinfoOrderSearchParams = params;
|
|
dispatch(clearMyinfoOrderSearch());
|
|
}
|
|
|
|
if (loading) {
|
|
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: 'wait' } }));
|
|
}
|
|
|
|
let currentKey = key;
|
|
const onSuccess = (response) => {
|
|
dlog('getMyinfoOrderSearch onSuccess ', response.data);
|
|
|
|
if (orderInfoDataIdx === 1) {
|
|
getMyinfoOrderSearchKey = new Date();
|
|
currentKey = getMyinfoOrderSearchKey;
|
|
|
|
dispatch({
|
|
type: types.GET_MY_INFO_ORDER_SEARCH,
|
|
payload: response.data.data,
|
|
orderSearchParams: {
|
|
mbrNo,
|
|
srchMonth,
|
|
cancelOrderYn,
|
|
limitNum,
|
|
},
|
|
});
|
|
} else if (getMyinfoOrderSearchKey === currentKey) {
|
|
dispatch({
|
|
type: types.GET_MY_INFO_ORDER_SEARCH,
|
|
payload: response.data.data,
|
|
append: true,
|
|
startIndex: (orderInfoDataIdx - 1) * limitNum,
|
|
orderSearchParams: lastMyinfoOrderSearchParams,
|
|
});
|
|
}
|
|
|
|
if (loading) {
|
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
|
}
|
|
};
|
|
|
|
const onFail = (error) => {
|
|
derror('getMyinfoOrderSearch onFail ', error);
|
|
if (loading) {
|
|
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
|
|
}
|
|
if (orderInfoDataIdx === 1) {
|
|
lastMyinfoOrderSearchParams = {};
|
|
}
|
|
};
|
|
|
|
TAxios(
|
|
dispatch,
|
|
getState,
|
|
'get',
|
|
URLS.GET_MY_INFO_ORDER_SEARCH,
|
|
{
|
|
mbrNo,
|
|
srchMonth,
|
|
cancelOrderYn,
|
|
limitNum,
|
|
orderInfoDataIdx,
|
|
},
|
|
{},
|
|
onSuccess,
|
|
onFail
|
|
);
|
|
};
|
|
|
|
export const continueGetMyinfoOrderSearch =
|
|
(orderInfoDataIdx = 2) =>
|
|
(dispatch, getState) => {
|
|
const state = getState();
|
|
const orderSearchParams = state.order.orderSearchParams;
|
|
const isCancelOrder = orderSearchParams.cancelOrderYn === 'Y';
|
|
const orderInfoData = isCancelOrder
|
|
? state.order.cancelOrderInfoData
|
|
: state.order.orderInfoData;
|
|
|
|
if (!orderInfoData || !orderInfoData.orderInfo) {
|
|
return;
|
|
}
|
|
|
|
const totalCount = orderInfoData.orderInfoCount ?? 0;
|
|
const startIndex = GET_MY_INFO_ORDER_SEARCH_LIMIT * (orderInfoDataIdx - 1);
|
|
|
|
if (startIndex <= 1 || totalCount < startIndex) {
|
|
return;
|
|
}
|
|
|
|
dispatch(
|
|
getMyinfoOrderSearch(
|
|
{ ...lastMyinfoOrderSearchParams },
|
|
false,
|
|
orderInfoDataIdx,
|
|
getMyinfoOrderSearchKey,
|
|
false
|
|
)
|
|
);
|
|
};
|
|
|
|
const clearMyinfoOrderSearch = () => ({
|
|
type: types.CLEAR_MY_INFO_ORDER_SEARCH,
|
|
});
|
|
|
|
// 회원 주문 상세 정보 조회 (IF-LGSP-341)
|
|
export const getMyinfoOrderDetailSearch = (params, callback) => (dispatch, getState) => {
|
|
const { mbrNo, ordNo, prdtId } = params;
|
|
|
|
const onSuccess = (response) => {
|
|
dlog('getMyinfoOrderDetailSearch onSuccess ', response.data);
|
|
|
|
dispatch({
|
|
type: types.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
|
payload: response.data.data,
|
|
});
|
|
|
|
if (callback) callback(response.data);
|
|
};
|
|
|
|
const onFail = (error) => {
|
|
derror('getMyinfoOrderDetailSearch onFail ', error);
|
|
};
|
|
|
|
TAxios(
|
|
dispatch,
|
|
getState,
|
|
'get',
|
|
URLS.GET_MY_INFO_ORDER_DETAIL_SEARCH,
|
|
{ mbrNo, ordNo, prdtId },
|
|
{},
|
|
onSuccess,
|
|
onFail
|
|
);
|
|
};
|
|
|
|
export const getMyinfoOrderShippingSearch = (params, callback) => (dispatch, getState) => {
|
|
const { mbrNo, ordNo, patnrId, prdtId, prodSno } = params;
|
|
|
|
const onSuccess = (response) => {
|
|
dlog('getMyinfoOrderShippingSearch onSuccess ', response.data);
|
|
|
|
dispatch({
|
|
type: types.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
|
payload: response.data.data,
|
|
});
|
|
|
|
if (callback) callback(response.data);
|
|
};
|
|
|
|
const onFail = (error) => {
|
|
derror('getMyinfoOrderShippingSearch onFail ', error);
|
|
};
|
|
|
|
TAxios(
|
|
dispatch,
|
|
getState,
|
|
'get',
|
|
URLS.GET_MY_INFO_ORDER_SHIPPING_SEARCH,
|
|
{ mbrNo, ordNo, patnrId, prdtId, prodSno },
|
|
{},
|
|
onSuccess,
|
|
onFail
|
|
);
|
|
};
|
|
|
|
// 구매 약관 동의 (IF-LGSP-360)
|
|
export const setPurchaseTermsAgree = (params) => (dispatch, getState) => {
|
|
const { mbrNo, termsList } = params;
|
|
|
|
const onSuccess = (response) => {
|
|
dlog('setPurchaseTermsAgree onSuccess ', response.data);
|
|
|
|
dispatch({
|
|
type: types.SET_PURCHASE_TERMS_AGREE,
|
|
payload: response.data.data,
|
|
retCode: response.data.retCode,
|
|
});
|
|
|
|
dispatch(getTermsAgreeYn());
|
|
};
|
|
|
|
const onFail = (error) => {
|
|
derror('setPurchaseTermsAgree onFail ', error);
|
|
};
|
|
|
|
TAxios(
|
|
dispatch,
|
|
getState,
|
|
'post',
|
|
URLS.SET_PURCHASE_TERMS_AGREE,
|
|
{},
|
|
{ mbrNo, termsList },
|
|
onSuccess,
|
|
onFail
|
|
);
|
|
};
|
|
|
|
// 구매 약관 철회 (IF-LGSP-361)
|
|
export const setPurchasetermsWithdraw = (params) => (dispatch, getState) => {
|
|
const { mbrNo, termsList } = params;
|
|
|
|
const onSuccess = (response) => {
|
|
dlog('setPurchasetermsWithdraw onSuccess ', response.data);
|
|
|
|
dispatch({
|
|
type: types.SET_PURCHASE_TERMS_WITHDRAW,
|
|
payload: response.data.data,
|
|
retCode: response.data.retCode,
|
|
});
|
|
|
|
dispatch(getTermsAgreeYn());
|
|
};
|
|
|
|
const onFail = (error) => {
|
|
derror('setPurchasetermsWithdraw onFail ', error);
|
|
};
|
|
|
|
TAxios(
|
|
dispatch,
|
|
getState,
|
|
'post',
|
|
URLS.SET_PURCHASE_TERMS_WITHDRAW,
|
|
{},
|
|
{ mbrNo, termsList },
|
|
onSuccess,
|
|
onFail
|
|
);
|
|
};
|