CategoryItem.js 1.72 KB
Newer Older
zhanghaozhe committed
1
/* eslint-disable jsx-a11y/alt-text */
zhanghaozhe committed
2 3 4
import React, { Component } from "react"
import { Flex, WingBlank } from "antd-mobile"
import "./CategoryItem.scss"
5 6

export default class CategoryItem extends Component {
zhanghaozhe committed
7 8 9 10 11 12 13 14 15 16 17 18 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 47 48 49 50 51 52 53 54 55 56 57 58 59
  render() {
    const {
      course_title,
      price1,
      price0,
      first_level_tip,
      image_name,
      upgrade,
      upgradeImg,
      course_id,
      share,
      toDetail,
    } = this.props
    return (
      <WingBlank>
        <div className={"scholarship-category"}>
          {/* <Link to={`/detail?id=${course_id}`} > */}
          <div className={"imageContainer"} onClick={() => toDetail(course_id)}>
            <img className={"image"} src={image_name}></img>
            {upgrade ? <img src={upgradeImg}></img> : null}
          </div>
          {/* </Link> */}
          <div className={"content"}>
            <Flex
              direction="column"
              justify="around"
              align="start"
              style={{ height: "90px" }}
            >
              {/* <Link to={`/detail?id=${course_id}`} > */}
              <p
                className={"text-overflow-one"}
                onClick={() => toDetail(course_id)}
              >
                {course_title}
              </p>
              {/* </Link> */}
              <p>
                <span className={"priceNow"}>{`¥${price1}`}</span>
                <span className={"pricePrimary"}>{`¥${price0}`}</span>
              </p>
              <div
                className={"shareMoney"}
                onClick={() => {
                  share(course_id, first_level_tip)
                }}
              >{`分享赚${first_level_tip}元`}</div>
            </Flex>
          </div>
        </div>
      </WingBlank>
    )
  }
60
}