[포유 작업]#1

- action, reducer 에 recommendProduct 관련 추가.
 - 로그 관련으로 Config에 pickedforyou추가
 - homepanel pickforyou노출 건으로 추가.
 - homepanel getSubCategory에 파라미터 추가.
 - bestseller,pickedforyou노출 변경.(foru api에서 내려주는걸로)
 - subCategory 노출 변경. foru api에서 내려주는 아이템 2개 추가및 기존 데이터 중복시 제거.
This commit is contained in:
junghoon86.park
2025-11-10 16:17:51 +09:00
parent 3e547df1a4
commit 11582840b8
7 changed files with 156 additions and 67 deletions

View File

@@ -67,18 +67,33 @@ const BestSeller = ({
const { cursorVisible } = useSelector((state) => state.common.appStatus);
const bestSellerDatas = useSelector(
(state) => state.product.bestSellerData?.bestSeller
);
const bestSellerNewDatas = useSelector(
(state) =>
state.foryou?.justForYouInfo?.shelfInfos
);
const [drawChk, setDrawChk] = useState(false);
const [firstChk, setFirstChk] = useState(0);
const [bestInfos, setBestInfos] = useState(null);
useEffect(()=>{
setBestInfos(
bestSellerNewDatas?.filter(
(item) => item.recommendTpCd === "BESTSELLER"
)
)
},[bestSellerNewDatas])
const orderStyle = useMemo(() => ({ order: order }), [order]);
useEffect(() => {
useEffect(() => {
setDrawChk(true);
}, [bestSellerDatas]);
}, [bestSellerNewDatas]);
const handleCardClick = useCallback(
(patnrId, prdtId) => () => {
@@ -176,22 +191,7 @@ const BestSeller = ({
handleShelfFocus();
}
}, [handleShelfFocus]);
const [bestSellerNewData, setBestSellerNewData] = useState([]);
const _randomProduct = useCallback(() => {
const randomChk = Math.round(Math.random()) === 0 ? false : true;
return randomChk;
}, []);
useEffect(() => {
setBestSellerNewData(
bestSellerDatas?.map((item) => ({
...item,
// foryou: _randomProduct(),
}))
);
}, [bestSellerDatas]);
return (
<Container
@@ -213,8 +213,8 @@ const BestSeller = ({
cbScrollTo={getScrollTo}
noScrollByWheel
>
{bestSellerNewData &&
bestSellerNewData.map(
{bestInfos &&
bestInfos?.[0].productInfos.map(
(
{
prdtId,
@@ -226,7 +226,7 @@ const BestSeller = ({
offerInfo,
brndNm,
patncNm,
catNm,
//catNm, 없음
//foryou,
euEnrgLblInfos,
},
@@ -251,7 +251,7 @@ const BestSeller = ({
shelfTitle={shelfTitle}
patnerName={patncNm}
brandName={brndNm}
catNm={catNm}
// catNm={catNm}
imageAlt={prdtId}
imageSource={imgUrl}
priceInfo={priceInfo}
@@ -265,7 +265,7 @@ const BestSeller = ({
offerInfo={offerInfo}
spotlightId={"bestsellerItem" + itemIndex}
firstLabel={rankText}
label={itemIndex * 1 + 1 + " of " + bestSellerNewData.length}
label={itemIndex * 1 + 1 + " of " + bestInfos?.[0].productInfos.length}
lastLabel=" go to detail, button"
euEnrgLblInfos={euEnrgLblInfos}
>