import { Component } from "react";

import "./PrizePanel.less";
import { Button } from "@grace/ui";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl.tsx";
import { _throttle } from "@/utils/utils";
import PrizePage from "@/pages/PrizePage/PrizePage.tsx";
import { PageCtrl } from '@/core/ctrls/PageCtrl';

export class PrizePanel extends Component<any, any> {

    componentDidMount() {
    }

    clickClose = () => {
        ModalCtrl.closeModal();
    }

    clickBtn = _throttle(() => {
        ModalCtrl.closeModal();
        // PageCtrl.changePage(PrizePage);
    })

    render() {

        const { optionImg, optionName } = this.props;

        return <div className="PrizePanel modal_center">
            <div className="bg" />
            <img className="img" src={optionImg} />
            <div className="prizeName">{optionName}</div>
            <Button className={`btn`} onClick={this.clickBtn} />
            <div className="tips">奖品可在「首页奖品」中查看</div>
            <Button className="close" onClick={this.clickClose} />
        </div>
    }


}
