index.js 3.83 KB
Newer Older
zhanghaozhe committed
1 2 3
import React, { Component } from 'react';
import './bargain.scss'
import { Flex } from "antd-mobile";
zhanghaozhe committed
4 5
import Overlay from '../overlay'
import BargainInfo from './bargainInfo'
zhanghaozhe committed
6 7

class Bargain extends Component {
zhanghaozhe committed
8 9 10 11 12 13 14
    state = {
        showCover: false
    }
    toggleCover = () => {
        this.setState({showCover: !this.state.showCover});
    }

zhanghaozhe committed
15 16 17
    render() {
        return (
            <div className={'bargain'}>
zhanghaozhe committed
18 19
                <BargainIntro
                    onClick={this.toggleCover}
zhanghaozhe committed
20
                />
zhanghaozhe committed
21 22 23
                {
                    this.state.showCover &&
                    <Overlay>
zhanghaozhe committed
24
                        <BargainSuccess/>
zhanghaozhe committed
25 26
                    </Overlay>
                }
zhanghaozhe committed
27 28 29 30 31
            </div>
        );
    }
}

zhanghaozhe committed
32
function BargainIntro({onClick}) {
zhanghaozhe committed
33 34 35 36 37 38 39 40 41 42 43 44
    return (
        <div className="intro-outer">
            <div className="intro-inner">
                <Flex direction={'column'} justify={'center'} className={'intro-wrapper'}>
                    <p>
                        邀请
                        <span className={'indicator'}>20</span>
                        好友帮忙砍价可获得
                        <span className={'indicator'}>【砍价神器】</span>
                    </p>
                    <p>一刀绝杀,砍爆底价</p>
                    <Flex.Item>
zhanghaozhe committed
45
                        <button onClick={onClick}>我要砍价</button>
zhanghaozhe committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
                    </Flex.Item>
                </Flex>
            </div>
        </div>
    )
}

function BargainStatus() {
    return (
        <div className="status-outer">
            <div className="status-inner">
                <Flex direction={'column'}>
                    <div className={'first-row'}>
                        <div>
                            已砍<span className={'indicator'}>59</span>
                            <span className={'time hour'}>23</span>:
                            <span className={'time min'}>59</span>:
                            <span className={'time sec'}>02</span>
                            后砍价结束
                        </div>
                        <div>15位好友助力></div>
                    </div>
                    <div className="sec-row">
                        <div>
zhanghaozhe committed
70 71 72
                            <img
                                src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556513873959&di=dde8198548f6157add517042e0225748&imgtype=0&src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180802%2F00%2F1533140084-jtaHBPSIOh.jpg"
                                alt=""/>
zhanghaozhe committed
73 74 75 76 77 78 79 80 81
                            <span>机器学习集训营</span>
                        </div>
                        <div>
                            <div>砍掉<span className={'indicator'}>25.3</span></div>
                            <button>继续砍价</button>
                        </div>
                    </div>
                    <div className="third-row">
                        <div>
zhanghaozhe committed
82 83
                            再邀请<span className={'indicator'}>5</span>位好友助力即可获得<span
                            className={'indicator'}>【砍价神器】</span>
zhanghaozhe committed
84 85 86 87 88 89 90 91 92 93
                        </div>

                        {/*<button>立即领取</button>*/}
                    </div>
                </Flex>
            </div>
        </div>
    )
}

zhanghaozhe committed
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
function BargainSuccess() {
    return (
        <div className="bargain-success">
            <p className={'title'}>
                恭喜你,一刀砍了
                <span className={'indicator'}>39.8</span>
            </p>
            <p>分享到微信群邀请更多好友帮忙砍价</p>
            <p>
                超过20位好友助力可获得
                <span className={'indicator'} style={{color: '#FF4000'}}>【砍价神器】</span>
                
            </p>
        </div>
    )
}

zhanghaozhe committed
111

zhanghaozhe committed
112
export default Bargain;