1. myOrder cancel / focus

2. checkOut QRCode
This commit is contained in:
hyunwoo93.cha
2024-07-04 18:04:18 +09:00
parent 264ffa77e5
commit b34cb7a08e
10 changed files with 251 additions and 144 deletions

View File

@@ -10,20 +10,23 @@ import { changeAppStatus, getTermsAgreeYn } from "./commonActions";
let getMyinfoOrderSearchKey = null;
let lastMyinfoOrderSearchParams = {};
export const getMyinfoOrderSearch =
(params, orderInfoDataIdx = 1, key, loading = true) =>
(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)
) {
console.log("getMyinfoOrderSearch ignore patch");
return;
}
// if (
// JSON.stringify(lastMyinfoOrderSearchParams) ===
// JSON.stringify(params) &&
// !forceUpdate
// ) {
// console.log("getMyinfoOrderSearch ignore patch");
// return;
// }
lastMyinfoOrderSearchParams = params;
dispatch(clearMyinfoOrderSearch());
}
if (loading) {
@@ -96,7 +99,17 @@ export const getMyinfoOrderSearch =
export const continueGetMyinfoOrderSearch =
(orderInfoDataIdx = 2) =>
(dispatch, getState) => {
const orderInfoData = getState().order.orderInfoData || {};
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);
@@ -107,6 +120,7 @@ export const continueGetMyinfoOrderSearch =
dispatch(
getMyinfoOrderSearch(
{ ...lastMyinfoOrderSearchParams },
false,
orderInfoDataIdx,
getMyinfoOrderSearchKey,
false
@@ -114,7 +128,7 @@ export const continueGetMyinfoOrderSearch =
);
};
export const clearMyinfoOrderSearch = () => ({
const clearMyinfoOrderSearch = () => ({
type: types.CLEAR_MY_INFO_ORDER_SEARCH,
});