[홈패널] 퓨처드브랜드 전송 방식 변경

This commit is contained in:
sungmin.in
2024-04-08 20:24:42 +09:00
parent 85d5e34e34
commit b08ca83bfc
7 changed files with 3379 additions and 3364 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -252,7 +252,7 @@ export const getMyUpcomingAlertShow = () => (dispatch, getState) => {
// MyPage UpComing Alert Show 삭제 (IF-LGSP-042) // MyPage UpComing Alert Show 삭제 (IF-LGSP-042)
export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => { export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
const { patnrId, showId } = params; const { showList } = params;
const onSuccess = (response) => { const onSuccess = (response) => {
console.log("deleteMyUpcomingAlertShow onSuccess ", response.data); console.log("deleteMyUpcomingAlertShow onSuccess ", response.data);
@@ -273,7 +273,7 @@ export const deleteMyUpcomingAlertShow = (params) => (dispatch, getState) => {
"post", "post",
URLS.DELETE_MY_UPCOMING_ALERT_SHOW, URLS.DELETE_MY_UPCOMING_ALERT_SHOW,
{}, {},
{ patnrId, showId }, { showList },
onSuccess, onSuccess,
onFail onFail
); );

View File

@@ -19,13 +19,25 @@
left: 18px; left: 18px;
top: 18px; top: 18px;
} }
.imgBanner { .imgBanner {
> img { > img {
border-radius: 12px; border-radius: 12px;
.size(@w: 486px, @h: 858px); .size(@w: 486px, @h: 858px);
} }
} }
.btnPlay {
.size(@w: 100%, @h: 100%);
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top: 0;
z-index: 2;
> img {
.size(@w: 120px, @h: 120px);
}
}
&.isHorizontal { &.isHorizontal {
.size(@w: 744px, @h: 420px); .size(@w: 744px, @h: 420px);
.imgBanner { .imgBanner {
@@ -34,6 +46,24 @@
} }
} }
} }
.errorContents {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.errorlogo {
width: 120px;
height: 120px;
object-fit: cover;
}
.errorText {
margin-top: 30px;
color: #ff0000;
padding-top: 10px;
}
}
&.todaysDeals { &.todaysDeals {
background-image: url(../../../../assets/images/img_home_banner_td_ver.png); background-image: url(../../../../assets/images/img_home_banner_td_ver.png);
background-size: 486px 858px; background-size: 486px 858px;
@@ -73,7 +103,6 @@
.size(@w: 354px, @h: 354px); .size(@w: 354px, @h: 354px);
} }
} }
&.isHorizontal { &.isHorizontal {
background-image: url(../../../../assets/images/img_home_banner_td_hor.png); background-image: url(../../../../assets/images/img_home_banner_td_hor.png);
background-size: 744px 420px; background-size: 744px 420px;
@@ -118,6 +147,27 @@
} }
} }
.arrow {
z-index: 10;
.size(@w: 42px, @h: 42px);
background-size: 42px 42px;
background-position: center center;
&.leftBtn {
.position(@position: absolute, @top: 406px, @left: 18px);
background-image: url("../../../../assets/images/btn/btn_prev_thumb_nor.png");
&:focus {
background-image: url("../../../../assets/images/btn/btn_prev_thumb_foc.png");
}
}
&.rightBtn {
.position(@position: absolute, @top: 406px, @right: 18px);
background-image: url("../../../../assets/images/btn/btn_next_thumb_nor.png");
&:focus {
background-image: url("../../../../assets/images/btn/btn_next_thumb_foc.png");
}
}
}
&.isHorizontalWrap { &.isHorizontalWrap {
.arrow { .arrow {
&.leftBtn { &.leftBtn {

View File

@@ -152,12 +152,6 @@ export default function RollingUnit({
rollingData[startIndex].priceInfo rollingData[startIndex].priceInfo
); );
// 투데이즈 딜 가격 정보
// const { originalPrice, discountedPrice } =
// usePriceInfo(rollingData[startIndex].priceInfo) || {};
// console.log(rollingData[startIndex].priceInfo);
// 이미지 배너 클릭 // 이미지 배너 클릭
const imageBannerClick = useCallback(() => { const imageBannerClick = useCallback(() => {
let panelName = ""; let panelName = "";
@@ -166,7 +160,7 @@ export default function RollingUnit({
return dispatch( return dispatch(
pushPanel({ pushPanel({
name: panel_names.FEATURED_BRANDS_PANEL, name: panel_names.FEATURED_BRANDS_PANEL,
panelInfo: rollingData[startIndex].patnrId, panelInfo: { patnrId: rollingData[startIndex].patnrId },
}) })
); );
} else if (rollingData[startIndex].shptmLnkTpNm === "Trending now") { } else if (rollingData[startIndex].shptmLnkTpNm === "Trending now") {

View File

@@ -160,7 +160,7 @@ export default function MainView() {
onTabActivated={onTabActivated} onTabActivated={onTabActivated}
/> />
</div> </div>
<LoadingPanel showLoadingPanel={showLoadingPanel} /> {/* <LoadingPanel showLoadingPanel={showLoadingPanel} /> */}
{isLoading && <Loader />} {isLoading && <Loader />}
{toast && <TToast text={toastText} />} {toast && <TToast text={toastText} />}
</> </>

View File

@@ -26,15 +26,7 @@ import { $L } from "../../../../utils/helperMethods";
import css from "./Reminders.module.less"; import css from "./Reminders.module.less";
import RemindersCard, { SIZES } from "./RemindersCard"; import RemindersCard, { SIZES } from "./RemindersCard";
const HeaderButtonContainer = SpotlightContainerDecorator( const HeaderButtonContainer = SpotlightContainerDecorator("div");
{
leaveFor: {
left: "",
right: "",
},
},
"div"
);
export default function Reminders({ title, cbScrollTo }) { export default function Reminders({ title, cbScrollTo }) {
const dispatch = useDispatch(); const dispatch = useDispatch();
@@ -44,7 +36,6 @@ export default function Reminders({ title, cbScrollTo }) {
upComingAlertShow, upComingAlertShow,
upComingAlertShowKeys, upComingAlertShowKeys,
upComingAlertShowChangeInfo, upComingAlertShowChangeInfo,
deleteMyUpcomingAlertShow,
} = useSelector((state) => state.myPage.upComingData); } = useSelector((state) => state.myPage.upComingData);
const { popupVisible, activePopup } = useSelector( const { popupVisible, activePopup } = useSelector(
(state) => state.common.popup (state) => state.common.popup
@@ -57,6 +48,9 @@ export default function Reminders({ title, cbScrollTo }) {
const [selectedItems, setSelectedItems] = useState({}); const [selectedItems, setSelectedItems] = useState({});
const [selectAll, setSelectAll] = useState(false); const [selectAll, setSelectAll] = useState(false);
// let timerRef = useRef();
// 스위치 on, off
useEffect(() => { useEffect(() => {
setUseAlarm(upComingAlertShow?.upcomAlamUseFlag === "Y"); setUseAlarm(upComingAlertShow?.upcomAlamUseFlag === "Y");
}, [upComingAlertShow]); }, [upComingAlertShow]);
@@ -66,21 +60,23 @@ export default function Reminders({ title, cbScrollTo }) {
dispatch(getMyUpcomingAlertShow()); dispatch(getMyUpcomingAlertShow());
dispatch(getMyUpcomingAlertShowKeys()); dispatch(getMyUpcomingAlertShowKeys());
dispatch(getUpcomingAlertShowChangeInfo()); dispatch(getUpcomingAlertShowChangeInfo());
// dispatch(deleteMyUpcomingAlertShow());
}, [dispatch]); }, [dispatch]);
// useEffect(() => {
// return () => timerRef.current && clearTimeout(timerRef.current);
// }, []);
// 아이템 설정 // 아이템 설정
useEffect(() => { useEffect(() => {
const initialSelectedItems = upComingAlertShow.alertShows?.reduce( const initialSelectedItems = upComingAlertShow.alertShows?.reduce(
(acc, item, index) => { (acc, item, index) => {
acc[item.showId] = false; acc[item.showId] = false;
return acc; return acc;
}, },
{} {}
); );
setSelectedItems(initialSelectedItems); setSelectedItems(initialSelectedItems);
}, [upComingAlertShow]); }, [upComingAlertShow.alertShows]);
// 스위치 버튼 // 스위치 버튼
const handleToggleSwitchButton = useCallback(() => { const handleToggleSwitchButton = useCallback(() => {
@@ -94,21 +90,6 @@ export default function Reminders({ title, cbScrollTo }) {
setUseAlarm(!useAlarm); setUseAlarm(!useAlarm);
}, [dispatch, useAlarm]); }, [dispatch, useAlarm]);
// 전체 선택
const handleSelectAllToggle = useCallback(() => {
const newState = !selectAll;
setSelectedItems(
Object.keys(selectedItems).reduce((acc, key) => {
acc[key] = newState;
return acc;
}, {})
);
setSelectAll(newState);
}, [selectAll, selectedItems]);
// 삭제 버튼 // 삭제 버튼
const handleDeleteBtnClick = useCallback(() => { const handleDeleteBtnClick = useCallback(() => {
if (activeDelete) { if (activeDelete) {
@@ -133,22 +114,39 @@ export default function Reminders({ title, cbScrollTo }) {
Object.entries(selectedItems).forEach(([id, selected]) => { Object.entries(selectedItems).forEach(([id, selected]) => {
if (selected) { if (selected) {
const item = upComingAlertShow.alertShows.find( const item = upComingAlertShow.alertShows.find(
(item) => item.showId === id (item) => item.patnrId === id || item.showId === id
); );
if (item.showId === id) { if (item.showId === id || item.patnrId === id) {
showList.push({ showId: item.showId }); showList.push({ patnrId: item.patnrId, showId: item.showId });
} }
} }
}); });
console.log(showList, "쇼리스트");
if (showList.length > 0) { if (showList.length > 0) {
// dispatch(deleteMyUpcomingAlertShow({ showList })); dispatch(deleteMyUpcomingAlertShow({ showList }));
} }
} }
setActiveDelete((prev) => !prev); setActiveDelete((prev) => !prev);
}, [dispatch, upComingAlertShow, selectedItems, activeDelete]); }, [dispatch, upComingAlertShow, selectedItems, activeDelete]);
// 전체 선택
const handleSelectAllToggle = useCallback(() => {
const newState = !selectAll;
setSelectedItems(
Object.keys(selectedItems).reduce((acc, key) => {
acc[key] = newState;
return acc;
}, {})
);
setSelectAll(newState);
}, [selectAll, selectedItems]);
// 아이템 토글 버튼 // 아이템 토글 버튼
const handleItemToggle = useCallback( const handleItemToggle = useCallback(
(showId) => { (showId) => {
@@ -163,7 +161,6 @@ export default function Reminders({ title, cbScrollTo }) {
[selectedItems] [selectedItems]
); );
//
const handleCancel = useCallback(() => { const handleCancel = useCallback(() => {
dispatch(setHidePopup()); dispatch(setHidePopup());
}, [dispatch]); }, [dispatch]);
@@ -187,8 +184,6 @@ export default function Reminders({ title, cbScrollTo }) {
({ index, ...rest }) => { ({ index, ...rest }) => {
const item = upComingAlertShow.alertShows[index]; const item = upComingAlertShow.alertShows[index];
console.log(selectedItems[item.showId], "아이템");
return ( return (
<RemindersCard <RemindersCard
{...rest} {...rest}
@@ -217,17 +212,23 @@ export default function Reminders({ title, cbScrollTo }) {
[upComingAlertShow, activeDelete, selectedItems, handleItemToggle] [upComingAlertShow, activeDelete, selectedItems, handleItemToggle]
); );
// console.log("--------------------"); console.log("--------------------");
// console.log("upComingChangeInfo", upComingChangeInfo); console.log("upComingChangeInfo", upComingChangeInfo);
// console.log("upComingAlertShow", upComingAlertShow); console.log("upComingAlertShow", upComingAlertShow);
// console.log("upComingAlertShowKeys", upComingAlertShowKeys); console.log("upComingAlertShowKeys", upComingAlertShowKeys);
// console.log("upComingAlertShowChangeInfo", upComingAlertShowChangeInfo); console.log("upComingAlertShowChangeInfo", upComingAlertShowChangeInfo);
// console.log("--------------------"); console.log("--------------------");
return ( return (
<> <>
<THeader title={title} className={css.remindersHeader}> <THeader title={title} className={css.remindersHeader}>
<HeaderButtonContainer className={css.headerButtonContainer}> <HeaderButtonContainer className={css.headerButtonContainer}>
<TSwitch
className={css.switchBtn}
selected={useAlarm}
onClick={handleToggleSwitchButton}
/>
{activeDelete && ( {activeDelete && (
<> <>
<div className={css.deleteAll}> <div className={css.deleteAll}>
@@ -250,12 +251,6 @@ export default function Reminders({ title, cbScrollTo }) {
{upComingAlertShow.alertShows && {upComingAlertShow.alertShows &&
upComingAlertShow.alertShows.length > 0 ? ( upComingAlertShow.alertShows.length > 0 ? (
<> <>
<TSwitch
className={css.switchBtn}
selected={useAlarm}
onClick={handleToggleSwitchButton}
/>
<TButton <TButton
type={TYPES.mypage} type={TYPES.mypage}
className={css.deleteBtn} className={css.deleteBtn}

View File

@@ -76,13 +76,13 @@ export default memo(function RemindersCard({
className={css.patncLogo} className={css.patncLogo}
/> />
<div className={css.imgWrap}> {/* <div className={css.imgWrap}>
{soldOutYn === "Y" && ( {soldOutYn === "Y" && (
<div className={css.soldOutOverlay}> <div className={css.soldOutOverlay}>
<p className={css.soldOutText}>{"Comming Soon"}</p> <p className={css.soldOutText}>{"Comming Soon"}</p>
</div> </div>
)} )}
</div> </div> */}
{activeDelete && ( {activeDelete && (
<div <div