checkout loading status fix / add my page tabs global variable

This commit is contained in:
hyunwoo93.cha
2024-07-02 14:55:23 +09:00
parent b3c54f49f8
commit dc03feaf9d
7 changed files with 49 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -56,11 +56,14 @@ export const insertMyInfoCheckoutOrder =
payload: response.data.data, payload: response.data.data,
}); });
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
if (callback) callback(response); if (callback) callback(response);
}; };
const onFail = (error) => { const onFail = (error) => {
console.error("insertMyInfoCheckoutOrder onFail: ", error); console.error("insertMyInfoCheckoutOrder onFail: ", error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
}; };
TAxios( TAxios(

View File

@@ -20,11 +20,13 @@ export const getMyInfoCardPincodeCheck =
payload: response.data, payload: response.data,
}); });
if (response.data.retCode !== 0) {
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
}
if (callback) { if (callback) {
callback(response.data); callback(response.data);
} }
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
}; };
const onFail = (error) => { const onFail = (error) => {

View File

@@ -90,6 +90,16 @@ export const PLAN = "PLAN";
export const ADD_PLAN = "ADD_PLAN"; export const ADD_PLAN = "ADD_PLAN";
export const MORE = "MORE"; export const MORE = "MORE";
export const MYPAGE_TABS = {
MY_INFO: 30800,
MY_ORDERS: 30900,
RECENTLY_VIEWED: 30300,
FAVORITES: 30200,
REMINDERS: 30400,
SUPPORT: 30500,
TERMS_OF_SERVICE: 30600,
};
export const MYINFO_TABS = { export const MYINFO_TABS = {
PAYMENT: 0, PAYMENT: 0,
BILLING_ADDRESS: 1, BILLING_ADDRESS: 1,

View File

@@ -2,12 +2,15 @@ import React, { useCallback, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import confirmCardImage from "../../../assets/images/img-checkout-complete.png";
import { popPanel, pushPanel, resetPanels } from "../../actions/panelActions"; import { popPanel, pushPanel, resetPanels } from "../../actions/panelActions";
import CustomImage from "../../components/CustomImage/CustomImage";
import TButton from "../../components/TButton/TButton"; import TButton from "../../components/TButton/TButton";
import TPanel from "../../components/TPanel/TPanel"; import TPanel from "../../components/TPanel/TPanel";
import useLogService from "../../hooks/useLogService"; import useLogService from "../../hooks/useLogService";
import * as Config from "../../utils/Config"; import * as Config from "../../utils/Config";
import { $L } from "../../utils/helperMethods"; import { $L } from "../../utils/helperMethods";
import { myPageComponents } from "../MyPagePanel/MyPagePanel";
import css from "./ConfirmPanel.module.less"; import css from "./ConfirmPanel.module.less";
export default function ConfirmPanel({ spotlightId }) { export default function ConfirmPanel({ spotlightId }) {
@@ -15,6 +18,11 @@ export default function ConfirmPanel({ spotlightId }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
const panels = useSelector((state) => state.panels.panels); const panels = useSelector((state) => state.panels.panels);
const myPageTabs = useSelector((state) => state.home.menuData.data.mypage);
const myOrder =
myPageTabs.find((item) => item.menuId === Config.MYPAGE_TABS.MY_ORDERS) ||
{};
const panelInfo = panels.find( const panelInfo = panels.find(
(panel) => panel.name === "confirmpanel" (panel) => panel.name === "confirmpanel"
)?.panelInfo; )?.panelInfo;
@@ -61,12 +69,13 @@ export default function ConfirmPanel({ spotlightId }) {
pushPanel({ pushPanel({
name: Config.panel_names.MY_PAGE_PANEL, name: Config.panel_names.MY_PAGE_PANEL,
panelInfo: { panelInfo: {
menuNm: "My Orders", menuId: myOrder.menuId,
menuOrd: 4, menuNm: myOrder.menuNm,
menuOrd: myOrder.menuOrd,
}, },
}) })
); );
}, [dispatch]); }, [dispatch, myOrder]);
const handleContinueClick = useCallback(() => { const handleContinueClick = useCallback(() => {
dispatch(resetPanels()); dispatch(resetPanels());
@@ -134,10 +143,17 @@ export default function ConfirmPanel({ spotlightId }) {
</span> </span>
)} )}
</div> </div>
<CustomImage
src={confirmCardImage}
alt="confirmCardImage"
className={css.img}
/>
</div> </div>
)} )}
<div className={css.buttonWrap}> <div className={css.buttonWrap}>
<TButton onClick={handleReviewClick}>{$L("REVIEW ORDER")}</TButton> <TButton onClick={handleReviewClick} className={css.firstButton}>
{$L("REVIEW ORDER")}
</TButton>
<TButton onClick={handleContinueClick}> <TButton onClick={handleContinueClick}>
{$L("CONTINUE SHOPPING")} {$L("CONTINUE SHOPPING")}
</TButton> </TButton>

View File

@@ -3,7 +3,7 @@
.confirmPanel { .confirmPanel {
background-color: @BG_COLOR_01; background-color: @BG_COLOR_01;
padding-top: 100px; padding-top: 100px !important;
.title { .title {
.font(@fontSize: 48px, @fontFamily: @baseFont); .font(@fontSize: 48px, @fontFamily: @baseFont);
@@ -20,6 +20,13 @@
padding: 40px 0 90px 60px; padding: 40px 0 90px 60px;
border: 1px solid #dadada; border: 1px solid #dadada;
border-radius: 12px; border-radius: 12px;
position: relative;
.img {
position: absolute;
bottom: 0;
right: 0;
}
.topContents { .topContents {
margin-bottom: 27px; margin-bottom: 27px;
@@ -92,5 +99,9 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
.firstButton {
margin-right: 12px;
}
} }
} }