From c786426462f157e73b089b0d7f389948c5695ce1 Mon Sep 17 00:00:00 2001 From: "junghoon86.park" Date: Tue, 18 Jun 2024 16:25:22 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=AB=ED=94=BD=EC=8A=A4=EC=BF=A0=ED=8F=B0?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MobileSend/MobileSendPopUp.jsx | 75 +++++++++++----- .../src/views/HotPicksPanel/HotPicksPanel.jsx | 88 +++++++++++-------- .../views/HotPicksPanel/Type/TCFI/TCFI.jsx | 2 +- 3 files changed, 103 insertions(+), 62 deletions(-) diff --git a/com.twin.app.shoptime/src/components/MobileSend/MobileSendPopUp.jsx b/com.twin.app.shoptime/src/components/MobileSend/MobileSendPopUp.jsx index 25e2c4a9..5cb0f69e 100644 --- a/com.twin.app.shoptime/src/components/MobileSend/MobileSendPopUp.jsx +++ b/com.twin.app.shoptime/src/components/MobileSend/MobileSendPopUp.jsx @@ -1,43 +1,62 @@ -import React, { useCallback, useEffect, useMemo, useState } from "react"; +import React, { + useCallback, + useEffect, + useMemo, + useState, +} from 'react'; -import classNames from "classnames"; +import classNames from 'classnames'; import { AsYouTypeFormatter, PhoneNumberFormat, PhoneNumberUtil, -} from "google-libphonenumber"; -import { useDispatch, useSelector } from "react-redux"; +} from 'google-libphonenumber'; +import { + useDispatch, + useSelector, +} from 'react-redux'; -import { off, on } from "@enact/core/dispatcher"; -import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator"; -import { Spottable } from "@enact/spotlight/Spottable"; +import { + off, + on, +} from '@enact/core/dispatcher'; +import { + SpotlightContainerDecorator, +} from '@enact/spotlight/SpotlightContainerDecorator'; +import { Spottable } from '@enact/spotlight/Spottable'; -import defaultImage from "../../../assets/images/img-thumb-empty-144@3x.png"; -import { types } from "../../actions/actionTypes"; -import { clearSMS, sendSms } from "../../actions/appDataActions"; +import defaultImage from '../../../assets/images/img-thumb-empty-144@3x.png'; +import { types } from '../../actions/actionTypes'; +import { + clearSMS, + sendSms, +} from '../../actions/appDataActions'; import { changeLocalSettings, setHidePopup, setShowPopup, -} from "../../actions/commonActions"; +} from '../../actions/commonActions'; import { clearRegisterDeviceInfo, getDeviceAdditionInfo, registerDeviceInfo, -} from "../../actions/deviceActions"; +} from '../../actions/deviceActions'; import { clearCurationCoupon, setEventIssueReq, -} from "../../actions/eventActions"; -import useLogService from "../../hooks/useLogService"; -import { ACTIVE_POPUP, LOG_TP_NO } from "../../utils/Config"; -import { $L } from "../../utils/helperMethods"; -import CustomImage from "../CustomImage/CustomImage"; -import TButton from "../TButton/TButton"; -import TPopUp from "../TPopUp/TPopUp"; -import HistoryPhoneNumber from "./HistoryPhoneNumber/HistoryPhoneNumber"; -import css from "./MobileSendPopUp.module.less"; -import SMSNumKeyPad from "./SMSNumKeyPad"; +} from '../../actions/eventActions'; +import useLogService from '../../hooks/useLogService'; +import { + ACTIVE_POPUP, + LOG_TP_NO, +} from '../../utils/Config'; +import { $L } from '../../utils/helperMethods'; +import CustomImage from '../CustomImage/CustomImage'; +import TButton from '../TButton/TButton'; +import TPopUp from '../TPopUp/TPopUp'; +import HistoryPhoneNumber from './HistoryPhoneNumber/HistoryPhoneNumber'; +import css from './MobileSendPopUp.module.less'; +import SMSNumKeyPad from './SMSNumKeyPad'; const Container = SpotlightContainerDecorator( { enterTo: "last-focused" }, @@ -73,6 +92,7 @@ export default function MobileSendPopUp({ const [keyPadOff, setKeyPadOff] = useState(false); const [smsRetCode, setSmsRetCode] = useState(undefined); const [chkAgreeBtn, setChkAgreeBtn] = useState(false); + const [popText, setPopText] = useState(false); const { httpHeader } = useSelector((state) => state.common); const regDeviceInfoRetCode = useSelector( (state) => state.device?.regDeviceInfoData?.retCode @@ -335,6 +355,16 @@ export default function MobileSendPopUp({ }) ); } + if (evntTpCd === "EVT00102") { + dispatch( + setEventIssueReq({ + evntTpCd, + evntId, + mbphNo: naturalNumber, + cntryCd: deviceCountryCode, + }) + ); + } }, [ dispatch, mobileNumber, @@ -463,7 +493,6 @@ export default function MobileSendPopUp({ const retCodeError = (smsRetCode !== undefined && smsRetCode !== 0) || (curationCouponSuccess !== undefined && curationCouponSuccess !== 0); - return ( <> {smsRetCode === undefined && diff --git a/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx b/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx index e2542339..6ec328f6 100644 --- a/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx +++ b/com.twin.app.shoptime/src/views/HotPicksPanel/HotPicksPanel.jsx @@ -4,59 +4,66 @@ import React, { useMemo, useRef, useState, -} from "react"; +} from 'react'; -import classNames from "classnames"; -import { useDispatch, useSelector } from "react-redux"; +import classNames from 'classnames'; +import { + useDispatch, + useSelector, +} from 'react-redux'; -import { Job } from "@enact/core/util"; -import Spotlight from "@enact/spotlight"; -import SpotlightContainerDecorator from "@enact/spotlight/SpotlightContainerDecorator"; -import Spottable from "@enact/spotlight/Spottable"; +import { Job } from '@enact/core/util'; +import Spotlight from '@enact/spotlight'; +import SpotlightContainerDecorator + from '@enact/spotlight/SpotlightContainerDecorator'; +import Spottable from '@enact/spotlight/Spottable'; -import { clearSMS } from "../../actions/appDataActions"; +import { clearSMS } from '../../actions/appDataActions'; import { alertToast, setHidePopup, setShowPopup, -} from "../../actions/commonActions"; +} from '../../actions/commonActions'; import { clearGetProductCouponDownload, getProductCouponDownload, -} from "../../actions/couponActions"; -import { setEventIssueReq } from "../../actions/eventActions"; -import { getThemeCurationInfo } from "../../actions/homeActions"; +} from '../../actions/couponActions'; +import { setEventIssueReq } from '../../actions/eventActions'; +import { getThemeCurationInfo } from '../../actions/homeActions'; import { popPanel, pushPanel, resetPanels, updatePanel, -} from "../../actions/panelActions"; +} from '../../actions/panelActions'; import { finishVideoPreview, startVideoPlayer, -} from "../../actions/playActions"; -import MobileSendPopUp from "../../components/MobileSend/MobileSendPopUp"; -import TBody from "../../components/TBody/TBody"; -import TPanel from "../../components/TPanel/TPanel"; -import useLogService from "../../hooks/useLogService"; -import usePrevious from "../../hooks/usePrevious"; -import useScrollTo from "../../hooks/useScrollTo"; -import { launchMembershipApp } from "../../lunaSend"; -import * as Config from "../../utils/Config"; -import { LOG_TP_NO, panel_names } from "../../utils/Config"; -import { $L } from "../../utils/helperMethods"; -import { SpotlightIds } from "../../utils/SpotlightIds"; -import css from "./HotPicks.module.less"; -import TCFI from "./Type/TCFI/TCFI"; -import TCFI_2 from "./Type/TCFI_2/TCFI_2"; -import TCFI_3 from "./Type/TCFI_3/TCFI_3"; -import TCFI_4 from "./Type/TCFI_4/TCFI_4"; -import TCFV from "./Type/TCFV/TCFV"; -import TCFV_2 from "./Type/TCFV_2/TCFV_2"; -import TCFV_3 from "./Type/TCFV_3/TCFV_3"; -import TCFV_4 from "./Type/TCFV_4/TCFV_4"; -import TCHH from "./Type/TCHH/TCHH"; +} from '../../actions/playActions'; +import MobileSendPopUp from '../../components/MobileSend/MobileSendPopUp'; +import TBody from '../../components/TBody/TBody'; +import TPanel from '../../components/TPanel/TPanel'; +import useLogService from '../../hooks/useLogService'; +import usePrevious from '../../hooks/usePrevious'; +import useScrollTo from '../../hooks/useScrollTo'; +import { launchMembershipApp } from '../../lunaSend'; +import * as Config from '../../utils/Config'; +import { + LOG_TP_NO, + panel_names, +} from '../../utils/Config'; +import { $L } from '../../utils/helperMethods'; +import { SpotlightIds } from '../../utils/SpotlightIds'; +import css from './HotPicks.module.less'; +import TCFI from './Type/TCFI/TCFI'; +import TCFI_2 from './Type/TCFI_2/TCFI_2'; +import TCFI_3 from './Type/TCFI_3/TCFI_3'; +import TCFI_4 from './Type/TCFI_4/TCFI_4'; +import TCFV from './Type/TCFV/TCFV'; +import TCFV_2 from './Type/TCFV_2/TCFV_2'; +import TCFV_3 from './Type/TCFV_3/TCFV_3'; +import TCFV_4 from './Type/TCFV_4/TCFV_4'; +import TCHH from './Type/TCHH/TCHH'; const SpottableComponent = Spottable("button"); @@ -379,15 +386,20 @@ export default function HotPicksPanel({ panelInfo, isOnTop, spotlightId }) { } }, [webOSVersion]); - const handlePopupOpen = useCallback( - (patnrId, curationId, evntId, evntTpCd, eventInfoV2) => { + useEffect(() => { + if (activePopup !== "hotPicksSmsPopup") { + setSmsTpCode(""); setIsCurationEvnt(false); setPopPatnrId(null); setPopCurationId(null); setPopEvntId(null); setPopEventInfo(null); + } + }, [activePopup]); - // coupon + const handlePopupOpen = useCallback( + (patnrId, curationId, evntId, evntTpCd, eventInfoV2) => { + //coupon if (eventInfoV2 && eventInfoV2.evntTpCd === "EVT00102") { setIsCurationEvnt(true); setPopPatnrId(patnrId); diff --git a/com.twin.app.shoptime/src/views/HotPicksPanel/Type/TCFI/TCFI.jsx b/com.twin.app.shoptime/src/views/HotPicksPanel/Type/TCFI/TCFI.jsx index ac9b7b16..7c7f83d2 100644 --- a/com.twin.app.shoptime/src/views/HotPicksPanel/Type/TCFI/TCFI.jsx +++ b/com.twin.app.shoptime/src/views/HotPicksPanel/Type/TCFI/TCFI.jsx @@ -138,7 +138,7 @@ export default function TCFI({ }) ); } else { - changePop(patnrId, curationId, evntId, evntTpCd, eventInfoV2); + changePop(patnrId, curationId, evntId, evntTpCd, ""); } } }