diff --git a/com.twin.app.shoptime/assets/images/app-icon-80x80.png b/com.twin.app.shoptime/assets/images/app-icon-80x80.png new file mode 100644 index 00000000..1255c053 Binary files /dev/null and b/com.twin.app.shoptime/assets/images/app-icon-80x80.png differ diff --git a/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg.png b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg.png new file mode 100644 index 00000000..17b0a0f5 Binary files /dev/null and b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg.png differ diff --git a/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@2x.png b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@2x.png new file mode 100644 index 00000000..4688388c Binary files /dev/null and b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@2x.png differ diff --git a/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@3x.png b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@3x.png new file mode 100644 index 00000000..c2b6ca9a Binary files /dev/null and b/com.twin.app.shoptime/assets/images/mypagepanel/img-card-bg@3x.png differ diff --git a/com.twin.app.shoptime/src/App/App.js b/com.twin.app.shoptime/src/App/App.js index 4ecde30d..c6b51cb3 100644 --- a/com.twin.app.shoptime/src/App/App.js +++ b/com.twin.app.shoptime/src/App/App.js @@ -6,7 +6,10 @@ import platform from "@enact/core/platform"; import ThemeDecorator from "@enact/sandstone/ThemeDecorator"; import appinfo from "../../webos-meta/appinfo.json"; -import { changeAppStatus } from "../actions/commonActions"; +import { + changeAppStatus, + getHttpHeaderForServiceRequest, +} from "../actions/commonActions"; import { getAuthenticationCode } from "../actions/deviceActions"; import { getHomeLayout, @@ -18,9 +21,8 @@ import { getSubCategory, getTop20Show } from "../actions/mainActions"; import { getMyRecommandedKeyword } from "../actions/myPageActions"; import { getOnSaleInfo } from "../actions/onSaleActions"; import { getBestSeller } from "../actions/productActions"; -import { getHttpHeaderForServiceRequest } from "../actions/commonActions"; import { lunaTest } from "../lunaSend/lunaTest"; -import { getLaunchParams, clearLaunchParams } from "../utils/helperMethods"; +import { clearLaunchParams, getLaunchParams } from "../utils/helperMethods"; import MainView from "../views/MainView/MainView"; import css from "./App.module.less"; import { handleDeepLink } from "./deepLinkHandler"; @@ -30,6 +32,7 @@ let foreGroundChangeTimer = null; function AppBase(props) { const dispatch = useDispatch(); const { httpHeader } = useSelector((state) => state.common); + const { appStatus } = useSelector((state) => state.common); // called by [receive httpHeader, launch, relaunch] const initService = useCallback( @@ -39,7 +42,7 @@ function AppBase(props) { haveyInit, appinfo ); - if(httpHeader){ + if (httpHeader) { if (haveyInit) { dispatch(changeAppStatus({ connectionFailed: false })); if (typeof window === "object" && window.PalmSystem) { @@ -133,7 +136,7 @@ function AppBase(props) { lunaTest(service, method, subscribe, parameters); } dispatch(getHttpHeaderForServiceRequest()); - //todo subscribe + //todo subscribe // dispatch(getSystemSettings()); // //get captionEnable // dispatch(getSystemSettings2()); @@ -148,10 +151,10 @@ function AppBase(props) { }, []); useEffect(() => { - console.log('httpHeader changed ', httpHeader); - if(!httpHeader){ - - }else{ //계정정보 변경시 또는 초기 로딩시 + console.log("httpHeader changed ", httpHeader); + if (!httpHeader) { + } else { + //계정정보 변경시 또는 초기 로딩시 dispatch(changeAppStatus({ showLoadingPanel: { show: true } })); initService(true); } diff --git a/com.twin.app.shoptime/src/actions/actionTypes.js b/com.twin.app.shoptime/src/actions/actionTypes.js index 9d461bda..5908f38e 100644 --- a/com.twin.app.shoptime/src/actions/actionTypes.js +++ b/com.twin.app.shoptime/src/actions/actionTypes.js @@ -19,6 +19,9 @@ export const types = { SET_EXIT_APP: "SET_EXIT_APP", GET_LOGIN_USER_DATA: "GET_LOGIN_USER_DATA", + // card actions + GET_MY_INFO_CARD_SEARCH: "GET_MY_INFO_CARD_SEARCH", + // appData actions ADD_MAIN_INDEX: "ADD_MAIN_INDEX", diff --git a/com.twin.app.shoptime/src/actions/cardActions.js b/com.twin.app.shoptime/src/actions/cardActions.js new file mode 100644 index 00000000..1a16f033 --- /dev/null +++ b/com.twin.app.shoptime/src/actions/cardActions.js @@ -0,0 +1,32 @@ +import { URLS } from "../api/apiConfig"; +import { TAxios } from "../api/TAxios"; +import { types } from "./actionTypes"; + +// 회원의 등록 카드 정보 조회 IF-LGSP-332 +export const getMyInfoCardSearch = (props) => (dispatch, getState) => { + const { mbrNo } = props; + + const onSuccess = (response) => { + console.log("getMyInfoCardSearch onSuccess: ", response.data); + + dispatch({ + type: types.GET_MY_INFO_CARD_SEARCH, + payload: response.data.data, + }); + }; + + const onFail = (error) => { + console.error("getMyInfoCardSearch OnFail: ", error); + }; + + TAxios( + dispatch, + getState, + "get", + URLS.GET_MY_INFO_CARD_SEARCH, + { mbrNo }, + {}, + onSuccess, + onFail + ); +}; diff --git a/com.twin.app.shoptime/src/actions/commonActions.js b/com.twin.app.shoptime/src/actions/commonActions.js index 75b2cb2d..90de212f 100644 --- a/com.twin.app.shoptime/src/actions/commonActions.js +++ b/com.twin.app.shoptime/src/actions/commonActions.js @@ -43,6 +43,14 @@ export const getLoginUserData = (userData) => ({ payload: userData, }); +export const alertToast = (payload) => (dispatch, getState) => { + if (typeof window === "object" && !window.PalmSystem) { + dispatch(changeAppStatus({ toast: true, toastText: payload })); + } else { + lunaSend.createToast(payload); + } +}; + export const getHttpHeaderForServiceRequest = (onComplete) => (dispatch, getState) => { console.log("getHttpHeaderForServiceRequest "); diff --git a/com.twin.app.shoptime/src/api/apiConfig.js b/com.twin.app.shoptime/src/api/apiConfig.js index 612164db..6f3c94c1 100644 --- a/com.twin.app.shoptime/src/api/apiConfig.js +++ b/com.twin.app.shoptime/src/api/apiConfig.js @@ -11,6 +11,9 @@ export const URLS = { REGISTER_DEVICE: "/lgsp/v1/device/register.lge", REGISTER_DEVICE_INFO: "/lgsp/v1/device/register/info.lge", + // card controller + GET_MY_INFO_CARD_SEARCH: "/lgsp/v1/myinfo/card/search.lge", + //home controller GET_HOME_TERMS: "/lgsp/v1/home/terms.lge", GET_HOME_MENU: "/lgsp/v1/home/menu.lge", @@ -59,6 +62,7 @@ export const URLS = { GET_PRODUCT_COUPON_INFO: "/lgsp/v1/product/coupon/info.lge", GET_PRODUCT_COUPON_SEARCH: "/lgsp/v1/product/coupon/search.lge", }; + const getRicCode = (country, ricCodeSetting) => { if (ricCodeSetting !== "system") { return ricCodeSetting; diff --git a/com.twin.app.shoptime/src/components/TToast/TToast.jsx b/com.twin.app.shoptime/src/components/TToast/TToast.jsx new file mode 100644 index 00000000..44ae3d1e --- /dev/null +++ b/com.twin.app.shoptime/src/components/TToast/TToast.jsx @@ -0,0 +1,33 @@ +import React, { useEffect } from "react"; + +import classNames from "classnames"; +import { useDispatch } from "react-redux"; + +import Alert from "@enact/sandstone/Alert"; +import Spotlight from "@enact/spotlight"; + +import { changeAppStatus } from "../../actions/commonActions"; +import css from "./TToast.module.less"; + +export default function TToast({ text, ...rest }) { + const dispatch = useDispatch(); + + useEffect(() => { + setTimeout(() => { + dispatch(changeAppStatus({ toast: false })); + Spotlight.focus(); + }, 1000); + }, [dispatch]); + + return ( + + {text} + + ); +} diff --git a/com.twin.app.shoptime/src/components/TToast/TToast.module.less b/com.twin.app.shoptime/src/components/TToast/TToast.module.less new file mode 100644 index 00000000..e69de29b diff --git a/com.twin.app.shoptime/src/reducers/cardReducer.js b/com.twin.app.shoptime/src/reducers/cardReducer.js new file mode 100644 index 00000000..4f66a2f5 --- /dev/null +++ b/com.twin.app.shoptime/src/reducers/cardReducer.js @@ -0,0 +1,18 @@ +import { types } from "../actions/actionTypes"; + +const initialState = { + cardData: null, +}; + +export const cardReducer = (state = initialState, action) => { + switch (action.type) { + case types.GET_MY_INFO_CARD_SEARCH: + return { + ...state, + cardData: action.payload, + }; + + default: + return state; + } +}; diff --git a/com.twin.app.shoptime/src/reducers/commonReducer.js b/com.twin.app.shoptime/src/reducers/commonReducer.js index b84389eb..4041016a 100644 --- a/com.twin.app.shoptime/src/reducers/commonReducer.js +++ b/com.twin.app.shoptime/src/reducers/commonReducer.js @@ -9,6 +9,8 @@ const initialState = { mbr_no: "", //X-User-Number : "US2401051532595" cursorVisible: false, loginUserData: {}, + toast: false, + toastText: null, }, httpHeader: null, isGnbOpened: false, diff --git a/com.twin.app.shoptime/src/store/store.js b/com.twin.app.shoptime/src/store/store.js index 5106f4bd..ff1991ac 100644 --- a/com.twin.app.shoptime/src/store/store.js +++ b/com.twin.app.shoptime/src/store/store.js @@ -3,6 +3,7 @@ import thunk from "redux-thunk"; import { appDataReducer } from "../reducers/appDataReducer"; import { brandReducer } from "../reducers/brandReducer"; +import { cardReducer } from "../reducers/cardReducer"; import { commonReducer } from "../reducers/commonReducer"; import { couponReducer } from "../reducers/couponReducer"; import { deviceReducer } from "../reducers/deviceReducer"; @@ -31,6 +32,7 @@ const rootReducer = combineReducers({ search: searchReducer, event: eventReducer, coupon: couponReducer, + card: cardReducer, }); export const store = createStore(rootReducer, applyMiddleware(thunk)); diff --git a/com.twin.app.shoptime/src/utils/Config.js b/com.twin.app.shoptime/src/utils/Config.js index 4dea1bde..00c7a724 100644 --- a/com.twin.app.shoptime/src/utils/Config.js +++ b/com.twin.app.shoptime/src/utils/Config.js @@ -42,3 +42,5 @@ export const ACTIVE_POPUP = { termsPopup: "termsPopup", exitPopup: "exitPopup", }; + +export const AUTO_SCROLL_DELAY = 600; diff --git a/com.twin.app.shoptime/src/views/MainView/MainView.jsx b/com.twin.app.shoptime/src/views/MainView/MainView.jsx index 11908c54..b8837e3d 100644 --- a/com.twin.app.shoptime/src/views/MainView/MainView.jsx +++ b/com.twin.app.shoptime/src/views/MainView/MainView.jsx @@ -12,6 +12,7 @@ import { changeAppStatus } from "../../actions/commonActions"; import { pushPanel } from "../../actions/panelActions"; import PreloadImage from "../../components/PreloadImage/PreloadImage"; import TabLayout from "../../components/TabLayout/TabLayout"; +import TToast from "../../components/TToast/TToast"; import * as Config from "../../utils/Config"; import CartPanel from "../CartPanel/CartPanel"; import CategoryPanel from "../CategoryPanel/CategoryPanel"; @@ -52,6 +53,7 @@ export default function MainView() { const mainIndex = useSelector((state) => state.appData.mainIndex); const panels = useSelector((state) => state.panels.panels); const { showLoadingPanel } = useSelector((state) => state.common.appStatus); + const { toast, toastText } = useSelector((state) => state.common.appStatus); const [tabActivated, setTabActivated] = useState(false); const [isTermAgreed, setIsTermAgreed] = useState(false); // TODO: 약관 동의 체크 api 연동 @@ -161,6 +163,7 @@ export default function MainView() { )} + {toast && } ); }