index.js 1.43 KB
Newer Older
zhanghaozhe committed
1 2 3 4 5
import React, { Component } from "react"
import "./index.scss"
import { connect } from "react-redux"
import { withRouter } from "react-router-dom"
import { compose } from "redux"
xuzhenghua committed
6 7

class Deposit extends Component {
zhanghaozhe committed
8 9 10 11
  constructor(props) {
    super(props)
    this.state = {}
  }
xuzhenghua committed
12

zhanghaozhe committed
13 14 15 16 17
  render() {
    const { courseInfo } = this.props
    let info = ""
    if (courseInfo) {
      info = courseInfo.deposit_info
xuzhenghua committed
18
    }
zhanghaozhe committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    return (
      <div className="buy-expand">
        <p className="buy-time">
          付定金时间:{info.deposit_start_time}-{info.deposit_end_time}
        </p>
        <p className="buy-time">
          付尾款时间:{info.final_start_time}-{info.final_end_time}
        </p>
        <div className="expand-bgimg">
          <img
            className="four-year"
            src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/dj-1111.png"
            alt=""
          />
          <span className="dingjin">
            定金{info.deposit_amount}元,可抵扣{info.deduction_amount}
          </span>
          <p className="small">
            到手价最低:¥
            <span>{info.low_price}</span>
          </p>
          <p className="else-tip">
            另可获得最高{info.deposit_coupon}元代金券进行叠加
          </p>
        </div>
      </div>
    )
  }
xuzhenghua committed
47 48 49
}

export default compose(
zhanghaozhe committed
50 51 52 53 54 55 56
  connect(
    (state) => ({
      user: state.user,
    }),
    null
  ),
  withRouter
xuzhenghua committed
57
)(Deposit)