[MobileSendPopUp] SHOPTIME-2875
- 국가별 번호 자릿 수 여부에 따라 sms 호출 - 자릿 수 맞지 않으면 알럿메세지 노출
This commit is contained in:
@@ -1,48 +1,67 @@
|
|||||||
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 {
|
import {
|
||||||
AsYouTypeFormatter,
|
AsYouTypeFormatter,
|
||||||
PhoneNumberFormat,
|
PhoneNumberFormat,
|
||||||
PhoneNumberUtil,
|
PhoneNumberUtil,
|
||||||
} from "google-libphonenumber";
|
} from 'google-libphonenumber';
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import {
|
||||||
|
useDispatch,
|
||||||
|
useSelector,
|
||||||
|
} from 'react-redux';
|
||||||
|
|
||||||
import { off, on } from "@enact/core/dispatcher";
|
import {
|
||||||
import spotlight, { Spotlight } from "@enact/spotlight";
|
off,
|
||||||
import { SpotlightContainerDecorator } from "@enact/spotlight/SpotlightContainerDecorator";
|
on,
|
||||||
import { Spottable } from "@enact/spotlight/Spottable";
|
} from '@enact/core/dispatcher';
|
||||||
|
import spotlight, { Spotlight } from '@enact/spotlight';
|
||||||
|
import {
|
||||||
|
SpotlightContainerDecorator,
|
||||||
|
} from '@enact/spotlight/SpotlightContainerDecorator';
|
||||||
|
import { Spottable } from '@enact/spotlight/Spottable';
|
||||||
|
|
||||||
import defaultImage from "../../../assets/images/img-thumb-empty-144@3x.png";
|
import defaultImage from '../../../assets/images/img-thumb-empty-144@3x.png';
|
||||||
import { types } from "../../actions/actionTypes";
|
import { types } from '../../actions/actionTypes';
|
||||||
import { clearSMS, sendSms } from "../../actions/appDataActions";
|
import {
|
||||||
|
clearSMS,
|
||||||
|
sendSms,
|
||||||
|
} from '../../actions/appDataActions';
|
||||||
import {
|
import {
|
||||||
changeLocalSettings,
|
changeLocalSettings,
|
||||||
setHidePopup,
|
setHidePopup,
|
||||||
setShowPopup,
|
setShowPopup,
|
||||||
} from "../../actions/commonActions";
|
} from '../../actions/commonActions';
|
||||||
import {
|
import {
|
||||||
clearRegisterDeviceInfo,
|
clearRegisterDeviceInfo,
|
||||||
getDeviceAdditionInfo,
|
getDeviceAdditionInfo,
|
||||||
registerDeviceInfo,
|
registerDeviceInfo,
|
||||||
} from "../../actions/deviceActions";
|
} from '../../actions/deviceActions';
|
||||||
import {
|
import {
|
||||||
clearCurationCoupon,
|
clearCurationCoupon,
|
||||||
setEventIssueReq,
|
setEventIssueReq,
|
||||||
} from "../../actions/eventActions";
|
} from '../../actions/eventActions';
|
||||||
import { sendLogShopByMobile } from "../../actions/logActions";
|
import { sendLogShopByMobile } from '../../actions/logActions';
|
||||||
import { ACTIVE_POPUP, LOG_TP_NO } from "../../utils/Config";
|
import {
|
||||||
|
ACTIVE_POPUP,
|
||||||
|
LOG_TP_NO,
|
||||||
|
} from '../../utils/Config';
|
||||||
import {
|
import {
|
||||||
$L,
|
$L,
|
||||||
decryptPhoneNumber,
|
decryptPhoneNumber,
|
||||||
encryptPhoneNumber,
|
encryptPhoneNumber,
|
||||||
} from "../../utils/helperMethods";
|
} from '../../utils/helperMethods';
|
||||||
import CustomImage from "../CustomImage/CustomImage";
|
import CustomImage from '../CustomImage/CustomImage';
|
||||||
import TButton from "../TButton/TButton";
|
import TButton from '../TButton/TButton';
|
||||||
import TPopUp from "../TPopUp/TPopUp";
|
import TPopUp from '../TPopUp/TPopUp';
|
||||||
import HistoryPhoneNumber from "./HistoryPhoneNumber/HistoryPhoneNumber";
|
import HistoryPhoneNumber from './HistoryPhoneNumber/HistoryPhoneNumber';
|
||||||
import css from "./MobileSendPopUp.module.less";
|
import css from './MobileSendPopUp.module.less';
|
||||||
import SMSNumKeyPad from "./SMSNumKeyPad";
|
import SMSNumKeyPad from './SMSNumKeyPad';
|
||||||
|
|
||||||
const SECRET_KEY = "fy7BTKuM9eeTQqEC9sF3Iw5qG43Aaip";
|
const SECRET_KEY = "fy7BTKuM9eeTQqEC9sF3Iw5qG43Aaip";
|
||||||
|
|
||||||
@@ -277,10 +296,13 @@ export default function MobileSendPopUp({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleAgreeSendClick = useCallback(() => {
|
const handleAgreeSendClick = useCallback(() => {
|
||||||
if (!mobileNumber) return;
|
|
||||||
|
|
||||||
let naturalNumber = mobileNumber.replace(/\D/g, "");
|
let naturalNumber = mobileNumber.replace(/\D/g, "");
|
||||||
|
|
||||||
|
if (!mobileNumber || naturalNumber.length < getMaxNum(deviceCountryCode)) {
|
||||||
|
setSmsRetCode(907);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (deviceCountryCode === "KR") {
|
if (deviceCountryCode === "KR") {
|
||||||
naturalNumber = "82" + naturalNumber;
|
naturalNumber = "82" + naturalNumber;
|
||||||
}
|
}
|
||||||
@@ -476,6 +498,8 @@ export default function MobileSendPopUp({
|
|||||||
return SMS_ERROR_905;
|
return SMS_ERROR_905;
|
||||||
case 906:
|
case 906:
|
||||||
return SMS_ERROR_906;
|
return SMS_ERROR_906;
|
||||||
|
case 907:
|
||||||
|
return SMS_ERROR_907;
|
||||||
default:
|
default:
|
||||||
return SMS_ERROR_900;
|
return SMS_ERROR_900;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user