import { ComponentClass } from 'react'
import Taro, { Component } from '@tarojs/taro'
import { View, Image, Text } from '@tarojs/components'
import './index.scss'
import SdFormid from '../sdFormid';
type PageOwnProps = {
className?: string
hidePrice?: boolean
onImageClick?: any
styleName?: any
caseId?: any,
area?: any,
homeicName?: any,
province?: any,
price?: any,
xiaoqu?: any,
backgroudurl?: any,
title?: any,
city?: any,
county?: any,
}
type IProps = PageOwnProps
interface Index {
props: IProps;
}
class Index extends Component {
static options = {
addGlobalClass: true
}
handleImageClick = (e) => {
this.props.onImageClick(e)
}
render() {
const {
className,
hidePrice,
area,
homeicName,
province,
price,
xiaoqu,
backgroudurl,
title,
county,
city,
styleName
} = this.props
const hasHouseInfo = area || styleName || homeicName || price
const hasAddress = province || xiaoqu
return (
{
backgroudurl &&
}
{/* 标题 */}
{title}
{/* 房屋信息和位置 */}
{
(hasHouseInfo || hasAddress) &&
{/* 房屋信息 */}
{
hasHouseInfo &&
{
homeicName &&
{homeicName}
}
{
area &&
{area}㎡
}
{
styleName &&
{styleName}
}
{
(price && !hidePrice) &&
{price}万元
}
{
(price && hidePrice) &&
装修费用
}
}
{/* 位置 */}
{
hasAddress &&
{province ? province : 'ddd'}
{(city && city !== '市辖区') ? ' | ' + city : ''}
{county ? ' | ' + county : ''}
{xiaoqu ? ' | ' + xiaoqu : ''}
}
}
)
}
}
export default Index as ComponentClass