import * as React from 'react' import CoverImg from "./coverImg"; import ProductName from "./productName"; import ShopProductDescption from "./productDesc"; import ShopOriginalPrice from "./productOriginalPrice"; import ShopProductBtn from "./productBtn"; import LinkWrapper from "../goodslinkWrapper"; import MUtil from "../../util/utils"; import ShopMarkingNum from "./markingNum"; import ShopPriceWrapper from "./productPrice/wrapper"; import ShopPrice from "./productPrice"; const marketType = MUtil.marketType(); class ShopProduct extends React.Component { constructor(props) { super(props); this.goDetail = this.goDetail.bind(this); } componentDidMount(): void { } goDetail(data) { if (this.props.env == 'isMp') { this.props.goMpPath(data.goodsLink); } else { window.location.href = data.goodsLink; } } render() { let data = this.props.data; return (
{/*图片*/}
{/*商品名称*/} {/*商品描述*/} {/*价格和购买按钮*/} { data.cptType == 9401 ?
{ data.showPrice || data.markPrice == 1 ?
{/*价格*/} { data.showPrice ? {data.pointsPrice ? data.pointsPrice : 0}{data.pointsName ? data.pointsName : '积分'} { data.moneyPrice && data.moneyPrice > 0 ? + ¥{MUtil.centTransformOut(data.moneyPrice)} : '' } : '' }
: '' } { data.showPurBtn ?
{/*购买按钮*/}
: '' }
: data.cptType == 9402 || data.cptType == 9404 ?
{ data.showPrice ?
{/*价格*/} {data.pointsPrice ? data.pointsPrice : 0}积分 { data.moneyPrice && data.moneyPrice > 0 ? + ¥{MUtil.centTransformOut(data.moneyPrice)} : '' }
: '' }
{/*购买按钮*/} { data.showPurBtn ?
{/*购买按钮*/}
: '' }
: data.cptType == 9403 || data.cptType == 9406 ?
{ data.showPrice && data.moneyPrice > 0 ?
{/*价格*/} ¥{MUtil.centTransformOut(data.moneyPrice)}
: '' } { data.showPrice || data.showPurBtn ?
{ data.showPrice ? {data.pointsPrice ? data.pointsPrice : 0}积分 : '' } {/*购买按钮*/} { data.showPurBtn ?
{/*购买按钮*/}
: '' }
: '' }
: data.cptType == 9405 ?
{ data.showPrice || (data.markPrice && data.mItemType == 'big') ?
{/*价格*/} {data.pointsPrice ? data.pointsPrice : 0}积分 { data.moneyPrice && data.moneyPrice > 0 ? + ¥{MUtil.centTransformOut(data.moneyPrice)} : '' } { data.mItemType == 'big' ? : '' }
: '' } {/*购买按钮*/} { data.markPrice || data.showPurBtn ?
{ data.mItemType == 'small' ? : '' } {/*购买按钮*/}
: '' }
: "" }
); } } export default ShopProduct;