|
@@ -7,6 +7,7 @@ import icon_2 from "@assets/promotion/icon_2.svg";
|
|
|
import banner_2 from "@assets/promotion/banner_2.png";
|
|
import banner_2 from "@assets/promotion/banner_2.png";
|
|
|
import icon_3 from "@assets/promotion/icon_3.svg";
|
|
import icon_3 from "@assets/promotion/icon_3.svg";
|
|
|
import banner_3 from "@assets/promotion/banner_3.png";
|
|
import banner_3 from "@assets/promotion/banner_3.png";
|
|
|
|
|
+import new_icon from "@assets/promotion/new.png";
|
|
|
import {useNavigate} from "react-router-dom";
|
|
import {useNavigate} from "react-router-dom";
|
|
|
import {useDispatch, useSelector} from "react-redux";
|
|
import {useDispatch, useSelector} from "react-redux";
|
|
|
import {getRedPackInfo} from "@features/redpackSlice";
|
|
import {getRedPackInfo} from "@features/redpackSlice";
|
|
@@ -14,6 +15,10 @@ import {formatTime} from "@utils/helpers";
|
|
|
import {reqRedpackCheck} from "@features/api";
|
|
import {reqRedpackCheck} from "@features/api";
|
|
|
import {getTurnplate} from "@features/turnplateSlice";
|
|
import {getTurnplate} from "@features/turnplateSlice";
|
|
|
import {getActivityList} from "@features/activitySlice";
|
|
import {getActivityList} from "@features/activitySlice";
|
|
|
|
|
+import LazyImgix from "@components/Imgix/LazyImgix";
|
|
|
|
|
+import {getBonusList} from "@features/agentSlice";
|
|
|
|
|
+import clock from "@assets/promotion/clock.json";
|
|
|
|
|
+import Lottie from "lottie-react";
|
|
|
const icons=[
|
|
const icons=[
|
|
|
null,
|
|
null,
|
|
|
icon_1,
|
|
icon_1,
|
|
@@ -30,31 +35,32 @@ const WPromotion=({close})=>{
|
|
|
const navigate=useNavigate();
|
|
const navigate=useNavigate();
|
|
|
const redpack=useSelector(getRedPackInfo);
|
|
const redpack=useSelector(getRedPackInfo);
|
|
|
const turnplate=useSelector(getTurnplate);
|
|
const turnplate=useSelector(getTurnplate);
|
|
|
|
|
+ const agentBonus=useSelector(getBonusList);
|
|
|
const dispatch=useDispatch();
|
|
const dispatch=useDispatch();
|
|
|
- const list=useSelector(getActivityList);
|
|
|
|
|
- let data=[
|
|
|
|
|
- {
|
|
|
|
|
- id:1,
|
|
|
|
|
- title:"Tycoon",
|
|
|
|
|
- icon:"",
|
|
|
|
|
- banner:"",
|
|
|
|
|
- link:"#/cashwheel",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id:2,
|
|
|
|
|
- title:"Collection",
|
|
|
|
|
- icon:"",
|
|
|
|
|
- banner:"",
|
|
|
|
|
- link:"#/moneyrain",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id:3,
|
|
|
|
|
- title:"Agent",
|
|
|
|
|
- icon:"",
|
|
|
|
|
- banner:"",
|
|
|
|
|
- link:"#/agent",
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ const data=useSelector(getActivityList);
|
|
|
|
|
+ // let data=[
|
|
|
|
|
+ // {
|
|
|
|
|
+ // id:1,
|
|
|
|
|
+ // title:"Tycoon",
|
|
|
|
|
+ // icon:"",
|
|
|
|
|
+ // banner:"",
|
|
|
|
|
+ // link:"#/cashwheel",
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // id:2,
|
|
|
|
|
+ // title:"Collection",
|
|
|
|
|
+ // icon:"",
|
|
|
|
|
+ // banner:"",
|
|
|
|
|
+ // link:"#/moneyrain",
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // id:3,
|
|
|
|
|
+ // title:"Agent",
|
|
|
|
|
+ // icon:"",
|
|
|
|
|
+ // banner:"",
|
|
|
|
|
+ // link:"#/agent",
|
|
|
|
|
+ // }
|
|
|
|
|
+ // ]
|
|
|
useEffect(()=>{
|
|
useEffect(()=>{
|
|
|
dispatch(reqRedpackCheck());
|
|
dispatch(reqRedpackCheck());
|
|
|
},[])
|
|
},[])
|
|
@@ -92,25 +98,92 @@ const WPromotion=({close})=>{
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
+ const checkDot=(item)=>{
|
|
|
|
|
+ if (item.id===1){
|
|
|
|
|
+ if (turnplate&&turnplate.times>0){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (item.id===2){
|
|
|
|
|
+ if (agentBonus&&agentBonus.length>0){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (item.id===3){
|
|
|
|
|
+ if (redpack&&redpack.status===1){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // const checkRender
|
|
|
|
|
+ const checkRenderLeft=(item)=>{
|
|
|
|
|
+ if (item.id===3){}
|
|
|
|
|
+ return (
|
|
|
|
|
+ <></>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const checkRenderCD=(item)=>{
|
|
|
|
|
+ if (redpack==null)return (<></>);
|
|
|
|
|
+ let status=redpack.status;
|
|
|
|
|
+ if (status!==0)return (<></>);
|
|
|
|
|
+ let cdLeft=redpack.next_in_seconds;
|
|
|
|
|
+ let cdLeftStr=formatTime(cdLeft);
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.item_right}>
|
|
|
|
|
+ <div className={styles.clock_item}>
|
|
|
|
|
+ {cdLeftStr}
|
|
|
|
|
+ <Lottie animationData={clock} className={styles.clock_icon} />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const checkRenderRight=(item)=>{
|
|
|
|
|
+ let isdot=checkDot(item);
|
|
|
|
|
+ if (isdot){
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.item_right}>
|
|
|
|
|
+ <img src={new_icon} className={`${styles.act_new} iconshake`}/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ if (item.id===3){
|
|
|
|
|
+ return checkRenderCD(item);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return (
|
|
|
|
|
+ <></>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
const renderItem = (item) => {
|
|
const renderItem = (item) => {
|
|
|
- if (item.id === 2) return (renderRedPackItem(item));
|
|
|
|
|
|
|
+ // if (item.id === 2) return (renderRedPackItem(item));
|
|
|
|
|
+ // return (
|
|
|
|
|
+ // <>
|
|
|
|
|
+ // <div className={styles.gift_title}>{item.title}</div>
|
|
|
|
|
+ // <button className={styles.git_fun_item} onClick={() => {
|
|
|
|
|
+ // navigate(item.link);
|
|
|
|
|
+ // }}>
|
|
|
|
|
+ // <div className={styles.left}>
|
|
|
|
|
+ // <div className={styles.icon_con}>
|
|
|
|
|
+ // <img className={"iconshake"} src={icons[item.id]}/>
|
|
|
|
|
+ // {/*<div className={styles.red_dot}></div>*/}
|
|
|
|
|
+ // {checkRenderDot(item)}
|
|
|
|
|
+ // </div>
|
|
|
|
|
+ // </div>
|
|
|
|
|
+ // <div className={styles.right}>
|
|
|
|
|
+ // <img src={banners[item.id]}/>
|
|
|
|
|
+ // </div>
|
|
|
|
|
+ // </button>
|
|
|
|
|
+ // </>
|
|
|
|
|
+ // )
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- <div className={styles.gift_title}>{item.title}</div>
|
|
|
|
|
- <button className={styles.git_fun_item} onClick={() => {
|
|
|
|
|
- navigate(item.link);
|
|
|
|
|
- }}>
|
|
|
|
|
- <div className={styles.left}>
|
|
|
|
|
- <div className={styles.icon_con}>
|
|
|
|
|
- <img className={"iconshake"} src={icons[item.id]}/>
|
|
|
|
|
- {/*<div className={styles.red_dot}></div>*/}
|
|
|
|
|
- {checkRenderDot(item)}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className={styles.right}>
|
|
|
|
|
- <img src={banners[item.id]}/>
|
|
|
|
|
- </div>
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <LazyImgix src={item.img} alt={item.title} className={styles.banner} width={1350}></LazyImgix>
|
|
|
|
|
+ <div className={styles.item_content}>
|
|
|
|
|
+ {checkRenderLeft(item)}
|
|
|
|
|
+ {checkRenderRight(item)}
|
|
|
|
|
+ </div>
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -120,9 +193,11 @@ const WPromotion=({close})=>{
|
|
|
{
|
|
{
|
|
|
data.map((item, index) => {
|
|
data.map((item, index) => {
|
|
|
return (
|
|
return (
|
|
|
- <div key={index} className={styles.gift_item}>
|
|
|
|
|
|
|
+ <button key={index} className={styles.act_item} onClick={()=>{
|
|
|
|
|
+ navigate(item.link);
|
|
|
|
|
+ }}>
|
|
|
{renderItem(item)}
|
|
{renderItem(item)}
|
|
|
- </div>
|
|
|
|
|
|
|
+ </button>
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|