import * as React from "react"; import Util from "../../../util/utils"; import CouponCircle from './circle' /* * 左右锯齿状优惠券 */ class CouponOne extends React.Component { constructor(props) { super(props); this.centTransform = this.centTransform.bind(this); this.state = {} } centTransform(price) { let num = Util.centChange(price); let str = num.str; let arr = str.split('.'); let obj = { price1: arr[0], price2: arr[1], unit: num.unit }; return obj; } onClick(e) { let index = this.props.index; this.props.onClick ? this.props.onClick(index) : '' } render(): React.ReactElement | string | number | {} | React.ReactNodeArray | React.ReactPortal | boolean | null | undefined { let item = this.props.data; let len = this.props.length; let centTransform = this.centTransform; return (
{ item.type == 1 ?

{centTransform(item.faceValue).price1} .{centTransform(item.faceValue).price2} {centTransform(item.faceValue).unit}元

:

{item.faceValue}

}
{ len == 1 ?

优惠券

: '' } { item.thresholdType == 1 ?

满{Util.centTransformOut(item.threshold)}使用

: '无门槛使用' }
{ len == 1 ?
立即领取
: '' }
); } } export default CouponOne;