|
|
@@ -0,0 +1,123 @@
|
|
|
+import Modal from "@mui/material/Modal";
|
|
|
+import Fade from "@mui/material/Fade";
|
|
|
+import styles from "./styles.module.scss"
|
|
|
+import {ClickAwayListener} from "@mui/base/ClickAwayListener";
|
|
|
+import Grow from "@mui/material/Grow";
|
|
|
+import styled from 'styled-components/macro';
|
|
|
+import rain_bg3 from "@assets/moneyrain/rain_bg3.png";
|
|
|
+import close_bai from "@assets/moneyrain/Close_bai.png";
|
|
|
+import rain_card from "@assets/moneyrain/rain_card.png";
|
|
|
+import red_box from "@assets/moneyrain/huodongrukou5_jianbian.png";
|
|
|
+import time_icon from "@assets/moneyrain/shijian_bai.png";
|
|
|
+import star_icon from "@assets/moneyrain/bofang_bai.png";
|
|
|
+import {format2LongChips, stringFormat} from "@utils/helpers";
|
|
|
+const i18n=global.i18n;
|
|
|
+const StyledRules=styled.div`
|
|
|
+ background: url(${rain_bg3});
|
|
|
+`
|
|
|
+const StyledRewardCon=styled.div`
|
|
|
+ background: url(${rain_card});
|
|
|
+`
|
|
|
+const WMoneyRain = ({close}) => {
|
|
|
+ const getRuleTxt=(totalStr)=>{
|
|
|
+ let txt=[];
|
|
|
+ for (let i = 0; i < 4; i++) {
|
|
|
+ let str=i18n.t("moneyRain.des.tips_"+i);
|
|
|
+ if (i===0)str=stringFormat(str,[global.DOLLAR+" "+totalStr]);
|
|
|
+ txt.push(str);
|
|
|
+ }
|
|
|
+ return txt;
|
|
|
+ }
|
|
|
+ const renderRules=()=>{
|
|
|
+ let toatlNum=10000000;
|
|
|
+ let maxNum=777700;
|
|
|
+ let totalStr=format2LongChips(toatlNum);
|
|
|
+ let maxStr=format2LongChips(maxNum);
|
|
|
+ let timeData=[
|
|
|
+ "12:00-12:59",
|
|
|
+ "14:00-14:59",
|
|
|
+ "18:00-18:59",
|
|
|
+ "20:00-20:59"
|
|
|
+ ];
|
|
|
+ let timeLen=timeData.length;
|
|
|
+ let rules=getRuleTxt(totalStr);
|
|
|
+ return (
|
|
|
+ <Grow in={true} timeout={500}>
|
|
|
+ <StyledRules className={styles.rule_container}>
|
|
|
+ <button className={styles.close} onClick={close}>
|
|
|
+ <img src={close_bai}/>
|
|
|
+ </button>
|
|
|
+ <div className={styles.title}>
|
|
|
+ {i18n.t("moneyRain.rule.title")}
|
|
|
+ </div>
|
|
|
+ <StyledRewardCon className={styles.reward_con}>
|
|
|
+ <div className={styles.reward_item}>
|
|
|
+ <img src={red_box}/>
|
|
|
+ <div className={styles.text_con}>
|
|
|
+ <div>{global.DOLLAR}</div>
|
|
|
+ <div className={styles.reward}>{totalStr}</div>
|
|
|
+ <div>{i18n.t("moneyRain.rule.reward_tip_1")}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={styles.reward_item}>
|
|
|
+ <img src={red_box}/>
|
|
|
+ <div className={styles.text_con}>
|
|
|
+ <div>{i18n.t("moneyRain.rule.reward_tip_2")}</div>
|
|
|
+ <div>{global.DOLLAR}</div>
|
|
|
+ <div className={styles.reward}>{maxStr}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </StyledRewardCon>
|
|
|
+ <div className={styles.time_con}>
|
|
|
+ <div className={styles.time_title}>
|
|
|
+ {stringFormat(i18n.t("moneyRain.time.title"),[timeLen])}
|
|
|
+ </div>
|
|
|
+ <div className={styles.time_content}>
|
|
|
+ {
|
|
|
+ timeData.map((item,index)=>{
|
|
|
+ return (
|
|
|
+ <div key={index} className={styles.time_item}>
|
|
|
+ <img src={time_icon}/>
|
|
|
+ {item}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className={styles.rule_content}>
|
|
|
+ {
|
|
|
+ rules.map((item,index)=>{
|
|
|
+ return (
|
|
|
+ <div key={index} className={styles.rule_item}>
|
|
|
+ <img src={star_icon}/>
|
|
|
+ <div>{item}</div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </StyledRules>
|
|
|
+ </Grow>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ const renderMain = () => {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ {renderRules()}
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <Modal open={true} onClose={close} closeAfterTransition>
|
|
|
+ <Fade in={true} timeout={500}>
|
|
|
+ <div className={styles.container}>
|
|
|
+ <div className={styles.content}>
|
|
|
+ {renderMain()}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Fade>
|
|
|
+ </Modal>
|
|
|
+ )
|
|
|
+}
|
|
|
+export default WMoneyRain;
|